Results 1 - 10
of
45
Static Inference of Modes and Data Dependencies in Logic Programs
- ACM Transactions on Programming Languages and Systems
, 1989
"... Abstract: Mode and data dependency analyses find many applications in the generation of efficient exe-cutable code for logic programs. For example, mode information can be used to generate specialized unification instructions where permissible; to detect determinacy and functionality of programs; to ..."
Abstract
-
Cited by 86 (5 self)
- Add to MetaCart
Abstract: Mode and data dependency analyses find many applications in the generation of efficient exe-cutable code for logic programs. For example, mode information can be used to generate specialized unification instructions where permissible; to detect determinacy and functionality of programs; to gen-erate index structures more intelligently; to reduce the amount of runtime tests in systems that support goal suspension; and in the integration of logic and functional languages. Data dependency information can be used for various source-level optimizing transformations, to improve backtracking behavior, and to parallelize logic programs. This paper describes and proves correct an algorithm for the static infer-ence of modes and data dependencies in a program. The algorithm is shown to be quite efficient for pro-grams commonly encountered in practice.
Automatic Mode Inference for Logic Programs
- Journal of Logic Programming
, 1988
"... In general, logic programs are undirected, i.e. there is no concept of "input" and "output" arguments to a procedure. An argument may be used either as an input or as an output argument, and programs may be executed either in a "forward" direction or in a "backward" direction. However, it is often t ..."
Abstract
-
Cited by 69 (7 self)
- Add to MetaCart
In general, logic programs are undirected, i.e. there is no concept of "input" and "output" arguments to a procedure. An argument may be used either as an input or as an output argument, and programs may be executed either in a "forward" direction or in a "backward" direction. However, it is often the case that in a given program, a predicate is used with some of its arguments used consistently as input arguments and others as output arguments. Such mode information can be used by a compiler to effect various optimizations. This paper considers the problem of automatically inferring the modes of the predicates in a program. The dataflow analysis we use is more powerful than approaches relying on syntactic characteristics of programs, e.g. [18]. Our work differs from that of Mellish [14, 15] in that (i) we give a sound and efficient treatment of variable aliasing in mode inference; (ii) by propagating instantiation information using state transformations rather than through dependen...
An Efficient Easily Adaptable System for Interpreting Natural Language Queries
, 1982
"... This paper gives an overall account of a prototype natural language question answering system, called Chat-80. Chat-80 has been designed to be both efficient and easily adaptable to a variety of applications. The system is implemented entirely in Prolog, a programming language based on logic. With t ..."
Abstract
-
Cited by 68 (3 self)
- Add to MetaCart
This paper gives an overall account of a prototype natural language question answering system, called Chat-80. Chat-80 has been designed to be both efficient and easily adaptable to a variety of applications. The system is implemented entirely in Prolog, a programming language based on logic. With the aid of a logic-based grammar formalism called extraposition grammars, Chat-80 translates English questions into the Prolog subset of logic. The resulting logical expression is then transformed by a planning algorithm into efficient Prolog, cf. "query optimisation" in a relational database. Finally, the Prolog form is executed to yield the answer. On a domain of world geography, most questions within the English subset are answered in well under one second, including relatively complex queries
Functional computations in logic programs
- ACM Transactions on Programming Languages and Systems
, 1989
"... Abstract: While the ability to simulate nondeterminism and compute multiple solutions for a single query is a powerful and attractive feature of logic programming languages, it is expensive in both time and space. Since programs in such languages are very often functional, i.e. do not produce more t ..."
Abstract
-
Cited by 51 (11 self)
- Add to MetaCart
Abstract: While the ability to simulate nondeterminism and compute multiple solutions for a single query is a powerful and attractive feature of logic programming languages, it is expensive in both time and space. Since programs in such languages are very often functional, i.e. do not produce more than one distinct solution for a single input, this overhead is especially undesirable. This paper describes how pro-grams may be analyzed statically to determine which literals and predicates are functional, and how the program may then be optimized using this information. Our notion of ‘‘functionality’ ’ subsumes the notion of ‘‘determinacy’ ’ that has been considered by various researchers. Our algorithm is less reliant on language features such as the cut, and thus extends more easily to parallel execution strategies, than others that have been proposed.
On the Complexity of Dataflow Analysis of Logic Programs
, 1992
"... This article reports some results on this correlation in the context of logic programs. A formal notion of the "precision" of an analysis algorithm is proposed, and this is used to characterize the worst-case computational complexity of a number of dataflow analyses with different degrees of precisi ..."
Abstract
-
Cited by 35 (4 self)
- Add to MetaCart
This article reports some results on this correlation in the context of logic programs. A formal notion of the "precision" of an analysis algorithm is proposed, and this is used to characterize the worst-case computational complexity of a number of dataflow analyses with different degrees of precision. While this article considers the analysis of logic programs, the technique proposed, namely the use of "exactness sets" to study relationships between complexity and precision of analyses, is not specific to logic programming in any way, and is equally applicable to flow analyses of other language families.
Retrieving Re-Usable Software Components By Polymorphic Type
, 1991
"... Polymorphic types are labels classifying both (a) defined components in a library and (b) contexts of free variables in partially written programs. We propose to help programmers make better use of software libraries by providing a system that, given (b), identifies candidates from (a) with matching ..."
Abstract
-
Cited by 30 (1 self)
- Add to MetaCart
Polymorphic types are labels classifying both (a) defined components in a library and (b) contexts of free variables in partially written programs. We propose to help programmers make better use of software libraries by providing a system that, given (b), identifies candidates from (a) with matching types. Assuming at first that matching means unifying (ie having a common instance) we discuss efficient ways of implementing such a retrieval system, and also indicate its likely effectiveness based on a quantitative study of currently available libraries. Later we introduce the applicative instance relation between types, which captures some intuitions about generalisation/specialisation, and discuss its use as the basis of a more flexible system. 1. INTRODUCTION Much programming effort can be saved by making good use of libraries of pre-defined components. In a functional language the majority of such components are functions and many of them are higher order functions, extensive use o...
An Implementation of Standard ML Modules
- In ACM Conf. on Lisp and Functional Programming
, 1988
"... Standard ML includes a set of module constructs that support programming in the large. These constructs extend ML's basic polymorphic type system by introducing the dependent types of Martin Lo"f's Intuitionistic Type Theory. This paper discusses the problems involved in implementing Standard ML's m ..."
Abstract
-
Cited by 29 (3 self)
- Add to MetaCart
Standard ML includes a set of module constructs that support programming in the large. These constructs extend ML's basic polymorphic type system by introducing the dependent types of Martin Lo"f's Intuitionistic Type Theory. This paper discusses the problems involved in implementing Standard ML's modules and describes a practical, efficient solution to these problems. The representations and algorithms of this implementation were inspired by a detailed formal semantics of Standard ML developed by Milner, Tofte, and Harper. The implementation is part of a new Standard ML compiler that is written in Standard ML using the module system. March 11, An Implementation of Standard ML Modules David MacQueen AT&T Bell Laboratories Murray Hill, NJ 07974 1. Introduction An important part of the revision of ML that led to the Standard ML language was the inclusion of module facilities for the support of "programming in the large." The design of these facilities went through several versions [...
Mode and Termination Checking for Higher-Order Logic Programs
- In Hanne Riis Nielson, editor, Proceedings of the European Symposium on Programming
, 1996
"... . We consider how mode (such as input and output) and termination properties of typed higher-order constraint logic programming languages may be declared and checked effectively. The systems that we present have been validated through an implementation and numerous case studies. 1 Introduction Jus ..."
Abstract
-
Cited by 29 (10 self)
- Add to MetaCart
. We consider how mode (such as input and output) and termination properties of typed higher-order constraint logic programming languages may be declared and checked effectively. The systems that we present have been validated through an implementation and numerous case studies. 1 Introduction Just like other paradigms logic programming benefits tremendously from types. Perhaps most importantly, types allow the early detection of errors when a program is checked against a type specification. With some notable exceptions most type systems proposed for logic programming languages to date (see [18]) are concerned with the declarative semantics of programs, for example, in terms of many-sorted, order-sorted, or higher-order logic. Operational properties of logic programs which are vital for their correctness can thus neither be expressed nor checked and errors will remain undetected. In this paper we consider how the declaration and checking of mode (such as input and output) and termina...
Prolog: The language and its implementation compared with Lisp
- ACM SIGPLAN Notices
, 1977
"... Prolog is a Simple but powerful programming language founded on symbolic logic. The basic computational mechanism is a pattern matching process ("unification") operating on general record structures ("terms " of logic). We briefly review the language and compare it especially wit ..."
Abstract
-
Cited by 22 (2 self)
- Add to MetaCart
Prolog is a Simple but powerful programming language founded on symbolic logic. The basic computational mechanism is a pattern matching process ("unification") operating on general record structures ("terms " of logic). We briefly review the language and compare it especially with pure Lisp. The remainder of the paper discusses techniques for implementing Prolog efficiently; in particular we describe how to compile the patterns involved in the matching process. These techniques are as incorporated in our DECsystem-lO Prolog compiler (written in Prolog). The code it generates is comparable in speed with that prod-uced by existing DECIO Lisp compilers. We argue that pattern matching is a better method for expressing operations on structured data than conventional selectors and constructors- both for the user and for the implementor.
Parameter Passing and Control Stack Management in Prolog Implementation Revisited
- ACM Transactions on Programming Languages and Systems
, 1994
"... Machine (WAM), the most widely used abstract machine for Prolog implementation, arguments are passed through argument registers, and the information associated with procedure calls is stored in possibly two frames. Although accessing registers is faster than accessing memory, this scheme requires th ..."
Abstract
-
Cited by 16 (13 self)
- Add to MetaCart
Machine (WAM), the most widely used abstract machine for Prolog implementation, arguments are passed through argument registers, and the information associated with procedure calls is stored in possibly two frames. Although accessing registers is faster than accessing memory, this scheme requires the argument registers to be saved and restored for backtracking and makes it difficult to implement full tail recursion elimination. These disadvantages may far outweigh the advantage in emulator-based implementations because registers are actually simulated by using memory. In this article, we reconsider the two crucial issues and describe a new abstract machine called ATOAM (yet Another Tree-Oriented Abstract Machine) . The ATOAM differs from the WAM mainly in that (1) arguments are passed directly into stack frames, (2) only one frame is used for each procedure call, and (3) procedures are translated into matching trees if possible, and clauses in each procedure are indexed on all input ar...

