I would like to write this:
paths( Result ) :-
findall( B, f(B) , Result ).
f( B ) :-
f1( B ),
f2( B ).
in just one line. So basically something like:
paths( Result ) :-
findall( B, f1(B) AND f2(B), Result ).
I don't know how to express 'AND' in a goal statement. Is this possible at all?
Just put parentheses around it:
Addition: Goals are just conjunctions (and disjunctions) of sub-goals. You can construct them at some point, and then pass them around until they are called. This is useful if the goal needs to be constructed dynamically: