All Manuals > KnowledgeWorks and Prolog User Guide > Appendix A: Common Prolog

A.1 Introduction

A.1.1 Overview

Common Prolog is a logic programming system within Common Lisp. It conforms closely to Edinburgh Prolog and at the same time integrates well with Lisp. The basic syntax of Common Prolog is Lisp-like, but an Edinburgh syntax translator is included that provides the ability to use pre-existing code. The implementation of Common Prolog was motivated by the desire to use the logic programming paradigm without having to give up the advantages of a Lisp development environment. Common Prolog is tightly integrated with Lisp and can be easily used in a mixed fashion with Lisp definitions even within the same source file. Common Prolog predicates are compiled into Lisp functions which may then be compiled by a standard Lisp compiler. Substantial effort has gone into providing a powerful debugging environment for Common Prolog, so that it can be used when building serious applications. The implementation of Common Prolog is based loosely on the Warren Abstract Machine (WAM) modified to take advantage of a Lisp environment's built in support for control flow and memory allocation. (For more details of the WAM, see An Abstract Prolog Instruction Set, by David H D Warren, Technical Note 309, SRI International, October 1983.)

A.1.1.1 Starting Common Prolog

Common Prolog may be loaded into an image with the function call:

(require "prolog")

This will load the Common Prolog system. If Common Prolog will be used extensively, it may be worthwhile to save an image with it pre-loaded. Alternatively, you may simply insert the call above into your LispWorks initialization file (usually .lispworks).

For information about saving an image and the LispWorks initialization file, see the Release Notes and Installation Guide.

Note: If you load KnowledgeWorks, then Common Prolog is loaded as part of this.


KnowledgeWorks and Prolog User Guide (Windows version) - 01 Dec 2021 19:36:05