Skip to main content
QUICK REVIEW

[Paper Review] Combining typing and size constraints for checking the termination of higher-order conditional rewrite systems

Frédéric Blanqui, Riba, Colin|arXiv (Cornell University)|Sep 5, 2006
Logic, programming, and type systemsComputer Science6 citations
TL;DR

This paper presents a novel termination criterion for higher-order conditional rewrite systems by integrating typing with size constraints and Presburger arithmetic constraints. It enables precise tracking of input-output size relationships, allowing verification of termination for more complex functions than previous type-based methods, and is the first such criterion to account for conditions in the rewrite rules themselves.

ABSTRACT

In a previous work, the first author extended to higher-order rewriting and dependent types the use of size annotations in types, a termination proof technique called type or size based termination and initially developed for ML-like programs. Here, we go one step further by considering conditional rewriting and explicit quantifications and constraints on size annotations. This allows to describe more precisely how the size of the output of a function depends on the size of its inputs. Hence, we can check the termination of more functions. We first give a general type-checking algorithm based on constraint solving. Then, we give a termination criterion with constraints in Presburger arithmetic. To our knowledge, this is the first termination criterion for higher-order conditional rewriting taking into account the conditions in termination.

Motivation & Objective

  • To address the limitation of existing type-based termination techniques in handling higher-order conditional rewrite systems with complex size dependencies.
  • To develop a formal framework that integrates size annotations, explicit quantifications, and constraints on sizes to precisely model how output size relates to input size.
  • To provide a termination criterion that accounts for the conditions in conditional rewrite rules, which previous methods ignored.
  • To enable automated termination checking via constraint solving over Presburger arithmetic, extending prior work on size-based termination.
  • To lay the foundation for integrating this method into proof assistants like Coq by supporting dependent and polymorphic types.

Proposed method

  • The paper introduces a type system where base types are indexed by size annotations, allowing terms to be assigned types that reflect their size bounds.
  • It extends this with explicit existential and universal quantifications over size variables to express complex size relationships between inputs and outputs.
  • Conditional rewrite rules are annotated with constraints that must be satisfied for the rule to apply, and these constraints are checked for consistency with size reductions.
  • A general type-checking algorithm is defined using constraint solving, where size constraints are expressed in Presburger arithmetic.
  • The termination criterion is based on ensuring that every recursive call is made on arguments whose size is strictly smaller, as guaranteed by the type and constraint system.
  • The system supports higher-order functions and inductive types, with a focus on first-order pattern-matching for practicality.

Experimental results

Research questions

  • RQ1Can size-based termination be extended to higher-order conditional rewrite systems while accounting for the conditions in the rules?
  • RQ2How can size annotations and constraints be integrated into a type system to precisely describe size reduction in recursive calls?
  • RQ3Is it possible to define a formal termination criterion for higher-order conditional rewriting that uses constraint solving over Presburger arithmetic?
  • RQ4Can this approach verify the termination of functions that are not simply terminating under subterm ordering?
  • RQ5How can such a system be adapted to support dependent and polymorphic types used in proof assistants?

Key findings

  • The proposed method successfully verifies the termination of Mc Carthy’s 91 function, which is not simply terminating under subterm ordering.
  • The system can type-check complex functions like 'pivot' that require reasoning about size decomposition via existential quantification over size variables.
  • The termination criterion is the first to explicitly consider the conditions in conditional rewrite rules when checking termination.
  • The method supports higher-order functions and inductive types, extending prior work on size-based termination to conditional and more expressive systems.
  • The approach is sound and complete for the class of systems it targets, with termination proven via size reduction under constraints in Presburger arithmetic.
  • The framework is extensible to polymorphic and dependent type systems, with preliminary results suggesting feasibility for integration into proof assistants like Coq.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.