Complex Systems, Spring 1998
Bio 367: Computational Models of Biological Organization
CS 246: Programming Paradigms


Paul Grobstein, Bryn Mawr College Department of Biology
Clare Congdon, Bryn Mawr College Computer Science Program
______________________________________________________________________

Using clisp on Mainline

The Lisp package we have on Mainline is called clisp. To run it, just type clisp at the Unix prompt; to quit, type (exit)

When you're running Lisp, you'll have a new prompt, the angle bracket. Most of the legitimate things to type should be enclosed in parentheses, such as (exit). The parentheses are absolutely important. (Some folks will claim that LISP is an acronym for Lots of Irritating and Silly Parentheses. But it really stands for LISt Processing language. The parentheses are used to denote the lists.)

Lisp curiosities

The LISP functions we care about for this lab

For this lab, we will only be using logical functions as the primitives for our genetic programming.

The last example starts to get at the flavor of Lisp expressions in general, which can be "nested" to an arbitrary depth, for example
	(and (or y (not z)) (equal (or y z) (and x y)))	
The above expression evaluates to T (which you can try out for yourself by first doing all the SETF's for the variables and then typing the expression at the Lisp prompt.) From the inside out,
  • (not z) is T, so (or y (not z)) is T
  • (or y z) is NIL
  • (and x y) is NIL
  • (equal (or y z) (and x y)) is T (both parts are NIL)
  • both arguments to the AND are T, so the whole expression is T

    It may be easier at first to type these things at the Lisp prompt rather than trying to figure it out in your head, so that you get a feel for the T and NIL convention.

    ______________________________________________________________________
    Maintained by:

    Clare Bates Congdon (ccongdon@brynmawr.edu)
    Paul Grobstein (pgrobste@brynmawr.edu)
    ______________________________________________________________________