Skip to content

Commit

Permalink
subst_args34
Browse files Browse the repository at this point in the history
  • Loading branch information
TeamSPoon committed Dec 22, 2024
1 parent f3cdc3a commit afb6d79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions prolog/metta_lang/metta_subst.pl
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
set_last_error(_).
*/
subst_args1(Eq,RetType,Depth, Self, [OP|ARGS], Template):- fail,
subst_args1(Eq,RetType,Depth, Self, [OP|ARGS], Template):-
is_space_op(OP), !,
subst_args_as(Depth, Self, [OP|ARGS], Template).

Expand Down Expand Up @@ -714,11 +714,11 @@


% user defined function
subst_args2(Eq,Depth,Self,[H|PredDecl],Res):- fail,mnotrace(is_user_defined_head(Eq,Self,H)),!,
subst_args2(Eq,Depth,Self,[H|PredDecl],Res):- mnotrace(is_user_defined_head(Eq,Self,H)),!,
subst_args30(Eq,Depth,Self,[H|PredDecl],Res).

% function inherited by system
subst_args2(Eq,Depth,Self,PredDecl,Res):- fail, subst_args40(Eq,Depth,Self,PredDecl,Res).
subst_args2(Eq,Depth,Self,PredDecl,Res):- subst_args40(Eq,Depth,Self,PredDecl,Res).

/*
last_element(T,E):- \+ compound(T),!,E=T.
Expand Down Expand Up @@ -843,7 +843,7 @@
*/


subst_args30(Eq,Depth,Self,H,B):- fail, (subst_args34(Depth,Self,H,B)*->true;subst_args37(Eq,Depth,Self,H,B)).
subst_args30(Eq,Depth,Self,H,B):- (subst_args34(Depth,Self,H,B)*->true;subst_args37(Eq,Depth,Self,H,B)).

subst_args34(_Dpth,Self,H,B):- (metta_eq_def(Eq,Self,H,B);(get_metta_atom(Eq,Self,H),B=H)).

Expand All @@ -854,7 +854,7 @@
mnotrace((ArgRes\==[H2|H2Args], append(Left,[ArgRes|Rest],NewArgs))),
subst_args30(Eq,Depth,Self,[H1|NewArgs],Res).

subst_args37(Eq,Depth,Self,[[H|Start]|T1],Y):-
subst_args37(Eq,Depth,Self,[[H|Start]|T1],Y):- !,
mnotrace((is_user_defined_head_f(Eq,Self,H),is_list(Start))),
metta_eq_def(Eq,Self,[H|Start],Left),
subst_args(Eq,RetType,Depth,Self,[Left|T1],Y).
Expand Down
2 changes: 1 addition & 1 deletion prolog/metta_lang/metta_types.pl
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@
no_repeats_var(NoRepeatType),
% Retrieve the type of the value.
call_nth(get_type_each(Depth, Self, Val, Type),Nth), Type\=='',
(Nth >1 -> Type\== 'Atom' ; true),
((Nth > 1) -> Type\== 'Atom' ; true),
% Ensure the type matches the expected no-repeat type.
NoRepeatType = Type,
Type = TypeO,
Expand Down

0 comments on commit afb6d79

Please sign in to comment.