If you have trouble with getting Lisp or Prolog running, please contact me (via email) ASAP! Getting into programming in these languages should have as few barriers as possible. Setting up your programming environment should not be a struggle.
Name: Chris Millward
Email: cmillward at ucf dot edu
Office: ENG3 303
Office hours: Tues. and Thurs. 10am-11am
If you cannot come during office hours, email me and we can set up a meeting.
I recommend that you use a Common Lisp environment for programming for this class. There are many choices, and it is a standard that is used in many areas. Also, I am most familiar with it, so I will be able to help you with this if you are having trouble. You have a few choices:
If you are attempting to run simple examples in the Lisp interpreter,
such as (setq d '(1 2 3))
you might recieve a warning such-as
; in: LAMBDA NIL
; (SETQ D '(1 2 3))
;
; caught WARNING:
; undefined variable: D
;
; caught WARNING:
; This variable is undefined:
; D
;
; compilation unit finished
; caught 2 WARNING conditions
In order to not get these warnings, you should just declare the
variables before you use them. So, to define D
to be a variable,
enter (defvar d)
. D
is now a global variable that you can assign
at will.
I recommend using Lispworks. They offer a free personal version for all operating systems. It is very easy to install, and gives you a powerful environment. Both it and Allegro CL offer free trial versions that include a whole delevoping environment.
sbcl
If [BACKSPACE] is causing \^H to be inserted into the string, then hitting CTRL-H should act as backspace within the interpreter.
To load a file named test.l
that you have written at command line
type (load 'test.l)
As with Lisp you have the option of either using the software provided on the olympus server, or installing a local version on your own machine.
There are many different Prolog implementations, but the one we will
recommend for this course is
SWI-Prolog.
It is cross-platform and includes a complete environment (including an
integrated editor).
Using the Prolog environment provided on Olympus is another good option.
gprolog
.
This will bring you into the Prolog shell.The prompt for calling predicates in Prolog looks like | ?-
To define a new predicate, say mother(X,Y)
[user].
you are now able to define predicates, so enter:
mother(martha,george).
mother(linda,paul).
mother(gracie,lacy).
When you are done defining predicates, and want to be able to
query them, simply press CTL-D
to return you to the prompt.
If you want to develop your Prolog programs in a text editor, and then load them into the interpreter, so that you have a copy of them (recommended) - then follow below.
To connect to Olympus you will need a ssh client.
The address is olympus.acs.ucf.edu
, and you must use the username
and password provided to you by the department. If you have troubles
with this please contact the Computer Help
Desk by email or phone (407) 823-5117.