Using Modes to Ensure Subject Reduction for Typed Logic Programs with Subtyping
نویسندگان
چکیده
We consider a general prescriptive type system with parametric polymorphism and subtyping for logic programs. The property of subject reduction expresses the consistency of the type system w.r.t. the execution model: if a program is"well-typed", then all derivations starting in a"well-typed"goal are again"well-typed". It is well-established that without subtyping, this property is readily obtained for logic programs w.r.t. their standard (untyped) execution model. Here we give syntactic conditions that ensure subject reduction also in the presence of general subtyping relations between type constructors. The idea is to consider logic programs with a fixed dataflow, given by modes.
منابع مشابه
Typing constraint logic programs
We present a prescriptive type system with parametric polymorphism and subtyping for constraint logic programs. The aim of this type system is to detect programming errors statically. It introduces a type discipline for constraint logic programs and modules, while maintaining the capabilities of performing the usual coercions between constraint domains, and of typing meta-programming predicates...
متن کاملSubtyping, Modular Specification, and Modular Verification for Applicative Object-Oriented Programs
We present a formal specification language and a formal verification logic for a simple object-oriented programming language. The language is applicative and statically typed, and supports subtyping and messagepassing. The verification logic relies on a behavioral notion of subtyping that captures the intuition that a subtype behaves like its supertypes. We give a formal definition for legal su...
متن کاملTyped operational semantics for higher-order subtyping
Bounded operator abstraction is a language construct relevant to object oriented programming languages and to ML2000, the successor to Standard ML. In this paper, we introduce Fω ≤, a variant of Fω <: with this feature and with Cardelli and Wegner’s kernel Fun rule for quantifiers. We define a typed operational semantics with subtyping and prove that it is equivalent with Fω ≤, using a Kripke m...
متن کاملTyped Constraint Logic Programs: checking domain coercions and metaprograms through subtyping
متن کامل
Subject Reduction of Logic Programs as Proof-Theoretic Property
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-t...
متن کامل