• Title/Summary/Keyword: 지연 함수형 언어

Search Result 7, Processing Time 0.02 seconds

Design and Implementation of a Lazy Functinal Language Compiler for Java Virtual Machine (자바가상기계를 대상으로 하는 지연계산기반 함수형 언어 컴파일러의 설계 및 구현)

  • 최광훈;임현일;한태숙
    • Proceedings of the Korean Information Science Society Conference
    • /
    • 2000.10a
    • /
    • pp.326-328
    • /
    • 2000
  • 본 논문에서는 지연계산기반 함수형 언어 프로그램을 받아 Java 프로그램을 목적 코드로 생성하는 컴파일러를 설계하고 구현한다. 이 컴파일러는 제한된 형태의 함수형 언어 Shared Term Graph(STG)를 입력언어로 하는 추상기계 Spineless Tagiess G-Machine (STGM)을 수행 모델로 한다. 본 논문에서는 명령형 언어 L-code를 제안하고 이를 입력언어로 하는 새로운 형태의 STGM인 L-Machine을 제안한다. STG 언어를 L-code로 변환하는 컴파일러와 L-code를 Java로 변환하는 컴파일러를 설계하고 구현함으로써 원하는 컴파일러를 구성한다. 그리고 Glasgow Haskell 컴파일러를 전단부로 하여 지연계산 기반 함수형 언어 Haskell로 작성된 프로그램들을 컴파일하여 STG 프로그램으로 변환한 다음 본 논문에서 구현한 컴파일러로 이를 Java 프로그램으로 변환한다. 변환된 Java 프로그램을 Sun JIT 컴파일러로 컴파일하여 수행한 성능 평가 결과를 제시한다.

  • PDF

Term Rewriting Semantics of Lazy Functional Programming Languages (지연 함수형 프로그래밍 언어의 항 개서 의미)

  • Byun, Sug-Woo
    • Journal of KIISE:Computer Systems and Theory
    • /
    • v.35 no.3
    • /
    • pp.141-149
    • /
    • 2008
  • Most functional programming languages allows programmers to write ambiguous rules, under the strategy that pattern-matching will be performed in a direction of 'from top to bottom' way. While providing programmers with convenience and intuitive understanding of defining default rules, such ambiguous rules may make the semantics of functional languages unclear. More specifically, it may fail to apply the equational reasoning, one of most significant advantage of functional programming, and may cause to obscure finding a formal way of translating functional languages into the ${\lambda}$-calculus; as a result, we only get an ad hoc translation. In this paper, we associate with separability of term rewriting systems, holding purely-declarative property, pattern-matching semantics of lazy functional languages. Separability can serve a formalism for translating lazy functional languages into the ${\lambda}$-calculus.

Compiling Lazy Functional Programs to Java on the basis of Spineless Taxless G-Machine with Eval-Apply Model (Eval-Apply 모델의 STGM에 기반하여 지연 계산 함수형 프로그램을 자바로 컴파일하는 기법)

  • Nam, Byeong-Gyu;Choi, Kwang-Hoon;Han, Tai-Sook
    • Journal of KIISE:Software and Applications
    • /
    • v.29 no.5
    • /
    • pp.326-335
    • /
    • 2002
  • Recently there have been a number of researches to provide code mobility to lazy functional language (LFL) programs by translating LFL programs to Java programs. These approaches are basically baled on architectural similarities between abstract machines of LFLs and Java. The abstract machines of LFLs and Java programming language, Spineless Tagless G-Machine(STGM) and Java Virtual Machine(JVM) respectively, share important common features such as built- in garbage collector and stack machine architecture. Thus, we can provide code mobility to LFLs by translating LFLs to Java utilizing these common features. In this paper, we propose a new translation scheme which fully utilizes architectural common features between STGM and JVM. By redefining STGM as an eval-apply evaluation model, we have defined a new translation scheme which utilizes Java Virtual Machine Stack for function evaluation and totally eliminates stack simulation which causes array manipulation overhead in Java. Benchmark program translated to Java programs by our translation scheme run faster on JDK 1.3 than those translated by the previous schemes.

Exception Handling Technique in Lazy Functional Language from the Viewpoint of Program Synthesis (프로그램 합성 관점에서 지연 함수형 언어의 예외처리 기법)

  • Lee, Dong-Ju;Woo, Gyun
    • Proceedings of the Korean Information Science Society Conference
    • /
    • 2006.10b
    • /
    • pp.586-589
    • /
    • 2006
  • 순수 함수형 언어에서 예외처리를 구현하는 것은 매우 까다로운 문제이다. 지연계산, 참조투명성과 같은 주요 특징은 예외 처리와 상반된 성질을 가지는 때문이다. 예외의 처리순서는 계산순서와 관계가 있고, 예외의 발생순서는 참조투명성과 밀접한 관계가 있다. 본 논문은 현재 하스켈(Haskell)에서 구현된 예외처리 방법의 분석을 통해, 프로그램 수행 시 효율적인 예외처리 방법에 대해서 제시한다. 합성된 프로그램에서 예외 발생할 때 예외가 전달되는 것을 사전에 차단하는 방법을 이용한다. 실제 예외가 발생한 프로그램을 작성하고, 프로파일링을 통하여 이 방법의 효율성을 점검한다.

  • PDF

