Module R.Backwards

Backward transfer functions for all expression constructs. Used to refine abstractions of a constructs arguments given a precise abstraction of its results.

For a given construct C(z1,..,zn), Backards.C z1' .. zn' ~res should verify: if contains res (C(z1,..,zn)) then for all i contains (Backards.C z1' .. zn' ~res).i zi

These return None if no new information can be deduced for this argument.

These do not perform the meet with the arguments, they only return the new information. So if Backwards.binop PlusA l r is Some l', None, the best abstraction for each argument is meet l l' and r respectively. If the meet is None, then this expression cannot possibly have the given value ~res.

Also note that functions may return Some x' even if x' isn't more precise than the argument x. Sometimes deductions can be made without even inspecting that argument. Check that not (subseteq x (meet x' x)) holds before doing recursive calls.

val unop : Ast.Expr.unop -> t -> res:t -> t option
val binop : Ast.Expr.binop -> t -> t -> res:t -> t option * t option
val ternary : t -> t -> t -> res:t -> t option * t option * t option