From 96faad1c0147565ebd86f313adef4f857fc9e102 Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Sat, 26 Feb 2022 10:57:52 -0700 Subject: [PATCH] add proper error throwing for call_with_inference_limit/3 (#1296) --- src/lib/iso_ext.pl | 9 +++++++++ 1 file changed, 9 insertions(+) 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)), -- 2.54.0