Hello,
In checking the properties of a structure I have property identification tests, each comprising a number of predicates. The structure exhibits a property when all predicates succeed, and not, if at least one in the series of predicates fails.
This looks something like this:
property_test(p1) :-
test1(S, X, Y),
test2(S, Y, Z),
test3(S, Z, _M).
Typically, this involves a lot of backtracking, before success or failure can be determined.
If there is failure I want to know which predicates failed the property test.
I tried an -> structure wrapped around a single test predicate, but I think this wont work because tests fail and backtrack and can then succeed. An if structure would abort the next trials.
nop.
property_test(p1) :-
(test1(S, X, Y)-> nop; message(1)),
(test2(S, Y, Z),-> nop; message(2)),
(test3(S, Z, _M) -> nop; message(3)).
Any suggestion are most welcome,
thank you,
Dan