]> Repositorios git - scryer-prolog.git/commitdiff
sort attribute goals before deduplicating them linearly
authorMark Thom <[email protected]>
Sun, 17 Feb 2019 19:23:25 +0000 (12:23 -0700)
committerMark Thom <[email protected]>
Sun, 17 Feb 2019 19:23:25 +0000 (12:23 -0700)
src/prolog/lib/reif.pl
src/prolog/machine/attributed_variables.rs

index ad12fcc61481b497d3fc6246ef6a951f50dc2864..77af1893fe9790dcb2407d16e332d6895e40588a 100644 (file)
@@ -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), _))
index af7766972af45cae7d7ad2db390bd2048aa7db76..5686dd47d764011d90ef36242c4ea1e988f9722c 100644 (file)
@@ -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();