From afb6d79bc07c19c4864ed7bab3157ac7ed502bf9 Mon Sep 17 00:00:00 2001 From: logicmoo Date: Sat, 21 Dec 2024 22:08:27 -0800 Subject: [PATCH] subst_args34 --- prolog/metta_lang/metta_subst.pl | 10 +++++----- prolog/metta_lang/metta_types.pl | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/prolog/metta_lang/metta_subst.pl b/prolog/metta_lang/metta_subst.pl index 7e9f137ac6..dca4c5c256 100755 --- a/prolog/metta_lang/metta_subst.pl +++ b/prolog/metta_lang/metta_subst.pl @@ -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). @@ -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. @@ -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)). @@ -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). diff --git a/prolog/metta_lang/metta_types.pl b/prolog/metta_lang/metta_types.pl index fab1a5f9ed..e6c5c803d3 100755 --- a/prolog/metta_lang/metta_types.pl +++ b/prolog/metta_lang/metta_types.pl @@ -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,