library colibrilib.spec — module SoundThe shapes of the specifications of the abstract domains, as higher–order predicates: the review of an exported function only needs to read which shape, which membership and which operation.
mem x d is the membership of a value x in an abstract value d.
module Sound6use option.Option7
Sound forward propagation of a unary operation: the image by f of a is in r
predicate sound1 (mem: 'v -> 'd -> bool) (f: 'v -> 'v) (a r: 'd) =11forall x. mem x a -> mem (f x) r12
Sound forward propagation of a binary operation: the image by f of a and b is in r
predicate sound2 (mem: 'v -> 'd -> bool) (f: 'v -> 'v -> 'v) (a b r: 'd) =16forall x y. mem x a -> mem y b -> mem (f x y) r17
Complete forward propagation of a unary operation: every element of r is the image by f of an element of a
predicate complete1 (mem: 'v -> 'd -> bool) (f: 'v -> 'v) (a r: 'd) =21forall s. mem s r -> exists x. mem x a /\ s = f x22
Complete forward propagation of a binary operation
predicate complete2 (mem: 'v -> 'd -> bool) (f: 'v -> 'v -> 'v) (a b r: 'd) =25forall s. mem s r -> exists x y. mem x a /\ mem y b /\ s = f x y26
Sound backward propagation of a unary operation: the x of a with f x in c are in r
predicate back1 (mem: 'v -> 'd -> bool) (f: 'v -> 'v) (a c r: 'd) =30forall x. mem x a -> mem (f x) c -> mem x r31
Sound backward propagation on the first argument of a binary operation: the x of a with f x y in c for a y of b are in r; None when there is no such x
predicate back2 (mem: 'v -> 'd -> bool) (f: 'v -> 'v -> 'v) (a b c: 'd)36(r: option 'd) =37forall x y. mem x a -> mem y b -> mem (f x y) c ->38match r with None -> false | Some r -> mem x r end39
Sound backward propagation of a unary operation without a domain for the argument: the x with f x in c are in r
predicate preimage1 (mem: 'v -> 'd -> bool) (f: 'v -> 'v) (c r: 'd) =43forall x. mem (f x) c -> mem x r44
As preimage1, None when there is no such x
predicate preimage1_opt (mem: 'v -> 'd -> bool) (f: 'v -> 'v) (c: 'd)47(r: option 'd) =48forall x. mem (f x) c -> match r with None -> false | Some r -> mem x r end49
The x of a that satisfy p are in r; None when there is none
predicate restrict (mem: 'v -> 'd -> bool) (p: 'v -> bool) (a: 'd)53(r: option 'd) =54forall x. mem x a -> p x -> match r with None -> false | Some r -> mem x r end55
As sound2, for the arguments that satisfy ok (a division by a nonzero number)
predicate sound2_on (mem: 'v -> 'd -> bool) (ok: 'v -> 'v -> bool)59(f: 'v -> 'v -> 'v) (a b r: 'd) =60forall x y. mem x a -> mem y b -> ok x y -> mem (f x y) r61
The abstract value r is exactly the set p
predicate exact (mem: 'v -> 'd -> bool) (p: 'v -> bool) (r: 'd) =64forall x. mem x r <-> p x65
r is exactly the set p, None when p is empty
predicate exact_opt (mem: 'v -> 'd -> bool) (p: 'v -> bool) (r: option 'd) =68forall x. p x <-> match r with None -> false | Some r -> mem x r end69
The abstract value r contains the set p
predicate includes (mem: 'v -> 'd -> bool) (p: 'v -> bool) (r: 'd) =72forall x. p x -> mem x r73
r is the smallest abstract value that contains a and b
predicate join (mem: 'v -> 'd -> bool) (a b r: 'd) =76(forall x. mem x a \/ mem x b -> mem x r) /\77(forall c. (forall x. mem x a -> mem x c) -> (forall x. mem x b -> mem x c) ->78forall x. mem x r -> mem x c)79end80