Reputation: 51
I want to create the following rule:
rule2(X) :-
is "true" if rule1(X,Y) is false.
So rule2 will output a "true" for X
, if rule1 outputs a "false" for X
and any value Y
I hope this makes sense. I'm a beginner at prolog
. It's been fun but I've been stuck on this issue for hours! Thanks.
Upvotes: 1
Views: 78
Reputation: 22585
I'd suggest to use a logical not, \+/1
in favour of a !, fail
approach:
rule2(X):- \+ (rule1(X,_)).
Upvotes: 1