[m-dev.] for review: more function def's for single out det mode library predicates
Ralph Becket
rwab1 at cam.sri.com
Fri Apr 30 23:20:18 AEST 1999
[Diffs are attached]
[Diffs are for library version rotd-1999-04-16]
Estimated hours taken: 5
I've added functions for the remaining output det predicates in a number
of modules in the standard library. Basically, for each
:- pred f(in, ..., in, out) is det.
I have added the declaration
:- func f(in, ..., in) = out.
and definition
f(X1, ..., Xn) = Y :-
f(X1, ..., Xn, Y).
The changes were made using a mostly automatic process and
have been `checked' by compiling the whole library.
library/pqueue.m:
No special comments.
library/assoc_list.m:
No special comments.
library/getopt.m:
No special comments.
library/bag.m:
No special comments.
library/bimap.m:
No special comments.
library/bintree.m:
No special comments.
library/bintree_set.m:
No special comments.
library/bt_array.m:
No special comments.
library/eqvclass.m:
No special comments.
library/graph.m:
No special comments.
library/group.m:
No special comments.
library/queue.m:
No special comments.
library/rbtree.m:
No special comments.
library/stack.m:
No special comments.
library/term.m:
No special comments.
library/varset.m:
No special comments.
library/tree234.m:
No special comments.
library/relation.m:
No special comments.
library/set.m:
No special comments.
library/set_bbbtree.m:
No special comments.
library/set_ordlist.m:
No special comments.
library/set_unordlist.m:
No special comments.
-------------- next part --------------
154a155,186
> %---------------------------------------------------------------------------%
> % Ralph Becket <rwab1 at cl.cam.ac.uk> 29/04/99
> % Functional forms added.
>
> :- interface.
>
> :- func pqueue__init = pqueue(_K, _V).
>
> :- func pqueue__insert(pqueue(K, V), K, V) = pqueue(K, V).
>
> :- func pqueue__to_assoc_list(pqueue(K, V)) = assoc_list(K, V).
>
> :- func pqueue__assoc_list_to_pqueue(assoc_list(K, V)) = pqueue(K, V).
>
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
>
> :- implementation.
>
> pqueue__init = PQ :-
> pqueue__init(PQ).
>
> pqueue__insert(PQ1, K, V) = PQ2 :-
> pqueue__insert(PQ1, K, V, PQ2).
>
> pqueue__to_assoc_list(PQ) = AL :-
> pqueue__to_assoc_list(PQ, AL).
>
> pqueue__assoc_list_to_pqueue(AL) = PQ2 :-
> pqueue__assoc_list_to_pqueue(AL, PQ2).
>
>
-------------- next part --------------
130a131,162
> %-----------------------------------------------------------------------------%
> % Ralph Becket <rwab1 at cl.cam.ac.uk> 29/04/99
> % Functional forms added.
>
> :- interface.
>
> :- func assoc_list__reverse_members(assoc_list(K, V)) = assoc_list(V, K).
>
> :- func assoc_list__from_corresponding_lists(list(K), list(V)) = assoc_list(K,V).
>
> :- func assoc_list__keys(assoc_list(K, V)) = list(K).
>
> :- func assoc_list__values(assoc_list(K, V)) = list(V).
>
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
>
> :- implementation.
>
> assoc_list__reverse_members(AL1) = AL2 :-
> assoc_list__reverse_members(AL1, AL2).
>
> assoc_list__from_corresponding_lists(Ks, Vs) = AL :-
> assoc_list__from_corresponding_lists(Ks, Vs, AL).
>
> assoc_list__keys(AL) = Ks :-
> assoc_list__keys(AL, Ks).
>
> assoc_list__values(AL) = Vs :-
> assoc_list__values(AL, Vs).
>
>
-------------- next part --------------
678a679,722
> %-----------------------------------------------------------------------------%
> % Ralph Becket <rwab1 at cl.cam.ac.uk> 29/04/99
> % Functional forms added.
>
> :- interface.
>
> :- func getopt__lookup_bool_option(option_table(Option), Option) = bool.
>
> :- func getopt__lookup_int_option(option_table(Option), Option) = int.
>
> :- func getopt__lookup_string_option(option_table(Option), Option) = string.
>
> :- func getopt__lookup_maybe_int_option(option_table(Option), Option) =
> maybe(int).
>
> :- func getopt__lookup_maybe_string_option(option_table(Option), Option) =
> maybe(string).
>
> :- func getopt__lookup_accumulating_option(option_table(Option), Option) =
> list(string).
>
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
>
> :- implementation.
>
> getopt__lookup_bool_option(OT, Opt) = B :-
> getopt__lookup_bool_option(OT, Opt, B).
>
> getopt__lookup_int_option(OT, Opt) = N :-
> getopt__lookup_int_option(OT, Opt, N).
>
> getopt__lookup_string_option(OT, Opt) = S :-
> getopt__lookup_string_option(OT, Opt, S).
>
> getopt__lookup_maybe_int_option(OT, Opt) = MN :-
> getopt__lookup_maybe_int_option(OT, Opt, MN).
>
> getopt__lookup_maybe_string_option(OT, Opt) =MS :-
> getopt__lookup_maybe_string_option(OT, Opt, MS).
>
> getopt__lookup_accumulating_option(OT, Opt) =Ss :-
> getopt__lookup_accumulating_option(OT, Opt, Ss).
>
-------------- next part --------------
447a448,540
>
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
> % Ralph Becket <rwab1 at cl.cam.ac.uk> 29/04/99
> % Function forms added.
>
> :- interface.
>
> :- func bag__init = bag(T).
>
> :- func bag__insert(bag(T), T) = bag(T).
>
> :- func bag__insert_list(bag(T), list(T)) = bag(T).
>
> :- func bag__from_list(list(T)) = bag(T).
>
> :- func bag__to_list(bag(T)) = list(T).
>
> :- func bag__to_assoc_list(bag(T)) = assoc_list(T, int).
>
> :- func bag__to_list_without_duplicates(bag(T)) = list(T).
>
> :- func bag__det_remove(bag(T), T) = bag(T).
>
> :- func bag__det_remove_list(bag(T), list(T)) = bag(T).
>
> :- func bag__delete(bag(T), T) = bag(T).
>
> :- func bag__delete_all(bag(T), T) = bag(T).
>
> :- func bag__count_value(bag(T), T) = int.
>
> :- func bag__subtract(bag(T), bag(T)) = bag(T).
>
> :- func bag__union(bag(T), bag(T)) = bag(T).
>
> :- func bag__intersect(bag(T), bag(T)) = bag(T).
>
> :- func bag__least_upper_bound(bag(T), bag(T)) = bag(T).
>
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
>
> :- implementation.
>
> bag__init = B :-
> bag__init(B).
>
> bag__insert(B1, X) = B2 :-
> bag__insert(B1, X, B2).
>
> bag__insert_list(B1, Xs) = B2 :-
> bag__insert_list(B1, Xs, B2).
>
> bag__from_list(Xs) = B :-
> bag__from_list(Xs, B).
>
> bag__to_list(B) = Xs :-
> bag__to_list(B, Xs).
>
> bag__to_assoc_list(B) = AL :-
> bag__to_assoc_list(B, AL).
>
> bag__to_list_without_duplicates(B) = Xs :-
> bag__to_list_without_duplicates(B, Xs).
>
> bag__det_remove(B1, X) = B2 :-
> bag__det_remove(B1, X, B2).
>
> bag__det_remove_list(B1, Xs) = B2 :-
> bag__det_remove_list(B1, Xs, B2).
>
> bag__delete(B1, X) = B2 :-
> bag__delete(B1, X, B2).
>
> bag__delete_all(B1, X) = B2 :-
> bag__delete_all(B1, X, B2).
>
> bag__count_value(B, X) = N :-
> bag__count_value(B, X, N).
>
> bag__subtract(B1, B2) = B3 :-
> bag__subtract(B1, B2, B3).
>
> bag__union(B1, B2) = B3 :-
> bag__union(B1, B2, B3).
>
> bag__intersect(B1, B2) = B3 :-
> bag__intersect(B1, B2, B3).
>
> bag__least_upper_bound(B1, B2) = B3 :-
> bag__least_upper_bound(B1, B2, B3).
>
-------------- next part --------------
135a136,186
> % Ralph Becket <rwab1 at cl.cam.ac.uk> 29/04/99
> % Functional forms added.
>
> :- interface.
>
> :- func bimap__init = bimap(_,_).
>
> :- func bimap__lookup(bimap(K,V), K) = V.
>
> :- func bimap__set(bimap(K,V), K, V) = bimap(K,V).
>
> :- func bimap__ordinates(bimap(K, _V)) = list(K).
>
> :- func bimap__coordinates(bimap(_K, V)) = list(V).
>
> :- func bimap__to_assoc_list(bimap(K,V)) = assoc_list(K,V).
>
> :- func bimap__from_assoc_list(assoc_list(K,V)) = bimap(K,V).
>
> %%% :- func bimap__from_corresponding_lists(list(K), list(V)) = bimap(K, V).
>
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
>
> :- implementation.
>
> bimap__init = BM :-
> bimap__init(BM).
>
> bimap__lookup(BM, K) = V :-
> bimap__lookup(BM, K, V).
>
> bimap__set(BM1, K, V) = BM2 :-
> bimap__set(BM1, K, V, BM2).
>
> bimap__ordinates(BM) = Ks :-
> bimap__ordinates(BM, Ks).
>
> bimap__coordinates(BM) = Vs :-
> bimap__coordinates(BM, Vs).
>
> bimap__to_assoc_list(BM) = AL :-
> bimap__to_assoc_list(BM, AL).
>
> bimap__from_assoc_list(AL) = BM :-
> bimap__from_assoc_list(AL, BM).
>
> %%% bimap__from_corresponding_lists(Ks, Vs) = BM :-
> %%% bimap__from_corresponding_lists(Ks, Vs, BM).
>
>
-------------- next part --------------
548a549,619
> %-----------------------------------------------------------------------------%
> % Ralph Becket <rwab1 at cl.cam.ac.uk> 29/04/99
> % Function forms added.
>
> :- interface.
>
> :- func bintree__set(bintree(K,V), K, V) = bintree(K,V).
>
> :- func bintree__lookup(bintree(K,V), K) = V.
>
> :- func bintree__delete(bintree(K,V), K) = bintree(K,V).
>
> :- func bintree__keys(bintree(K,_V)) = list(K).
>
> :- func bintree__values(bintree(_K,V)) = list(V).
>
> :- func bintree__from_list(assoc_list(K,V)) = bintree(K,V).
>
> :- func bintree__from_sorted_list(assoc_list(K,V)) = bintree(K,V).
>
> :- func bintree__from_corresponding_lists(list(K), list(V)) = bintree(K,V).
>
> :- func bintree__to_list(bintree(K,V)) = assoc_list(K,V).
>
> :- func bintree__count(bintree(_K,_V)) = int.
>
> :- func bintree__depth(bintree(_K,_V)) = int.
>
> :- func bintree__balance(bintree(K, V)) = bintree(K, V).
>
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
>
> :- implementation.
>
> bintree__set(BT1, K, V) = BT2 :-
> bintree__set(BT1, K, V, BT2).
>
> bintree__lookup(BT, K) = V :-
> bintree__lookup(BT, K, V).
>
> bintree__delete(BT1, K) = BT2 :-
> bintree__delete(BT1, K, BT2).
>
> bintree__keys(BT) = Ks :-
> bintree__keys(BT, Ks).
>
> bintree__values(BT) = Vs :-
> bintree__values(BT, Vs).
>
> bintree__from_list(AL) = BT :-
> bintree__from_list(AL, BT).
>
> bintree__from_sorted_list(AL) = BT :-
> bintree__from_sorted_list(AL, BT).
>
> bintree__from_corresponding_lists(Ks, Vs) = BT :-
> bintree__from_corresponding_lists(Ks, Vs, BT).
>
> bintree__to_list(BT) = AL :-
> bintree__to_list(BT, AL).
>
> bintree__count(BT) = N :-
> bintree__count(BT, N).
>
> bintree__depth(BT) = N :-
> bintree__depth(BT, N).
>
> bintree__balance(BT1) = BT2 :-
> bintree__balance(BT1, BT2).
>
-------------- next part --------------
257a258,314
> %--------------------------------------------------------------------------%
> % Ralph Becket <rwab1 at cl.cam.ac.uk> 29/04/99
> % Function forms added.
>
> :- interface.
>
> :- func bintree_set__list_to_set(list(T)) = bintree_set(T).
>
> :- func bintree_set__sorted_list_to_set(list(T)) = bintree_set(T).
>
> :- func bintree_set__to_sorted_list(bintree_set(T)) = list(T).
>
> :- func bintree_set__insert(bintree_set(T), T) = bintree_set(T).
>
> :- func bintree_set__insert_list(bintree_set(T), list(T)) = bintree_set(T).
>
> :- func bintree_set__delete(bintree_set(T), T) = bintree_set(T).
>
> :- func bintree_set__delete_list(bintree_set(T), list(T)) = bintree_set(T).
>
> :- func bintree_set__union(bintree_set(T), bintree_set(T)) = bintree_set(T).
>
> :- func bintree_set__intersect(bintree_set(T), bintree_set(T)) = bintree_set(T).
>
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
>
> :- implementation.
>
> bintree_set__list_to_set(Xs) = BT :-
> bintree_set__list_to_set(Xs, BT).
>
> bintree_set__sorted_list_to_set(Xs) = BT :-
> bintree_set__sorted_list_to_set(Xs, BT).
>
> bintree_set__to_sorted_list(BT) = Xs :-
> bintree_set__to_sorted_list(BT, Xs).
>
> bintree_set__insert(BT1, X) = BT2 :-
> bintree_set__insert(BT1, X, BT2).
>
> bintree_set__insert_list(BT1, Xs) = BT2 :-
> bintree_set__insert_list(BT1, Xs, BT2).
>
> bintree_set__delete(BT1, X) = BT2 :-
> bintree_set__delete(BT1, X, BT2).
>
> bintree_set__delete_list(BT1, Xs) = BT2 :-
> bintree_set__delete_list(BT1, Xs, BT2).
>
> bintree_set__union(BT1, BT2) = BT3 :-
> bintree_set__union(BT1, BT2, BT3).
>
> bintree_set__intersect(BT1, BT2) = BT3 :-
> bintree_set__intersect(BT1, BT2, BT3).
>
>
-------------- next part --------------
629a630,699
> % Ralph Becket <rwab1 at cl.cam.ac.uk> 29/04/99
> % Function forms added.
>
> :- interface.
>
> :- func bt_array__make_empty_array(int) = bt_array(T).
>
> :- func bt_array__init(int, int, T) = bt_array(T).
>
> :- func bt_array__min(bt_array(_T)) = int.
>
> :- func bt_array__max(bt_array(_T)) = int.
>
> :- func bt_array__size(bt_array(_T)) = int.
>
> :- func bt_array__lookup(bt_array(T), int) = T.
>
> :- func bt_array__set(bt_array(T), int, T) = bt_array(T).
>
> :- func bt_array__resize(bt_array(T), int, int, T) = bt_array(T).
>
> :- func bt_array__shrink(bt_array(T), int, int) = bt_array(T).
>
> :- func bt_array__from_list(int, list(T)) = bt_array(T).
>
> :- func bt_array__to_list(bt_array(T)) = list(T).
>
> :- func bt_array__fetch_items(bt_array(T), int, int) = list(T).
>
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
>
> :- implementation.
>
> bt_array__make_empty_array(N) = BTA :-
> bt_array__make_empty_array(N, BTA).
>
> bt_array__init(N1, N2, T) = BTA :-
> bt_array__init(N1, N2, T, BTA).
>
> bt_array__min(BTA) = N :-
> bt_array__min(BTA, N).
>
> bt_array__max(BTA) = N :-
> bt_array__max(BTA, N).
>
> bt_array__size(BTA) = N :-
> bt_array__size(BTA, N).
>
> bt_array__lookup(BTA, N) = T :-
> bt_array__lookup(BTA, N, T).
>
> bt_array__set(BT1A, N, T) = BTA2 :-
> bt_array__set(BT1A, N, T, BTA2).
>
> bt_array__resize(BT1A, N1, N2, T) = BTA2 :-
> bt_array__resize(BT1A, N1, N2, T, BTA2).
>
> bt_array__shrink(BT1A, N1, N2) = BTA2 :-
> bt_array__shrink(BT1A, N1, N2, BTA2).
>
> bt_array__from_list(N, Xs) = BTA :-
> bt_array__from_list(N, Xs, BTA).
>
> bt_array__to_list(BTA) = Xs :-
> bt_array__to_list(BTA, Xs).
>
> bt_array__fetch_items(BTA, N1, N2) = Xs :-
> bt_array__fetch_items(BTA, N1, N2, Xs).
>
-------------- next part --------------
300a301,354
> % Ralph Becket <rwab1 at cl.cam.ac.uk> 29/04/99
> % Function forms added.
>
> :- interface.
>
> :- func eqvclass__init = eqvclass(T).
>
> :- func eqvclass__ensure_element(eqvclass(T), T) = eqvclass(T).
>
> :- func eqvclass__new_element(eqvclass(T), T) = eqvclass(T).
>
> :- func eqvclass__ensure_equivalence(eqvclass(T), T, T) = eqvclass(T).
>
> :- func eqvclass__new_equivalence(eqvclass(T), T, T) = eqvclass(T).
>
> :- func eqvclass__partition_set(eqvclass(T)) = set(set(T)).
>
> :- func eqvclass__partition_list(eqvclass(T)) = list(set(T)).
>
> :- func eqvclass__partition_set_to_eqvclass(set(set(T))) = eqvclass(T).
>
> :- func eqvclass__partition_list_to_eqvclass(list(set(T))) = eqvclass(T).
>
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
>
> :- implementation.
>
> eqvclass__init = EC :-
> eqvclass__init(EC).
>
> eqvclass__ensure_element(EC1, X) = EC2 :-
> eqvclass__ensure_element(EC1, X, EC2).
>
> eqvclass__new_element(EC1, X) = EC2 :-
> eqvclass__new_element(EC1, X, EC2).
>
> eqvclass__ensure_equivalence(EC1, X, Y) = EC2 :-
> eqvclass__ensure_equivalence(EC1, X, Y, EC2).
>
> eqvclass__new_equivalence(EC1, X, Y) = EC2 :-
> eqvclass__new_equivalence(EC1, X, Y, EC2).
>
> eqvclass__partition_set(EC) = S :-
> eqvclass__partition_set(EC, S).
>
> eqvclass__partition_list(EC) = Xs :-
> eqvclass__partition_list(EC, Xs).
>
> eqvclass__partition_set_to_eqvclass(S) = EC :-
> eqvclass__partition_set_to_eqvclass(S, EC).
>
> eqvclass__partition_list_to_eqvclass(Xs) = EC :-
> eqvclass__partition_list_to_eqvclass(Xs, EC).
-------------- next part --------------
420a421,455
> % Ralph Becket <rwab1 at cl.cam.ac.uk> 29/04/99
> % Function forms added.
>
> :- interface.
>
> :- func graph__init = graph(N, A).
>
> :- func graph__find_matching_nodes(graph(N, A), N) = set(node(N)).
>
> :- func graph__node_contents(graph(N, A), node(N)) = N.
>
> :- func graph__successors(graph(N, A), node(N)) = set(node(N)).
>
> :- func graph__nodes(graph(N, A)) = set(node(N)).
>
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
>
> :- implementation.
>
> graph__init = G :-
> graph__init(G).
>
> graph__find_matching_nodes(G, N) = S :-
> graph__find_matching_nodes(G, N, S).
>
> graph__node_contents(G, N) = NI :-
> graph__node_contents(G, N, NI).
>
> graph__successors(G, N) = S :-
> graph__successors(G, N, S).
>
> graph__nodes(G) = S :-
> graph__nodes(G,S).
>
-------------- next part --------------
249a250,305
> %---------------------------------------------------------------------------%
> % Ralph Becket <rwab1 at cl.cam.ac.uk> 29/04/99
> % Function forms added.
>
> :- interface.
>
> :- func group__init = group(T).
>
> :- func group__insert(group(T), set(T)) = group(T).
>
> :- func group__group(group(T), T) = set(T).
>
> :- func group__to_set(group(T)) = set(set(T)).
>
> :- func group__sets_and_keys(group(T)) = assoc_list(set(T), group__key).
>
> :- func group__group_key(group(T), T) = group__key.
>
> :- func group__key_group(group(T), group__key) = set(T).
>
> :- func group__largest_group_key(group(T)) = group__key.
>
> :- func group__group_keys(group(T)) = list(group__key).
>
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
>
> :- implementation.
>
> group__init = G :-
> group__init(G).
>
> group__insert(G1, S) = G2 :-
> group__insert(G1, S, G2).
>
> group__group(G, T) = S :-
> group__group(G, T, S).
>
> group__to_set(G) = SS :-
> group__to_set(G, SS).
>
> group__sets_and_keys(G) = AL :-
> group__sets_and_keys(G, AL).
>
> group__group_key(G, T) = K :-
> group__group_key(G, T, K).
>
> group__key_group(G, K) = S :-
> group__key_group(G, K, S).
>
> group__largest_group_key(G) = K :-
> group__largest_group_key(G, K).
>
> group__group_keys(G) = Ks :-
> group__group_keys(G, Ks).
>
-------------- next part --------------
178a179,219
> %--------------------------------------------------------------------------%
> % Ralph Becket <rwab1 at cl.cam.ac.uk> 29/04/99
> % Function forms added.
>
> :- interface.
>
> :- func queue__init = queue(T).
>
> :- func queue__put(queue(T), T) = queue(T).
>
> :- func queue__put_list(queue(T), list(T)) = queue(T).
>
> :- func queue__length(queue(T)) = int.
>
> :- func queue__list_to_queue(list(T)) = queue(T).
>
> :- func queue__delete_all(queue(T), T) = queue(T).
>
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
>
> :- implementation.
>
> queue__init = Q :-
> queue__init(Q).
>
> queue__put(Q1, T) = Q2 :-
> queue__put(Q1, T, Q2).
>
> queue__put_list(Q1, Xs) = Q2 :-
> queue__put_list(Q1, Xs, Q2).
>
> queue__length(Q) = N :-
> queue__length(Q, N).
>
> queue__list_to_queue(Xs) = Q :-
> queue__list_to_queue(Xs, Q).
>
> queue__delete_all(Q1, T) = Q2 :-
> queue__delete_all(Q1, T, Q2).
>
-------------- next part --------------
892a893,954
> %-----------------------------------------------------------------------------%
> % Ralph Becket <rwab1 at cl.cam.ac.uk> 29/04/99
> % Function forms added.
>
> :- interface.
>
> :- func rbtree__init = rbtree(K, V).
>
> :- func rbtree__set(rbtree(K, V), K, V) = rbtree(K, V).
>
> :- func rbtree__insert_duplicate(rbtree(K, V), K, V) = rbtree(K, V).
>
> :- func rbtree__lookup(rbtree(K, V), K) = V.
>
> :- func rbtree__delete(rbtree(K, V), K) = rbtree(K, V).
>
> :- func rbtree__keys(rbtree(K, V)) = list(K).
>
> :- func rbtree__values(rbtree(K, V)) = list(V).
>
> :- func rbtree__count(rbtree(K, V)) = int.
>
> :- func rbtree__assoc_list_to_rbtree(assoc_list(K, V)) = rbtree(K, V).
>
> :- func rbtree__rbtree_to_assoc_list(rbtree(K, V)) = assoc_list(K, V).
>
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
>
> :- implementation.
>
> rbtree__init = RBT :-
> rbtree__init(RBT).
>
> rbtree__set(RBT1, K, V) = RBT2 :-
> rbtree__set(RBT1, K, V, RBT2).
>
> rbtree__insert_duplicate(RBT1, K, V) = RBT2 :-
> rbtree__insert_duplicate(RBT1, K, V, RBT2).
>
> rbtree__lookup(RBT, K) = V :-
> rbtree__lookup(RBT, K, V).
>
> rbtree__delete(RBT1, K) = RBT2 :-
> rbtree__delete(RBT1, K, RBT2).
>
> rbtree__keys(RBT) = Ks :-
> rbtree__keys(RBT, Ks).
>
> rbtree__values(RBT) = Vs :-
> rbtree__values(RBT, Vs).
>
> rbtree__count(RBT) = N :-
> rbtree__count(RBT, N).
>
> rbtree__assoc_list_to_rbtree(AL) = RBT :-
> rbtree__assoc_list_to_rbtree(AL, RBT).
>
> rbtree__rbtree_to_assoc_list(RBT) = AL :-
> rbtree__rbtree_to_assoc_list(RBT, AL).
>
>
-------------- next part --------------
130a131,167
> %--------------------------------------------------------------------------%
> % Ralph Becket <rwab1 at cl.cam.ac.uk> 29/04/99
> % Function forms added.
>
> :- interface.
>
> :- func stack__init = stack(T).
>
> :- func stack__push(stack(T), T) = stack(T).
>
> :- func stack__push_list(stack(T), list(T)) = stack(T).
>
> :- func stack__top_det(stack(T)) = T.
>
> :- func stack__depth(stack(T)) = int.
>
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
>
> :- implementation.
>
> stack__init = S :-
> stack__init(S).
>
> stack__push(S1, X) = S2 :-
> stack__push(S1, X, S2).
>
> stack__push_list(S1, Xs) = S2 :-
> stack__push_list(S1, Xs, S2).
>
> stack__top_det(S) = X :-
> stack__top_det(S, X).
>
> stack__depth(S) = N :-
> stack__depth(S, N).
>
>
-------------- next part --------------
1115a1116,1277
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
> % Ralph Becket <rwab1 at cl.cam.ac.uk> 30/04/99
> % Function forms added.
>
> :- interface.
>
> :- func term__context_init = term__context.
>
> :- func term__init_var_supply = var_supply(T).
>
> :- func term__try_term_to_type(term(U)) = term_to_type_result(T, U).
>
> :- func term__det_term_to_type(term(_)) = T.
>
> :- func term__type_to_term(T) = term(_).
>
> :- func term__univ_to_term(univ) = term(_).
>
> :- func term__vars(term(T)) = list(var(T)).
>
> :- func term__vars_2(term(T), list(var(T))) = list(var(T)).
>
> :- func term__vars_list(list(term(T))) = list(var(T)).
>
> :- func term__substitute(term(T), var(T), term(T)) = term(T).
>
> :- func term__substitute_list(list(term(T)), var(T), term(T)) = list(term(T)).
>
> :- func term__substitute_corresponding(list(var(T)), list(term(T)), term(T)) = term(T).
>
> :- func term__substitute_corresponding_list(list(var(T)), list(term(T)), list(term(T))) = list(term(T)).
>
> :- func term__apply_rec_substitution(term(T), substitution(T)) = term(T).
>
> :- func term__apply_rec_substitution_to_list(list(term(T)), substitution(T)) = list(term(T)).
>
> :- func term__apply_substitution(term(T), substitution(T)) = term(T).
>
> :- func term__apply_substitution_to_list(list(term(T)), substitution(T)) = list(term(T)).
>
> :- func term__relabel_variable(term(T), var(T), var(T)) = term(T).
>
> :- func term__relabel_variables(list(term(T)), var(T), var(T)) = list(term(T)).
>
> :- func term__apply_variable_renaming(term(T), map(var(T), var(T))) = term(T).
>
> :- func term__apply_variable_renaming_to_list(list(term(T)), map(var(T), var(T))) = list(term(T)).
>
> :- func term__var_to_int(var(T)) = int.
>
> :- func term__context_line(term__context) = int.
>
> :- func term__context_file(term__context) = string.
>
> :- func term__context_init(string, int) = term__context.
>
> :- func term__term_list_to_var_list(list(term(T))) = list(var(T)).
>
> :- func term__var_list_to_term_list(list(var(T))) = list(term(T)).
>
> :- func term__coerce(term(T)) = term(U).
>
> :- func term__coerce_var(var(T)) = var(U).
>
> :- func term__coerce_var_supply(var_supply(T)) = var_supply(U).
>
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
>
> :- implementation.
>
> term__context_init = C :-
> term__context_init(C).
>
> term__init_var_supply = VS :-
> term__init_var_supply(VS).
>
> term__try_term_to_type(T) = TTTR :-
> term__try_term_to_type(T, TTTR).
>
> term__det_term_to_type(T1) = T2 :-
> term__det_term_to_type(T1, T2).
>
> term__type_to_term(T1) = T2 :-
> term__type_to_term(T1, T2).
>
> term__univ_to_term(U) = T :-
> term__univ_to_term(U, T).
>
> term__vars(T) = Vs :-
> term__vars(T, Vs).
>
> term__vars_2(T, Vs1) = Vs2 :-
> term__vars_2(T, Vs1, Vs2).
>
> term__vars_list(Ts) = Vs :-
> term__vars_list(Ts, Vs).
>
> term__substitute(T1, V, T2) = T3 :-
> term__substitute(T1, V, T2, T3).
>
> term__substitute_list(Ts1, V, T) = Ts2 :-
> term__substitute_list(Ts1, V, T, Ts2).
>
> term__substitute_corresponding(Vs, T1s, T) = T2 :-
> term__substitute_corresponding(Vs, T1s, T, T2).
>
> term__substitute_corresponding_list(Vs, Ts1, Ts2) = Ts3 :-
> term__substitute_corresponding_list(Vs, Ts1, Ts2, Ts3).
>
> term__apply_rec_substitution(T1, S) = T2 :-
> term__apply_rec_substitution(T1, S, T2).
>
> term__apply_rec_substitution_to_list(Ts1, S) = Ts2 :-
> term__apply_rec_substitution_to_list(Ts1, S, Ts2).
>
> term__apply_substitution(T1, S) = T2 :-
> term__apply_substitution(T1, S, T2).
>
> term__apply_substitution_to_list(Ts1, S) = Ts2 :-
> term__apply_substitution_to_list(Ts1, S, Ts2).
>
> term__relabel_variable(T1, V1, V2) = T2 :-
> term__relabel_variable(T1, V1, V2, T2).
>
> term__relabel_variables(Ts1, V1, V2) = Ts2 :-
> term__relabel_variables(Ts1, V1, V2, Ts2).
>
> term__apply_variable_renaming(T1, M) = T2 :-
> term__apply_variable_renaming(T1, M, T2).
>
> term__apply_variable_renaming_to_list(Ts1, M) = Ts2 :-
> term__apply_variable_renaming_to_list(Ts1, M, Ts2).
>
> term__var_to_int(V) = N :-
> term__var_to_int(V, N).
>
> term__context_line(C) = N :-
> term__context_line(C, N).
>
> term__context_file(C) = S :-
> term__context_file(C, S).
>
> term__context_init(S, N) = C :-
> term__context_init(S, N, C).
>
> term__term_list_to_var_list(Ts) = Vs :-
> term__term_list_to_var_list(Ts, Vs).
>
> term__var_list_to_term_list(Vs) = Ts :-
> term__var_list_to_term_list(Vs, Ts).
>
> term__coerce(T1) = T2 :-
> term__coerce(T1, T2).
>
> term__coerce_var(V1) = V2 :-
> term__coerce_var(V1, V2).
>
> term__coerce_var_supply(VS1) = VS2 :-
> term__coerce_var_supply(VS1, VS2).
>
-------------- next part --------------
514a515,609
> % Ralph Becket <rwab1 at cl.cam.ac.uk> 30/04/99
> % Function forms added.
>
> :- interface.
>
> :- func varset__init = varset(T).
>
> :- func varset__delete_var(varset(T), var(T)) = varset(T).
>
> :- func varset__delete_vars(varset(T), list(var(T))) = varset(T).
>
> :- func varset__vars(varset(T)) = list(var(T)).
>
> :- func varset__name_var(varset(T), var(T), string) = varset(T).
>
> :- func varset__lookup_name(varset(T), var(T)) = string.
>
> :- func varset__lookup_name(varset(T), var(T), string) = string.
>
> :- func varset__bind_var(varset(T), var(T), term(T)) = varset(T).
>
> :- func varset__bind_vars(varset(T), substitution(T)) = varset(T).
>
> :- func varset__lookup_vars(varset(T)) = substitution(T).
>
> :- func varset__get_bindings(varset(T)) = substitution(T).
>
> :- func varset__set_bindings(varset(T), substitution(T)) = varset(T).
>
> :- func varset__create_name_var_map(varset(T)) = map(string, var(T)).
>
> :- func varset__var_name_list(varset(T)) = assoc_list(var(T), string).
>
> :- func varset__ensure_unique_names(list(var(T)), string, varset(T)) = varset(T).
>
> :- func varset__select(varset(T), set(var(T))) = varset(T).
>
> :- func varset__coerce(varset(T)) = varset(U).
>
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
>
> :- implementation.
>
> varset__init = VS :-
> varset__init(VS).
>
> varset__delete_var(VS1, V) = VS2 :-
> varset__delete_var(VS1, V, VS2).
>
> varset__delete_vars(VS1, Vs) = VS2 :-
> varset__delete_vars(VS1, Vs, VS2).
>
> varset__vars(VS) = Vs :-
> varset__vars(VS, Vs).
>
> varset__name_var(VS1, V, S) = VS2 :-
> varset__name_var(VS1, V, S, VS2).
>
> varset__lookup_name(VS, V) = S :-
> varset__lookup_name(VS, V, S).
>
> varset__lookup_name(VS1, V, S) = S2 :-
> varset__lookup_name(VS1, V, S, S2).
>
> varset__bind_var(VS1, V, T) = VS2 :-
> varset__bind_var(VS1, V, T, VS2).
>
> varset__bind_vars(VS1, S) = VS2 :-
> varset__bind_vars(VS1, S, VS2).
>
> varset__lookup_vars(VS) = S :-
> varset__lookup_vars(VS, S).
>
> varset__get_bindings(VS) = S :-
> varset__get_bindings(VS, S).
>
> varset__set_bindings(VS1, S) = VS2 :-
> varset__set_bindings(VS1, S, VS2).
>
> varset__create_name_var_map(VS) = M :-
> varset__create_name_var_map(VS, M).
>
> varset__var_name_list(VS) = AL :-
> varset__var_name_list(VS, AL).
>
> varset__ensure_unique_names(Vs, S1, VS1) = VS2 :-
> varset__ensure_unique_names(Vs, S1, VS1, VS2).
>
> varset__select(VS1, S) = VS2 :-
> varset__select(VS1, S, VS2).
>
> varset__coerce(VS1) = VS2 :-
> varset__coerce(VS1, VS2).
>
-------------- next part --------------
2474a2475,2541
> % Ralph Becket <rwab1 at cl.cam.ac.uk> 30/04/99
> % Function forms added.
>
> :- interface.
>
> :- func tree234__init = tree234(K, V).
>
> :- func tree234__lookup(tree234(K, V), K) = V.
>
> :- func tree234__set(tree234(K, V), K, V) = tree234(K, V).
>
> :- func tree234__delete(tree234(K, V), K) = tree234(K, V).
>
> :- func tree234__keys(tree234(K, V)) = list(K).
>
> :- func tree234__values(tree234(K, V)) = list(V).
>
> :- func tree234__count(tree234(K, V)) = int.
>
> :- func tree234__assoc_list_to_tree234(assoc_list(K, V)) = tree234(K, V).
>
> :- func tree234__tree234_to_assoc_list(tree234(K, V)) = assoc_list(K, V).
>
> :- func tree234__foldl(func(K, V, T) = T, tree234(K, V), T) = T.
>
> :- func tree234__map_values(func(K, V) = W, tree234(K, V)) = tree234(K, W).
>
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
>
> :- implementation.
>
> tree234__init = T :-
> tree234__init(T).
>
> tree234__lookup(T, K) = V :-
> tree234__lookup(T, K, V).
>
> tree234__set(T1, K, V) = T2 :-
> tree234__set(T1, K, V, T2).
>
> tree234__delete(T1, K) = T2 :-
> tree234__delete(T1, K, T2).
>
> tree234__keys(T) = Ks :-
> tree234__keys(T, Ks).
>
> tree234__values(T) = Vs :-
> tree234__values(T, Vs).
>
> tree234__count(T) = N :-
> tree234__count(T, N).
>
> tree234__assoc_list_to_tree234(AL) = T :-
> tree234__assoc_list_to_tree234(AL, T).
>
> tree234__tree234_to_assoc_list(T) = AL :-
> tree234__tree234_to_assoc_list(T, AL).
>
> tree234__foldl(F, T, A) = B :-
> P = ( pred(W::in, X::in, Y::in, Z::out) is det :- Z = F(W, X, Y) ),
> tree234__foldl(P, T, A, B).
>
> tree234__map_values(F, T1) = T2 :-
> P = ( pred(X::in, Y::in, Z::out) is det :- Z = F(X, Y) ),
> tree234__map_values(P, T1, T2).
>
-------------- next part --------------
1058a1059,1203
> % Ralph Becket <rwab1 at cl.cam.ac.uk> 30/04/99
> % Function forms added.
>
> :- interface.
>
> :- func relation__init = relation(T).
>
> :- func relation__lookup_element(relation(T), T) = relation_key.
>
> :- func relation__lookup_key(relation(T), relation_key) = T.
>
> :- func relation__add(relation(T), relation_key, relation_key) = relation(T).
>
> :- func relation__add_values(relation(T), T, T) = relation(T).
>
> :- func relation__add_assoc_list(relation(T), assoc_list(relation_key, relation_key)) = relation(T).
>
> :- func relation__remove(relation(T), relation_key, relation_key) = relation(T).
>
> :- func relation__remove_assoc_list(relation(T), assoc_list(relation_key, relation_key)) = relation(T).
>
> :- func relation__lookup_from(relation(T), relation_key) = set(relation_key).
>
> :- func relation__lookup_to(relation(T), relation_key) = set(relation_key).
>
> :- func relation__to_assoc_list(relation(T)) = assoc_list(T, T).
>
> :- func relation__to_key_assoc_list(relation(T)) = assoc_list(relation_key, relation_key).
>
> :- func relation__from_assoc_list(assoc_list(T, T)) = relation(T).
>
> :- func relation__domain(relation(T)) = set(T).
>
> :- func relation__inverse(relation(T)) = relation(T).
>
> :- func relation__compose(relation(T), relation(T)) = relation(T).
>
> :- func relation__dfs(relation(T), relation_key) = list(relation_key).
>
> :- func relation__dfsrev(relation(T), relation_key) = list(relation_key).
>
> :- func relation__dfs(relation(T)) = list(relation_key).
>
> :- func relation__dfsrev(relation(T)) = list(relation_key).
>
> :- func relation__components(relation(T)) = set(set(relation_key)).
>
> :- func relation__cliques(relation(T)) = set(set(relation_key)).
>
> :- func relation__reduced(relation(T)) = relation(set(T)).
>
> :- func relation__atsort(relation(T)) = list(set(T)).
>
> :- func relation__sc(relation(T)) = relation(T).
>
> :- func relation__tc(relation(T)) = relation(T).
>
> :- func relation__rtc(relation(T)) = relation(T).
>
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
>
> :- implementation.
>
> relation__init = R :-
> relation__init(R).
>
> relation__lookup_element(R, X) = K :-
> relation__lookup_element(R, X, K).
>
> relation__lookup_key(R, K) = X :-
> relation__lookup_key(R, K, X).
>
> relation__add(R1, K1, K2) = R2 :-
> relation__add(R1, K1, K2, R2).
>
> relation__add_values(R1, X, Y) = R2 :-
> relation__add_values(R1, X, Y, R2).
>
> relation__add_assoc_list(R1, AL) = R2 :-
> relation__add_assoc_list(R1, AL, R2).
>
> relation__remove(R1, K1, K2) = R2 :-
> relation__remove(R1, K1, K2, R2).
>
> relation__remove_assoc_list(R1, AL) = R2 :-
> relation__remove_assoc_list(R1, AL, R2).
>
> relation__lookup_from(R, K) = S :-
> relation__lookup_from(R, K, S).
>
> relation__lookup_to(R, K) = S :-
> relation__lookup_to(R, K, S).
>
> relation__to_assoc_list(R) = AL :-
> relation__to_assoc_list(R, AL).
>
> relation__to_key_assoc_list(R) = AL :-
> relation__to_key_assoc_list(R, AL).
>
> relation__from_assoc_list(AL) = R :-
> relation__from_assoc_list(AL, R).
>
> relation__domain(R) = S :-
> relation__domain(R, S).
>
> relation__inverse(R1) = R2 :-
> relation__inverse(R1, R2).
>
> relation__compose(R1, R2) = R3 :-
> relation__compose(R1, R2, R3).
>
> relation__dfs(R, K) = Ks :-
> relation__dfs(R, K, Ks).
>
> relation__dfsrev(R, K) = Ks :-
> relation__dfsrev(R, K, Ks).
>
> relation__dfs(R) = Ks :-
> relation__dfs(R, Ks).
>
> relation__dfsrev(R) = Ks :-
> relation__dfsrev(R, Ks).
>
> relation__components(R) = KSS :-
> relation__components(R, KSS).
>
> relation__cliques(R) = KSS :-
> relation__cliques(R, KSS).
>
> relation__reduced(R1) = R2 :-
> relation__reduced(R1, R2).
>
> relation__atsort(R) = Ss :-
> relation__atsort(R, Ss).
>
> relation__sc(R1) = R2 :-
> relation__sc(R1, R2).
>
> relation__tc(R1) = R2 :-
> relation__tc(R1, R2).
>
> relation__rtc(R1) = R2 :-
> relation__rtc(R1, R2).
>
-------------- next part --------------
14a15,17
> % Ralph Becket <rwab1 at cam.sri.com> 24/04/99
> % Function forms added.
>
271a275,375
> % Ralph Becket <rwab1 at cam.sri.com> 24/04/99
> % Function forms added.
>
> :- interface.
>
> :- func set__list_to_set(list(T)) = set(T).
>
> :- func set__sorted_list_to_set(list(T)) = set(T).
>
> :- func set__to_sorted_list(set(T)) = list(T).
>
> :- func set__init = set(T).
>
> :- func set__make_singleton_set(T) = set(T).
>
> :- func set__insert(set(T), T) = set(T).
>
> :- func set__insert_list(set(T), list(T)) = set(T).
>
> :- func set__delete(set(T), T) = set(T).
>
> :- func set__delete_list(set(T), list(T)) = set(T).
>
> :- func set__union(set(T), set(T)) = set(T).
>
> :- func set__power_union(set(set(T))) = set(T).
>
> :- func set__intersect(set(T), set(T)) = set(T).
>
> :- func set__power_intersect(set(set(T))) = set(T).
>
> :- func set__difference(set(T), set(T)) = set(T).
>
> :- func set__count(set(T)) = int.
>
> :- func set__map(func(T1) = T2, set(T1)) = set(T2).
>
> :- func set__filter_map(func(T1) = T2, set(T1)) = set(T2).
> :- mode set__filter_map(func(in) = out is semidet, in) = out is det.
>
> :- func set__fold(func(T1, T2) = T2, set(T1), T2) = T2.
>
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
>
> :- implementation.
>
> set__list_to_set(Xs) = S :-
> set__list_to_set(Xs, S).
>
> set__sorted_list_to_set(Xs) = S :-
> set__sorted_list_to_set(Xs, S).
>
> set__to_sorted_list(S) = Xs :-
> set__to_sorted_list(S, Xs).
>
> set__init = S :-
> set__init(S).
>
> set__make_singleton_set(T) = S :-
> set__singleton_set(S, T).
>
> set__insert(S1, T) = S2 :-
> set__insert(S1, T, S2).
>
> set__insert_list(S1, Xs) = S2 :-
> set__insert_list(S1, Xs, S2).
>
> set__delete(S1, T) = S2 :-
> set__delete(S1, T, S2).
>
> set__delete_list(S1, Xs) = S2 :-
> set__delete_list(S1, Xs, S2).
>
> set__union(S1, S2) = S3 :-
> set__union(S1, S2, S3).
>
> set__power_union(SS) = S :-
> set__power_union(SS, S).
>
> set__intersect(S1, S2) = S3 :-
> set__intersect(S1, S2, S3).
>
> set__power_intersect(SS) = S :-
> set__power_intersect(SS, S).
>
> set__difference(S1, S2) = S3 :-
> set__difference(S1, S2, S3).
>
> set__count(S) = N :-
> set__count(S, N).
>
> set__map(F, S1) = S2 :-
> S2 = set__list_to_set(list__map(F, set__to_sorted_list(S1))).
>
> set__filter_map(PF, S1) = S2 :-
> S2 = set__list_to_set(list__filter_map(PF, set__to_sorted_list(S1))).
>
> set__fold(F, S, A) = B :-
> B = list__foldl(F, set__to_sorted_list(S), A).
>
-------------- next part --------------
1199,1200c1199,1296
< %------------------------------------------------------------------------------%
< %------------------------------------------------------------------------------%
---
> %--------------------------------------------------------------------------%
> %--------------------------------------------------------------------------%
> % Ralph Becket <rwab1 at cam.sri.com> 24/04/99
> % Function forms added.
>
> :- interface.
>
> :- func set_bbbtree__list_to_set(list(T)) = set_bbbtree(T).
>
> :- func set_bbbtree__sorted_list_to_set(list(T)) = set_bbbtree(T).
>
> :- func set_bbbtree__to_sorted_list(set_bbbtree(T)) = list(T).
>
> :- func set_bbbtree__init = set_bbbtree(T).
>
> :- func set_bbbtree__make_singleton_set(T) = set_bbbtree(T).
>
> :- func set_bbbtree__insert(set_bbbtree(T), T) = set_bbbtree(T).
>
> :- func set_bbbtree__insert_list(set_bbbtree(T), list(T)) = set_bbbtree(T).
>
> :- func set_bbbtree__delete(set_bbbtree(T), T) = set_bbbtree(T).
>
> :- func set_bbbtree__delete_list(set_bbbtree(T), list(T)) = set_bbbtree(T).
>
> :- func set_bbbtree__union(set_bbbtree(T), set_bbbtree(T)) = set_bbbtree(T).
>
> :- func set_bbbtree__power_union(set_bbbtree(set_bbbtree(T))) = set_bbbtree(T).
>
> :- func set_bbbtree__intersect(set_bbbtree(T), set_bbbtree(T)) = set_bbbtree(T).
>
> :- func set_bbbtree__power_intersect(set_bbbtree(set_bbbtree(T))) = set_bbbtree(T).
>
> :- func set_bbbtree__difference(set_bbbtree(T), set_bbbtree(T)) = set_bbbtree(T).
>
> :- func set_bbbtree__map(func(T1) = T2, set_bbbtree(T1)) = set_bbbtree(T2).
>
> :- func set_bbbtree__filter_map(func(T1) = T2, set_bbbtree(T1)) = set_bbbtree(T2).
> :- mode set_bbbtree__filter_map(func(in) = out is semidet, in) = out is det.
>
> :- func set_bbbtree__fold(func(T1, T2) = T2, set_bbbtree(T1), T2) = T2.
>
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
>
> :- implementation.
>
> set_bbbtree__list_to_set(Xs) = S :-
> set_bbbtree__list_to_set(Xs, S).
>
> set_bbbtree__sorted_list_to_set(Xs) = S :-
> set_bbbtree__sorted_list_to_set(Xs, S).
>
> set_bbbtree__to_sorted_list(S) = Xs :-
> set_bbbtree__to_sorted_list(S, Xs).
>
> set_bbbtree__init = S :-
> set_bbbtree__init(S).
>
> set_bbbtree__make_singleton_set(T) = S :-
> set_bbbtree__singleton_set(S, T).
>
> set_bbbtree__insert(S1, T) = S2 :-
> set_bbbtree__insert(S1, T, S2).
>
> set_bbbtree__insert_list(S1, Xs) = S2 :-
> set_bbbtree__insert_list(S1, Xs, S2).
>
> set_bbbtree__delete(S1, T) = S2 :-
> set_bbbtree__delete(S1, T, S2).
>
> set_bbbtree__delete_list(S1, Xs) = S2 :-
> set_bbbtree__delete_list(S1, Xs, S2).
>
> set_bbbtree__union(S1, S2) = S3 :-
> set_bbbtree__union(S1, S2, S3).
>
> set_bbbtree__power_union(SS) = S :-
> set_bbbtree__power_union(SS, S).
>
> set_bbbtree__intersect(S1, S2) = S3 :-
> set_bbbtree__intersect(S1, S2, S3).
>
> set_bbbtree__power_intersect(SS) = S :-
> set_bbbtree__power_intersect(SS, S).
>
> set_bbbtree__difference(S1, S2) = S3 :-
> set_bbbtree__difference(S1, S2, S3).
>
> set_bbbtree__map(F, S1) = S2 :-
> S2 = set_bbbtree__list_to_set(list__map(F, set_bbbtree__to_sorted_list(S1))).
>
> set_bbbtree__filter_map(PF, S1) = S2 :-
> S2 = set_bbbtree__list_to_set(list__filter_map(PF, set_bbbtree__to_sorted_list(S1))).
>
> set_bbbtree__fold(F, S, A) = B :-
> B = list__foldl(F, set_bbbtree__to_sorted_list(S), A).
>
-------------- next part --------------
351a352,453
> %--------------------------------------------------------------------------%
> % Ralph Becket <rwab1 at cam.sri.com> 24/04/99
> % Function forms added.
>
> :- interface.
>
> :- func set_ordlist__list_to_set(list(T)) = set_ordlist(T).
>
> :- func set_ordlist__sorted_list_to_set(list(T)) = set_ordlist(T).
>
> :- func set_ordlist__to_sorted_list(set_ordlist(T)) = list(T).
>
> :- func set_ordlist__init = set_ordlist(T).
>
> :- func set_ordlist__make_singleton_set(T) = set_ordlist(T).
>
> :- func set_ordlist__insert(set_ordlist(T), T) = set_ordlist(T).
>
> :- func set_ordlist__insert_list(set_ordlist(T), list(T)) = set_ordlist(T).
>
> :- func set_ordlist__delete(set_ordlist(T), T) = set_ordlist(T).
>
> :- func set_ordlist__delete_list(set_ordlist(T), list(T)) = set_ordlist(T).
>
> :- func set_ordlist__union(set_ordlist(T), set_ordlist(T)) = set_ordlist(T).
>
> :- func set_ordlist__power_union(set_ordlist(set_ordlist(T))) = set_ordlist(T).
>
> :- func set_ordlist__intersect(set_ordlist(T), set_ordlist(T)) = set_ordlist(T).
>
> :- func set_ordlist__power_intersect(set_ordlist(set_ordlist(T))) = set_ordlist(T).
>
> :- func set_ordlist__difference(set_ordlist(T), set_ordlist(T)) = set_ordlist(T).
>
> :- func set_ordlist__count(set_ordlist(T)) = int.
>
> :- func set_ordlist__map(func(T1) = T2, set_ordlist(T1)) = set_ordlist(T2).
>
> :- func set_ordlist__filter_map(func(T1) = T2, set_ordlist(T1)) = set_ordlist(T2).
> :- mode set_ordlist__filter_map(func(in) = out is semidet, in) = out is det.
>
> :- func set_ordlist__fold(func(T1, T2) = T2, set_ordlist(T1), T2) = T2.
>
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
>
> :- implementation.
>
> set_ordlist__list_to_set(Xs) = S :-
> set_ordlist__list_to_set(Xs, S).
>
> set_ordlist__sorted_list_to_set(Xs) = S :-
> set_ordlist__sorted_list_to_set(Xs, S).
>
> set_ordlist__to_sorted_list(S) = Xs :-
> set_ordlist__to_sorted_list(S, Xs).
>
> set_ordlist__init = S :-
> set_ordlist__init(S).
>
> set_ordlist__make_singleton_set(T) = S :-
> set_ordlist__singleton_set(S, T).
>
> set_ordlist__insert(S1, T) = S2 :-
> set_ordlist__insert(S1, T, S2).
>
> set_ordlist__insert_list(S1, Xs) = S2 :-
> set_ordlist__insert_list(S1, Xs, S2).
>
> set_ordlist__delete(S1, T) = S2 :-
> set_ordlist__delete(S1, T, S2).
>
> set_ordlist__delete_list(S1, Xs) = S2 :-
> set_ordlist__delete_list(S1, Xs, S2).
>
> set_ordlist__union(S1, S2) = S3 :-
> set_ordlist__union(S1, S2, S3).
>
> set_ordlist__power_union(SS) = S :-
> set_ordlist__power_union(SS, S).
>
> set_ordlist__intersect(S1, S2) = S3 :-
> set_ordlist__intersect(S1, S2, S3).
>
> set_ordlist__power_intersect(SS) = S :-
> set_ordlist__power_intersect(SS, S).
>
> set_ordlist__difference(S1, S2) = S3 :-
> set_ordlist__difference(S1, S2, S3).
>
> set_ordlist__count(S) = N :-
> set_ordlist__count(S, N).
>
> set_ordlist__map(F, S1) = S2 :-
> S2 = set_ordlist__list_to_set(list__map(F, set_ordlist__to_sorted_list(S1))).
>
> set_ordlist__filter_map(PF, S1) = S2 :-
> S2 = set_ordlist__list_to_set(list__filter_map(PF, set_ordlist__to_sorted_list(S1))).
>
> set_ordlist__fold(F, S, A) = B :-
> B = list__foldl(F, set_ordlist__to_sorted_list(S), A).
>
-------------- next part --------------
308a309,405
> %--------------------------------------------------------------------------%
> % Ralph Becket <rwab1 at cam.sri.com> 24/04/99
> % Function forms added.
>
> :- interface.
>
> :- func set_unordlist__list_to_set(list(T)) = set_unordlist(T).
>
> :- func set_unordlist__sorted_list_to_set(list(T)) = set_unordlist(T).
>
> :- func set_unordlist__to_sorted_list(set_unordlist(T)) = list(T).
>
> :- func set_unordlist__init = set_unordlist(T).
>
> :- func set_unordlist__make_singleton_set(T) = set_unordlist(T).
>
> :- func set_unordlist__insert(set_unordlist(T), T) = set_unordlist(T).
>
> :- func set_unordlist__insert_list(set_unordlist(T), list(T)) = set_unordlist(T).
>
> :- func set_unordlist__delete(set_unordlist(T), T) = set_unordlist(T).
>
> :- func set_unordlist__delete_list(set_unordlist(T), list(T)) = set_unordlist(T).
>
> :- func set_unordlist__union(set_unordlist(T), set_unordlist(T)) = set_unordlist(T).
>
> :- func set_unordlist__power_union(set_unordlist(set_unordlist(T))) = set_unordlist(T).
>
> :- func set_unordlist__intersect(set_unordlist(T), set_unordlist(T)) = set_unordlist(T).
>
> :- func set_unordlist__power_intersect(set_unordlist(set_unordlist(T))) = set_unordlist(T).
>
> :- func set_unordlist__difference(set_unordlist(T), set_unordlist(T)) = set_unordlist(T).
>
> :- func set_unordlist__map(func(T1) = T2, set_unordlist(T1)) = set_unordlist(T2).
>
> :- func set_unordlist__filter_map(func(T1) = T2, set_unordlist(T1)) = set_unordlist(T2).
> :- mode set_unordlist__filter_map(func(in) = out is semidet, in) = out is det.
>
> :- func set_unordlist__fold(func(T1, T2) = T2, set_unordlist(T1), T2) = T2.
>
> % ---------------------------------------------------------------------------- %
> % ---------------------------------------------------------------------------- %
>
> :- implementation.
>
> set_unordlist__list_to_set(Xs) = S :-
> set_unordlist__list_to_set(Xs, S).
>
> set_unordlist__sorted_list_to_set(Xs) = S :-
> set_unordlist__sorted_list_to_set(Xs, S).
>
> set_unordlist__to_sorted_list(S) = Xs :-
> set_unordlist__to_sorted_list(S, Xs).
>
> set_unordlist__init = S :-
> set_unordlist__init(S).
>
> set_unordlist__make_singleton_set(T) = S :-
> set_unordlist__singleton_set(S, T).
>
> set_unordlist__insert(S1, T) = S2 :-
> set_unordlist__insert(S1, T, S2).
>
> set_unordlist__insert_list(S1, Xs) = S2 :-
> set_unordlist__insert_list(S1, Xs, S2).
>
> set_unordlist__delete(S1, T) = S2 :-
> set_unordlist__delete(S1, T, S2).
>
> set_unordlist__delete_list(S1, Xs) = S2 :-
> set_unordlist__delete_list(S1, Xs, S2).
>
> set_unordlist__union(S1, S2) = S3 :-
> set_unordlist__union(S1, S2, S3).
>
> set_unordlist__power_union(SS) = S :-
> set_unordlist__power_union(SS, S).
>
> set_unordlist__intersect(S1, S2) = S3 :-
> set_unordlist__intersect(S1, S2, S3).
>
> set_unordlist__power_intersect(SS) = S :-
> set_unordlist__power_intersect(SS, S).
>
> set_unordlist__difference(S1, S2) = S3 :-
> set_unordlist__difference(S1, S2, S3).
>
> set_unordlist__map(F, S1) = S2 :-
> S2 = set_unordlist__list_to_set(list__map(F, set_unordlist__to_sorted_list(S1))).
>
> set_unordlist__filter_map(PF, S1) = S2 :-
> S2 = set_unordlist__list_to_set(list__filter_map(PF, set_unordlist__to_sorted_list(S1))).
>
> set_unordlist__fold(F, S, A) = B :-
> B = list__foldl(F, set_unordlist__to_sorted_list(S), A).
>
More information about the developers
mailing list