Hello,

I try to get a grasp, how to use Pilog properly. As I thought it resembles Prolog but only with a Lisp-ish syntax, I tried to implement the both Prolog rules for member/2 and append/3 in Pilog. But I guess, I did not really understand Pilog properly, as I cannot get the definitions to work correctly.


The Prolog definitions are:

  member(X, [X|_]).
  member(X, [_|T]) :- member(X, T).

  append([], L, L).
  append([H|L1], L2, [H|L3]) :- append(L1, L2, L3).

I already fail defining a correct Pilog member. This is, what I already got:

  (be mymember (@ NIL) T)
  (be mymember (@X @L) (equal (-> @X) (car (-> @L))))
  (be mymember (@X @L) (mymember @X (cdr (-> @L))))

But if I try, for instance,  (prove (goal '((mymember '2 '(1 2 3)))))
it seems to run forever ...

Can someone please shed some light on my, how to define member/2 and append/3 in Pilog properly?

Thanks in advance ...

Ciao,
Cle.


--
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to