• Title/Summary/Keyword: 자유변수 없애기

Search Result 2, Processing Time 0.015 seconds

Closed-code-conversion: Transforming Open Code Multi-staged Programs into Closed Ones (다단계 프로그램에서 프로그램 생성 단계의 자유변수 제거)

  • Eo, Hyun-Jun;Yi, Kwang-Keun
    • Journal of KIISE:Software and Applications
    • /
    • v.36 no.3
    • /
    • pp.244-251
    • /
    • 2009
  • We present a transformation which converts open-code multi-staged programs into closed ones. Staged computation, which explicitly divides a computation into separate stages, is a unifying framework for existing program generation systems. Because a multi-staged program generates another program, which can also generate a third program and on, the implementation of a multi-staged language is not straightforward. Dynamic binding of (lexically free) variables in code also makes the implementation of a multi-staged language hard. By converting each code into code of function which takes environment for free variables as its argument and giving an actual environment at the code-composition site, we can transform a open-code program into a closed-code one. Combining with Davies and Pfenning's method, our closed-code-conversion enables the implementation of the unstaged language to be useful for executing multi-staged programs. We also prove the correctness of our conversion: the converted program is equivalent to the original program, and the converted program does not have open code.