[eclipse-clp-users] saving the resolution list of a call

From: Christian Wirth <tyrion_at_...215...>
Date: Fri, 14 May 2010 17:30:54 +0200
Hi,

i also need to save the resolution list of a call, meaning a list of all 
called predicates in the called order (without and/or, but that could be 
extracted later).

Something like this (only an example, not tested):

rescall(true,_) :- !.

rescall((A,B),Res) :- rescall(A,Res),rescall(B,Res).
rescall((A;B),Res) :- rescall(A,Res);rescall(B,Res).

rescall(X,Res) :- 
not(booleanfunctor(X)),functor(X,F,A),member(F/A,Res),clause(X,C),rescall(C,Res).

This works, but takes serveral times the time of a normal call(X). I 
need a VERY fast version of this. Any possibility to make this work faster ?
Maybe by saving this information directly out of the normal prolog call 
method ?

best regards Christian Wirth
Received on Fri May 14 2010 - 15:30:15 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 16 2024 - 09:13:20 CEST