Module Ast.Program

Abstract syntax for our programs: a control flow graph with edges annotated by relation, which are either Guard or Assign. This also contains SSA program variable and expressions, as well as get_graph, the function which translated frama-c's Cil representation to our graph representation.

Program Locations

val pgrm_start : Loc.t
val pgrm_end : Loc.t

Program Variables and expressions

val tmp_var : int -> Var.t
module VarExpr : Expr.S with type var = Var.t

SSA Variables, Expression and Bindings

val ssavar_init : Var.t -> SSAVar.t
val ssavar_join : Var.t -> int -> SSAVar.t
val ssavar_rename : SSAVar.t -> old:int -> int -> SSAVar.t
module SSAExpr : Expr.S with type var = SSAVar.t

Relations between program points

type relation =
  1. | Guard of Var.t Expr.expr
  2. | Assign of Var.t * Var.t Expr.expr
val expr_of_rel : relation -> Var.t Expr.expr

Program graph

type graph = {
  1. name : string;
  2. starting_vars : Var.t list;
  3. preds : (relation * Loc.t) list LocMap.t;
}
val graph_pp : Stdlib.Format.formatter -> graph -> unit
val co_graph : ('a * Loc.t) list LocMap.t -> ('a * Loc.t) list LocMap.t

Flip the edges of the given graph

val count_assertions : (relation * Loc.t) list LocMap.t -> int

Counts assertion in given graph. An assertion is simply a node with no a single guarded child (or two children whose guards aren't "c" and "!c")

val get_graph : unit -> graph

Get the graph from frama-c's parser

val graph_dotty_printer : Stdlib.Format.formatter -> graph -> unit

Print the graph in dotty format

Styles for dotty arrows

val guard_arrow_style : unit Std_extra.Types.pp
val assign_arrow_style : unit Std_extra.Types.pp
val relation_arrow_style : relation Std_extra.Types.pp