Skip to main content
QUICK REVIEW

[Paper Review] Three Datatype Defining Rewrite Systems for Datatypes of Integers each extending a Datatype of Naturals

J.A. Bergstra, Alban Ponse|arXiv (Cornell University)|Jun 12, 2014
Logic, programming, and type systems14 references7 citations
TL;DR

This paper presents three ground-complete, ground-confluent datatype-defining rewrite systems (DDRSs) for integers, each extending a canonical term algebra for natural numbers: one using unary notation (0, S, P), one using binary digit append constructors, and one using decimal digit append constructors. Each system ensures unique normal forms matching standard integer notations and proves ground-completeness via structural induction and termination arguments.

ABSTRACT

Integer arithmetic is specified according to three views: unary, binary, and decimal notation. The binary and decimal view have as their characteristic that each normal form resembles common number notation, that is, either a digit, or a string of digits without leading zero, or the negated versions of the latter. The unary view comprises a specification of integer arithmetic based on 0, successor function $S$, and predecessor function, with negative normal forms $-S^i(0)$. Integer arithmetic in binary and decimal notation is based on (postfix) digit append functions. For each view we define a ground-confluent and terminating datatype defining rewrite system (DDRS), and in each case the resulting datatype is a canonical term algebra that extends a corresponding canonical term algebra for natural numbers. Then, for each view, we consider an alternative DDRS based on tree constructors that yield comparable normal forms, which for that binary and decimal view admits expressions that are algorithmically more involved. These DDRSes are incorporated because they are closer to existing literature. For these DDRSes we also provide ground-completeness results. Finally, we define a DDRS for the ring of Integers (comprising fifteen rewrite rules) and prove its ground-completeness.

Motivation & Objective

  • To provide equational specifications of integer arithmetic using three distinct notational views: unary, binary, and decimal.
  • To define ground-confluent and strongly terminating DDRSes for each integer notation, ensuring unique normal forms.
  • To extend canonical term algebras for natural numbers into corresponding canonical term algebras for integers.
  • To offer alternative DDRSes using tree constructors that align with existing literature while preserving normal form equivalence.
  • To prove ground-completeness for all DDRSes, including a minimal ring-based specification for integers in the language of commutative rings.

Proposed method

  • Define three DDRSes for integers using digit append constructors: unary (S, P), binary (append 0/1), and decimal (append 0–9), each extending a natural number algebra.
  • Construct alternative DDRSes using tree constructors (e.g., binary and decimal digit trees) to model number representations more closely to standard syntactic forms.
  • Prove strong termination and ground-confluence via structural induction on closed terms, showing every term rewrites to a unique normal form.
  • Use weight functions and case analysis on term structure to verify that all closed terms either are normal forms or reduce further.
  • Provide formal proofs of ground-completeness in appendices, including for a minimal ring-based DDRS with 15 rules.
  • Verify that all rewrite systems are semantic consequences of standard ring axioms and preserve isomorphism to the integer ring Z.

Experimental results

Research questions

  • RQ1Can integer arithmetic be formally specified using three distinct notational views—unary, binary, and decimal—each yielding unique normal forms matching standard notation?
  • RQ2Are the proposed DDRSes ground-confluent and strongly terminating, ensuring unique normal forms for all closed terms?
  • RQ3Can alternative DDRSes based on tree constructors be defined that yield the same normal forms as the digit-append systems but align better with existing formal literature?
  • RQ4Is a minimal DDRS for the ring of integers (in signature {0, 1, −, +, ·}) ground-complete, and does it follow from standard ring axioms?
  • RQ5Can ground-completeness be formally proven for all DDRSes, including those with complex constructors and multiple rewrite rules?

Key findings

  • The unary DDRS for integers (Zubd) is ground-complete and uses the signature {0, S, P}, with normal forms −Si(0) for negative integers.
  • The binary DDRS (Zbud) uses digit append operations and is proven ground-complete with 16 equations, ensuring normal forms match standard binary notation.
  • The decimal DDRS (Zdub) uses digit append operations and is proven ground-complete with 16 equations, yielding normal forms matching standard decimal notation.
  • Alternative DDRSes using tree constructors (Zut, Zbt, Zdt) are defined and proven ground-complete, providing closer alignment with existing literature.
  • A minimal DDRS for the ring of integers (Zr) with 15 rules is proven ground-complete, using only ring operations and axioms.
  • The ring-based DDRS (Zr) is not confluent in the standard sense but is ground-confluent, with strong termination proven via a weight function on terms.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.