Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!portc01.blue.aol.com!newsxfer2.itd.umich.edu!howland.erols.net!usc!news.isi.edu!gremlin!shomase!jbarnett
From: jbarnett@shomase.NoSubdomain.NoDomain (Jeff Barnett)
Subject: Re: lisp question
Message-ID: <Dyo3AL.uF@gremlin.nrtc.northrop.com>
Sender: news@gremlin.nrtc.northrop.com (Usenet News Manager)
Reply-To: jbarnett@charming.nrtc.northrop.com
Organization: Northrop Automation Sciences Laboratory
References: <3249E5A2.C98@uwaterloo.ca> <324FF127.491C@ccs.neu.edu> <ymi4tkew9h5.fsf@hobbes.isi.edu>
Date: Wed, 2 Oct 1996 21:20:44 GMT
Lines: 40

In article <ymi4tkew9h5.fsf@hobbes.isi.edu>, tar@ISI.EDU (Thomas A. Russ) writes:
|> In article <324FF127.491C@ccs.neu.edu> William D Clinger <will@ccs.neu.edu> writes:
|>  >         1) CAR(CONS(x,y)) = x
|>  >         2) CDR(CONS(x,y)) = y
|>  >         3) if not ATOM(x), then CONS(CAR(x), CDR(x)) = x
|>  >         4) not ATOM(CONS(x,y))
|>  > 
|>  > These four formulas, taken together, imply that CONS is
|>  > a pairing function with projections CAR and CDR.

If you add the induction axiom
    5) if   (P(a) for all a in A) and 
            (P(x) and P(y) imply P(CONS(x,y)))
       then P(z) for all z in A union N
where A is the set of atoms, N is the non atoms in your model, and
P is a predicate.  Now this set of axioms defines Peano integers
of the second kind.  Here, CONS is the succesor function, and CAR
and CDR are both predecessor functions.  (Forget for a moment that
most Lisps make CAR(nil) = CDR(nil) = nil and take a different view
on whether nil is in A or N.)  With this system, we have the same
proof mechanisms for our programs that the logicans have for number
theory given the normal Peano axioms:
      1+2)  pred(suc(x)) = x
        3)  if x not 0, then suc(pred(x)) = x
        4)  not suc(x) = 0
        5   if   P(0) and P(x) implies P(suc(x))
            then for all x, P(x)
BTW, I think this set of axioms was taught at MIT, in the early
1960s, to all Lisp hackers who wandered into a model theory
class.

Jeff Barnett

PS For those who want a challenge: What are all the finite models
of the above axioms?  (Up to isomorphism, naturally.)  Finite
means that both A and N are finite sets.  In order to make this
meaningful, assume that axioms 1-4 are cast in a first order
language and that axiom 5 quantifies P in an extended logic that
allows such things.  BTW, could you do this homework without axiom
5?  Why or why not?
