Module Free_algebra.SSA

Free algebra of the SSA Domain signature (each function is a constructor) We use hash-consing to speed up comparisons and set operations.

Its command line id is FA (under Lift or LiftGVN).

module StateNode : sig ... end

The type of states: a free algebra of the domain signature

SSA_State are just hash-consed nodes

Set of states paired with bindings, as used in the join

include Sig.SSA_Domain with module SSA_State := SSA_State and module StateBindingsSet := StateBindingsSet
include Sig.Doc
val id : string

Unique identifier for the domain, eg "N", "FA",...

val name : Stdlib.Format.formatter -> unit -> unit

Full human readable name

val state_name : string

Name of the domain's states

val doc : string

Long description of the domain

Domain types

Domain operations

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

  • raises Division_by_zero
val join : StateBindingsSet.t -> SSA_State.t option

Join the given states.

  • None on empty set
  • the unique element on the singleton set (bindings are discarded)
val 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.

Queries

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

module Graph : Sig.Graph with type state = SSA_State.t

Generate the graph from psharp, we use a cast function as argument to allow Psharp to have a different type