1:- module(tm, []). 2:- use_module(pac(basic)). 3:- use_module(util(meta2)). 4:- use_module(pac('expand-pac')). 5term_expansion --> pac:expand_pac.
6:- use_module(pac(op)). 7
8
14
19
21:- bekind(set, [nonvar, stop]). 22sgn(emptyset, 0, []).
23sgn([], 0, []).
24sgn([X|Y], 0, [X|Y]).
25sgn(+, 2, union).
26sgn(plus, 2, pred([X, Y, Z]:-union(X, Y, Z))).
27sgn(yaplus, 2, fun([X, Y]>> :union(X, Y))).
28sgn(yayaplus, 2, fun([X, Y]>> :union@X@Y)).
29sgn(&, 2, intersection).
30sgn(\, 2, subtract).
31sgn(pow, 1, powerset).
32sgn(++, 2, direct_sum).
33sgn(*, 2, product).
34sgn(#, 2, scramble_cons).
35singleton(A) = xargs([X] >> [X])@ A.
36:- ekind. 37
39:- bekind(yaset, [nonvar, stop]). 40emptyset = [].
41X