Skip to main content

Why Can’t You Behave? Non-termination Analysis of Direct Recursive Rules with Constraints

  • Conference paper
  • First Online:
  • 2258 Accesses

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 9718))

Abstract

This paper is concerned with rule-based programs that go wrong. The unwanted behavior of rule applications is non-termination or failure of a computation. We propose a static program analysis of the non-termination problem for recursion in the Constraint Handling Rules (CHR) language.

CHR is an advanced concurrent declarative language involving constraint reasoning. It has been closely related to many other rule-based approaches, so the results are of a more general interest. In such languages, non-termination is due to infinite applications of recursive rules. Failure is due to accumulation of contradicting constraints during the computation.

We give theorems with so-called misbehavior conditions for potential non-termination and failure (as well as definite termination) of linear direct recursive simplification rules. Logical relationships between the constraints in a recursive rule play a crucial role in this kind of program analysis. We think that our approach can be extended to other types of recursion and to a more general class of rules. Therefore this paper can serve as a basic reference and a starting point for further research.

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   84.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   109.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

Learn about institutional subscriptions

References

  1. Betz, H., Raiser, F., Frühwirth, T.: A complete and terminating execution model for constraint handling rules. Theor. Pract. Log. Program. 10, 597–610 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  2. Brockschmidt, M., Ströder, T., Otto, C., Giesl, J.: Automated detection of non-termination and NullPointerExceptions for Java bytecode. In: Beckert, B., Damiani, F., Gurov, D. (eds.) FoVeOOS 2011. LNCS, vol. 7421, pp. 123–141. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  3. Endrullis, J., Zantema, H.: Proving non-termination by finite automata. In: LIPIcs-Leibniz International Proceedings in Informatics, vol. 36. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik (2015)

    Google Scholar 

  4. Frühwirth, T.: Constraint Handling Rules (Monography). Cambridge University Press, Cambridge (2009)

    Book  MATH  Google Scholar 

  5. Frühwirth, T.: Constraint handling rules - what else? In: Bassiliades, N., Gottlob, G., Sadri, F., Paschke, A., Roman, D. (eds.) RuleML 2015. LNCS, vol. 9202, pp. 13–34. Springer, Heidelberg (2015)

    Chapter  Google Scholar 

  6. Frühwirth, T.: A devil’s advocate against termination of direct recursion. In: Proceedings of the 17th International Symposium on Principles and Practice of Declarative Programming, pp. 103–113. ACM (2015)

    Google Scholar 

  7. Frühwirth, T.: The CHR Web Site. Ulm University (2016). www.constraint-handling-rules.org

  8. Gupta, A., Henzinger, T.A., Majumdar, R., Rybalchenko, A., Xu, R.-G.: Proving non-termination. ACM Sigplan Not. 43(1), 147–158 (2008)

    Article  MATH  Google Scholar 

  9. Le, T.C., Qin, S., Chin, W.-N.: Termination and non-termination specification inference. In: Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 489–498. ACM (2015)

    Google Scholar 

  10. Liang, S., Kifer, M.: A practical analysis of non-termination in large logic programs. Theor. Practi. Log. Program. 13(4–5), 705–719 (2013)

    Article  MathSciNet  MATH  Google Scholar 

  11. Payet, É.: Loop detection in term rewriting using the eliminating unfoldings. Theoret. Comput. Sci. 403(2), 307–327 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  12. Payet, É., Mesnard, F.: A non-termination criterion for binary constraint logic programs. Theor. Pract. Log. Program. 9(02), 145–164 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  13. Payet, É., Mesnard, F., Spoto, F.: Non-termination analysis of Java bytecode (2014). CoRR abs/1401.5292

    Google Scholar 

  14. Voets, D., De Schreye, D.: A new approach to non-termination analysis of logic programs. In: Hill, P.M., Warren, D.S. (eds.) ICLP 2009. LNCS, vol. 5649, pp. 220–234. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

Download references

Acknowledgements

We thank the anonymous referees for their helpful suggestions on how to improve the paper.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Thom Frühwirth .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer International Publishing Switzerland

About this paper

Cite this paper

Frühwirth, T. (2016). Why Can’t You Behave? Non-termination Analysis of Direct Recursive Rules with Constraints. In: Alferes, J., Bertossi, L., Governatori, G., Fodor, P., Roman, D. (eds) Rule Technologies. Research, Tools, and Applications. RuleML 2016. Lecture Notes in Computer Science(), vol 9718. Springer, Cham. https://doi.org/10.1007/978-3-319-42019-6_14

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-42019-6_14

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-42018-9

  • Online ISBN: 978-3-319-42019-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics