(* Debugging functions *)
(*****************************************************************************)
let show_or_not_predicate pred =
- if !Flag_engine.debug_engine then begin
+ if !Flag_matcher.debug_engine then begin
indent_do (fun () ->
adjust_pp_with_indent_and_header "labeling: pred = " (fun () ->
Pretty_print_engine.pp_predicate pred;
end
let show_or_not_nodes nodes =
- if !Flag_engine.debug_engine then begin
+ if !Flag_matcher.debug_engine then begin
indent_do (fun () ->
adjust_pp_with_indent_and_header "labeling: result = " (fun () ->
Common.pp_do_in_box (fun () ->
| Lib_engine.Match (re), _unwrapnode ->
let substs =
- Pattern3.match_re_node dropped_isos re node binding
+ Pattern_c.match_re_node dropped_isos re node binding
+> List.map (fun (re', subst) ->
Lib_engine.Match (re'), subst
)
module CFG =
struct
- type node = int
+ type node = Ograph_extended.nodei
type cfg = (F.node, F.edge) Ograph_extended.ograph_mutable
let predecessors cfg n = List.map fst ((cfg#predecessors n)#tolist)
let successors cfg n = List.map fst ((cfg#successors n)#tolist)
Control_flow_c.extract_is_loop (cfg#nodes#find n)
let print_node i = Format.print_string (i_to_s i)
let size cfg = cfg#nodes#length
+
+ (* In ctl_engine, we use 'node' for the node but in the Ograph_extended
+ * terminology, this 'node' is in fact an index to access the real
+ * node information (that ctl/ wants to abstract away to be more generic),
+ * the 'Ograph_extended.nodei'.
+ *)
+ let print_graph cfg label border_colors fill_colors filename =
+ Ograph_extended.print_ograph_mutable_generic cfg label
+ (fun (nodei, (node: F.node)) ->
+ (* the string julia wants to put ? *)
+ let bc = try Some(List.assoc nodei border_colors) with _ -> None in
+ let fc = try Some(List.assoc nodei fill_colors) with _ -> None in
+ (* the string yoann put as debug information in the cfg *)
+ let str = snd node in
+ (str,bc,fc)
+ )
+ ~output_file:filename
+ ~launch_gv:false
end
WRAPPED_ENGINE.satbis (flow, label, states) ctl (used_after, binding2)
in
if not (!Flag_parsing_cocci.sgrep_mode || !Flag.sgrep_mode2 ||
- !Flag_engine.allow_inconsistent_paths)
+ !Flag_matcher.allow_inconsistent_paths)
then Check_reachability.check_reachability triples flow;
let (trans_info2,used_after_fresh_envs) =
Postprocess_transinfo.process used_after binding2 trans_info2 in