Convex Hull Abstractions in Specialization of CLP Programs

  • Julio C. Peralta
  • John P. Gallagher
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2664)


We introduce an abstract domain consisting of atomic formulas constrained by linear arithmetic constraints (or convex hulls). This domain is used in an algorithm for specialization of constraint logic programs. The algorithm incorporates in a single phase both top-down goal directed propagation and bottom-up answer propagation, and uses a widening on the convex hull domain to ensure termination. We give examples to show the precision gained by this approach over other methods in the literature for specializing constraint logic programs. The specialization method can also be used for ordinary logic programs containing arithmetic, as well as constraint logic programs. Assignments, inequalities and equalities with arithmetic expressions can be interpreted as constraints during specialization, thus increasing the amount of specialization that can be achieved.


Convex Hull Logic Program Partial Evaluation Atomic Formula Abstract Interpretation 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Krysztof R. Apt and Ernst-Rüdiger Olderog. Verification of Sequential and Concurrent Programs. Springer-Verlag, 1991.Google Scholar
  2. 2.
    F. Benoy and A. King. Inferring argument size relations in CLP(R). In Proceedings of the 6th International Workshop on Logic Program Synthesis and Transformation, pages 204–223, Sweden, 1996. Springer-Verlag, LNCS 1207.Google Scholar
  3. 3.
    Edmund M. Clarke, Orna Grumberg, and Doron Peled. Model Checking. The MIT Press, 2000.Google Scholar
  4. 4.
    P. Cousot and N. Halbwachs. Automatic discovery of linear restraints among variables of a program. In Proceedings of the Conference Record of the 5th ACM Symposium on Principles of Programming Languages, pages 84–97, Albuquerque, New Mexico, 1978. Also in “”.
  5. 5.
    G. Delzanno and A. Podelski. Model Checking in CLP. In W. R. Cleaveland, editor, 5th International Conference on Tools and Algorithms for the Construction and Analysis of Systems, pages 223–239. Springer-Verlag, LNCS 1579, 1999.CrossRefGoogle Scholar
  6. 6.
    Fabio Fioravanti, Alberto Pettorossi, and Maurizio Proietti. Automated strategies for specialising constraint logic programs. In Kung-Kiu Lau, editor, 10th International Workshop on Logic-based Program Synthesis and Transformation, pages 125–146. Springer-Verlag, LNCS 2042, 2000.CrossRefGoogle Scholar
  7. 7.
    Fabio Fioravanti, Alberto Pettorossi, and Maurizio Proietti. Verifying CTL properties of infinite state systems by specializing constraint logic programs. Technical Report DSSE-TR-2001-3, Department of Electronics and Computer Science, University of Southampton, 2001. Proceedings of the Second International Workshop on Verification and Computational Logic (VCL’01).Google Scholar
  8. 8.
    J. Gallagher. Specialisation of logic programs: A tutorial. In Proceedings PEPM’93, ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pages 88–98, Copenhagen, June 1993. ACM Press.Google Scholar
  9. 9.
    J. Gallagher, M. Codish, and E.Y. Shapiro. Specialisation of Prolog and FCP programs using abstract interpretation. New Generation Computing, 6:159–186, 1988.MATHCrossRefGoogle Scholar
  10. 10.
    J. Gallagher and D.A. de Waal. Deletion of redundant unary type predicates from logic programs. In K.K. Lau and T. Clement, editors, Logic Program Synthesis and Transformation, Workshops in Computing, pages 151–167. Springer-Verlag, 1993.Google Scholar
  11. 11.
    John P. Gallagher and L. Lafave. Regular approximation of computation paths in logic and functional languages. In O. Danvy, R. Gluck, and P. Thiemman, editors, Partial Evaluation, pages 115–136. Springer-Verlag, LNCS 1110, 1996.Google Scholar
  12. 12.
    John P. Gallagher and Julio C. Peralta. Regular tree languages as an abstract domain in program specialisation. Higher-Order and Symbolic Computation, 14(2–3):143–172, 2001.MATHCrossRefGoogle Scholar
  13. 13.
    J.M. Howe and A. King. Specialising finite domain programs using polyhedra. In A. Bossi, editor, Logic-Based Program Synthesis and Transformation (LOPSTR’99), volume 1817 of Springer-Verlag Lecture Notes in Computer Science, pages 118–135, April 2000.CrossRefGoogle Scholar
  14. 14.
    Joxan Jaffar and Michael J. Maher. Constraint logic programming: A survey. The Journal of Logic Programming, 19(20):503–581, 1994.CrossRefMathSciNetGoogle Scholar
  15. 15.
    N. Jones, C.K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Software Generation. Prentice Hall, 1993.Google Scholar
  16. 16.
    Neil D. Jones. Combining abstract interpretation and partial evaluation. In P. Van Hentenryck, editor, Symposium on Static Analysis (SAS’97), volume 1302 of Springer-Verlag Lecture Notes in Computer Science, pages 396–405, 1997.CrossRefGoogle Scholar
  17. 17.
    M. Leuschel. Program specialisation and abstract interpretation reconciled. In Joxan Jaffar, editor, Proceedings of the Joint International Conference and Symposium on Logic Programming JICSLP’98, pages 220–234, Manchester, UK, June 1998. MIT Press.Google Scholar
  18. 18.
    M. Leuschel and S. Gruner. Abstract partial deduction using regular types and its application to model checking. In A. Pettorossi, editor, (Pre)Proceedings of LOPSTR-2001 11th International Workshop on Logic-based Program Synthesis and Transformation (LOPSTR-2001), Paphos, Cyprus, December 2001.Google Scholar
  19. 19.
    M. Leuschel and T. Massart. Infinite state model checking by abstract interpretation and program specialisation. In Annalisa Bossi, editor, Logic-Based Program Synthesis and Transformation, pages 62–81. Springer Verlag, LNCS 1817, 1999.CrossRefGoogle Scholar
  20. 20.
    J.W. Lloyd and J.C. Shepherdson. Partial Evaluation in Logic Programming. Journal of Logic Programming, 11(3 & 4):217–242, 1991.CrossRefMATHMathSciNetGoogle Scholar
  21. 21.
    K. Marriott and P. Stuckey. The 3 R’s of optimizing constraint logic programs: Refinement, Removal and Reordering. In Proceedings of the Twentieth Symposium on Principles of Programming Languages, pages 334–344, Charleston, South Carolina, 1993. ACM Press.CrossRefGoogle Scholar
  22. 22.
    Torben Æ. Mogensen. Partially static structures in a self-applicable partial evaluator. In D. Bjørner, A.P. Ershov, and N.D. Jones, editors, Partial Evaluation and Mixed Computation, pages 325–347. North-Holland, 1988.Google Scholar
  23. 23.
    Julio C. Peralta and John P. Gallagher. Imperative program specialisation: An approach using CLP. In Annalisa Bossi, editor, Logic-Based Program Synthesis and Transformation, pages 102–117. Springer Verlag, LNCS 1817, 1999.CrossRefGoogle Scholar
  24. 24.
    G. Puebla, M. Hermenegildo, and J. P. Gallagher. An integration of partial evaluation in a generic abstract interpretation framework. In Olivier Danvy, editor, Proceedings of the ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation (PEPM’99), Technical report BRICS-NS-99-1, University of Aarhus, pages 75–84, San Antonio, Texas, January 1999.Google Scholar
  25. 25.
    J. C. Reynolds. Transformational systems and the algebraic structure of atomic formulas. Machine Intelligence, pages 135–151, 1970.Google Scholar
  26. 26.
    Huseyin Sağlam and John P. Gallagher. Constrained regular approximations of logic programs. In N. Fuchs, editor, LOPSTR’97, pages 282–299. Springer-Verlag, LNCS 1463, 1997.Google Scholar
  27. 27.
    Danny De Schreye, Robert Glück, Jesper Jørgensen, Michael Leuschel, Bern Martens, and Morten Heine Sørensen. Conjunctive partial deduction: Foundations, control, algorithms, and experiments. The Journal of Logic Programming, 41(2–3):231–277, 1999. Erratum appeared in JLP 43(3): 265(2000).MATHCrossRefGoogle Scholar
  28. 28.
    U. A. Shankar. An Introduction to Assertional Reasoning for Concurrent systems. ACM Computing Surveys, 25(3):225–262, 1993.CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2003

Authors and Affiliations

  • Julio C. Peralta
    • 1
  • John P. Gallagher
    • 2
  1. 1.Instituto de Investigación en Matemáticas Aplicadas y en SistemasCiudad UniversitariaMéxico, D.F.
  2. 2.Dept. of Computer ScienceUniversity of RoskildeRoskildeDenmark

Personalised recommendations