Abstract Interpretation over Non-deterministic Finite Tree Automata for Set-Based Analysis of Logic Programs
Set-based program analysis has many potential applications, including compiler optimisations, type-checking, debugging, verification and planning. One method of set-based analysis is to solve a set of set constraints derived directly from the program text. Another approach is based on abstract interpretation (with widening) over an infinite-height domain of regular types. Up till now only deterministic types have been used in abstract interpretations, whereas solving set constraints yields non-deterministic types, which are more precise. It was pointed out by Cousot and Cousot that set constraint analysis of a particular program P could be understood as an abstract interpretation over a finite domain of regular tree grammars, constructed from P. In this paper we define such an abstract interpretation for logic programs, formulated over a domain of non-deterministic finite tree automata, and describe its implementation. Both goal-dependent and goal-independent analysis are considered. Variations on the abstract domains operations are introduced, and we discuss the associated tradeoffs of precision and complexity. The experimental results indicate that this approach is a practical way of achieving the precision of set-constraints in the abstract interpretation framework.
KeywordsLogic Program Function Symbol Abstract Interpretation Abstract Domain Tree Automaton
Unable to display preview. Download preview PDF.
- 1.A. Aiken. Set constraints: Results, applications, and future directions. In A. Borning, editor, Principles and Practice of Constraint Programming (PPCP 1994), volume 874 of Springer-Verlag Lecture Notes in Computer Science, pages 326–335. Springer Verlag, 1994.Google Scholar
- 2.A. Aiken and E. L. Wimmers. Solving systems of set constraints (extended abstract). In IEEE Symposium on Logic in Computer Science (LICS 1992), pages 329–340, 1992.Google Scholar
- 4.M. Bruynooghe, H. Vandecasteele, D. A. de Waal, and M. Denecker. Detecting unsolvable queries for definite logic programs. Journal of Functional and Logic Programming, Special Issue 2, 1999.Google Scholar
- 5.F. Bueno, D. Cabeza, M. Carro, M. Hermenegildo, P. López-García, and G. Puebla. The Ciao prolog system. reference manual. Technical Report CLIP3/97. 1, School of Computer Science, Technical University of Madrid (UPM), August 1997. Available from http://www.clip.dia...upm.es/.
- 7.W. Charatonik and A. Podelski. Directional type inference for logic programs. In G. Levi, editor, Proceedings of the International Symposium on Static Analysis (SAS’98), Pisa, September 14-16, 1998, volume 1503 of Springer LNCS, pages 278–294. Springer-Verlag, 1998.Google Scholar
- 8.W. Charatonik and A. Podelski. Set-based analysis of reactive infinite-state systems. In B. Steffen, editor, Proc. of TACAS’98, Tools and Algorithms for Construction and Analysis of Systems, 4th International Conference, TACAS’ 98, volume 1384 of Springer-Verlag Lecture Notes in Computer Science, 1998.CrossRefGoogle Scholar
- 9.W. Charatonik, A. Podelski, and J.-M. Talbot. Paths vs. trees in set-based program analysis. In T. Reps, editor, Proceedings of POPL’00: Principles of Programming Languages, pages 330–338. ACM, ACM Press, January 2000.Google Scholar
- 11.M. Codish and B. Demoen. Analysing logic programs using “Prop”-ositional logic programs and a magic wand. In D. Miller, editor, Proceedings of the 1993 International Symposium on Logic Programming, Vancouver. MIT Press, 1993.Google Scholar
- 12.H. Comon, M. Dauchet, R. Gilleron, F. Jacquemard, D. Lugiez, S. Tison, and M. Tommasi. Tree Automata Techniques and Applications. http://www.grappa.univ-lille3.fr/tata, 1999.
- 13.P. Cousot and R. Cousot. Formal language, grammar and set-constraint-based program analysis by abstract interpretation. In Proceedings of the Seventh ACM Conference on Functional Programming Languages and Computer Architecture, pages 170–181, La Jolla, California, 25-28 June 1995. ACM Press, New York, NY.Google Scholar
- 14.D. de Waal and J. Gallagher. The applicability of logic program analysis and transformation to theorem proving. In Proceedings of the 12th International Conference on Automated Deduction (CADE-12), Nancy, 1994.Google Scholar
- 16.T. Frühwirth, E. Shapiro, M. Vardi, and E. Yardeni. Logic programs as types for logic programs. In Proceedings of the IEEE Symposium on Logic in Computer Science, Amsterdam, July 1991.Google Scholar
- 17.J. Gallagher. A bottom-up analysis toolkit. In Proceedings of the Workshop on Analysis of Logic Languages (WAILL); Eilat, Israel; (also Technical Report CSTR-95-016, Department of Computer Science, University of Bristol, July 1995), June 1995.Google Scholar
- 18.J. Gallagher, D. Boulanger, and H. Sağlam. Practical model-based static analysis for definite logic programs. In J. W. Lloyd, editor, Proc. of International Logic Programming Symposium, pages 351–365, 1995.Google Scholar
- 19.J. Gallagher and D. de Waal. Fast and precise regular approximation of logic programs. In P. Van Hentenryck, editor, Proceedings of the International Conference on Logic Programming (ICLP’94), Santa Margherita Ligure, Italy. MI T Press, 1994.Google Scholar
- 20.J. P. Gallagher and J. C. Peralta. Using regular approximations for generalisation during partial evaluation. In Proceedings of the 2000 ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation (PEPM’2000), Boston, Mass., (ed. J. Lawall), pages 44–51. ACM Press, January 2000.Google Scholar
- 21.N. Heintze. Practical aspects of set based analysis. In K. Apt, editor, Proceedings of the Joint International Symposium and Conference on Logic Programming, pages 765–769. MIT Press, 1992.Google Scholar
- 22.N. Heintze and J. Jaffar. A Finite Presentation Theorem for Approximating Logic Programs. In Proceedings of the 17th Annual ACM Symposium on Principles of Programming Languages, San Francisco, pages 197–209. ACM Press, 1990.Google Scholar
- 24.M. V. Hermenegildo, F. Bueno, G. Puebla, and P. López. Program analysis, debugging, and optimization using the Ciao system preprocessor. In D. De Schreye, editor, Proceedings of ICLP 1999: International Conference on Logic Programming, Las Cruces, New Mexico, USA, pages 52–66. MIT Press, 1999.Google Scholar
- 26.N. Jones. Flow analysis of lazy higher order functional programs. In S. Abramsky and C. Hankin, editors, Abstract Interpretation of Declarative Languages. Ellis-Horwood, 1987.Google Scholar
- 27.N. D. Jones and S. S. Muchnick. A flexible approach to interprocedural data flow analysis and programs with recursive data structures. In Conference Record of the Ninth Symposium on Principles of Programming Languages, pages 66–74. ACM Press, 1982.Google Scholar
- 29.J. Lloyd. Foundations of Logic Programming: 2nd Edition. Springer-Verlag, 1987.Google Scholar
- 30.P. Mildner. Type Domains for Abstract Interpretation: A Critical Study. PhD thesis, Department of Computer Science, Uppsala University, 1999.Google Scholar
- 32.A. Podelski, W. Charatonik, and M. Müller. Set-based failure analysis for logic programs and concurrent constraint programs. In S. D. Swierstra, editor, Programming Languages and Systems, 8th European Symposium on Programming, ESOP’99, volume 1576 of LNCS, pages 177–192. Springer-Verlag, 1999.CrossRefGoogle Scholar
- 33.J. C. Reynolds. Automatic construction of data set definitions. In J. Morrell, editor, Information Processing 68, pages 456–461. North-Holland, 1969.Google Scholar
- 35.P. Van Roy and A. M. Despain. High-performance logic programming with the Aquarius Prolog compiler. IEEE Computer, 25(1):54–68, 1992.Google Scholar
- 36.J. Wunderwald. Memoing evaluation by source-to-source transformation. In M. Proietti, editor, Logic Program Synthesis and Transformation (LOPSTR’95), volume 1048 of Springer-Verlag Lecture Notes in Computer Science, pages 17–32, 1995.Google Scholar