fix use of copy_term/3 for attribute goals in toplevel (#888, #2057, #2217)

This commit is contained in:
Mark
2023-12-13 11:49:16 -07:00
parent 82f3731c97
commit 399b50b4d7
2 changed files with 3 additions and 36 deletions

View File

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