Cut & Paste — defining the impure primitives of Prolog
Prolog consists of the Horn Clause subset of predicate logic interpreted by a fixed (left to right, depth first) evaluation strategy and a number of non-logical primitive predicates. The most fundamental of these are ‘cut’ for control of execution, ‘assert’ and ‘retract’ for changing the database, and input-output. Whatever the desirability of these features for the logic programming languages of the future there is general agreement as to the need of these for Prolog as a practical programming language for today.
Despite their apparently simple definition there is considerable diversity in the details of the implementation of these primitives and some experiments to demonstrate this diversity are reported. We then suggest definitions that could be agreed and implemented by everyone.
KeywordsPredicate Logic Horn Clause Prolog Program Logic Programming Language Prolog System
Unable to display preview. Download preview PDF.
- G. Smolke: Making Control and Data Flow in Logic Programs Explicit. 1984 ACM Functional Programming Conferences. p311–322.Google Scholar
- D.H.D. Warren, L.M. Pereira, F.C.N. Pereira: PROLOG — The language and its implementation compared with Lisp. Proc. Symposium on Artificial Intelligence and Programming Languages, 1977. SIGPLAN Vol. 12 (8).Google Scholar
- D.H.D. Warren: Sequential and Parallel Implementations of Prolog. Seminar at Imperial College 1986.Google Scholar