Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- findall(T, G, L):-
- list_new(Ls),
- (
- findall1(T, G, Ls)
- ;
- true
- ),
- list_to_prolog(Ls, L).
- findall1(T, G, Ls):-
- call(G),
- copy_term(T, C),
- list_add(Ls, C),
- fail.
- findall_set(T, G, L):-
- set_new(Ls),
- (
- findall_set1(T, G, Ls)
- ;
- true
- ),
- set_to_prolog(Ls, L).
- findall_set1(T, G, Ls):-
- call(G),
- copy_term(T, C),
- set_add(Ls, C),
- fail.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement