Skip to content

Commit 7db3e2f

Browse files
committed
cns:attr_unify_hook
1 parent 756b3cc commit 7db3e2f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

prolog/metta_lang/metta_compiler.pl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3852,6 +3852,7 @@
38523852
is_plain_list0(L):- \+ is_list(L),!,fail.
38533853
is_plain_list0([]):- !.
38543854
is_plain_list0([QUOTE,_]):- QUOTE=='quote',!.
3855+
is_plain_list0([Colon,_,_]):- Colon==':',!.
38553856
is_plain_list0([R|L]):- is_plain_obj(R),!,maplist(is_value_obj,L).
38563857

38573858
is_value_obj(L):- notrace(quietly(is_value_obj0(L))).
@@ -3950,8 +3951,8 @@
39503951
add_types_into(OpN,Nth,Var, List, MightF, Args),
39513952
ignore(maybe_cond(OpN,Nth,[MightF|Args])),
39523953
append(CodeL,[Call],LLL),
3953-
(((is_list(VarL),VarL=[V],var(V))) -> (VarP=V,Var=VarP) ; VarP=..['S'|VarL]),
3954-
Call = ( =(VarP,Var) ),
3954+
(((is_list(VarL),VarL=[V],var(V))) -> (VarP=V,Var=VarP,Call=true) ; (VarP=VarL,Call='S'(VarP,Var))),
3955+
39553956
if_t(has_returnType(MightF),add_type_to(Var,arg(MightF,0))),
39563957
list_to_conjuncts(LLL,Code))).
39573958
into_equality(OpN,Nth,_Var,Comp, Code):- compound_name_arguments(Comp,F,Args),maplist_nth(arg_equality([F,arg(Nth)|OpN]),1,Args,DFArgs),compound_name_arguments(Code,F,DFArgs).
@@ -3962,7 +3963,7 @@
39623963
walk_src_for_constraints(_,_,Out):- ground(Out),!.
39633964
walk_src_for_constraints(_,_,assign_now(BodyVar,Var)):- !, add_type_to(Var,val(BodyVar)).
39643965

3965-
walk_src_for_constraints(_,_,Comp=Var):- var(Var),compound(Comp),compound_name_arguments(Comp,'S',[MightF|Args]),!,
3966+
walk_src_for_constraints(_,_,'S'(),Comp=Var):- var(Var),compound(Comp),compound_name_arguments(Comp,'S',[MightF|Args]),!,
39663967
if_t(callable(MightF),maplist_nth(walk_src_for_constraints(MightF),1,Args)).
39673968

39683969

0 commit comments

Comments
 (0)