Improved Functional Flow and Reachability Analyses Using Indexed Linear Tree Grammars

The collecting semantics of a program defines the strongest static property of interest. We study the analysis of the collecting semantics of higher-order functional programs, cast as left-linear term rewriting systems. The analysis generalises functional flow analysis and the reachability problem for term rewriting systems, which are both undecidable. We present an algorithm that uses indexed linear tree grammars (ILTGs) both to describe the input set and compute the set that approximates the collecting semantics. ILTGs are equi-expressive with pushdown tree automata, and so, strictly more expressive than regular tree grammars. Our result can be seen as a refinement of Jones and Andersen's procedure, which uses regular tree grammars. The main technical innovation of our algorithm is the use of indices to capture (sets of) substitutions, thus enabling a more precise binding analysis than afforded by regular grammars. We give a simple proof of termination and soundness, and demonstrate that our method is more accurate than other approaches to functional flow and reachability analyses in the literature.

[1]  Neil D. Jones,et al.  Flow analysis of lazy higher-order functional programs , 2007, Theor. Comput. Sci..

[2]  Thomas Genet,et al.  Decidable Approximations of Sets of Descendants and Sets of Normal Forms , 1998, RTA.

[3]  C.-H. Luke Ong,et al.  On Model-Checking Trees Generated by Higher-Order Recursion Schemes , 2006, 21st Annual IEEE Symposium on Logic in Computer Science (LICS'06).

[4]  Olga Kouchnarenko,et al.  Finer Is Better: Abstraction Refinement for Rewriting Approximations , 2008, RTA.

[5]  Patrick Cousot,et al.  Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints , 1977, POPL.

[6]  Florent Jacquemard,et al.  Decidable Approximations of Term Rewriting Systems , 1996, RTA.

[7]  Helmut Seidl,et al.  XML type checking with macro tree transducers , 2005, PODS.

[8]  Joost Engelfriet,et al.  Pushdown Machines for the Macro Tree Transducer , 1986, Theor. Comput. Sci..

[9]  Sophie Tison,et al.  Regular Tree Languages and Rewrite Systems , 1995, Fundam. Informaticae.

[10]  Irène Guessarian,et al.  Pushdown tree automata , 1983, Mathematical systems theory.

[11]  Valérie Viet Triem Tong,et al.  Reachability Analysis over Term Rewriting Systems , 2004, Journal of Automated Reasoning.

[12]  Alfred V. Aho Indexed Grammars-An Extension of Context Free Grammars , 1967, SWAT.

[13]  John C. Reynolds,et al.  Definitional Interpreters for Higher-Order Programming Languages , 1972, ACM '72.

[14]  Naoki Kobayashi,et al.  Verification of Tree-Processing Programs via Higher-Order Model Checking , 2010, APLAS.

[15]  Naoki Kobayashi,et al.  Higher-order multi-parameter tree transducers and recursion schemes for program verification , 2010, POPL '10.

[16]  Helmut Seidl,et al.  Exact XML Type Checking in Polynomial Time , 2007, ICDT.

[17]  C.-H. Luke Ong,et al.  Verifying higher-order functional programs with pattern-matching algebraic data types , 2011, POPL '11.

[18]  C.-H. Luke Ong Models of Higher-Order Computation: Recursion Schemes and Collapsible Pushdown Automata , 2010, Logics and Languages for Reliability and Security.