Relation which asserts first item in list equivalent to
x for goal == #s:
(caro (grape raisin pear) x) ;; #s iff x == grape ;; (grape)
(define caro (lambda (p a) (fresh (d) (== (cons a d) p))))
car takes 1 argument (a list)
caro takes 2 arguments (a list
p and a variable
Also observe this is declarative.
We simply say that given a list
p and a variable,
a appended to a fresh variable has to give us
It does not talk about the procedure we go through to get the head element of the list.
We do not deconstruct
(define caro (lambda (p a) (fresh (d) (conso a d p))))