use ordsets in library(dif)
This commit is contained in:
@@ -1,18 +1,15 @@
|
|||||||
:- module(dif, [dif/2]).
|
:- module(dif, [dif/2]).
|
||||||
|
|
||||||
:- use_module(library(atts)).
|
:- use_module(library(atts)).
|
||||||
|
:- use_module(library(ordsets)).
|
||||||
|
|
||||||
:- attribute dif/1.
|
:- attribute dif/1.
|
||||||
|
|
||||||
non_unif_member([X \== Y | Z], V, W) :-
|
|
||||||
( X == V, Y == W -> true
|
|
||||||
; non_unif_member(Z, V, W)
|
|
||||||
).
|
|
||||||
|
|
||||||
put_dif_att(Var, X, Y) :-
|
put_dif_att(Var, X, Y) :-
|
||||||
( get_atts(Var, +dif(Z)) ->
|
( get_atts(Var, +dif(Z)) ->
|
||||||
( non_unif_member(Z, X, Y) -> true
|
ord_add_element(Z, X \== Y, NewZ),
|
||||||
; put_atts(Var, +dif([X \== Y | Z]))
|
( Z == NewZ -> true
|
||||||
|
; put_atts(Var, +dif(NewZ))
|
||||||
)
|
)
|
||||||
; put_atts(Var, +dif([X \== Y]))
|
; put_atts(Var, +dif([X \== Y]))
|
||||||
).
|
).
|
||||||
|
|||||||
@@ -183,11 +183,11 @@ impl Machine {
|
|||||||
compile_user_module(self, TERMS.as_bytes());
|
compile_user_module(self, TERMS.as_bytes());
|
||||||
compile_user_module(self, DCGS.as_bytes());
|
compile_user_module(self, DCGS.as_bytes());
|
||||||
compile_user_module(self, ATTS.as_bytes());
|
compile_user_module(self, ATTS.as_bytes());
|
||||||
|
compile_user_module(self, ORDSETS.as_bytes());
|
||||||
compile_user_module(self, DIF.as_bytes());
|
compile_user_module(self, DIF.as_bytes());
|
||||||
compile_user_module(self, FREEZE.as_bytes());
|
compile_user_module(self, FREEZE.as_bytes());
|
||||||
compile_user_module(self, REIF.as_bytes());
|
compile_user_module(self, REIF.as_bytes());
|
||||||
compile_user_module(self, ASSOC.as_bytes());
|
compile_user_module(self, ASSOC.as_bytes());
|
||||||
compile_user_module(self, ORDSETS.as_bytes());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
|
|||||||
Reference in New Issue
Block a user