[ library(cardinal) | Reference Manual | Alphabetic Index ]

domain(?SetVariable, -Domain)

Accessing the domain of a set
SetVariable
A set variable.
Domain
A list (pair) with glb and poss.

Description

Domain is unified with the domain of SetVariable in the form [Glb:NIn,Poss:NMax], where Glb is the (greatest) lower bound of SetVariable, and NIn its length, Poss is the set of still possible elements of SetVariable (i.e. its lub\glb), and NMax is the lub's cardinality (i.e. NIn + #(Poss)).

If SetVariable is a set of sets and a union function attribute has been set, then each element of Poss comes annotated with its respective length.

Fail Conditions

Fails if Domain can not be unified with the current domain of SetVariable.

Resatisfiable

No.

Examples

?- S `::[c]+[a,b], domain(S,D).
D = [[c]:1, [a,b]:3]

?- set(S, [],[[a,b],[b,c],[a,c],[b]],[union:[a,b,c]]), domain(S,D).
D = [[]:0, [[a,b]:2, [a,c]:2, [b]:1, [b,c]:2]:4]

See Also

domain / 3, glb / 2, poss / 2, glb_poss / 3, lub / 2, lub / 4