Datatype defining rewrite systems for naturals and integers
Open Access
- 18 February 2021
- journal article
- research article
- Published by Centre pour la Communication Scientifique Directe (CCSD) in Logical Methods in Computer Science
- Vol. ume 17, Is (1)
Abstract
A datatype defining rewrite system (DDRS) is an algebraic (equational) specification intended to specify a datatype. When interpreting the equations from left-to-right, a DDRS defines a term rewriting system that must be ground-complete. First we define two DDRSs for the ring of integers, each comprising twelve rewrite rules, and prove their ground-completeness. Then we introduce natural number and integer arithmetic specified according to unary view, that is, arithmetic based on a postfix unary append constructor (a form of tallying). Next we specify arithmetic based on two other views: 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. Integer arithmetic in binary and decimal notation is based on (postfix) digit append functions. For each view we define a 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 yields comparable normal forms, which for that view admits expressions that are algorithmically more involved. For all DDRSs considered, ground-completeness is proven.Comment: arXiv admin note: text overlap with arXiv:1406.3280Keywords
All Related Versions
This publication has 8 references indexed in Scilit:
- Analyzing Program Termination and Complexity Automatically with AProVEJournal of Automated Reasoning, 2016
- Fracpairs and fractions over a reduced commutative ringIndagationes Mathematicae, 2016
- Division by zero in non-involutive meadowsJournal of Applied Logic, 2015
- The rational numbers as an abstract data typeJournal of the ACM, 2007
- Testing Algebraic Data Types and Processes: A Unifying TheoryFormal Aspects of Computing, 1998
- Equational specifications, complete term rewriting systems, and computable and semicomputable algebrasJournal of the ACM, 1995
- Algebraic specifications of computable and semicomputable data typesTheoretical Computer Science, 1987
- A systematic study of models of abstract data typesTheoretical Computer Science, 1984