Results 1  10
of
37
A Lightweight Implementation of Generics and Dynamics
, 2002
"... The recent years have seen a number of proposals for extending statically typed languages by dynamics or generics. Most proposals  if not all  require significant extensions to the underlying language. In this paper we show that this need not be the case. We propose a particularly lightweight ..."
Abstract

Cited by 77 (5 self)
 Add to MetaCart
(Show Context)
The recent years have seen a number of proposals for extending statically typed languages by dynamics or generics. Most proposals  if not all  require significant extensions to the underlying language. In this paper we show that this need not be the case. We propose a particularly lightweight extension that supports both dynamics and generics. Furthermore, the two features are smoothly integrated: dynamic values, for instance, can be passed to generic functions. Our proposal makes do with a standard HindleyMilner type system augmented by existential types. Building upon these ideas we have implemented a small library that is readily usable both with Hugs and with the Glasgow Haskell compiler.
Typed Prolog: A Semantic Reconstruction of the MycroftO'Keefe Type System
, 1991
"... Mycroft and O'Keefe [25] presented a declarationbased type system for Prolog. However, they did not clarify the semantics of the type system, leading to several criticisms being voiced against it. We propose that the language accepted by this type system be viewed as a typed variant of Prolog ..."
Abstract

Cited by 58 (2 self)
 Add to MetaCart
(Show Context)
Mycroft and O'Keefe [25] presented a declarationbased type system for Prolog. However, they did not clarify the semantics of the type system, leading to several criticisms being voiced against it. We propose that the language accepted by this type system be viewed as a typed variant of Prolog, called Typed Prolog. We dene the formal semantics of Typed Prolog along the lines of manysorted logic and polymorphic lambda calculus. Typed Prolog also supports a form of type inference called type reconstruction which takes a Typed Prolog program with missing type declarations, and reconstructs the most general type declarations satisfying the language denition. This approach contrasts with the inference based type systems which have been widely pursued heretofore. 1
Type Inferencing for Polymorphic OrderSorted Logic Programs
 PROCEEDINGS OF THE TWELFTH INTERNATIONAL CONFERENCE ON LOGIC PROGRAMMING
, 1995
"... The purpose of this paper is to study the problem of complete type inferencing for polymorphic ordersorted logic programs. We show that previous approaches are incomplete even if one does not employ the full power of the used type systems. We present a complete type inferencing algorithm that cover ..."
Abstract

Cited by 24 (1 self)
 Add to MetaCart
(Show Context)
The purpose of this paper is to study the problem of complete type inferencing for polymorphic ordersorted logic programs. We show that previous approaches are incomplete even if one does not employ the full power of the used type systems. We present a complete type inferencing algorithm that covers the polymorphic ordersorted types in PROTOSL, a logic programming language that allows for polymorphism as in ML and for hierarchically structured monomorphic types.
Implementing Polymorphic Typing in a Logic Programming Language
 COMPUTER LANGUAGES
, 1993
"... Introducing types into a logic programming language leads to the need for typed unification within the computation model. In the presence of polymorphism and higherorder features, this aspect forces analysis of types at runtime. We propose extensions to the Warren Abstract Machine (WAM) that permi ..."
Abstract

Cited by 18 (11 self)
 Add to MetaCart
Introducing types into a logic programming language leads to the need for typed unification within the computation model. In the presence of polymorphism and higherorder features, this aspect forces analysis of types at runtime. We propose extensions to the Warren Abstract Machine (WAM) that permit such analysis to be done with reasonable efficiency. Much information about the structures of types is present at compiletime, and we show that this information can be used to considerably reduce the work during execution. We illustrate our ideas in the context of a typed version of Prolog. We describe a modified representation for terms, new instructions and additional data areas that in conjunction with existing WAM structures suffice to implement this language. The nature of compiled code is illustrated through examples, and the kind of runtime overheads that are incurred for processing types is analyzed, especially in those cases where others have shown that type checking can be eliminated during execution. The ideas
Prolog's Control Constructs in a Functional . . .
 INTERNATIONAL JOURNAL OF FOUNDATIONS OF COMPUTER SCIENCE
"... The purpose of this article is twofold. First, we show that Prolog's control constructs can be smoothly integrated into a functional language like Haskell. The resulting `language', termed embedded Prolog, incorporates many of the features prescribed by the Prolog ISO standard: control ..."
Abstract

Cited by 13 (6 self)
 Add to MetaCart
