package mopsa
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=37966e98ffeebcedc09bd6e9b2b81f69
sha512=40d4d826c25f680766c07eccbabdf5e8a4fa023016e8a164e4e4f6b3781c8484dc4df437055721dfd19b9db8fb7fe3b61236c4833186d346fc7204a68d01eaaa
doc/mopsa.mopsa_analyzer/Mopsa_analyzer/Languages/Cfg/Ast/index.html
Module Cfg.Ast
Extends the simple Universal language with Control Flow Graphs.
Graph types
module Loc : sig ... endmodule TagLoc : sig ... endmodule Range : sig ... endmodule Port : sig ... endmodule LocSet : sig ... endmodule LocMap : sig ... endmodule LocHash : sig ... endmodule TagLocSet : sig ... endmodule TagLocMap : sig ... endmodule TagLocHash : sig ... endmodule RangeSet : sig ... endmodule RangeMap : sig ... endmodule RangeHash : sig ... endmodule CFG_Param : sig ... endBuild CFG module.
module CFG : sig ... endtype graph = (unit, MopsaLib.stmt) CFG.graphEdges are labelled with a statement. Nodes have no information in the graph structure. Abstract invariant information will be kept in maps separately from the CFG. This way, CFG can be kept immutable.
type node = (unit, MopsaLib.stmt) CFG.nodetype edge = (unit, MopsaLib.stmt) CFG.edgetype node_id = TagLoc.ttype edge_id = Range.ttype port = MopsaLib.tokentype cfg = {cfg_graph : graph;mutable cfg_order : node Mopsa_utils.Containers.GraphSig.nested_list list;
}Graph utilities
val fresh_node_id : int LocHash.tFresh node with some source location information. NOTE: Do not mix mk_fresh_node_id and mk_node_id as it can break uniqueness.
val loc_anonymous : Loc.tval mk_anonymous_node_id : ?tag:string -> unit -> node_idFresh node without any source location information.
val pp_node_id : Format.formatter -> TagLoc.t -> unitval pp_node_as_id : Format.formatter -> ('a, 'b) CFG.node -> unitval mk_edge_id : ?tag:string -> MopsaLib.range -> edge_idval fresh_edge_id : int RangeHash.tval mk_fresh_edge_id : ?tag:string -> MopsaLib.range -> edge_idFresh range with possible some source range information. NOTE: Do not mix mk_fresh_edge_id and mk_edge_id as it can break uniqueness.
val mk_anonymous_edge_id : ?tag:string -> unit -> edge_idFresh range without any source range information.
val edge_range : edge_id -> MopsaLib.rangeval pp_edge_id : Format.formatter -> MopsaLib.range -> unitval pp_edge_as_id : Format.formatter -> ('a, 'b) CFG.edge -> unitval compare_edge_id : MopsaLib.range -> MopsaLib.range -> intFlows
type MopsaLib.token += Associate a flow to each CFG node. We can store abstract information for the whole graph in a single abstract state, using node flows. We also associate a flow to cache the post-image of each CFG edge.
Flow for true and false branch of tests.
Statements
type MopsaLib.stmt_kind += | S_cfg of cfg| S_test of MopsaLib.expr(*test nodes, with a true and a false branch
*)| S_skip(*empty node
*)
val mk_skip : Mopsa_utils.Core.Location.range -> MopsaLib.stmtval mk_test : MopsaLib.expr -> Mopsa_utils.Core.Location.range -> MopsaLib.stmtval mk_cfg : cfg -> Mopsa_utils.Core.Location.range -> MopsaLib.stmt