![]() |
YAP 7.1.0
|
call_count(? CallsMax, ? RetriesMax, ? CallsAndRetriesMax) More...
call_count(? CallsMax, ? RetriesMax, ? CallsAndRetriesMax)
Set call counters as timers YAP will generate an exception if one of the instantiated call counters decreases to 0:
CallsMax
throw the exception call_counter
when the counter calls
reaches 0;
RetriesMax
throw the exception retry_counter
when the counter retries
reaches 0;
CallsAndRetriesMax
throw the exception call_and_retry_counter
when the counter calls_and_retries
reaches 0
YAP will ignore counters that are called with unbound arguments
Next, we show a simple example of how to use call counters:
Notice that we first compile the looping predicate l/0
with call_counting on
Next, we catch/3 to handle an exception when l/0
performs more than 10000 reductions
Definition at line 1 of file callcount.yap.