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 条
  • [1] Well-Typed Music Does Not Sound Wrong
    Szamozvancev, Dmitrij
    Gale, Michael B.
    ACM SIGPLAN NOTICES, 2017, 52 (10) : 99 - 104
  • [2] Well-Typed Programs Can't Be Blamed
    Wadler, Philip
    Findler, Robert Bruce
    PROGRAMMING LANGUAGES AND SYSTEMS, PROCEEDINGS, 2009, 5502 : 1 - +
  • [3] Termination of Simply-Moded Well-Typed Logic Programs under a Tabled Execution Mechanism
    Sofie Verbaeten
    Danny De Schreye
    Applicable Algebra in Engineering, Communication and Computing, 2001, 12 : 157 - 196
  • [4] Termination of simply-moded well-typed logic programs under a tabled execution mechanism
    Verbaeten, S
    De Schreye, D
    APPLICABLE ALGEBRA IN ENGINEERING COMMUNICATION AND COMPUTING, 2001, 12 (1-2) : 157 - 196
  • [5] Well-Typed Programs Can Go Wrong: A Study of Typing-Related Bugs in JVM Compilers
    Chaliasos, Stefanos
    Sotiropoulos, Thodoris
    Drosos, Georgios-Petros
    Mitropoulos, Charalambos
    Mitropoulos, Dimitris
    Spinellis, Diomidis
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2021, 5 (OOPSLA):
  • [6] Generating Random Well-Typed Featherweight Java Programs Using QuickCheck
    Da Silva Feitosa, Samuel
    Ribeiro, Rodrigo Geraldo
    Rauber Du Bois, Andre
    Electronic Notes in Theoretical Computer Science, 2019, 342 : 3 - 20
  • [7] Generating Well-Typed Terms That Are Not "Useless"
    Frank, Justin
    Quiring, Benjamin
    Lampropoulos, Leonidas
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2024, 8 (POPL): : 2318 - 2339
  • [8] Enumerating Well-Typed Terms Generically
    Yakushev, Alexey Rodriguez
    Jeuring, Johan
    APPROACHES AND APPLICATIONS OF INDUCTIVE PROGRAMMING, 2010, 5812 : 93 - +
  • [9] Dynamic Editors for Well-Typed Expressions
    Koopman, Pieter
    Michels, Steffen
    Plasmeijer, Rinus
    TRENDS IN FUNCTIONAL PROGRAMMING (TFP 2021), 2021, 12834 : 44 - 66
  • [10] Generating Random Well-Typed Featherweight Java']Java Programs Using QuickCheck
    Feitosa, Samuel da Silva
    Ribeiro, Rodrigo Geraldo
    Du Bois, Andre Rauber
    ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE, 2019, 342 : 3 - 20