Module Classical.Graph

Generate the graph from psharp, we use a cast function as argument to allow Psharp to have a different type. This is useful when this domain is part of a product in the analysis.

include Std_extra.Types.PRINTABLE
type t
type state = State.t

The free algebra state, it is often a part of the full domain state (eg left/right projection in a product). To account for this difference, graph operation take a cast argument, casting from the full state to the free algebra substate.

val size : t -> int

Number of nodes in the graph

val dotty_printer : Stdlib.Format.formatter -> t -> unit

Print the graph in dotty format

val make : cast:('a -> state) -> join_preds:(Ast.Program.Loc.t -> 'a Ast.Program.LocMap.t -> 'a option) -> 'a Ast.Program.LocMap.t -> t

Generate the graph

val assertions_and_dead_ends : cast:('a -> state) -> t -> 'a Ast.Program.LocMap.t -> int * int

Returns the number of assertions (nodes with a single guarded child) and dead ends (nodes with no children) in the graph