Well-Typed Logic Programs Are not Wrong - Inria - Institut national de recherche en sciences et technologies du numérique Accéder directement au contenu
Rapport (Rapport De Recherche) Année : 2000

Well-Typed Logic Programs Are not Wrong

Pierre Deransart
  • Fonction : Auteur
  • PersonId : 833574
Jan Georg Smaus

Résumé

We consider prescriptive type systems for logic programs (as in Gödel 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 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.
Fichier principal
Vignette du fichier
RR-4082.pdf (360.64 Ko) Télécharger le fichier

Dates et versions

inria-00072551 , version 1 (24-05-2006)

Identifiants

  • HAL Id : inria-00072551 , version 1

Citer

Pierre Deransart, Jan Georg Smaus. Well-Typed Logic Programs Are not Wrong. [Research Report] RR-4082, INRIA. 2000. ⟨inria-00072551⟩
47 Consultations
134 Téléchargements

Partager

Gmail Facebook X LinkedIn More