A Semantic Account of Type-Directed Partial Evaluation

We formally characterize partial evaluation of functional programs as a normalization problem in an equational theory, and derive a type-based normalization-by-evaluation algorithm for computing normal forms in this setting. We then establish the correctness of this algorithm using a semantic argument based on Kripke logical relations. For simplicity, the results are stated for a non-strict, purely functional language; but the methods are directly applicable to stating and proving correctness of type-directed partial evaluation in ML-like languages as well.

[1]  Olivier Danvy,et al.  Semantics-Based Compiling: A Case Study in Type-Directed Partial Evaluation , 1996, PLILP.

[2]  Ulrich Berger,et al.  Program Extraction from Normalization Proofs , 2006, Stud Logica.

[3]  Ulrich Berger,et al.  An inverse of the evaluation functional for typed lambda -calculus , 1991, [1991] Proceedings Sixth Annual IEEE Symposium on Logic in Computer Science.

[4]  G.D. Plotkin,et al.  LCF Considered as a Programming Language , 1977, Theor. Comput. Sci..

[5]  Samuel N. Kamin,et al.  Modular compilers based on monad transformers , 1998, Proceedings of the 1998 International Conference on Computer Languages (Cat. No.98CB36225).

[6]  Zhe Yang,et al.  Encoding types in ML-like languages , 1998, ICFP '98.

[7]  Ulrich Kohlenbach On the Uniform Weak König’s Lemma , 1999 .

[8]  Christian N. S. Pedersen,et al.  Protein Folding in the 2D HP Model , 1999 .

[9]  Peter Sestoft,et al.  Partial evaluation and automatic program generation , 1993, Prentice Hall international series in computer science.

[10]  Olivier Danvy,et al.  Type-directed partial evaluation , 1995, POPL '96.

[11]  Peter Thiemann,et al.  Two Flavors of Offline Partial Evaluation , 1998, ASIAN.

[12]  Andrzej Filinski,et al.  Representing monads , 1994, POPL '94.

[13]  Walid Taha,et al.  An Idealized MetaML: Simpler, and More Expressive , 1999, ESOP.

[14]  Olivier Danvy Online Type-Directed Partial Evaluation , 1998, Fuji International Symposium on Functional and Logic Programming.

[15]  Eugenio Moggi,et al.  Computational lambda-calculus and monads , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[16]  Christian N. S. Pedersen,et al.  An Improved Algorithm for RNA Secondary Structure Prediction , 1999 .

[17]  Rasmus Pagh Hash and Displace: Efficient Evaluation of Minimal Perfect Hash Functions , 1999, WADS.

[18]  Thierry Coquand,et al.  Intuitionistic model constructions and normalization proofs , 1997, Mathematical Structures in Computer Science.

[19]  Glynn Winskel,et al.  Weak bisimulation and open maps , 1999, Proceedings. 14th Symposium on Logic in Computer Science (Cat. No. PR00158).

[20]  Jens Stoye,et al.  Finding Maximal Pairs with Bounded Gap , 1999, CPM.