Abstract
We give an introduction to the meta-circular approach to the abstract interpretation of logic programs. This approach is particularly useful for prototyping and for introductory classes on abstract interpretation. Using interpreters, students can immediately write, adapt, and experiment with interpreters and working dataflow analysers. We use a simple meta-circular interpreter, based on a “non-ground T P” semantics, as a generic analysis engine. Instantiating the engine is a matter of providing an appropriate domain of approximations, together with definitions of “abstract” unification and disjunction. Small changes of the interpreter let us vary both what can be “observed” by an analyser, and how fixed point computation is done. Amongst the dataflow analyses used to exemplify this approach are a parity analysis, groundness dependency analysis, call patterns, depth-k analysis, and a “pattern” analysis to establish most specific generalisations of calls and success sets.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
S. Abramsky and C. Hankin. Abstract Interpretation of Declarative Languages. Ellis Horwood, 1987.
F. Baader and J. Siekmann. Unification theory. In D. Gabbay, C. Hogger, and J. Robinson, editors, Handbook of Logic in Artificial Intelligence and Logic Programming, volume 2, pages 41–126. Oxford University Press, 1994.
R. Bagnara. China: A data-flow analyzer for CLP languages. Survey at URL http://www.cs.unipr.it/China/, 19 February 2001.
F. Bancilhon, D. Maier, Y. Sagiv, and J. Ullman. Magic sets and other strange ways to implement logic programs. In Proc. Fifth ACM SIGMOD/SIGACT Symp. Principles of Database Systems, pages 1–15. ACMPress, 1986.
R. Barbuti, R. Giacobazzi, and G. Levi. A general framework for semantics-based abstract interpretation. ACM Transactions on Programming Languages, 15(1):133–181, 1993.
A. Bossi, M. Gabbrielli, G. Levi, and M. Martelli. The s-semantics approach: Theory and applications. Journal of Logic Programming, 19&20:149–197, 1994.
D. Boulanger, M. Bruynooghe, and M. Denecker. Abstracting s-semantics using a model-theoretic approach. In M. Hermenegildo and J. Penjam, editors, Programming Language Implementation and Logic Programming: Proc. Sixth Int. Symp., volume 844 of Lecture Notes in Computer Science, pages 432–446. Springer-Verlag, 1994.
M. Bruynooghe. A practical framework for the abstract interpretation of logic programs. Journal of Logic Programming, 10(2):91–124, 1991.
M. Bruynooghe, B. Demoen, D. Boulanger, M. Denecker, and A. Mulkers. A freeness and sharing analysis of logic programs based on a pre-interpretation. In R. Cousot and D. A. Schmidt, editors, Static Analysis: Proc. Third Int. Symp., volume 1145 of Lecture Notes in Computer Science, pages 128–142. Springer-Verlag, 1996.
M. Bruynooghe, G. Janssens, A. Callebaut, and B. Demoen. Abstract interpretation: Towards the global optimisation of Prolog programs. In Proc. 1987 Symp. Logic Programming, pages 192–204. IEEE Comp. Soc., 1987.
M. Codish. Efficient goal directed bottom-up evaluation of logic programs. Journal of Logic Programming, 38(3):355–370, 1999.
M. Codish, D. Dams, and E. Yardeni. Bottom-up abstract interpretation of logic programs. Theoretical Computer Science, 124(1):93–125, 1994.
M. Codish and B. Demoen. Deriving polymorphic type dependencies for logic programs using multiple incarnations of Prop. In P. Van Hentenryck, editor, Static Analysis: Proc. First Int. Symp., volume 864 of Lecture Notes in Computer Science, pages 281–296. Springer-Verlag, 1994.
M. Codish and B. Demoen. Analysing logic programs using “Prop”-ositional logic programs and a magic wand. Journal of Logic Programming, 25(3):249–274, 1995.
M. Codish, B. Demoen, and K. Sagonas. Semantics-based program analysis for logic-based languages using XSB. Springer Int. Journal of Software Tools for Technology Transfer, 2(1):29–45, 1998.
M. Codish and V. Lagoon. Type dependencies for logic programs using ACI unification. Theoretical Computer Science, 238:131–159, 2000.
M. Codish, V. Lagoon, and F. Bueno. An algebraic approach to sharing analysis of logic programs. Journal of Logic Programming, 41(2):110–149, 2000.
M. Codish, K. Marriott, and C. Taboch. Improving program analyses by structure untupling. Journal of Logic Programming, 43(3):251–263, 2000.
M. Codish and H. Søndergaard. Meta-circular abstract interpretation in Prolog. http://www.cs.bgu.ac.il/~mcodish/Tutorial/, 11 June 2001.
M. Codish, H. Søndergaard, and P. J. Stuckey. Sharing and groundness dependencies in logic programs. ACM Transactions on Programming Languages and Systems, 21(5):948–976, 1999.
M.-M. Corsini, K. Musumbu, A. Rauzy, and B. Le Charlier. Efficient bottomup abstract interpretation of Prolog by means of constraint solving over symbolic finite domains. In M. Bruynooghe and J. Penjam, editors, Programming Language Implementation and Logic Programming, volume 714 of Lecture Notes in Computer Science, pages 75–91. Springer-Verlag, 1993.
P. Cousot and R. Cousot. Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Proc. Fourth ACM Symp. Principles of Programming Languages, pages 238–252. ACM Press, 1977.
P. Cousot and R. Cousot. Systematic design of program analysis frameworks. In Proc. Sixth ACM Symp. Principles of Programming Languages, pages 269–282. ACM Press, 1979.
S. Dawson, R. Ramakrishnan, and D. S. Warren. Practical program analysis using general purpose logic programming systems: A case study. In Proc. ACM SIGPLAN 96 Conf. Programming Language Design and Implementation, pages 117–126. ACM Press, 1996.
S. K. Debray and D. S. Warren. Automatic mode inference for Prolog programs. In Proc. 1986 Symp. Logic Programming, pages 78–88. IEEE Comp. Soc., 1986.
M. Falaschi, G. Levi, M. Gabbrielli, and C. Palamidessi. A new declarative semantics for logic languages. In R. Kowalski and K. Bowen, editors, Logic Programming: Proc. Fifth Int. Conf. Symp., pages 993–1005. MIT Press, 1988.
M. Falaschi, G. Levi, M. Martelli, and C. Palamidessi. Declarative modeling of the operational behavior of logic languages. Theoretical Computer Science, 69(3):289–318, 1989.
M. Falaschi, G. Levi, M. Martelli, and C. Palamidessi. A model-theoretic reconstruction of the operational semantics of logic programs. Information and Computation, 103:86–113, 1993.
C. Fecht. Abstrakte Interpretation logischer Programme: Theorie, Implementierung, Generierung. PhD thesis, Universität des Saarlandes, Saarbrücken, Germany, 1997.
J. Gallagher, D. Boulanger, and H. Sağlam. Practical model-based static analysis for definite logic programs. In J. Lloyd, editor, Logic Programming: Proc. 1995 Int. Symp., pages 351–365. MIT Press, 1995.
J. Gallagher and D. de Waal. Deletion of redundant unary type predicates from logic programs. In K.-K. Lau and T. Clement, editors, Logic Program Synthesis and Transformation: Proc. LOPSTR 92, Workshops in Computing, pages 151–167. Springer-Verlag, 1993.
J. Gallagher and D. de Waal. Fast and precise regular approximations of logic programs. In P. Van Hentenryck, editor, Logic Programming: Proc. Eleventh Int. Conf., pages 599–613. MIT Press, 1994.
S. Genaim and M. Codish. The Def-inite approach to dependency analysis. In D. Sands, editor, Proc. Tenth European Symp. Programming, volume 2028 of Lecture Notes in Computer Science, pages 417–431. Springer-Verlag, 2001.
M. Hermenegildo, R. Warren, and S. K. Debray. Global flow analysis as a practical compilation tool. Journal of Logic Programming, 13(4):349–366, 1992.
J. Howe and A. King. Implementing groundness analysis with definite Boolean functions. In G. Smolka, editor, Programming Languages and Systems, volume 1782 of Lecture Notes in Computer Science, pages 200–214. Springer-Verlag, 2000.
N. D. Jones. Concerning the abstract interpretation of Prolog. Draft paper, DIKU, Copenhagen, 1985. Cited in Mellish [49].
N. D. Jones and A. Mycroft. Dataflow analysis of applicative programs using minimal function graphs. In Proc. Thirteenth ACM Symp. Principles of Programming Languages, pages 296–306. ACMPress, 1986.
N. D. Jones and H. Søndergaard. A semantics-based framework for the abstract interpretation of Prolog. In S. Abramsky and C. Hankin, editors, Abstract Interpretation of Declarative Languages, chapter 6, pages 123–142. Ellis Horwood, 1987.
A. Kelly, K. Marriott, H. Søndergaard, and P. Stuckey. A practical object-oriented analysis engine for constraint logic programs. Software-Practice and Experience, 28(2):199–224, 1998.
B. Le Charlier and P. Van Hentenryck. Experimental evaluation of a generic abstract interpretation algorithm for Prolog. ACM Transactions on Programming Languages and Systems, 16(1):35–101, 1994.
G. Levi and D. Ramundo. A formalization of metaprogramming for real. In D. S. Warren, editor, Logic Programming: Proc. Tenth Int. Conf., pages 354–373. MIT Press, 1993.
J. W. Lloyd. Foundations of Logic Programming. Springer-Verlag, Berlin, second edition, 1987.
M. J. Maher and R. Ramakrishnan. Déjà vu in fixpoints of logic programs. In E. Lusk and R. Overbeek, editors, Logic Programming: Proc. North American Conf. 1989, pages 963–980. MIT Press, 1989.
K. Marriott and H. Søndergaard. Bottom-up abstract interpretation of logic programs. In R. A. Kowalski and K. A. Bowen, editors, Logic Programming: Proc. Fifth Int. Conf. Symp., pages 733–748. MIT Press, 1988.
K. Marriott and H. Søndergaard. Semantics-based dataflow analysis of logic programs. In G. X. Ritter, editor, Information Processing 89, pages 601–606. North-Holland, 1989.
K. Marriott and H. Søndergaard. Bottom-up dataflow analysis of normal logic programs. Journal of Logic Programming, 13(2 & 3):181–204, 1992.
B. Martens and D. De Schreye. Why untyped nonground metaprogramming is not (much of) a problem. Journal of Logic Programming, 22(1):47–99, 1995.
C. S. Mellish. Some global optimizations for a Prolog compiler. Journal of Logic Programming, 2(1):43–66, 1985.
C. S. Mellish. Abstract interpretation of Prolog programs. In E. Shapiro, editor, Proc. Third Int. Conf. Logic Programming, volume 240 of Lecture Notes in Computer Science, pages 463–474. Springer-Verlag, 1986.
K. Muthukumar and M. Hermenegildo. Compile-time derivation of variable dependency using abstract interpretation. Journal of Logic Programming, 13(2&3):315–347, 1992.
A. Mycroft. Abstract Interpretation and Optimising Transformations for Applicative Programs. PhD thesis, University of Edinburgh, Scotland, 1981.
R. Ramakrishnan and J. Ullman. A survey of deductive database systems. Journal of Logic Programming, 23(2):125–149, 1995.
J. Reynolds. Transformational systems and the algebraic structure of atomic formulas. In B. Meltzer and D. Michie, editors, Machine Intelligence, volume 5, pages 135–152. 1970.
K. Sagonas, T. Swift, and D. S. Warren. XSB as an efficient deductive database engine. In Proc. ACM SIGMOD Int. Conf. Management of Data, pages 442–453. ACMPress, 1994.
T. Sato and H. Tamaki. Enumeration of success patterns in logic programs. Theoretical Computer Science, 34:227–240, 1984.
H. Søndergaard. An application of abstract interpretation of logic programs: Occur check reduction. In B. Robinet and R. Wilhelm, editors, Proc. ESOP 86, volume 213 of Lecture Notes in Computer Science, pages 327–338. Springer-Verlag, 1986.
L. Sterling and E. Shapiro. The Art of Prolog. MIT Press, second edition, 1994.
J. Ullman. Principles of Database and Knowledge-Base Systems. Computer Science Press, 1988.
M. van Emden and R. Kowalski. The semantics of logic as a programming language. Journal of the ACM, 23:733–742, 1976.
W. Winsborough. Automatic, Transparent Parallelization of Logic Programs at Compile Time. PhD thesis, University of Wisconsin-Madison, Wisconsin, 1988.
J. Wunderwald. Memoing evaluation by source-to-source transformation. In M. Proietti, editor, Logic Program Synthesis and Transformation, volume 1048 of Lecture Notes in Computer Science, pages 17–32. Springer-Verlag, 1995.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2002 Springer-Verlag Berlin Heidelberg
About this chapter
Cite this chapter
Codish, M., Søndergaard, H. (2002). Meta-circular Abstract Interpretation in Prolog. In: Mogensen, T.Æ., Schmidt, D.A., Sudborough, I.H. (eds) The Essence of Computation. Lecture Notes in Computer Science, vol 2566. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-36377-7_6
Download citation
DOI: https://doi.org/10.1007/3-540-36377-7_6
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-00326-7
Online ISBN: 978-3-540-36377-4
eBook Packages: Springer Book Archive