The test should returns true: if the first part is true, and the second part is false.
Tried to do something like that:
f_test :- f(x), % 1st part
f(y) is false. % 2nd part
But it gives me an error:
ERROR: is/2: Arithmetic: `false/0' is not a function.
Please tell me, how to do it correctly?
(is)/2is a predicate intended to perform arithmetic. Even if your test was about arithmetic, the use of(=:=)/2would be preferred (because(is)/2is used to instantiate a variable. When you use it to check a variable value, you misuse it. OTOH,(=:=)/2is used to compare numbers).But here your test isn’t about arithmetic, it’s about knowing if something is true or not. There is an operator for that, which checks if a given term is provable or not, it’s
(\+)/1, use is: