Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addall_s( Elem, Goal, Old, New ) :-
- addall_s( Elem, Goal, Old, Old, [], New ).
- addall_s( Elem, Goal, Old, Acc, Used, New ) :-
- Goal =.. [Predicate|Arguments],
- replace( Arguments, NewArguments, Elem, NewElem ),
- NewGoal =.. [Predicate|NewArguments],
- call(Goal),
- \+member( Elem, Used ),!,
- addall_s( NewElem, NewGoal, Old, [Elem|Acc], [Elem|Used], New ).
Add Comment
Please, Sign In to add comment