Improving the static analysis of embedded languages via partial evaluation

Programs in embedded languages contain invariants that are not automatically detected or enforced by their host language. We show how to use macros to easily implement partial evaluation of embedded interpreters in order to capture invariants encoded in embedded programs and render them explicit in the terms of their host language. We demonstrate the effectiveness of this technique in improving the results of a value flow analysis.

[1]  Matthias Felleisen,et al.  Componential set-based analysis , 1997, TOPL.

[2]  Jens Palsberg,et al.  Closure analysis in constraint form , 1995, TOPL.

[3]  Guy L. Steele,et al.  Common Lisp the Language , 1984 .

[4]  Brian W. Kernighan,et al.  The C Programming Language , 1978 .

[5]  Gerald J. Sussman,et al.  Structure and interpretation of computer programs , 1985, Proceedings of the IEEE.

[6]  Matthias Felleisen,et al.  DrScheme: a programming environment for Scheme , 2002, J. Funct. Program..

[7]  Ralf Hinze Formatting: a class act , 2003, J. Funct. Program..

[8]  Olivier Danvy Functional Unparsing , 1998, J. Funct. Program..

[9]  Pierre Weis,et al.  Bigloo: A Portable and Optimizing Compiler for Strict Functional Languages , 1995, SAS.

[10]  Peter Thiemann,et al.  Functional logic overloading , 2002, POPL '02.

[11]  Paul Hudak,et al.  Modular domain specific languages and tools , 1998, Proceedings. Fifth International Conference on Software Reuse (Cat. No.98TB100203).

[12]  Oege de Moor,et al.  Compiling embedded languages , 2003, J. Funct. Program..

[13]  Robert Hieb,et al.  Revised 5 Report on the Algorithmic Language , 1999 .

[14]  Alexander Aiken,et al.  Introduction to Set Constraint-Based Program Analysis , 1999, Sci. Comput. Program..

[15]  Samuel N. Kamin Research on Domain-specific Embedded Languages and Program Generators , 1997, US-Brazil Joint Workshops on the Formal Foundations of Software Systems.

[16]  D. H. Bartley,et al.  Revised4 report on the algorithmic language scheme , 1991, LIPO.

[17]  Bernard Sufrin Abstract interpretation of domain-specific embedded languages , 2002 .

[18]  R. Kent Dybvig,et al.  Revised5 Report on the Algorithmic Language Scheme , 1986, SIGP.

[19]  Ken Arnold,et al.  The Java Programming Language , 1996 .

[20]  Nevin Charles Heintze,et al.  Set based program analysis , 1992 .

[21]  Ken Arnold,et al.  Java(TM) Programming Language, The (4th Edition) , 2005 .

[22]  Joyce Farrell Java Programming , 1999 .

[23]  Xavier Leroy The objective caml system release 3 , 2001 .

[24]  Todd L. Veldhuizen C++ Templates as Partial Evaluation , 1999, PEPM.

[25]  Noel Welsh,et al.  SchemeUnit and SchemeQL: Two Little Languages , 2002 .

[26]  Matthias Felleisen,et al.  Programming the Web with High-Level Programming Languages , 2001, ESOP.

[27]  Matthew Flatt Composable and compilable macros:: you want it when? , 2002, ICFP '02.

[28]  Olin Shivers A Universal Scripting Framework or Lambda: The Ultimate "Little Language" , 1996, ASIAN.

[29]  Lennart Augustsson,et al.  Cayenne—a language with dependent types , 1998, ICFP '98.