Hostname: page-component-586b7cd67f-vdxz6 Total loading time: 0 Render date: 2024-11-29T07:52:55.380Z Has data issue: false hasContentIssue false

Evaluation of the Implementation of an Abstract Interpretation Algorithm using Tabled CLP

Published online by Cambridge University Press:  20 September 2019

JOAQUÍN ARIAS
Affiliation:
IMDEA Software Institute and Universidad Politécnica de Madrid (e-mails: [email protected], [email protected], [email protected], [email protected])
MANUEL CARRO
Affiliation:
IMDEA Software Institute and Universidad Politécnica de Madrid (e-mails: [email protected], [email protected], [email protected], [email protected])

Abstract

CiaoPP is an analyzer and optimizer for logic programs, part of the Ciao Prolog system. It includes PLAI, a fixpoint algorithm for the abstract interpretation of logic programs which we adapt to use tabled constraint logic programming. In this adaptation, the tabling engine drives the fixpoint computation, while the constraint solver handles the LUB of the abstract substitutions of different clauses. That simplifies the code and improves performance, since termination, dependencies, and some crucial operations (e.g., branch switching and resumption) are directly handled by the tabling engine. Determining whether the fixpoint has been reached uses semantic equivalence, which can decide that two syntactically different abstract substitutions represent the same element in the abstract domain. Therefore, the tabling analyzer can reuse answers in more cases than an analyzer using syntactical equality. This helps achieve better performance, even taking into account the additional cost associated to these checks. Our implementation is based on the TCLP framework available in Ciao Prolog and is one-third the size of the initial fixpoint implementation in CiaoPP. Its performance has been evaluated by analyzing several programs using different abstract domains.

Type
Original Article
Copyright
© Cambridge University Press 2019 

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Footnotes

*

