# 4.2.1.3. Option type support¶

These functions and predicates implement the standard library for working with option types. Note that option type support is still incomplete.

## Option type support for Booleans¶

In this section: absent, deopt, occurs.

### absent¶

 predicate absent(var opt bool: x)  True iff x is absent

### deopt¶

 predicate deopt(var opt bool: x)  Return value of x (assumes that x is not absent)

### occurs¶

 predicate occurs(var opt bool: x)  True iff x is not absent

## Option type support for integers¶

In this section: absent, deopt, had_zero, occurs.

### absent¶

 predicate absent(var opt int: x)  True iff x is absent

### deopt¶

 function var $$E: deopt(var opt$$E: x)  Return value of x (assumes that x is not absent)

 test had_zero(var opt int: x) test had_zero(opt int: x) test had_zero(array [int] of var opt int: x)  True if x had zero in its original domain. Returns true if absent zero representation is disabled or if it is possible that $$\text{occurs}(x) \wedge \text{deopt}(x) = 0$$

### occurs¶

 predicate occurs(var opt int: x)  True iff x is not absent

## Option type support for floats¶

In this section: absent, deopt, occurs.

### absent¶

 predicate absent(var opt float: x)  True iff x is absent

### deopt¶

 function var float: deopt(var opt float: x)  Return value of x (assumes that x is not absent)

### occurs¶

 predicate occurs(var opt float: x)  True iff x is not absent

## Other declarations¶

In this section: absent, deopt, occurs.

### occurs¶

 1. test occurs($T: x) 2. test occurs(var$T: x) 3. test occurs(set of $$T: x) 4. test occurs(var set of$$T: x) 5. test occurs(opt \$T: x)  1-4. Test if x is not absent (always returns true) Test if x is not absent