UBC Theses and Dissertations

UBC Theses Logo

UBC Theses and Dissertations

xpProlog : high performance extended pure prolog Lüdemann, Peter Gerald

Abstract

Adhering to the principles of logic programming results in greater expressiveness than is obtained by using the many non-logical features which have been grafted onto current logic programming languages such as Prolog. This report describes an alternative approach to high performance logic programming in which the language and its implementation were designed together. Prolog's non-logical features are discarded and new logical ones are added. Extended pure Prolog (xpProlog) is a superset of conventional Prolog; it is sufficient in itself, without any need for "impure" non-logical predicates. This gives both greater expressiveness and better performance than conventional Prologs. XpProlog programs have the following advantages over conventional Prolog programs: • They are often easier to understand because their meaning does not rely on the underlying computational mechanism. • Coroutining, automatic delaying and sound negation are available. • As technology improves, better implementations and optimization techniques can be used without affecting existing programs. This report covers: • The proper use of logic programming. • How Prolog must be changed to become a good logic programming language (xpProlog). • Sound negation and coroutining. • An efficient abstract machine (xpPAM) which can be efficiently emulated on conventional machines, translated to conventional machine code, or implemented in special purpose hardware. • How to compile extended Prolog and functional (applicative) languages to the abstract machine or to conventional machine code. • Discussion of alternative Prolog abstract machine designs. The xpProlog Abstract Machine's design allows: • Performance similar to the Warren Abstract Machine (WAM) for sequential programs. • Tail recursion optimization (TRO). • Parallelism and coroutining with full backtracking. • Dynamic optimization of clause order. • Efficient if-then-else ("shallow" backtracking). • Simple, regular instruction set for easily optimized compilation. • Efficient memory utilization. • Integrated object-oriented virtual memory. • Predicates as first-class objects. • Simple extension to functional programming. C.R. categories: 1.2.5: Prolog; D.1.3: concurrent programming; D.3.2: very high level languages; D.3.3: language constructs: coroutines, backtracking; D.3.4: 1 interpreters.; 1.2.3: logic programming.

Item Media

Item Citations and Data

Rights

For non-commercial purposes only, such as research, private study and education. Additional conditions apply, see Terms of Use https://open.library.ubc.ca/terms_of_use.