[eclipse-clp-users] Backtracking over current predicate only

From: Christian Wirth <tyrion_at_...215...>
Date: Fri, 14 May 2010 16:50:52 +0200
Hi,

how can i define a cut that allows backtracking over the current 
predicate but not over another predicate ?
example:

pred(aPred(X)) :- call(X).
pred(X) :- anotherCall(X).

i now want to define a cut that creates all solutions for call(X), if 
the first perdicate gets matched, but it should prevent matching the 
other one.
I'm currently using pred(X) :- 
functor(X,F,A),not(F==aPred),anotherCall(X), but i want to replace this 
because speedup is very essential.

.. hope this is possible.
Received on Fri May 14 2010 - 14:50:15 CEST

This archive was generated by hypermail 2.2.0 : Mon Jul 09 2018 - 02:05:29 CEST