fixes for CHR

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@261 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2002-01-03 06:42:24 +00:00
parent d678864273
commit 54729fc4eb
3 changed files with 19 additions and 4 deletions

View File

@ -25,7 +25,12 @@
sbag_del_element/3
]).
% -----------------------------------------------------------------
:- use_module( library(ordsets),
[
merge/3
]).
% -----------------------------------------------------------------
%
% *** MACROS ***
%
@ -68,7 +73,7 @@ sbag_member( E, [Head|Tail], _) :-
sbag_union( A, B, C) :-
sort( A, As),
sort( B, Bs),
prolog:merge( As, Bs, C).
merge( As, Bs, C).
sbag_add_element( Set1, Elem, Set2) :- Set2 = [Elem|Set1].

View File

@ -35,6 +35,11 @@
ord_list_to_assoc/2
]).
:- use_module( library(ordsets),
[
merge/3
]).
% -----------------------------------------------------------------
%
% *** MACROS ***
@ -92,7 +97,7 @@ sbag_member( Elem, A) :-
sbag_union( A, B, C) :-
assoc_to_list( A, As),
assoc_to_list( B, Bs),
prolog:merge( As, Bs, Cs),
merge( As, Bs, Cs),
ord_list_to_assoc( Cs, C).
sbag_add_element( S1, E, S2) :- put_assoc( E, S1, 0, S2).

View File

@ -25,6 +25,11 @@
sbag_del_element/3
]).
:- use_module( library(ordsets),
[
merge/3
]).
% -----------------------------------------------------------------
%
% *** MACROS ***
@ -68,7 +73,7 @@ sbag_member( E, [Head|Tail], _) :-
sbag_union( A, B, C) :-
sort( A, As),
sort( B, Bs),
prolog:merge( As, Bs, C).
merge( As, Bs, C).
sbag_add_element( Set1, Elem, Set2) :- Set2 = [Elem|Set1].