eguneys
eguneys

Reputation: 6406

How to query the amount of calculations for a successful query that didn't reach the limit

I use Tau-Prolog to calculate some stuff, I set the limit to 100 to test things out. I sometimes hit the limit, then I raise the limit.

I was wondering, this limit measures the performance of the program, so is there a way to query the amount of calculations (backtracking?) occured for a given query. So I get an idea of what's going under the hood.

For example I have these definitions:

zip_pos([], [], []).
zip_pos([X|Xs], [Y|Ys], [X-Y|Rest]) :- zip_pos(Xs, Ys, Rest).
  


fwd_que(X-Y, X_-Y_, N) :- zip_pos(MX, MY, N), lefter(X-X_, MX), upper(Y-Y_, MY).

In fwd_que definition, If I put the zip_pos at the end, it hits the limit, this version passes the limit, and the result doesn't change. So I was wondering what causes this and how can I detect these kind of stuff.

Upvotes: 1

Views: 33

Answers (0)

Related Questions