Term Rewriting Semantics of Lazy Functional Programming Languages

지연 함수형 프로그래밍 언어의 항 개서 의미

  • 변석우 (경성대학교 컴퓨터정보학부)
  • Published : 2008.04.15

Abstract

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.

대부분의 함수형 프로그래밍 언어에서는 '위에서 아래쪽, 왼쪽에서 오른쪽 방향으로' 패턴 매칭(pattern matching)을 한다는 전략에 따라, 모호한(ambiguous) 특성을 갖는 룰의 정의를 허용하고 있다. 이 방법은 함수형 프로그래머에게 디폴트 룰을 정의할 수 있게 하는 직관적인 편리함을 제공하지만, 한편으로 모호한 룰 때문에 함수형 언어의 의미는 불명확해 질 수 있다. 좀 더 구체적으로, 함수형 언어가 갖는 대표적인 특성인 등식 추론(equational reasoning) 원리의 적용을 불가능하게 할 수 있으며, 함수형 언어를 람다 계산법으로 변환하는 데 있어서도 정형적인 방법이 아닌 임시방편적인(ad hoc) 방법에 의존할 수밖에 없게 한다. 본 연구에서는 지연(lazy) 함수형 언어의 패턴 매칭의 의미를 순수 선언적 특성을 갖는 항 개서 시스템(Term Rewriting Systems)의 분리성(separability) 이론과 연관시키고, 분리성 이론에 따라 지연 함수형 언어가 람다 계산법으로 변환될 수 있음을 보인다.

Keywords

References

  1. Richard Kennaway, The Specificity Rule for Lazy Pattern-Matching in Ambiguous Term Rewriting Systems. ESOP '90, Lecture Notes in Computer Science No. 432, Springer-Verlag, 1990
  2. Simon L. Peyton Jones, The Implementation of Functional Programming Languages. Prentice-Hall, 1987
  3. Simon Thompson, The Craft of Functional Programming, 2nd Edition. Addison-Wesley, 1999
  4. J.W. Klop, Term rewriting systems. In Abramsky et al., editors, Handbook of Logic in Computer Science, volume II. Oxford University Press, 1992
  5. H. Barendregt, The Lambda Calculus: Its Syntax and Semantics. North-Holland, 1984
  6. G. Huet and J.-J. Lèvy, Computations in Orthogonal Rewrite Systems I and II. In Lassez and Plotkin, eds., Computational Logic: Essay in Honor of Alan Robinson, MIT Press 1991. (Originally appeared as Technical Report 359, INRIA, 1979.)
  7. G. Berry. Sequentialite de l'evaluation formelle des ${\lambda}-expressions,$ in Proc. 3-e Colloque International sur la Programmation, Paris, 1978
  8. 변석우, 분리가능 시스템의 지수 추이성과 변환. 정보과학회 논문지: 소프트웨어 및 응용, 제31권 제5호, 659-666쪽, 2004년 5월
  9. S. Byun, J.R. Kennaway, and R. Sleep, Lambda- definable Term Rewriting Systems, Lecture Notes in Computer Science 1023, pp. 106-115, Springer- Verlag, 1996
  10. C. Bohm, Alcune proprieta delle forme ${\beta}-{\eta}-normali$ nel ${\lambda}-K-calcolo.$ IAC Pubbl., 696:19, 1968
  11. A. Laville, Lazy pattern matchingin the ML programming. INRIA report 663, 1987
  12. Y. Toyama, S. Smesters M. van Eekelen, and R. Plasmeijer, The Functional Strategy and Transitive Term Rewriting Systems. In (eds. Sleep, Plasmeijer, and van Eekelen) Term Graph Rewriting, John Wiley and Sons Ltd. 1993