Advertisement
logicmoo

Untitled

Apr 16th, 2017
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.16 KB | None | 0 0
  1. p([],[]).
  2. p([H|Rest],Out):- p(H,Rest,Out) .
  3.  
  4. p(f(A),Rest,[A|Rec]) :- p(Rest,Rec).
  5. p(p(A),Rest,[A|Rec]) :- p(Rest,Rec).
  6.  
  7. ?- p([f(1),g(2)],L).
  8. L = [1, 2]
  9. true.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement