From d919d41c6f5a053ff583661ef5fa8aa4b73f92c3 Mon Sep 17 00:00:00 2001 From: logicmoo Date: Thu, 2 Jan 2025 02:48:56 -0800 Subject: [PATCH] must_det_ll -> must in some cases --- prolog/metta_lang/metta_eval.pl | 12 ++++++------ prolog/metta_lang/metta_testing.pl | 9 +-------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/prolog/metta_lang/metta_eval.pl b/prolog/metta_lang/metta_eval.pl index 0be6f488cc..5f71e890aa 100755 --- a/prolog/metta_lang/metta_eval.pl +++ b/prolog/metta_lang/metta_eval.pl @@ -260,7 +260,7 @@ if_or_else( (fail,finish_eval(Eq,RetType,Depth2,Self,Y,YO)), Y=YO))). -'[|]'(A,B,C):- C=[A,B]. +%'[|]'(A,B,C):- C=[A,B]. '[|]'(A,B,C):- trace,break. % subst_args_here(Eq,RetType,Depth2,Self,Y,YO):- @@ -1598,7 +1598,7 @@ eval_20( Eq, RetType, Depth, Self, [ 'parse' , L ] , Exp ):- !, eval_args( Eq, RetType, Depth, Self, L, Str ), - once(parse_sexpr_metta1( Str, Exp )). + once(read_metta( Str, Exp )). eval_20( _Eq, _RetType, _Depth, _Self, [ 'repr' , L ] , Sxx ):- !, %eval_args( Eq, RetType, Depth, Self, L, Lis2 ), @@ -1656,14 +1656,14 @@ assert(was_asserted_space(Other)), make_nop(RetType,[],RetVal), check_returnval(Eq,RetType,RetVal). eval_20(Eq,RetType,Depth,Self,['bind!',Other,Expr],RetVal):- !, - must_det_ll((into_name(Self,Other,Name),!,eval_args(Eq,RetType,Depth,Self,Expr,Value), + must((into_name(Self,Other,Name),!,eval_args(Eq,RetType,Depth,Self,Expr,Value), nb_bind(Name,Value), make_nop(RetType,Value,RetVal))), check_returnval(Eq,RetType,RetVal). eval_20(Eq,RetType,Depth,Self,['pragma!',Other,Expr],RetVal):- !, must_det_ll((into_name(Self,Other,Name),nd_ignore((eval_args(Eq,RetType,Depth,Self,Expr,Value), set_option_value_interp(Name,Value))), make_nop(RetType,Value,RetVal), check_returnval(Eq,RetType,RetVal))). -eval_20(Eq,RetType,_Dpth,Self,['transfer!',File],RetVal):- !, must_det_ll((include_metta(Self,File), +eval_20(Eq,RetType,_Dpth,Self,['transfer!',File],RetVal):- !, must((include_metta(Self,File), make_nop(RetType,Self,RetVal),check_returnval(Eq,RetType,RetVal))). @@ -2378,8 +2378,8 @@ eval_adjust_args1(Eq,RetType,ResIn,ResOut,Depth,Self,[AE|More],[AE|Adjusted]):- adjust_args_90(Eq,RetType,ResIn,ResOut,Depth,Self,AE,More,Adjusted). -adjust_args_90(Eq,RetType,ResIn,ResOut,Depth,Self,AE,More,Adjusted):- \+ is_debugging(eval_args),!, - adjust_args_9(Eq,RetType,ResIn,ResOut,Depth,Self,AE,More,Adjusted). +%adjust_args_90(Eq,RetType,ResIn,ResOut,Depth,Self,AE,More,Adjusted):- \+ is_debugging(eval_args),!, +% adjust_args_9(Eq,RetType,ResIn,ResOut,Depth,Self,AE,More,Adjusted). adjust_args_90(Eq,RetType,ResIn,ResOut,Depth,Self,AE,More,Adjusted):- if_or_else(adjust_args_9(Eq,RetType,ResIn,ResOut,Depth,Self,AE,More,Adjusted), if_or_else(with_debug(eval_args,adjust_args_9(Eq,RetType,ResIn,ResOut,Depth,Self,AE,More,Adjusted)), diff --git a/prolog/metta_lang/metta_testing.pl b/prolog/metta_lang/metta_testing.pl index 42ec110030..4fab135c7b 100755 --- a/prolog/metta_lang/metta_testing.pl +++ b/prolog/metta_lang/metta_testing.pl @@ -850,7 +850,7 @@ _ = nop(Pre), record_call_duration(G), % Log as passed if Goal succeeds. - must_det_ll(give_pass_credit(TestSrc, Pre, G)), + must_det_lls(give_pass_credit(TestSrc, Pre, G)), !. /* loonit_asserts1(TestSrc,Pre,G) :- fail, @@ -861,13 +861,6 @@ option_value('on-fail','trace'), setup_call_cleanup(debug(metta(eval)),call((Pre,G)),nodebug(metta(eval)))))). */ -loonit_asserts1(TestSrc, Pre, G) :- - % Run precondition and record duration of Goal execution. - _ = nop(Pre), - call(G), - % Log as passed if Goal succeeds. - trace,give_pass_credit(TestSrc, Pre, G), - !. loonit_asserts1(TestSrc, Pre, G) :- % Handle failed Goal by logging, flagging failure, and optionally tracing. must_det_ll((