Skip to content

Commit

Permalink
must_det_ll -> must in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
TeamSPoon committed Jan 2, 2025
1 parent 755b6b7 commit d919d41
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
12 changes: 6 additions & 6 deletions prolog/metta_lang/metta_eval.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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):-
Expand Down Expand Up @@ -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 ),
Expand Down Expand Up @@ -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))).


Expand Down Expand Up @@ -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)),
Expand Down
9 changes: 1 addition & 8 deletions prolog/metta_lang/metta_testing.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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((
Expand Down

0 comments on commit d919d41

Please sign in to comment.