Coccinelle release-1.0.0-rc11
[bpt/coccinelle.git] / ctl / ctl_engine.mli
1 (*
2 * Copyright 2012, INRIA
3 * Julia Lawall, Gilles Muller
4 * Copyright 2010-2011, INRIA, University of Copenhagen
5 * Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix
6 * Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
7 * Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix
8 * This file is part of Coccinelle.
9 *
10 * Coccinelle is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, according to version 2 of the License.
13 *
14 * Coccinelle is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with Coccinelle. If not, see <http://www.gnu.org/licenses/>.
21 *
22 * The authors reserve the right to distribute this or future versions of
23 * Coccinelle under other licenses.
24 *)
25
26
27 open Ast_ctl
28
29 module type SUBST =
30 sig
31 type value
32 type mvar
33 val eq_mvar : mvar -> mvar -> bool
34 val eq_val : value -> value -> bool
35 val merge_val : value -> value -> value
36 val print_mvar : mvar -> unit
37 val print_value : value -> unit
38 end
39
40 module type GRAPH =
41 sig
42 type node
43 type cfg
44 val predecessors: cfg -> node -> node list
45 val successors: cfg -> node -> node list
46 val extract_is_loop : cfg -> node -> bool
47 val print_node : node -> unit
48 val size : cfg -> int
49 val print_graph : cfg -> string option ->
50 (node * string) list -> (node * string) list -> string -> unit
51 end
52
53 module OGRAPHEXT_GRAPH :
54 sig
55 type node = int
56 type cfg = (string, unit) Ograph_extended.ograph_mutable
57 val predecessors :
58 < predecessors : 'a -> < tolist : ('b * 'c) list; .. >; .. > ->
59 'a -> 'b list
60 val print_node : node -> unit
61 end
62
63 module type PREDICATE =
64 sig
65 type t
66 val print_predicate : t -> unit
67 end
68
69 module CTL_ENGINE :
70 functor (SUB : SUBST) ->
71 functor (G : GRAPH) ->
72 functor (P : PREDICATE) ->
73 sig
74
75 type substitution = (SUB.mvar, SUB.value) Ast_ctl.generic_subst list
76
77 type ('pred,'anno) witness =
78 (G.node, substitution,
79 ('pred, SUB.mvar, 'anno) Ast_ctl.generic_ctl list)
80 Ast_ctl.generic_witnesstree
81
82 type ('pred,'anno) triples =
83 (G.node * substitution * ('pred,'anno) witness list) list
84
85 val sat :
86 G.cfg * (P.t -> (P.t,'anno) triples) * G.node list ->
87 (P.t, SUB.mvar, 'c) Ast_ctl.generic_ctl ->
88 (P.t list list (* optional and required things *)) ->
89 (P.t,'anno) triples
90
91 val print_bench : unit -> unit
92 end
93
94 val get_graph_files : unit -> string list
95 val get_graph_comp_files : string -> string list
96