Results 1 - 10
of
13
Polymorphically Typed Logic Programs
- Types in Logic Programming
, 1991
"... We introduce polymorphically typed logic programs, an integration of a polymorphic type system with logic programs. The first-order notion of predicates is extended to parametric predicates, which are parameterized by types. The type system accommodates both subtypes and parametric polymorphism. It ..."
Abstract
-
Cited by 25 (2 self)
- Add to MetaCart
We introduce polymorphically typed logic programs, an integration of a polymorphic type system with logic programs. The first-order notion of predicates is extended to parametric predicates, which are parameterized by types. The type system accommodates both subtypes and parametric polymorphism. It unifies features of value-based and name-based approaches. The denotation of a typed logic program is given by its type completion, a transformation that incorporates explicit type conditions into a parametric logic program. The result of the transformation is a restricted form of a HiLog program. We give fixpoint semantics to our language (actually to full HiLog). We define a notion of well-typing, which relates type declarations for predicates in the program to an approximation of the denotation of the type completed program. We present a type-checking algorithm for verifying that a program is indeed well-typed. Finally we discuss some extensions to the type system.
A First-Order Theory of Types and Polymorphism in Logic Programming
- Department of Computer Science, University at Stony Brook
, 1990
"... We describe a new logic called typed predicate calculus (T PC) that gives declarative meaning to logic programs with type declarations and type inference. T PC supports all popular types of polymorphism, such as parametric, inclusion, and ad hoc polymorphism. The proper interaction between parametri ..."
Abstract
-
Cited by 11 (5 self)
- Add to MetaCart
We describe a new logic called typed predicate calculus (T PC) that gives declarative meaning to logic programs with type declarations and type inference. T PC supports all popular types of polymorphism, such as parametric, inclusion, and ad hoc polymorphism. The proper interaction between parametric and inclusion varieties of polymorphism is achieved through a new construct, called type dependency, which is reminiscent of implication types of [PR89] but yields more natural and succinct specifications. Unlike other proposals where typing has extra-logical status, in T PC the notion of type-correctness has precise model-theoretic meaning that is independent of any specific type-checking or type-inference procedure. Moreover, many different approaches to typing that were proposed in the past can be studied and compared within the framework of our logic. As an illustration, we apply T PC to interpret and compare the results reported in [MO84, Smo88, HT90, Mis84, XW88]. Another novel featu...
From Typing Constraints to Typed Constraint Systems in CHR
, 2001
"... Typing constraint programs requires the exibility of subtyping to properly express coercions between constraint domains. The typing of constraint logic programs as done in the TCLP system for example involves solving complex subtyping constraints. In this paper we present an implementation in CHR of ..."
Abstract
-
Cited by 6 (1 self)
- Add to MetaCart
Typing constraint programs requires the exibility of subtyping to properly express coercions between constraint domains. The typing of constraint logic programs as done in the TCLP system for example involves solving complex subtyping constraints. In this paper we present an implementation in CHR of Pottier's algorithm for checking the satisfiability of subtype inequalities. We show that when combined with a CHR implementation of an untyped constraint system, a simple merge of both CHR programs gives rise to a new typed constraint system which enjoys nice semantical properties. This is illustrated with examples of typed unification and TCLP programs.
Report of the Logic Programming Language PROTOS-L
- Revised version: Working Paper 4, IBM Germany, Scientific Center, Institute for Logics and Linguistics
, 1994
"... : PROTOS-L is a language based on logic programming that integrates a variety of concepts for programming large knowledge based systems like a powerful type concept, a module concept, high-level access to external relational databases, and finite domain constraints. The type concept covers user defi ..."
Abstract
-
Cited by 5 (2 self)
- Add to MetaCart
: PROTOS-L is a language based on logic programming that integrates a variety of concepts for programming large knowledge based systems like a powerful type concept, a module concept, high-level access to external relational databases, and finite domain constraints. The type concept covers user defined sorts, subsort relationships supporting multiple inheritance and parameterized sorts in the form of polymorphism. In addition to relations, also user-defined functions are available. The module concept is similar to that of Modula-2 and allows to hide implementation details from the user of a module. Database access and modification is fully embedded in the programming language PROTOS-L and can be programmed transparent to the user of a program or a program part. Besides simple links to external relations, non-recursive as well as recursive function free deduction rules can be defined. PROTOS-L also provides an easy way to work with windows via an object-oriented interface to the OSF/Mot...
Polymorphic Types in Higher-Order Logic Programming
, 1993
"... This paper analyses the requirements to the notion of type correctness in logic programming and proposes several "adequacy" criteria for such a system. We then present a type theory for a higher-order logic programming language, HiLog [5], which is adequate in that sense. The proposed type system no ..."
Abstract
-
Cited by 4 (2 self)
- Add to MetaCart
This paper analyses the requirements to the notion of type correctness in logic programming and proposes several "adequacy" criteria for such a system. We then present a type theory for a higher-order logic programming language, HiLog [5], which is adequate in that sense. The proposed type system not only captures type errors of syntactic origin, but also ensures that all atoms true in a canonical model (such as the perfect model or the well-founded partial model) of a well-typed program are well-typed. Furthermore, type dependencies among arguments of functions and/or predicates are incorporated into the definition of welltyped terms and atoms, so that the benefits of both parametric and inclusion polymorphism are preserved. Finally types are treated as first-class objects and type declarations can be queried directly by users, making it a suitable framework for schema integration of heterogeneous databases. Keywords: types, inclusion and parametric polymorphism, type dependency, arg...
TCLP: overloading, subtyping and parametric polymorphism made practical for constraint logic programming
"... This paper is a continuation of our previous work on the TCLP type system for constraint logic programming. Here we introduce overloading in TCLP and describe a new implementation of TCLP in the Constraint Handling Rules language CHR. Overloading, that is assigning several types to symbols, e.g. ..."
Abstract
-
Cited by 4 (2 self)
- Add to MetaCart
This paper is a continuation of our previous work on the TCLP type system for constraint logic programming. Here we introduce overloading in TCLP and describe a new implementation of TCLP in the Constraint Handling Rules language CHR. Overloading, that is assigning several types to symbols, e.g. for integer and oating point arithmetic, makes it possible to avoid subtype relations like integer subtype of oat, that are not faithful to the behavior of some predicates, e.g. uni cation between an integer and its oat representation fails in ISO Prolog.
Sorted HiLog: Sorts in Higher-Order Logic Data Languages
- In Int’l Conference on Database Theory, number 893 in Lecture Notes in Computer Science
, 1994
"... HiLog enhances the modeling capabilities of deductive databases and logic programming with higher-order and meta-data constructs, complex objects, and schema browsing. Its distinctive feature, a higher-order syntax with a first-order semantics, allows for efficient implementation with speeds compara ..."
Abstract
-
Cited by 4 (0 self)
- Add to MetaCart
HiLog enhances the modeling capabilities of deductive databases and logic programming with higher-order and meta-data constructs, complex objects, and schema browsing. Its distinctive feature, a higher-order syntax with a first-order semantics, allows for efficient implementation with speeds comparable to Prolog. In fact, HiLog implementation in XSB [30, 26] together with tabulated query evaluation offers impressive performance with negligible penalty for higher-order syntax, thereby bringing the modeling capabilities of HiLog to practical realization. The lack of sorts in HiLog, however, is somewhat of a problem in database applications, which led to a number of HiLog dialects such as DataHiLog [24]. This paper develops a comprehensive theory of sorts for HiLog. It supports HiLog's flexible higher-order syntax via a polymorphic and recursive sort structure, and it offers an easy and convenient mechanism to control the rules of well-formedness. By varying the sort structure we obtain ...
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 per ..."
Abstract
-
Cited by 2 (1 self)
- Add to MetaCart
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, thanks to the exibility of subtyping. The property of subject reduction expresses the consistency of a prescriptive type system w.r.t. the execution model: if a program is \well-typed", then all derivations starting from a \well-typed" goal are again \well-typed". That property is proved w.r.t. the abstract execution model of constraint programming which proceeds by accumulation of constraints only, and w.r.t. an enriched execution model with type constraints for substitutions. We describe our implementation of the system for type checking and type inference. We report our experimental results on type checking ISO-Prolog, the (constraint) libraries of Sicstus Prolog and other Prolog programs.
Polymorphically order-sorted types in OBJ-3
, 1997
"... . OBJ--3 [GWM + 93] is a functional programming language with first-order function types. OBJ--3 has two special features: overloading of function symbols and the possibility to order the sorts. This ordering is induced by set inclusion on the carrier sets. We call the feature to be able to order ..."
Abstract
-
Cited by 2 (1 self)
- Add to MetaCart
. OBJ--3 [GWM + 93] is a functional programming language with first-order function types. OBJ--3 has two special features: overloading of function symbols and the possibility to order the sorts. This ordering is induced by set inclusion on the carrier sets. We call the feature to be able to order the sorts inclusion set subtyping. The algebraic semantics of OBJ--3 is based on the theory of order-sorted algebras [GM89]. Furthermore, OBJ--3 allows parameterized programming [Gog90]. However, the concepts of higher-order functions and parametric polymorphism are only emulated by parameters of OBJ--3 modules. In this paper we show how to extend OBJ--3 by parametric polymorphism in an elegant way. We call this extended language OBJ--P. In the second part of the paper we describe the operational semantics of OBJ--P. The operational semantics is a translation of OBJ--P programs into programs without overloading and subtypes. Here, we improve the approaches of Goguen, Jouannaud, and Mesegu...

