Please see this code snipped:
...,
findall(X, predicate(Input1, X), XS),
XS \== [],
!,
member(X, XS),
...
That will find all solutions for predicate(_, X)
in XS
, cut, then "iterate" over the X in XS.
Is it possible to replace findall/3
in here? Most likely I won't be interested in all solutions for X. I need to know if it is satisfiable for Input1, and if so, continue with its solutions.
Please notice that this is, of course, not what I am looking for:
predicate(Input1, X), % Uses other values for Input1
Neither is this:
!, predicate(Input1, X), % I could need another value for Input1
And esp. not this:
predicate(Input1, X), !, % I want further solutions for X