The purpose of this article is twofold. First, we show that Prolog's control constructs can be smoothly integrated into a functional language like Haskell. The resulting `language', termed embedded Prolog, incorporates many of the features prescribed by the Prolog ISO standard: control constructs including the cut, all solution collecting functions, and error handling facilities. Embedded Prolog lacks some concepts such as logical variables but it inherits all of Haskell's strengths, eg static polymorphic typing, higher order functions etc. Technically, the integration is achieved using monads and monad transformers. One of the main innovations is the de nition of a backtracking monad transformer, which allows us to combine backtracking with exception handling and interaction. Second, we work towards an axiomatization of the operations, through which the computational features are accessed. Equations are used to lay down the meaning of the various operations and their interrelations enabling the programmer to reason about programs in a simple calculational style. The axiomatization is applied to show that each nite computation has a simple canonical form.
A typed foundation for directional logic programming
 In Proc. Workshop on Extensions to Logic Programming
, 1992
"... Abstract. A long standing problem in logic programming is how to impose directionality on programs in a safe fashion. The benefits of directionality include freedom from explicit sequential control, the ability to reason about algorithmic properties of programs (such as termination, complexity and d ..."
Abstract

Cited by 12 (1 self)
 Add to MetaCart
(Show Context)
Abstract. A long standing problem in logic programming is how to impose directionality on programs in a safe fashion. The benefits of directionality include freedom from explicit sequential control, the ability to reason about algorithmic properties of programs (such as termination, complexity and deadlockfreedom) and controlling concurrency. By using Girard’s linear logic, we are able to devise a type system that combines types and modes into a unified framework, and enables one to express directionality declaratively. The rich power of the type system allows outputs to be embedded in inputs and vice versa. Type checking guarantees that values have unique producers, but multiple consumers are still possible. From a theoretical point of view, this work provides a “logic programming interpretation ” of (the proofs of) linear logic, adding to the concurrency and functional programming interpretations that are already known. It also brings logic programming into the broader world of typed languages and typesaspropositions paradigm, enriching it with static scoping and higherorder features.
Refinement of a typed WAM extension by polymorphic ordersorted types
, 1996
"... We refine the mathematical specification of a WAM extension to typeconstraint logic programming given in [BB96]. We provide a full specification and correctness proof of the PROTOS Abstract Machine (PAM), an extension of the WAM by polymorphic ordersorted unification as required by the logic pro ..."
Abstract

Cited by 10 (4 self)
 Add to MetaCart
We refine the mathematical specification of a WAM extension to typeconstraint logic programming given in [BB96]. We provide a full specification and correctness proof of the PROTOS Abstract Machine (PAM), an extension of the WAM by polymorphic ordersorted unification as required by the logic programming language PROTOSL, by refining the abstract type constraints used in [BB96] to the polymorphic ordersorted types of PROTOSL. This allows us to develop a detailed and mathematically precise account of the PAM's compiled type constraint representation and solving facilities, and to extend the correctness theorem to compilation on the fully specified PAM.
Using Modes to Ensure Subject Reduction for Typed Logic Programs with Subtyping
, 2000
"... 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 welltyped, then all derivations starting in a welltyped goal are ..."
Abstract

Cited by 8 (7 self)
 Add to MetaCart
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 welltyped, then all derivations starting in a welltyped goal are again welltyped. It is wellestablished 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 xed dataow, given by modes.
Typed static analysis: Application to groundness analysis of prolog and lambdaprolog
 In Proceedings of the International Symposium on Functional and Logic Programming. LNCS
, 1999
"... ..."
(Show Context)
On the Use of Types in Logic Programming
, 1996
"... In procedural and functional languages it is rather clear what a type error is and the main purpose of typing is to detect programming errors automatically. Furthermore, in these languages the semantics of a program is usually independent of types. Type systems for logic programming languages differ ..."
Abstract

Cited by 5 (3 self)
 Add to MetaCart
In procedural and functional languages it is rather clear what a type error is and the main purpose of typing is to detect programming errors automatically. Furthermore, in these languages the semantics of a program is usually independent of types. Type systems for logic programming languages differ considerably on these aspects. We will show that these differences lead to several theoretical and practical problems. The mixture of static type checking purposes on the one hand and computations with type constraints in the CLP(X) style on the other hand will be marked as the central source of problems. As a solution we propose a typing scheme which separates these issues. We distinguish three almost independent dimensions of types in logic programming: types as approximations, types as constraints and types for proving partial correctness. Based on the notion of useless expressions, we develop a method that allows static program analysis for finding type errors, which enables error detec...