Execution of a functional Logic language using the Dataflow Graph Representation (데이터플로우 그래프 표현 방식을 이용한 함수 논리 언어의 실행)

  • Kim, Yong-Jun;Cheon, Suh-Hyun
    • The Transactions of the Korea Information Processing Society
    • /
    • v.5 no.9
    • /
    • pp.2435-2446
    • /
    • 1998
  • In this paper. We describe a dataflow model for efficient execution of a functional logic language and a method of translation a functional logic language into a dataflow graph. To explore parallelism and intelligent backtracking, we us model in which clause and function are represented as independent dataflow graph. The node denotes basic actions to be performed when the clause and function are executed. The dataflow mechanism allows an operation to be executed as soon as all its operands are available. Since the operations can never be executed earlier, a dataflow model is an excellent base for increasing execution speed. We did decrease a delay time with concurrent execution of dependency analysis and subgoal.

  • PDF

Compressing the Graphis in G-machine by Tag-Forwarding (태그 옮기기에 의한 G-machine 그래프의 압축)

  • U, Gyun;Han, Tae-Suk
    • Journal of KIISE:Software and Applications
    • /
    • v.26 no.5
    • /
    • pp.702-712
    • /
    • 1999
  • 지연 함수형 언어를 효율적으로 구현하기 위한 한 방법으로 G-machine이 제안되었다. G-machine은 그래프 축약을 빠르게 수행하지만, 축약 과정의 그래프를 저장하기 위해 많은 기억장소를 필요로 한다. 이는 그래프 축약 방법자체의 문제점으로 생각된다. 이 논문에서는 그래프 노드의 태그를 옮김으로써 기억장소의 그래프 구조를 압축할수 있는 방법을 제안한다. 노드의 태그는 그 노드를 가리키는 포인터 자리로 옮겨지는데, 포인터 정보의 유지하기 위해 상대주소와 합쳐져 함께 옮겨진다. 태그 옮기기는 그래프 구성 노드를 힙에 동시에 할당할수 있을 때 가능하다. 그러나, 일반적으로 그래프의 일부가 전체 그래프가 생성되기 이전에 생성될 수 있으므로, 이러한 태그 옮기기가 항상 가능한 것은 아니다. 그렇지만, 태그 옮기기에 의해서 어느 정도의 힙 사용량을 줄일 수있다. 태그 옮기기에 의해 그래프를 압축했을 때 압축된 그래프를 해석하기위한 수행시간의 부담이 생기게 되는데, 이 부담정도를 알아보기 위해 몇몇 작은 프로그램에 대해서 실험결과를 보였다. 실험결과에 따르면, 태그 옮기기를 수행한 결과, 총 힙 사용량은 평균 약 305 감소하였고, 이로 인한 수행시간은 원래의 G-machine과 비슷한 수준인 것으로 나타났다.

Reusing AP Node in G-machine (G-machine 에서의 AP 노드 재사용)

  • Joo, Sung-Yong;Woo, Gyun
    • Proceedings of the Korea Information Processing Society Conference
    • /
    • 2002.11c
    • /
    • pp.2329-2332
    • /
    • 2002
  • G-machine은 지연 함수형 언어를 효율적으로 구현하기 위한 추상기계이다. G-machine은 축약 과정에서 생성되는 그래프를 저장하기 위해서 많은 기억장소를 필요로 한다. 본 논문은 힙에 할당되는 그래프 노드 중 AP 노드를 재사용하는 방법을 제시한다. 일반적으로 AP 노드를 루트로 하는 그래프가 한 단계 축약된 후 다시 AP 노드를 루트로 하는 그래프로 구성되어지는 경우 루트 노드를 재사용할 수 있다. 이를 위해서는 기존 G-machine을 약간 확장 시켜야 하는데, 본 논문에서는 AP 노드의 일부를 변경하기 위한 명령어 UPDL과 UPDR을 제시하고, 이들 명령어의 상태변환 규칙과 이들 명령어 생성을 위해 수정된 R-변환 규칙을 제시한다. 본 논문에서 제시하는 방식으로 기 생성된 AP 노드를 재사용함으로써 힙 기억공간의 사용량을 줄일 수 있고, 이 과정에서 힙 기억장소 할당과 쓰기 연산의 수를 줄일 수 있다.

  • PDF