sort attribute goals before deduplicating them linearly

This commit is contained in:
Mark Thom
2019-02-17 12:23:25 -07:00
parent 896914b8e9
commit a460e84c57
2 changed files with 2 additions and 1 deletions

View 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), _))

View 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();