diff --git a/src/lib/iso_ext.pl b/src/lib/iso_ext.pl index 37044a40..e614b1f6 100644 --- a/src/lib/iso_ext.pl +++ b/src/lib/iso_ext.pl @@ -137,6 +137,15 @@ handle_ile(B, E, _) :- :- meta_predicate(call_with_inference_limit(0, ?, ?)). call_with_inference_limit(G, L, R) :- + ( integer(L) -> + ( L < 0 -> + domain_error(not_less_than_zero, L, call_with_inference_limit/3) + ; true + ) + ; var(L) -> + instantiation_error(call_with_inference_limit/3) + ; type_error(integer, L, call_with_inference_limit/3) + ), '$get_current_block'(Bb), '$get_b_value'(B), '$call_with_default_policy'(call_with_inference_limit(G, L, R, Bb, B)),