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 条
  • [21] Making Random Judgments: Automatically Generating Well-Typed Terms from the Definition of a Type-System
    Fetscher, Burke
    Claessen, Koen
    Palka, Michal
    Hughes, John
    Findler, Robert Bruce
    PROGRAMMING LANGUAGES AND SYSTEMS, 2015, 9032 : 383 - 405
  • [22] Reuse of results in termination analysis of typed logic programs
    Bruynooghe, M
    Codish, M
    Genaim, S
    Vanhoof, W
    STATIC ANALYSIS, PROCEEDINGS, 2002, 2477 : 477 - 492
  • [23] THE COMPLETION OF TYPED LOGIC PROGRAMS AND SLDNF-RESOLUTION
    HILL, PM
    LOGIC PROGRAMMING AND AUTOMATED REASONING, 1993, 698 : 182 - 193
  • [24] Using modes to ensure subject reduction for typed logic programs with subtyping
    Smaus, JG
    Fages, F
    Deransart, P
    FST TCS 2000: FOUNDATIONS OF SOFTWARE TECHNOLOGY AND THEORETICAL COMPUTER SCIENCE, PROCEEDINGS, 2000, 1974 : 214 - 226
  • [25] When size does matter - Termination analysis for typed logic programs
    Vanhoof, W
    Bruynooghe, M
    LOGIC BASED PROGRAM SYNTHESIS AND TRANSFORMATION, 2002, 2372 : 129 - 147
  • [26] EFFICIENT RUN-TIME TYPE CHECKING OF TYPED LOGIC PROGRAMS
    DART, PW
    ZOBEL, J
    JOURNAL OF LOGIC PROGRAMMING, 1992, 14 (1-2): : 31 - 69
  • [27] SteelCore: An Extensible Concurrent Separation Logic for Effectful Dependently Typed Programs
    Swamy, Nikhil
    Rastogi, Aseem
    Fromherz, Aymeric
    Merigoux, Denis
    Ahman, Danel
    Martinez, Guido
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2020, 4 (ICFP):
  • [28] Dynamic witnesses for static type errors (or, Ill-Typed Programs Usually Go Wrong)
    Seidel, Eric L.
    Jhala, Ranjit
    Weimer, Westley
    JOURNAL OF FUNCTIONAL PROGRAMMING, 2018, 28
  • [29] Dynamic Witnesses for Static Type Errors* (or, Ill-Typed Programs Usually Go Wrong)
    Seidel, Eric L.
    Jhala, Ranjit
    Weimer, Westley
    ACM SIGPLAN NOTICES, 2016, 51 (09) : 228 - 242
  • [30] WELL - AN EVALUATION PROCEDURE FOR ALL LOGIC PROGRAMS
    BIDOIT, N
    LEGAY, P
    LECTURE NOTES IN COMPUTER SCIENCE, 1990, 470 : 336 - 348