Pure, declarative, and constructive arithmetic relations (declarative pearl)

被引:0
|
作者
Kiselyov, Oleg
Byrd, William E.
Friedman, Daniel P.
Shan, Chung-Chieh
机构
来源
关键词
D O I
暂无
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
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 non-logical operators. The purity and minimalism of our approach allows us to declare arithmetic in other logic systems, such as Haskell type classes.
引用
收藏
页码:64 / 80
页数:17
相关论文
共 50 条
  • [21] DECLARATIVE GRAPHICS
    HELM, R
    MARRIOTT, K
    LECTURE NOTES IN COMPUTER SCIENCE, 1986, 225 : 513 - 527
  • [22] Frog Declarative
    Kinsella, John
    SOCIAL ALTERNATIVES, 2013, 32 (04) : 27 - 27
  • [23] Declarative networking
    Loo, Boon Thau
    Zhou, Wenchao
    Synthesis Lectures on Data Management, 2012, 4 (01): : 1 - 131
  • [24] A neurobiology of learning beyond the declarative non-declarative distinction
    Ortu, Daniele
    Vaidya, Manish
    FRONTIERS IN BEHAVIORAL NEUROSCIENCE, 2013, 7
  • [25] FROM DECLARATIVE AND PROCEDURAL KNOWLEDGE TO THE MANAGEMENT OF DECLARATIVE AND PROCEDURAL KNOWLEDGE
    FAYOL, M
    EUROPEAN JOURNAL OF PSYCHOLOGY OF EDUCATION, 1994, 9 (03) : 179 - 190
  • [26] Memory for items and memory for relations in the procedural/declarative memory framework
    Cohen, NJ
    Poldrack, RA
    Eichenbaum, H
    MEMORY, 1997, 5 (1-2) : 131 - 178
  • [27] Real-Time Persistent Queues and Deques with Logic Variables (Declarative Pearl)
    Bouma, Gerlof
    FUNCTIONAL AND LOGIC PROGRAMMING (FLOPS 2012), 2012, 7294 : 62 - 72
  • [28] Declarative and Non-declarative Memory Consolidation in Children with Sleep Disorder
    Csabi, Eszter
    Benedek, Palma
    Janacsek, Karolina
    Zavecz, Zsofia
    Katona, Gabor
    Nemeth, Dezso
    FRONTIERS IN HUMAN NEUROSCIENCE, 2016, 9
  • [29] Declarative Networking: Recent Theoretical Work on Coordination, Correctness, and Declarative Semantics
    Ameloot, Tom J.
    SIGMOD RECORD, 2014, 43 (02) : 5 - 16
  • [30] Declarative networking: Recent theoretical work on coordination, correctness, and declarative semantics
    Ameloot, Tom J., 1600, Association for Computing Machinery, 2 Penn Plaza, Suite 701, New York, NY 10121-0701, United States (43):