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
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsReferences
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)
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)
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)
Frühwirth, T.: Constraint Handling Rules (Monography). Cambridge University Press, Cambridge (2009)
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)
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)
Frühwirth, T.: The CHR Web Site. Ulm University (2016). www.constraint-handling-rules.org
Gupta, A., Henzinger, T.A., Majumdar, R., Rybalchenko, A., Xu, R.-G.: Proving non-termination. ACM Sigplan Not. 43(1), 147–158 (2008)
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)
Liang, S., Kifer, M.: A practical analysis of non-termination in large logic programs. Theor. Practi. Log. Program. 13(4–5), 705–719 (2013)
Payet, É.: Loop detection in term rewriting using the eliminating unfoldings. Theoret. Comput. Sci. 403(2), 307–327 (2008)
Payet, É., Mesnard, F.: A non-termination criterion for binary constraint logic programs. Theor. Pract. Log. Program. 9(02), 145–164 (2009)
Payet, É., Mesnard, F., Spoto, F.: Non-termination analysis of Java bytecode (2014). CoRR abs/1401.5292
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)
Acknowledgements
We thank the anonymous referees for their helpful suggestions on how to improve the paper.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights 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)