1 | #define SOUFFLE_GENERATOR_VERSION "39d42a366"
|
2 | #include "souffle/CompiledSouffle.h"
|
3 | #include "souffle/SignalHandler.h"
|
4 | #include "souffle/SouffleInterface.h"
|
5 | #include "souffle/datastructure/BTree.h"
|
6 | #include "souffle/io/IOSystem.h"
|
7 | #include <any>
|
8 | namespace functors {
|
9 | extern "C" {
|
10 | }
|
11 | } //namespace functors
|
12 | namespace souffle::t_btree_iiii__0_1_2_3__1110__1111__1100 {
|
13 | using namespace souffle;
|
14 | struct Type {
|
15 | static constexpr Relation::arity_type Arity = 4;
|
16 | using t_tuple = Tuple<RamDomain, 4>;
|
17 | struct t_comparator_0{
|
18 | int operator()(const t_tuple& a, const t_tuple& b) const {
|
19 | return (ramBitCast<RamSigned>(a[0]) < ramBitCast<RamSigned>(b[0])) ? -1 : (ramBitCast<RamSigned>(a[0]) > ramBitCast<RamSigned>(b[0])) ? 1 :((ramBitCast<RamSigned>(a[1]) < ramBitCast<RamSigned>(b[1])) ? -1 : (ramBitCast<RamSigned>(a[1]) > ramBitCast<RamSigned>(b[1])) ? 1 :((ramBitCast<RamSigned>(a[2]) < ramBitCast<RamSigned>(b[2])) ? -1 : (ramBitCast<RamSigned>(a[2]) > ramBitCast<RamSigned>(b[2])) ? 1 :((ramBitCast<RamSigned>(a[3]) < ramBitCast<RamSigned>(b[3])) ? -1 : (ramBitCast<RamSigned>(a[3]) > ramBitCast<RamSigned>(b[3])) ? 1 :(0))));
|
20 | }
|
21 | bool less(const t_tuple& a, const t_tuple& b) const {
|
22 | return (ramBitCast<RamSigned>(a[0]) < ramBitCast<RamSigned>(b[0]))|| ((ramBitCast<RamSigned>(a[0]) == ramBitCast<RamSigned>(b[0])) && ((ramBitCast<RamSigned>(a[1]) < ramBitCast<RamSigned>(b[1]))|| ((ramBitCast<RamSigned>(a[1]) == ramBitCast<RamSigned>(b[1])) && ((ramBitCast<RamSigned>(a[2]) < ramBitCast<RamSigned>(b[2]))|| ((ramBitCast<RamSigned>(a[2]) == ramBitCast<RamSigned>(b[2])) && ((ramBitCast<RamSigned>(a[3]) < ramBitCast<RamSigned>(b[3]))))))));
|
23 | }
|
24 | bool equal(const t_tuple& a, const t_tuple& b) const {
|
25 | return (ramBitCast<RamSigned>(a[0]) == ramBitCast<RamSigned>(b[0]))&&(ramBitCast<RamSigned>(a[1]) == ramBitCast<RamSigned>(b[1]))&&(ramBitCast<RamSigned>(a[2]) == ramBitCast<RamSigned>(b[2]))&&(ramBitCast<RamSigned>(a[3]) == ramBitCast<RamSigned>(b[3]));
|
26 | }
|
27 | };
|
28 | using t_ind_0 = btree_set<t_tuple,t_comparator_0>;
|
29 | t_ind_0 ind_0;
|
30 | using iterator = t_ind_0::iterator;
|
31 | struct context {
|
32 | t_ind_0::operation_hints hints_0_lower;
|
33 | t_ind_0::operation_hints hints_0_upper;
|
34 | };
|
35 | context createContext() { return context(); }
|
36 | bool insert(const t_tuple& t);
|
37 | bool insert(const t_tuple& t, context& h);
|
38 | bool insert(const RamDomain* ramDomain);
|
39 | bool insert(RamDomain a0,RamDomain a1,RamDomain a2,RamDomain a3);
|
40 | bool contains(const t_tuple& t, context& h) const;
|
41 | bool contains(const t_tuple& t) const;
|
42 | std::size_t size() const;
|
43 | iterator find(const t_tuple& t, context& h) const;
|
44 | iterator find(const t_tuple& t) const;
|
45 | range<iterator> lowerUpperRange_0000(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const;
|
46 | range<iterator> lowerUpperRange_0000(const t_tuple& /* lower */, const t_tuple& /* upper */) const;
|
47 | range<t_ind_0::iterator> lowerUpperRange_1110(const t_tuple& lower, const t_tuple& upper, context& h) const;
|
48 | range<t_ind_0::iterator> lowerUpperRange_1110(const t_tuple& lower, const t_tuple& upper) const;
|
49 | range<t_ind_0::iterator> lowerUpperRange_1111(const t_tuple& lower, const t_tuple& upper, context& h) const;
|
50 | range<t_ind_0::iterator> lowerUpperRange_1111(const t_tuple& lower, const t_tuple& upper) const;
|
51 | range<t_ind_0::iterator> lowerUpperRange_1100(const t_tuple& lower, const t_tuple& upper, context& h) const;
|
52 | range<t_ind_0::iterator> lowerUpperRange_1100(const t_tuple& lower, const t_tuple& upper) const;
|
53 | bool empty() const;
|
54 | std::vector<range<iterator>> partition() const;
|
55 | void purge();
|
56 | iterator begin() const;
|
57 | iterator end() const;
|
58 | void printStatistics(std::ostream& o) const;
|
59 | };
|
60 | } // namespace souffle::t_btree_iiii__0_1_2_3__1110__1111__1100
|
61 | namespace souffle::t_btree_iiii__0_1_2_3__1110__1111__1100 {
|
62 | using namespace souffle;
|
63 | using t_ind_0 = Type::t_ind_0;
|
64 | using iterator = Type::iterator;
|
65 | using context = Type::context;
|
66 | bool Type::insert(const t_tuple& t) {
|
67 | context h;
|
68 | return insert(t, h);
|
69 | }
|
70 | bool Type::insert(const t_tuple& t, context& h) {
|
71 | if (ind_0.insert(t, h.hints_0_lower)) {
|
72 | return true;
|
73 | } else return false;
|
74 | }
|
75 | bool Type::insert(const RamDomain* ramDomain) {
|
76 | RamDomain data[4];
|
77 | std::copy(ramDomain, ramDomain + 4, data);
|
78 | const t_tuple& tuple = reinterpret_cast<const t_tuple&>(data);
|
79 | context h;
|
80 | return insert(tuple, h);
|
81 | }
|
82 | bool Type::insert(RamDomain a0,RamDomain a1,RamDomain a2,RamDomain a3) {
|
83 | RamDomain data[4] = {a0,a1,a2,a3};
|
84 | return insert(data);
|
85 | }
|
86 | bool Type::contains(const t_tuple& t, context& h) const {
|
87 | return ind_0.contains(t, h.hints_0_lower);
|
88 | }
|
89 | bool Type::contains(const t_tuple& t) const {
|
90 | context h;
|
91 | return contains(t, h);
|
92 | }
|
93 | std::size_t Type::size() const {
|
94 | return ind_0.size();
|
95 | }
|
96 | iterator Type::find(const t_tuple& t, context& h) const {
|
97 | return ind_0.find(t, h.hints_0_lower);
|
98 | }
|
99 | iterator Type::find(const t_tuple& t) const {
|
100 | context h;
|
101 | return find(t, h);
|
102 | }
|
103 | range<iterator> Type::lowerUpperRange_0000(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const {
|
104 | return range<iterator>(ind_0.begin(),ind_0.end());
|
105 | }
|
106 | range<iterator> Type::lowerUpperRange_0000(const t_tuple& /* lower */, const t_tuple& /* upper */) const {
|
107 | return range<iterator>(ind_0.begin(),ind_0.end());
|
108 | }
|
109 | range<t_ind_0::iterator> Type::lowerUpperRange_1110(const t_tuple& lower, const t_tuple& upper, context& h) const {
|
110 | t_comparator_0 comparator;
|
111 | int cmp = comparator(lower, upper);
|
112 | if (cmp > 0) {
|
113 | return make_range(ind_0.end(), ind_0.end());
|
114 | }
|
115 | return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper));
|
116 | }
|
117 | range<t_ind_0::iterator> Type::lowerUpperRange_1110(const t_tuple& lower, const t_tuple& upper) const {
|
118 | context h;
|
119 | return lowerUpperRange_1110(lower,upper,h);
|
120 | }
|
121 | range<t_ind_0::iterator> Type::lowerUpperRange_1111(const t_tuple& lower, const t_tuple& upper, context& h) const {
|
122 | t_comparator_0 comparator;
|
123 | int cmp = comparator(lower, upper);
|
124 | if (cmp == 0) {
|
125 | auto pos = ind_0.find(lower, h.hints_0_lower);
|
126 | auto fin = ind_0.end();
|
127 | if (pos != fin) {fin = pos; ++fin;}
|
128 | return make_range(pos, fin);
|
129 | }
|
130 | if (cmp > 0) {
|
131 | return make_range(ind_0.end(), ind_0.end());
|
132 | }
|
133 | return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper));
|
134 | }
|
135 | range<t_ind_0::iterator> Type::lowerUpperRange_1111(const t_tuple& lower, const t_tuple& upper) const {
|
136 | context h;
|
137 | return lowerUpperRange_1111(lower,upper,h);
|
138 | }
|
139 | range<t_ind_0::iterator> Type::lowerUpperRange_1100(const t_tuple& lower, const t_tuple& upper, context& h) const {
|
140 | t_comparator_0 comparator;
|
141 | int cmp = comparator(lower, upper);
|
142 | if (cmp > 0) {
|
143 | return make_range(ind_0.end(), ind_0.end());
|
144 | }
|
145 | return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper));
|
146 | }
|
147 | range<t_ind_0::iterator> Type::lowerUpperRange_1100(const t_tuple& lower, const t_tuple& upper) const {
|
148 | context h;
|
149 | return lowerUpperRange_1100(lower,upper,h);
|
150 | }
|
151 | bool Type::empty() const {
|
152 | return ind_0.empty();
|
153 | }
|
154 | std::vector<range<iterator>> Type::partition() const {
|
155 | return ind_0.getChunks(400);
|
156 | }
|
157 | void Type::purge() {
|
158 | ind_0.clear();
|
159 | }
|
160 | iterator Type::begin() const {
|
161 | return ind_0.begin();
|
162 | }
|
163 | iterator Type::end() const {
|
164 | return ind_0.end();
|
165 | }
|
166 | void Type::printStatistics(std::ostream& o) const {
|
167 | o << " arity 4 direct b-tree index 0 lex-order [0,1,2,3]\n";
|
168 | ind_0.printStats(o);
|
169 | }
|
170 | } // namespace souffle::t_btree_iiii__0_1_2_3__1110__1111__1100
|
171 | namespace souffle::t_btree_iiiii__0_1_2_3_4__11100__11111 {
|
172 | using namespace souffle;
|
173 | struct Type {
|
174 | static constexpr Relation::arity_type Arity = 5;
|
175 | using t_tuple = Tuple<RamDomain, 5>;
|
176 | struct t_comparator_0{
|
177 | int operator()(const t_tuple& a, const t_tuple& b) const {
|
178 | return (ramBitCast<RamSigned>(a[0]) < ramBitCast<RamSigned>(b[0])) ? -1 : (ramBitCast<RamSigned>(a[0]) > ramBitCast<RamSigned>(b[0])) ? 1 :((ramBitCast<RamSigned>(a[1]) < ramBitCast<RamSigned>(b[1])) ? -1 : (ramBitCast<RamSigned>(a[1]) > ramBitCast<RamSigned>(b[1])) ? 1 :((ramBitCast<RamSigned>(a[2]) < ramBitCast<RamSigned>(b[2])) ? -1 : (ramBitCast<RamSigned>(a[2]) > ramBitCast<RamSigned>(b[2])) ? 1 :((ramBitCast<RamSigned>(a[3]) < ramBitCast<RamSigned>(b[3])) ? -1 : (ramBitCast<RamSigned>(a[3]) > ramBitCast<RamSigned>(b[3])) ? 1 :((ramBitCast<RamSigned>(a[4]) < ramBitCast<RamSigned>(b[4])) ? -1 : (ramBitCast<RamSigned>(a[4]) > ramBitCast<RamSigned>(b[4])) ? 1 :(0)))));
|
179 | }
|
180 | bool less(const t_tuple& a, const t_tuple& b) const {
|
181 | return (ramBitCast<RamSigned>(a[0]) < ramBitCast<RamSigned>(b[0]))|| ((ramBitCast<RamSigned>(a[0]) == ramBitCast<RamSigned>(b[0])) && ((ramBitCast<RamSigned>(a[1]) < ramBitCast<RamSigned>(b[1]))|| ((ramBitCast<RamSigned>(a[1]) == ramBitCast<RamSigned>(b[1])) && ((ramBitCast<RamSigned>(a[2]) < ramBitCast<RamSigned>(b[2]))|| ((ramBitCast<RamSigned>(a[2]) == ramBitCast<RamSigned>(b[2])) && ((ramBitCast<RamSigned>(a[3]) < ramBitCast<RamSigned>(b[3]))|| ((ramBitCast<RamSigned>(a[3]) == ramBitCast<RamSigned>(b[3])) && ((ramBitCast<RamSigned>(a[4]) < ramBitCast<RamSigned>(b[4]))))))))));
|
182 | }
|
183 | bool equal(const t_tuple& a, const t_tuple& b) const {
|
184 | return (ramBitCast<RamSigned>(a[0]) == ramBitCast<RamSigned>(b[0]))&&(ramBitCast<RamSigned>(a[1]) == ramBitCast<RamSigned>(b[1]))&&(ramBitCast<RamSigned>(a[2]) == ramBitCast<RamSigned>(b[2]))&&(ramBitCast<RamSigned>(a[3]) == ramBitCast<RamSigned>(b[3]))&&(ramBitCast<RamSigned>(a[4]) == ramBitCast<RamSigned>(b[4]));
|
185 | }
|
186 | };
|
187 | using t_ind_0 = btree_set<t_tuple,t_comparator_0>;
|
188 | t_ind_0 ind_0;
|
189 | using iterator = t_ind_0::iterator;
|
190 | struct context {
|
191 | t_ind_0::operation_hints hints_0_lower;
|
192 | t_ind_0::operation_hints hints_0_upper;
|
193 | };
|
194 | context createContext() { return context(); }
|
195 | bool insert(const t_tuple& t);
|
196 | bool insert(const t_tuple& t, context& h);
|
197 | bool insert(const RamDomain* ramDomain);
|
198 | bool insert(RamDomain a0,RamDomain a1,RamDomain a2,RamDomain a3,RamDomain a4);
|
199 | bool contains(const t_tuple& t, context& h) const;
|
200 | bool contains(const t_tuple& t) const;
|
201 | std::size_t size() const;
|
202 | iterator find(const t_tuple& t, context& h) const;
|
203 | iterator find(const t_tuple& t) const;
|
204 | range<iterator> lowerUpperRange_00000(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const;
|
205 | range<iterator> lowerUpperRange_00000(const t_tuple& /* lower */, const t_tuple& /* upper */) const;
|
206 | range<t_ind_0::iterator> lowerUpperRange_11100(const t_tuple& lower, const t_tuple& upper, context& h) const;
|
207 | range<t_ind_0::iterator> lowerUpperRange_11100(const t_tuple& lower, const t_tuple& upper) const;
|
208 | range<t_ind_0::iterator> lowerUpperRange_11111(const t_tuple& lower, const t_tuple& upper, context& h) const;
|
209 | range<t_ind_0::iterator> lowerUpperRange_11111(const t_tuple& lower, const t_tuple& upper) const;
|
210 | bool empty() const;
|
211 | std::vector<range<iterator>> partition() const;
|
212 | void purge();
|
213 | iterator begin() const;
|
214 | iterator end() const;
|
215 | void printStatistics(std::ostream& o) const;
|
216 | };
|
217 | } // namespace souffle::t_btree_iiiii__0_1_2_3_4__11100__11111
|
218 | namespace souffle::t_btree_iiiii__0_1_2_3_4__11100__11111 {
|
219 | using namespace souffle;
|
220 | using t_ind_0 = Type::t_ind_0;
|
221 | using iterator = Type::iterator;
|
222 | using context = Type::context;
|
223 | bool Type::insert(const t_tuple& t) {
|
224 | context h;
|
225 | return insert(t, h);
|
226 | }
|
227 | bool Type::insert(const t_tuple& t, context& h) {
|
228 | if (ind_0.insert(t, h.hints_0_lower)) {
|
229 | return true;
|
230 | } else return false;
|
231 | }
|
232 | bool Type::insert(const RamDomain* ramDomain) {
|
233 | RamDomain data[5];
|
234 | std::copy(ramDomain, ramDomain + 5, data);
|
235 | const t_tuple& tuple = reinterpret_cast<const t_tuple&>(data);
|
236 | context h;
|
237 | return insert(tuple, h);
|
238 | }
|
239 | bool Type::insert(RamDomain a0,RamDomain a1,RamDomain a2,RamDomain a3,RamDomain a4) {
|
240 | RamDomain data[5] = {a0,a1,a2,a3,a4};
|
241 | return insert(data);
|
242 | }
|
243 | bool Type::contains(const t_tuple& t, context& h) const {
|
244 | return ind_0.contains(t, h.hints_0_lower);
|
245 | }
|
246 | bool Type::contains(const t_tuple& t) const {
|
247 | context h;
|
248 | return contains(t, h);
|
249 | }
|
250 | std::size_t Type::size() const {
|
251 | return ind_0.size();
|
252 | }
|
253 | iterator Type::find(const t_tuple& t, context& h) const {
|
254 | return ind_0.find(t, h.hints_0_lower);
|
255 | }
|
256 | iterator Type::find(const t_tuple& t) const {
|
257 | context h;
|
258 | return find(t, h);
|
259 | }
|
260 | range<iterator> Type::lowerUpperRange_00000(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const {
|
261 | return range<iterator>(ind_0.begin(),ind_0.end());
|
262 | }
|
263 | range<iterator> Type::lowerUpperRange_00000(const t_tuple& /* lower */, const t_tuple& /* upper */) const {
|
264 | return range<iterator>(ind_0.begin(),ind_0.end());
|
265 | }
|
266 | range<t_ind_0::iterator> Type::lowerUpperRange_11100(const t_tuple& lower, const t_tuple& upper, context& h) const {
|
267 | t_comparator_0 comparator;
|
268 | int cmp = comparator(lower, upper);
|
269 | if (cmp > 0) {
|
270 | return make_range(ind_0.end(), ind_0.end());
|
271 | }
|
272 | return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper));
|
273 | }
|
274 | range<t_ind_0::iterator> Type::lowerUpperRange_11100(const t_tuple& lower, const t_tuple& upper) const {
|
275 | context h;
|
276 | return lowerUpperRange_11100(lower,upper,h);
|
277 | }
|
278 | range<t_ind_0::iterator> Type::lowerUpperRange_11111(const t_tuple& lower, const t_tuple& upper, context& h) const {
|
279 | t_comparator_0 comparator;
|
280 | int cmp = comparator(lower, upper);
|
281 | if (cmp == 0) {
|
282 | auto pos = ind_0.find(lower, h.hints_0_lower);
|
283 | auto fin = ind_0.end();
|
284 | if (pos != fin) {fin = pos; ++fin;}
|
285 | return make_range(pos, fin);
|
286 | }
|
287 | if (cmp > 0) {
|
288 | return make_range(ind_0.end(), ind_0.end());
|
289 | }
|
290 | return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper));
|
291 | }
|
292 | range<t_ind_0::iterator> Type::lowerUpperRange_11111(const t_tuple& lower, const t_tuple& upper) const {
|
293 | context h;
|
294 | return lowerUpperRange_11111(lower,upper,h);
|
295 | }
|
296 | bool Type::empty() const {
|
297 | return ind_0.empty();
|
298 | }
|
299 | std::vector<range<iterator>> Type::partition() const {
|
300 | return ind_0.getChunks(400);
|
301 | }
|
302 | void Type::purge() {
|
303 | ind_0.clear();
|
304 | }
|
305 | iterator Type::begin() const {
|
306 | return ind_0.begin();
|
307 | }
|
308 | iterator Type::end() const {
|
309 | return ind_0.end();
|
310 | }
|
311 | void Type::printStatistics(std::ostream& o) const {
|
312 | o << " arity 5 direct b-tree index 0 lex-order [0,1,2,3,4]\n";
|
313 | ind_0.printStats(o);
|
314 | }
|
315 | } // namespace souffle::t_btree_iiiii__0_1_2_3_4__11100__11111
|
316 | namespace souffle::t_btree_iii__2_0_1__001__111 {
|
317 | using namespace souffle;
|
318 | struct Type {
|
319 | static constexpr Relation::arity_type Arity = 3;
|
320 | using t_tuple = Tuple<RamDomain, 3>;
|
321 | struct t_comparator_0{
|
322 | int operator()(const t_tuple& a, const t_tuple& b) const {
|
323 | return (ramBitCast<RamSigned>(a[2]) < ramBitCast<RamSigned>(b[2])) ? -1 : (ramBitCast<RamSigned>(a[2]) > ramBitCast<RamSigned>(b[2])) ? 1 :((ramBitCast<RamSigned>(a[0]) < ramBitCast<RamSigned>(b[0])) ? -1 : (ramBitCast<RamSigned>(a[0]) > ramBitCast<RamSigned>(b[0])) ? 1 :((ramBitCast<RamSigned>(a[1]) < ramBitCast<RamSigned>(b[1])) ? -1 : (ramBitCast<RamSigned>(a[1]) > ramBitCast<RamSigned>(b[1])) ? 1 :(0)));
|
324 | }
|
325 | bool less(const t_tuple& a, const t_tuple& b) const {
|
326 | return (ramBitCast<RamSigned>(a[2]) < ramBitCast<RamSigned>(b[2]))|| ((ramBitCast<RamSigned>(a[2]) == ramBitCast<RamSigned>(b[2])) && ((ramBitCast<RamSigned>(a[0]) < ramBitCast<RamSigned>(b[0]))|| ((ramBitCast<RamSigned>(a[0]) == ramBitCast<RamSigned>(b[0])) && ((ramBitCast<RamSigned>(a[1]) < ramBitCast<RamSigned>(b[1]))))));
|
327 | }
|
328 | bool equal(const t_tuple& a, const t_tuple& b) const {
|
329 | return (ramBitCast<RamSigned>(a[2]) == ramBitCast<RamSigned>(b[2]))&&(ramBitCast<RamSigned>(a[0]) == ramBitCast<RamSigned>(b[0]))&&(ramBitCast<RamSigned>(a[1]) == ramBitCast<RamSigned>(b[1]));
|
330 | }
|
331 | };
|
332 | using t_ind_0 = btree_set<t_tuple,t_comparator_0>;
|
333 | t_ind_0 ind_0;
|
334 | using iterator = t_ind_0::iterator;
|
335 | struct context {
|
336 | t_ind_0::operation_hints hints_0_lower;
|
337 | t_ind_0::operation_hints hints_0_upper;
|
338 | };
|
339 | context createContext() { return context(); }
|
340 | bool insert(const t_tuple& t);
|
341 | bool insert(const t_tuple& t, context& h);
|
342 | bool insert(const RamDomain* ramDomain);
|
343 | bool insert(RamDomain a0,RamDomain a1,RamDomain a2);
|
344 | bool contains(const t_tuple& t, context& h) const;
|
345 | bool contains(const t_tuple& t) const;
|
346 | std::size_t size() const;
|
347 | iterator find(const t_tuple& t, context& h) const;
|
348 | iterator find(const t_tuple& t) const;
|
349 | range<iterator> lowerUpperRange_000(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const;
|
350 | range<iterator> lowerUpperRange_000(const t_tuple& /* lower */, const t_tuple& /* upper */) const;
|
351 | range<t_ind_0::iterator> lowerUpperRange_001(const t_tuple& lower, const t_tuple& upper, context& h) const;
|
352 | range<t_ind_0::iterator> lowerUpperRange_001(const t_tuple& lower, const t_tuple& upper) const;
|
353 | range<t_ind_0::iterator> lowerUpperRange_111(const t_tuple& lower, const t_tuple& upper, context& h) const;
|
354 | range<t_ind_0::iterator> lowerUpperRange_111(const t_tuple& lower, const t_tuple& upper) const;
|
355 | bool empty() const;
|
356 | std::vector<range<iterator>> partition() const;
|
357 | void purge();
|
358 | iterator begin() const;
|
359 | iterator end() const;
|
360 | void printStatistics(std::ostream& o) const;
|
361 | };
|
362 | } // namespace souffle::t_btree_iii__2_0_1__001__111
|
363 | namespace souffle::t_btree_iii__2_0_1__001__111 {
|
364 | using namespace souffle;
|
365 | using t_ind_0 = Type::t_ind_0;
|
366 | using iterator = Type::iterator;
|
367 | using context = Type::context;
|
368 | bool Type::insert(const t_tuple& t) {
|
369 | context h;
|
370 | return insert(t, h);
|
371 | }
|
372 | bool Type::insert(const t_tuple& t, context& h) {
|
373 | if (ind_0.insert(t, h.hints_0_lower)) {
|
374 | return true;
|
375 | } else return false;
|
376 | }
|
377 | bool Type::insert(const RamDomain* ramDomain) {
|
378 | RamDomain data[3];
|
379 | std::copy(ramDomain, ramDomain + 3, data);
|
380 | const t_tuple& tuple = reinterpret_cast<const t_tuple&>(data);
|
381 | context h;
|
382 | return insert(tuple, h);
|
383 | }
|
384 | bool Type::insert(RamDomain a0,RamDomain a1,RamDomain a2) {
|
385 | RamDomain data[3] = {a0,a1,a2};
|
386 | return insert(data);
|
387 | }
|
388 | bool Type::contains(const t_tuple& t, context& h) const {
|
389 | return ind_0.contains(t, h.hints_0_lower);
|
390 | }
|
391 | bool Type::contains(const t_tuple& t) const {
|
392 | context h;
|
393 | return contains(t, h);
|
394 | }
|
395 | std::size_t Type::size() const {
|
396 | return ind_0.size();
|
397 | }
|
398 | iterator Type::find(const t_tuple& t, context& h) const {
|
399 | return ind_0.find(t, h.hints_0_lower);
|
400 | }
|
401 | iterator Type::find(const t_tuple& t) const {
|
402 | context h;
|
403 | return find(t, h);
|
404 | }
|
405 | range<iterator> Type::lowerUpperRange_000(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const {
|
406 | return range<iterator>(ind_0.begin(),ind_0.end());
|
407 | }
|
408 | range<iterator> Type::lowerUpperRange_000(const t_tuple& /* lower */, const t_tuple& /* upper */) const {
|
409 | return range<iterator>(ind_0.begin(),ind_0.end());
|
410 | }
|
411 | range<t_ind_0::iterator> Type::lowerUpperRange_001(const t_tuple& lower, const t_tuple& upper, context& h) const {
|
412 | t_comparator_0 comparator;
|
413 | int cmp = comparator(lower, upper);
|
414 | if (cmp > 0) {
|
415 | return make_range(ind_0.end(), ind_0.end());
|
416 | }
|
417 | return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper));
|
418 | }
|
419 | range<t_ind_0::iterator> Type::lowerUpperRange_001(const t_tuple& lower, const t_tuple& upper) const {
|
420 | context h;
|
421 | return lowerUpperRange_001(lower,upper,h);
|
422 | }
|
423 | range<t_ind_0::iterator> Type::lowerUpperRange_111(const t_tuple& lower, const t_tuple& upper, context& h) const {
|
424 | t_comparator_0 comparator;
|
425 | int cmp = comparator(lower, upper);
|
426 | if (cmp == 0) {
|
427 | auto pos = ind_0.find(lower, h.hints_0_lower);
|
428 | auto fin = ind_0.end();
|
429 | if (pos != fin) {fin = pos; ++fin;}
|
430 | return make_range(pos, fin);
|
431 | }
|
432 | if (cmp > 0) {
|
433 | return make_range(ind_0.end(), ind_0.end());
|
434 | }
|
435 | return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper));
|
436 | }
|
437 | range<t_ind_0::iterator> Type::lowerUpperRange_111(const t_tuple& lower, const t_tuple& upper) const {
|
438 | context h;
|
439 | return lowerUpperRange_111(lower,upper,h);
|
440 | }
|
441 | bool Type::empty() const {
|
442 | return ind_0.empty();
|
443 | }
|
444 | std::vector<range<iterator>> Type::partition() const {
|
445 | return ind_0.getChunks(400);
|
446 | }
|
447 | void Type::purge() {
|
448 | ind_0.clear();
|
449 | }
|
450 | iterator Type::begin() const {
|
451 | return ind_0.begin();
|
452 | }
|
453 | iterator Type::end() const {
|
454 | return ind_0.end();
|
455 | }
|
456 | void Type::printStatistics(std::ostream& o) const {
|
457 | o << " arity 3 direct b-tree index 0 lex-order [2,0,1]\n";
|
458 | ind_0.printStats(o);
|
459 | }
|
460 | } // namespace souffle::t_btree_iii__2_0_1__001__111
|
461 | namespace souffle::t_btree_ii__0_1__11 {
|
462 | using namespace souffle;
|
463 | struct Type {
|
464 | static constexpr Relation::arity_type Arity = 2;
|
465 | using t_tuple = Tuple<RamDomain, 2>;
|
466 | struct t_comparator_0{
|
467 | int operator()(const t_tuple& a, const t_tuple& b) const {
|
468 | return (ramBitCast<RamSigned>(a[0]) < ramBitCast<RamSigned>(b[0])) ? -1 : (ramBitCast<RamSigned>(a[0]) > ramBitCast<RamSigned>(b[0])) ? 1 :((ramBitCast<RamSigned>(a[1]) < ramBitCast<RamSigned>(b[1])) ? -1 : (ramBitCast<RamSigned>(a[1]) > ramBitCast<RamSigned>(b[1])) ? 1 :(0));
|
469 | }
|
470 | bool less(const t_tuple& a, const t_tuple& b) const {
|
471 | return (ramBitCast<RamSigned>(a[0]) < ramBitCast<RamSigned>(b[0]))|| ((ramBitCast<RamSigned>(a[0]) == ramBitCast<RamSigned>(b[0])) && ((ramBitCast<RamSigned>(a[1]) < ramBitCast<RamSigned>(b[1]))));
|
472 | }
|
473 | bool equal(const t_tuple& a, const t_tuple& b) const {
|
474 | return (ramBitCast<RamSigned>(a[0]) == ramBitCast<RamSigned>(b[0]))&&(ramBitCast<RamSigned>(a[1]) == ramBitCast<RamSigned>(b[1]));
|
475 | }
|
476 | };
|
477 | using t_ind_0 = btree_set<t_tuple,t_comparator_0>;
|
478 | t_ind_0 ind_0;
|
479 | using iterator = t_ind_0::iterator;
|
480 | struct context {
|
481 | t_ind_0::operation_hints hints_0_lower;
|
482 | t_ind_0::operation_hints hints_0_upper;
|
483 | };
|
484 | context createContext() { return context(); }
|
485 | bool insert(const t_tuple& t);
|
486 | bool insert(const t_tuple& t, context& h);
|
487 | bool insert(const RamDomain* ramDomain);
|
488 | bool insert(RamDomain a0,RamDomain a1);
|
489 | bool contains(const t_tuple& t, context& h) const;
|
490 | bool contains(const t_tuple& t) const;
|
491 | std::size_t size() const;
|
492 | iterator find(const t_tuple& t, context& h) const;
|
493 | iterator find(const t_tuple& t) const;
|
494 | range<iterator> lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const;
|
495 | range<iterator> lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */) const;
|
496 | range<t_ind_0::iterator> lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper, context& h) const;
|
497 | range<t_ind_0::iterator> lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper) const;
|
498 | bool empty() const;
|
499 | std::vector<range<iterator>> partition() const;
|
500 | void purge();
|
501 | iterator begin() const;
|
502 | iterator end() const;
|
503 | void printStatistics(std::ostream& o) const;
|
504 | };
|
505 | } // namespace souffle::t_btree_ii__0_1__11
|
506 | namespace souffle::t_btree_ii__0_1__11 {
|
507 | using namespace souffle;
|
508 | using t_ind_0 = Type::t_ind_0;
|
509 | using iterator = Type::iterator;
|
510 | using context = Type::context;
|
511 | bool Type::insert(const t_tuple& t) {
|
512 | context h;
|
513 | return insert(t, h);
|
514 | }
|
515 | bool Type::insert(const t_tuple& t, context& h) {
|
516 | if (ind_0.insert(t, h.hints_0_lower)) {
|
517 | return true;
|
518 | } else return false;
|
519 | }
|
520 | bool Type::insert(const RamDomain* ramDomain) {
|
521 | RamDomain data[2];
|
522 | std::copy(ramDomain, ramDomain + 2, data);
|
523 | const t_tuple& tuple = reinterpret_cast<const t_tuple&>(data);
|
524 | context h;
|
525 | return insert(tuple, h);
|
526 | }
|
527 | bool Type::insert(RamDomain a0,RamDomain a1) {
|
528 | RamDomain data[2] = {a0,a1};
|
529 | return insert(data);
|
530 | }
|
531 | bool Type::contains(const t_tuple& t, context& h) const {
|
532 | return ind_0.contains(t, h.hints_0_lower);
|
533 | }
|
534 | bool Type::contains(const t_tuple& t) const {
|
535 | context h;
|
536 | return contains(t, h);
|
537 | }
|
538 | std::size_t Type::size() const {
|
539 | return ind_0.size();
|
540 | }
|
541 | iterator Type::find(const t_tuple& t, context& h) const {
|
542 | return ind_0.find(t, h.hints_0_lower);
|
543 | }
|
544 | iterator Type::find(const t_tuple& t) const {
|
545 | context h;
|
546 | return find(t, h);
|
547 | }
|
548 | range<iterator> Type::lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const {
|
549 | return range<iterator>(ind_0.begin(),ind_0.end());
|
550 | }
|
551 | range<iterator> Type::lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */) const {
|
552 | return range<iterator>(ind_0.begin(),ind_0.end());
|
553 | }
|
554 | range<t_ind_0::iterator> Type::lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper, context& h) const {
|
555 | t_comparator_0 comparator;
|
556 | int cmp = comparator(lower, upper);
|
557 | if (cmp == 0) {
|
558 | auto pos = ind_0.find(lower, h.hints_0_lower);
|
559 | auto fin = ind_0.end();
|
560 | if (pos != fin) {fin = pos; ++fin;}
|
561 | return make_range(pos, fin);
|
562 | }
|
563 | if (cmp > 0) {
|
564 | return make_range(ind_0.end(), ind_0.end());
|
565 | }
|
566 | return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper));
|
567 | }
|
568 | range<t_ind_0::iterator> Type::lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper) const {
|
569 | context h;
|
570 | return lowerUpperRange_11(lower,upper,h);
|
571 | }
|
572 | bool Type::empty() const {
|
573 | return ind_0.empty();
|
574 | }
|
575 | std::vector<range<iterator>> Type::partition() const {
|
576 | return ind_0.getChunks(400);
|
577 | }
|
578 | void Type::purge() {
|
579 | ind_0.clear();
|
580 | }
|
581 | iterator Type::begin() const {
|
582 | return ind_0.begin();
|
583 | }
|
584 | iterator Type::end() const {
|
585 | return ind_0.end();
|
586 | }
|
587 | void Type::printStatistics(std::ostream& o) const {
|
588 | o << " arity 2 direct b-tree index 0 lex-order [0,1]\n";
|
589 | ind_0.printStats(o);
|
590 | }
|
591 | } // namespace souffle::t_btree_ii__0_1__11
|
592 | namespace souffle::t_btree_ii__0_1__11__10 {
|
593 | using namespace souffle;
|
594 | struct Type {
|
595 | static constexpr Relation::arity_type Arity = 2;
|
596 | using t_tuple = Tuple<RamDomain, 2>;
|
597 | struct t_comparator_0{
|
598 | int operator()(const t_tuple& a, const t_tuple& b) const {
|
599 | return (ramBitCast<RamSigned>(a[0]) < ramBitCast<RamSigned>(b[0])) ? -1 : (ramBitCast<RamSigned>(a[0]) > ramBitCast<RamSigned>(b[0])) ? 1 :((ramBitCast<RamSigned>(a[1]) < ramBitCast<RamSigned>(b[1])) ? -1 : (ramBitCast<RamSigned>(a[1]) > ramBitCast<RamSigned>(b[1])) ? 1 :(0));
|
600 | }
|
601 | bool less(const t_tuple& a, const t_tuple& b) const {
|
602 | return (ramBitCast<RamSigned>(a[0]) < ramBitCast<RamSigned>(b[0]))|| ((ramBitCast<RamSigned>(a[0]) == ramBitCast<RamSigned>(b[0])) && ((ramBitCast<RamSigned>(a[1]) < ramBitCast<RamSigned>(b[1]))));
|
603 | }
|
604 | bool equal(const t_tuple& a, const t_tuple& b) const {
|
605 | return (ramBitCast<RamSigned>(a[0]) == ramBitCast<RamSigned>(b[0]))&&(ramBitCast<RamSigned>(a[1]) == ramBitCast<RamSigned>(b[1]));
|
606 | }
|
607 | };
|
608 | using t_ind_0 = btree_set<t_tuple,t_comparator_0>;
|
609 | t_ind_0 ind_0;
|
610 | using iterator = t_ind_0::iterator;
|
611 | struct context {
|
612 | t_ind_0::operation_hints hints_0_lower;
|
613 | t_ind_0::operation_hints hints_0_upper;
|
614 | };
|
615 | context createContext() { return context(); }
|
616 | bool insert(const t_tuple& t);
|
617 | bool insert(const t_tuple& t, context& h);
|
618 | bool insert(const RamDomain* ramDomain);
|
619 | bool insert(RamDomain a0,RamDomain a1);
|
620 | bool contains(const t_tuple& t, context& h) const;
|
621 | bool contains(const t_tuple& t) const;
|
622 | std::size_t size() const;
|
623 | iterator find(const t_tuple& t, context& h) const;
|
624 | iterator find(const t_tuple& t) const;
|
625 | range<iterator> lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const;
|
626 | range<iterator> lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */) const;
|
627 | range<t_ind_0::iterator> lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper, context& h) const;
|
628 | range<t_ind_0::iterator> lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper) const;
|
629 | range<t_ind_0::iterator> lowerUpperRange_10(const t_tuple& lower, const t_tuple& upper, context& h) const;
|
630 | range<t_ind_0::iterator> lowerUpperRange_10(const t_tuple& lower, const t_tuple& upper) const;
|
631 | bool empty() const;
|
632 | std::vector<range<iterator>> partition() const;
|
633 | void purge();
|
634 | iterator begin() const;
|
635 | iterator end() const;
|
636 | void printStatistics(std::ostream& o) const;
|
637 | };
|
638 | } // namespace souffle::t_btree_ii__0_1__11__10
|
639 | namespace souffle::t_btree_ii__0_1__11__10 {
|
640 | using namespace souffle;
|
641 | using t_ind_0 = Type::t_ind_0;
|
642 | using iterator = Type::iterator;
|
643 | using context = Type::context;
|
644 | bool Type::insert(const t_tuple& t) {
|
645 | context h;
|
646 | return insert(t, h);
|
647 | }
|
648 | bool Type::insert(const t_tuple& t, context& h) {
|
649 | if (ind_0.insert(t, h.hints_0_lower)) {
|
650 | return true;
|
651 | } else return false;
|
652 | }
|
653 | bool Type::insert(const RamDomain* ramDomain) {
|
654 | RamDomain data[2];
|
655 | std::copy(ramDomain, ramDomain + 2, data);
|
656 | const t_tuple& tuple = reinterpret_cast<const t_tuple&>(data);
|
657 | context h;
|
658 | return insert(tuple, h);
|
659 | }
|
660 | bool Type::insert(RamDomain a0,RamDomain a1) {
|
661 | RamDomain data[2] = {a0,a1};
|
662 | return insert(data);
|
663 | }
|
664 | bool Type::contains(const t_tuple& t, context& h) const {
|
665 | return ind_0.contains(t, h.hints_0_lower);
|
666 | }
|
667 | bool Type::contains(const t_tuple& t) const {
|
668 | context h;
|
669 | return contains(t, h);
|
670 | }
|
671 | std::size_t Type::size() const {
|
672 | return ind_0.size();
|
673 | }
|
674 | iterator Type::find(const t_tuple& t, context& h) const {
|
675 | return ind_0.find(t, h.hints_0_lower);
|
676 | }
|
677 | iterator Type::find(const t_tuple& t) const {
|
678 | context h;
|
679 | return find(t, h);
|
680 | }
|
681 | range<iterator> Type::lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const {
|
682 | return range<iterator>(ind_0.begin(),ind_0.end());
|
683 | }
|
684 | range<iterator> Type::lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */) const {
|
685 | return range<iterator>(ind_0.begin(),ind_0.end());
|
686 | }
|
687 | range<t_ind_0::iterator> Type::lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper, context& h) const {
|
688 | t_comparator_0 comparator;
|
689 | int cmp = comparator(lower, upper);
|
690 | if (cmp == 0) {
|
691 | auto pos = ind_0.find(lower, h.hints_0_lower);
|
692 | auto fin = ind_0.end();
|
693 | if (pos != fin) {fin = pos; ++fin;}
|
694 | return make_range(pos, fin);
|
695 | }
|
696 | if (cmp > 0) {
|
697 | return make_range(ind_0.end(), ind_0.end());
|
698 | }
|
699 | return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper));
|
700 | }
|
701 | range<t_ind_0::iterator> Type::lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper) const {
|
702 | context h;
|
703 | return lowerUpperRange_11(lower,upper,h);
|
704 | }
|
705 | range<t_ind_0::iterator> Type::lowerUpperRange_10(const t_tuple& lower, const t_tuple& upper, context& h) const {
|
706 | t_comparator_0 comparator;
|
707 | int cmp = comparator(lower, upper);
|
708 | if (cmp > 0) {
|
709 | return make_range(ind_0.end(), ind_0.end());
|
710 | }
|
711 | return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper));
|
712 | }
|
713 | range<t_ind_0::iterator> Type::lowerUpperRange_10(const t_tuple& lower, const t_tuple& upper) const {
|
714 | context h;
|
715 | return lowerUpperRange_10(lower,upper,h);
|
716 | }
|
717 | bool Type::empty() const {
|
718 | return ind_0.empty();
|
719 | }
|
720 | std::vector<range<iterator>> Type::partition() const {
|
721 | return ind_0.getChunks(400);
|
722 | }
|
723 | void Type::purge() {
|
724 | ind_0.clear();
|
725 | }
|
726 | iterator Type::begin() const {
|
727 | return ind_0.begin();
|
728 | }
|
729 | iterator Type::end() const {
|
730 | return ind_0.end();
|
731 | }
|
732 | void Type::printStatistics(std::ostream& o) const {
|
733 | o << " arity 2 direct b-tree index 0 lex-order [0,1]\n";
|
734 | ind_0.printStats(o);
|
735 | }
|
736 | } // namespace souffle::t_btree_ii__0_1__11__10
|
737 | namespace souffle::t_btree_iii__0_1_2__111 {
|
738 | using namespace souffle;
|
739 | struct Type {
|
740 | static constexpr Relation::arity_type Arity = 3;
|
741 | using t_tuple = Tuple<RamDomain, 3>;
|
742 | struct t_comparator_0{
|
743 | int operator()(const t_tuple& a, const t_tuple& b) const {
|
744 | return (ramBitCast<RamSigned>(a[0]) < ramBitCast<RamSigned>(b[0])) ? -1 : (ramBitCast<RamSigned>(a[0]) > ramBitCast<RamSigned>(b[0])) ? 1 :((ramBitCast<RamSigned>(a[1]) < ramBitCast<RamSigned>(b[1])) ? -1 : (ramBitCast<RamSigned>(a[1]) > ramBitCast<RamSigned>(b[1])) ? 1 :((ramBitCast<RamSigned>(a[2]) < ramBitCast<RamSigned>(b[2])) ? -1 : (ramBitCast<RamSigned>(a[2]) > ramBitCast<RamSigned>(b[2])) ? 1 :(0)));
|
745 | }
|
746 | bool less(const t_tuple& a, const t_tuple& b) const {
|
747 | return (ramBitCast<RamSigned>(a[0]) < ramBitCast<RamSigned>(b[0]))|| ((ramBitCast<RamSigned>(a[0]) == ramBitCast<RamSigned>(b[0])) && ((ramBitCast<RamSigned>(a[1]) < ramBitCast<RamSigned>(b[1]))|| ((ramBitCast<RamSigned>(a[1]) == ramBitCast<RamSigned>(b[1])) && ((ramBitCast<RamSigned>(a[2]) < ramBitCast<RamSigned>(b[2]))))));
|
748 | }
|
749 | bool equal(const t_tuple& a, const t_tuple& b) const {
|
750 | return (ramBitCast<RamSigned>(a[0]) == ramBitCast<RamSigned>(b[0]))&&(ramBitCast<RamSigned>(a[1]) == ramBitCast<RamSigned>(b[1]))&&(ramBitCast<RamSigned>(a[2]) == ramBitCast<RamSigned>(b[2]));
|
751 | }
|
752 | };
|
753 | using t_ind_0 = btree_set<t_tuple,t_comparator_0>;
|
754 | t_ind_0 ind_0;
|
755 | using iterator = t_ind_0::iterator;
|
756 | struct context {
|
757 | t_ind_0::operation_hints hints_0_lower;
|
758 | t_ind_0::operation_hints hints_0_upper;
|
759 | };
|
760 | context createContext() { return context(); }
|
761 | bool insert(const t_tuple& t);
|
762 | bool insert(const t_tuple& t, context& h);
|
763 | bool insert(const RamDomain* ramDomain);
|
764 | bool insert(RamDomain a0,RamDomain a1,RamDomain a2);
|
765 | bool contains(const t_tuple& t, context& h) const;
|
766 | bool contains(const t_tuple& t) const;
|
767 | std::size_t size() const;
|
768 | iterator find(const t_tuple& t, context& h) const;
|
769 | iterator find(const t_tuple& t) const;
|
770 | range<iterator> lowerUpperRange_000(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const;
|
771 | range<iterator> lowerUpperRange_000(const t_tuple& /* lower */, const t_tuple& /* upper */) const;
|
772 | range<t_ind_0::iterator> lowerUpperRange_111(const t_tuple& lower, const t_tuple& upper, context& h) const;
|
773 | range<t_ind_0::iterator> lowerUpperRange_111(const t_tuple& lower, const t_tuple& upper) const;
|
774 | bool empty() const;
|
775 | std::vector<range<iterator>> partition() const;
|
776 | void purge();
|
777 | iterator begin() const;
|
778 | iterator end() const;
|
779 | void printStatistics(std::ostream& o) const;
|
780 | };
|
781 | } // namespace souffle::t_btree_iii__0_1_2__111
|
782 | namespace souffle::t_btree_iii__0_1_2__111 {
|
783 | using namespace souffle;
|
784 | using t_ind_0 = Type::t_ind_0;
|
785 | using iterator = Type::iterator;
|
786 | using context = Type::context;
|
787 | bool Type::insert(const t_tuple& t) {
|
788 | context h;
|
789 | return insert(t, h);
|
790 | }
|
791 | bool Type::insert(const t_tuple& t, context& h) {
|
792 | if (ind_0.insert(t, h.hints_0_lower)) {
|
793 | return true;
|
794 | } else return false;
|
795 | }
|
796 | bool Type::insert(const RamDomain* ramDomain) {
|
797 | RamDomain data[3];
|
798 | std::copy(ramDomain, ramDomain + 3, data);
|
799 | const t_tuple& tuple = reinterpret_cast<const t_tuple&>(data);
|
800 | context h;
|
801 | return insert(tuple, h);
|
802 | }
|
803 | bool Type::insert(RamDomain a0,RamDomain a1,RamDomain a2) {
|
804 | RamDomain data[3] = {a0,a1,a2};
|
805 | return insert(data);
|
806 | }
|
807 | bool Type::contains(const t_tuple& t, context& h) const {
|
808 | return ind_0.contains(t, h.hints_0_lower);
|
809 | }
|
810 | bool Type::contains(const t_tuple& t) const {
|
811 | context h;
|
812 | return contains(t, h);
|
813 | }
|
814 | std::size_t Type::size() const {
|
815 | return ind_0.size();
|
816 | }
|
817 | iterator Type::find(const t_tuple& t, context& h) const {
|
818 | return ind_0.find(t, h.hints_0_lower);
|
819 | }
|
820 | iterator Type::find(const t_tuple& t) const {
|
821 | context h;
|
822 | return find(t, h);
|
823 | }
|
824 | range<iterator> Type::lowerUpperRange_000(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const {
|
825 | return range<iterator>(ind_0.begin(),ind_0.end());
|
826 | }
|
827 | range<iterator> Type::lowerUpperRange_000(const t_tuple& /* lower */, const t_tuple& /* upper */) const {
|
828 | return range<iterator>(ind_0.begin(),ind_0.end());
|
829 | }
|
830 | range<t_ind_0::iterator> Type::lowerUpperRange_111(const t_tuple& lower, const t_tuple& upper, context& h) const {
|
831 | t_comparator_0 comparator;
|
832 | int cmp = comparator(lower, upper);
|
833 | if (cmp == 0) {
|
834 | auto pos = ind_0.find(lower, h.hints_0_lower);
|
835 | auto fin = ind_0.end();
|
836 | if (pos != fin) {fin = pos; ++fin;}
|
837 | return make_range(pos, fin);
|
838 | }
|
839 | if (cmp > 0) {
|
840 | return make_range(ind_0.end(), ind_0.end());
|
841 | }
|
842 | return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper));
|
843 | }
|
844 | range<t_ind_0::iterator> Type::lowerUpperRange_111(const t_tuple& lower, const t_tuple& upper) const {
|
845 | context h;
|
846 | return lowerUpperRange_111(lower,upper,h);
|
847 | }
|
848 | bool Type::empty() const {
|
849 | return ind_0.empty();
|
850 | }
|
851 | std::vector<range<iterator>> Type::partition() const {
|
852 | return ind_0.getChunks(400);
|
853 | }
|
854 | void Type::purge() {
|
855 | ind_0.clear();
|
856 | }
|
857 | iterator Type::begin() const {
|
858 | return ind_0.begin();
|
859 | }
|
860 | iterator Type::end() const {
|
861 | return ind_0.end();
|
862 | }
|
863 | void Type::printStatistics(std::ostream& o) const {
|
864 | o << " arity 3 direct b-tree index 0 lex-order [0,1,2]\n";
|
865 | ind_0.printStats(o);
|
866 | }
|
867 | } // namespace souffle::t_btree_iii__0_1_2__111
|
868 | namespace souffle::t_btree_iii__0_1_2__110__111 {
|
869 | using namespace souffle;
|
870 | struct Type {
|
871 | static constexpr Relation::arity_type Arity = 3;
|
872 | using t_tuple = Tuple<RamDomain, 3>;
|
873 | struct t_comparator_0{
|
874 | int operator()(const t_tuple& a, const t_tuple& b) const {
|
875 | return (ramBitCast<RamSigned>(a[0]) < ramBitCast<RamSigned>(b[0])) ? -1 : (ramBitCast<RamSigned>(a[0]) > ramBitCast<RamSigned>(b[0])) ? 1 :((ramBitCast<RamSigned>(a[1]) < ramBitCast<RamSigned>(b[1])) ? -1 : (ramBitCast<RamSigned>(a[1]) > ramBitCast<RamSigned>(b[1])) ? 1 :((ramBitCast<RamSigned>(a[2]) < ramBitCast<RamSigned>(b[2])) ? -1 : (ramBitCast<RamSigned>(a[2]) > ramBitCast<RamSigned>(b[2])) ? 1 :(0)));
|
876 | }
|
877 | bool less(const t_tuple& a, const t_tuple& b) const {
|
878 | return (ramBitCast<RamSigned>(a[0]) < ramBitCast<RamSigned>(b[0]))|| ((ramBitCast<RamSigned>(a[0]) == ramBitCast<RamSigned>(b[0])) && ((ramBitCast<RamSigned>(a[1]) < ramBitCast<RamSigned>(b[1]))|| ((ramBitCast<RamSigned>(a[1]) == ramBitCast<RamSigned>(b[1])) && ((ramBitCast<RamSigned>(a[2]) < ramBitCast<RamSigned>(b[2]))))));
|
879 | }
|
880 | bool equal(const t_tuple& a, const t_tuple& b) const {
|
881 | return (ramBitCast<RamSigned>(a[0]) == ramBitCast<RamSigned>(b[0]))&&(ramBitCast<RamSigned>(a[1]) == ramBitCast<RamSigned>(b[1]))&&(ramBitCast<RamSigned>(a[2]) == ramBitCast<RamSigned>(b[2]));
|
882 | }
|
883 | };
|
884 | using t_ind_0 = btree_set<t_tuple,t_comparator_0>;
|
885 | t_ind_0 ind_0;
|
886 | using iterator = t_ind_0::iterator;
|
887 | struct context {
|
888 | t_ind_0::operation_hints hints_0_lower;
|
889 | t_ind_0::operation_hints hints_0_upper;
|
890 | };
|
891 | context createContext() { return context(); }
|
892 | bool insert(const t_tuple& t);
|
893 | bool insert(const t_tuple& t, context& h);
|
894 | bool insert(const RamDomain* ramDomain);
|
895 | bool insert(RamDomain a0,RamDomain a1,RamDomain a2);
|
896 | bool contains(const t_tuple& t, context& h) const;
|
897 | bool contains(const t_tuple& t) const;
|
898 | std::size_t size() const;
|
899 | iterator find(const t_tuple& t, context& h) const;
|
900 | iterator find(const t_tuple& t) const;
|
901 | range<iterator> lowerUpperRange_000(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const;
|
902 | range<iterator> lowerUpperRange_000(const t_tuple& /* lower */, const t_tuple& /* upper */) const;
|
903 | range<t_ind_0::iterator> lowerUpperRange_110(const t_tuple& lower, const t_tuple& upper, context& h) const;
|
904 | range<t_ind_0::iterator> lowerUpperRange_110(const t_tuple& lower, const t_tuple& upper) const;
|
905 | range<t_ind_0::iterator> lowerUpperRange_111(const t_tuple& lower, const t_tuple& upper, context& h) const;
|
906 | range<t_ind_0::iterator> lowerUpperRange_111(const t_tuple& lower, const t_tuple& upper) const;
|
907 | bool empty() const;
|
908 | std::vector<range<iterator>> partition() const;
|
909 | void purge();
|
910 | iterator begin() const;
|
911 | iterator end() const;
|
912 | void printStatistics(std::ostream& o) const;
|
913 | };
|
914 | } // namespace souffle::t_btree_iii__0_1_2__110__111
|
915 | namespace souffle::t_btree_iii__0_1_2__110__111 {
|
916 | using namespace souffle;
|
917 | using t_ind_0 = Type::t_ind_0;
|
918 | using iterator = Type::iterator;
|
919 | using context = Type::context;
|
920 | bool Type::insert(const t_tuple& t) {
|
921 | context h;
|
922 | return insert(t, h);
|
923 | }
|
924 | bool Type::insert(const t_tuple& t, context& h) {
|
925 | if (ind_0.insert(t, h.hints_0_lower)) {
|
926 | return true;
|
927 | } else return false;
|
928 | }
|
929 | bool Type::insert(const RamDomain* ramDomain) {
|
930 | RamDomain data[3];
|
931 | std::copy(ramDomain, ramDomain + 3, data);
|
932 | const t_tuple& tuple = reinterpret_cast<const t_tuple&>(data);
|
933 | context h;
|
934 | return insert(tuple, h);
|
935 | }
|
936 | bool Type::insert(RamDomain a0,RamDomain a1,RamDomain a2) {
|
937 | RamDomain data[3] = {a0,a1,a2};
|
938 | return insert(data);
|
939 | }
|
940 | bool Type::contains(const t_tuple& t, context& h) const {
|
941 | return ind_0.contains(t, h.hints_0_lower);
|
942 | }
|
943 | bool Type::contains(const t_tuple& t) const {
|
944 | context h;
|
945 | return contains(t, h);
|
946 | }
|
947 | std::size_t Type::size() const {
|
948 | return ind_0.size();
|
949 | }
|
950 | iterator Type::find(const t_tuple& t, context& h) const {
|
951 | return ind_0.find(t, h.hints_0_lower);
|
952 | }
|
953 | iterator Type::find(const t_tuple& t) const {
|
954 | context h;
|
955 | return find(t, h);
|
956 | }
|
957 | range<iterator> Type::lowerUpperRange_000(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const {
|
958 | return range<iterator>(ind_0.begin(),ind_0.end());
|
959 | }
|
960 | range<iterator> Type::lowerUpperRange_000(const t_tuple& /* lower */, const t_tuple& /* upper */) const {
|
961 | return range<iterator>(ind_0.begin(),ind_0.end());
|
962 | }
|
963 | range<t_ind_0::iterator> Type::lowerUpperRange_110(const t_tuple& lower, const t_tuple& upper, context& h) const {
|
964 | t_comparator_0 comparator;
|
965 | int cmp = comparator(lower, upper);
|
966 | if (cmp > 0) {
|
967 | return make_range(ind_0.end(), ind_0.end());
|
968 | }
|
969 | return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper));
|
970 | }
|
971 | range<t_ind_0::iterator> Type::lowerUpperRange_110(const t_tuple& lower, const t_tuple& upper) const {
|
972 | context h;
|
973 | return lowerUpperRange_110(lower,upper,h);
|
974 | }
|
975 | range<t_ind_0::iterator> Type::lowerUpperRange_111(const t_tuple& lower, const t_tuple& upper, context& h) const {
|
976 | t_comparator_0 comparator;
|
977 | int cmp = comparator(lower, upper);
|
978 | if (cmp == 0) {
|
979 | auto pos = ind_0.find(lower, h.hints_0_lower);
|
980 | auto fin = ind_0.end();
|
981 | if (pos != fin) {fin = pos; ++fin;}
|
982 | return make_range(pos, fin);
|
983 | }
|
984 | if (cmp > 0) {
|
985 | return make_range(ind_0.end(), ind_0.end());
|
986 | }
|
987 | return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper));
|
988 | }
|
989 | range<t_ind_0::iterator> Type::lowerUpperRange_111(const t_tuple& lower, const t_tuple& upper) const {
|
990 | context h;
|
991 | return lowerUpperRange_111(lower,upper,h);
|
992 | }
|
993 | bool Type::empty() const {
|
994 | return ind_0.empty();
|
995 | }
|
996 | std::vector<range<iterator>> Type::partition() const {
|
997 | return ind_0.getChunks(400);
|
998 | }
|
999 | void Type::purge() {
|
1000 | ind_0.clear();
|
1001 | }
|
1002 | iterator Type::begin() const {
|
1003 | return ind_0.begin();
|
1004 | }
|
1005 | iterator Type::end() const {
|
1006 | return ind_0.end();
|
1007 | }
|
1008 | void Type::printStatistics(std::ostream& o) const {
|
1009 | o << " arity 3 direct b-tree index 0 lex-order [0,1,2]\n";
|
1010 | ind_0.printStats(o);
|
1011 | }
|
1012 | } // namespace souffle::t_btree_iii__0_1_2__110__111
|
1013 | namespace souffle {
|
1014 | using namespace souffle;
|
1015 | class Stratum_assign_e0d78e44f4df6411 {
|
1016 | public:
|
1017 | Stratum_assign_e0d78e44f4df6411(SymbolTable& symTable,RecordTable& recordTable,ConcurrentCache<std::string,std::regex>& regexCache,bool& pruneImdtRels,bool& performIO,SignalHandler*& signalHandler,std::atomic<std::size_t>& iter,std::atomic<RamDomain>& ctr,std::string& inputDirectory,std::string& outputDirectory,t_btree_iiii__0_1_2_3__1110__1111__1100::Type& rel_assign_e4bb6e0824a16a37);
|
1018 | void run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret);
|
1019 | private:
|
1020 | SymbolTable& symTable;
|
1021 | RecordTable& recordTable;
|
1022 | ConcurrentCache<std::string,std::regex>& regexCache;
|
1023 | bool& pruneImdtRels;
|
1024 | bool& performIO;
|
1025 | SignalHandler*& signalHandler;
|
1026 | std::atomic<std::size_t>& iter;
|
1027 | std::atomic<RamDomain>& ctr;
|
1028 | std::string& inputDirectory;
|
1029 | std::string& outputDirectory;
|
1030 | t_btree_iiii__0_1_2_3__1110__1111__1100::Type* rel_assign_e4bb6e0824a16a37;
|
1031 | };
|
1032 | } // namespace souffle
|
1033 | namespace souffle {
|
1034 | using namespace souffle;
|
1035 | Stratum_assign_e0d78e44f4df6411::Stratum_assign_e0d78e44f4df6411(SymbolTable& symTable,RecordTable& recordTable,ConcurrentCache<std::string,std::regex>& regexCache,bool& pruneImdtRels,bool& performIO,SignalHandler*& signalHandler,std::atomic<std::size_t>& iter,std::atomic<RamDomain>& ctr,std::string& inputDirectory,std::string& outputDirectory,t_btree_iiii__0_1_2_3__1110__1111__1100::Type& rel_assign_e4bb6e0824a16a37):
|
1036 | symTable(symTable),
|
1037 | recordTable(recordTable),
|
1038 | regexCache(regexCache),
|
1039 | pruneImdtRels(pruneImdtRels),
|
1040 | performIO(performIO),
|
1041 | signalHandler(signalHandler),
|
1042 | iter(iter),
|
1043 | ctr(ctr),
|
1044 | inputDirectory(inputDirectory),
|
1045 | outputDirectory(outputDirectory),
|
1046 | rel_assign_e4bb6e0824a16a37(&rel_assign_e4bb6e0824a16a37){
|
1047 | }
|
1048 |
|
1049 | void Stratum_assign_e0d78e44f4df6411::run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret){
|
1050 | if (performIO) {
|
1051 | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","f\ts\tr\tv"},{"auxArity","0"},{"fact-dir","."},{"name","assign"},{"operation","input"},{"params","{\"records\": {}, \"relation\": {\"arity\": 4, \"params\": [\"f\", \"s\", \"r\", \"v\"]}}"},{"types","{\"ADTs\": {\"+:Reference\": {\"arity\": 2, \"branches\": [{\"name\": \"LocalVariable\", \"types\": [\"s:Function\", \"s:symbol\"]}, {\"name\": \"ObjectMember\", \"types\": [\"s:symbol\", \"s:symbol\"]}], \"enum\": false}, \"+:Value\": {\"arity\": 3, \"branches\": [{\"name\": \"Empty\", \"types\": []}, {\"name\": \"HeapObject\", \"types\": [\"s:symbol\"]}, {\"name\": \"Ref\", \"types\": [\"+:Reference\"]}], \"enum\": false}}, \"records\": {}, \"relation\": {\"arity\": 4, \"types\": [\"s:Function\", \"i:Statement\", \"+:Reference\", \"+:Value\"]}}"}});
|
1052 | if (!inputDirectory.empty()) {directiveMap["fact-dir"] = inputDirectory;}
|
1053 | IOSystem::getInstance().getReader(directiveMap, symTable, recordTable)->readAll(*rel_assign_e4bb6e0824a16a37);
|
1054 | } catch (std::exception& e) {std::cerr << "Error loading assign data: " << e.what() << '\n';
|
1055 | exit(1);
|
1056 | }
|
1057 | }
|
1058 | }
|
1059 |
|
1060 | } // namespace souffle
|
1061 |
|
1062 | namespace souffle {
|
1063 | using namespace souffle;
|
1064 | class Stratum_bind_8b0da46e2379b6cd {
|
1065 | public:
|
1066 | Stratum_bind_8b0da46e2379b6cd(SymbolTable& symTable,RecordTable& recordTable,ConcurrentCache<std::string,std::regex>& regexCache,bool& pruneImdtRels,bool& performIO,SignalHandler*& signalHandler,std::atomic<std::size_t>& iter,std::atomic<RamDomain>& ctr,std::string& inputDirectory,std::string& outputDirectory,t_btree_iiiii__0_1_2_3_4__11100__11111::Type& rel_bind_c9210fdc63280a40);
|
1067 | void run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret);
|
1068 | private:
|
1069 | SymbolTable& symTable;
|
1070 | RecordTable& recordTable;
|
1071 | ConcurrentCache<std::string,std::regex>& regexCache;
|
1072 | bool& pruneImdtRels;
|
1073 | bool& performIO;
|
1074 | SignalHandler*& signalHandler;
|
1075 | std::atomic<std::size_t>& iter;
|
1076 | std::atomic<RamDomain>& ctr;
|
1077 | std::string& inputDirectory;
|
1078 | std::string& outputDirectory;
|
1079 | t_btree_iiiii__0_1_2_3_4__11100__11111::Type* rel_bind_c9210fdc63280a40;
|
1080 | };
|
1081 | } // namespace souffle
|
1082 | namespace souffle {
|
1083 | using namespace souffle;
|
1084 | Stratum_bind_8b0da46e2379b6cd::Stratum_bind_8b0da46e2379b6cd(SymbolTable& symTable,RecordTable& recordTable,ConcurrentCache<std::string,std::regex>& regexCache,bool& pruneImdtRels,bool& performIO,SignalHandler*& signalHandler,std::atomic<std::size_t>& iter,std::atomic<RamDomain>& ctr,std::string& inputDirectory,std::string& outputDirectory,t_btree_iiiii__0_1_2_3_4__11100__11111::Type& rel_bind_c9210fdc63280a40):
|
1085 | symTable(symTable),
|
1086 | recordTable(recordTable),
|
1087 | regexCache(regexCache),
|
1088 | pruneImdtRels(pruneImdtRels),
|
1089 | performIO(performIO),
|
1090 | signalHandler(signalHandler),
|
1091 | iter(iter),
|
1092 | ctr(ctr),
|
1093 | inputDirectory(inputDirectory),
|
1094 | outputDirectory(outputDirectory),
|
1095 | rel_bind_c9210fdc63280a40(&rel_bind_c9210fdc63280a40){
|
1096 | }
|
1097 |
|
1098 | void Stratum_bind_8b0da46e2379b6cd::run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret){
|
1099 | if (performIO) {
|
1100 | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","caller\ts\tr\tcallee\tparam"},{"auxArity","0"},{"fact-dir","."},{"name","bind"},{"operation","input"},{"params","{\"records\": {}, \"relation\": {\"arity\": 5, \"params\": [\"caller\", \"s\", \"r\", \"callee\", \"param\"]}}"},{"types","{\"ADTs\": {\"+:Reference\": {\"arity\": 2, \"branches\": [{\"name\": \"LocalVariable\", \"types\": [\"s:Function\", \"s:symbol\"]}, {\"name\": \"ObjectMember\", \"types\": [\"s:symbol\", \"s:symbol\"]}], \"enum\": false}, \"+:Value\": {\"arity\": 3, \"branches\": [{\"name\": \"Empty\", \"types\": []}, {\"name\": \"HeapObject\", \"types\": [\"s:symbol\"]}, {\"name\": \"Ref\", \"types\": [\"+:Reference\"]}], \"enum\": false}}, \"records\": {}, \"relation\": {\"arity\": 5, \"types\": [\"s:Function\", \"i:Statement\", \"+:Reference\", \"s:Function\", \"s:symbol\"]}}"}});
|
1101 | if (!inputDirectory.empty()) {directiveMap["fact-dir"] = inputDirectory;}
|
1102 | IOSystem::getInstance().getReader(directiveMap, symTable, recordTable)->readAll(*rel_bind_c9210fdc63280a40);
|
1103 | } catch (std::exception& e) {std::cerr << "Error loading bind data: " << e.what() << '\n';
|
1104 | exit(1);
|
1105 | }
|
1106 | }
|
1107 | }
|
1108 |
|
1109 | } // namespace souffle
|
1110 |
|
1111 | namespace souffle {
|
1112 | using namespace souffle;
|
1113 | class Stratum_call_104fac07831e2229 {
|
1114 | public:
|
1115 | Stratum_call_104fac07831e2229(SymbolTable& symTable,RecordTable& recordTable,ConcurrentCache<std::string,std::regex>& regexCache,bool& pruneImdtRels,bool& performIO,SignalHandler*& signalHandler,std::atomic<std::size_t>& iter,std::atomic<RamDomain>& ctr,std::string& inputDirectory,std::string& outputDirectory,t_btree_iii__2_0_1__001__111::Type& rel_call_ee1d8972d66cc25f);
|
1116 | void run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret);
|
1117 | private:
|
1118 | SymbolTable& symTable;
|
1119 | RecordTable& recordTable;
|
1120 | ConcurrentCache<std::string,std::regex>& regexCache;
|
1121 | bool& pruneImdtRels;
|
1122 | bool& performIO;
|
1123 | SignalHandler*& signalHandler;
|
1124 | std::atomic<std::size_t>& iter;
|
1125 | std::atomic<RamDomain>& ctr;
|
1126 | std::string& inputDirectory;
|
1127 | std::string& outputDirectory;
|
1128 | t_btree_iii__2_0_1__001__111::Type* rel_call_ee1d8972d66cc25f;
|
1129 | };
|
1130 | } // namespace souffle
|
1131 | namespace souffle {
|
1132 | using namespace souffle;
|
1133 | Stratum_call_104fac07831e2229::Stratum_call_104fac07831e2229(SymbolTable& symTable,RecordTable& recordTable,ConcurrentCache<std::string,std::regex>& regexCache,bool& pruneImdtRels,bool& performIO,SignalHandler*& signalHandler,std::atomic<std::size_t>& iter,std::atomic<RamDomain>& ctr,std::string& inputDirectory,std::string& outputDirectory,t_btree_iii__2_0_1__001__111::Type& rel_call_ee1d8972d66cc25f):
|
1134 | symTable(symTable),
|
1135 | recordTable(recordTable),
|
1136 | regexCache(regexCache),
|
1137 | pruneImdtRels(pruneImdtRels),
|
1138 | performIO(performIO),
|
1139 | signalHandler(signalHandler),
|
1140 | iter(iter),
|
1141 | ctr(ctr),
|
1142 | inputDirectory(inputDirectory),
|
1143 | outputDirectory(outputDirectory),
|
1144 | rel_call_ee1d8972d66cc25f(&rel_call_ee1d8972d66cc25f){
|
1145 | }
|
1146 |
|
1147 | void Stratum_call_104fac07831e2229::run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret){
|
1148 | if (performIO) {
|
1149 | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","caller\ts\tcallee"},{"auxArity","0"},{"fact-dir","."},{"name","call"},{"operation","input"},{"params","{\"records\": {}, \"relation\": {\"arity\": 3, \"params\": [\"caller\", \"s\", \"callee\"]}}"},{"types","{\"ADTs\": {\"+:Reference\": {\"arity\": 2, \"branches\": [{\"name\": \"LocalVariable\", \"types\": [\"s:Function\", \"s:symbol\"]}, {\"name\": \"ObjectMember\", \"types\": [\"s:symbol\", \"s:symbol\"]}], \"enum\": false}, \"+:Value\": {\"arity\": 3, \"branches\": [{\"name\": \"Empty\", \"types\": []}, {\"name\": \"HeapObject\", \"types\": [\"s:symbol\"]}, {\"name\": \"Ref\", \"types\": [\"+:Reference\"]}], \"enum\": false}}, \"records\": {}, \"relation\": {\"arity\": 3, \"types\": [\"s:Function\", \"i:Statement\", \"s:Function\"]}}"}});
|
1150 | if (!inputDirectory.empty()) {directiveMap["fact-dir"] = inputDirectory;}
|
1151 | IOSystem::getInstance().getReader(directiveMap, symTable, recordTable)->readAll(*rel_call_ee1d8972d66cc25f);
|
1152 | } catch (std::exception& e) {std::cerr << "Error loading call data: " << e.what() << '\n';
|
1153 | exit(1);
|
1154 | }
|
1155 | }
|
1156 | }
|
1157 |
|
1158 | } // namespace souffle
|
1159 |
|
1160 | namespace souffle {
|
1161 | using namespace souffle;
|
1162 | class Stratum_cf_edge_c2ae152829fd6f1f {
|
1163 | public:
|
1164 | Stratum_cf_edge_c2ae152829fd6f1f(SymbolTable& symTable,RecordTable& recordTable,ConcurrentCache<std::string,std::regex>& regexCache,bool& pruneImdtRels,bool& performIO,SignalHandler*& signalHandler,std::atomic<std::size_t>& iter,std::atomic<RamDomain>& ctr,std::string& inputDirectory,std::string& outputDirectory,t_btree_iii__0_1_2__111::Type& rel_cf_edge_4931a04c8c74bb72);
|
1165 | void run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret);
|
1166 | private:
|
1167 | SymbolTable& symTable;
|
1168 | RecordTable& recordTable;
|
1169 | ConcurrentCache<std::string,std::regex>& regexCache;
|
1170 | bool& pruneImdtRels;
|
1171 | bool& performIO;
|
1172 | SignalHandler*& signalHandler;
|
1173 | std::atomic<std::size_t>& iter;
|
1174 | std::atomic<RamDomain>& ctr;
|
1175 | std::string& inputDirectory;
|
1176 | std::string& outputDirectory;
|
1177 | t_btree_iii__0_1_2__111::Type* rel_cf_edge_4931a04c8c74bb72;
|
1178 | };
|
1179 | } // namespace souffle
|
1180 | namespace souffle {
|
1181 | using namespace souffle;
|
1182 | Stratum_cf_edge_c2ae152829fd6f1f::Stratum_cf_edge_c2ae152829fd6f1f(SymbolTable& symTable,RecordTable& recordTable,ConcurrentCache<std::string,std::regex>& regexCache,bool& pruneImdtRels,bool& performIO,SignalHandler*& signalHandler,std::atomic<std::size_t>& iter,std::atomic<RamDomain>& ctr,std::string& inputDirectory,std::string& outputDirectory,t_btree_iii__0_1_2__111::Type& rel_cf_edge_4931a04c8c74bb72):
|
1183 | symTable(symTable),
|
1184 | recordTable(recordTable),
|
1185 | regexCache(regexCache),
|
1186 | pruneImdtRels(pruneImdtRels),
|
1187 | performIO(performIO),
|
1188 | signalHandler(signalHandler),
|
1189 | iter(iter),
|
1190 | ctr(ctr),
|
1191 | inputDirectory(inputDirectory),
|
1192 | outputDirectory(outputDirectory),
|
1193 | rel_cf_edge_4931a04c8c74bb72(&rel_cf_edge_4931a04c8c74bb72){
|
1194 | }
|
1195 |
|
1196 | void Stratum_cf_edge_c2ae152829fd6f1f::run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret){
|
1197 | if (performIO) {
|
1198 | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","f\ts1\ts2"},{"auxArity","0"},{"fact-dir","."},{"name","cf_edge"},{"operation","input"},{"params","{\"records\": {}, \"relation\": {\"arity\": 3, \"params\": [\"f\", \"s1\", \"s2\"]}}"},{"types","{\"ADTs\": {\"+:Reference\": {\"arity\": 2, \"branches\": [{\"name\": \"LocalVariable\", \"types\": [\"s:Function\", \"s:symbol\"]}, {\"name\": \"ObjectMember\", \"types\": [\"s:symbol\", \"s:symbol\"]}], \"enum\": false}, \"+:Value\": {\"arity\": 3, \"branches\": [{\"name\": \"Empty\", \"types\": []}, {\"name\": \"HeapObject\", \"types\": [\"s:symbol\"]}, {\"name\": \"Ref\", \"types\": [\"+:Reference\"]}], \"enum\": false}}, \"records\": {}, \"relation\": {\"arity\": 3, \"types\": [\"s:Function\", \"i:Statement\", \"i:Statement\"]}}"}});
|
1199 | if (!inputDirectory.empty()) {directiveMap["fact-dir"] = inputDirectory;}
|
1200 | IOSystem::getInstance().getReader(directiveMap, symTable, recordTable)->readAll(*rel_cf_edge_4931a04c8c74bb72);
|
1201 | } catch (std::exception& e) {std::cerr << "Error loading cf_edge data: " << e.what() << '\n';
|
1202 | exit(1);
|
1203 | }
|
1204 | }
|
1205 | }
|
1206 |
|
1207 | } // namespace souffle
|
1208 |
|
1209 | namespace souffle {
|
1210 | using namespace souffle;
|
1211 | class Stratum_live_vars_in_a363f2025538826a {
|
1212 | public:
|
1213 | Stratum_live_vars_in_a363f2025538826a(SymbolTable& symTable,RecordTable& recordTable,ConcurrentCache<std::string,std::regex>& regexCache,bool& pruneImdtRels,bool& performIO,SignalHandler*& signalHandler,std::atomic<std::size_t>& iter,std::atomic<RamDomain>& ctr,std::string& inputDirectory,std::string& outputDirectory,t_btree_iii__0_1_2__110__111::Type& rel_delta_live_vars_in_fccc4ee6df066f63,t_btree_iii__0_1_2__111::Type& rel_delta_live_vars_out_acc66913cea62d16,t_btree_iii__0_1_2__110__111::Type& rel_new_live_vars_in_0b01be53183b2351,t_btree_iii__0_1_2__111::Type& rel_new_live_vars_out_2d78073638bb3740,t_btree_iiii__0_1_2_3__1110__1111__1100::Type& rel_assign_e4bb6e0824a16a37,t_btree_iii__0_1_2__111::Type& rel_cf_edge_4931a04c8c74bb72,t_btree_iii__0_1_2__111::Type& rel_live_vars_in_0b002b95687eda95,t_btree_iii__0_1_2__110__111::Type& rel_live_vars_out_f94306e028b67aa4,t_btree_iii__0_1_2__111::Type& rel_use_e955e932f22dad4d);
|
1214 | void run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret);
|
1215 | private:
|
1216 | SymbolTable& symTable;
|
1217 | RecordTable& recordTable;
|
1218 | ConcurrentCache<std::string,std::regex>& regexCache;
|
1219 | bool& pruneImdtRels;
|
1220 | bool& performIO;
|
1221 | SignalHandler*& signalHandler;
|
1222 | std::atomic<std::size_t>& iter;
|
1223 | std::atomic<RamDomain>& ctr;
|
1224 | std::string& inputDirectory;
|
1225 | std::string& outputDirectory;
|
1226 | t_btree_iii__0_1_2__110__111::Type* rel_delta_live_vars_in_fccc4ee6df066f63;
|
1227 | t_btree_iii__0_1_2__111::Type* rel_delta_live_vars_out_acc66913cea62d16;
|
1228 | t_btree_iii__0_1_2__110__111::Type* rel_new_live_vars_in_0b01be53183b2351;
|
1229 | t_btree_iii__0_1_2__111::Type* rel_new_live_vars_out_2d78073638bb3740;
|
1230 | t_btree_iiii__0_1_2_3__1110__1111__1100::Type* rel_assign_e4bb6e0824a16a37;
|
1231 | t_btree_iii__0_1_2__111::Type* rel_cf_edge_4931a04c8c74bb72;
|
1232 | t_btree_iii__0_1_2__111::Type* rel_live_vars_in_0b002b95687eda95;
|
1233 | t_btree_iii__0_1_2__110__111::Type* rel_live_vars_out_f94306e028b67aa4;
|
1234 | t_btree_iii__0_1_2__111::Type* rel_use_e955e932f22dad4d;
|
1235 | };
|
1236 | } // namespace souffle
|
1237 | namespace souffle {
|
1238 | using namespace souffle;
|
1239 | Stratum_live_vars_in_a363f2025538826a::Stratum_live_vars_in_a363f2025538826a(SymbolTable& symTable,RecordTable& recordTable,ConcurrentCache<std::string,std::regex>& regexCache,bool& pruneImdtRels,bool& performIO,SignalHandler*& signalHandler,std::atomic<std::size_t>& iter,std::atomic<RamDomain>& ctr,std::string& inputDirectory,std::string& outputDirectory,t_btree_iii__0_1_2__110__111::Type& rel_delta_live_vars_in_fccc4ee6df066f63,t_btree_iii__0_1_2__111::Type& rel_delta_live_vars_out_acc66913cea62d16,t_btree_iii__0_1_2__110__111::Type& rel_new_live_vars_in_0b01be53183b2351,t_btree_iii__0_1_2__111::Type& rel_new_live_vars_out_2d78073638bb3740,t_btree_iiii__0_1_2_3__1110__1111__1100::Type& rel_assign_e4bb6e0824a16a37,t_btree_iii__0_1_2__111::Type& rel_cf_edge_4931a04c8c74bb72,t_btree_iii__0_1_2__111::Type& rel_live_vars_in_0b002b95687eda95,t_btree_iii__0_1_2__110__111::Type& rel_live_vars_out_f94306e028b67aa4,t_btree_iii__0_1_2__111::Type& rel_use_e955e932f22dad4d):
|
1240 | symTable(symTable),
|
1241 | recordTable(recordTable),
|
1242 | regexCache(regexCache),
|
1243 | pruneImdtRels(pruneImdtRels),
|
1244 | performIO(performIO),
|
1245 | signalHandler(signalHandler),
|
1246 | iter(iter),
|
1247 | ctr(ctr),
|
1248 | inputDirectory(inputDirectory),
|
1249 | outputDirectory(outputDirectory),
|
1250 | rel_delta_live_vars_in_fccc4ee6df066f63(&rel_delta_live_vars_in_fccc4ee6df066f63),
|
1251 | rel_delta_live_vars_out_acc66913cea62d16(&rel_delta_live_vars_out_acc66913cea62d16),
|
1252 | rel_new_live_vars_in_0b01be53183b2351(&rel_new_live_vars_in_0b01be53183b2351),
|
1253 | rel_new_live_vars_out_2d78073638bb3740(&rel_new_live_vars_out_2d78073638bb3740),
|
1254 | rel_assign_e4bb6e0824a16a37(&rel_assign_e4bb6e0824a16a37),
|
1255 | rel_cf_edge_4931a04c8c74bb72(&rel_cf_edge_4931a04c8c74bb72),
|
1256 | rel_live_vars_in_0b002b95687eda95(&rel_live_vars_in_0b002b95687eda95),
|
1257 | rel_live_vars_out_f94306e028b67aa4(&rel_live_vars_out_f94306e028b67aa4),
|
1258 | rel_use_e955e932f22dad4d(&rel_use_e955e932f22dad4d){
|
1259 | }
|
1260 |
|
1261 | void Stratum_live_vars_in_a363f2025538826a::run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret){
|
1262 | signalHandler->setMsg(R"_(live_vars_in(f,s,r) :-
|
1263 | use(f,s,r).
|
1264 | in file dataflow.dl [49:1-49:39])_");
|
1265 | if(!(rel_use_e955e932f22dad4d->empty())) {
|
1266 | [&](){
|
1267 | CREATE_OP_CONTEXT(rel_live_vars_in_0b002b95687eda95_op_ctxt,rel_live_vars_in_0b002b95687eda95->createContext());
|
1268 | CREATE_OP_CONTEXT(rel_use_e955e932f22dad4d_op_ctxt,rel_use_e955e932f22dad4d->createContext());
|
1269 | for(const auto& env0 : *rel_use_e955e932f22dad4d) {
|
1270 | Tuple<RamDomain,3> tuple{{ramBitCast(env0[0]),ramBitCast(env0[1]),ramBitCast(env0[2])}};
|
1271 | rel_live_vars_in_0b002b95687eda95->insert(tuple,READ_OP_CONTEXT(rel_live_vars_in_0b002b95687eda95_op_ctxt));
|
1272 | }
|
1273 | }
|
1274 | ();}
|
1275 | [&](){
|
1276 | CREATE_OP_CONTEXT(rel_delta_live_vars_in_fccc4ee6df066f63_op_ctxt,rel_delta_live_vars_in_fccc4ee6df066f63->createContext());
|
1277 | CREATE_OP_CONTEXT(rel_live_vars_in_0b002b95687eda95_op_ctxt,rel_live_vars_in_0b002b95687eda95->createContext());
|
1278 | for(const auto& env0 : *rel_live_vars_in_0b002b95687eda95) {
|
1279 | Tuple<RamDomain,3> tuple{{ramBitCast(env0[0]),ramBitCast(env0[1]),ramBitCast(env0[2])}};
|
1280 | rel_delta_live_vars_in_fccc4ee6df066f63->insert(tuple,READ_OP_CONTEXT(rel_delta_live_vars_in_fccc4ee6df066f63_op_ctxt));
|
1281 | }
|
1282 | }
|
1283 | ();[&](){
|
1284 | CREATE_OP_CONTEXT(rel_delta_live_vars_out_acc66913cea62d16_op_ctxt,rel_delta_live_vars_out_acc66913cea62d16->createContext());
|
1285 | CREATE_OP_CONTEXT(rel_live_vars_out_f94306e028b67aa4_op_ctxt,rel_live_vars_out_f94306e028b67aa4->createContext());
|
1286 | for(const auto& env0 : *rel_live_vars_out_f94306e028b67aa4) {
|
1287 | Tuple<RamDomain,3> tuple{{ramBitCast(env0[0]),ramBitCast(env0[1]),ramBitCast(env0[2])}};
|
1288 | rel_delta_live_vars_out_acc66913cea62d16->insert(tuple,READ_OP_CONTEXT(rel_delta_live_vars_out_acc66913cea62d16_op_ctxt));
|
1289 | }
|
1290 | }
|
1291 | ();auto loop_counter = RamUnsigned(1);
|
1292 | iter = 0;
|
1293 | for(;;) {
|
1294 | signalHandler->setMsg(R"_(live_vars_in(f,s,r) :-
|
1295 | !assign(f,s,r,_),
|
1296 | live_vars_out(f,s,r).
|
1297 | in file dataflow.dl [51:1-51:70])_");
|
1298 | if(!(rel_delta_live_vars_out_acc66913cea62d16->empty())) {
|
1299 | [&](){
|
1300 | CREATE_OP_CONTEXT(rel_delta_live_vars_out_acc66913cea62d16_op_ctxt,rel_delta_live_vars_out_acc66913cea62d16->createContext());
|
1301 | CREATE_OP_CONTEXT(rel_new_live_vars_in_0b01be53183b2351_op_ctxt,rel_new_live_vars_in_0b01be53183b2351->createContext());
|
1302 | CREATE_OP_CONTEXT(rel_assign_e4bb6e0824a16a37_op_ctxt,rel_assign_e4bb6e0824a16a37->createContext());
|
1303 | CREATE_OP_CONTEXT(rel_live_vars_in_0b002b95687eda95_op_ctxt,rel_live_vars_in_0b002b95687eda95->createContext());
|
1304 | for(const auto& env0 : *rel_delta_live_vars_out_acc66913cea62d16) {
|
1305 | if( !(rel_live_vars_in_0b002b95687eda95->contains(Tuple<RamDomain,3>{{ramBitCast(env0[0]),ramBitCast(env0[1]),ramBitCast(env0[2])}},READ_OP_CONTEXT(rel_live_vars_in_0b002b95687eda95_op_ctxt))) && !(!rel_assign_e4bb6e0824a16a37->lowerUpperRange_1110(Tuple<RamDomain,4>{{ramBitCast(env0[0]), ramBitCast(env0[1]), ramBitCast(env0[2]), ramBitCast<RamDomain>(MIN_RAM_SIGNED)}},Tuple<RamDomain,4>{{ramBitCast(env0[0]), ramBitCast(env0[1]), ramBitCast(env0[2]), ramBitCast<RamDomain>(MAX_RAM_SIGNED)}},READ_OP_CONTEXT(rel_assign_e4bb6e0824a16a37_op_ctxt)).empty())) {
|
1306 | Tuple<RamDomain,3> tuple{{ramBitCast(env0[0]),ramBitCast(env0[1]),ramBitCast(env0[2])}};
|
1307 | rel_new_live_vars_in_0b01be53183b2351->insert(tuple,READ_OP_CONTEXT(rel_new_live_vars_in_0b01be53183b2351_op_ctxt));
|
1308 | }
|
1309 | }
|
1310 | }
|
1311 | ();}
|
1312 | signalHandler->setMsg(R"_(live_vars_out(f,s1,r) :-
|
1313 | cf_edge(f,s1,s2),
|
1314 | live_vars_in(f,s2,r).
|
1315 | in file dataflow.dl [55:1-55:71])_");
|
1316 | if(!(rel_cf_edge_4931a04c8c74bb72->empty()) && !(rel_delta_live_vars_in_fccc4ee6df066f63->empty())) {
|
1317 | [&](){
|
1318 | CREATE_OP_CONTEXT(rel_delta_live_vars_in_fccc4ee6df066f63_op_ctxt,rel_delta_live_vars_in_fccc4ee6df066f63->createContext());
|
1319 | CREATE_OP_CONTEXT(rel_new_live_vars_out_2d78073638bb3740_op_ctxt,rel_new_live_vars_out_2d78073638bb3740->createContext());
|
1320 | CREATE_OP_CONTEXT(rel_cf_edge_4931a04c8c74bb72_op_ctxt,rel_cf_edge_4931a04c8c74bb72->createContext());
|
1321 | CREATE_OP_CONTEXT(rel_live_vars_out_f94306e028b67aa4_op_ctxt,rel_live_vars_out_f94306e028b67aa4->createContext());
|
1322 | for(const auto& env0 : *rel_cf_edge_4931a04c8c74bb72) {
|
1323 | auto range = rel_delta_live_vars_in_fccc4ee6df066f63->lowerUpperRange_110(Tuple<RamDomain,3>{{ramBitCast(env0[0]), ramBitCast(env0[2]), ramBitCast<RamDomain>(MIN_RAM_SIGNED)}},Tuple<RamDomain,3>{{ramBitCast(env0[0]), ramBitCast(env0[2]), ramBitCast<RamDomain>(MAX_RAM_SIGNED)}},READ_OP_CONTEXT(rel_delta_live_vars_in_fccc4ee6df066f63_op_ctxt));
|
1324 | for(const auto& env1 : range) {
|
1325 | if( !(rel_live_vars_out_f94306e028b67aa4->contains(Tuple<RamDomain,3>{{ramBitCast(env0[0]),ramBitCast(env0[1]),ramBitCast(env1[2])}},READ_OP_CONTEXT(rel_live_vars_out_f94306e028b67aa4_op_ctxt)))) {
|
1326 | Tuple<RamDomain,3> tuple{{ramBitCast(env0[0]),ramBitCast(env0[1]),ramBitCast(env1[2])}};
|
1327 | rel_new_live_vars_out_2d78073638bb3740->insert(tuple,READ_OP_CONTEXT(rel_new_live_vars_out_2d78073638bb3740_op_ctxt));
|
1328 | }
|
1329 | }
|
1330 | }
|
1331 | }
|
1332 | ();}
|
1333 | if(rel_new_live_vars_in_0b01be53183b2351->empty() && rel_new_live_vars_out_2d78073638bb3740->empty()) break;
|
1334 | [&](){
|
1335 | CREATE_OP_CONTEXT(rel_new_live_vars_in_0b01be53183b2351_op_ctxt,rel_new_live_vars_in_0b01be53183b2351->createContext());
|
1336 | CREATE_OP_CONTEXT(rel_live_vars_in_0b002b95687eda95_op_ctxt,rel_live_vars_in_0b002b95687eda95->createContext());
|
1337 | for(const auto& env0 : *rel_new_live_vars_in_0b01be53183b2351) {
|
1338 | Tuple<RamDomain,3> tuple{{ramBitCast(env0[0]),ramBitCast(env0[1]),ramBitCast(env0[2])}};
|
1339 | rel_live_vars_in_0b002b95687eda95->insert(tuple,READ_OP_CONTEXT(rel_live_vars_in_0b002b95687eda95_op_ctxt));
|
1340 | }
|
1341 | }
|
1342 | ();std::swap(rel_delta_live_vars_in_fccc4ee6df066f63, rel_new_live_vars_in_0b01be53183b2351);
|
1343 | rel_new_live_vars_in_0b01be53183b2351->purge();
|
1344 | [&](){
|
1345 | CREATE_OP_CONTEXT(rel_new_live_vars_out_2d78073638bb3740_op_ctxt,rel_new_live_vars_out_2d78073638bb3740->createContext());
|
1346 | CREATE_OP_CONTEXT(rel_live_vars_out_f94306e028b67aa4_op_ctxt,rel_live_vars_out_f94306e028b67aa4->createContext());
|
1347 | for(const auto& env0 : *rel_new_live_vars_out_2d78073638bb3740) {
|
1348 | Tuple<RamDomain,3> tuple{{ramBitCast(env0[0]),ramBitCast(env0[1]),ramBitCast(env0[2])}};
|
1349 | rel_live_vars_out_f94306e028b67aa4->insert(tuple,READ_OP_CONTEXT(rel_live_vars_out_f94306e028b67aa4_op_ctxt));
|
1350 | }
|
1351 | }
|
1352 | ();std::swap(rel_delta_live_vars_out_acc66913cea62d16, rel_new_live_vars_out_2d78073638bb3740);
|
1353 | rel_new_live_vars_out_2d78073638bb3740->purge();
|
1354 | loop_counter = (ramBitCast<RamUnsigned>(loop_counter) + ramBitCast<RamUnsigned>(RamUnsigned(1)));
|
1355 | iter++;
|
1356 | }
|
1357 | iter = 0;
|
1358 | rel_delta_live_vars_in_fccc4ee6df066f63->purge();
|
1359 | rel_new_live_vars_in_0b01be53183b2351->purge();
|
1360 | rel_delta_live_vars_out_acc66913cea62d16->purge();
|
1361 | rel_new_live_vars_out_2d78073638bb3740->purge();
|
1362 | if (pruneImdtRels) rel_cf_edge_4931a04c8c74bb72->purge();
|
1363 | if (pruneImdtRels) rel_live_vars_in_0b002b95687eda95->purge();
|
1364 | if (pruneImdtRels) rel_use_e955e932f22dad4d->purge();
|
1365 | }
|
1366 |
|
1367 | } // namespace souffle
|
1368 |
|
1369 | namespace souffle {
|
1370 | using namespace souffle;
|
1371 | class Stratum_might_collect_beadc513d07ff032 {
|
1372 | public:
|
1373 | Stratum_might_collect_beadc513d07ff032(SymbolTable& symTable,RecordTable& recordTable,ConcurrentCache<std::string,std::regex>& regexCache,bool& pruneImdtRels,bool& performIO,SignalHandler*& signalHandler,std::atomic<std::size_t>& iter,std::atomic<RamDomain>& ctr,std::string& inputDirectory,std::string& outputDirectory,t_btree_ii__0_1__11__10::Type& rel_delta_might_collect_d651f71586aafe59,t_btree_ii__0_1__11__10::Type& rel_new_might_collect_5d48ef45a97e4618,t_btree_iii__2_0_1__001__111::Type& rel_call_ee1d8972d66cc25f,t_btree_ii__0_1__11::Type& rel_might_collect_ef1d0b06d36e4ddc);
|
1374 | void run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret);
|
1375 | private:
|
1376 | SymbolTable& symTable;
|
1377 | RecordTable& recordTable;
|
1378 | ConcurrentCache<std::string,std::regex>& regexCache;
|
1379 | bool& pruneImdtRels;
|
1380 | bool& performIO;
|
1381 | SignalHandler*& signalHandler;
|
1382 | std::atomic<std::size_t>& iter;
|
1383 | std::atomic<RamDomain>& ctr;
|
1384 | std::string& inputDirectory;
|
1385 | std::string& outputDirectory;
|
1386 | t_btree_ii__0_1__11__10::Type* rel_delta_might_collect_d651f71586aafe59;
|
1387 | t_btree_ii__0_1__11__10::Type* rel_new_might_collect_5d48ef45a97e4618;
|
1388 | t_btree_iii__2_0_1__001__111::Type* rel_call_ee1d8972d66cc25f;
|
1389 | t_btree_ii__0_1__11::Type* rel_might_collect_ef1d0b06d36e4ddc;
|
1390 | };
|
1391 | } // namespace souffle
|
1392 | namespace souffle {
|
1393 | using namespace souffle;
|
1394 | Stratum_might_collect_beadc513d07ff032::Stratum_might_collect_beadc513d07ff032(SymbolTable& symTable,RecordTable& recordTable,ConcurrentCache<std::string,std::regex>& regexCache,bool& pruneImdtRels,bool& performIO,SignalHandler*& signalHandler,std::atomic<std::size_t>& iter,std::atomic<RamDomain>& ctr,std::string& inputDirectory,std::string& outputDirectory,t_btree_ii__0_1__11__10::Type& rel_delta_might_collect_d651f71586aafe59,t_btree_ii__0_1__11__10::Type& rel_new_might_collect_5d48ef45a97e4618,t_btree_iii__2_0_1__001__111::Type& rel_call_ee1d8972d66cc25f,t_btree_ii__0_1__11::Type& rel_might_collect_ef1d0b06d36e4ddc):
|
1395 | symTable(symTable),
|
1396 | recordTable(recordTable),
|
1397 | regexCache(regexCache),
|
1398 | pruneImdtRels(pruneImdtRels),
|
1399 | performIO(performIO),
|
1400 | signalHandler(signalHandler),
|
1401 | iter(iter),
|
1402 | ctr(ctr),
|
1403 | inputDirectory(inputDirectory),
|
1404 | outputDirectory(outputDirectory),
|
1405 | rel_delta_might_collect_d651f71586aafe59(&rel_delta_might_collect_d651f71586aafe59),
|
1406 | rel_new_might_collect_5d48ef45a97e4618(&rel_new_might_collect_5d48ef45a97e4618),
|
1407 | rel_call_ee1d8972d66cc25f(&rel_call_ee1d8972d66cc25f),
|
1408 | rel_might_collect_ef1d0b06d36e4ddc(&rel_might_collect_ef1d0b06d36e4ddc){
|
1409 | }
|
1410 |
|
1411 | void Stratum_might_collect_beadc513d07ff032::run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret){
|
1412 | signalHandler->setMsg(R"_(might_collect(f,s) :-
|
1413 | call(f,s,"mylib.MaybeCollect").
|
1414 | in file call-graph.dl [14:1-14:57])_");
|
1415 | if(!(rel_call_ee1d8972d66cc25f->empty())) {
|
1416 | [&](){
|
1417 | CREATE_OP_CONTEXT(rel_call_ee1d8972d66cc25f_op_ctxt,rel_call_ee1d8972d66cc25f->createContext());
|
1418 | CREATE_OP_CONTEXT(rel_might_collect_ef1d0b06d36e4ddc_op_ctxt,rel_might_collect_ef1d0b06d36e4ddc->createContext());
|
1419 | auto range = rel_call_ee1d8972d66cc25f->lowerUpperRange_001(Tuple<RamDomain,3>{{ramBitCast<RamDomain>(MIN_RAM_SIGNED), ramBitCast<RamDomain>(MIN_RAM_SIGNED), ramBitCast(RamSigned(0))}},Tuple<RamDomain,3>{{ramBitCast<RamDomain>(MAX_RAM_SIGNED), ramBitCast<RamDomain>(MAX_RAM_SIGNED), ramBitCast(RamSigned(0))}},READ_OP_CONTEXT(rel_call_ee1d8972d66cc25f_op_ctxt));
|
1420 | for(const auto& env0 : range) {
|
1421 | Tuple<RamDomain,2> tuple{{ramBitCast(env0[0]),ramBitCast(env0[1])}};
|
1422 | rel_might_collect_ef1d0b06d36e4ddc->insert(tuple,READ_OP_CONTEXT(rel_might_collect_ef1d0b06d36e4ddc_op_ctxt));
|
1423 | }
|
1424 | }
|
1425 | ();}
|
1426 | [&](){
|
1427 | CREATE_OP_CONTEXT(rel_delta_might_collect_d651f71586aafe59_op_ctxt,rel_delta_might_collect_d651f71586aafe59->createContext());
|
1428 | CREATE_OP_CONTEXT(rel_might_collect_ef1d0b06d36e4ddc_op_ctxt,rel_might_collect_ef1d0b06d36e4ddc->createContext());
|
1429 | for(const auto& env0 : *rel_might_collect_ef1d0b06d36e4ddc) {
|
1430 | Tuple<RamDomain,2> tuple{{ramBitCast(env0[0]),ramBitCast(env0[1])}};
|
1431 | rel_delta_might_collect_d651f71586aafe59->insert(tuple,READ_OP_CONTEXT(rel_delta_might_collect_d651f71586aafe59_op_ctxt));
|
1432 | }
|
1433 | }
|
1434 | ();auto loop_counter = RamUnsigned(1);
|
1435 | iter = 0;
|
1436 | for(;;) {
|
1437 | signalHandler->setMsg(R"_(might_collect(f,s) :-
|
1438 | call(f,s,g),
|
1439 | might_collect(g,_).
|
1440 | in file call-graph.dl [15:1-15:59])_");
|
1441 | if(!(rel_call_ee1d8972d66cc25f->empty()) && !(rel_delta_might_collect_d651f71586aafe59->empty())) {
|
1442 | [&](){
|
1443 | CREATE_OP_CONTEXT(rel_delta_might_collect_d651f71586aafe59_op_ctxt,rel_delta_might_collect_d651f71586aafe59->createContext());
|
1444 | CREATE_OP_CONTEXT(rel_new_might_collect_5d48ef45a97e4618_op_ctxt,rel_new_might_collect_5d48ef45a97e4618->createContext());
|
1445 | CREATE_OP_CONTEXT(rel_call_ee1d8972d66cc25f_op_ctxt,rel_call_ee1d8972d66cc25f->createContext());
|
1446 | CREATE_OP_CONTEXT(rel_might_collect_ef1d0b06d36e4ddc_op_ctxt,rel_might_collect_ef1d0b06d36e4ddc->createContext());
|
1447 | for(const auto& env0 : *rel_call_ee1d8972d66cc25f) {
|
1448 | if( !rel_delta_might_collect_d651f71586aafe59->lowerUpperRange_10(Tuple<RamDomain,2>{{ramBitCast(env0[2]), ramBitCast<RamDomain>(MIN_RAM_SIGNED)}},Tuple<RamDomain,2>{{ramBitCast(env0[2]), ramBitCast<RamDomain>(MAX_RAM_SIGNED)}},READ_OP_CONTEXT(rel_delta_might_collect_d651f71586aafe59_op_ctxt)).empty() && !(rel_might_collect_ef1d0b06d36e4ddc->contains(Tuple<RamDomain,2>{{ramBitCast(env0[0]),ramBitCast(env0[1])}},READ_OP_CONTEXT(rel_might_collect_ef1d0b06d36e4ddc_op_ctxt)))) {
|
1449 | Tuple<RamDomain,2> tuple{{ramBitCast(env0[0]),ramBitCast(env0[1])}};
|
1450 | rel_new_might_collect_5d48ef45a97e4618->insert(tuple,READ_OP_CONTEXT(rel_new_might_collect_5d48ef45a97e4618_op_ctxt));
|
1451 | }
|
1452 | }
|
1453 | }
|
1454 | ();}
|
1455 | if(rel_new_might_collect_5d48ef45a97e4618->empty()) break;
|
1456 | [&](){
|
1457 | CREATE_OP_CONTEXT(rel_new_might_collect_5d48ef45a97e4618_op_ctxt,rel_new_might_collect_5d48ef45a97e4618->createContext());
|
1458 | CREATE_OP_CONTEXT(rel_might_collect_ef1d0b06d36e4ddc_op_ctxt,rel_might_collect_ef1d0b06d36e4ddc->createContext());
|
1459 | for(const auto& env0 : *rel_new_might_collect_5d48ef45a97e4618) {
|
1460 | Tuple<RamDomain,2> tuple{{ramBitCast(env0[0]),ramBitCast(env0[1])}};
|
1461 | rel_might_collect_ef1d0b06d36e4ddc->insert(tuple,READ_OP_CONTEXT(rel_might_collect_ef1d0b06d36e4ddc_op_ctxt));
|
1462 | }
|
1463 | }
|
1464 | ();std::swap(rel_delta_might_collect_d651f71586aafe59, rel_new_might_collect_5d48ef45a97e4618);
|
1465 | rel_new_might_collect_5d48ef45a97e4618->purge();
|
1466 | loop_counter = (ramBitCast<RamUnsigned>(loop_counter) + ramBitCast<RamUnsigned>(RamUnsigned(1)));
|
1467 | iter++;
|
1468 | }
|
1469 | iter = 0;
|
1470 | rel_delta_might_collect_d651f71586aafe59->purge();
|
1471 | rel_new_might_collect_5d48ef45a97e4618->purge();
|
1472 | if (performIO) {
|
1473 | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","f\ts"},{"auxArity","0"},{"name","might_collect"},{"operation","output"},{"output-dir","."},{"params","{\"records\": {}, \"relation\": {\"arity\": 2, \"params\": [\"f\", \"s\"]}}"},{"types","{\"ADTs\": {\"+:Reference\": {\"arity\": 2, \"branches\": [{\"name\": \"LocalVariable\", \"types\": [\"s:Function\", \"s:symbol\"]}, {\"name\": \"ObjectMember\", \"types\": [\"s:symbol\", \"s:symbol\"]}], \"enum\": false}, \"+:Value\": {\"arity\": 3, \"branches\": [{\"name\": \"Empty\", \"types\": []}, {\"name\": \"HeapObject\", \"types\": [\"s:symbol\"]}, {\"name\": \"Ref\", \"types\": [\"+:Reference\"]}], \"enum\": false}}, \"records\": {}, \"relation\": {\"arity\": 2, \"types\": [\"s:Function\", \"i:Statement\"]}}"}});
|
1474 | if (outputDirectory == "-"){directiveMap["IO"] = "stdout"; directiveMap["headers"] = "true";}
|
1475 | else if (!outputDirectory.empty()) {directiveMap["output-dir"] = outputDirectory;}
|
1476 | IOSystem::getInstance().getWriter(directiveMap, symTable, recordTable)->writeAll(*rel_might_collect_ef1d0b06d36e4ddc);
|
1477 | } catch (std::exception& e) {std::cerr << e.what();exit(1);}
|
1478 | }
|
1479 | if (pruneImdtRels) rel_call_ee1d8972d66cc25f->purge();
|
1480 | }
|
1481 |
|
1482 | } // namespace souffle
|
1483 |
|
1484 | namespace souffle {
|
1485 | using namespace souffle;
|
1486 | class Stratum_stack_root_vars_4df5b9c3cd2e7586 {
|
1487 | public:
|
1488 | Stratum_stack_root_vars_4df5b9c3cd2e7586(SymbolTable& symTable,RecordTable& recordTable,ConcurrentCache<std::string,std::regex>& regexCache,bool& pruneImdtRels,bool& performIO,SignalHandler*& signalHandler,std::atomic<std::size_t>& iter,std::atomic<RamDomain>& ctr,std::string& inputDirectory,std::string& outputDirectory,t_btree_iiii__0_1_2_3__1110__1111__1100::Type& rel_assign_e4bb6e0824a16a37,t_btree_iiiii__0_1_2_3_4__11100__11111::Type& rel_bind_c9210fdc63280a40,t_btree_iii__0_1_2__110__111::Type& rel_live_vars_out_f94306e028b67aa4,t_btree_ii__0_1__11::Type& rel_might_collect_ef1d0b06d36e4ddc,t_btree_ii__0_1__11::Type& rel_stack_root_vars_a138611bd47fd3ff);
|
1489 | void run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret);
|
1490 | private:
|
1491 | SymbolTable& symTable;
|
1492 | RecordTable& recordTable;
|
1493 | ConcurrentCache<std::string,std::regex>& regexCache;
|
1494 | bool& pruneImdtRels;
|
1495 | bool& performIO;
|
1496 | SignalHandler*& signalHandler;
|
1497 | std::atomic<std::size_t>& iter;
|
1498 | std::atomic<RamDomain>& ctr;
|
1499 | std::string& inputDirectory;
|
1500 | std::string& outputDirectory;
|
1501 | t_btree_iiii__0_1_2_3__1110__1111__1100::Type* rel_assign_e4bb6e0824a16a37;
|
1502 | t_btree_iiiii__0_1_2_3_4__11100__11111::Type* rel_bind_c9210fdc63280a40;
|
1503 | t_btree_iii__0_1_2__110__111::Type* rel_live_vars_out_f94306e028b67aa4;
|
1504 | t_btree_ii__0_1__11::Type* rel_might_collect_ef1d0b06d36e4ddc;
|
1505 | t_btree_ii__0_1__11::Type* rel_stack_root_vars_a138611bd47fd3ff;
|
1506 | std::vector<std::regex> regexes;
|
1507 | };
|
1508 | } // namespace souffle
|
1509 | namespace souffle {
|
1510 | using namespace souffle;
|
1511 | Stratum_stack_root_vars_4df5b9c3cd2e7586::Stratum_stack_root_vars_4df5b9c3cd2e7586(SymbolTable& symTable,RecordTable& recordTable,ConcurrentCache<std::string,std::regex>& regexCache,bool& pruneImdtRels,bool& performIO,SignalHandler*& signalHandler,std::atomic<std::size_t>& iter,std::atomic<RamDomain>& ctr,std::string& inputDirectory,std::string& outputDirectory,t_btree_iiii__0_1_2_3__1110__1111__1100::Type& rel_assign_e4bb6e0824a16a37,t_btree_iiiii__0_1_2_3_4__11100__11111::Type& rel_bind_c9210fdc63280a40,t_btree_iii__0_1_2__110__111::Type& rel_live_vars_out_f94306e028b67aa4,t_btree_ii__0_1__11::Type& rel_might_collect_ef1d0b06d36e4ddc,t_btree_ii__0_1__11::Type& rel_stack_root_vars_a138611bd47fd3ff):
|
1512 | symTable(symTable),
|
1513 | recordTable(recordTable),
|
1514 | regexCache(regexCache),
|
1515 | pruneImdtRels(pruneImdtRels),
|
1516 | performIO(performIO),
|
1517 | signalHandler(signalHandler),
|
1518 | iter(iter),
|
1519 | ctr(ctr),
|
1520 | inputDirectory(inputDirectory),
|
1521 | outputDirectory(outputDirectory),
|
1522 | rel_assign_e4bb6e0824a16a37(&rel_assign_e4bb6e0824a16a37),
|
1523 | rel_bind_c9210fdc63280a40(&rel_bind_c9210fdc63280a40),
|
1524 | rel_live_vars_out_f94306e028b67aa4(&rel_live_vars_out_f94306e028b67aa4),
|
1525 | rel_might_collect_ef1d0b06d36e4ddc(&rel_might_collect_ef1d0b06d36e4ddc),
|
1526 | rel_stack_root_vars_a138611bd47fd3ff(&rel_stack_root_vars_a138611bd47fd3ff),
|
1527 | regexes({
|
1528 | std::regex(".*ctx_.*__init__"),
|
1529 | }){
|
1530 | }
|
1531 |
|
1532 | void Stratum_stack_root_vars_4df5b9c3cd2e7586::run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret){
|
1533 | signalHandler->setMsg(R"_(stack_root_vars(f,r) :-
|
1534 | !bind(f,s,r,_,_),
|
1535 | might_collect(f,s),
|
1536 | live_vars_out(f,s,r).
|
1537 | in file dataflow.dl [59:1-59:92])_");
|
1538 | if(!(rel_might_collect_ef1d0b06d36e4ddc->empty()) && !(rel_live_vars_out_f94306e028b67aa4->empty())) {
|
1539 | [&](){
|
1540 | CREATE_OP_CONTEXT(rel_bind_c9210fdc63280a40_op_ctxt,rel_bind_c9210fdc63280a40->createContext());
|
1541 | CREATE_OP_CONTEXT(rel_live_vars_out_f94306e028b67aa4_op_ctxt,rel_live_vars_out_f94306e028b67aa4->createContext());
|
1542 | CREATE_OP_CONTEXT(rel_might_collect_ef1d0b06d36e4ddc_op_ctxt,rel_might_collect_ef1d0b06d36e4ddc->createContext());
|
1543 | CREATE_OP_CONTEXT(rel_stack_root_vars_a138611bd47fd3ff_op_ctxt,rel_stack_root_vars_a138611bd47fd3ff->createContext());
|
1544 | for(const auto& env0 : *rel_might_collect_ef1d0b06d36e4ddc) {
|
1545 | auto range = rel_live_vars_out_f94306e028b67aa4->lowerUpperRange_110(Tuple<RamDomain,3>{{ramBitCast(env0[0]), ramBitCast(env0[1]), ramBitCast<RamDomain>(MIN_RAM_SIGNED)}},Tuple<RamDomain,3>{{ramBitCast(env0[0]), ramBitCast(env0[1]), ramBitCast<RamDomain>(MAX_RAM_SIGNED)}},READ_OP_CONTEXT(rel_live_vars_out_f94306e028b67aa4_op_ctxt));
|
1546 | for(const auto& env1 : range) {
|
1547 | if( !(!rel_bind_c9210fdc63280a40->lowerUpperRange_11100(Tuple<RamDomain,5>{{ramBitCast(env0[0]), ramBitCast(env0[1]), ramBitCast(env1[2]), ramBitCast<RamDomain>(MIN_RAM_SIGNED), ramBitCast<RamDomain>(MIN_RAM_SIGNED)}},Tuple<RamDomain,5>{{ramBitCast(env0[0]), ramBitCast(env0[1]), ramBitCast(env1[2]), ramBitCast<RamDomain>(MAX_RAM_SIGNED), ramBitCast<RamDomain>(MAX_RAM_SIGNED)}},READ_OP_CONTEXT(rel_bind_c9210fdc63280a40_op_ctxt)).empty())) {
|
1548 | Tuple<RamDomain,2> tuple{{ramBitCast(env0[0]),ramBitCast(env1[2])}};
|
1549 | rel_stack_root_vars_a138611bd47fd3ff->insert(tuple,READ_OP_CONTEXT(rel_stack_root_vars_a138611bd47fd3ff_op_ctxt));
|
1550 | }
|
1551 | }
|
1552 | }
|
1553 | }
|
1554 | ();}
|
1555 | signalHandler->setMsg(R"_(stack_root_vars(f,$LocalVariable(f, v)) :-
|
1556 | might_collect(f,_),
|
1557 | assign(f,0,$LocalVariable(f, v),$Empty()).
|
1558 | in file dataflow.dl [63:1-63:111])_");
|
1559 | if(!(rel_might_collect_ef1d0b06d36e4ddc->empty()) && !(rel_assign_e4bb6e0824a16a37->empty())) {
|
1560 | [&](){
|
1561 | CREATE_OP_CONTEXT(rel_assign_e4bb6e0824a16a37_op_ctxt,rel_assign_e4bb6e0824a16a37->createContext());
|
1562 | CREATE_OP_CONTEXT(rel_might_collect_ef1d0b06d36e4ddc_op_ctxt,rel_might_collect_ef1d0b06d36e4ddc->createContext());
|
1563 | CREATE_OP_CONTEXT(rel_stack_root_vars_a138611bd47fd3ff_op_ctxt,rel_stack_root_vars_a138611bd47fd3ff->createContext());
|
1564 | for(const auto& env0 : *rel_might_collect_ef1d0b06d36e4ddc) {
|
1565 | auto range = rel_assign_e4bb6e0824a16a37->lowerUpperRange_1100(Tuple<RamDomain,4>{{ramBitCast(env0[0]), ramBitCast(RamSigned(0)), ramBitCast<RamDomain>(MIN_RAM_SIGNED), ramBitCast<RamDomain>(MIN_RAM_SIGNED)}},Tuple<RamDomain,4>{{ramBitCast(env0[0]), ramBitCast(RamSigned(0)), ramBitCast<RamDomain>(MAX_RAM_SIGNED), ramBitCast<RamDomain>(MAX_RAM_SIGNED)}},READ_OP_CONTEXT(rel_assign_e4bb6e0824a16a37_op_ctxt));
|
1566 | for(const auto& env1 : range) {
|
1567 | RamDomain const ref = env1[2];
|
1568 | if (ref == 0) continue;
|
1569 | const RamDomain *env2 = recordTable.unpack(ref,2);
|
1570 | {
|
1571 | if( (ramBitCast<RamDomain>(env2[0]) == ramBitCast<RamDomain>(RamSigned(0)))) {
|
1572 | RamDomain const ref = env2[1];
|
1573 | if (ref == 0) continue;
|
1574 | const RamDomain *env3 = recordTable.unpack(ref,2);
|
1575 | {
|
1576 | if( (ramBitCast<RamDomain>(env0[0]) == ramBitCast<RamDomain>(env3[0]))) {
|
1577 | RamDomain const ref = env1[3];
|
1578 | if (ref == 0) continue;
|
1579 | const RamDomain *env4 = recordTable.unpack(ref,2);
|
1580 | {
|
1581 | if( (ramBitCast<RamDomain>(env4[0]) == ramBitCast<RamDomain>(RamSigned(0)))) {
|
1582 | Tuple<RamDomain,2> tuple{{ramBitCast(env0[0]),ramBitCast(pack(recordTable,Tuple<RamDomain,2>{{ramBitCast(ramBitCast(RamSigned(0))),ramBitCast(ramBitCast(pack(recordTable,Tuple<RamDomain,2>{{ramBitCast(ramBitCast(env0[0])),ramBitCast(ramBitCast(env3[1]))}}
|
1583 | )))}}
|
1584 | ))}};
|
1585 | rel_stack_root_vars_a138611bd47fd3ff->insert(tuple,READ_OP_CONTEXT(rel_stack_root_vars_a138611bd47fd3ff_op_ctxt));
|
1586 | }
|
1587 | }
|
1588 | }
|
1589 | }
|
1590 | }
|
1591 | }
|
1592 | }
|
1593 | }
|
1594 | }
|
1595 | ();}
|
1596 | signalHandler->setMsg(R"_(stack_root_vars(f,$ObjectMember("self", m)) :-
|
1597 | match(".*ctx_.*__init__", f),
|
1598 | assign(f,_,$ObjectMember("self", m),_).
|
1599 | in file dataflow.dl [66:1-66:121])_");
|
1600 | if(!(rel_assign_e4bb6e0824a16a37->empty())) {
|
1601 | [&](){
|
1602 | CREATE_OP_CONTEXT(rel_assign_e4bb6e0824a16a37_op_ctxt,rel_assign_e4bb6e0824a16a37->createContext());
|
1603 | CREATE_OP_CONTEXT(rel_stack_root_vars_a138611bd47fd3ff_op_ctxt,rel_stack_root_vars_a138611bd47fd3ff->createContext());
|
1604 | for(const auto& env0 : *rel_assign_e4bb6e0824a16a37) {
|
1605 | if( std::regex_match(symTable.decode(env0[0]), regexes.at(0))) {
|
1606 | RamDomain const ref = env0[2];
|
1607 | if (ref == 0) continue;
|
1608 | const RamDomain *env1 = recordTable.unpack(ref,2);
|
1609 | {
|
1610 | if( (ramBitCast<RamDomain>(env1[0]) == ramBitCast<RamDomain>(RamSigned(1)))) {
|
1611 | RamDomain const ref = env1[1];
|
1612 | if (ref == 0) continue;
|
1613 | const RamDomain *env2 = recordTable.unpack(ref,2);
|
1614 | {
|
1615 | if( (ramBitCast<RamDomain>(env2[0]) == ramBitCast<RamDomain>(RamSigned(1)))) {
|
1616 | Tuple<RamDomain,2> tuple{{ramBitCast(env0[0]),ramBitCast(pack(recordTable,Tuple<RamDomain,2>{{ramBitCast(ramBitCast(RamSigned(1))),ramBitCast(ramBitCast(pack(recordTable,Tuple<RamDomain,2>{{ramBitCast(ramBitCast(RamSigned(1))),ramBitCast(ramBitCast(env2[1]))}}
|
1617 | )))}}
|
1618 | ))}};
|
1619 | rel_stack_root_vars_a138611bd47fd3ff->insert(tuple,READ_OP_CONTEXT(rel_stack_root_vars_a138611bd47fd3ff_op_ctxt));
|
1620 | }
|
1621 | }
|
1622 | }
|
1623 | }
|
1624 | }
|
1625 | }
|
1626 | }
|
1627 | ();}
|
1628 | if (performIO) {
|
1629 | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","f\tr"},{"auxArity","0"},{"delimeter","\t"},{"filename","stack_root_vars.tsv"},{"name","stack_root_vars"},{"operation","output"},{"output-dir","."},{"params","{\"records\": {}, \"relation\": {\"arity\": 2, \"params\": [\"f\", \"r\"]}}"},{"types","{\"ADTs\": {\"+:Reference\": {\"arity\": 2, \"branches\": [{\"name\": \"LocalVariable\", \"types\": [\"s:Function\", \"s:symbol\"]}, {\"name\": \"ObjectMember\", \"types\": [\"s:symbol\", \"s:symbol\"]}], \"enum\": false}, \"+:Value\": {\"arity\": 3, \"branches\": [{\"name\": \"Empty\", \"types\": []}, {\"name\": \"HeapObject\", \"types\": [\"s:symbol\"]}, {\"name\": \"Ref\", \"types\": [\"+:Reference\"]}], \"enum\": false}}, \"records\": {}, \"relation\": {\"arity\": 2, \"types\": [\"s:Function\", \"+:Reference\"]}}"}});
|
1630 | if (outputDirectory == "-"){directiveMap["IO"] = "stdout"; directiveMap["headers"] = "true";}
|
1631 | else if (!outputDirectory.empty()) {directiveMap["output-dir"] = outputDirectory;}
|
1632 | IOSystem::getInstance().getWriter(directiveMap, symTable, recordTable)->writeAll(*rel_stack_root_vars_a138611bd47fd3ff);
|
1633 | } catch (std::exception& e) {std::cerr << e.what();exit(1);}
|
1634 | }
|
1635 | if (pruneImdtRels) rel_assign_e4bb6e0824a16a37->purge();
|
1636 | if (pruneImdtRels) rel_bind_c9210fdc63280a40->purge();
|
1637 | if (pruneImdtRels) rel_live_vars_out_f94306e028b67aa4->purge();
|
1638 | }
|
1639 |
|
1640 | } // namespace souffle
|
1641 |
|
1642 | namespace souffle {
|
1643 | using namespace souffle;
|
1644 | class Stratum_use_f38e4ba456a0cc9a {
|
1645 | public:
|
1646 | Stratum_use_f38e4ba456a0cc9a(SymbolTable& symTable,RecordTable& recordTable,ConcurrentCache<std::string,std::regex>& regexCache,bool& pruneImdtRels,bool& performIO,SignalHandler*& signalHandler,std::atomic<std::size_t>& iter,std::atomic<RamDomain>& ctr,std::string& inputDirectory,std::string& outputDirectory,t_btree_iii__0_1_2__111::Type& rel_use_e955e932f22dad4d);
|
1647 | void run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret);
|
1648 | private:
|
1649 | SymbolTable& symTable;
|
1650 | RecordTable& recordTable;
|
1651 | ConcurrentCache<std::string,std::regex>& regexCache;
|
1652 | bool& pruneImdtRels;
|
1653 | bool& performIO;
|
1654 | SignalHandler*& signalHandler;
|
1655 | std::atomic<std::size_t>& iter;
|
1656 | std::atomic<RamDomain>& ctr;
|
1657 | std::string& inputDirectory;
|
1658 | std::string& outputDirectory;
|
1659 | t_btree_iii__0_1_2__111::Type* rel_use_e955e932f22dad4d;
|
1660 | };
|
1661 | } // namespace souffle
|
1662 | namespace souffle {
|
1663 | using namespace souffle;
|
1664 | Stratum_use_f38e4ba456a0cc9a::Stratum_use_f38e4ba456a0cc9a(SymbolTable& symTable,RecordTable& recordTable,ConcurrentCache<std::string,std::regex>& regexCache,bool& pruneImdtRels,bool& performIO,SignalHandler*& signalHandler,std::atomic<std::size_t>& iter,std::atomic<RamDomain>& ctr,std::string& inputDirectory,std::string& outputDirectory,t_btree_iii__0_1_2__111::Type& rel_use_e955e932f22dad4d):
|
1665 | symTable(symTable),
|
1666 | recordTable(recordTable),
|
1667 | regexCache(regexCache),
|
1668 | pruneImdtRels(pruneImdtRels),
|
1669 | performIO(performIO),
|
1670 | signalHandler(signalHandler),
|
1671 | iter(iter),
|
1672 | ctr(ctr),
|
1673 | inputDirectory(inputDirectory),
|
1674 | outputDirectory(outputDirectory),
|
1675 | rel_use_e955e932f22dad4d(&rel_use_e955e932f22dad4d){
|
1676 | }
|
1677 |
|
1678 | void Stratum_use_f38e4ba456a0cc9a::run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret){
|
1679 | if (performIO) {
|
1680 | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","f\ts\tr"},{"auxArity","0"},{"fact-dir","."},{"name","use"},{"operation","input"},{"params","{\"records\": {}, \"relation\": {\"arity\": 3, \"params\": [\"f\", \"s\", \"r\"]}}"},{"types","{\"ADTs\": {\"+:Reference\": {\"arity\": 2, \"branches\": [{\"name\": \"LocalVariable\", \"types\": [\"s:Function\", \"s:symbol\"]}, {\"name\": \"ObjectMember\", \"types\": [\"s:symbol\", \"s:symbol\"]}], \"enum\": false}, \"+:Value\": {\"arity\": 3, \"branches\": [{\"name\": \"Empty\", \"types\": []}, {\"name\": \"HeapObject\", \"types\": [\"s:symbol\"]}, {\"name\": \"Ref\", \"types\": [\"+:Reference\"]}], \"enum\": false}}, \"records\": {}, \"relation\": {\"arity\": 3, \"types\": [\"s:Function\", \"i:Statement\", \"+:Reference\"]}}"}});
|
1681 | if (!inputDirectory.empty()) {directiveMap["fact-dir"] = inputDirectory;}
|
1682 | IOSystem::getInstance().getReader(directiveMap, symTable, recordTable)->readAll(*rel_use_e955e932f22dad4d);
|
1683 | } catch (std::exception& e) {std::cerr << "Error loading use data: " << e.what() << '\n';
|
1684 | exit(1);
|
1685 | }
|
1686 | }
|
1687 | }
|
1688 |
|
1689 | } // namespace souffle
|
1690 |
|
1691 | namespace souffle {
|
1692 | using namespace souffle;
|
1693 | class Sf__: public SouffleProgram {
|
1694 | public:
|
1695 | Sf__();
|
1696 | ~Sf__();
|
1697 | void run();
|
1698 | void runAll(std::string inputDirectoryArg = "",std::string outputDirectoryArg = "",bool performIOArg = true,bool pruneImdtRelsArg = true);
|
1699 | void printAll([[maybe_unused]] std::string outputDirectoryArg = "");
|
1700 | void loadAll([[maybe_unused]] std::string inputDirectoryArg = "");
|
1701 | void dumpInputs();
|
1702 | void dumpOutputs();
|
1703 | SymbolTable& getSymbolTable();
|
1704 | RecordTable& getRecordTable();
|
1705 | void setNumThreads(std::size_t numThreadsValue);
|
1706 | void executeSubroutine(std::string name,const std::vector<RamDomain>& args,std::vector<RamDomain>& ret);
|
1707 | private:
|
1708 | void runFunction(std::string inputDirectoryArg,std::string outputDirectoryArg,bool performIOArg,bool pruneImdtRelsArg);
|
1709 | SymbolTableImpl symTable;
|
1710 | SpecializedRecordTable<0,2> recordTable;
|
1711 | ConcurrentCache<std::string,std::regex> regexCache;
|
1712 | Own<t_btree_iiii__0_1_2_3__1110__1111__1100::Type> rel_assign_e4bb6e0824a16a37;
|
1713 | souffle::RelationWrapper<t_btree_iiii__0_1_2_3__1110__1111__1100::Type> wrapper_rel_assign_e4bb6e0824a16a37;
|
1714 | Own<t_btree_iiiii__0_1_2_3_4__11100__11111::Type> rel_bind_c9210fdc63280a40;
|
1715 | souffle::RelationWrapper<t_btree_iiiii__0_1_2_3_4__11100__11111::Type> wrapper_rel_bind_c9210fdc63280a40;
|
1716 | Own<t_btree_iii__2_0_1__001__111::Type> rel_call_ee1d8972d66cc25f;
|
1717 | souffle::RelationWrapper<t_btree_iii__2_0_1__001__111::Type> wrapper_rel_call_ee1d8972d66cc25f;
|
1718 | Own<t_btree_ii__0_1__11::Type> rel_might_collect_ef1d0b06d36e4ddc;
|
1719 | souffle::RelationWrapper<t_btree_ii__0_1__11::Type> wrapper_rel_might_collect_ef1d0b06d36e4ddc;
|
1720 | Own<t_btree_ii__0_1__11__10::Type> rel_delta_might_collect_d651f71586aafe59;
|
1721 | Own<t_btree_ii__0_1__11__10::Type> rel_new_might_collect_5d48ef45a97e4618;
|
1722 | Own<t_btree_iii__0_1_2__111::Type> rel_cf_edge_4931a04c8c74bb72;
|
1723 | souffle::RelationWrapper<t_btree_iii__0_1_2__111::Type> wrapper_rel_cf_edge_4931a04c8c74bb72;
|
1724 | Own<t_btree_iii__0_1_2__111::Type> rel_use_e955e932f22dad4d;
|
1725 | souffle::RelationWrapper<t_btree_iii__0_1_2__111::Type> wrapper_rel_use_e955e932f22dad4d;
|
1726 | Own<t_btree_iii__0_1_2__111::Type> rel_live_vars_in_0b002b95687eda95;
|
1727 | souffle::RelationWrapper<t_btree_iii__0_1_2__111::Type> wrapper_rel_live_vars_in_0b002b95687eda95;
|
1728 | Own<t_btree_iii__0_1_2__110__111::Type> rel_delta_live_vars_in_fccc4ee6df066f63;
|
1729 | Own<t_btree_iii__0_1_2__110__111::Type> rel_new_live_vars_in_0b01be53183b2351;
|
1730 | Own<t_btree_iii__0_1_2__110__111::Type> rel_live_vars_out_f94306e028b67aa4;
|
1731 | souffle::RelationWrapper<t_btree_iii__0_1_2__110__111::Type> wrapper_rel_live_vars_out_f94306e028b67aa4;
|
1732 | Own<t_btree_iii__0_1_2__111::Type> rel_delta_live_vars_out_acc66913cea62d16;
|
1733 | Own<t_btree_iii__0_1_2__111::Type> rel_new_live_vars_out_2d78073638bb3740;
|
1734 | Own<t_btree_ii__0_1__11::Type> rel_stack_root_vars_a138611bd47fd3ff;
|
1735 | souffle::RelationWrapper<t_btree_ii__0_1__11::Type> wrapper_rel_stack_root_vars_a138611bd47fd3ff;
|
1736 | Stratum_assign_e0d78e44f4df6411 stratum_assign_f550d366a9215d2a;
|
1737 | Stratum_bind_8b0da46e2379b6cd stratum_bind_1968829e9243d389;
|
1738 | Stratum_call_104fac07831e2229 stratum_call_587d2d7effb5d130;
|
1739 | Stratum_cf_edge_c2ae152829fd6f1f stratum_cf_edge_4017fef287699967;
|
1740 | Stratum_live_vars_in_a363f2025538826a stratum_live_vars_in_c3dc49a4823a7f1e;
|
1741 | Stratum_might_collect_beadc513d07ff032 stratum_might_collect_cc50af26f53a71ac;
|
1742 | Stratum_stack_root_vars_4df5b9c3cd2e7586 stratum_stack_root_vars_49e4f510c537163e;
|
1743 | Stratum_use_f38e4ba456a0cc9a stratum_use_2e20cb5441769259;
|
1744 | std::string inputDirectory;
|
1745 | std::string outputDirectory;
|
1746 | SignalHandler* signalHandler{SignalHandler::instance()};
|
1747 | std::atomic<RamDomain> ctr{};
|
1748 | std::atomic<std::size_t> iter{};
|
1749 | };
|
1750 | } // namespace souffle
|
1751 | namespace souffle {
|
1752 | using namespace souffle;
|
1753 | Sf__::Sf__():
|
1754 | symTable({
|
1755 | R"_(mylib.MaybeCollect)_",
|
1756 | R"_(self)_",
|
1757 | R"_(.*ctx_.*__init__)_",
|
1758 | }),
|
1759 | recordTable(),
|
1760 | regexCache(),
|
1761 | rel_assign_e4bb6e0824a16a37(mk<t_btree_iiii__0_1_2_3__1110__1111__1100::Type>()),
|
1762 | wrapper_rel_assign_e4bb6e0824a16a37(0, *rel_assign_e4bb6e0824a16a37, *this, "assign", std::array<const char *,4>{{"s:Function","i:Statement","+:Reference","+:Value"}}, std::array<const char *,4>{{"f","s","r","v"}}, 0),
|
1763 | rel_bind_c9210fdc63280a40(mk<t_btree_iiiii__0_1_2_3_4__11100__11111::Type>()),
|
1764 | wrapper_rel_bind_c9210fdc63280a40(1, *rel_bind_c9210fdc63280a40, *this, "bind", std::array<const char *,5>{{"s:Function","i:Statement","+:Reference","s:Function","s:symbol"}}, std::array<const char *,5>{{"caller","s","r","callee","param"}}, 0),
|
1765 | rel_call_ee1d8972d66cc25f(mk<t_btree_iii__2_0_1__001__111::Type>()),
|
1766 | wrapper_rel_call_ee1d8972d66cc25f(2, *rel_call_ee1d8972d66cc25f, *this, "call", std::array<const char *,3>{{"s:Function","i:Statement","s:Function"}}, std::array<const char *,3>{{"caller","s","callee"}}, 0),
|
1767 | rel_might_collect_ef1d0b06d36e4ddc(mk<t_btree_ii__0_1__11::Type>()),
|
1768 | wrapper_rel_might_collect_ef1d0b06d36e4ddc(3, *rel_might_collect_ef1d0b06d36e4ddc, *this, "might_collect", std::array<const char *,2>{{"s:Function","i:Statement"}}, std::array<const char *,2>{{"f","s"}}, 0),
|
1769 | rel_delta_might_collect_d651f71586aafe59(mk<t_btree_ii__0_1__11__10::Type>()),
|
1770 | rel_new_might_collect_5d48ef45a97e4618(mk<t_btree_ii__0_1__11__10::Type>()),
|
1771 | rel_cf_edge_4931a04c8c74bb72(mk<t_btree_iii__0_1_2__111::Type>()),
|
1772 | wrapper_rel_cf_edge_4931a04c8c74bb72(4, *rel_cf_edge_4931a04c8c74bb72, *this, "cf_edge", std::array<const char *,3>{{"s:Function","i:Statement","i:Statement"}}, std::array<const char *,3>{{"f","s1","s2"}}, 0),
|
1773 | rel_use_e955e932f22dad4d(mk<t_btree_iii__0_1_2__111::Type>()),
|
1774 | wrapper_rel_use_e955e932f22dad4d(5, *rel_use_e955e932f22dad4d, *this, "use", std::array<const char *,3>{{"s:Function","i:Statement","+:Reference"}}, std::array<const char *,3>{{"f","s","r"}}, 0),
|
1775 | rel_live_vars_in_0b002b95687eda95(mk<t_btree_iii__0_1_2__111::Type>()),
|
1776 | wrapper_rel_live_vars_in_0b002b95687eda95(6, *rel_live_vars_in_0b002b95687eda95, *this, "live_vars_in", std::array<const char *,3>{{"s:Function","i:Statement","+:Reference"}}, std::array<const char *,3>{{"f","s","r"}}, 0),
|
1777 | rel_delta_live_vars_in_fccc4ee6df066f63(mk<t_btree_iii__0_1_2__110__111::Type>()),
|
1778 | rel_new_live_vars_in_0b01be53183b2351(mk<t_btree_iii__0_1_2__110__111::Type>()),
|
1779 | rel_live_vars_out_f94306e028b67aa4(mk<t_btree_iii__0_1_2__110__111::Type>()),
|
1780 | wrapper_rel_live_vars_out_f94306e028b67aa4(7, *rel_live_vars_out_f94306e028b67aa4, *this, "live_vars_out", std::array<const char *,3>{{"s:Function","i:Statement","+:Reference"}}, std::array<const char *,3>{{"f","s","r"}}, 0),
|
1781 | rel_delta_live_vars_out_acc66913cea62d16(mk<t_btree_iii__0_1_2__111::Type>()),
|
1782 | rel_new_live_vars_out_2d78073638bb3740(mk<t_btree_iii__0_1_2__111::Type>()),
|
1783 | rel_stack_root_vars_a138611bd47fd3ff(mk<t_btree_ii__0_1__11::Type>()),
|
1784 | wrapper_rel_stack_root_vars_a138611bd47fd3ff(8, *rel_stack_root_vars_a138611bd47fd3ff, *this, "stack_root_vars", std::array<const char *,2>{{"s:Function","+:Reference"}}, std::array<const char *,2>{{"f","r"}}, 0),
|
1785 | stratum_assign_f550d366a9215d2a(symTable,recordTable,regexCache,pruneImdtRels,performIO,signalHandler,iter,ctr,inputDirectory,outputDirectory,*rel_assign_e4bb6e0824a16a37),
|
1786 | stratum_bind_1968829e9243d389(symTable,recordTable,regexCache,pruneImdtRels,performIO,signalHandler,iter,ctr,inputDirectory,outputDirectory,*rel_bind_c9210fdc63280a40),
|
1787 | stratum_call_587d2d7effb5d130(symTable,recordTable,regexCache,pruneImdtRels,performIO,signalHandler,iter,ctr,inputDirectory,outputDirectory,*rel_call_ee1d8972d66cc25f),
|
1788 | stratum_cf_edge_4017fef287699967(symTable,recordTable,regexCache,pruneImdtRels,performIO,signalHandler,iter,ctr,inputDirectory,outputDirectory,*rel_cf_edge_4931a04c8c74bb72),
|
1789 | stratum_live_vars_in_c3dc49a4823a7f1e(symTable,recordTable,regexCache,pruneImdtRels,performIO,signalHandler,iter,ctr,inputDirectory,outputDirectory,*rel_delta_live_vars_in_fccc4ee6df066f63,*rel_delta_live_vars_out_acc66913cea62d16,*rel_new_live_vars_in_0b01be53183b2351,*rel_new_live_vars_out_2d78073638bb3740,*rel_assign_e4bb6e0824a16a37,*rel_cf_edge_4931a04c8c74bb72,*rel_live_vars_in_0b002b95687eda95,*rel_live_vars_out_f94306e028b67aa4,*rel_use_e955e932f22dad4d),
|
1790 | stratum_might_collect_cc50af26f53a71ac(symTable,recordTable,regexCache,pruneImdtRels,performIO,signalHandler,iter,ctr,inputDirectory,outputDirectory,*rel_delta_might_collect_d651f71586aafe59,*rel_new_might_collect_5d48ef45a97e4618,*rel_call_ee1d8972d66cc25f,*rel_might_collect_ef1d0b06d36e4ddc),
|
1791 | stratum_stack_root_vars_49e4f510c537163e(symTable,recordTable,regexCache,pruneImdtRels,performIO,signalHandler,iter,ctr,inputDirectory,outputDirectory,*rel_assign_e4bb6e0824a16a37,*rel_bind_c9210fdc63280a40,*rel_live_vars_out_f94306e028b67aa4,*rel_might_collect_ef1d0b06d36e4ddc,*rel_stack_root_vars_a138611bd47fd3ff),
|
1792 | stratum_use_2e20cb5441769259(symTable,recordTable,regexCache,pruneImdtRels,performIO,signalHandler,iter,ctr,inputDirectory,outputDirectory,*rel_use_e955e932f22dad4d){
|
1793 | addRelation("assign", wrapper_rel_assign_e4bb6e0824a16a37, true, false);
|
1794 | addRelation("bind", wrapper_rel_bind_c9210fdc63280a40, true, false);
|
1795 | addRelation("call", wrapper_rel_call_ee1d8972d66cc25f, true, false);
|
1796 | addRelation("might_collect", wrapper_rel_might_collect_ef1d0b06d36e4ddc, false, true);
|
1797 | addRelation("cf_edge", wrapper_rel_cf_edge_4931a04c8c74bb72, true, false);
|
1798 | addRelation("use", wrapper_rel_use_e955e932f22dad4d, true, false);
|
1799 | addRelation("live_vars_in", wrapper_rel_live_vars_in_0b002b95687eda95, false, false);
|
1800 | addRelation("live_vars_out", wrapper_rel_live_vars_out_f94306e028b67aa4, false, false);
|
1801 | addRelation("stack_root_vars", wrapper_rel_stack_root_vars_a138611bd47fd3ff, false, true);
|
1802 | }
|
1803 |
|
1804 | Sf__::~Sf__(){
|
1805 | }
|
1806 |
|
1807 | void Sf__::runFunction(std::string inputDirectoryArg,std::string outputDirectoryArg,bool performIOArg,bool pruneImdtRelsArg){
|
1808 |
|
1809 | this->inputDirectory = std::move(inputDirectoryArg);
|
1810 | this->outputDirectory = std::move(outputDirectoryArg);
|
1811 | this->performIO = performIOArg;
|
1812 | this->pruneImdtRels = pruneImdtRelsArg;
|
1813 |
|
1814 | // set default threads (in embedded mode)
|
1815 | // if this is not set, and omp is used, the default omp setting of number of cores is used.
|
1816 | #if defined(_OPENMP)
|
1817 | if (0 < getNumThreads()) { omp_set_num_threads(static_cast<int>(getNumThreads())); }
|
1818 | #endif
|
1819 |
|
1820 | signalHandler->set();
|
1821 | // -- query evaluation --
|
1822 | {
|
1823 | std::vector<RamDomain> args, ret;
|
1824 | stratum_assign_f550d366a9215d2a.run(args, ret);
|
1825 | }
|
1826 | {
|
1827 | std::vector<RamDomain> args, ret;
|
1828 | stratum_bind_1968829e9243d389.run(args, ret);
|
1829 | }
|
1830 | {
|
1831 | std::vector<RamDomain> args, ret;
|
1832 | stratum_call_587d2d7effb5d130.run(args, ret);
|
1833 | }
|
1834 | {
|
1835 | std::vector<RamDomain> args, ret;
|
1836 | stratum_might_collect_cc50af26f53a71ac.run(args, ret);
|
1837 | }
|
1838 | {
|
1839 | std::vector<RamDomain> args, ret;
|
1840 | stratum_cf_edge_4017fef287699967.run(args, ret);
|
1841 | }
|
1842 | {
|
1843 | std::vector<RamDomain> args, ret;
|
1844 | stratum_use_2e20cb5441769259.run(args, ret);
|
1845 | }
|
1846 | {
|
1847 | std::vector<RamDomain> args, ret;
|
1848 | stratum_live_vars_in_c3dc49a4823a7f1e.run(args, ret);
|
1849 | }
|
1850 | {
|
1851 | std::vector<RamDomain> args, ret;
|
1852 | stratum_stack_root_vars_49e4f510c537163e.run(args, ret);
|
1853 | }
|
1854 |
|
1855 | // -- relation hint statistics --
|
1856 | signalHandler->reset();
|
1857 | }
|
1858 |
|
1859 | void Sf__::run(){
|
1860 | runFunction("", "", false, false);
|
1861 | }
|
1862 |
|
1863 | void Sf__::runAll(std::string inputDirectoryArg,std::string outputDirectoryArg,bool performIOArg,bool pruneImdtRelsArg){
|
1864 | runFunction(inputDirectoryArg, outputDirectoryArg, performIOArg, pruneImdtRelsArg);
|
1865 | }
|
1866 |
|
1867 | void Sf__::printAll([[maybe_unused]] std::string outputDirectoryArg){
|
1868 | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","f\ts"},{"auxArity","0"},{"name","might_collect"},{"operation","output"},{"output-dir","."},{"params","{\"records\": {}, \"relation\": {\"arity\": 2, \"params\": [\"f\", \"s\"]}}"},{"types","{\"ADTs\": {\"+:Reference\": {\"arity\": 2, \"branches\": [{\"name\": \"LocalVariable\", \"types\": [\"s:Function\", \"s:symbol\"]}, {\"name\": \"ObjectMember\", \"types\": [\"s:symbol\", \"s:symbol\"]}], \"enum\": false}, \"+:Value\": {\"arity\": 3, \"branches\": [{\"name\": \"Empty\", \"types\": []}, {\"name\": \"HeapObject\", \"types\": [\"s:symbol\"]}, {\"name\": \"Ref\", \"types\": [\"+:Reference\"]}], \"enum\": false}}, \"records\": {}, \"relation\": {\"arity\": 2, \"types\": [\"s:Function\", \"i:Statement\"]}}"}});
|
1869 | if (!outputDirectoryArg.empty()) {directiveMap["output-dir"] = outputDirectoryArg;}
|
1870 | IOSystem::getInstance().getWriter(directiveMap, symTable, recordTable)->writeAll(*rel_might_collect_ef1d0b06d36e4ddc);
|
1871 | } catch (std::exception& e) {std::cerr << e.what();exit(1);}
|
1872 | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","f\tr"},{"auxArity","0"},{"delimeter","\t"},{"filename","stack_root_vars.tsv"},{"name","stack_root_vars"},{"operation","output"},{"output-dir","."},{"params","{\"records\": {}, \"relation\": {\"arity\": 2, \"params\": [\"f\", \"r\"]}}"},{"types","{\"ADTs\": {\"+:Reference\": {\"arity\": 2, \"branches\": [{\"name\": \"LocalVariable\", \"types\": [\"s:Function\", \"s:symbol\"]}, {\"name\": \"ObjectMember\", \"types\": [\"s:symbol\", \"s:symbol\"]}], \"enum\": false}, \"+:Value\": {\"arity\": 3, \"branches\": [{\"name\": \"Empty\", \"types\": []}, {\"name\": \"HeapObject\", \"types\": [\"s:symbol\"]}, {\"name\": \"Ref\", \"types\": [\"+:Reference\"]}], \"enum\": false}}, \"records\": {}, \"relation\": {\"arity\": 2, \"types\": [\"s:Function\", \"+:Reference\"]}}"}});
|
1873 | if (!outputDirectoryArg.empty()) {directiveMap["output-dir"] = outputDirectoryArg;}
|
1874 | IOSystem::getInstance().getWriter(directiveMap, symTable, recordTable)->writeAll(*rel_stack_root_vars_a138611bd47fd3ff);
|
1875 | } catch (std::exception& e) {std::cerr << e.what();exit(1);}
|
1876 | }
|
1877 |
|
1878 | void Sf__::loadAll([[maybe_unused]] std::string inputDirectoryArg){
|
1879 | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","caller\ts\tr\tcallee\tparam"},{"auxArity","0"},{"fact-dir","."},{"name","bind"},{"operation","input"},{"params","{\"records\": {}, \"relation\": {\"arity\": 5, \"params\": [\"caller\", \"s\", \"r\", \"callee\", \"param\"]}}"},{"types","{\"ADTs\": {\"+:Reference\": {\"arity\": 2, \"branches\": [{\"name\": \"LocalVariable\", \"types\": [\"s:Function\", \"s:symbol\"]}, {\"name\": \"ObjectMember\", \"types\": [\"s:symbol\", \"s:symbol\"]}], \"enum\": false}, \"+:Value\": {\"arity\": 3, \"branches\": [{\"name\": \"Empty\", \"types\": []}, {\"name\": \"HeapObject\", \"types\": [\"s:symbol\"]}, {\"name\": \"Ref\", \"types\": [\"+:Reference\"]}], \"enum\": false}}, \"records\": {}, \"relation\": {\"arity\": 5, \"types\": [\"s:Function\", \"i:Statement\", \"+:Reference\", \"s:Function\", \"s:symbol\"]}}"}});
|
1880 | if (!inputDirectoryArg.empty()) {directiveMap["fact-dir"] = inputDirectoryArg;}
|
1881 | IOSystem::getInstance().getReader(directiveMap, symTable, recordTable)->readAll(*rel_bind_c9210fdc63280a40);
|
1882 | } catch (std::exception& e) {std::cerr << "Error loading bind data: " << e.what() << '\n';
|
1883 | exit(1);
|
1884 | }
|
1885 | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","caller\ts\tcallee"},{"auxArity","0"},{"fact-dir","."},{"name","call"},{"operation","input"},{"params","{\"records\": {}, \"relation\": {\"arity\": 3, \"params\": [\"caller\", \"s\", \"callee\"]}}"},{"types","{\"ADTs\": {\"+:Reference\": {\"arity\": 2, \"branches\": [{\"name\": \"LocalVariable\", \"types\": [\"s:Function\", \"s:symbol\"]}, {\"name\": \"ObjectMember\", \"types\": [\"s:symbol\", \"s:symbol\"]}], \"enum\": false}, \"+:Value\": {\"arity\": 3, \"branches\": [{\"name\": \"Empty\", \"types\": []}, {\"name\": \"HeapObject\", \"types\": [\"s:symbol\"]}, {\"name\": \"Ref\", \"types\": [\"+:Reference\"]}], \"enum\": false}}, \"records\": {}, \"relation\": {\"arity\": 3, \"types\": [\"s:Function\", \"i:Statement\", \"s:Function\"]}}"}});
|
1886 | if (!inputDirectoryArg.empty()) {directiveMap["fact-dir"] = inputDirectoryArg;}
|
1887 | IOSystem::getInstance().getReader(directiveMap, symTable, recordTable)->readAll(*rel_call_ee1d8972d66cc25f);
|
1888 | } catch (std::exception& e) {std::cerr << "Error loading call data: " << e.what() << '\n';
|
1889 | exit(1);
|
1890 | }
|
1891 | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","f\ts\tr\tv"},{"auxArity","0"},{"fact-dir","."},{"name","assign"},{"operation","input"},{"params","{\"records\": {}, \"relation\": {\"arity\": 4, \"params\": [\"f\", \"s\", \"r\", \"v\"]}}"},{"types","{\"ADTs\": {\"+:Reference\": {\"arity\": 2, \"branches\": [{\"name\": \"LocalVariable\", \"types\": [\"s:Function\", \"s:symbol\"]}, {\"name\": \"ObjectMember\", \"types\": [\"s:symbol\", \"s:symbol\"]}], \"enum\": false}, \"+:Value\": {\"arity\": 3, \"branches\": [{\"name\": \"Empty\", \"types\": []}, {\"name\": \"HeapObject\", \"types\": [\"s:symbol\"]}, {\"name\": \"Ref\", \"types\": [\"+:Reference\"]}], \"enum\": false}}, \"records\": {}, \"relation\": {\"arity\": 4, \"types\": [\"s:Function\", \"i:Statement\", \"+:Reference\", \"+:Value\"]}}"}});
|
1892 | if (!inputDirectoryArg.empty()) {directiveMap["fact-dir"] = inputDirectoryArg;}
|
1893 | IOSystem::getInstance().getReader(directiveMap, symTable, recordTable)->readAll(*rel_assign_e4bb6e0824a16a37);
|
1894 | } catch (std::exception& e) {std::cerr << "Error loading assign data: " << e.what() << '\n';
|
1895 | exit(1);
|
1896 | }
|
1897 | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","f\ts1\ts2"},{"auxArity","0"},{"fact-dir","."},{"name","cf_edge"},{"operation","input"},{"params","{\"records\": {}, \"relation\": {\"arity\": 3, \"params\": [\"f\", \"s1\", \"s2\"]}}"},{"types","{\"ADTs\": {\"+:Reference\": {\"arity\": 2, \"branches\": [{\"name\": \"LocalVariable\", \"types\": [\"s:Function\", \"s:symbol\"]}, {\"name\": \"ObjectMember\", \"types\": [\"s:symbol\", \"s:symbol\"]}], \"enum\": false}, \"+:Value\": {\"arity\": 3, \"branches\": [{\"name\": \"Empty\", \"types\": []}, {\"name\": \"HeapObject\", \"types\": [\"s:symbol\"]}, {\"name\": \"Ref\", \"types\": [\"+:Reference\"]}], \"enum\": false}}, \"records\": {}, \"relation\": {\"arity\": 3, \"types\": [\"s:Function\", \"i:Statement\", \"i:Statement\"]}}"}});
|
1898 | if (!inputDirectoryArg.empty()) {directiveMap["fact-dir"] = inputDirectoryArg;}
|
1899 | IOSystem::getInstance().getReader(directiveMap, symTable, recordTable)->readAll(*rel_cf_edge_4931a04c8c74bb72);
|
1900 | } catch (std::exception& e) {std::cerr << "Error loading cf_edge data: " << e.what() << '\n';
|
1901 | exit(1);
|
1902 | }
|
1903 | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","f\ts\tr"},{"auxArity","0"},{"fact-dir","."},{"name","use"},{"operation","input"},{"params","{\"records\": {}, \"relation\": {\"arity\": 3, \"params\": [\"f\", \"s\", \"r\"]}}"},{"types","{\"ADTs\": {\"+:Reference\": {\"arity\": 2, \"branches\": [{\"name\": \"LocalVariable\", \"types\": [\"s:Function\", \"s:symbol\"]}, {\"name\": \"ObjectMember\", \"types\": [\"s:symbol\", \"s:symbol\"]}], \"enum\": false}, \"+:Value\": {\"arity\": 3, \"branches\": [{\"name\": \"Empty\", \"types\": []}, {\"name\": \"HeapObject\", \"types\": [\"s:symbol\"]}, {\"name\": \"Ref\", \"types\": [\"+:Reference\"]}], \"enum\": false}}, \"records\": {}, \"relation\": {\"arity\": 3, \"types\": [\"s:Function\", \"i:Statement\", \"+:Reference\"]}}"}});
|
1904 | if (!inputDirectoryArg.empty()) {directiveMap["fact-dir"] = inputDirectoryArg;}
|
1905 | IOSystem::getInstance().getReader(directiveMap, symTable, recordTable)->readAll(*rel_use_e955e932f22dad4d);
|
1906 | } catch (std::exception& e) {std::cerr << "Error loading use data: " << e.what() << '\n';
|
1907 | exit(1);
|
1908 | }
|
1909 | }
|
1910 |
|
1911 | void Sf__::dumpInputs(){
|
1912 | try {std::map<std::string, std::string> rwOperation;
|
1913 | rwOperation["IO"] = "stdout";
|
1914 | rwOperation["name"] = "bind";
|
1915 | rwOperation["types"] = "{\"relation\": {\"arity\": 5, \"auxArity\": 0, \"types\": [\"s:Function\", \"i:Statement\", \"+:Reference\", \"s:Function\", \"s:symbol\"]}}";
|
1916 | IOSystem::getInstance().getWriter(rwOperation, symTable, recordTable)->writeAll(*rel_bind_c9210fdc63280a40);
|
1917 | } catch (std::exception& e) {std::cerr << e.what();exit(1);}
|
1918 | try {std::map<std::string, std::string> rwOperation;
|
1919 | rwOperation["IO"] = "stdout";
|
1920 | rwOperation["name"] = "call";
|
1921 | rwOperation["types"] = "{\"relation\": {\"arity\": 3, \"auxArity\": 0, \"types\": [\"s:Function\", \"i:Statement\", \"s:Function\"]}}";
|
1922 | IOSystem::getInstance().getWriter(rwOperation, symTable, recordTable)->writeAll(*rel_call_ee1d8972d66cc25f);
|
1923 | } catch (std::exception& e) {std::cerr << e.what();exit(1);}
|
1924 | try {std::map<std::string, std::string> rwOperation;
|
1925 | rwOperation["IO"] = "stdout";
|
1926 | rwOperation["name"] = "assign";
|
1927 | rwOperation["types"] = "{\"relation\": {\"arity\": 4, \"auxArity\": 0, \"types\": [\"s:Function\", \"i:Statement\", \"+:Reference\", \"+:Value\"]}}";
|
1928 | IOSystem::getInstance().getWriter(rwOperation, symTable, recordTable)->writeAll(*rel_assign_e4bb6e0824a16a37);
|
1929 | } catch (std::exception& e) {std::cerr << e.what();exit(1);}
|
1930 | try {std::map<std::string, std::string> rwOperation;
|
1931 | rwOperation["IO"] = "stdout";
|
1932 | rwOperation["name"] = "cf_edge";
|
1933 | rwOperation["types"] = "{\"relation\": {\"arity\": 3, \"auxArity\": 0, \"types\": [\"s:Function\", \"i:Statement\", \"i:Statement\"]}}";
|
1934 | IOSystem::getInstance().getWriter(rwOperation, symTable, recordTable)->writeAll(*rel_cf_edge_4931a04c8c74bb72);
|
1935 | } catch (std::exception& e) {std::cerr << e.what();exit(1);}
|
1936 | try {std::map<std::string, std::string> rwOperation;
|
1937 | rwOperation["IO"] = "stdout";
|
1938 | rwOperation["name"] = "use";
|
1939 | rwOperation["types"] = "{\"relation\": {\"arity\": 3, \"auxArity\": 0, \"types\": [\"s:Function\", \"i:Statement\", \"+:Reference\"]}}";
|
1940 | IOSystem::getInstance().getWriter(rwOperation, symTable, recordTable)->writeAll(*rel_use_e955e932f22dad4d);
|
1941 | } catch (std::exception& e) {std::cerr << e.what();exit(1);}
|
1942 | }
|
1943 |
|
1944 | void Sf__::dumpOutputs(){
|
1945 | try {std::map<std::string, std::string> rwOperation;
|
1946 | rwOperation["IO"] = "stdout";
|
1947 | rwOperation["name"] = "might_collect";
|
1948 | rwOperation["types"] = "{\"relation\": {\"arity\": 2, \"auxArity\": 0, \"types\": [\"s:Function\", \"i:Statement\"]}}";
|
1949 | IOSystem::getInstance().getWriter(rwOperation, symTable, recordTable)->writeAll(*rel_might_collect_ef1d0b06d36e4ddc);
|
1950 | } catch (std::exception& e) {std::cerr << e.what();exit(1);}
|
1951 | try {std::map<std::string, std::string> rwOperation;
|
1952 | rwOperation["IO"] = "stdout";
|
1953 | rwOperation["name"] = "stack_root_vars";
|
1954 | rwOperation["types"] = "{\"relation\": {\"arity\": 2, \"auxArity\": 0, \"types\": [\"s:Function\", \"+:Reference\"]}}";
|
1955 | IOSystem::getInstance().getWriter(rwOperation, symTable, recordTable)->writeAll(*rel_stack_root_vars_a138611bd47fd3ff);
|
1956 | } catch (std::exception& e) {std::cerr << e.what();exit(1);}
|
1957 | }
|
1958 |
|
1959 | SymbolTable& Sf__::getSymbolTable(){
|
1960 | return symTable;
|
1961 | }
|
1962 |
|
1963 | RecordTable& Sf__::getRecordTable(){
|
1964 | return recordTable;
|
1965 | }
|
1966 |
|
1967 | void Sf__::setNumThreads(std::size_t numThreadsValue){
|
1968 | SouffleProgram::setNumThreads(numThreadsValue);
|
1969 | symTable.setNumLanes(getNumThreads());
|
1970 | recordTable.setNumLanes(getNumThreads());
|
1971 | regexCache.setNumLanes(getNumThreads());
|
1972 | }
|
1973 |
|
1974 | void Sf__::executeSubroutine(std::string name,const std::vector<RamDomain>& args,std::vector<RamDomain>& ret){
|
1975 | if (name == "assign") {
|
1976 | stratum_assign_f550d366a9215d2a.run(args, ret);
|
1977 | return;}
|
1978 | if (name == "bind") {
|
1979 | stratum_bind_1968829e9243d389.run(args, ret);
|
1980 | return;}
|
1981 | if (name == "call") {
|
1982 | stratum_call_587d2d7effb5d130.run(args, ret);
|
1983 | return;}
|
1984 | if (name == "cf_edge") {
|
1985 | stratum_cf_edge_4017fef287699967.run(args, ret);
|
1986 | return;}
|
1987 | if (name == "live_vars_in") {
|
1988 | stratum_live_vars_in_c3dc49a4823a7f1e.run(args, ret);
|
1989 | return;}
|
1990 | if (name == "might_collect") {
|
1991 | stratum_might_collect_cc50af26f53a71ac.run(args, ret);
|
1992 | return;}
|
1993 | if (name == "stack_root_vars") {
|
1994 | stratum_stack_root_vars_49e4f510c537163e.run(args, ret);
|
1995 | return;}
|
1996 | if (name == "use") {
|
1997 | stratum_use_2e20cb5441769259.run(args, ret);
|
1998 | return;}
|
1999 | fatal(("unknown subroutine " + name).c_str());
|
2000 | }
|
2001 |
|
2002 | } // namespace souffle
|
2003 | namespace souffle {
|
2004 | SouffleProgram *newInstance__(){return new souffle::Sf__;}
|
2005 | SymbolTable *getST__(SouffleProgram *p){return &reinterpret_cast<souffle::Sf__*>(p)->getSymbolTable();}
|
2006 | } // namespace souffle
|
2007 |
|
2008 | #ifndef __EMBEDDED_SOUFFLE__
|
2009 | #include "souffle/CompiledOptions.h"
|
2010 | int main(int argc, char** argv)
|
2011 | {
|
2012 | try{
|
2013 | souffle::CmdOptions opt(R"(mycpp/datalog/dataflow.dl)",
|
2014 | R"()",
|
2015 | R"()",
|
2016 | false,
|
2017 | R"()",
|
2018 | 1);
|
2019 | if (!opt.parse(argc,argv)) return 1;
|
2020 | souffle::Sf__ obj;
|
2021 | #if defined(_OPENMP)
|
2022 | obj.setNumThreads(opt.getNumJobs());
|
2023 |
|
2024 | #endif
|
2025 | obj.runAll(opt.getInputFileDir(), opt.getOutputFileDir());
|
2026 | return 0;
|
2027 | } catch(std::exception &e) { souffle::SignalHandler::instance()->error(e.what());}
|
2028 | }
|
2029 | #endif
|
2030 |
|
2031 | namespace souffle {
|
2032 | using namespace souffle;
|
2033 | class factory_Sf__: souffle::ProgramFactory {
|
2034 | public:
|
2035 | souffle::SouffleProgram* newInstance();
|
2036 | factory_Sf__();
|
2037 | private:
|
2038 | };
|
2039 | } // namespace souffle
|
2040 | namespace souffle {
|
2041 | using namespace souffle;
|
2042 | souffle::SouffleProgram* factory_Sf__::newInstance(){
|
2043 | return new souffle::Sf__();
|
2044 | }
|
2045 |
|
2046 | factory_Sf__::factory_Sf__():
|
2047 | souffle::ProgramFactory("_"){
|
2048 | }
|
2049 |
|
2050 | } // namespace souffle
|
2051 | namespace souffle {
|
2052 |
|
2053 | #ifdef __EMBEDDED_SOUFFLE__
|
2054 | extern "C" {
|
2055 | souffle::factory_Sf__ __factory_Sf___instance;
|
2056 | }
|
2057 | #endif
|
2058 | } // namespace souffle
|
2059 |
|