Did you know ... | Search Documentation: |
Pack pac -- prolog/zdd/zdd.pl |
obj_id([a,b,c], Id)
, obj_id(Obj, Id)
.opp_compare(C, Y, X)
.--- only basic expressions follow ---
x x if x is nummber, string, or list. $E E (quote). @(a) {{a}} as a singleton family of a.
:E eval E as prolog term with last argument as output. #E eval E as zdd term using state. !E apply E without evaluating args.
--- zdd expression ---
X + Y join (union) of X and Y
X - Y subtract Y from X
X \ Y subtract Y from X
X & Y intersection of X and Y
merge(X, Y)
merge/multiply X and Y
X * Y merge/multiply X and Y
X // Y quotient X by Y.
X / Y remainder of X by Y.
prod(X, YO)
product of X and Y
X ** Y product of X and Y
pow(X)
powerset of X
power(X)
powerset of X
set(L)
read L a singleton family {L}.
sets(X, S)
convet X in S to list of lists
*E merge all elements of a list E.
+E join all elements of a list E.
{A,B,..} family of sets [A, B, ...]
--- Boolean terms ---
cnf(F, X) X is CNF of F. dnf(F, X) X is DNF of F,
cofact(Z, t(X, 0, Y), S)
.
Having analogy Z = [X|Y] in mind.Remark. The merge is associative and commutative, but not idempotent.
zdd_divmod(X, Y, D, M, S)
,
psa(X, S)
, psa(D, S)
, psa(M, S)
.zdd_list(Y, U, Z)
, zdd_mod_by_list(X, U, Z, S)
.zdd_sets(U, [X], Z, S)
, zdd_div(Y, U, Z, S)
.zdd_sets(U, [X], S)
, zdd_divisible(Y, U, Z, S)
.
map_zdd(F, X, Y)
works roughly like
maplist(maplist(F), X, Y)
) with a list X of lists.
pow([a])
, psa(X)
.
?- zdd X<<{[a]}, psa(X)
.
?- zdd((X << pow([a, b, c]), zdd_rand_path(X)))
.
?- zdd((X << {[a], [b], [c]}, zdd_rand_path(X)))
.
?- zdd((X << pow([a, b, c, d, e, f, g]), zdd_rand_path(X)))
.
@ [a,c,e,f]
@ X = 8.
zdd_ord_power([a,b], 1, X)
, psa(X)
.a(e0,e1)
, where a is an atom,
e0 and e1 are integer expressions.
A is the list of atoms ai with suffix i (j=<i=<k),
where j and k is the value of e0 and e1.charlist(A-B, X)
.
?- charlist(a, c, X)
.
@ X = [a, b, c].zdd0((X<<pow([a,b,c]), zdd_subtr(1, X, Y), card(Y, C)))
.
?- zdd((zdd_insert(a, 1, X), zdd_insert(b, X, X1), prz(X1)))
.
?- zdd((X<<pow([a,b,c]), zdd_insert(x, X, X1), psa(X1)))
.
length(M)
= length(A)
+length(B)
, and both A and B are sublists of M.
A list U is a sublist of a list V if U is a subsequence of V,
provided that a list is viewed as a sequence.The following predicates are exported, but not or incorrectly documented.