Well-Typed Logic Programs Are not Wrong
Pierre Deransart, Jan-Georg Smaus

TL;DR
This paper explores the type systems of logic programs, proposing a more general condition than the traditional head condition to ensure subject reduction, and discusses its implications and relation to polymorphic recursion.
Contribution
It introduces a generalized condition for type preservation in logic programs, relaxing the traditional head condition and linking it to polymorphic recursion.
Findings
Proposes a more general condition for subject reduction in logic programs.
Establishes a connection between the head condition and polymorphic recursion.
Discusses implications for the design of type systems in logic programming.
Abstract
We consider prescriptive type systems for logic programs (as in Goedel 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 are 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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Logic, Reasoning, and Knowledge · Formal Methods in Verification
