Fix anonymous attributed variables not showing in toplevel #2241

This commit is contained in:
bakaq
2023-12-22 13:07:09 -03:00
parent 373b08a91e
commit 20c6a327ea

View File

@@ -314,9 +314,11 @@ write_eqs_and_read_input(B, VarList, AttrVars) :-
% one layer of depth added for (=/2) functor % one layer of depth added for (=/2) functor
'$term_variables_under_max_depth'(OrigVars, 22, Vars0), '$term_variables_under_max_depth'(OrigVars, 22, Vars0),
'$project_atts':project_attributes(Vars0, AttrVars), '$project_atts':project_attributes(Vars0, AttrVars),
% need to copy all the visible Vars here so that they appear % Need to copy all the visible Vars here so that they appear
% properly in AttrGoals, even the non-attributed. % properly in AttrGoals, even the non-attributed. Need to also
copy_term(Vars0, Vars0, AttrGoals), % copy all the attributed variables here so that anonymous
% attributed variables also appear properly in AttrGoals.
copy_term([Vars0, AttrVars], [Vars0, AttrVars], AttrGoals),
term_variables(AttrGoals, AttrGoalVars), term_variables(AttrGoals, AttrGoalVars),
append([Vars0, AttrGoalVars, AttrVars], Vars), append([Vars0, AttrGoalVars, AttrVars], Vars),
charsio:extend_var_list(Vars, VarList, NewVarList, fabricated), charsio:extend_var_list(Vars, VarList, NewVarList, fabricated),