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

get_domain(?Var, -Domain)

Returns a ground representation of the current IC domain of a variable.
Var
An IC variable or a number.
Domain
A ground representation of the domain of Var.

Description

If Var is a number, Domain will be unified with that number.

If Var is a real IC variable, Domain will be unified with the term Lo..Hi where Lo and Hi are floats corresponding to the current lower and upper bounds of Var, respectively.

If Var is an integer IC variable with no holes in its domain, Domain will be unified with the term Lo..Hi where Lo and Hi are integers corresponding to the current lower and upper bounds of Var, respectively.

If Var is an integer IC variable with holes in its domain, Domain will be unified with an ordered list of integers and/or terms Lo..Hi where Lo and Hi are integers; in this case the elements of the domain of Var are exactly those integers appearing directly in the list or falling within any of the intervals Lo..Hi.

Modes and Determinism

Fail Conditions

The initial value of DomainList fails to unify with the returned value.

Exceptions

(5) type error
Var is neither an IC variable or number.

See Also

get_domain_as_list / 2, get_bounds / 3