Work partially supported by EIT Digital (https://eitdigital.eu), MINECO project TIN2015-67522-C3-1-R (TRACES), and Comunidad de Madrid project S2018/TCS-4339 BLOQUES-CM co-funded by EIE Funds of the European Union.

References

Arias, J. and Carro, M. 2019a. Description, Implementation, and Evaluation of a Generic Design for Tabled CLP. Theory and Practice of Logic Programming 19, 3, 412448.Google Scholar
Arias, J. and Carro, M. 2019b. Incremental evaluation of lattice-based aggregates in logic programming using modular TCLP. In Practical Aspects of Declarative Languages - 21st International Symposium (PADL 2019), Alferes, J. J. and Johansson, M., Eds. Lecture Notes in Computer Science, vol. 11372. Springer, 98114.Google Scholar
Bruynooghe, M. 1991. A Practical Framework for the Abstract Interpretation of Logic Programs. Journal of Logic Programming 10, 91124.Google Scholar
Bueno, F., Lopez-Garcia, P., and Hermenegildo, M. V. 2004. Multivariant Non-Failure Analysis via Standard Abstract Interpretation. In FLOPS’04. Number 2998 in LNCS. Springer-Verlag, 100–116.Google Scholar
Chico de Guzmán, P., Carro, M., Hermenegildo, M. V., and Stuckey, P. 2012. A General Implementation Framework for Tabled CLP. In Int’l. Symposium on Functional and Logic Programming (FLOPS’12). Number 7294 in LNCS. Springer Verlag, 104–119.Google Scholar
Cousot, P. and Cousot, R. 1977. Abstract Interpretation: a Unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints. In ACM Symposium on Principles of Programming Languages (POPL’77). ACM Press, 238252.Google Scholar
Cui, B. and Warren, D. S. 2000. A system for Tabled Constraint Logic Programming. In Int’l. Conference on Computational Logic. LNCS, vol. 1861. 478–492.Google Scholar
Demoen, B. and Sagonas, K. 1998. CAT: The Copying Approach to Tabling. In Programming Language Implementation and Logic Programming. Lecture Notes in Computer Science, vol. 1490. Springer-Verlag, 2135.Google Scholar
Dietrich, S. W. 1987. Extension Tables: Memo Relations in Logic Programming. In Fourth IEEE Symposium on Logic Programming. 264–272.Google Scholar
Freire, J., Swift, T., and Warren, D. S. 2001. Beyond Depth-First: Improving Tabled Logic Programs through Alternative Scheduling Strategies. In International Symposium on Programming Language Implementation and Logic Programming. Number 1140 in LNCS. Springer-Verlag, 243–258.Google Scholar
Gange, G., Navas, J. A., Schachte, P., Søndergaard, H., and Stuckey, P. J. 2013. Failure Tabled Constraint Logic Programming by Interpolation. TPLP 13, 4-5, 593607.Google Scholar
Guo, H.-F. and Gupta, G. 2008. Simplifying Dynamic Programming via Mode-directed Tabling. Software: Practice and Experience 1 (Jan), 7594.Google Scholar
Hermenegildo, M. V., Bueno, F., Carro, M., Lopez-Garcia, P., Mera, E., Morales, J., and Puebla, G. 2012. An Overview of Ciao and its Design Philosophy. Theory and Practice of Logic Programming 12, 1–2 (January), 219252. http://arxiv.org/abs/1102.5497.Google Scholar
Hermenegildo, M. V., Puebla, G., Bueno, F., and Lopez-Garcia, P. 2005. Integrated Program Debugging, Verification, and Optimization Using Abstract Interpretation (and The Ciao System Preprocessor). Science of Computer Programming 58, 1–2 (October), 115140.CrossRefGoogle Scholar
Holzbaur, C. 1992. Metastructures vs. Attributed Variables in the Context of Extensible Unification. In Int’l. Symposium on Programming Language Implementation and Logic Programming. Number 631 in LNCS. Springer Verlag, 260–268.Google Scholar
Jaffar, J. and Maher, M. 1994. Constraint Logic Programming: A Survey. Journal of Logic Programming 19/20, 503–581.Google Scholar
Janssens, G., Bruynooghe, M., and Dumortier, V. 1995. A blueprint for an abstract machine for abstract interpretation of (constraint) logic programs. In ILPS. 336–350.Google Scholar
Janssens, G. and Sagonas, K. 1998. On the Use of Tabling for Abstract Interpretation: An Experiment with Abstract Equation Systems. In Tabulation in Parsing and Deduction.Google Scholar
Kanamori, T. and Kawamura, T. 1993. Abstract Interpretation Based on OLDT Resolution. Journal of Logic Programming 15, 130.Google Scholar
Muthukumar, K. and Hermenegildo, M. 1989. Determination of Variable Dependence Information at Compile-Time Through Abstract Interpretation. In 1989 North American Conference on Logic Programming. MIT Press, 166189.Google Scholar
Muthukumar, K. and Hermenegildo, M. 1990. Deriving A Fixpoint Computation Algorithm for Top-down Abstract Interpretation of Logic Programs. Technical Report ACT-DC-153-90, Microelectronics and Computer Technology Corporation (MCC), Austin, TX 78759. April.Google Scholar
Muthukumar, K. and Hermenegildo, M. 1991. Combined Determination of Sharing and Freeness of Program Variables Through Abstract Interpretation. In International Conference on Logic Programming (ICLP 1991). MIT Press, 4963.Google Scholar
Muthukumar, K. and Hermenegildo, M. 1992. Compile-time Derivation of Variable Dependency Using Abstract Interpretation. JLP 13, 2/3 (July), 315–347.Google Scholar
Nielson, F., Nielson, H. R., and Hankin, C. 2005. Principles of Program Analysis. Springer. Second Ed.Google Scholar
Santos Costa, V., Rocha, R., and Damas, L. 2012. The YAP Prolog system. Theory and Practice of Logic Programming 12, 1-2, 534.Google Scholar
Schrijvers, T., Demoen, B., and Warren, D. S. 2008. TCHR: a Framework for Tabled CLP. Theory and Practice of Logic Programming 4 (Jul), 491526.Google Scholar
Swift, T. and Warren, D. S. 2010. Tabling with answer subsumption: Implementation, applications and performance. In Logics in Artificial Intelligence. Vol. 6341. 300312.CrossRefGoogle Scholar
Tamaki, H. and Sato, M. 1986. OLD Resolution with Tabulation. In Third International Conference on Logic Programming. Lecture Notes in Computer Science, Springer-Verlag, London, 8498.Google Scholar
Vaucheret, C. and Bueno, F. 2002. More Precise yet Efficient Type Inference for Logic Programs. In 9th International Static Analysis Symposium (SAS’02). Lecture Notes in Computer Science, vol. 2477. Springer-Verlag, 102116.Google Scholar
Warren, D. S. 1992. Memoing for Logic Programs. Communications of the ACM 35, 3, 93111.Google Scholar
Warren, D. S. 1999. Programming in Tabled Prolog. https://www3.cs.stonybrook.edu/~warren/xsbbook/book.html. Unpublished manuscript. Accessed on May 15, 2019.Google Scholar
Warren, R., Hermenegildo, M., and Debray, S. K. 1988. On the Practicality of Global Flow Analysis of Logic Programs. In Fifth International Conference and Symposium on Logic Programming. MIT Press, 684699.Google Scholar
Wielemaker, J., Schrijvers, T., Triska, M., and Lager, T. 2012. SWI-Prolog. Theory and Practice of Logic Programming 12, 1-2, 6796.Google Scholar
Zhou, N.-F., Kameya, Y., and Sato, T. 2010. Mode-Directed Tabling for Dynamic Programming, Machine Learning, and Constraint Solving. In Int’l. Conference on Tools with Artificial Intelligence. Number 2. IEEE, 213–218.Google Scholar
Supplementary material: PDF

Arias and Carro supplementary material

Appendix

Download Arias and Carro supplementary material(PDF)
PDF 206.9 KB