Numeric.SSA
Non relational numeric abstraction for SSA. Unlike Classical
, which only remembers abstractions for variables, this also remembers abstractions for sub-expressions, which is possible at a reasonable cost thanks to the static assignement properties of SSA.
Its command line id is N
(under Lift
or LiftGVN
).
include Sig.SSA_Domain with type SSA_State.t = Zs.t Ast.Program.SSAExpr.Map.t
include Sig.Doc
module SSA_State :
Std_extra.Types.TYPE with type t = Zs.t Ast.Program.SSAExpr.Map.t
module StateBindingsSet :
Std_extra.Types.SET with type elt = SSA_State.t * Ast.Program.Bindings.t
Set of states and bindings (phi variables).
val assume : Ast.Program.SSAExpr.t -> SSA_State.t -> SSA_State.t option
similar to apply
, assume e s
returns the state obtained from s
when assuming that e
is non-zero. None
means e
is always zero
val join : StateBindingsSet.t -> SSA_State.t option
Join the given states.
None
on empty setval entrypoint : Ast.Program.Var.t list -> SSA_State.t
Domain entrypoint, with a list of initial variables in scope
val is_included : Ast.Program.Loc.t -> SSA_State.t -> SSA_State.t -> bool
is_included l s1 s2
is true
is s1
included in s2
according to the domain order at l
. Used to know the fixpoint has been reached.
val join_and_widen :
Ast.Program.Loc.t ->
SSA_State.t ->
StateBindingsSet.t ->
SSA_State.t option
Performs both join and widening simultaneously. This simplifies numbering the new states.
val query_truth_value :
(SSA_State.t ->
Ast.Program.SSAExpr.t ->
Single_value_abstraction.Ternary.t)
option
Possible truth value of the given expression None
when the domain provides no useful data
val query_is_constant :
(SSA_State.t -> Ast.Program.SSAExpr.t -> Z.t option) option
query_is_constant state expr
is Some z
only if we can prove that expr
is equal to constant z
in the given state None
when the domain provides no useful data
val expr_forwards : SSA_State.t -> Ast.Program.SSAExpr.t -> Zs.t
expr_forwards state expr
returns the best abstraction for the value of expr
in the given state
.