[ ECLiPSe Conjunto built-in.|Group Index| Full Index]

el_weight(+Var, ?Wvar)

Var is an element of type e(Val,Weight) from a weighted domain. Wvar is a free variable unifying with the weight Weight of Var.

+Var
A weighted element.
?Wvar
Term unifying with an integer.

Description

Unifyes the weight of the term Var which should be of the form e(Val,Weight) with Wvar. This predicate is convenient to select elements for the labeling of weighted sets.

Fail Conditions

Fails if Var is not of the form e(Val,Weight) or if Wvar is not unifyable with the weight.

Resatisfiable

No.

Exceptions

Examples


[eclipse 12]: E = e(1,2), el_weight(E, W).

E = e(1, 2)
W = 2
yes.


See Also

max_weight / 2, `:: / 2