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

Michael Leuschel, Salvador Tamarit, Germán Vidal
2010 Lecture Notes in Computer Science  
Analysing the termination of logic programs is a challenging problem that has attracted a lot of interest (see, e.g., [2, 3, 7, 8] and references therein). However, strong termination analysis (i.e., termination for any selection rule) has received little attention, a notable exception being the work by Bezem [1] . 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
more » ... 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 [4] that can be used to infer conditions for both strong termination and quasi-termination of logic programs. In the paper 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 realistic programs exceeding 25,000 lines of Prolog. One major application of this algorithm is for offline partial evaluation of large programs. In the experimental evaluation we show that, with our new algorithm, we can now deal with realistic interpreters, such as the interpreter for the full B specification language from [6] . Together with the selective use of hints [5], we have obtained both a scalable and an effective partial evaluation procedure. References 1. M. Bezem. Strong Termination of Logic Programs. Journal of Logic Programming, 15(1&2):79-97, 1993. 2. M. Codish and C. Taboch. A semantic basis for the termination analysis of logic programs.
doi:10.1007/978-3-642-11999-6_8 fatcat:5yguk3smlzhgfevquf2o3hrn5i