Well-typed logic programs are not wrong

被引:0
|
作者
Deransart, P
Smaus, JG
机构
[1] Inst Natl Rech Informat & Automat, F-78153 Le Chesnay, France
[2] CWI, NL-1098 SJ Amsterdam, Netherlands
关键词
D O I
暂无
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
We consider prescriptive type systems for logic programs (as in Godel or Mercury). In such systems, the typing is static, but it guarantees an operational property: if a program is "well-typed", then all derivations starting in a "well-typed" query,axe again "well-typed". This property has been called subject reduction. We show that this property can also be phrased as a property of the proof-theoretic semantics of logic programs, thus abstracting from the usual operational (top-down) semantics. This proof-theoretic view leads us to questioning a condition which is usually considered necessary for subject reduction, namely the head condition. It states that the head of each clause must have a type which is a variant (and not a proper instance) of the declared type. We provide a more general condition, thus reestablishing a certain symmetry between heads and body atoms. The condition ensures that in a derivation, the types of two unified terms are themselves unifiable. We discuss possible implications of this result. We also discuss the relationship between the head condition and polymorphic recursion, a concept known in functional programming.
引用
收藏
页码:280 / 295
页数:16
相关论文
共 50 条
  • [11] A type-directed algorithm to generate random well-typed Java']Java 8 programs
    Feitosa, Samuel
    Ribeiro, Rodrigo
    Du Bois, Andre
    SCIENCE OF COMPUTER PROGRAMMING, 2020, 196 (196)
  • [12] Meta-programming with Well-typed Code Analysis
    Lopez, Michael
    Dos Reis, Gabriel
    30TH ANNUAL ACM SYMPOSIUM ON APPLIED COMPUTING, VOLS I AND II, 2015, : 2119 - 2121
  • [13] A SEMANTIC CHARACTERIZATION OF THE WELL-TYPED FORMULAS OF LAMBDA-CALCULUS
    FORSTER, T
    THEORETICAL COMPUTER SCIENCE, 1993, 110 (02) : 405 - 418
  • [14] Typed norms for typed logic programs
    Martin, JC
    King, A
    Soper, P
    LOGIC PROGRAM SYNTHESIS AND TRANSFORMATION, 1997, 1207 : 224 - 238
  • [15] A framework for analysis of typed logic programs
    Lagoon, V
    Stuckey, PJ
    FUNCTIONAL AND LOGIC PROGRAMMING, PROCEEDINGS, 2001, 2024 : 296 - 310
  • [16] Extensionality of simply typed logic programs
    Bezem, M
    LOGIC PROGRAMMING: PROCEEDINGS OF THE 1999 INTERNATIONAL CONFERENCE ON LOGIC PROGRAMMING, 1999, : 395 - 410
  • [17] Mode analysis domains for typed logic programs
    Smaus, JG
    Hill, PM
    King, A
    LOGIC-BASED PROGRAM SYNTHESIS AND TRANSFORMATION, PROCEEDINGS, 2000, 1817 : 82 - 101
  • [18] Dependently typed array programs don't go wrong
    Trojahner, Kai
    Grelck, Clemens
    JOURNAL OF LOGIC AND ALGEBRAIC PROGRAMMING, 2009, 78 (07): : 643 - 664
  • [19] Well-going programs can be typed
    Kahrs, S
    TYPED LAMBDA CALCULI AND APPLICATIONS, PROCEEDINGS, 2003, 2701 : 167 - 179
  • [20] Typed Meta-interpretive Learning of Logic Programs
    Morel, Rolf
    Cropper, Andrew
    Ong, C. -H. Luke
    LOGICS IN ARTIFICIAL INTELLIGENCE, JELIA 2019, 2019, 11468 : 198 - 213