Commit | Line | Data |
---|---|---|
f537ebc4 | 1 | (* |
17ba0788 C |
2 | * Copyright 2012, INRIA |
3 | * Julia Lawall, Gilles Muller | |
4 | * Copyright 2010-2011, INRIA, University of Copenhagen | |
f537ebc4 C |
5 | * Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix |
6 | * Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen | |
d6ce1786 C |
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 | # 0 "./ast_ctl.ml" | |
28 | (* | |
29 | * Copyright 2012, INRIA | |
30 | * Julia Lawall, Gilles Muller | |
31 | * Copyright 2010-2011, INRIA, University of Copenhagen | |
32 | * Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix | |
33 | * Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen | |
f537ebc4 C |
34 | * Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix |
35 | * This file is part of Coccinelle. | |
36 | * | |
37 | * Coccinelle is free software: you can redistribute it and/or modify | |
38 | * it under the terms of the GNU General Public License as published by | |
39 | * the Free Software Foundation, according to version 2 of the License. | |
40 | * | |
41 | * Coccinelle is distributed in the hope that it will be useful, | |
42 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
43 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
44 | * GNU General Public License for more details. | |
45 | * | |
46 | * You should have received a copy of the GNU General Public License | |
47 | * along with Coccinelle. If not, see <http://www.gnu.org/licenses/>. | |
48 | * | |
49 | * The authors reserve the right to distribute this or future versions of | |
50 | * Coccinelle under other licenses. | |
51 | *) | |
52 | ||
53 | ||
feec80c3 | 54 | # 0 "./ast_ctl.ml" |
34e49164 C |
55 | |
56 | (* ---------------------------------------------------------------------- *) | |
57 | (* Types *) | |
58 | (* ---------------------------------------------------------------------- *) | |
59 | ||
60 | type strict = STRICT | NONSTRICT | |
61 | ||
62 | type keep_binding = bool (* true = put in witness tree *) | |
63 | ||
64 | (* CTL parameterised on basic predicates and metavar's*) | |
ae4735db | 65 | type ('pred,'mvar,'anno) generic_ctl = |
34e49164 C |
66 | | False |
67 | | True | |
68 | | Pred of 'pred | |
69 | | Not of (('pred,'mvar,'anno) generic_ctl) | |
70 | | Exists of keep_binding * 'mvar * (('pred,'mvar,'anno) generic_ctl) | |
ae4735db | 71 | | And of strict * (('pred,'mvar,'anno) generic_ctl) * |
34e49164 | 72 | (('pred,'mvar,'anno) generic_ctl) |
ae4735db | 73 | | AndAny of direction * strict * (('pred,'mvar,'anno) generic_ctl) * |
34e49164 | 74 | (('pred,'mvar,'anno) generic_ctl) |
ae4735db | 75 | | HackForStmt of direction * strict * (('pred,'mvar,'anno) generic_ctl) * |
34e49164 | 76 | (('pred,'mvar,'anno) generic_ctl) |
ae4735db | 77 | | Or of (('pred,'mvar,'anno) generic_ctl) * |
34e49164 | 78 | (('pred,'mvar,'anno) generic_ctl) |
ae4735db | 79 | | Implies of (('pred,'mvar,'anno) generic_ctl) * |
34e49164 C |
80 | (('pred,'mvar,'anno) generic_ctl) |
81 | | AF of direction * strict * (('pred,'mvar,'anno) generic_ctl) | |
82 | | AX of direction * strict * (('pred,'mvar,'anno) generic_ctl) | |
83 | | AG of direction * strict * (('pred,'mvar,'anno) generic_ctl) | |
84 | | AW of direction * strict * | |
85 | (* versions with exists v *) | |
86 | (('pred,'mvar,'anno) generic_ctl) * (('pred,'mvar,'anno) generic_ctl) | |
87 | | AU of direction * strict * | |
88 | (* versions with exists v *) | |
89 | (('pred,'mvar,'anno) generic_ctl) * (('pred,'mvar,'anno) generic_ctl) | |
90 | | EF of direction * (('pred,'mvar,'anno) generic_ctl) | |
91 | | EX of direction * (('pred,'mvar,'anno) generic_ctl) | |
92 | | EG of direction * (('pred,'mvar,'anno) generic_ctl) | |
ae4735db | 93 | | EU of direction * (('pred,'mvar,'anno) generic_ctl) * |
34e49164 | 94 | (('pred,'mvar,'anno) generic_ctl) |
ae4735db C |
95 | | Let of string * |
96 | (('pred,'mvar,'anno) generic_ctl) * | |
34e49164 C |
97 | (('pred,'mvar,'anno) generic_ctl) |
98 | | LetR of direction * string * (* evals phi1 wrt reachable states *) | |
ae4735db | 99 | (('pred,'mvar,'anno) generic_ctl) * |
34e49164 C |
100 | (('pred,'mvar,'anno) generic_ctl) |
101 | | Ref of string | |
ae4735db | 102 | | SeqOr of (('pred,'mvar,'anno) generic_ctl) * |
34e49164 C |
103 | (('pred,'mvar,'anno) generic_ctl) |
104 | | Uncheck of (('pred,'mvar,'anno) generic_ctl) | |
105 | | InnerAnd of (('pred,'mvar,'anno) generic_ctl) | |
106 | | XX of (('pred,'mvar,'anno) generic_ctl) (* fake, used in asttoctl *) | |
107 | ||
108 | and direction = FORWARD (* the normal way *) | BACKWARD (* toward the start *) | |
109 | ||
110 | let unwrap (ctl,_) = ctl | |
111 | let rewrap (_,model) ctl = (ctl,model) | |
112 | let get_line (_,l) = l | |
113 | ||
114 | ||
115 | (* NOTE: No explicit representation of the bottom subst., i.e., FALSE *) | |
ae4735db | 116 | type ('mvar,'value) generic_subst = |
34e49164 C |
117 | | Subst of 'mvar * 'value |
118 | | NegSubst of 'mvar * 'value | |
119 | type ('mvar,'value) generic_substitution = ('mvar,'value) generic_subst list | |
120 | ||
121 | type ('state,'subst,'anno) generic_witnesstree = | |
122 | Wit of | |
123 | 'state * 'subst * 'anno * ('state,'subst,'anno) generic_witnesstree list | |
124 | | NegWit of ('state,'subst,'anno) generic_witnesstree | |
125 | ||
126 | (* ---------------------------------------------------------------------- *) | |
127 | ||
128 | type 'a modif = Modif of 'a | UnModif of 'a | Control | |
129 | ||
130 | (* ---------------------------------------------------------------------- *) |