On 1/31/2018 2:51 PM, Matthias Felleisen wrote:
> On Jan 31, 2018, at 2:15 PM, George Neuner <[email protected]> wrote:
> > > On 1/31/2018 2:10 PM, Sam Caldwell wrote:
>> Your definition of `ancestor` is one or two steps of parentage:
>> >> > ancestor(A, B) :- parent(A, B).
>> > ancestor(A, B) :-
>>       parent(A, C),
>>       parent(C, B).
>> >> I suspect you want one of those lines to appeal to the `ancestor` relation to allow longer chains. > > Knowing nothing about datalog he asks naively: > > Shouldn't the rule ancestor(A, B) :- parent(A, C), parent(C, B). be applied recursively?


It is — except that there’s no recursion.


> Kevin's definition would work in Prolog.


No it wouldn’t.

Sorry ... brain freeze.   Somehow I misread Kevin's code as being

      ancestor(A, B) :- parent(A, C), ancestor(C, B).

which would work.    You and Sam both are absolutely correct that it does not work as written.

Apologies for the noise.
George


--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to