I need to do this homework assignment using prolog (SWI-flavor) and cant get my head around some things.
For example, if i want to iterate through a list and add it
try the ignore/1 predicate:
goal(Stuff) :- do_something(X) ignore(only_do_this_if_something(Y)), always_do_this(Z).
ignore/1 calls the only argument and succeeds whenever it fails or not:
ignore(X) :- X, !. ignore(_).