Re: deductive databases

From: alex goldman <hello_at_spamm.er>
Date: Sat, 14 May 2005 07:48:07 -0700
Message-Id: <1143313.uAvcIbnWMH_at_yahoo.com>


Robert Low wrote:

> alex goldman wrote:

>> VC wrote:
>>>b. car(cons(X,Y), X).  If it's Lisp,  the expression does not make sense.
>>>If it's a Prolog 'functor', it does not make any sense either.
>> In the future, please add qualifiers like "to me" to silly statements
>> like the above. Car of a cons, consisting of X and Y, is X.

>
> But what is car(cons(X,Y),X)?

It's a relation (whereas in Lips, it would be a function)

> That looks like it's feeding
> car two things, namely cons(X,Y) and X. I understand car eats
> a list and spits out the first element of the list,

In Lisp. More acctuarately, it takes a cons cell (which does not have to be a /proper/ list) and returns its first element.

(cons '(1 . 2)) -> 1

In Lisp, it's an elementary function. In prolog, we define a corresponding /relation/ (of arity 2) stating that car of a cons is its first element.

> but
> have no idea what it does with a pair of objects.

Relations don't "do" anything. Inference procedures do. Relations just state properties. Unlike Lisp, in Prolog you can also ask `reverse` questions like what object is this a cons of? Received on Sat May 14 2005 - 16:48:07 CEST

Original text of this message