-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathltl.cpp
More file actions
129 lines (102 loc) · 2.69 KB
/
ltl.cpp
File metadata and controls
129 lines (102 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#include "ltl.hpp"
void FormulaAtom::show(FILE *fp, const Numbering &map) const {
fprintf(fp, "%s", map.toString(id)->c_str());
}
void FormulaNegation::show(FILE *fp, const Numbering &map) const {
fprintf(fp, "! ");
f.show(fp, map);
}
void FormulaConj::show(FILE *fp, const Numbering &map) const {
fprintf(fp, "(");
f1.show(fp, map);
fprintf(fp, " /\\ ");
f2.show(fp, map);
fprintf(fp, ")");
}
void FormulaDisj::show(FILE *fp, const Numbering &map) const {
fprintf(fp, "(");
f1.show(fp, map);
fprintf(fp, " \\/ ");
f2.show(fp, map);
fprintf(fp, ")");
}
void FormulaImply::show(FILE *fp, const Numbering &map) const {
fprintf(fp, "(");
f1.show(fp, map);
fprintf(fp, " -> ");
f2.show(fp, map);
fprintf(fp, ")");
}
void FormulaNext::show(FILE *fp, const Numbering &map) const {
fprintf(fp, "X ");
f.show(fp, map);
}
void FormulaAlways::show(FILE *fp, const Numbering &map) const {
fprintf(fp, "G ");
f.show(fp, map);
}
void FormulaEvent::show(FILE *fp, const Numbering &map) const {
fprintf(fp, "F ");
f.show(fp, map);
}
void FormulaUntil::show(FILE *fp, const Numbering &map) const {
fprintf(fp, "(");
f1.show(fp, map);
fprintf(fp, " U ");
f2.show(fp, map);
fprintf(fp, ")");
}
NNF FormulaAtom::toNNF() const {
return mkNNFAtom(id);
}
NNF FormulaAtom::pushNegation() const {
return mkNNFNegAtom(id);
}
NNF FormulaNegation::toNNF() const {
return f.pushNegation();
}
NNF FormulaNegation::pushNegation() const {
return f.toNNF();
}
NNF FormulaConj::toNNF() const {
return mkNNFConj(f1.toNNF(), f2.toNNF());
}
NNF FormulaConj::pushNegation() const {
return mkNNFDisj(f1.pushNegation(), f2.pushNegation());
}
NNF FormulaDisj::toNNF() const {
return mkNNFDisj(f1.toNNF(), f2.toNNF());
}
NNF FormulaDisj::pushNegation() const {
return mkNNFConj(f1.pushNegation(), f2.pushNegation());
}
NNF FormulaImply::toNNF() const {
return mkNNFDisj(f1.pushNegation(), f2.toNNF());
}
NNF FormulaImply::pushNegation() const {
return mkNNFConj(f1.toNNF(), f2.pushNegation());
}
NNF FormulaNext::toNNF() const {
return mkNNFNext(f.toNNF());
}
NNF FormulaNext::pushNegation() const {
return mkNNFNext(f.pushNegation());
}
NNF FormulaAlways::toNNF() const {
return mkNNFRelease(mkNNFFalse(), f.toNNF());
}
NNF FormulaAlways::pushNegation() const {
return mkNNFUntil(mkNNFTrue(), f.pushNegation());
}
NNF FormulaEvent::toNNF() const {
return mkNNFUntil(mkNNFTrue(), f.toNNF());
}
NNF FormulaEvent::pushNegation() const {
return mkNNFRelease(mkNNFFalse(), f.pushNegation());
}
NNF FormulaUntil::toNNF() const {
return mkNNFUntil(f1.toNNF(), f2.toNNF());
}
NNF FormulaUntil::pushNegation() const {
return mkNNFRelease(f1.pushNegation(), f2.pushNegation());
}