Running CLP(R)

CLP(R) is available on various platforms in CSE.

To run CLP(R) on the instructional linux machines (e.g. ceylon), the executable file is /cse/courses/misc_lang/linux/clpr/bin/clpr

To access this easily, add the following line to your .cshrc file:

set path = ($path /cse/courses/misc_lang/linux/clpr/bin)
Or modify your set path=... entry appropriately if you already have one. Then you can invoke the system by just typing
clpr

To run CLP(R) on orcas or sanjuan (alphas), the executable file is /cse/courses/misc_lang/axp/clpr/bin/clpr

The system is interactive. The system prompt is
?-

You can type a query to it, for example X=[1,2,3], Y=100. Here's a transcript of this:

CLP(R) Version 1.2
(c) Copyright International Business Machines Corporation
1989 (1991, 1992) All Rights Reserved

1 ?- X=[42,Y], Y=1.

X = [42, 1]
Y = 1

*** Yes

CLP(R) has separate query and definition modes. To define some rules, put them in a file, say "mystuff". Then load them into CLP(R) using the goal consult("mystuff").

You can set up a second window to edit the file mystuff. To reload all the definitions after you've edited, use the goal reconsult("mystuff").

Or (naturally) you can run the whole thing under emacs. Start up emacs, then type <esc>x shell, then type clpr.

Example files for 505 are in the directory ~borning/505 on the instructional systems. There are various other CLP(R) programs in ~borning/clpr/progs and ~borning/clpr/myprogs.