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