Foundations of logic programming; (2nd extended ed.)
Foundations of logic programming; (2nd extended ed.)
Hilbert's tenth problem
ACM Transactions on Database Systems (TODS)
Computer architecture: a quantitative approach
Computer architecture: a quantitative approach
On Termination of Constraint Logic Programs
CP '95 Proceedings of the First International Conference on Principles and Practice of Constraint Programming
Backtracking, interleaving, and terminating monad transformers: (functional pearl)
Proceedings of the tenth ACM SIGPLAN international conference on Functional programming
The Reasoned Schemer
Principles of Constraint Programming
Principles of Constraint Programming
Declarative modeling of finite mathematics
Proceedings of the 12th international ACM SIGPLAN symposium on Principles and practice of declarative programming
On arithmetic computations with hereditarily finite sets, functions and types
ICTAC'10 Proceedings of the 7th International colloquium conference on Theoretical aspects of computing
A declarative specification of tree-based symbolic arithmetic computations
PADL'12 Proceedings of the 14th international conference on Practical Aspects of Declarative Languages
Proceedings of the 27th Annual ACM Symposium on Applied Computing
Binary trees as a computational framework
Computer Languages, Systems and Structures
Hi-index | 0.00 |
We present decidable logic programs for addition, multiplication, division with remainder, exponentiation, and logarithm with remainder over the unbounded domain of natural numbers. Our predicates represent relations without mode restrictions or annotations. They are fully decidable under the common, DFS-like, SLD resolution strategy of Prolog or under an interleaving refinement of DFS. We prove that the evaluation of our arithmetic goals always terminates, given arguments that share no logic variables. Further, the (possibly infinite) set of solutions for a goal denotes exactly the corresponding mathematical relation. (For SLD without interleaving, and for some infinite solution sets, only half of the relation's domain may be covered.) We define predicates to handle unary (for illustration) and binary representations of natural numbers, and prove termination and completeness of these predicates. Our predicates are written in pure Prolog, without cut (!), var/1, or other nonlogical operators. The purity and minimalism of our approach allows us to declare arithmetic in other logic systems, such as Haskell type classes.