deduplicate but do not sort anonymous variables in toplevel (#1196)

This commit is contained in:
Mark Thom
2022-01-15 11:03:41 -07:00
parent 06abe2302b
commit 83378e4373
2 changed files with 2 additions and 2 deletions

View File

@@ -555,7 +555,7 @@ impl MachineState {
let outcome = heap_loc_as_cell!( let outcome = heap_loc_as_cell!(
iter_to_heap_list( iter_to_heap_list(
&mut self.heap, &mut self.heap,
seen_set.into_iter().rev(), seen_set.into_iter(),
) )
); );

View File

@@ -292,7 +292,7 @@ write_eqs_and_read_input(B, VarList) :-
% one layer of depth added for (=/2) functor % one layer of depth added for (=/2) functor
maplist(\Term^Vs^term_variables_under_max_depth(Term, 22, Vs), Equations, EquationVars), maplist(\Term^Vs^term_variables_under_max_depth(Term, 22, Vs), Equations, EquationVars),
append([AttrGoalVars | EquationVars], Vars1), append([AttrGoalVars | EquationVars], Vars1),
sort(Vars1, Vars2), term_variables(Vars1, Vars2), % deduplicate vars of Vars1 but preserve their order.
charsio:extend_var_list(Vars2, VarList, NewVarList0, fabricated), charsio:extend_var_list(Vars2, VarList, NewVarList0, fabricated),
( bb_get('$first_answer', true) -> ( bb_get('$first_answer', true) ->
write(' '), write(' '),