[Next] [Up] [Previous] [Contents]
Next: Built-in Data and Types Up: Tutorial Previous: Tutorial   Contents

Running the Interpreter

The current implementation of $ \alpha $Prolog is an interpreter written in Ocaml and using no libraries or extensions. Therefore, it runs on any computer system that Ocaml 3.06 runs on. If you haven't already, get the $ \alpha $Prolog source distribution and install it according to the accompanying instructions.

After starting $ \alpha $Prolog, you will see a banner followed by:

AlphaProlog 0.3
?-
The toplevel loop prompt ?- indicates that $ \alpha $Prolog is expecting a query. In the toplevel loop, you can't define any new types, predicates, or functions, or add any facts or clauses to the database. Since no external declarations have been loaded, we can only ask queries involving built-in predicates/functions.

Let's start with evaluation (is). Type

?- X is 1 + 2.
You should see
Yes.
X = 3
The interpreter now waits for further input from you. If you type ; in response to this, the interpreter looks for another solution. In this case, there isn't one:
;
No.



James Cheney 2003-10-23