skip to main content
10.1007/11547662_5guideproceedingsArticle/Chapter ViewAbstractPublication PagesConference Proceedingsacm-pubtype
Article

Inference of well-typings for logic programs with application to termination analysis

Published: 07 September 2005 Publication History

Abstract

A method is developed to infer a polymorphic well-typing for a logic program. Our motivation is to improve the automation of termination analysis by deriving types from which norms can automatically be constructed. Previous work on type-based termination analysis used either types declared by the user, or automatically generated monomorphic types describing the success set of predicates. The latter types are less precise and result in weaker termination conditions than those obtained from declared types. Our type inference procedure involves solving set constraints generated from the program and derives a well-typing in contrast to a success-set approximation. Experiments so far show that our automatically inferred well-typings are close to the declared types and result in termination conditions that are as strong as those obtained with declared types. We describe the method, its implementation and experiments with termination analysis based on the inferred types.

References

[1]
M. Bruynooghe, M. Codish, J. P. Gallagher, S. Genaim, and W. Vanhoof. Termination analysis of logic programs through combination of type-based norms. Draft, 2004.
[2]
M. Bruynooghe, M. Codish, S. Genaim, and W. Vanhoof. Reuse of results in termination analysis of typed logic programs. In Static Analysis, SAS 2002, volume 2477 of LNCS, pages 477-492, 2002.
[3]
M. Bruynooghe, J. Gallagher, and W. Van Humbeeck. Inference of well-typings for logic programs with application to termination analysis. Technical Report CW 409, Dept. Comp. Sc., Katholieke Universiteit Leuven, 2005.
[4]
H. Christiansen. Deriving declarations from programs (extended abstract). In CPP'97, Workshop on Constraint Programming for Reasoning about Programming, Leeds, 1997.
[5]
T. Frühwirth, E. Shapiro, M. Vardi, and E. Yardeni. Logic programs as types for logic programs. In Logic in Computer Science, LICS'91, pages 300-309, 1991.
[6]
J. P. Gallagher and D. de Waal. Fast and precise regular approximation of logic programs. In Logic Programming, ICLP'94, pages 599-61, 1994.
[7]
J. P. Gallagher and G. Puebla. Abstract interpretation over nondeterministic finite tree automata for set-based analysis of logic programs. In Practical Aspects of Declarative Languages, PADL 2002, volume 2257 of LNCS, pages 243-261, 2002.
[8]
S. Genaim, M. Codish, J. P. Gallagher, and V. Lagoon. Combining norms to prove termination. In A. Cortesi, editor, Verification, Model Checking, and Abstract Interpretation, VMCAI 2002, volume 2294 of LNCS, pages 126-138, 2002.
[9]
N. Heintze and J. Jaffar. A finite presentation theorem for approximating logic programs. In Principles of Programming Languages, POPL'90, pages 197-209, 1990.
[10]
P. M. Hill and R. W. Topor. A semantics for typed logic programs. In F. Pfenning, editor, Types in Logic Programming, pages 1-62. MIT Press, 1992.
[11]
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, 1992.
[12]
N. D. Jones and S. S. Muchnick. A flexible approach to interprocedural data flow analysis and programs with recursive data structures. In Principles of Programming Languages, POPL'82, pages 66-74, 1982.
[13]
V. Lagoon, F. Mesnard, and P. J. Stuckey. Termination analysis with types is more accurate. In Logic Programming, ICLP 2003, volume 2916 of LNCS, pages 254-268, 2003.
[14]
T. L. Lakshman and U. S. Reddy. Typed Prolog: A semantic reconstruction of the Mycroft-O'Keefe type system. In Logic Programming, ISLP 1991, pages 202-217, 1991.
[15]
S. Marlow and P. Wadler. A practical subtyping system for Erlang. In ICFP, pages 136-149, 1997.
[16]
P. Mishra. Towards a theory of types in Prolog. In Logic Programming, ISLP 1984, pages 289-298, 1984.
[17]
A. Mycroft and R. A. O'Keefe. A polymorphic type system for Prolog. Artificial Intelligence, 23(3):295-307, 1984.
[18]
J. C. Reynolds. Automatic construction of data set definitions. In Information Processing 68, pages 456-461, 1996.
[19]
Z. Somogyi, F. Henderson, and T. Conway. The execution algorithm of Mercury, an efficient purely declarative logic programming language. Journal of Logic Programming, 29(1-3):17-64, 1996.
[20]
C. Taboch, S. Genaim, and M. Codish. TerminWeb: Semantic based termination analyser for logic programs, 2002. http://www.cs.bgu.ac.il/ mcodish/TerminWeb.
[21]
R. E. Tarjan and J. van Leeuwen. Worst-case analysis of set union algorithms. Journal of the ACM, 31(2):245-281, 1984.
[22]
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.
[23]
W. Vanhoof and M. Bruynooghe. When size does matter. In A. Pettorossi, editor, Logic Based Program Synthesis and Transformation, LOPSTR 2001, volume 2372 of LNCS, pages 129-147, 2002.
[24]
C. Vaucheret and F. Bueno. More precise yet efficient type inference for logic programs. In Static Analysis, SAS 2002, pages 102-116, 2002.
[25]
J. Zobel. Derivation of polymorphic types for Prolog programs. In Logic Programming, ICLP 1987, pages 817-838, 1987.

Cited By

View all
  1. Inference of well-typings for logic programs with application to termination analysis

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image Guide Proceedings
    SAS'05: Proceedings of the 12th international conference on Static Analysis
    September 2005
    368 pages
    ISBN:3540285849
    • Editors:
    • Chris Hankin,
    • Igor Siveroni

    Publisher

    Springer-Verlag

    Berlin, Heidelberg

    Publication History

    Published: 07 September 2005

    Qualifiers

    • Article

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)0
    • Downloads (Last 6 weeks)0
    Reflects downloads up to 03 Jan 2025

    Other Metrics

    Citations

    Cited By

    View all

    View Options

    View options

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media