Abstract
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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
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.
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.
F. Bourdoncle. Efficient chaotic iteration strategies with widenings. In Formal Methods in Programming and their Applications, volume 735 of Springer-Verlag Lecture Notes in Computer Science, pages 123–141, 1993.
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.
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/.
F. Bueno, M. G. de la Banda, and M. Hermenegildo. Effectiveness of Abstract Interpretation in Automatic Parallelization: A Case Study in Logic Programming. ACM Transactions on Programming Languages and Systems, 21(2):189–238, March 1999.
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.
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.
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.
M. Codish. Efficient goal directed bottom-up evaluation of logic programs. Journal of Logic Programming, 38(3):355–370, 1999.
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.
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.
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.
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.
S. Debray and R. Ramakrishnan. Abstract Interpretation of Logic Programs Using Magic Transformations. Journal of Logic Programming, 18:149–176, 1994.
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.
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.
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.
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.
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.
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.
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.
M. Hermenegildo, G. Puebla, K. Marriott, and P. Stuckey. Incremental Analysis of Constraint Logic Programs. ACM Transactions on Programming Languages and Systems, 22(2):187–223, March 2000.
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.
G. Janssens and M. Bruynooghe. Deriving descriptions of possible values of program variables by means of abstract interpretation. Journal of Logic Programming, 13(2–3):205–258, July 1992.
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.
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.
D. Kozen. Set constraints and logic programming. Information and Computation, 143(1):2–25, 1998.
J. Lloyd. Foundations of Logic Programming: 2nd Edition. Springer-Verlag, 1987.
P. Mildner. Type Domains for Abstract Interpretation: A Critical Study. PhD thesis, Department of Computer Science, Uppsala University, 1999.
K. Muthukumar and M. Hermenegildo. Compile-time Derivation of Variable Dependency Using Abstract Interpretation. Journal of Logic Programming, 13(2 and 3):315–347, July 1992.
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.
J. C. Reynolds. Automatic construction of data set definitions. In J. Morrell, editor, Information Processing 68, pages 456–461. North-Holland, 1969.
P. Van Hentenryck, A. Cortesi, and B. Le Charlier. Type analysis of prolog using type graphs. Journal of Logic Programming, 22(3):179–210, 1994.
P. Van Roy and A. M. Despain. High-performance logic programming with the Aquarius Prolog compiler. IEEE Computer, 25(1):54–68, 1992.
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.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2002 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Gallagher, J.P., Puebla, G. (2002). Abstract Interpretation over Non-deterministic Finite Tree Automata for Set-Based Analysis of Logic Programs. In: Krishnamurthi, S., Ramakrishnan, C.R. (eds) Practical Aspects of Declarative Languages. PADL 2002. Lecture Notes in Computer Science, vol 2257. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45587-6_16
Download citation
DOI: https://doi.org/10.1007/3-540-45587-6_16
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-43092-6
Online ISBN: 978-3-540-45587-5
eBook Packages: Springer Book Archive