diff --git a/src/prolog/lib/reif.pl b/src/prolog/lib/reif.pl index ad12fcc6..77af1893 100644 --- a/src/prolog/lib/reif.pl +++ b/src/prolog/lib/reif.pl @@ -5,7 +5,7 @@ :- use_module(library(control), [(\=)/2]). :- use_module(library(dif)). -/* in essence, '$reify_switch'(T, Then_0, Else_0) is semantically this: +/* in essence, '$reify_switch'(T, Then_0, Else_0) is semantically this, ( T == true -> call(Then_0) ; T == false -> call(Else_0) ; nonvar(T) -> throw(error(type_error(boolean, T), _)) diff --git a/src/prolog/machine/attributed_variables.rs b/src/prolog/machine/attributed_variables.rs index af776697..5686dd47 100644 --- a/src/prolog/machine/attributed_variables.rs +++ b/src/prolog/machine/attributed_variables.rs @@ -162,6 +162,7 @@ impl MachineState { return; } + attr_goals.sort_unstable_by(|a1, a2| self.compare_term_test(a1, a2)); self.term_dedup(&mut attr_goals); let mut output = PrinterOutputter::new();