SUMMARYFor simply-typed term rewriting systems (STRSs) and higher-order rewrite systems (HRSs)à la Nipkow, we proposed a method for proving termination, namely the static dependency pair method. The method combines the dependency pair method introduced for first-order rewrite systems with the notion of strong computability introduced for typed λ-calculi. This method analyzes a static recursive structure based on definition dependency. By solving suitable constraints generated by the analysis, we can prove termination. In this paper, we extend the method to rewriting systems for functional programs (RFPs) with product, algebraic data, and ML-polymorphic types. Although the type system in STRSs contains only product and simple types and the type system in HRSs contains only simple types, our RFPs allow product types, type constructors (algebraic data types), and type variables (ML-polymorphic types). Hence, our RFPs are more representative of existing functional programs than STRSs and HRSs. Therefore, our result makes a large contribution to applying theoretical rewriting techniques to actual problems, that is, to proving the termination of existing functional programs. key words: rewriting systems for functional programs, termination, static dependency pair method
IntroductionVarious extensions of term rewriting systems (TRSs) [24] for handling higher-order functions have been proposed [10], [12], [14], [19], [20]. Simply-typed term rewriting systems (STRSs) introduced by Kusakari [14], and higher-order rewrite systems (HRSs) introduced by Nipkow [19] are two such extensions. In this paper, we introduce rewriting systems for functional programs (RFPs), which is an extension of TRSs with product, algebraic data, and ML-polymorphic types. For example, the typical higher-order function foldl can be represented by the following RFP R foldl :Here we suppose that the function foldl has the type:in which α and β are type variables, and list is a type constructor.The static dependency pair method is a powerful
)) xsTo prove the non-loopingness of static recursion components, the notions of subterm criterion and reduction pair have been proposed. The subterm criterion was introduced on TRSs [9], and slightly improved by extending the subterms permitted by the criterion on STRSs [16], and extended on HRSs [18]. Reduction pairs [15] are an abstraction of weak-reduction order [1]. By using the subterm criterion, we can prove the non-loopingness of the above static recursion component from the following fact:cons(x, xs) sub xs (xs is a subterm of cons (x, xs))By recapitulating such a termination proof by the static dependency pair method, we obtain the following claim:The function foldl is explicitly recursively defined on the third argument. Hence, the function foldl is well-defined (terminating).This claim is an assertion of the static dependency pair method, and it may be very natural reasoning. However, it is quite difficult to verify the claim because its reduction may be affected by unanticipated behaviors of functio...