Common — library colibrilib.spec — module Opt

The shapes of the results that may give nothing, and of a relation with an element of an abstract value.

171
module Opt
172
use option.Option

When r is Some x, p x holds (None: no claim)

175
predicate
when_some
(p: 'a -> bool) (r: option 'a) =
176
match r with Some x -> p x | None -> true end

The abstract value r contains the set p, None when p is empty

179
predicate
includes_opt
(mem: 'v -> 'd -> bool) (p: 'v -> bool) (r: option 'd) =
180
forall x. p x -> match r with None -> false | Some r -> mem x r end

Every x in the relation rel x y with a y of a is in r (the numbers below an element of a)

184
predicate
sound_rel
(mem: 'v -> 'd -> bool) (rel: 'v -> 'v -> bool) (a r: 'd) =
185
forall x y. mem y a -> rel x y -> mem x r
186
end