| 1 | + | #define SOUFFLE_GENERATOR_VERSION "2.4-1-g15b114abf" |
| 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_ii__0_1__11 { |
| 13 | + | using namespace souffle; |
| 14 | + | struct Type { |
| 15 | + | static constexpr Relation::arity_type Arity = 2; |
| 16 | + | using t_tuple = Tuple<RamDomain, 2>; |
| 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 :(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])))); |
| 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])); |
| 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); |
| 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_00(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const; |
| 46 | + | range<iterator> lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */) const; |
| 47 | + | range<t_ind_0::iterator> lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper, context& h) const; |
| 48 | + | range<t_ind_0::iterator> lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper) const; |
| 49 | + | bool empty() const; |
| 50 | + | std::vector<range<iterator>> partition() const; |
| 51 | + | void purge(); |
| 52 | + | iterator begin() const; |
| 53 | + | iterator end() const; |
| 54 | + | void printStatistics(std::ostream& o) const; |
| 55 | + | }; |
| 56 | + | } // namespace souffle::t_btree_ii__0_1__11 |
| 57 | + | namespace souffle::t_btree_ii__0_1__11 { |
| 58 | + | using namespace souffle; |
| 59 | + | using t_ind_0 = Type::t_ind_0; |
| 60 | + | using iterator = Type::iterator; |
| 61 | + | using context = Type::context; |
| 62 | + | bool Type::insert(const t_tuple& t) { |
| 63 | + | context h; |
| 64 | + | return insert(t, h); |
| 65 | + | } |
| 66 | + | bool Type::insert(const t_tuple& t, context& h) { |
| 67 | + | if (ind_0.insert(t, h.hints_0_lower)) { |
| 68 | + | return true; |
| 69 | + | } else return false; |
| 70 | + | } |
| 71 | + | bool Type::insert(const RamDomain* ramDomain) { |
| 72 | + | RamDomain data[2]; |
| 73 | + | std::copy(ramDomain, ramDomain + 2, data); |
| 74 | + | const t_tuple& tuple = reinterpret_cast<const t_tuple&>(data); |
| 75 | + | context h; |
| 76 | + | return insert(tuple, h); |
| 77 | + | } |
| 78 | + | bool Type::insert(RamDomain a0,RamDomain a1) { |
| 79 | + | RamDomain data[2] = {a0,a1}; |
| 80 | + | return insert(data); |
| 81 | + | } |
| 82 | + | bool Type::contains(const t_tuple& t, context& h) const { |
| 83 | + | return ind_0.contains(t, h.hints_0_lower); |
| 84 | + | } |
| 85 | + | bool Type::contains(const t_tuple& t) const { |
| 86 | + | context h; |
| 87 | + | return contains(t, h); |
| 88 | + | } |
| 89 | + | std::size_t Type::size() const { |
| 90 | + | return ind_0.size(); |
| 91 | + | } |
| 92 | + | iterator Type::find(const t_tuple& t, context& h) const { |
| 93 | + | return ind_0.find(t, h.hints_0_lower); |
| 94 | + | } |
| 95 | + | iterator Type::find(const t_tuple& t) const { |
| 96 | + | context h; |
| 97 | + | return find(t, h); |
| 98 | + | } |
| 99 | + | range<iterator> Type::lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const { |
| 100 | + | return range<iterator>(ind_0.begin(),ind_0.end()); |
| 101 | + | } |
| 102 | + | range<iterator> Type::lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */) const { |
| 103 | + | return range<iterator>(ind_0.begin(),ind_0.end()); |
| 104 | + | } |
| 105 | + | range<t_ind_0::iterator> Type::lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper, context& h) const { |
| 106 | + | t_comparator_0 comparator; |
| 107 | + | int cmp = comparator(lower, upper); |
| 108 | + | if (cmp == 0) { |
| 109 | + | auto pos = ind_0.find(lower, h.hints_0_lower); |
| 110 | + | auto fin = ind_0.end(); |
| 111 | + | if (pos != fin) {fin = pos; ++fin;} |
| 112 | + | return make_range(pos, fin); |
| 113 | + | } |
| 114 | + | if (cmp > 0) { |
| 115 | + | return make_range(ind_0.end(), ind_0.end()); |
| 116 | + | } |
| 117 | + | return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper)); |
| 118 | + | } |
| 119 | + | range<t_ind_0::iterator> Type::lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper) const { |
| 120 | + | context h; |
| 121 | + | return lowerUpperRange_11(lower,upper,h); |
| 122 | + | } |
| 123 | + | bool Type::empty() const { |
| 124 | + | return ind_0.empty(); |
| 125 | + | } |
| 126 | + | std::vector<range<iterator>> Type::partition() const { |
| 127 | + | return ind_0.getChunks(400); |
| 128 | + | } |
| 129 | + | void Type::purge() { |
| 130 | + | ind_0.clear(); |
| 131 | + | } |
| 132 | + | iterator Type::begin() const { |
| 133 | + | return ind_0.begin(); |
| 134 | + | } |
| 135 | + | iterator Type::end() const { |
| 136 | + | return ind_0.end(); |
| 137 | + | } |
| 138 | + | void Type::printStatistics(std::ostream& o) const { |
| 139 | + | o << " arity 2 direct b-tree index 0 lex-order [0,1]\n"; |
| 140 | + | ind_0.printStats(o); |
| 141 | + | } |
| 142 | + | } // namespace souffle::t_btree_ii__0_1__11 |
| 143 | + | namespace souffle::t_btree_iii__0_2_1__101__111 { |
| 144 | + | using namespace souffle; |
| 145 | + | struct Type { |
| 146 | + | static constexpr Relation::arity_type Arity = 3; |
| 147 | + | using t_tuple = Tuple<RamDomain, 3>; |
| 148 | + | struct t_comparator_0{ |
| 149 | + | int operator()(const t_tuple& a, const t_tuple& b) const { |
| 150 | + | return (ramBitCast<RamSigned>(a[0]) < ramBitCast<RamSigned>(b[0])) ? -1 : (ramBitCast<RamSigned>(a[0]) > ramBitCast<RamSigned>(b[0])) ? 1 :((ramBitCast<RamSigned>(a[2]) < ramBitCast<RamSigned>(b[2])) ? -1 : (ramBitCast<RamSigned>(a[2]) > ramBitCast<RamSigned>(b[2])) ? 1 :((ramBitCast<RamSigned>(a[1]) < ramBitCast<RamSigned>(b[1])) ? -1 : (ramBitCast<RamSigned>(a[1]) > ramBitCast<RamSigned>(b[1])) ? 1 :(0))); |
| 151 | + | } |
| 152 | + | bool less(const t_tuple& a, const t_tuple& b) const { |
| 153 | + | return (ramBitCast<RamSigned>(a[0]) < ramBitCast<RamSigned>(b[0]))|| ((ramBitCast<RamSigned>(a[0]) == ramBitCast<RamSigned>(b[0])) && ((ramBitCast<RamSigned>(a[2]) < ramBitCast<RamSigned>(b[2]))|| ((ramBitCast<RamSigned>(a[2]) == ramBitCast<RamSigned>(b[2])) && ((ramBitCast<RamSigned>(a[1]) < ramBitCast<RamSigned>(b[1])))))); |
| 154 | + | } |
| 155 | + | bool equal(const t_tuple& a, const t_tuple& b) const { |
| 156 | + | return (ramBitCast<RamSigned>(a[0]) == ramBitCast<RamSigned>(b[0]))&&(ramBitCast<RamSigned>(a[2]) == ramBitCast<RamSigned>(b[2]))&&(ramBitCast<RamSigned>(a[1]) == ramBitCast<RamSigned>(b[1])); |
| 157 | + | } |
| 158 | + | }; |
| 159 | + | using t_ind_0 = btree_set<t_tuple,t_comparator_0>; |
| 160 | + | t_ind_0 ind_0; |
| 161 | + | using iterator = t_ind_0::iterator; |
| 162 | + | struct context { |
| 163 | + | t_ind_0::operation_hints hints_0_lower; |
| 164 | + | t_ind_0::operation_hints hints_0_upper; |
| 165 | + | }; |
| 166 | + | context createContext() { return context(); } |
| 167 | + | bool insert(const t_tuple& t); |
| 168 | + | bool insert(const t_tuple& t, context& h); |
| 169 | + | bool insert(const RamDomain* ramDomain); |
| 170 | + | bool insert(RamDomain a0,RamDomain a1,RamDomain a2); |
| 171 | + | bool contains(const t_tuple& t, context& h) const; |
| 172 | + | bool contains(const t_tuple& t) const; |
| 173 | + | std::size_t size() const; |
| 174 | + | iterator find(const t_tuple& t, context& h) const; |
| 175 | + | iterator find(const t_tuple& t) const; |
| 176 | + | range<iterator> lowerUpperRange_000(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const; |
| 177 | + | range<iterator> lowerUpperRange_000(const t_tuple& /* lower */, const t_tuple& /* upper */) const; |
| 178 | + | range<t_ind_0::iterator> lowerUpperRange_101(const t_tuple& lower, const t_tuple& upper, context& h) const; |
| 179 | + | range<t_ind_0::iterator> lowerUpperRange_101(const t_tuple& lower, const t_tuple& upper) const; |
| 180 | + | range<t_ind_0::iterator> lowerUpperRange_111(const t_tuple& lower, const t_tuple& upper, context& h) const; |
| 181 | + | range<t_ind_0::iterator> lowerUpperRange_111(const t_tuple& lower, const t_tuple& upper) const; |
| 182 | + | bool empty() const; |
| 183 | + | std::vector<range<iterator>> partition() const; |
| 184 | + | void purge(); |
| 185 | + | iterator begin() const; |
| 186 | + | iterator end() const; |
| 187 | + | void printStatistics(std::ostream& o) const; |
| 188 | + | }; |
| 189 | + | } // namespace souffle::t_btree_iii__0_2_1__101__111 |
| 190 | + | namespace souffle::t_btree_iii__0_2_1__101__111 { |
| 191 | + | using namespace souffle; |
| 192 | + | using t_ind_0 = Type::t_ind_0; |
| 193 | + | using iterator = Type::iterator; |
| 194 | + | using context = Type::context; |
| 195 | + | bool Type::insert(const t_tuple& t) { |
| 196 | + | context h; |
| 197 | + | return insert(t, h); |
| 198 | + | } |
| 199 | + | bool Type::insert(const t_tuple& t, context& h) { |
| 200 | + | if (ind_0.insert(t, h.hints_0_lower)) { |
| 201 | + | return true; |
| 202 | + | } else return false; |
| 203 | + | } |
| 204 | + | bool Type::insert(const RamDomain* ramDomain) { |
| 205 | + | RamDomain data[3]; |
| 206 | + | std::copy(ramDomain, ramDomain + 3, data); |
| 207 | + | const t_tuple& tuple = reinterpret_cast<const t_tuple&>(data); |
| 208 | + | context h; |
| 209 | + | return insert(tuple, h); |
| 210 | + | } |
| 211 | + | bool Type::insert(RamDomain a0,RamDomain a1,RamDomain a2) { |
| 212 | + | RamDomain data[3] = {a0,a1,a2}; |
| 213 | + | return insert(data); |
| 214 | + | } |
| 215 | + | bool Type::contains(const t_tuple& t, context& h) const { |
| 216 | + | return ind_0.contains(t, h.hints_0_lower); |
| 217 | + | } |
| 218 | + | bool Type::contains(const t_tuple& t) const { |
| 219 | + | context h; |
| 220 | + | return contains(t, h); |
| 221 | + | } |
| 222 | + | std::size_t Type::size() const { |
| 223 | + | return ind_0.size(); |
| 224 | + | } |
| 225 | + | iterator Type::find(const t_tuple& t, context& h) const { |
| 226 | + | return ind_0.find(t, h.hints_0_lower); |
| 227 | + | } |
| 228 | + | iterator Type::find(const t_tuple& t) const { |
| 229 | + | context h; |
| 230 | + | return find(t, h); |
| 231 | + | } |
| 232 | + | range<iterator> Type::lowerUpperRange_000(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const { |
| 233 | + | return range<iterator>(ind_0.begin(),ind_0.end()); |
| 234 | + | } |
| 235 | + | range<iterator> Type::lowerUpperRange_000(const t_tuple& /* lower */, const t_tuple& /* upper */) const { |
| 236 | + | return range<iterator>(ind_0.begin(),ind_0.end()); |
| 237 | + | } |
| 238 | + | range<t_ind_0::iterator> Type::lowerUpperRange_101(const t_tuple& lower, const t_tuple& upper, context& h) const { |
| 239 | + | t_comparator_0 comparator; |
| 240 | + | int cmp = comparator(lower, upper); |
| 241 | + | if (cmp > 0) { |
| 242 | + | return make_range(ind_0.end(), ind_0.end()); |
| 243 | + | } |
| 244 | + | return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper)); |
| 245 | + | } |
| 246 | + | range<t_ind_0::iterator> Type::lowerUpperRange_101(const t_tuple& lower, const t_tuple& upper) const { |
| 247 | + | context h; |
| 248 | + | return lowerUpperRange_101(lower,upper,h); |
| 249 | + | } |
| 250 | + | range<t_ind_0::iterator> Type::lowerUpperRange_111(const t_tuple& lower, const t_tuple& upper, context& h) const { |
| 251 | + | t_comparator_0 comparator; |
| 252 | + | int cmp = comparator(lower, upper); |
| 253 | + | if (cmp == 0) { |
| 254 | + | auto pos = ind_0.find(lower, h.hints_0_lower); |
| 255 | + | auto fin = ind_0.end(); |
| 256 | + | if (pos != fin) {fin = pos; ++fin;} |
| 257 | + | return make_range(pos, fin); |
| 258 | + | } |
| 259 | + | if (cmp > 0) { |
| 260 | + | return make_range(ind_0.end(), ind_0.end()); |
| 261 | + | } |
| 262 | + | return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper)); |
| 263 | + | } |
| 264 | + | range<t_ind_0::iterator> Type::lowerUpperRange_111(const t_tuple& lower, const t_tuple& upper) const { |
| 265 | + | context h; |
| 266 | + | return lowerUpperRange_111(lower,upper,h); |
| 267 | + | } |
| 268 | + | bool Type::empty() const { |
| 269 | + | return ind_0.empty(); |
| 270 | + | } |
| 271 | + | std::vector<range<iterator>> Type::partition() const { |
| 272 | + | return ind_0.getChunks(400); |
| 273 | + | } |
| 274 | + | void Type::purge() { |
| 275 | + | ind_0.clear(); |
| 276 | + | } |
| 277 | + | iterator Type::begin() const { |
| 278 | + | return ind_0.begin(); |
| 279 | + | } |
| 280 | + | iterator Type::end() const { |
| 281 | + | return ind_0.end(); |
| 282 | + | } |
| 283 | + | void Type::printStatistics(std::ostream& o) const { |
| 284 | + | o << " arity 3 direct b-tree index 0 lex-order [0,2,1]\n"; |
| 285 | + | ind_0.printStats(o); |
| 286 | + | } |
| 287 | + | } // namespace souffle::t_btree_iii__0_2_1__101__111 |
| 288 | + | namespace souffle::t_btree_ii__0_1__11__10 { |
| 289 | + | using namespace souffle; |
| 290 | + | struct Type { |
| 291 | + | static constexpr Relation::arity_type Arity = 2; |
| 292 | + | using t_tuple = Tuple<RamDomain, 2>; |
| 293 | + | struct t_comparator_0{ |
| 294 | + | int operator()(const t_tuple& a, const t_tuple& b) const { |
| 295 | + | 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)); |
| 296 | + | } |
| 297 | + | bool less(const t_tuple& a, const t_tuple& b) const { |
| 298 | + | 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])))); |
| 299 | + | } |
| 300 | + | bool equal(const t_tuple& a, const t_tuple& b) const { |
| 301 | + | return (ramBitCast<RamSigned>(a[0]) == ramBitCast<RamSigned>(b[0]))&&(ramBitCast<RamSigned>(a[1]) == ramBitCast<RamSigned>(b[1])); |
| 302 | + | } |
| 303 | + | }; |
| 304 | + | using t_ind_0 = btree_set<t_tuple,t_comparator_0>; |
| 305 | + | t_ind_0 ind_0; |
| 306 | + | using iterator = t_ind_0::iterator; |
| 307 | + | struct context { |
| 308 | + | t_ind_0::operation_hints hints_0_lower; |
| 309 | + | t_ind_0::operation_hints hints_0_upper; |
| 310 | + | }; |
| 311 | + | context createContext() { return context(); } |
| 312 | + | bool insert(const t_tuple& t); |
| 313 | + | bool insert(const t_tuple& t, context& h); |
| 314 | + | bool insert(const RamDomain* ramDomain); |
| 315 | + | bool insert(RamDomain a0,RamDomain a1); |
| 316 | + | bool contains(const t_tuple& t, context& h) const; |
| 317 | + | bool contains(const t_tuple& t) const; |
| 318 | + | std::size_t size() const; |
| 319 | + | iterator find(const t_tuple& t, context& h) const; |
| 320 | + | iterator find(const t_tuple& t) const; |
| 321 | + | range<iterator> lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const; |
| 322 | + | range<iterator> lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */) const; |
| 323 | + | range<t_ind_0::iterator> lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper, context& h) const; |
| 324 | + | range<t_ind_0::iterator> lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper) const; |
| 325 | + | range<t_ind_0::iterator> lowerUpperRange_10(const t_tuple& lower, const t_tuple& upper, context& h) const; |
| 326 | + | range<t_ind_0::iterator> lowerUpperRange_10(const t_tuple& lower, const t_tuple& upper) const; |
| 327 | + | bool empty() const; |
| 328 | + | std::vector<range<iterator>> partition() const; |
| 329 | + | void purge(); |
| 330 | + | iterator begin() const; |
| 331 | + | iterator end() const; |
| 332 | + | void printStatistics(std::ostream& o) const; |
| 333 | + | }; |
| 334 | + | } // namespace souffle::t_btree_ii__0_1__11__10 |
| 335 | + | namespace souffle::t_btree_ii__0_1__11__10 { |
| 336 | + | using namespace souffle; |
| 337 | + | using t_ind_0 = Type::t_ind_0; |
| 338 | + | using iterator = Type::iterator; |
| 339 | + | using context = Type::context; |
| 340 | + | bool Type::insert(const t_tuple& t) { |
| 341 | + | context h; |
| 342 | + | return insert(t, h); |
| 343 | + | } |
| 344 | + | bool Type::insert(const t_tuple& t, context& h) { |
| 345 | + | if (ind_0.insert(t, h.hints_0_lower)) { |
| 346 | + | return true; |
| 347 | + | } else return false; |
| 348 | + | } |
| 349 | + | bool Type::insert(const RamDomain* ramDomain) { |
| 350 | + | RamDomain data[2]; |
| 351 | + | std::copy(ramDomain, ramDomain + 2, data); |
| 352 | + | const t_tuple& tuple = reinterpret_cast<const t_tuple&>(data); |
| 353 | + | context h; |
| 354 | + | return insert(tuple, h); |
| 355 | + | } |
| 356 | + | bool Type::insert(RamDomain a0,RamDomain a1) { |
| 357 | + | RamDomain data[2] = {a0,a1}; |
| 358 | + | return insert(data); |
| 359 | + | } |
| 360 | + | bool Type::contains(const t_tuple& t, context& h) const { |
| 361 | + | return ind_0.contains(t, h.hints_0_lower); |
| 362 | + | } |
| 363 | + | bool Type::contains(const t_tuple& t) const { |
| 364 | + | context h; |
| 365 | + | return contains(t, h); |
| 366 | + | } |
| 367 | + | std::size_t Type::size() const { |
| 368 | + | return ind_0.size(); |
| 369 | + | } |
| 370 | + | iterator Type::find(const t_tuple& t, context& h) const { |
| 371 | + | return ind_0.find(t, h.hints_0_lower); |
| 372 | + | } |
| 373 | + | iterator Type::find(const t_tuple& t) const { |
| 374 | + | context h; |
| 375 | + | return find(t, h); |
| 376 | + | } |
| 377 | + | range<iterator> Type::lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const { |
| 378 | + | return range<iterator>(ind_0.begin(),ind_0.end()); |
| 379 | + | } |
| 380 | + | range<iterator> Type::lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */) const { |
| 381 | + | return range<iterator>(ind_0.begin(),ind_0.end()); |
| 382 | + | } |
| 383 | + | range<t_ind_0::iterator> Type::lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper, context& h) const { |
| 384 | + | t_comparator_0 comparator; |
| 385 | + | int cmp = comparator(lower, upper); |
| 386 | + | if (cmp == 0) { |
| 387 | + | auto pos = ind_0.find(lower, h.hints_0_lower); |
| 388 | + | auto fin = ind_0.end(); |
| 389 | + | if (pos != fin) {fin = pos; ++fin;} |
| 390 | + | return make_range(pos, fin); |
| 391 | + | } |
| 392 | + | if (cmp > 0) { |
| 393 | + | return make_range(ind_0.end(), ind_0.end()); |
| 394 | + | } |
| 395 | + | return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper)); |
| 396 | + | } |
| 397 | + | range<t_ind_0::iterator> Type::lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper) const { |
| 398 | + | context h; |
| 399 | + | return lowerUpperRange_11(lower,upper,h); |
| 400 | + | } |
| 401 | + | range<t_ind_0::iterator> Type::lowerUpperRange_10(const t_tuple& lower, const t_tuple& upper, context& h) const { |
| 402 | + | t_comparator_0 comparator; |
| 403 | + | int cmp = comparator(lower, upper); |
| 404 | + | if (cmp > 0) { |
| 405 | + | return make_range(ind_0.end(), ind_0.end()); |
| 406 | + | } |
| 407 | + | return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper)); |
| 408 | + | } |
| 409 | + | range<t_ind_0::iterator> Type::lowerUpperRange_10(const t_tuple& lower, const t_tuple& upper) const { |
| 410 | + | context h; |
| 411 | + | return lowerUpperRange_10(lower,upper,h); |
| 412 | + | } |
| 413 | + | bool Type::empty() const { |
| 414 | + | return ind_0.empty(); |
| 415 | + | } |
| 416 | + | std::vector<range<iterator>> Type::partition() const { |
| 417 | + | return ind_0.getChunks(400); |
| 418 | + | } |
| 419 | + | void Type::purge() { |
| 420 | + | ind_0.clear(); |
| 421 | + | } |
| 422 | + | iterator Type::begin() const { |
| 423 | + | return ind_0.begin(); |
| 424 | + | } |
| 425 | + | iterator Type::end() const { |
| 426 | + | return ind_0.end(); |
| 427 | + | } |
| 428 | + | void Type::printStatistics(std::ostream& o) const { |
| 429 | + | o << " arity 2 direct b-tree index 0 lex-order [0,1]\n"; |
| 430 | + | ind_0.printStats(o); |
| 431 | + | } |
| 432 | + | } // namespace souffle::t_btree_ii__0_1__11__10 |
| 433 | + | namespace souffle::t_btree_ii__1_0__11__01 { |
| 434 | + | using namespace souffle; |
| 435 | + | struct Type { |
| 436 | + | static constexpr Relation::arity_type Arity = 2; |
| 437 | + | using t_tuple = Tuple<RamDomain, 2>; |
| 438 | + | struct t_comparator_0{ |
| 439 | + | int operator()(const t_tuple& a, const t_tuple& b) const { |
| 440 | + | return (ramBitCast<RamSigned>(a[1]) < ramBitCast<RamSigned>(b[1])) ? -1 : (ramBitCast<RamSigned>(a[1]) > ramBitCast<RamSigned>(b[1])) ? 1 :((ramBitCast<RamSigned>(a[0]) < ramBitCast<RamSigned>(b[0])) ? -1 : (ramBitCast<RamSigned>(a[0]) > ramBitCast<RamSigned>(b[0])) ? 1 :(0)); |
| 441 | + | } |
| 442 | + | bool less(const t_tuple& a, const t_tuple& b) const { |
| 443 | + | return (ramBitCast<RamSigned>(a[1]) < ramBitCast<RamSigned>(b[1]))|| ((ramBitCast<RamSigned>(a[1]) == ramBitCast<RamSigned>(b[1])) && ((ramBitCast<RamSigned>(a[0]) < ramBitCast<RamSigned>(b[0])))); |
| 444 | + | } |
| 445 | + | bool equal(const t_tuple& a, const t_tuple& b) const { |
| 446 | + | return (ramBitCast<RamSigned>(a[1]) == ramBitCast<RamSigned>(b[1]))&&(ramBitCast<RamSigned>(a[0]) == ramBitCast<RamSigned>(b[0])); |
| 447 | + | } |
| 448 | + | }; |
| 449 | + | using t_ind_0 = btree_set<t_tuple,t_comparator_0>; |
| 450 | + | t_ind_0 ind_0; |
| 451 | + | using iterator = t_ind_0::iterator; |
| 452 | + | struct context { |
| 453 | + | t_ind_0::operation_hints hints_0_lower; |
| 454 | + | t_ind_0::operation_hints hints_0_upper; |
| 455 | + | }; |
| 456 | + | context createContext() { return context(); } |
| 457 | + | bool insert(const t_tuple& t); |
| 458 | + | bool insert(const t_tuple& t, context& h); |
| 459 | + | bool insert(const RamDomain* ramDomain); |
| 460 | + | bool insert(RamDomain a0,RamDomain a1); |
| 461 | + | bool contains(const t_tuple& t, context& h) const; |
| 462 | + | bool contains(const t_tuple& t) const; |
| 463 | + | std::size_t size() const; |
| 464 | + | iterator find(const t_tuple& t, context& h) const; |
| 465 | + | iterator find(const t_tuple& t) const; |
| 466 | + | range<iterator> lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const; |
| 467 | + | range<iterator> lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */) const; |
| 468 | + | range<t_ind_0::iterator> lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper, context& h) const; |
| 469 | + | range<t_ind_0::iterator> lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper) const; |
| 470 | + | range<t_ind_0::iterator> lowerUpperRange_01(const t_tuple& lower, const t_tuple& upper, context& h) const; |
| 471 | + | range<t_ind_0::iterator> lowerUpperRange_01(const t_tuple& lower, const t_tuple& upper) const; |
| 472 | + | bool empty() const; |
| 473 | + | std::vector<range<iterator>> partition() const; |
| 474 | + | void purge(); |
| 475 | + | iterator begin() const; |
| 476 | + | iterator end() const; |
| 477 | + | void printStatistics(std::ostream& o) const; |
| 478 | + | }; |
| 479 | + | } // namespace souffle::t_btree_ii__1_0__11__01 |
| 480 | + | namespace souffle::t_btree_ii__1_0__11__01 { |
| 481 | + | using namespace souffle; |
| 482 | + | using t_ind_0 = Type::t_ind_0; |
| 483 | + | using iterator = Type::iterator; |
| 484 | + | using context = Type::context; |
| 485 | + | bool Type::insert(const t_tuple& t) { |
| 486 | + | context h; |
| 487 | + | return insert(t, h); |
| 488 | + | } |
| 489 | + | bool Type::insert(const t_tuple& t, context& h) { |
| 490 | + | if (ind_0.insert(t, h.hints_0_lower)) { |
| 491 | + | return true; |
| 492 | + | } else return false; |
| 493 | + | } |
| 494 | + | bool Type::insert(const RamDomain* ramDomain) { |
| 495 | + | RamDomain data[2]; |
| 496 | + | std::copy(ramDomain, ramDomain + 2, data); |
| 497 | + | const t_tuple& tuple = reinterpret_cast<const t_tuple&>(data); |
| 498 | + | context h; |
| 499 | + | return insert(tuple, h); |
| 500 | + | } |
| 501 | + | bool Type::insert(RamDomain a0,RamDomain a1) { |
| 502 | + | RamDomain data[2] = {a0,a1}; |
| 503 | + | return insert(data); |
| 504 | + | } |
| 505 | + | bool Type::contains(const t_tuple& t, context& h) const { |
| 506 | + | return ind_0.contains(t, h.hints_0_lower); |
| 507 | + | } |
| 508 | + | bool Type::contains(const t_tuple& t) const { |
| 509 | + | context h; |
| 510 | + | return contains(t, h); |
| 511 | + | } |
| 512 | + | std::size_t Type::size() const { |
| 513 | + | return ind_0.size(); |
| 514 | + | } |
| 515 | + | iterator Type::find(const t_tuple& t, context& h) const { |
| 516 | + | return ind_0.find(t, h.hints_0_lower); |
| 517 | + | } |
| 518 | + | iterator Type::find(const t_tuple& t) const { |
| 519 | + | context h; |
| 520 | + | return find(t, h); |
| 521 | + | } |
| 522 | + | range<iterator> Type::lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const { |
| 523 | + | return range<iterator>(ind_0.begin(),ind_0.end()); |
| 524 | + | } |
| 525 | + | range<iterator> Type::lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */) const { |
| 526 | + | return range<iterator>(ind_0.begin(),ind_0.end()); |
| 527 | + | } |
| 528 | + | range<t_ind_0::iterator> Type::lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper, context& h) const { |
| 529 | + | t_comparator_0 comparator; |
| 530 | + | int cmp = comparator(lower, upper); |
| 531 | + | if (cmp == 0) { |
| 532 | + | auto pos = ind_0.find(lower, h.hints_0_lower); |
| 533 | + | auto fin = ind_0.end(); |
| 534 | + | if (pos != fin) {fin = pos; ++fin;} |
| 535 | + | return make_range(pos, fin); |
| 536 | + | } |
| 537 | + | if (cmp > 0) { |
| 538 | + | return make_range(ind_0.end(), ind_0.end()); |
| 539 | + | } |
| 540 | + | return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper)); |
| 541 | + | } |
| 542 | + | range<t_ind_0::iterator> Type::lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper) const { |
| 543 | + | context h; |
| 544 | + | return lowerUpperRange_11(lower,upper,h); |
| 545 | + | } |
| 546 | + | range<t_ind_0::iterator> Type::lowerUpperRange_01(const t_tuple& lower, const t_tuple& upper, context& h) const { |
| 547 | + | t_comparator_0 comparator; |
| 548 | + | int cmp = comparator(lower, upper); |
| 549 | + | if (cmp > 0) { |
| 550 | + | return make_range(ind_0.end(), ind_0.end()); |
| 551 | + | } |
| 552 | + | return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper)); |
| 553 | + | } |
| 554 | + | range<t_ind_0::iterator> Type::lowerUpperRange_01(const t_tuple& lower, const t_tuple& upper) const { |
| 555 | + | context h; |
| 556 | + | return lowerUpperRange_01(lower,upper,h); |
| 557 | + | } |
| 558 | + | bool Type::empty() const { |
| 559 | + | return ind_0.empty(); |
| 560 | + | } |
| 561 | + | std::vector<range<iterator>> Type::partition() const { |
| 562 | + | return ind_0.getChunks(400); |
| 563 | + | } |
| 564 | + | void Type::purge() { |
| 565 | + | ind_0.clear(); |
| 566 | + | } |
| 567 | + | iterator Type::begin() const { |
| 568 | + | return ind_0.begin(); |
| 569 | + | } |
| 570 | + | iterator Type::end() const { |
| 571 | + | return ind_0.end(); |
| 572 | + | } |
| 573 | + | void Type::printStatistics(std::ostream& o) const { |
| 574 | + | o << " arity 2 direct b-tree index 0 lex-order [1,0]\n"; |
| 575 | + | ind_0.printStats(o); |
| 576 | + | } |
| 577 | + | } // namespace souffle::t_btree_ii__1_0__11__01 |
| 578 | + | namespace souffle::t_btree_iui__0_1_2__110__111 { |
| 579 | + | using namespace souffle; |
| 580 | + | struct Type { |
| 581 | + | static constexpr Relation::arity_type Arity = 3; |
| 582 | + | using t_tuple = Tuple<RamDomain, 3>; |
| 583 | + | struct t_comparator_0{ |
| 584 | + | int operator()(const t_tuple& a, const t_tuple& b) const { |
| 585 | + | return (ramBitCast<RamSigned>(a[0]) < ramBitCast<RamSigned>(b[0])) ? -1 : (ramBitCast<RamSigned>(a[0]) > ramBitCast<RamSigned>(b[0])) ? 1 :((ramBitCast<RamUnsigned>(a[1]) < ramBitCast<RamUnsigned>(b[1])) ? -1 : (ramBitCast<RamUnsigned>(a[1]) > ramBitCast<RamUnsigned>(b[1])) ? 1 :((ramBitCast<RamSigned>(a[2]) < ramBitCast<RamSigned>(b[2])) ? -1 : (ramBitCast<RamSigned>(a[2]) > ramBitCast<RamSigned>(b[2])) ? 1 :(0))); |
| 586 | + | } |
| 587 | + | bool less(const t_tuple& a, const t_tuple& b) const { |
| 588 | + | return (ramBitCast<RamSigned>(a[0]) < ramBitCast<RamSigned>(b[0]))|| ((ramBitCast<RamSigned>(a[0]) == ramBitCast<RamSigned>(b[0])) && ((ramBitCast<RamUnsigned>(a[1]) < ramBitCast<RamUnsigned>(b[1]))|| ((ramBitCast<RamUnsigned>(a[1]) == ramBitCast<RamUnsigned>(b[1])) && ((ramBitCast<RamSigned>(a[2]) < ramBitCast<RamSigned>(b[2])))))); |
| 589 | + | } |
| 590 | + | bool equal(const t_tuple& a, const t_tuple& b) const { |
| 591 | + | return (ramBitCast<RamSigned>(a[0]) == ramBitCast<RamSigned>(b[0]))&&(ramBitCast<RamUnsigned>(a[1]) == ramBitCast<RamUnsigned>(b[1]))&&(ramBitCast<RamSigned>(a[2]) == ramBitCast<RamSigned>(b[2])); |
| 592 | + | } |
| 593 | + | }; |
| 594 | + | using t_ind_0 = btree_set<t_tuple,t_comparator_0>; |
| 595 | + | t_ind_0 ind_0; |
| 596 | + | using iterator = t_ind_0::iterator; |
| 597 | + | struct context { |
| 598 | + | t_ind_0::operation_hints hints_0_lower; |
| 599 | + | t_ind_0::operation_hints hints_0_upper; |
| 600 | + | }; |
| 601 | + | context createContext() { return context(); } |
| 602 | + | bool insert(const t_tuple& t); |
| 603 | + | bool insert(const t_tuple& t, context& h); |
| 604 | + | bool insert(const RamDomain* ramDomain); |
| 605 | + | bool insert(RamDomain a0,RamDomain a1,RamDomain a2); |
| 606 | + | bool contains(const t_tuple& t, context& h) const; |
| 607 | + | bool contains(const t_tuple& t) const; |
| 608 | + | std::size_t size() const; |
| 609 | + | iterator find(const t_tuple& t, context& h) const; |
| 610 | + | iterator find(const t_tuple& t) const; |
| 611 | + | range<iterator> lowerUpperRange_000(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const; |
| 612 | + | range<iterator> lowerUpperRange_000(const t_tuple& /* lower */, const t_tuple& /* upper */) const; |
| 613 | + | range<t_ind_0::iterator> lowerUpperRange_110(const t_tuple& lower, const t_tuple& upper, context& h) const; |
| 614 | + | range<t_ind_0::iterator> lowerUpperRange_110(const t_tuple& lower, const t_tuple& upper) const; |
| 615 | + | range<t_ind_0::iterator> lowerUpperRange_111(const t_tuple& lower, const t_tuple& upper, context& h) const; |
| 616 | + | range<t_ind_0::iterator> lowerUpperRange_111(const t_tuple& lower, const t_tuple& upper) const; |
| 617 | + | bool empty() const; |
| 618 | + | std::vector<range<iterator>> partition() const; |
| 619 | + | void purge(); |
| 620 | + | iterator begin() const; |
| 621 | + | iterator end() const; |
| 622 | + | void printStatistics(std::ostream& o) const; |
| 623 | + | }; |
| 624 | + | } // namespace souffle::t_btree_iui__0_1_2__110__111 |
| 625 | + | namespace souffle::t_btree_iui__0_1_2__110__111 { |
| 626 | + | using namespace souffle; |
| 627 | + | using t_ind_0 = Type::t_ind_0; |
| 628 | + | using iterator = Type::iterator; |
| 629 | + | using context = Type::context; |
| 630 | + | bool Type::insert(const t_tuple& t) { |
| 631 | + | context h; |
| 632 | + | return insert(t, h); |
| 633 | + | } |
| 634 | + | bool Type::insert(const t_tuple& t, context& h) { |
| 635 | + | if (ind_0.insert(t, h.hints_0_lower)) { |
| 636 | + | return true; |
| 637 | + | } else return false; |
| 638 | + | } |
| 639 | + | bool Type::insert(const RamDomain* ramDomain) { |
| 640 | + | RamDomain data[3]; |
| 641 | + | std::copy(ramDomain, ramDomain + 3, data); |
| 642 | + | const t_tuple& tuple = reinterpret_cast<const t_tuple&>(data); |
| 643 | + | context h; |
| 644 | + | return insert(tuple, h); |
| 645 | + | } |
| 646 | + | bool Type::insert(RamDomain a0,RamDomain a1,RamDomain a2) { |
| 647 | + | RamDomain data[3] = {a0,a1,a2}; |
| 648 | + | return insert(data); |
| 649 | + | } |
| 650 | + | bool Type::contains(const t_tuple& t, context& h) const { |
| 651 | + | return ind_0.contains(t, h.hints_0_lower); |
| 652 | + | } |
| 653 | + | bool Type::contains(const t_tuple& t) const { |
| 654 | + | context h; |
| 655 | + | return contains(t, h); |
| 656 | + | } |
| 657 | + | std::size_t Type::size() const { |
| 658 | + | return ind_0.size(); |
| 659 | + | } |
| 660 | + | iterator Type::find(const t_tuple& t, context& h) const { |
| 661 | + | return ind_0.find(t, h.hints_0_lower); |
| 662 | + | } |
| 663 | + | iterator Type::find(const t_tuple& t) const { |
| 664 | + | context h; |
| 665 | + | return find(t, h); |
| 666 | + | } |
| 667 | + | range<iterator> Type::lowerUpperRange_000(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const { |
| 668 | + | return range<iterator>(ind_0.begin(),ind_0.end()); |
| 669 | + | } |
| 670 | + | range<iterator> Type::lowerUpperRange_000(const t_tuple& /* lower */, const t_tuple& /* upper */) const { |
| 671 | + | return range<iterator>(ind_0.begin(),ind_0.end()); |
| 672 | + | } |
| 673 | + | range<t_ind_0::iterator> Type::lowerUpperRange_110(const t_tuple& lower, const t_tuple& upper, context& h) const { |
| 674 | + | t_comparator_0 comparator; |
| 675 | + | int cmp = comparator(lower, upper); |
| 676 | + | if (cmp > 0) { |
| 677 | + | return make_range(ind_0.end(), ind_0.end()); |
| 678 | + | } |
| 679 | + | return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper)); |
| 680 | + | } |
| 681 | + | range<t_ind_0::iterator> Type::lowerUpperRange_110(const t_tuple& lower, const t_tuple& upper) const { |
| 682 | + | context h; |
| 683 | + | return lowerUpperRange_110(lower,upper,h); |
| 684 | + | } |
| 685 | + | range<t_ind_0::iterator> Type::lowerUpperRange_111(const t_tuple& lower, const t_tuple& upper, context& h) const { |
| 686 | + | t_comparator_0 comparator; |
| 687 | + | int cmp = comparator(lower, upper); |
| 688 | + | if (cmp == 0) { |
| 689 | + | auto pos = ind_0.find(lower, h.hints_0_lower); |
| 690 | + | auto fin = ind_0.end(); |
| 691 | + | if (pos != fin) {fin = pos; ++fin;} |
| 692 | + | return make_range(pos, fin); |
| 693 | + | } |
| 694 | + | if (cmp > 0) { |
| 695 | + | return make_range(ind_0.end(), ind_0.end()); |
| 696 | + | } |
| 697 | + | return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper)); |
| 698 | + | } |
| 699 | + | range<t_ind_0::iterator> Type::lowerUpperRange_111(const t_tuple& lower, const t_tuple& upper) const { |
| 700 | + | context h; |
| 701 | + | return lowerUpperRange_111(lower,upper,h); |
| 702 | + | } |
| 703 | + | bool Type::empty() const { |
| 704 | + | return ind_0.empty(); |
| 705 | + | } |
| 706 | + | std::vector<range<iterator>> Type::partition() const { |
| 707 | + | return ind_0.getChunks(400); |
| 708 | + | } |
| 709 | + | void Type::purge() { |
| 710 | + | ind_0.clear(); |
| 711 | + | } |
| 712 | + | iterator Type::begin() const { |
| 713 | + | return ind_0.begin(); |
| 714 | + | } |
| 715 | + | iterator Type::end() const { |
| 716 | + | return ind_0.end(); |
| 717 | + | } |
| 718 | + | void Type::printStatistics(std::ostream& o) const { |
| 719 | + | o << " arity 3 direct b-tree index 0 lex-order [0,1,2]\n"; |
| 720 | + | ind_0.printStats(o); |
| 721 | + | } |
| 722 | + | } // namespace souffle::t_btree_iui__0_1_2__110__111 |
| 723 | + | namespace souffle { |
| 724 | + | using namespace souffle; |
| 725 | + | class Stratum_AST_NodeContent_fd51b4bf60caba3f { |
| 726 | + | public: |
| 727 | + | Stratum_AST_NodeContent_fd51b4bf60caba3f(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::Type& rel_AST_NodeContent_b2f3666572e60754); |
| 728 | + | void run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret); |
| 729 | + | private: |
| 730 | + | SymbolTable& symTable; |
| 731 | + | RecordTable& recordTable; |
| 732 | + | ConcurrentCache<std::string,std::regex>& regexCache; |
| 733 | + | bool& pruneImdtRels; |
| 734 | + | bool& performIO; |
| 735 | + | SignalHandler*& signalHandler; |
| 736 | + | std::atomic<std::size_t>& iter; |
| 737 | + | std::atomic<RamDomain>& ctr; |
| 738 | + | std::string& inputDirectory; |
| 739 | + | std::string& outputDirectory; |
| 740 | + | t_btree_ii__0_1__11::Type* rel_AST_NodeContent_b2f3666572e60754; |
| 741 | + | }; |
| 742 | + | } // namespace souffle |
| 743 | + | namespace souffle { |
| 744 | + | using namespace souffle; |
| 745 | + | Stratum_AST_NodeContent_fd51b4bf60caba3f::Stratum_AST_NodeContent_fd51b4bf60caba3f(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::Type& rel_AST_NodeContent_b2f3666572e60754): |
| 746 | + | symTable(symTable), |
| 747 | + | recordTable(recordTable), |
| 748 | + | regexCache(regexCache), |
| 749 | + | pruneImdtRels(pruneImdtRels), |
| 750 | + | performIO(performIO), |
| 751 | + | signalHandler(signalHandler), |
| 752 | + | iter(iter), |
| 753 | + | ctr(ctr), |
| 754 | + | inputDirectory(inputDirectory), |
| 755 | + | outputDirectory(outputDirectory), |
| 756 | + | rel_AST_NodeContent_b2f3666572e60754(&rel_AST_NodeContent_b2f3666572e60754){ |
| 757 | + | } |
| 758 | + | |
| 759 | + | void Stratum_AST_NodeContent_fd51b4bf60caba3f::run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret){ |
| 760 | + | if (performIO) { |
| 761 | + | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","node\tcontent"},{"auxArity","0"},{"fact-dir","."},{"name","AST_NodeContent"},{"operation","input"},{"params","{\"records\": {\"AST_Location\": {\"arity\": 5, \"params\": [\"startByte\", \"startLine\", \"startColumn\", \"endLine\", \"endColumn\"]}, \"AST_Node\": {\"arity\": 2, \"params\": [\"file\", \"nodeId\"]}}, \"relation\": {\"arity\": 2, \"params\": [\"node\", \"content\"]}}"},{"types","{\"ADTs\": {}, \"records\": {\"r:AST_Location\": {\"arity\": 5, \"types\": [\"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\"]}, \"r:AST_Node\": {\"arity\": 2, \"types\": [\"i:AST_FileId\", \"i:AST_NodeId\"]}}, \"relation\": {\"arity\": 2, \"types\": [\"r:AST_Node\", \"s:AST_Content\"]}}"}}); |
| 762 | + | if (!inputDirectory.empty()) {directiveMap["fact-dir"] = inputDirectory;} |
| 763 | + | IOSystem::getInstance().getReader(directiveMap, symTable, recordTable)->readAll(*rel_AST_NodeContent_b2f3666572e60754); |
| 764 | + | } catch (std::exception& e) {std::cerr << "Error loading AST_NodeContent data: " << e.what() << '\n'; |
| 765 | + | exit(1); |
| 766 | + | } |
| 767 | + | } |
| 768 | + | } |
| 769 | + | |
| 770 | + | } // namespace souffle |
| 771 | + | |
| 772 | + | namespace souffle { |
| 773 | + | using namespace souffle; |
| 774 | + | class Stratum_AST_NodeField_cc21295739297165 { |
| 775 | + | public: |
| 776 | + | Stratum_AST_NodeField_cc21295739297165(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_2_1__101__111::Type& rel_AST_NodeField_ca02670731ce3c99); |
| 777 | + | void run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret); |
| 778 | + | private: |
| 779 | + | SymbolTable& symTable; |
| 780 | + | RecordTable& recordTable; |
| 781 | + | ConcurrentCache<std::string,std::regex>& regexCache; |
| 782 | + | bool& pruneImdtRels; |
| 783 | + | bool& performIO; |
| 784 | + | SignalHandler*& signalHandler; |
| 785 | + | std::atomic<std::size_t>& iter; |
| 786 | + | std::atomic<RamDomain>& ctr; |
| 787 | + | std::string& inputDirectory; |
| 788 | + | std::string& outputDirectory; |
| 789 | + | t_btree_iii__0_2_1__101__111::Type* rel_AST_NodeField_ca02670731ce3c99; |
| 790 | + | }; |
| 791 | + | } // namespace souffle |
| 792 | + | namespace souffle { |
| 793 | + | using namespace souffle; |
| 794 | + | Stratum_AST_NodeField_cc21295739297165::Stratum_AST_NodeField_cc21295739297165(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_2_1__101__111::Type& rel_AST_NodeField_ca02670731ce3c99): |
| 795 | + | symTable(symTable), |
| 796 | + | recordTable(recordTable), |
| 797 | + | regexCache(regexCache), |
| 798 | + | pruneImdtRels(pruneImdtRels), |
| 799 | + | performIO(performIO), |
| 800 | + | signalHandler(signalHandler), |
| 801 | + | iter(iter), |
| 802 | + | ctr(ctr), |
| 803 | + | inputDirectory(inputDirectory), |
| 804 | + | outputDirectory(outputDirectory), |
| 805 | + | rel_AST_NodeField_ca02670731ce3c99(&rel_AST_NodeField_ca02670731ce3c99){ |
| 806 | + | } |
| 807 | + | |
| 808 | + | void Stratum_AST_NodeField_cc21295739297165::run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret){ |
| 809 | + | if (performIO) { |
| 810 | + | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","parent\tchild\tfield"},{"auxArity","0"},{"fact-dir","."},{"name","AST_NodeField"},{"operation","input"},{"params","{\"records\": {\"AST_Location\": {\"arity\": 5, \"params\": [\"startByte\", \"startLine\", \"startColumn\", \"endLine\", \"endColumn\"]}, \"AST_Node\": {\"arity\": 2, \"params\": [\"file\", \"nodeId\"]}}, \"relation\": {\"arity\": 3, \"params\": [\"parent\", \"child\", \"field\"]}}"},{"types","{\"ADTs\": {}, \"records\": {\"r:AST_Location\": {\"arity\": 5, \"types\": [\"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\"]}, \"r:AST_Node\": {\"arity\": 2, \"types\": [\"i:AST_FileId\", \"i:AST_NodeId\"]}}, \"relation\": {\"arity\": 3, \"types\": [\"r:AST_Node\", \"r:AST_Node\", \"s:AST_Field\"]}}"}}); |
| 811 | + | if (!inputDirectory.empty()) {directiveMap["fact-dir"] = inputDirectory;} |
| 812 | + | IOSystem::getInstance().getReader(directiveMap, symTable, recordTable)->readAll(*rel_AST_NodeField_ca02670731ce3c99); |
| 813 | + | } catch (std::exception& e) {std::cerr << "Error loading AST_NodeField data: " << e.what() << '\n'; |
| 814 | + | exit(1); |
| 815 | + | } |
| 816 | + | } |
| 817 | + | } |
| 818 | + | |
| 819 | + | } // namespace souffle |
| 820 | + | |
| 821 | + | namespace souffle { |
| 822 | + | using namespace souffle; |
| 823 | + | class Stratum_AST_NodeLocation_89d765aa14237a09 { |
| 824 | + | public: |
| 825 | + | Stratum_AST_NodeLocation_89d765aa14237a09(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_AST_NodeLocation_5f3f38ee7a82c12a); |
| 826 | + | void run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret); |
| 827 | + | private: |
| 828 | + | SymbolTable& symTable; |
| 829 | + | RecordTable& recordTable; |
| 830 | + | ConcurrentCache<std::string,std::regex>& regexCache; |
| 831 | + | bool& pruneImdtRels; |
| 832 | + | bool& performIO; |
| 833 | + | SignalHandler*& signalHandler; |
| 834 | + | std::atomic<std::size_t>& iter; |
| 835 | + | std::atomic<RamDomain>& ctr; |
| 836 | + | std::string& inputDirectory; |
| 837 | + | std::string& outputDirectory; |
| 838 | + | t_btree_ii__0_1__11__10::Type* rel_AST_NodeLocation_5f3f38ee7a82c12a; |
| 839 | + | }; |
| 840 | + | } // namespace souffle |
| 841 | + | namespace souffle { |
| 842 | + | using namespace souffle; |
| 843 | + | Stratum_AST_NodeLocation_89d765aa14237a09::Stratum_AST_NodeLocation_89d765aa14237a09(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_AST_NodeLocation_5f3f38ee7a82c12a): |
| 844 | + | symTable(symTable), |
| 845 | + | recordTable(recordTable), |
| 846 | + | regexCache(regexCache), |
| 847 | + | pruneImdtRels(pruneImdtRels), |
| 848 | + | performIO(performIO), |
| 849 | + | signalHandler(signalHandler), |
| 850 | + | iter(iter), |
| 851 | + | ctr(ctr), |
| 852 | + | inputDirectory(inputDirectory), |
| 853 | + | outputDirectory(outputDirectory), |
| 854 | + | rel_AST_NodeLocation_5f3f38ee7a82c12a(&rel_AST_NodeLocation_5f3f38ee7a82c12a){ |
| 855 | + | } |
| 856 | + | |
| 857 | + | void Stratum_AST_NodeLocation_89d765aa14237a09::run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret){ |
| 858 | + | if (performIO) { |
| 859 | + | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","node\tlocation"},{"auxArity","0"},{"fact-dir","."},{"name","AST_NodeLocation"},{"operation","input"},{"params","{\"records\": {\"AST_Location\": {\"arity\": 5, \"params\": [\"startByte\", \"startLine\", \"startColumn\", \"endLine\", \"endColumn\"]}, \"AST_Node\": {\"arity\": 2, \"params\": [\"file\", \"nodeId\"]}}, \"relation\": {\"arity\": 2, \"params\": [\"node\", \"location\"]}}"},{"types","{\"ADTs\": {}, \"records\": {\"r:AST_Location\": {\"arity\": 5, \"types\": [\"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\"]}, \"r:AST_Node\": {\"arity\": 2, \"types\": [\"i:AST_FileId\", \"i:AST_NodeId\"]}}, \"relation\": {\"arity\": 2, \"types\": [\"r:AST_Node\", \"r:AST_Location\"]}}"}}); |
| 860 | + | if (!inputDirectory.empty()) {directiveMap["fact-dir"] = inputDirectory;} |
| 861 | + | IOSystem::getInstance().getReader(directiveMap, symTable, recordTable)->readAll(*rel_AST_NodeLocation_5f3f38ee7a82c12a); |
| 862 | + | } catch (std::exception& e) {std::cerr << "Error loading AST_NodeLocation data: " << e.what() << '\n'; |
| 863 | + | exit(1); |
| 864 | + | } |
| 865 | + | } |
| 866 | + | } |
| 867 | + | |
| 868 | + | } // namespace souffle |
| 869 | + | |
| 870 | + | namespace souffle { |
| 871 | + | using namespace souffle; |
| 872 | + | class Stratum_AST_NodeType_400775685fb3e630 { |
| 873 | + | public: |
| 874 | + | Stratum_AST_NodeType_400775685fb3e630(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__1_0__11__01::Type& rel_AST_NodeType_b38285ae9991409e); |
| 875 | + | void run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret); |
| 876 | + | private: |
| 877 | + | SymbolTable& symTable; |
| 878 | + | RecordTable& recordTable; |
| 879 | + | ConcurrentCache<std::string,std::regex>& regexCache; |
| 880 | + | bool& pruneImdtRels; |
| 881 | + | bool& performIO; |
| 882 | + | SignalHandler*& signalHandler; |
| 883 | + | std::atomic<std::size_t>& iter; |
| 884 | + | std::atomic<RamDomain>& ctr; |
| 885 | + | std::string& inputDirectory; |
| 886 | + | std::string& outputDirectory; |
| 887 | + | t_btree_ii__1_0__11__01::Type* rel_AST_NodeType_b38285ae9991409e; |
| 888 | + | }; |
| 889 | + | } // namespace souffle |
| 890 | + | namespace souffle { |
| 891 | + | using namespace souffle; |
| 892 | + | Stratum_AST_NodeType_400775685fb3e630::Stratum_AST_NodeType_400775685fb3e630(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__1_0__11__01::Type& rel_AST_NodeType_b38285ae9991409e): |
| 893 | + | symTable(symTable), |
| 894 | + | recordTable(recordTable), |
| 895 | + | regexCache(regexCache), |
| 896 | + | pruneImdtRels(pruneImdtRels), |
| 897 | + | performIO(performIO), |
| 898 | + | signalHandler(signalHandler), |
| 899 | + | iter(iter), |
| 900 | + | ctr(ctr), |
| 901 | + | inputDirectory(inputDirectory), |
| 902 | + | outputDirectory(outputDirectory), |
| 903 | + | rel_AST_NodeType_b38285ae9991409e(&rel_AST_NodeType_b38285ae9991409e){ |
| 904 | + | } |
| 905 | + | |
| 906 | + | void Stratum_AST_NodeType_400775685fb3e630::run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret){ |
| 907 | + | if (performIO) { |
| 908 | + | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","node\ttype"},{"auxArity","0"},{"fact-dir","."},{"name","AST_NodeType"},{"operation","input"},{"params","{\"records\": {\"AST_Location\": {\"arity\": 5, \"params\": [\"startByte\", \"startLine\", \"startColumn\", \"endLine\", \"endColumn\"]}, \"AST_Node\": {\"arity\": 2, \"params\": [\"file\", \"nodeId\"]}}, \"relation\": {\"arity\": 2, \"params\": [\"node\", \"type\"]}}"},{"types","{\"ADTs\": {}, \"records\": {\"r:AST_Location\": {\"arity\": 5, \"types\": [\"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\"]}, \"r:AST_Node\": {\"arity\": 2, \"types\": [\"i:AST_FileId\", \"i:AST_NodeId\"]}}, \"relation\": {\"arity\": 2, \"types\": [\"r:AST_Node\", \"s:AST_Type\"]}}"}}); |
| 909 | + | if (!inputDirectory.empty()) {directiveMap["fact-dir"] = inputDirectory;} |
| 910 | + | IOSystem::getInstance().getReader(directiveMap, symTable, recordTable)->readAll(*rel_AST_NodeType_b38285ae9991409e); |
| 911 | + | } catch (std::exception& e) {std::cerr << "Error loading AST_NodeType data: " << e.what() << '\n'; |
| 912 | + | exit(1); |
| 913 | + | } |
| 914 | + | } |
| 915 | + | } |
| 916 | + | |
| 917 | + | } // namespace souffle |
| 918 | + | |
| 919 | + | namespace souffle { |
| 920 | + | using namespace souffle; |
| 921 | + | class Stratum_AST_ParentChild_798cb83c96de8e4d { |
| 922 | + | public: |
| 923 | + | Stratum_AST_ParentChild_798cb83c96de8e4d(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_iui__0_1_2__110__111::Type& rel_AST_ParentChild_be6259205eb66578); |
| 924 | + | void run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret); |
| 925 | + | private: |
| 926 | + | SymbolTable& symTable; |
| 927 | + | RecordTable& recordTable; |
| 928 | + | ConcurrentCache<std::string,std::regex>& regexCache; |
| 929 | + | bool& pruneImdtRels; |
| 930 | + | bool& performIO; |
| 931 | + | SignalHandler*& signalHandler; |
| 932 | + | std::atomic<std::size_t>& iter; |
| 933 | + | std::atomic<RamDomain>& ctr; |
| 934 | + | std::string& inputDirectory; |
| 935 | + | std::string& outputDirectory; |
| 936 | + | t_btree_iui__0_1_2__110__111::Type* rel_AST_ParentChild_be6259205eb66578; |
| 937 | + | }; |
| 938 | + | } // namespace souffle |
| 939 | + | namespace souffle { |
| 940 | + | using namespace souffle; |
| 941 | + | Stratum_AST_ParentChild_798cb83c96de8e4d::Stratum_AST_ParentChild_798cb83c96de8e4d(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_iui__0_1_2__110__111::Type& rel_AST_ParentChild_be6259205eb66578): |
| 942 | + | symTable(symTable), |
| 943 | + | recordTable(recordTable), |
| 944 | + | regexCache(regexCache), |
| 945 | + | pruneImdtRels(pruneImdtRels), |
| 946 | + | performIO(performIO), |
| 947 | + | signalHandler(signalHandler), |
| 948 | + | iter(iter), |
| 949 | + | ctr(ctr), |
| 950 | + | inputDirectory(inputDirectory), |
| 951 | + | outputDirectory(outputDirectory), |
| 952 | + | rel_AST_ParentChild_be6259205eb66578(&rel_AST_ParentChild_be6259205eb66578){ |
| 953 | + | } |
| 954 | + | |
| 955 | + | void Stratum_AST_ParentChild_798cb83c96de8e4d::run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret){ |
| 956 | + | if (performIO) { |
| 957 | + | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","parent\tindex\tchild"},{"auxArity","0"},{"fact-dir","."},{"name","AST_ParentChild"},{"operation","input"},{"params","{\"records\": {\"AST_Location\": {\"arity\": 5, \"params\": [\"startByte\", \"startLine\", \"startColumn\", \"endLine\", \"endColumn\"]}, \"AST_Node\": {\"arity\": 2, \"params\": [\"file\", \"nodeId\"]}}, \"relation\": {\"arity\": 3, \"params\": [\"parent\", \"index\", \"child\"]}}"},{"types","{\"ADTs\": {}, \"records\": {\"r:AST_Location\": {\"arity\": 5, \"types\": [\"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\"]}, \"r:AST_Node\": {\"arity\": 2, \"types\": [\"i:AST_FileId\", \"i:AST_NodeId\"]}}, \"relation\": {\"arity\": 3, \"types\": [\"r:AST_Node\", \"u:unsigned\", \"r:AST_Node\"]}}"}}); |
| 958 | + | if (!inputDirectory.empty()) {directiveMap["fact-dir"] = inputDirectory;} |
| 959 | + | IOSystem::getInstance().getReader(directiveMap, symTable, recordTable)->readAll(*rel_AST_ParentChild_be6259205eb66578); |
| 960 | + | } catch (std::exception& e) {std::cerr << "Error loading AST_ParentChild data: " << e.what() << '\n'; |
| 961 | + | exit(1); |
| 962 | + | } |
| 963 | + | } |
| 964 | + | } |
| 965 | + | |
| 966 | + | } // namespace souffle |
| 967 | + | |
| 968 | + | namespace souffle { |
| 969 | + | using namespace souffle; |
| 970 | + | class Stratum_Rule_0e6b7aa9ece342e5 { |
| 971 | + | public: |
| 972 | + | Stratum_Rule_0e6b7aa9ece342e5(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::Type& rel_AST_NodeContent_b2f3666572e60754,t_btree_iii__0_2_1__101__111::Type& rel_AST_NodeField_ca02670731ce3c99,t_btree_ii__1_0__11__01::Type& rel_AST_NodeType_b38285ae9991409e,t_btree_iui__0_1_2__110__111::Type& rel_AST_ParentChild_be6259205eb66578,t_btree_ii__0_1__11::Type& rel_Rule_159a590c7b2c8d95); |
| 973 | + | void run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret); |
| 974 | + | private: |
| 975 | + | SymbolTable& symTable; |
| 976 | + | RecordTable& recordTable; |
| 977 | + | ConcurrentCache<std::string,std::regex>& regexCache; |
| 978 | + | bool& pruneImdtRels; |
| 979 | + | bool& performIO; |
| 980 | + | SignalHandler*& signalHandler; |
| 981 | + | std::atomic<std::size_t>& iter; |
| 982 | + | std::atomic<RamDomain>& ctr; |
| 983 | + | std::string& inputDirectory; |
| 984 | + | std::string& outputDirectory; |
| 985 | + | t_btree_ii__0_1__11::Type* rel_AST_NodeContent_b2f3666572e60754; |
| 986 | + | t_btree_iii__0_2_1__101__111::Type* rel_AST_NodeField_ca02670731ce3c99; |
| 987 | + | t_btree_ii__1_0__11__01::Type* rel_AST_NodeType_b38285ae9991409e; |
| 988 | + | t_btree_iui__0_1_2__110__111::Type* rel_AST_ParentChild_be6259205eb66578; |
| 989 | + | t_btree_ii__0_1__11::Type* rel_Rule_159a590c7b2c8d95; |
| 990 | + | }; |
| 991 | + | } // namespace souffle |
| 992 | + | namespace souffle { |
| 993 | + | using namespace souffle; |
| 994 | + | Stratum_Rule_0e6b7aa9ece342e5::Stratum_Rule_0e6b7aa9ece342e5(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::Type& rel_AST_NodeContent_b2f3666572e60754,t_btree_iii__0_2_1__101__111::Type& rel_AST_NodeField_ca02670731ce3c99,t_btree_ii__1_0__11__01::Type& rel_AST_NodeType_b38285ae9991409e,t_btree_iui__0_1_2__110__111::Type& rel_AST_ParentChild_be6259205eb66578,t_btree_ii__0_1__11::Type& rel_Rule_159a590c7b2c8d95): |
| 995 | + | symTable(symTable), |
| 996 | + | recordTable(recordTable), |
| 997 | + | regexCache(regexCache), |
| 998 | + | pruneImdtRels(pruneImdtRels), |
| 999 | + | performIO(performIO), |
| 1000 | + | signalHandler(signalHandler), |
| 1001 | + | iter(iter), |
| 1002 | + | ctr(ctr), |
| 1003 | + | inputDirectory(inputDirectory), |
| 1004 | + | outputDirectory(outputDirectory), |
| 1005 | + | rel_AST_NodeContent_b2f3666572e60754(&rel_AST_NodeContent_b2f3666572e60754), |
| 1006 | + | rel_AST_NodeField_ca02670731ce3c99(&rel_AST_NodeField_ca02670731ce3c99), |
| 1007 | + | rel_AST_NodeType_b38285ae9991409e(&rel_AST_NodeType_b38285ae9991409e), |
| 1008 | + | rel_AST_ParentChild_be6259205eb66578(&rel_AST_ParentChild_be6259205eb66578), |
| 1009 | + | rel_Rule_159a590c7b2c8d95(&rel_Rule_159a590c7b2c8d95){ |
| 1010 | + | } |
| 1011 | + | |
| 1012 | + | void Stratum_Rule_0e6b7aa9ece342e5::run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret){ |
| 1013 | + | signalHandler->setMsg(R"_(Rule("test_rule",node1) :- |
| 1014 | + | AST_NodeType(node1,"call"), |
| 1015 | + | !AST_NodeField(node1,_,"block"), |
| 1016 | + | AST_NodeField(node1,node2,"receiver"), |
| 1017 | + | AST_NodeType(node2,"constant"), |
| 1018 | + | AST_NodeContent(node2,"Foo"), |
| 1019 | + | AST_NodeField(node1,node3,"method"), |
| 1020 | + | AST_NodeType(node3,"identifier"), |
| 1021 | + | AST_NodeContent(node3,"new"), |
| 1022 | + | AST_NodeField(node1,node4,"arguments"), |
| 1023 | + | AST_NodeType(node4,"argument_list"), |
| 1024 | + | AST_ParentChild(node4,0,node5), |
| 1025 | + | AST_NodeType(node5,"pair"), |
| 1026 | + | AST_NodeField(node5,tmp0,"key"), |
| 1027 | + | AST_NodeType(tmp0,"simple_symbol"), |
| 1028 | + | AST_NodeContent(tmp0,":b"), |
| 1029 | + | AST_NodeField(node5,node6,"value"), |
| 1030 | + | AST_NodeType(node6,"integer"), |
| 1031 | + | AST_NodeContent(node6,"1"). |
| 1032 | + | in file rules.dl [1:1-1:714])_"); |
| 1033 | + | if(!(rel_AST_NodeType_b38285ae9991409e->empty()) && !(rel_AST_NodeField_ca02670731ce3c99->empty()) && !(rel_AST_NodeContent_b2f3666572e60754->empty()) && !(rel_AST_ParentChild_be6259205eb66578->empty())) { |
| 1034 | + | [&](){ |
| 1035 | + | CREATE_OP_CONTEXT(rel_AST_NodeContent_b2f3666572e60754_op_ctxt,rel_AST_NodeContent_b2f3666572e60754->createContext()); |
| 1036 | + | CREATE_OP_CONTEXT(rel_AST_NodeField_ca02670731ce3c99_op_ctxt,rel_AST_NodeField_ca02670731ce3c99->createContext()); |
| 1037 | + | CREATE_OP_CONTEXT(rel_AST_NodeType_b38285ae9991409e_op_ctxt,rel_AST_NodeType_b38285ae9991409e->createContext()); |
| 1038 | + | CREATE_OP_CONTEXT(rel_AST_ParentChild_be6259205eb66578_op_ctxt,rel_AST_ParentChild_be6259205eb66578->createContext()); |
| 1039 | + | CREATE_OP_CONTEXT(rel_Rule_159a590c7b2c8d95_op_ctxt,rel_Rule_159a590c7b2c8d95->createContext()); |
| 1040 | + | auto range = rel_AST_NodeType_b38285ae9991409e->lowerUpperRange_01(Tuple<RamDomain,2>{{ramBitCast<RamDomain>(MIN_RAM_SIGNED), ramBitCast(RamSigned(0))}},Tuple<RamDomain,2>{{ramBitCast<RamDomain>(MAX_RAM_SIGNED), ramBitCast(RamSigned(0))}},READ_OP_CONTEXT(rel_AST_NodeType_b38285ae9991409e_op_ctxt)); |
| 1041 | + | for(const auto& env0 : range) { |
| 1042 | + | if( !(!rel_AST_NodeField_ca02670731ce3c99->lowerUpperRange_101(Tuple<RamDomain,3>{{ramBitCast(env0[0]), ramBitCast<RamDomain>(MIN_RAM_SIGNED), ramBitCast(RamSigned(1))}},Tuple<RamDomain,3>{{ramBitCast(env0[0]), ramBitCast<RamDomain>(MAX_RAM_SIGNED), ramBitCast(RamSigned(1))}},READ_OP_CONTEXT(rel_AST_NodeField_ca02670731ce3c99_op_ctxt)).empty())) { |
| 1043 | + | auto range = rel_AST_NodeField_ca02670731ce3c99->lowerUpperRange_101(Tuple<RamDomain,3>{{ramBitCast(env0[0]), ramBitCast<RamDomain>(MIN_RAM_SIGNED), ramBitCast(RamSigned(2))}},Tuple<RamDomain,3>{{ramBitCast(env0[0]), ramBitCast<RamDomain>(MAX_RAM_SIGNED), ramBitCast(RamSigned(2))}},READ_OP_CONTEXT(rel_AST_NodeField_ca02670731ce3c99_op_ctxt)); |
| 1044 | + | for(const auto& env1 : range) { |
| 1045 | + | if( rel_AST_NodeContent_b2f3666572e60754->contains(Tuple<RamDomain,2>{{ramBitCast(env1[1]),ramBitCast(RamSigned(3))}},READ_OP_CONTEXT(rel_AST_NodeContent_b2f3666572e60754_op_ctxt)) && rel_AST_NodeType_b38285ae9991409e->contains(Tuple<RamDomain,2>{{ramBitCast(env1[1]),ramBitCast(RamSigned(4))}},READ_OP_CONTEXT(rel_AST_NodeType_b38285ae9991409e_op_ctxt))) { |
| 1046 | + | auto range = rel_AST_NodeField_ca02670731ce3c99->lowerUpperRange_101(Tuple<RamDomain,3>{{ramBitCast(env0[0]), ramBitCast<RamDomain>(MIN_RAM_SIGNED), ramBitCast(RamSigned(5))}},Tuple<RamDomain,3>{{ramBitCast(env0[0]), ramBitCast<RamDomain>(MAX_RAM_SIGNED), ramBitCast(RamSigned(5))}},READ_OP_CONTEXT(rel_AST_NodeField_ca02670731ce3c99_op_ctxt)); |
| 1047 | + | for(const auto& env2 : range) { |
| 1048 | + | if( rel_AST_NodeContent_b2f3666572e60754->contains(Tuple<RamDomain,2>{{ramBitCast(env2[1]),ramBitCast(RamSigned(6))}},READ_OP_CONTEXT(rel_AST_NodeContent_b2f3666572e60754_op_ctxt)) && rel_AST_NodeType_b38285ae9991409e->contains(Tuple<RamDomain,2>{{ramBitCast(env2[1]),ramBitCast(RamSigned(7))}},READ_OP_CONTEXT(rel_AST_NodeType_b38285ae9991409e_op_ctxt))) { |
| 1049 | + | auto range = rel_AST_NodeField_ca02670731ce3c99->lowerUpperRange_101(Tuple<RamDomain,3>{{ramBitCast(env0[0]), ramBitCast<RamDomain>(MIN_RAM_SIGNED), ramBitCast(RamSigned(8))}},Tuple<RamDomain,3>{{ramBitCast(env0[0]), ramBitCast<RamDomain>(MAX_RAM_SIGNED), ramBitCast(RamSigned(8))}},READ_OP_CONTEXT(rel_AST_NodeField_ca02670731ce3c99_op_ctxt)); |
| 1050 | + | for(const auto& env3 : range) { |
| 1051 | + | if( rel_AST_NodeType_b38285ae9991409e->contains(Tuple<RamDomain,2>{{ramBitCast(env3[1]),ramBitCast(RamSigned(9))}},READ_OP_CONTEXT(rel_AST_NodeType_b38285ae9991409e_op_ctxt))) { |
| 1052 | + | auto range = rel_AST_ParentChild_be6259205eb66578->lowerUpperRange_110(Tuple<RamDomain,3>{{ramBitCast(env3[1]), ramBitCast(RamUnsigned(0)), ramBitCast<RamDomain>(MIN_RAM_SIGNED)}},Tuple<RamDomain,3>{{ramBitCast(env3[1]), ramBitCast(RamUnsigned(0)), ramBitCast<RamDomain>(MAX_RAM_SIGNED)}},READ_OP_CONTEXT(rel_AST_ParentChild_be6259205eb66578_op_ctxt)); |
| 1053 | + | for(const auto& env4 : range) { |
| 1054 | + | if( rel_AST_NodeType_b38285ae9991409e->contains(Tuple<RamDomain,2>{{ramBitCast(env4[2]),ramBitCast(RamSigned(10))}},READ_OP_CONTEXT(rel_AST_NodeType_b38285ae9991409e_op_ctxt))) { |
| 1055 | + | auto range = rel_AST_NodeField_ca02670731ce3c99->lowerUpperRange_101(Tuple<RamDomain,3>{{ramBitCast(env4[2]), ramBitCast<RamDomain>(MIN_RAM_SIGNED), ramBitCast(RamSigned(11))}},Tuple<RamDomain,3>{{ramBitCast(env4[2]), ramBitCast<RamDomain>(MAX_RAM_SIGNED), ramBitCast(RamSigned(11))}},READ_OP_CONTEXT(rel_AST_NodeField_ca02670731ce3c99_op_ctxt)); |
| 1056 | + | for(const auto& env5 : range) { |
| 1057 | + | if( rel_AST_NodeContent_b2f3666572e60754->contains(Tuple<RamDomain,2>{{ramBitCast(env5[1]),ramBitCast(RamSigned(12))}},READ_OP_CONTEXT(rel_AST_NodeContent_b2f3666572e60754_op_ctxt)) && rel_AST_NodeType_b38285ae9991409e->contains(Tuple<RamDomain,2>{{ramBitCast(env5[1]),ramBitCast(RamSigned(13))}},READ_OP_CONTEXT(rel_AST_NodeType_b38285ae9991409e_op_ctxt))) { |
| 1058 | + | auto range = rel_AST_NodeField_ca02670731ce3c99->lowerUpperRange_101(Tuple<RamDomain,3>{{ramBitCast(env4[2]), ramBitCast<RamDomain>(MIN_RAM_SIGNED), ramBitCast(RamSigned(14))}},Tuple<RamDomain,3>{{ramBitCast(env4[2]), ramBitCast<RamDomain>(MAX_RAM_SIGNED), ramBitCast(RamSigned(14))}},READ_OP_CONTEXT(rel_AST_NodeField_ca02670731ce3c99_op_ctxt)); |
| 1059 | + | for(const auto& env6 : range) { |
| 1060 | + | if( rel_AST_NodeContent_b2f3666572e60754->contains(Tuple<RamDomain,2>{{ramBitCast(env6[1]),ramBitCast(RamSigned(15))}},READ_OP_CONTEXT(rel_AST_NodeContent_b2f3666572e60754_op_ctxt)) && rel_AST_NodeType_b38285ae9991409e->contains(Tuple<RamDomain,2>{{ramBitCast(env6[1]),ramBitCast(RamSigned(16))}},READ_OP_CONTEXT(rel_AST_NodeType_b38285ae9991409e_op_ctxt))) { |
| 1061 | + | Tuple<RamDomain,2> tuple{{ramBitCast(RamSigned(17)),ramBitCast(env0[0])}}; |
| 1062 | + | rel_Rule_159a590c7b2c8d95->insert(tuple,READ_OP_CONTEXT(rel_Rule_159a590c7b2c8d95_op_ctxt)); |
| 1063 | + | } |
| 1064 | + | } |
| 1065 | + | } |
| 1066 | + | } |
| 1067 | + | } |
| 1068 | + | } |
| 1069 | + | } |
| 1070 | + | } |
| 1071 | + | } |
| 1072 | + | } |
| 1073 | + | } |
| 1074 | + | } |
| 1075 | + | } |
| 1076 | + | } |
| 1077 | + | } |
| 1078 | + | ();} |
| 1079 | + | signalHandler->setMsg(R"_(Rule("test_rule",node1) :- |
| 1080 | + | AST_NodeType(node1,"call"), |
| 1081 | + | !AST_NodeField(node1,_,"block"), |
| 1082 | + | AST_NodeField(node1,node2,"receiver"), |
| 1083 | + | AST_NodeType(node2,"constant"), |
| 1084 | + | AST_NodeContent(node2,"Foo"), |
| 1085 | + | AST_NodeField(node1,node3,"method"), |
| 1086 | + | AST_NodeType(node3,"identifier"), |
| 1087 | + | AST_NodeContent(node3,"new"), |
| 1088 | + | AST_NodeField(node1,node4,"arguments"), |
| 1089 | + | AST_NodeType(node4,"argument_list"), |
| 1090 | + | AST_ParentChild(node4,0,node5), |
| 1091 | + | AST_NodeType(node5,"pair"), |
| 1092 | + | AST_NodeField(node5,tmp0,"key"), |
| 1093 | + | AST_NodeType(tmp0,"hash_key_symbol"), |
| 1094 | + | AST_NodeContent(tmp0,"b"), |
| 1095 | + | AST_NodeField(node5,node6,"value"), |
| 1096 | + | AST_NodeType(node6,"integer"), |
| 1097 | + | AST_NodeContent(node6,"1"). |
| 1098 | + | in file rules.dl [1:1-1:714])_"); |
| 1099 | + | if(!(rel_AST_NodeType_b38285ae9991409e->empty()) && !(rel_AST_NodeField_ca02670731ce3c99->empty()) && !(rel_AST_NodeContent_b2f3666572e60754->empty()) && !(rel_AST_ParentChild_be6259205eb66578->empty())) { |
| 1100 | + | [&](){ |
| 1101 | + | CREATE_OP_CONTEXT(rel_AST_NodeContent_b2f3666572e60754_op_ctxt,rel_AST_NodeContent_b2f3666572e60754->createContext()); |
| 1102 | + | CREATE_OP_CONTEXT(rel_AST_NodeField_ca02670731ce3c99_op_ctxt,rel_AST_NodeField_ca02670731ce3c99->createContext()); |
| 1103 | + | CREATE_OP_CONTEXT(rel_AST_NodeType_b38285ae9991409e_op_ctxt,rel_AST_NodeType_b38285ae9991409e->createContext()); |
| 1104 | + | CREATE_OP_CONTEXT(rel_AST_ParentChild_be6259205eb66578_op_ctxt,rel_AST_ParentChild_be6259205eb66578->createContext()); |
| 1105 | + | CREATE_OP_CONTEXT(rel_Rule_159a590c7b2c8d95_op_ctxt,rel_Rule_159a590c7b2c8d95->createContext()); |
| 1106 | + | auto range = rel_AST_NodeType_b38285ae9991409e->lowerUpperRange_01(Tuple<RamDomain,2>{{ramBitCast<RamDomain>(MIN_RAM_SIGNED), ramBitCast(RamSigned(0))}},Tuple<RamDomain,2>{{ramBitCast<RamDomain>(MAX_RAM_SIGNED), ramBitCast(RamSigned(0))}},READ_OP_CONTEXT(rel_AST_NodeType_b38285ae9991409e_op_ctxt)); |
| 1107 | + | for(const auto& env0 : range) { |
| 1108 | + | if( !(!rel_AST_NodeField_ca02670731ce3c99->lowerUpperRange_101(Tuple<RamDomain,3>{{ramBitCast(env0[0]), ramBitCast<RamDomain>(MIN_RAM_SIGNED), ramBitCast(RamSigned(1))}},Tuple<RamDomain,3>{{ramBitCast(env0[0]), ramBitCast<RamDomain>(MAX_RAM_SIGNED), ramBitCast(RamSigned(1))}},READ_OP_CONTEXT(rel_AST_NodeField_ca02670731ce3c99_op_ctxt)).empty())) { |
| 1109 | + | auto range = rel_AST_NodeField_ca02670731ce3c99->lowerUpperRange_101(Tuple<RamDomain,3>{{ramBitCast(env0[0]), ramBitCast<RamDomain>(MIN_RAM_SIGNED), ramBitCast(RamSigned(2))}},Tuple<RamDomain,3>{{ramBitCast(env0[0]), ramBitCast<RamDomain>(MAX_RAM_SIGNED), ramBitCast(RamSigned(2))}},READ_OP_CONTEXT(rel_AST_NodeField_ca02670731ce3c99_op_ctxt)); |
| 1110 | + | for(const auto& env1 : range) { |
| 1111 | + | if( rel_AST_NodeContent_b2f3666572e60754->contains(Tuple<RamDomain,2>{{ramBitCast(env1[1]),ramBitCast(RamSigned(3))}},READ_OP_CONTEXT(rel_AST_NodeContent_b2f3666572e60754_op_ctxt)) && rel_AST_NodeType_b38285ae9991409e->contains(Tuple<RamDomain,2>{{ramBitCast(env1[1]),ramBitCast(RamSigned(4))}},READ_OP_CONTEXT(rel_AST_NodeType_b38285ae9991409e_op_ctxt))) { |
| 1112 | + | auto range = rel_AST_NodeField_ca02670731ce3c99->lowerUpperRange_101(Tuple<RamDomain,3>{{ramBitCast(env0[0]), ramBitCast<RamDomain>(MIN_RAM_SIGNED), ramBitCast(RamSigned(5))}},Tuple<RamDomain,3>{{ramBitCast(env0[0]), ramBitCast<RamDomain>(MAX_RAM_SIGNED), ramBitCast(RamSigned(5))}},READ_OP_CONTEXT(rel_AST_NodeField_ca02670731ce3c99_op_ctxt)); |
| 1113 | + | for(const auto& env2 : range) { |
| 1114 | + | if( rel_AST_NodeContent_b2f3666572e60754->contains(Tuple<RamDomain,2>{{ramBitCast(env2[1]),ramBitCast(RamSigned(6))}},READ_OP_CONTEXT(rel_AST_NodeContent_b2f3666572e60754_op_ctxt)) && rel_AST_NodeType_b38285ae9991409e->contains(Tuple<RamDomain,2>{{ramBitCast(env2[1]),ramBitCast(RamSigned(7))}},READ_OP_CONTEXT(rel_AST_NodeType_b38285ae9991409e_op_ctxt))) { |
| 1115 | + | auto range = rel_AST_NodeField_ca02670731ce3c99->lowerUpperRange_101(Tuple<RamDomain,3>{{ramBitCast(env0[0]), ramBitCast<RamDomain>(MIN_RAM_SIGNED), ramBitCast(RamSigned(8))}},Tuple<RamDomain,3>{{ramBitCast(env0[0]), ramBitCast<RamDomain>(MAX_RAM_SIGNED), ramBitCast(RamSigned(8))}},READ_OP_CONTEXT(rel_AST_NodeField_ca02670731ce3c99_op_ctxt)); |
| 1116 | + | for(const auto& env3 : range) { |
| 1117 | + | if( rel_AST_NodeType_b38285ae9991409e->contains(Tuple<RamDomain,2>{{ramBitCast(env3[1]),ramBitCast(RamSigned(9))}},READ_OP_CONTEXT(rel_AST_NodeType_b38285ae9991409e_op_ctxt))) { |
| 1118 | + | auto range = rel_AST_ParentChild_be6259205eb66578->lowerUpperRange_110(Tuple<RamDomain,3>{{ramBitCast(env3[1]), ramBitCast(RamUnsigned(0)), ramBitCast<RamDomain>(MIN_RAM_SIGNED)}},Tuple<RamDomain,3>{{ramBitCast(env3[1]), ramBitCast(RamUnsigned(0)), ramBitCast<RamDomain>(MAX_RAM_SIGNED)}},READ_OP_CONTEXT(rel_AST_ParentChild_be6259205eb66578_op_ctxt)); |
| 1119 | + | for(const auto& env4 : range) { |
| 1120 | + | if( rel_AST_NodeType_b38285ae9991409e->contains(Tuple<RamDomain,2>{{ramBitCast(env4[2]),ramBitCast(RamSigned(10))}},READ_OP_CONTEXT(rel_AST_NodeType_b38285ae9991409e_op_ctxt))) { |
| 1121 | + | auto range = rel_AST_NodeField_ca02670731ce3c99->lowerUpperRange_101(Tuple<RamDomain,3>{{ramBitCast(env4[2]), ramBitCast<RamDomain>(MIN_RAM_SIGNED), ramBitCast(RamSigned(11))}},Tuple<RamDomain,3>{{ramBitCast(env4[2]), ramBitCast<RamDomain>(MAX_RAM_SIGNED), ramBitCast(RamSigned(11))}},READ_OP_CONTEXT(rel_AST_NodeField_ca02670731ce3c99_op_ctxt)); |
| 1122 | + | for(const auto& env5 : range) { |
| 1123 | + | if( rel_AST_NodeContent_b2f3666572e60754->contains(Tuple<RamDomain,2>{{ramBitCast(env5[1]),ramBitCast(RamSigned(18))}},READ_OP_CONTEXT(rel_AST_NodeContent_b2f3666572e60754_op_ctxt)) && rel_AST_NodeType_b38285ae9991409e->contains(Tuple<RamDomain,2>{{ramBitCast(env5[1]),ramBitCast(RamSigned(19))}},READ_OP_CONTEXT(rel_AST_NodeType_b38285ae9991409e_op_ctxt))) { |
| 1124 | + | auto range = rel_AST_NodeField_ca02670731ce3c99->lowerUpperRange_101(Tuple<RamDomain,3>{{ramBitCast(env4[2]), ramBitCast<RamDomain>(MIN_RAM_SIGNED), ramBitCast(RamSigned(14))}},Tuple<RamDomain,3>{{ramBitCast(env4[2]), ramBitCast<RamDomain>(MAX_RAM_SIGNED), ramBitCast(RamSigned(14))}},READ_OP_CONTEXT(rel_AST_NodeField_ca02670731ce3c99_op_ctxt)); |
| 1125 | + | for(const auto& env6 : range) { |
| 1126 | + | if( rel_AST_NodeContent_b2f3666572e60754->contains(Tuple<RamDomain,2>{{ramBitCast(env6[1]),ramBitCast(RamSigned(15))}},READ_OP_CONTEXT(rel_AST_NodeContent_b2f3666572e60754_op_ctxt)) && rel_AST_NodeType_b38285ae9991409e->contains(Tuple<RamDomain,2>{{ramBitCast(env6[1]),ramBitCast(RamSigned(16))}},READ_OP_CONTEXT(rel_AST_NodeType_b38285ae9991409e_op_ctxt))) { |
| 1127 | + | Tuple<RamDomain,2> tuple{{ramBitCast(RamSigned(17)),ramBitCast(env0[0])}}; |
| 1128 | + | rel_Rule_159a590c7b2c8d95->insert(tuple,READ_OP_CONTEXT(rel_Rule_159a590c7b2c8d95_op_ctxt)); |
| 1129 | + | } |
| 1130 | + | } |
| 1131 | + | } |
| 1132 | + | } |
| 1133 | + | } |
| 1134 | + | } |
| 1135 | + | } |
| 1136 | + | } |
| 1137 | + | } |
| 1138 | + | } |
| 1139 | + | } |
| 1140 | + | } |
| 1141 | + | } |
| 1142 | + | } |
| 1143 | + | } |
| 1144 | + | ();} |
| 1145 | + | if (pruneImdtRels) rel_AST_NodeContent_b2f3666572e60754->purge(); |
| 1146 | + | if (pruneImdtRels) rel_AST_NodeField_ca02670731ce3c99->purge(); |
| 1147 | + | if (pruneImdtRels) rel_AST_NodeType_b38285ae9991409e->purge(); |
| 1148 | + | if (pruneImdtRels) rel_AST_ParentChild_be6259205eb66578->purge(); |
| 1149 | + | } |
| 1150 | + | |
| 1151 | + | } // namespace souffle |
| 1152 | + | |
| 1153 | + | namespace souffle { |
| 1154 | + | using namespace souffle; |
| 1155 | + | class Stratum_RuleMatch_4394a245605301ce { |
| 1156 | + | public: |
| 1157 | + | Stratum_RuleMatch_4394a245605301ce(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_AST_NodeLocation_5f3f38ee7a82c12a,t_btree_ii__0_1__11::Type& rel_Rule_159a590c7b2c8d95,t_btree_ii__0_1__11::Type& rel_RuleMatch_8974a5cadf2d4779); |
| 1158 | + | void run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret); |
| 1159 | + | private: |
| 1160 | + | SymbolTable& symTable; |
| 1161 | + | RecordTable& recordTable; |
| 1162 | + | ConcurrentCache<std::string,std::regex>& regexCache; |
| 1163 | + | bool& pruneImdtRels; |
| 1164 | + | bool& performIO; |
| 1165 | + | SignalHandler*& signalHandler; |
| 1166 | + | std::atomic<std::size_t>& iter; |
| 1167 | + | std::atomic<RamDomain>& ctr; |
| 1168 | + | std::string& inputDirectory; |
| 1169 | + | std::string& outputDirectory; |
| 1170 | + | t_btree_ii__0_1__11__10::Type* rel_AST_NodeLocation_5f3f38ee7a82c12a; |
| 1171 | + | t_btree_ii__0_1__11::Type* rel_Rule_159a590c7b2c8d95; |
| 1172 | + | t_btree_ii__0_1__11::Type* rel_RuleMatch_8974a5cadf2d4779; |
| 1173 | + | }; |
| 1174 | + | } // namespace souffle |
| 1175 | + | namespace souffle { |
| 1176 | + | using namespace souffle; |
| 1177 | + | Stratum_RuleMatch_4394a245605301ce::Stratum_RuleMatch_4394a245605301ce(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_AST_NodeLocation_5f3f38ee7a82c12a,t_btree_ii__0_1__11::Type& rel_Rule_159a590c7b2c8d95,t_btree_ii__0_1__11::Type& rel_RuleMatch_8974a5cadf2d4779): |
| 1178 | + | symTable(symTable), |
| 1179 | + | recordTable(recordTable), |
| 1180 | + | regexCache(regexCache), |
| 1181 | + | pruneImdtRels(pruneImdtRels), |
| 1182 | + | performIO(performIO), |
| 1183 | + | signalHandler(signalHandler), |
| 1184 | + | iter(iter), |
| 1185 | + | ctr(ctr), |
| 1186 | + | inputDirectory(inputDirectory), |
| 1187 | + | outputDirectory(outputDirectory), |
| 1188 | + | rel_AST_NodeLocation_5f3f38ee7a82c12a(&rel_AST_NodeLocation_5f3f38ee7a82c12a), |
| 1189 | + | rel_Rule_159a590c7b2c8d95(&rel_Rule_159a590c7b2c8d95), |
| 1190 | + | rel_RuleMatch_8974a5cadf2d4779(&rel_RuleMatch_8974a5cadf2d4779){ |
| 1191 | + | } |
| 1192 | + | |
| 1193 | + | void Stratum_RuleMatch_4394a245605301ce::run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret){ |
| 1194 | + | signalHandler->setMsg(R"_(RuleMatch(name,location) :- |
| 1195 | + | Rule(name,node), |
| 1196 | + | AST_NodeLocation(node,location). |
| 1197 | + | in file ruby.dl [8:1-8:81])_"); |
| 1198 | + | if(!(rel_Rule_159a590c7b2c8d95->empty()) && !(rel_AST_NodeLocation_5f3f38ee7a82c12a->empty())) { |
| 1199 | + | [&](){ |
| 1200 | + | CREATE_OP_CONTEXT(rel_AST_NodeLocation_5f3f38ee7a82c12a_op_ctxt,rel_AST_NodeLocation_5f3f38ee7a82c12a->createContext()); |
| 1201 | + | CREATE_OP_CONTEXT(rel_Rule_159a590c7b2c8d95_op_ctxt,rel_Rule_159a590c7b2c8d95->createContext()); |
| 1202 | + | CREATE_OP_CONTEXT(rel_RuleMatch_8974a5cadf2d4779_op_ctxt,rel_RuleMatch_8974a5cadf2d4779->createContext()); |
| 1203 | + | for(const auto& env0 : *rel_Rule_159a590c7b2c8d95) { |
| 1204 | + | auto range = rel_AST_NodeLocation_5f3f38ee7a82c12a->lowerUpperRange_10(Tuple<RamDomain,2>{{ramBitCast(env0[1]), ramBitCast<RamDomain>(MIN_RAM_SIGNED)}},Tuple<RamDomain,2>{{ramBitCast(env0[1]), ramBitCast<RamDomain>(MAX_RAM_SIGNED)}},READ_OP_CONTEXT(rel_AST_NodeLocation_5f3f38ee7a82c12a_op_ctxt)); |
| 1205 | + | for(const auto& env1 : range) { |
| 1206 | + | Tuple<RamDomain,2> tuple{{ramBitCast(env0[0]),ramBitCast(env1[1])}}; |
| 1207 | + | rel_RuleMatch_8974a5cadf2d4779->insert(tuple,READ_OP_CONTEXT(rel_RuleMatch_8974a5cadf2d4779_op_ctxt)); |
| 1208 | + | } |
| 1209 | + | } |
| 1210 | + | } |
| 1211 | + | ();} |
| 1212 | + | if (performIO) { |
| 1213 | + | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","name\tlocation"},{"auxArity","0"},{"name","RuleMatch"},{"operation","output"},{"output-dir","."},{"params","{\"records\": {\"AST_Location\": {\"arity\": 5, \"params\": [\"startByte\", \"startLine\", \"startColumn\", \"endLine\", \"endColumn\"]}, \"AST_Node\": {\"arity\": 2, \"params\": [\"file\", \"nodeId\"]}}, \"relation\": {\"arity\": 2, \"params\": [\"name\", \"location\"]}}"},{"types","{\"ADTs\": {}, \"records\": {\"r:AST_Location\": {\"arity\": 5, \"types\": [\"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\"]}, \"r:AST_Node\": {\"arity\": 2, \"types\": [\"i:AST_FileId\", \"i:AST_NodeId\"]}}, \"relation\": {\"arity\": 2, \"types\": [\"s:RuleName\", \"r:AST_Location\"]}}"}}); |
| 1214 | + | if (outputDirectory == "-"){directiveMap["IO"] = "stdout"; directiveMap["headers"] = "true";} |
| 1215 | + | else if (!outputDirectory.empty()) {directiveMap["output-dir"] = outputDirectory;} |
| 1216 | + | IOSystem::getInstance().getWriter(directiveMap, symTable, recordTable)->writeAll(*rel_RuleMatch_8974a5cadf2d4779); |
| 1217 | + | } catch (std::exception& e) {std::cerr << e.what();exit(1);} |
| 1218 | + | } |
| 1219 | + | if (pruneImdtRels) rel_AST_NodeLocation_5f3f38ee7a82c12a->purge(); |
| 1220 | + | if (pruneImdtRels) rel_Rule_159a590c7b2c8d95->purge(); |
| 1221 | + | } |
| 1222 | + | |
| 1223 | + | } // namespace souffle |
| 1224 | + | |
| 1225 | + | namespace souffle { |
| 1226 | + | using namespace souffle; |
| 1227 | + | class Sf_souffle: public SouffleProgram { |
| 1228 | + | public: |
| 1229 | + | Sf_souffle(); |
| 1230 | + | ~Sf_souffle(); |
| 1231 | + | void run(); |
| 1232 | + | void runAll(std::string inputDirectoryArg = "",std::string outputDirectoryArg = "",bool performIOArg = true,bool pruneImdtRelsArg = true); |
| 1233 | + | void printAll([[maybe_unused]] std::string outputDirectoryArg = ""); |
| 1234 | + | void loadAll([[maybe_unused]] std::string inputDirectoryArg = ""); |
| 1235 | + | void dumpInputs(); |
| 1236 | + | void dumpOutputs(); |
| 1237 | + | SymbolTable& getSymbolTable(); |
| 1238 | + | RecordTable& getRecordTable(); |
| 1239 | + | void setNumThreads(std::size_t numThreadsValue); |
| 1240 | + | void executeSubroutine(std::string name,const std::vector<RamDomain>& args,std::vector<RamDomain>& ret); |
| 1241 | + | private: |
| 1242 | + | void runFunction(std::string inputDirectoryArg,std::string outputDirectoryArg,bool performIOArg,bool pruneImdtRelsArg); |
| 1243 | + | SymbolTableImpl symTable; |
| 1244 | + | SpecializedRecordTable<0> recordTable; |
| 1245 | + | ConcurrentCache<std::string,std::regex> regexCache; |
| 1246 | + | Own<t_btree_ii__0_1__11::Type> rel_AST_NodeContent_b2f3666572e60754; |
| 1247 | + | souffle::RelationWrapper<t_btree_ii__0_1__11::Type> wrapper_rel_AST_NodeContent_b2f3666572e60754; |
| 1248 | + | Own<t_btree_iii__0_2_1__101__111::Type> rel_AST_NodeField_ca02670731ce3c99; |
| 1249 | + | souffle::RelationWrapper<t_btree_iii__0_2_1__101__111::Type> wrapper_rel_AST_NodeField_ca02670731ce3c99; |
| 1250 | + | Own<t_btree_ii__0_1__11__10::Type> rel_AST_NodeLocation_5f3f38ee7a82c12a; |
| 1251 | + | souffle::RelationWrapper<t_btree_ii__0_1__11__10::Type> wrapper_rel_AST_NodeLocation_5f3f38ee7a82c12a; |
| 1252 | + | Own<t_btree_ii__1_0__11__01::Type> rel_AST_NodeType_b38285ae9991409e; |
| 1253 | + | souffle::RelationWrapper<t_btree_ii__1_0__11__01::Type> wrapper_rel_AST_NodeType_b38285ae9991409e; |
| 1254 | + | Own<t_btree_iui__0_1_2__110__111::Type> rel_AST_ParentChild_be6259205eb66578; |
| 1255 | + | souffle::RelationWrapper<t_btree_iui__0_1_2__110__111::Type> wrapper_rel_AST_ParentChild_be6259205eb66578; |
| 1256 | + | Own<t_btree_ii__0_1__11::Type> rel_Rule_159a590c7b2c8d95; |
| 1257 | + | souffle::RelationWrapper<t_btree_ii__0_1__11::Type> wrapper_rel_Rule_159a590c7b2c8d95; |
| 1258 | + | Own<t_btree_ii__0_1__11::Type> rel_RuleMatch_8974a5cadf2d4779; |
| 1259 | + | souffle::RelationWrapper<t_btree_ii__0_1__11::Type> wrapper_rel_RuleMatch_8974a5cadf2d4779; |
| 1260 | + | Stratum_AST_NodeContent_fd51b4bf60caba3f stratum_AST_NodeContent_f29a0e907561c50c; |
| 1261 | + | Stratum_AST_NodeField_cc21295739297165 stratum_AST_NodeField_b63714d335ba8b2e; |
| 1262 | + | Stratum_AST_NodeLocation_89d765aa14237a09 stratum_AST_NodeLocation_b120359576603175; |
| 1263 | + | Stratum_AST_NodeType_400775685fb3e630 stratum_AST_NodeType_f0647903c04c5ec5; |
| 1264 | + | Stratum_AST_ParentChild_798cb83c96de8e4d stratum_AST_ParentChild_381ffe0668807a9c; |
| 1265 | + | Stratum_Rule_0e6b7aa9ece342e5 stratum_Rule_b7f309df7d140ebc; |
| 1266 | + | Stratum_RuleMatch_4394a245605301ce stratum_RuleMatch_a3becf205b4cd965; |
| 1267 | + | std::string inputDirectory; |
| 1268 | + | std::string outputDirectory; |
| 1269 | + | SignalHandler* signalHandler{SignalHandler::instance()}; |
| 1270 | + | std::atomic<RamDomain> ctr{}; |
| 1271 | + | std::atomic<std::size_t> iter{}; |
| 1272 | + | }; |
| 1273 | + | } // namespace souffle |
| 1274 | + | namespace souffle { |
| 1275 | + | using namespace souffle; |
| 1276 | + | Sf_souffle::Sf_souffle(): |
| 1277 | + | symTable({ |
| 1278 | + | R"_(call)_", |
| 1279 | + | R"_(block)_", |
| 1280 | + | R"_(receiver)_", |
| 1281 | + | R"_(Foo)_", |
| 1282 | + | R"_(constant)_", |
| 1283 | + | R"_(method)_", |
| 1284 | + | R"_(new)_", |
| 1285 | + | R"_(identifier)_", |
| 1286 | + | R"_(arguments)_", |
| 1287 | + | R"_(argument_list)_", |
| 1288 | + | R"_(pair)_", |
| 1289 | + | R"_(key)_", |
| 1290 | + | R"_(:b)_", |
| 1291 | + | R"_(simple_symbol)_", |
| 1292 | + | R"_(value)_", |
| 1293 | + | R"_(1)_", |
| 1294 | + | R"_(integer)_", |
| 1295 | + | R"_(test_rule)_", |
| 1296 | + | R"_(b)_", |
| 1297 | + | R"_(hash_key_symbol)_", |
| 1298 | + | }), |
| 1299 | + | recordTable(), |
| 1300 | + | regexCache(), |
| 1301 | + | rel_AST_NodeContent_b2f3666572e60754(mk<t_btree_ii__0_1__11::Type>()), |
| 1302 | + | wrapper_rel_AST_NodeContent_b2f3666572e60754(0, *rel_AST_NodeContent_b2f3666572e60754, *this, "AST_NodeContent", std::array<const char *,2>{{"r:AST_Node","s:AST_Content"}}, std::array<const char *,2>{{"node","content"}}, 0), |
| 1303 | + | rel_AST_NodeField_ca02670731ce3c99(mk<t_btree_iii__0_2_1__101__111::Type>()), |
| 1304 | + | wrapper_rel_AST_NodeField_ca02670731ce3c99(1, *rel_AST_NodeField_ca02670731ce3c99, *this, "AST_NodeField", std::array<const char *,3>{{"r:AST_Node","r:AST_Node","s:AST_Field"}}, std::array<const char *,3>{{"parent","child","field"}}, 0), |
| 1305 | + | rel_AST_NodeLocation_5f3f38ee7a82c12a(mk<t_btree_ii__0_1__11__10::Type>()), |
| 1306 | + | wrapper_rel_AST_NodeLocation_5f3f38ee7a82c12a(2, *rel_AST_NodeLocation_5f3f38ee7a82c12a, *this, "AST_NodeLocation", std::array<const char *,2>{{"r:AST_Node","r:AST_Location"}}, std::array<const char *,2>{{"node","location"}}, 0), |
| 1307 | + | rel_AST_NodeType_b38285ae9991409e(mk<t_btree_ii__1_0__11__01::Type>()), |
| 1308 | + | wrapper_rel_AST_NodeType_b38285ae9991409e(3, *rel_AST_NodeType_b38285ae9991409e, *this, "AST_NodeType", std::array<const char *,2>{{"r:AST_Node","s:AST_Type"}}, std::array<const char *,2>{{"node","type"}}, 0), |
| 1309 | + | rel_AST_ParentChild_be6259205eb66578(mk<t_btree_iui__0_1_2__110__111::Type>()), |
| 1310 | + | wrapper_rel_AST_ParentChild_be6259205eb66578(4, *rel_AST_ParentChild_be6259205eb66578, *this, "AST_ParentChild", std::array<const char *,3>{{"r:AST_Node","u:unsigned","r:AST_Node"}}, std::array<const char *,3>{{"parent","index","child"}}, 0), |
| 1311 | + | rel_Rule_159a590c7b2c8d95(mk<t_btree_ii__0_1__11::Type>()), |
| 1312 | + | wrapper_rel_Rule_159a590c7b2c8d95(5, *rel_Rule_159a590c7b2c8d95, *this, "Rule", std::array<const char *,2>{{"s:RuleName","r:AST_Node"}}, std::array<const char *,2>{{"rule","node"}}, 0), |
| 1313 | + | rel_RuleMatch_8974a5cadf2d4779(mk<t_btree_ii__0_1__11::Type>()), |
| 1314 | + | wrapper_rel_RuleMatch_8974a5cadf2d4779(6, *rel_RuleMatch_8974a5cadf2d4779, *this, "RuleMatch", std::array<const char *,2>{{"s:RuleName","r:AST_Location"}}, std::array<const char *,2>{{"name","location"}}, 0), |
| 1315 | + | stratum_AST_NodeContent_f29a0e907561c50c(symTable,recordTable,regexCache,pruneImdtRels,performIO,signalHandler,iter,ctr,inputDirectory,outputDirectory,*rel_AST_NodeContent_b2f3666572e60754), |
| 1316 | + | stratum_AST_NodeField_b63714d335ba8b2e(symTable,recordTable,regexCache,pruneImdtRels,performIO,signalHandler,iter,ctr,inputDirectory,outputDirectory,*rel_AST_NodeField_ca02670731ce3c99), |
| 1317 | + | stratum_AST_NodeLocation_b120359576603175(symTable,recordTable,regexCache,pruneImdtRels,performIO,signalHandler,iter,ctr,inputDirectory,outputDirectory,*rel_AST_NodeLocation_5f3f38ee7a82c12a), |
| 1318 | + | stratum_AST_NodeType_f0647903c04c5ec5(symTable,recordTable,regexCache,pruneImdtRels,performIO,signalHandler,iter,ctr,inputDirectory,outputDirectory,*rel_AST_NodeType_b38285ae9991409e), |
| 1319 | + | stratum_AST_ParentChild_381ffe0668807a9c(symTable,recordTable,regexCache,pruneImdtRels,performIO,signalHandler,iter,ctr,inputDirectory,outputDirectory,*rel_AST_ParentChild_be6259205eb66578), |
| 1320 | + | stratum_Rule_b7f309df7d140ebc(symTable,recordTable,regexCache,pruneImdtRels,performIO,signalHandler,iter,ctr,inputDirectory,outputDirectory,*rel_AST_NodeContent_b2f3666572e60754,*rel_AST_NodeField_ca02670731ce3c99,*rel_AST_NodeType_b38285ae9991409e,*rel_AST_ParentChild_be6259205eb66578,*rel_Rule_159a590c7b2c8d95), |
| 1321 | + | stratum_RuleMatch_a3becf205b4cd965(symTable,recordTable,regexCache,pruneImdtRels,performIO,signalHandler,iter,ctr,inputDirectory,outputDirectory,*rel_AST_NodeLocation_5f3f38ee7a82c12a,*rel_Rule_159a590c7b2c8d95,*rel_RuleMatch_8974a5cadf2d4779){ |
| 1322 | + | addRelation("AST_NodeContent", wrapper_rel_AST_NodeContent_b2f3666572e60754, true, false); |
| 1323 | + | addRelation("AST_NodeField", wrapper_rel_AST_NodeField_ca02670731ce3c99, true, false); |
| 1324 | + | addRelation("AST_NodeLocation", wrapper_rel_AST_NodeLocation_5f3f38ee7a82c12a, true, false); |
| 1325 | + | addRelation("AST_NodeType", wrapper_rel_AST_NodeType_b38285ae9991409e, true, false); |
| 1326 | + | addRelation("AST_ParentChild", wrapper_rel_AST_ParentChild_be6259205eb66578, true, false); |
| 1327 | + | addRelation("Rule", wrapper_rel_Rule_159a590c7b2c8d95, false, false); |
| 1328 | + | addRelation("RuleMatch", wrapper_rel_RuleMatch_8974a5cadf2d4779, false, true); |
| 1329 | + | } |
| 1330 | + | |
| 1331 | + | Sf_souffle::~Sf_souffle(){ |
| 1332 | + | } |
| 1333 | + | |
| 1334 | + | void Sf_souffle::runFunction(std::string inputDirectoryArg,std::string outputDirectoryArg,bool performIOArg,bool pruneImdtRelsArg){ |
| 1335 | + | |
| 1336 | + | this->inputDirectory = std::move(inputDirectoryArg); |
| 1337 | + | this->outputDirectory = std::move(outputDirectoryArg); |
| 1338 | + | this->performIO = performIOArg; |
| 1339 | + | this->pruneImdtRels = pruneImdtRelsArg; |
| 1340 | + | |
| 1341 | + | // set default threads (in embedded mode) |
| 1342 | + | // if this is not set, and omp is used, the default omp setting of number of cores is used. |
| 1343 | + | #if defined(_OPENMP) |
| 1344 | + | if (0 < getNumThreads()) { omp_set_num_threads(static_cast<int>(getNumThreads())); } |
| 1345 | + | #endif |
| 1346 | + | |
| 1347 | + | signalHandler->set(); |
| 1348 | + | // -- query evaluation -- |
| 1349 | + | { |
| 1350 | + | std::vector<RamDomain> args, ret; |
| 1351 | + | stratum_AST_NodeContent_f29a0e907561c50c.run(args, ret); |
| 1352 | + | } |
| 1353 | + | { |
| 1354 | + | std::vector<RamDomain> args, ret; |
| 1355 | + | stratum_AST_NodeField_b63714d335ba8b2e.run(args, ret); |
| 1356 | + | } |
| 1357 | + | { |
| 1358 | + | std::vector<RamDomain> args, ret; |
| 1359 | + | stratum_AST_NodeLocation_b120359576603175.run(args, ret); |
| 1360 | + | } |
| 1361 | + | { |
| 1362 | + | std::vector<RamDomain> args, ret; |
| 1363 | + | stratum_AST_NodeType_f0647903c04c5ec5.run(args, ret); |
| 1364 | + | } |
| 1365 | + | { |
| 1366 | + | std::vector<RamDomain> args, ret; |
| 1367 | + | stratum_AST_ParentChild_381ffe0668807a9c.run(args, ret); |
| 1368 | + | } |
| 1369 | + | { |
| 1370 | + | std::vector<RamDomain> args, ret; |
| 1371 | + | stratum_Rule_b7f309df7d140ebc.run(args, ret); |
| 1372 | + | } |
| 1373 | + | { |
| 1374 | + | std::vector<RamDomain> args, ret; |
| 1375 | + | stratum_RuleMatch_a3becf205b4cd965.run(args, ret); |
| 1376 | + | } |
| 1377 | + | |
| 1378 | + | // -- relation hint statistics -- |
| 1379 | + | signalHandler->reset(); |
| 1380 | + | } |
| 1381 | + | |
| 1382 | + | void Sf_souffle::run(){ |
| 1383 | + | runFunction("", "", false, false); |
| 1384 | + | } |
| 1385 | + | |
| 1386 | + | void Sf_souffle::runAll(std::string inputDirectoryArg,std::string outputDirectoryArg,bool performIOArg,bool pruneImdtRelsArg){ |
| 1387 | + | runFunction(inputDirectoryArg, outputDirectoryArg, performIOArg, pruneImdtRelsArg); |
| 1388 | + | } |
| 1389 | + | |
| 1390 | + | void Sf_souffle::printAll([[maybe_unused]] std::string outputDirectoryArg){ |
| 1391 | + | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","name\tlocation"},{"auxArity","0"},{"name","RuleMatch"},{"operation","output"},{"output-dir","."},{"params","{\"records\": {\"AST_Location\": {\"arity\": 5, \"params\": [\"startByte\", \"startLine\", \"startColumn\", \"endLine\", \"endColumn\"]}, \"AST_Node\": {\"arity\": 2, \"params\": [\"file\", \"nodeId\"]}}, \"relation\": {\"arity\": 2, \"params\": [\"name\", \"location\"]}}"},{"types","{\"ADTs\": {}, \"records\": {\"r:AST_Location\": {\"arity\": 5, \"types\": [\"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\"]}, \"r:AST_Node\": {\"arity\": 2, \"types\": [\"i:AST_FileId\", \"i:AST_NodeId\"]}}, \"relation\": {\"arity\": 2, \"types\": [\"s:RuleName\", \"r:AST_Location\"]}}"}}); |
| 1392 | + | if (!outputDirectoryArg.empty()) {directiveMap["output-dir"] = outputDirectoryArg;} |
| 1393 | + | IOSystem::getInstance().getWriter(directiveMap, symTable, recordTable)->writeAll(*rel_RuleMatch_8974a5cadf2d4779); |
| 1394 | + | } catch (std::exception& e) {std::cerr << e.what();exit(1);} |
| 1395 | + | } |
| 1396 | + | |
| 1397 | + | void Sf_souffle::loadAll([[maybe_unused]] std::string inputDirectoryArg){ |
| 1398 | + | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","node\tcontent"},{"auxArity","0"},{"fact-dir","."},{"name","AST_NodeContent"},{"operation","input"},{"params","{\"records\": {\"AST_Location\": {\"arity\": 5, \"params\": [\"startByte\", \"startLine\", \"startColumn\", \"endLine\", \"endColumn\"]}, \"AST_Node\": {\"arity\": 2, \"params\": [\"file\", \"nodeId\"]}}, \"relation\": {\"arity\": 2, \"params\": [\"node\", \"content\"]}}"},{"types","{\"ADTs\": {}, \"records\": {\"r:AST_Location\": {\"arity\": 5, \"types\": [\"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\"]}, \"r:AST_Node\": {\"arity\": 2, \"types\": [\"i:AST_FileId\", \"i:AST_NodeId\"]}}, \"relation\": {\"arity\": 2, \"types\": [\"r:AST_Node\", \"s:AST_Content\"]}}"}}); |
| 1399 | + | if (!inputDirectoryArg.empty()) {directiveMap["fact-dir"] = inputDirectoryArg;} |
| 1400 | + | IOSystem::getInstance().getReader(directiveMap, symTable, recordTable)->readAll(*rel_AST_NodeContent_b2f3666572e60754); |
| 1401 | + | } catch (std::exception& e) {std::cerr << "Error loading AST_NodeContent data: " << e.what() << '\n'; |
| 1402 | + | exit(1); |
| 1403 | + | } |
| 1404 | + | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","parent\tindex\tchild"},{"auxArity","0"},{"fact-dir","."},{"name","AST_ParentChild"},{"operation","input"},{"params","{\"records\": {\"AST_Location\": {\"arity\": 5, \"params\": [\"startByte\", \"startLine\", \"startColumn\", \"endLine\", \"endColumn\"]}, \"AST_Node\": {\"arity\": 2, \"params\": [\"file\", \"nodeId\"]}}, \"relation\": {\"arity\": 3, \"params\": [\"parent\", \"index\", \"child\"]}}"},{"types","{\"ADTs\": {}, \"records\": {\"r:AST_Location\": {\"arity\": 5, \"types\": [\"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\"]}, \"r:AST_Node\": {\"arity\": 2, \"types\": [\"i:AST_FileId\", \"i:AST_NodeId\"]}}, \"relation\": {\"arity\": 3, \"types\": [\"r:AST_Node\", \"u:unsigned\", \"r:AST_Node\"]}}"}}); |
| 1405 | + | if (!inputDirectoryArg.empty()) {directiveMap["fact-dir"] = inputDirectoryArg;} |
| 1406 | + | IOSystem::getInstance().getReader(directiveMap, symTable, recordTable)->readAll(*rel_AST_ParentChild_be6259205eb66578); |
| 1407 | + | } catch (std::exception& e) {std::cerr << "Error loading AST_ParentChild data: " << e.what() << '\n'; |
| 1408 | + | exit(1); |
| 1409 | + | } |
| 1410 | + | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","node\ttype"},{"auxArity","0"},{"fact-dir","."},{"name","AST_NodeType"},{"operation","input"},{"params","{\"records\": {\"AST_Location\": {\"arity\": 5, \"params\": [\"startByte\", \"startLine\", \"startColumn\", \"endLine\", \"endColumn\"]}, \"AST_Node\": {\"arity\": 2, \"params\": [\"file\", \"nodeId\"]}}, \"relation\": {\"arity\": 2, \"params\": [\"node\", \"type\"]}}"},{"types","{\"ADTs\": {}, \"records\": {\"r:AST_Location\": {\"arity\": 5, \"types\": [\"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\"]}, \"r:AST_Node\": {\"arity\": 2, \"types\": [\"i:AST_FileId\", \"i:AST_NodeId\"]}}, \"relation\": {\"arity\": 2, \"types\": [\"r:AST_Node\", \"s:AST_Type\"]}}"}}); |
| 1411 | + | if (!inputDirectoryArg.empty()) {directiveMap["fact-dir"] = inputDirectoryArg;} |
| 1412 | + | IOSystem::getInstance().getReader(directiveMap, symTable, recordTable)->readAll(*rel_AST_NodeType_b38285ae9991409e); |
| 1413 | + | } catch (std::exception& e) {std::cerr << "Error loading AST_NodeType data: " << e.what() << '\n'; |
| 1414 | + | exit(1); |
| 1415 | + | } |
| 1416 | + | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","node\tlocation"},{"auxArity","0"},{"fact-dir","."},{"name","AST_NodeLocation"},{"operation","input"},{"params","{\"records\": {\"AST_Location\": {\"arity\": 5, \"params\": [\"startByte\", \"startLine\", \"startColumn\", \"endLine\", \"endColumn\"]}, \"AST_Node\": {\"arity\": 2, \"params\": [\"file\", \"nodeId\"]}}, \"relation\": {\"arity\": 2, \"params\": [\"node\", \"location\"]}}"},{"types","{\"ADTs\": {}, \"records\": {\"r:AST_Location\": {\"arity\": 5, \"types\": [\"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\"]}, \"r:AST_Node\": {\"arity\": 2, \"types\": [\"i:AST_FileId\", \"i:AST_NodeId\"]}}, \"relation\": {\"arity\": 2, \"types\": [\"r:AST_Node\", \"r:AST_Location\"]}}"}}); |
| 1417 | + | if (!inputDirectoryArg.empty()) {directiveMap["fact-dir"] = inputDirectoryArg;} |
| 1418 | + | IOSystem::getInstance().getReader(directiveMap, symTable, recordTable)->readAll(*rel_AST_NodeLocation_5f3f38ee7a82c12a); |
| 1419 | + | } catch (std::exception& e) {std::cerr << "Error loading AST_NodeLocation data: " << e.what() << '\n'; |
| 1420 | + | exit(1); |
| 1421 | + | } |
| 1422 | + | try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","parent\tchild\tfield"},{"auxArity","0"},{"fact-dir","."},{"name","AST_NodeField"},{"operation","input"},{"params","{\"records\": {\"AST_Location\": {\"arity\": 5, \"params\": [\"startByte\", \"startLine\", \"startColumn\", \"endLine\", \"endColumn\"]}, \"AST_Node\": {\"arity\": 2, \"params\": [\"file\", \"nodeId\"]}}, \"relation\": {\"arity\": 3, \"params\": [\"parent\", \"child\", \"field\"]}}"},{"types","{\"ADTs\": {}, \"records\": {\"r:AST_Location\": {\"arity\": 5, \"types\": [\"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\", \"i:AST_FilePosition\"]}, \"r:AST_Node\": {\"arity\": 2, \"types\": [\"i:AST_FileId\", \"i:AST_NodeId\"]}}, \"relation\": {\"arity\": 3, \"types\": [\"r:AST_Node\", \"r:AST_Node\", \"s:AST_Field\"]}}"}}); |
| 1423 | + | if (!inputDirectoryArg.empty()) {directiveMap["fact-dir"] = inputDirectoryArg;} |
| 1424 | + | IOSystem::getInstance().getReader(directiveMap, symTable, recordTable)->readAll(*rel_AST_NodeField_ca02670731ce3c99); |
| 1425 | + | } catch (std::exception& e) {std::cerr << "Error loading AST_NodeField data: " << e.what() << '\n'; |
| 1426 | + | exit(1); |
| 1427 | + | } |
| 1428 | + | } |
| 1429 | + | |
| 1430 | + | void Sf_souffle::dumpInputs(){ |
| 1431 | + | try {std::map<std::string, std::string> rwOperation; |
| 1432 | + | rwOperation["IO"] = "stdout"; |
| 1433 | + | rwOperation["name"] = "AST_NodeContent"; |
| 1434 | + | rwOperation["types"] = "{\"relation\": {\"arity\": 2, \"auxArity\": 0, \"types\": [\"r:AST_Node\", \"s:AST_Content\"]}}"; |
| 1435 | + | IOSystem::getInstance().getWriter(rwOperation, symTable, recordTable)->writeAll(*rel_AST_NodeContent_b2f3666572e60754); |
| 1436 | + | } catch (std::exception& e) {std::cerr << e.what();exit(1);} |
| 1437 | + | try {std::map<std::string, std::string> rwOperation; |
| 1438 | + | rwOperation["IO"] = "stdout"; |
| 1439 | + | rwOperation["name"] = "AST_ParentChild"; |
| 1440 | + | rwOperation["types"] = "{\"relation\": {\"arity\": 3, \"auxArity\": 0, \"types\": [\"r:AST_Node\", \"u:unsigned\", \"r:AST_Node\"]}}"; |
| 1441 | + | IOSystem::getInstance().getWriter(rwOperation, symTable, recordTable)->writeAll(*rel_AST_ParentChild_be6259205eb66578); |
| 1442 | + | } catch (std::exception& e) {std::cerr << e.what();exit(1);} |
| 1443 | + | try {std::map<std::string, std::string> rwOperation; |
| 1444 | + | rwOperation["IO"] = "stdout"; |
| 1445 | + | rwOperation["name"] = "AST_NodeType"; |
| 1446 | + | rwOperation["types"] = "{\"relation\": {\"arity\": 2, \"auxArity\": 0, \"types\": [\"r:AST_Node\", \"s:AST_Type\"]}}"; |
| 1447 | + | IOSystem::getInstance().getWriter(rwOperation, symTable, recordTable)->writeAll(*rel_AST_NodeType_b38285ae9991409e); |
| 1448 | + | } catch (std::exception& e) {std::cerr << e.what();exit(1);} |
| 1449 | + | try {std::map<std::string, std::string> rwOperation; |
| 1450 | + | rwOperation["IO"] = "stdout"; |
| 1451 | + | rwOperation["name"] = "AST_NodeLocation"; |
| 1452 | + | rwOperation["types"] = "{\"relation\": {\"arity\": 2, \"auxArity\": 0, \"types\": [\"r:AST_Node\", \"r:AST_Location\"]}}"; |
| 1453 | + | IOSystem::getInstance().getWriter(rwOperation, symTable, recordTable)->writeAll(*rel_AST_NodeLocation_5f3f38ee7a82c12a); |
| 1454 | + | } catch (std::exception& e) {std::cerr << e.what();exit(1);} |
| 1455 | + | try {std::map<std::string, std::string> rwOperation; |
| 1456 | + | rwOperation["IO"] = "stdout"; |
| 1457 | + | rwOperation["name"] = "AST_NodeField"; |
| 1458 | + | rwOperation["types"] = "{\"relation\": {\"arity\": 3, \"auxArity\": 0, \"types\": [\"r:AST_Node\", \"r:AST_Node\", \"s:AST_Field\"]}}"; |
| 1459 | + | IOSystem::getInstance().getWriter(rwOperation, symTable, recordTable)->writeAll(*rel_AST_NodeField_ca02670731ce3c99); |
| 1460 | + | } catch (std::exception& e) {std::cerr << e.what();exit(1);} |
| 1461 | + | } |
| 1462 | + | |
| 1463 | + | void Sf_souffle::dumpOutputs(){ |
| 1464 | + | try {std::map<std::string, std::string> rwOperation; |
| 1465 | + | rwOperation["IO"] = "stdout"; |
| 1466 | + | rwOperation["name"] = "RuleMatch"; |
| 1467 | + | rwOperation["types"] = "{\"relation\": {\"arity\": 2, \"auxArity\": 0, \"types\": [\"s:RuleName\", \"r:AST_Location\"]}}"; |
| 1468 | + | IOSystem::getInstance().getWriter(rwOperation, symTable, recordTable)->writeAll(*rel_RuleMatch_8974a5cadf2d4779); |
| 1469 | + | } catch (std::exception& e) {std::cerr << e.what();exit(1);} |
| 1470 | + | } |
| 1471 | + | |
| 1472 | + | SymbolTable& Sf_souffle::getSymbolTable(){ |
| 1473 | + | return symTable; |
| 1474 | + | } |
| 1475 | + | |
| 1476 | + | RecordTable& Sf_souffle::getRecordTable(){ |
| 1477 | + | return recordTable; |
| 1478 | + | } |
| 1479 | + | |
| 1480 | + | void Sf_souffle::setNumThreads(std::size_t numThreadsValue){ |
| 1481 | + | SouffleProgram::setNumThreads(numThreadsValue); |
| 1482 | + | symTable.setNumLanes(getNumThreads()); |
| 1483 | + | recordTable.setNumLanes(getNumThreads()); |
| 1484 | + | regexCache.setNumLanes(getNumThreads()); |
| 1485 | + | } |
| 1486 | + | |
| 1487 | + | void Sf_souffle::executeSubroutine(std::string name,const std::vector<RamDomain>& args,std::vector<RamDomain>& ret){ |
| 1488 | + | if (name == "AST_NodeContent") { |
| 1489 | + | stratum_AST_NodeContent_f29a0e907561c50c.run(args, ret); |
| 1490 | + | return;} |
| 1491 | + | if (name == "AST_NodeField") { |
| 1492 | + | stratum_AST_NodeField_b63714d335ba8b2e.run(args, ret); |
| 1493 | + | return;} |
| 1494 | + | if (name == "AST_NodeLocation") { |
| 1495 | + | stratum_AST_NodeLocation_b120359576603175.run(args, ret); |
| 1496 | + | return;} |
| 1497 | + | if (name == "AST_NodeType") { |
| 1498 | + | stratum_AST_NodeType_f0647903c04c5ec5.run(args, ret); |
| 1499 | + | return;} |
| 1500 | + | if (name == "AST_ParentChild") { |
| 1501 | + | stratum_AST_ParentChild_381ffe0668807a9c.run(args, ret); |
| 1502 | + | return;} |
| 1503 | + | if (name == "Rule") { |
| 1504 | + | stratum_Rule_b7f309df7d140ebc.run(args, ret); |
| 1505 | + | return;} |
| 1506 | + | if (name == "RuleMatch") { |
| 1507 | + | stratum_RuleMatch_a3becf205b4cd965.run(args, ret); |
| 1508 | + | return;} |
| 1509 | + | fatal(("unknown subroutine " + name).c_str()); |
| 1510 | + | } |
| 1511 | + | |
| 1512 | + | } // namespace souffle |
| 1513 | + | namespace souffle { |
| 1514 | + | SouffleProgram *newInstance_souffle(){return new souffle::Sf_souffle;} |
| 1515 | + | SymbolTable *getST_souffle(SouffleProgram *p){return &reinterpret_cast<souffle::Sf_souffle*>(p)->getSymbolTable();} |
| 1516 | + | } // namespace souffle |
| 1517 | + | |
| 1518 | + | #ifndef __EMBEDDED_SOUFFLE__ |
| 1519 | + | #include "souffle/CompiledOptions.h" |
| 1520 | + | int main(int argc, char** argv) |
| 1521 | + | { |
| 1522 | + | try{ |
| 1523 | + | souffle::CmdOptions opt(R"(souffle/ruby.dl)", |
| 1524 | + | R"()", |
| 1525 | + | R"()", |
| 1526 | + | false, |
| 1527 | + | R"()", |
| 1528 | + | 1); |
| 1529 | + | if (!opt.parse(argc,argv)) return 1; |
| 1530 | + | souffle::Sf_souffle obj; |
| 1531 | + | #if defined(_OPENMP) |
| 1532 | + | obj.setNumThreads(opt.getNumJobs()); |
| 1533 | + | |
| 1534 | + | #endif |
| 1535 | + | obj.runAll(opt.getInputFileDir(), opt.getOutputFileDir()); |
| 1536 | + | return 0; |
| 1537 | + | } catch(std::exception &e) { souffle::SignalHandler::instance()->error(e.what());} |
| 1538 | + | } |
| 1539 | + | #endif |
| 1540 | + | |
| 1541 | + | namespace souffle { |
| 1542 | + | using namespace souffle; |
| 1543 | + | class factory_Sf_souffle: souffle::ProgramFactory { |
| 1544 | + | public: |
| 1545 | + | souffle::SouffleProgram* newInstance(); |
| 1546 | + | factory_Sf_souffle(); |
| 1547 | + | private: |
| 1548 | + | }; |
| 1549 | + | } // namespace souffle |
| 1550 | + | namespace souffle { |
| 1551 | + | using namespace souffle; |
| 1552 | + | souffle::SouffleProgram* factory_Sf_souffle::newInstance(){ |
| 1553 | + | return new souffle::Sf_souffle(); |
| 1554 | + | } |
| 1555 | + | |
| 1556 | + | factory_Sf_souffle::factory_Sf_souffle(): |
| 1557 | + | souffle::ProgramFactory("souffle"){ |
| 1558 | + | } |
| 1559 | + | |
| 1560 | + | } // namespace souffle |
| 1561 | + | namespace souffle { |
| 1562 | + | |
| 1563 | + | #ifdef __EMBEDDED_SOUFFLE__ |
| 1564 | + | extern "C" { |
| 1565 | + | souffle::factory_Sf_souffle __factory_Sf_souffle_instance; |
| 1566 | + | } |
| 1567 | + | #endif |
| 1568 | + | } // namespace souffle |
| 1569 | + | |
| 1570 | + | |