| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: deductive databases
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.
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 - 09:48:07 CDT
![]() |
![]() |