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