]> Repositorios git - scryer-prolog.git/commitdiff
Explain non_counted_backtracking a little bit more
authorAleksy Grabowski <[email protected]>
Fri, 6 Sep 2024 06:15:45 +0000 (08:15 +0200)
committerAleksy Grabowski <[email protected]>
Sat, 7 Sep 2024 06:14:37 +0000 (08:14 +0200)
src/lib/iso_ext.pl
src/lib/ops_and_meta_predicates.pl

index 3eb00a3e80d47aa263c115077bda3ab4993804f9..5c779b10e11ce5a6c71b102515b2a82f2e0ff5e9 100644 (file)
@@ -223,6 +223,7 @@ run_cleaners_without_handling(Cp) :-
 %% call_with_inference_limit(Goal, Limit, Result).
 %
 % Similar to `call(Goal)` but it limits the number of inferences for each solution of Goal.
+% Calls to it may be nested, but only the last limit will be in power.
 call_with_inference_limit(G, L, R) :-
     (  integer(L) ->
        (  L < 0 ->
index 929165e3ff206c6e14edee27239a0e63e7e04218..d4f6767105774771c52f762c1028501239ac3797 100644 (file)
@@ -5,9 +5,13 @@
 
 :- op(1199, fx, meta_predicate).
 
-/* this is an implementation specific declarative operator used to implement call_with_inference_limit/3
-   and setup_call_cleanup/3. switches to the default trust_me and retry_me_else. Indexing choice
-   instructions are unchanged. */
+% Declarative operator used to implement `call_with_inference_limit/3` and
+% `setup_call_cleanup/3`. Compiler switches to the default trust_me, retry_me_else
+% and some other instructions for all predicates the marked with it. Indexing
+% choice instructions are unchanged.
+%
+% Default instructins are not subject to inference counting, so their execution
+% will not be considered if they happen to be called by `call_with_inference_limit/3`.
 :- op(700, fx, non_counted_backtracking).
 
 % arithmetic operators.