Skip to main content

Fast and Accurate Strong Termination Analysis with an Application to Partial Evaluation

  • Conference paper
Functional and Constraint Logic Programming (WFLP 2009)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 5979))

Included in the following conference series:

Abstract

A logic program strongly terminates if it terminates for any selection rule. Clearly, considering a particular selection rule|like Prolog’s leftmost selection rule|allows one to prove more goals terminating. In contrast, a strong termination analysis gives valuable information for those applications in which the selection rule cannot be fixed in advance (e.g., partial evaluation, dynamic selection rules, parallel execution). In this paper, we introduce a fast and accurate size-change analysis that can be used to infer conditions for both strong termination and strong quasi-termination of logic programs. We also provide several ways to increase the accuracy of the analysis without sacrificing scalability. In the experimental evaluation, we show that the new algorithm is up to three orders of magnitude faster than the previous implementation, meaning that we can efficiently deal with programs exceeding 25,000 lines of Prolog.

This work has been partially supported by the Spanish Ministerio de Ciencia e Innovación (MICINN) under grant TIN2008-06622-C03-02, by the Generalitat Valenciana under grant GVPRE/2008/001, and by the UPV (Programs PAID-05-08 and PAID-06-08). Salvador Tamarit has been partially supported by the Spanish MICINN under FPI grant BES-2009-015019.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Ben-Amram, A.M., Lee, C.S.: Program termination analysis in polynomial time. ACM TOPLAS 29(1) (2007)

    Google Scholar 

  2. Benoy, F., King, A., Mesnard, F.: Computing convex hulls with a linear solver. TPLP 5(1-2), 259–271 (2005)

    MATH  Google Scholar 

  3. Bezem, M.: Strong Termination of Logic Programs. Journal of Logic Programming 15(1&2), 79–97 (1993)

    Article  MATH  MathSciNet  Google Scholar 

  4. Bossi, A., Etalle, S., Rossi, S.: Properties of input-consuming derivations. TPLP 2(2), 125–154 (2002)

    MATH  MathSciNet  Google Scholar 

  5. Bossi, A., Etalle, S., Rossi, S., Smaus, J.-G.: Termination of simply moded logic programs with dynamic scheduling. ACM Trans. Comput. Log. 5(3), 470–507 (2004)

    Article  MathSciNet  Google Scholar 

  6. Codish, M., Taboch, C.: A semantic basis for the termination analysis of logic programs. Journal of Logic Programming 41(1), 103–123 (1999)

    Article  MATH  MathSciNet  Google Scholar 

  7. Consel, C., Danvy, O.: Tutorial notes on Partial Evaluation. In: Proc. of POPL 1993, pp. 493–501. ACM Press, New York (1993)

    Chapter  Google Scholar 

  8. Craig, S.-J., Gallagher, J., Leuschel, M., Henriksen, K.S.: Fully Automatic Binding-Time Analysis for Prolog. In: Etalle, S. (ed.) LOPSTR 2004. LNCS, vol. 3573, pp. 53–68. Springer, Heidelberg (2005)

    Google Scholar 

  9. De Schreye, D., Decorte, S.: Termination of logic programs: The never ending story. The Journal of Logic Programming 19 & 20, 199–260 (1994)

    Google Scholar 

  10. Decorte, S., De Schreye, D., Leuschel, M., Martens, B., Sagonas, K.F.: Termination Analysis for Tabled Logic Programming. In: Fuchs, N.E. (ed.) LOPSTR 1997. LNCS, vol. 1463, pp. 111–127. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  11. Van Gelder, A.: Deriving constraints among argument sizes in logic programs. Ann. Math. Artif. Intell. 3(2-4), 361–392 (1991)

    Article  MATH  Google Scholar 

  12. Giesl, J., Thiemann, R., Schneider-Kamp, P., Falke, S.: Mechanizing and Improving Dependency Pairs. J. Autom. Reasoning 37(3), 155–203 (2006)

    Article  MATH  MathSciNet  Google Scholar 

  13. Gómez-Zamalloa, M., Albert, E., Puebla, G.: Improving the decompilation of Java bytecode to Prolog by partial evaluation. Electr. Notes Theor. Comput. Sci. 190(1), 85–101 (2007)

    Article  Google Scholar 

  14. Henriksen, K.S., Gallagher, J.: Abstract interpretation of pic programs through logic programming. In: SCAM, pp. 184–196. IEEE Computer Society, Los Alamitos (2006)

    Google Scholar 

  15. Hill, P., Lloyd, J.W.: The Gödel Programming Language. MIT Press, Cambridge (1994)

    MATH  Google Scholar 

  16. Holzmann, G.J.: The model checker Spin. IEEE Trans. Software Eng. 23(5), 279–295 (1997)

    Article  MathSciNet  Google Scholar 

  17. Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice-Hall, Englewood Cliffs (1993)

    MATH  Google Scholar 

  18. Lee, C.S., Jones, N.D., Ben-Amram, A.M.: The Size-Change Principle for Program Termination. SIGPLAN Notices (Proc. of POPL 2001) 28, 81–92 (2001)

    Article  Google Scholar 

  19. Leuschel, M., Craig, S.-J., Bruynooghe, M., Vanhoof, W.: Specialising Interpreters Using Offline Partial Deduction. In: Bruynooghe, M., Lau, K.-K. (eds.) Program Development in Computational Logic. LNCS, vol. 3049, pp. 340–375. Springer, Heidelberg (2004)

    Google Scholar 

  20. Leuschel, M., Vidal, G.: Fast Offline Partial Evaluation of Large Logic Programs. In: Hanus, M. (ed.) Logic-Based Program Synthesis and Transformation. LNCS, vol. 5438, pp. 119–134. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  21. Leuschel, M.: The ecce partial deduction system and the dppd library of benchmarks. Obtainable via 1996-2002, http://www.ecs.soton.ac.uk/~mal

  22. Leuschel, M., Butler, M.: ProB: A model checker for B. In: Araki, K., Gnesi, S., Mandrioli, D. (eds.) FME 2003. LNCS, vol. 2805, pp. 855–874. Springer, Heidelberg (2003)

    Google Scholar 

  23. Leuschel, M., De Schreye, D.: Creating specialised integrity checks through partial evaluation of meta-interpreters. The Journal of Logic Programming 36(2), 149–193 (1998)

    Article  MATH  Google Scholar 

  24. Leuschel, M., Fontaine, M.: Probing the depths of CSP-M: A new FDR-compliant validation tool. In: Liu, S., Maibaum, T., Araki, K. (eds.) ICFEM 2008. LNCS, vol. 5256, pp. 278–297. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  25. Lindenstrauss, N., Sagiv, Y.: Automatic Termination Analysis of Logic Programs. In: Proc. of ICLP 1997, pp. 63–77. MIT Press, Cambridge (1997)

    Google Scholar 

  26. Lindenstrauss, N., Sagiv, Y., Serebrenik, A.: Proving Termination for Logic Programs by the Query-Mapping Pairs Approach. In: Bruynooghe, M., Lau, K.-K. (eds.) Program Development in Computational Logic. LNCS, vol. 3049, pp. 453–498. Springer, Heidelberg (2004)

    Google Scholar 

  27. Marchiori, E., Teusink, F.: Termination of Logic Programs with Delay Declarations. J. Log. Program. 39(1-3), 95–124 (1999)

    Article  MATH  MathSciNet  Google Scholar 

  28. Naish, L.: Coroutining and the construction of terminating logic programs. Australian Computer Science Communications 15(1), 181–190 (1993)

    Google Scholar 

  29. Smaus, J.-G.: Termination of Logic Programs Using Various Dynamic Selection Rules. In: Demoen, B., Lifschitz, V. (eds.) ICLP 2004. LNCS, vol. 3132, pp. 43–57. Springer, Heidelberg (2004)

    Google Scholar 

  30. Smaus, J.-G., Hill, P.M., King, A.: Verifying termination and error-freedom of logic programs with block declarations. TPLP 1(4), 447–486 (2001)

    MATH  MathSciNet  Google Scholar 

  31. Thiemann, R., Giesl, J.: The Size-Change Principle and Dependency Pairs for Termination of Term Rewriting. Applicable Algebra in Engineering, Communication and Computing 16(4), 229–270 (2005)

    Article  MATH  MathSciNet  Google Scholar 

  32. Verbaeten, S., Sagonas, K., De Schreye, D.: Termination Proofs for Logic Programs with Tabling. ACM Transactions on Computational Logic 2(1), 57–92 (2001)

    Article  MathSciNet  Google Scholar 

  33. Vidal, G.: Quasi-Terminating Logic Programs for Ensuring the Termination of Partial Evaluation. In: Proc. of PEPM 2007, pp. 51–60. ACM Press, New York (2007)

    Google Scholar 

  34. De Wachter, B., Genon, A., Massart, T., Meuter, C.: The formal design of distributed controllers with \(_{\mbox{d}}\)sl and Spin. Formal Asp. Comput. 17(2), 177–200 (2005)

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2010 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Leuschel, M., Tamarit, S., Vidal, G. (2010). Fast and Accurate Strong Termination Analysis with an Application to Partial Evaluation . In: Escobar, S. (eds) Functional and Constraint Logic Programming. WFLP 2009. Lecture Notes in Computer Science, vol 5979. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-11999-6_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-11999-6_8

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-11998-9

  • Online ISBN: 978-3-642-11999-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics