OILS / prebuilt / datalog / smoke-test.cc View on Github | oilshell.org

657 lines, 514 significant
1#define SOUFFLE_GENERATOR_VERSION "39d42a366"
2#include "souffle/CompiledSouffle.h"
3#include "souffle/SignalHandler.h"
4#include "souffle/SouffleInterface.h"
5#include "souffle/datastructure/BTree.h"
6#include "souffle/io/IOSystem.h"
7#include <any>
8namespace functors {
9extern "C" {
10}
11} //namespace functors
12namespace souffle::t_btree_ii__0_1__11 {
13using namespace souffle;
14struct Type {
15static constexpr Relation::arity_type Arity = 2;
16using t_tuple = Tuple<RamDomain, 2>;
17struct 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 }
21bool 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 }
24bool equal(const t_tuple& a, const t_tuple& b) const {
25return (ramBitCast<RamSigned>(a[0]) == ramBitCast<RamSigned>(b[0]))&&(ramBitCast<RamSigned>(a[1]) == ramBitCast<RamSigned>(b[1]));
26 }
27};
28using t_ind_0 = btree_set<t_tuple,t_comparator_0>;
29t_ind_0 ind_0;
30using iterator = t_ind_0::iterator;
31struct context {
32t_ind_0::operation_hints hints_0_lower;
33t_ind_0::operation_hints hints_0_upper;
34};
35context createContext() { return context(); }
36bool insert(const t_tuple& t);
37bool insert(const t_tuple& t, context& h);
38bool insert(const RamDomain* ramDomain);
39bool insert(RamDomain a0,RamDomain a1);
40bool contains(const t_tuple& t, context& h) const;
41bool contains(const t_tuple& t) const;
42std::size_t size() const;
43iterator find(const t_tuple& t, context& h) const;
44iterator find(const t_tuple& t) const;
45range<iterator> lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const;
46range<iterator> lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */) const;
47range<t_ind_0::iterator> lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper, context& h) const;
48range<t_ind_0::iterator> lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper) const;
49bool empty() const;
50std::vector<range<iterator>> partition() const;
51void purge();
52iterator begin() const;
53iterator end() const;
54void printStatistics(std::ostream& o) const;
55};
56} // namespace souffle::t_btree_ii__0_1__11
57namespace souffle::t_btree_ii__0_1__11 {
58using namespace souffle;
59using t_ind_0 = Type::t_ind_0;
60using iterator = Type::iterator;
61using context = Type::context;
62bool Type::insert(const t_tuple& t) {
63context h;
64return insert(t, h);
65}
66bool Type::insert(const t_tuple& t, context& h) {
67if (ind_0.insert(t, h.hints_0_lower)) {
68return true;
69} else return false;
70}
71bool Type::insert(const RamDomain* ramDomain) {
72RamDomain data[2];
73std::copy(ramDomain, ramDomain + 2, data);
74const t_tuple& tuple = reinterpret_cast<const t_tuple&>(data);
75context h;
76return insert(tuple, h);
77}
78bool Type::insert(RamDomain a0,RamDomain a1) {
79RamDomain data[2] = {a0,a1};
80return insert(data);
81}
82bool Type::contains(const t_tuple& t, context& h) const {
83return ind_0.contains(t, h.hints_0_lower);
84}
85bool Type::contains(const t_tuple& t) const {
86context h;
87return contains(t, h);
88}
89std::size_t Type::size() const {
90return ind_0.size();
91}
92iterator Type::find(const t_tuple& t, context& h) const {
93return ind_0.find(t, h.hints_0_lower);
94}
95iterator Type::find(const t_tuple& t) const {
96context h;
97return find(t, h);
98}
99range<iterator> Type::lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const {
100return range<iterator>(ind_0.begin(),ind_0.end());
101}
102range<iterator> Type::lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */) const {
103return range<iterator>(ind_0.begin(),ind_0.end());
104}
105range<t_ind_0::iterator> Type::lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper, context& h) const {
106t_comparator_0 comparator;
107int cmp = comparator(lower, upper);
108if (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}
114if (cmp > 0) {
115 return make_range(ind_0.end(), ind_0.end());
116}
117return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper));
118}
119range<t_ind_0::iterator> Type::lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper) const {
120context h;
121return lowerUpperRange_11(lower,upper,h);
122}
123bool Type::empty() const {
124return ind_0.empty();
125}
126std::vector<range<iterator>> Type::partition() const {
127return ind_0.getChunks(400);
128}
129void Type::purge() {
130ind_0.clear();
131}
132iterator Type::begin() const {
133return ind_0.begin();
134}
135iterator Type::end() const {
136return ind_0.end();
137}
138void Type::printStatistics(std::ostream& o) const {
139o << " arity 2 direct b-tree index 0 lex-order [0,1]\n";
140ind_0.printStats(o);
141}
142} // namespace souffle::t_btree_ii__0_1__11
143namespace souffle::t_btree_ii__0_1__11__10 {
144using namespace souffle;
145struct Type {
146static constexpr Relation::arity_type Arity = 2;
147using t_tuple = Tuple<RamDomain, 2>;
148struct 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[1]) < ramBitCast<RamSigned>(b[1])) ? -1 : (ramBitCast<RamSigned>(a[1]) > ramBitCast<RamSigned>(b[1])) ? 1 :(0));
151 }
152bool 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[1]) < ramBitCast<RamSigned>(b[1]))));
154 }
155bool equal(const t_tuple& a, const t_tuple& b) const {
156return (ramBitCast<RamSigned>(a[0]) == ramBitCast<RamSigned>(b[0]))&&(ramBitCast<RamSigned>(a[1]) == ramBitCast<RamSigned>(b[1]));
157 }
158};
159using t_ind_0 = btree_set<t_tuple,t_comparator_0>;
160t_ind_0 ind_0;
161using iterator = t_ind_0::iterator;
162struct context {
163t_ind_0::operation_hints hints_0_lower;
164t_ind_0::operation_hints hints_0_upper;
165};
166context createContext() { return context(); }
167bool insert(const t_tuple& t);
168bool insert(const t_tuple& t, context& h);
169bool insert(const RamDomain* ramDomain);
170bool insert(RamDomain a0,RamDomain a1);
171bool contains(const t_tuple& t, context& h) const;
172bool contains(const t_tuple& t) const;
173std::size_t size() const;
174iterator find(const t_tuple& t, context& h) const;
175iterator find(const t_tuple& t) const;
176range<iterator> lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const;
177range<iterator> lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */) const;
178range<t_ind_0::iterator> lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper, context& h) const;
179range<t_ind_0::iterator> lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper) const;
180range<t_ind_0::iterator> lowerUpperRange_10(const t_tuple& lower, const t_tuple& upper, context& h) const;
181range<t_ind_0::iterator> lowerUpperRange_10(const t_tuple& lower, const t_tuple& upper) const;
182bool empty() const;
183std::vector<range<iterator>> partition() const;
184void purge();
185iterator begin() const;
186iterator end() const;
187void printStatistics(std::ostream& o) const;
188};
189} // namespace souffle::t_btree_ii__0_1__11__10
190namespace souffle::t_btree_ii__0_1__11__10 {
191using namespace souffle;
192using t_ind_0 = Type::t_ind_0;
193using iterator = Type::iterator;
194using context = Type::context;
195bool Type::insert(const t_tuple& t) {
196context h;
197return insert(t, h);
198}
199bool Type::insert(const t_tuple& t, context& h) {
200if (ind_0.insert(t, h.hints_0_lower)) {
201return true;
202} else return false;
203}
204bool Type::insert(const RamDomain* ramDomain) {
205RamDomain data[2];
206std::copy(ramDomain, ramDomain + 2, data);
207const t_tuple& tuple = reinterpret_cast<const t_tuple&>(data);
208context h;
209return insert(tuple, h);
210}
211bool Type::insert(RamDomain a0,RamDomain a1) {
212RamDomain data[2] = {a0,a1};
213return insert(data);
214}
215bool Type::contains(const t_tuple& t, context& h) const {
216return ind_0.contains(t, h.hints_0_lower);
217}
218bool Type::contains(const t_tuple& t) const {
219context h;
220return contains(t, h);
221}
222std::size_t Type::size() const {
223return ind_0.size();
224}
225iterator Type::find(const t_tuple& t, context& h) const {
226return ind_0.find(t, h.hints_0_lower);
227}
228iterator Type::find(const t_tuple& t) const {
229context h;
230return find(t, h);
231}
232range<iterator> Type::lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */, context& /* h */) const {
233return range<iterator>(ind_0.begin(),ind_0.end());
234}
235range<iterator> Type::lowerUpperRange_00(const t_tuple& /* lower */, const t_tuple& /* upper */) const {
236return range<iterator>(ind_0.begin(),ind_0.end());
237}
238range<t_ind_0::iterator> Type::lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper, context& h) const {
239t_comparator_0 comparator;
240int cmp = comparator(lower, upper);
241if (cmp == 0) {
242 auto pos = ind_0.find(lower, h.hints_0_lower);
243 auto fin = ind_0.end();
244 if (pos != fin) {fin = pos; ++fin;}
245 return make_range(pos, fin);
246}
247if (cmp > 0) {
248 return make_range(ind_0.end(), ind_0.end());
249}
250return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper));
251}
252range<t_ind_0::iterator> Type::lowerUpperRange_11(const t_tuple& lower, const t_tuple& upper) const {
253context h;
254return lowerUpperRange_11(lower,upper,h);
255}
256range<t_ind_0::iterator> Type::lowerUpperRange_10(const t_tuple& lower, const t_tuple& upper, context& h) const {
257t_comparator_0 comparator;
258int cmp = comparator(lower, upper);
259if (cmp > 0) {
260 return make_range(ind_0.end(), ind_0.end());
261}
262return make_range(ind_0.lower_bound(lower, h.hints_0_lower), ind_0.upper_bound(upper, h.hints_0_upper));
263}
264range<t_ind_0::iterator> Type::lowerUpperRange_10(const t_tuple& lower, const t_tuple& upper) const {
265context h;
266return lowerUpperRange_10(lower,upper,h);
267}
268bool Type::empty() const {
269return ind_0.empty();
270}
271std::vector<range<iterator>> Type::partition() const {
272return ind_0.getChunks(400);
273}
274void Type::purge() {
275ind_0.clear();
276}
277iterator Type::begin() const {
278return ind_0.begin();
279}
280iterator Type::end() const {
281return ind_0.end();
282}
283void Type::printStatistics(std::ostream& o) const {
284o << " arity 2 direct b-tree index 0 lex-order [0,1]\n";
285ind_0.printStats(o);
286}
287} // namespace souffle::t_btree_ii__0_1__11__10
288namespace souffle {
289using namespace souffle;
290class Stratum_edge_9543a759b165a2cb {
291public:
292 Stratum_edge_9543a759b165a2cb(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_edge_04d25f5060e9043b);
293void run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret);
294private:
295SymbolTable& symTable;
296RecordTable& recordTable;
297ConcurrentCache<std::string,std::regex>& regexCache;
298bool& pruneImdtRels;
299bool& performIO;
300SignalHandler*& signalHandler;
301std::atomic<std::size_t>& iter;
302std::atomic<RamDomain>& ctr;
303std::string& inputDirectory;
304std::string& outputDirectory;
305t_btree_ii__0_1__11::Type* rel_edge_04d25f5060e9043b;
306};
307} // namespace souffle
308namespace souffle {
309using namespace souffle;
310 Stratum_edge_9543a759b165a2cb::Stratum_edge_9543a759b165a2cb(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_edge_04d25f5060e9043b):
311symTable(symTable),
312recordTable(recordTable),
313regexCache(regexCache),
314pruneImdtRels(pruneImdtRels),
315performIO(performIO),
316signalHandler(signalHandler),
317iter(iter),
318ctr(ctr),
319inputDirectory(inputDirectory),
320outputDirectory(outputDirectory),
321rel_edge_04d25f5060e9043b(&rel_edge_04d25f5060e9043b){
322}
323
324void Stratum_edge_9543a759b165a2cb::run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret){
325signalHandler->setMsg(R"_(edge(1,2).
326in file smoke-test.dl [3:1-3:12])_");
327[&](){
328CREATE_OP_CONTEXT(rel_edge_04d25f5060e9043b_op_ctxt,rel_edge_04d25f5060e9043b->createContext());
329Tuple<RamDomain,2> tuple{{ramBitCast(RamSigned(1)),ramBitCast(RamSigned(2))}};
330rel_edge_04d25f5060e9043b->insert(tuple,READ_OP_CONTEXT(rel_edge_04d25f5060e9043b_op_ctxt));
331}
332();signalHandler->setMsg(R"_(edge(2,3).
333in file smoke-test.dl [4:1-4:12])_");
334[&](){
335CREATE_OP_CONTEXT(rel_edge_04d25f5060e9043b_op_ctxt,rel_edge_04d25f5060e9043b->createContext());
336Tuple<RamDomain,2> tuple{{ramBitCast(RamSigned(2)),ramBitCast(RamSigned(3))}};
337rel_edge_04d25f5060e9043b->insert(tuple,READ_OP_CONTEXT(rel_edge_04d25f5060e9043b_op_ctxt));
338}
339();}
340
341} // namespace souffle
342
343namespace souffle {
344using namespace souffle;
345class Stratum_path_614f1ce382100c3f {
346public:
347 Stratum_path_614f1ce382100c3f(SymbolTable& symTable,RecordTable& recordTable,ConcurrentCache<std::string,std::regex>& regexCache,bool& pruneImdtRels,bool& performIO,SignalHandler*& signalHandler,std::atomic<std::size_t>& iter,std::atomic<RamDomain>& ctr,std::string& inputDirectory,std::string& outputDirectory,t_btree_ii__0_1__11__10::Type& rel_delta_path_23da6daa27e8b245,t_btree_ii__0_1__11__10::Type& rel_new_path_a0453b38c2806942,t_btree_ii__0_1__11::Type& rel_edge_04d25f5060e9043b,t_btree_ii__0_1__11::Type& rel_path_76cf4ab0e06a645b);
348void run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret);
349private:
350SymbolTable& symTable;
351RecordTable& recordTable;
352ConcurrentCache<std::string,std::regex>& regexCache;
353bool& pruneImdtRels;
354bool& performIO;
355SignalHandler*& signalHandler;
356std::atomic<std::size_t>& iter;
357std::atomic<RamDomain>& ctr;
358std::string& inputDirectory;
359std::string& outputDirectory;
360t_btree_ii__0_1__11__10::Type* rel_delta_path_23da6daa27e8b245;
361t_btree_ii__0_1__11__10::Type* rel_new_path_a0453b38c2806942;
362t_btree_ii__0_1__11::Type* rel_edge_04d25f5060e9043b;
363t_btree_ii__0_1__11::Type* rel_path_76cf4ab0e06a645b;
364};
365} // namespace souffle
366namespace souffle {
367using namespace souffle;
368 Stratum_path_614f1ce382100c3f::Stratum_path_614f1ce382100c3f(SymbolTable& symTable,RecordTable& recordTable,ConcurrentCache<std::string,std::regex>& regexCache,bool& pruneImdtRels,bool& performIO,SignalHandler*& signalHandler,std::atomic<std::size_t>& iter,std::atomic<RamDomain>& ctr,std::string& inputDirectory,std::string& outputDirectory,t_btree_ii__0_1__11__10::Type& rel_delta_path_23da6daa27e8b245,t_btree_ii__0_1__11__10::Type& rel_new_path_a0453b38c2806942,t_btree_ii__0_1__11::Type& rel_edge_04d25f5060e9043b,t_btree_ii__0_1__11::Type& rel_path_76cf4ab0e06a645b):
369symTable(symTable),
370recordTable(recordTable),
371regexCache(regexCache),
372pruneImdtRels(pruneImdtRels),
373performIO(performIO),
374signalHandler(signalHandler),
375iter(iter),
376ctr(ctr),
377inputDirectory(inputDirectory),
378outputDirectory(outputDirectory),
379rel_delta_path_23da6daa27e8b245(&rel_delta_path_23da6daa27e8b245),
380rel_new_path_a0453b38c2806942(&rel_new_path_a0453b38c2806942),
381rel_edge_04d25f5060e9043b(&rel_edge_04d25f5060e9043b),
382rel_path_76cf4ab0e06a645b(&rel_path_76cf4ab0e06a645b){
383}
384
385void Stratum_path_614f1ce382100c3f::run([[maybe_unused]] const std::vector<RamDomain>& args,[[maybe_unused]] std::vector<RamDomain>& ret){
386signalHandler->setMsg(R"_(path(u,v) :-
387 edge(u,v).
388in file smoke-test.dl [9:1-9:26])_");
389if(!(rel_edge_04d25f5060e9043b->empty())) {
390[&](){
391CREATE_OP_CONTEXT(rel_edge_04d25f5060e9043b_op_ctxt,rel_edge_04d25f5060e9043b->createContext());
392CREATE_OP_CONTEXT(rel_path_76cf4ab0e06a645b_op_ctxt,rel_path_76cf4ab0e06a645b->createContext());
393for(const auto& env0 : *rel_edge_04d25f5060e9043b) {
394Tuple<RamDomain,2> tuple{{ramBitCast(env0[0]),ramBitCast(env0[1])}};
395rel_path_76cf4ab0e06a645b->insert(tuple,READ_OP_CONTEXT(rel_path_76cf4ab0e06a645b_op_ctxt));
396}
397}
398();}
399[&](){
400CREATE_OP_CONTEXT(rel_delta_path_23da6daa27e8b245_op_ctxt,rel_delta_path_23da6daa27e8b245->createContext());
401CREATE_OP_CONTEXT(rel_path_76cf4ab0e06a645b_op_ctxt,rel_path_76cf4ab0e06a645b->createContext());
402for(const auto& env0 : *rel_path_76cf4ab0e06a645b) {
403Tuple<RamDomain,2> tuple{{ramBitCast(env0[0]),ramBitCast(env0[1])}};
404rel_delta_path_23da6daa27e8b245->insert(tuple,READ_OP_CONTEXT(rel_delta_path_23da6daa27e8b245_op_ctxt));
405}
406}
407();auto loop_counter = RamUnsigned(1);
408iter = 0;
409for(;;) {
410signalHandler->setMsg(R"_(path(u,w) :-
411 edge(u,v),
412 path(v,w).
413in file smoke-test.dl [10:1-10:38])_");
414if(!(rel_edge_04d25f5060e9043b->empty()) && !(rel_delta_path_23da6daa27e8b245->empty())) {
415[&](){
416CREATE_OP_CONTEXT(rel_delta_path_23da6daa27e8b245_op_ctxt,rel_delta_path_23da6daa27e8b245->createContext());
417CREATE_OP_CONTEXT(rel_new_path_a0453b38c2806942_op_ctxt,rel_new_path_a0453b38c2806942->createContext());
418CREATE_OP_CONTEXT(rel_edge_04d25f5060e9043b_op_ctxt,rel_edge_04d25f5060e9043b->createContext());
419CREATE_OP_CONTEXT(rel_path_76cf4ab0e06a645b_op_ctxt,rel_path_76cf4ab0e06a645b->createContext());
420for(const auto& env0 : *rel_edge_04d25f5060e9043b) {
421auto range = rel_delta_path_23da6daa27e8b245->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_delta_path_23da6daa27e8b245_op_ctxt));
422for(const auto& env1 : range) {
423if( !(rel_path_76cf4ab0e06a645b->contains(Tuple<RamDomain,2>{{ramBitCast(env0[0]),ramBitCast(env1[1])}},READ_OP_CONTEXT(rel_path_76cf4ab0e06a645b_op_ctxt)))) {
424Tuple<RamDomain,2> tuple{{ramBitCast(env0[0]),ramBitCast(env1[1])}};
425rel_new_path_a0453b38c2806942->insert(tuple,READ_OP_CONTEXT(rel_new_path_a0453b38c2806942_op_ctxt));
426}
427}
428}
429}
430();}
431if(rel_new_path_a0453b38c2806942->empty()) break;
432[&](){
433CREATE_OP_CONTEXT(rel_new_path_a0453b38c2806942_op_ctxt,rel_new_path_a0453b38c2806942->createContext());
434CREATE_OP_CONTEXT(rel_path_76cf4ab0e06a645b_op_ctxt,rel_path_76cf4ab0e06a645b->createContext());
435for(const auto& env0 : *rel_new_path_a0453b38c2806942) {
436Tuple<RamDomain,2> tuple{{ramBitCast(env0[0]),ramBitCast(env0[1])}};
437rel_path_76cf4ab0e06a645b->insert(tuple,READ_OP_CONTEXT(rel_path_76cf4ab0e06a645b_op_ctxt));
438}
439}
440();std::swap(rel_delta_path_23da6daa27e8b245, rel_new_path_a0453b38c2806942);
441rel_new_path_a0453b38c2806942->purge();
442loop_counter = (ramBitCast<RamUnsigned>(loop_counter) + ramBitCast<RamUnsigned>(RamUnsigned(1)));
443iter++;
444}
445iter = 0;
446rel_delta_path_23da6daa27e8b245->purge();
447rel_new_path_a0453b38c2806942->purge();
448if (performIO) {
449try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","u\tv"},{"auxArity","0"},{"filename","path.tsv"},{"name","path"},{"operation","output"},{"output-dir","."},{"params","{\"records\": {}, \"relation\": {\"arity\": 2, \"params\": [\"u\", \"v\"]}}"},{"types","{\"ADTs\": {}, \"records\": {}, \"relation\": {\"arity\": 2, \"types\": [\"i:number\", \"i:number\"]}}"}});
450if (outputDirectory == "-"){directiveMap["IO"] = "stdout"; directiveMap["headers"] = "true";}
451else if (!outputDirectory.empty()) {directiveMap["output-dir"] = outputDirectory;}
452IOSystem::getInstance().getWriter(directiveMap, symTable, recordTable)->writeAll(*rel_path_76cf4ab0e06a645b);
453} catch (std::exception& e) {std::cerr << e.what();exit(1);}
454}
455if (pruneImdtRels) rel_edge_04d25f5060e9043b->purge();
456}
457
458} // namespace souffle
459
460namespace souffle {
461using namespace souffle;
462class Sf__: public SouffleProgram {
463public:
464 Sf__();
465 ~Sf__();
466void run();
467void runAll(std::string inputDirectoryArg = "",std::string outputDirectoryArg = "",bool performIOArg = true,bool pruneImdtRelsArg = true);
468void printAll([[maybe_unused]] std::string outputDirectoryArg = "");
469void loadAll([[maybe_unused]] std::string inputDirectoryArg = "");
470void dumpInputs();
471void dumpOutputs();
472SymbolTable& getSymbolTable();
473RecordTable& getRecordTable();
474void setNumThreads(std::size_t numThreadsValue);
475void executeSubroutine(std::string name,const std::vector<RamDomain>& args,std::vector<RamDomain>& ret);
476private:
477void runFunction(std::string inputDirectoryArg,std::string outputDirectoryArg,bool performIOArg,bool pruneImdtRelsArg);
478SymbolTableImpl symTable;
479SpecializedRecordTable<0> recordTable;
480ConcurrentCache<std::string,std::regex> regexCache;
481Own<t_btree_ii__0_1__11::Type> rel_edge_04d25f5060e9043b;
482souffle::RelationWrapper<t_btree_ii__0_1__11::Type> wrapper_rel_edge_04d25f5060e9043b;
483Own<t_btree_ii__0_1__11::Type> rel_path_76cf4ab0e06a645b;
484souffle::RelationWrapper<t_btree_ii__0_1__11::Type> wrapper_rel_path_76cf4ab0e06a645b;
485Own<t_btree_ii__0_1__11__10::Type> rel_delta_path_23da6daa27e8b245;
486Own<t_btree_ii__0_1__11__10::Type> rel_new_path_a0453b38c2806942;
487Stratum_edge_9543a759b165a2cb stratum_edge_31e40d0d94fe9f7c;
488Stratum_path_614f1ce382100c3f stratum_path_2eecd83fe9440b5c;
489std::string inputDirectory;
490std::string outputDirectory;
491SignalHandler* signalHandler{SignalHandler::instance()};
492std::atomic<RamDomain> ctr{};
493std::atomic<std::size_t> iter{};
494};
495} // namespace souffle
496namespace souffle {
497using namespace souffle;
498 Sf__::Sf__():
499symTable(),
500recordTable(),
501regexCache(),
502rel_edge_04d25f5060e9043b(mk<t_btree_ii__0_1__11::Type>()),
503wrapper_rel_edge_04d25f5060e9043b(0, *rel_edge_04d25f5060e9043b, *this, "edge", std::array<const char *,2>{{"i:number","i:number"}}, std::array<const char *,2>{{"u","v"}}, 0),
504rel_path_76cf4ab0e06a645b(mk<t_btree_ii__0_1__11::Type>()),
505wrapper_rel_path_76cf4ab0e06a645b(1, *rel_path_76cf4ab0e06a645b, *this, "path", std::array<const char *,2>{{"i:number","i:number"}}, std::array<const char *,2>{{"u","v"}}, 0),
506rel_delta_path_23da6daa27e8b245(mk<t_btree_ii__0_1__11__10::Type>()),
507rel_new_path_a0453b38c2806942(mk<t_btree_ii__0_1__11__10::Type>()),
508stratum_edge_31e40d0d94fe9f7c(symTable,recordTable,regexCache,pruneImdtRels,performIO,signalHandler,iter,ctr,inputDirectory,outputDirectory,*rel_edge_04d25f5060e9043b),
509stratum_path_2eecd83fe9440b5c(symTable,recordTable,regexCache,pruneImdtRels,performIO,signalHandler,iter,ctr,inputDirectory,outputDirectory,*rel_delta_path_23da6daa27e8b245,*rel_new_path_a0453b38c2806942,*rel_edge_04d25f5060e9043b,*rel_path_76cf4ab0e06a645b){
510addRelation("edge", wrapper_rel_edge_04d25f5060e9043b, false, false);
511addRelation("path", wrapper_rel_path_76cf4ab0e06a645b, false, true);
512}
513
514 Sf__::~Sf__(){
515}
516
517void Sf__::runFunction(std::string inputDirectoryArg,std::string outputDirectoryArg,bool performIOArg,bool pruneImdtRelsArg){
518
519 this->inputDirectory = std::move(inputDirectoryArg);
520 this->outputDirectory = std::move(outputDirectoryArg);
521 this->performIO = performIOArg;
522 this->pruneImdtRels = pruneImdtRelsArg;
523
524 // set default threads (in embedded mode)
525 // if this is not set, and omp is used, the default omp setting of number of cores is used.
526#if defined(_OPENMP)
527 if (0 < getNumThreads()) { omp_set_num_threads(static_cast<int>(getNumThreads())); }
528#endif
529
530 signalHandler->set();
531// -- query evaluation --
532{
533 std::vector<RamDomain> args, ret;
534stratum_edge_31e40d0d94fe9f7c.run(args, ret);
535}
536{
537 std::vector<RamDomain> args, ret;
538stratum_path_2eecd83fe9440b5c.run(args, ret);
539}
540
541// -- relation hint statistics --
542signalHandler->reset();
543}
544
545void Sf__::run(){
546runFunction("", "", false, false);
547}
548
549void Sf__::runAll(std::string inputDirectoryArg,std::string outputDirectoryArg,bool performIOArg,bool pruneImdtRelsArg){
550runFunction(inputDirectoryArg, outputDirectoryArg, performIOArg, pruneImdtRelsArg);
551}
552
553void Sf__::printAll([[maybe_unused]] std::string outputDirectoryArg){
554try {std::map<std::string, std::string> directiveMap({{"IO","file"},{"attributeNames","u\tv"},{"auxArity","0"},{"filename","path.tsv"},{"name","path"},{"operation","output"},{"output-dir","."},{"params","{\"records\": {}, \"relation\": {\"arity\": 2, \"params\": [\"u\", \"v\"]}}"},{"types","{\"ADTs\": {}, \"records\": {}, \"relation\": {\"arity\": 2, \"types\": [\"i:number\", \"i:number\"]}}"}});
555if (!outputDirectoryArg.empty()) {directiveMap["output-dir"] = outputDirectoryArg;}
556IOSystem::getInstance().getWriter(directiveMap, symTable, recordTable)->writeAll(*rel_path_76cf4ab0e06a645b);
557} catch (std::exception& e) {std::cerr << e.what();exit(1);}
558}
559
560void Sf__::loadAll([[maybe_unused]] std::string inputDirectoryArg){
561}
562
563void Sf__::dumpInputs(){
564}
565
566void Sf__::dumpOutputs(){
567try {std::map<std::string, std::string> rwOperation;
568rwOperation["IO"] = "stdout";
569rwOperation["name"] = "path";
570rwOperation["types"] = "{\"relation\": {\"arity\": 2, \"auxArity\": 0, \"types\": [\"i:number\", \"i:number\"]}}";
571IOSystem::getInstance().getWriter(rwOperation, symTable, recordTable)->writeAll(*rel_path_76cf4ab0e06a645b);
572} catch (std::exception& e) {std::cerr << e.what();exit(1);}
573}
574
575SymbolTable& Sf__::getSymbolTable(){
576return symTable;
577}
578
579RecordTable& Sf__::getRecordTable(){
580return recordTable;
581}
582
583void Sf__::setNumThreads(std::size_t numThreadsValue){
584SouffleProgram::setNumThreads(numThreadsValue);
585symTable.setNumLanes(getNumThreads());
586recordTable.setNumLanes(getNumThreads());
587regexCache.setNumLanes(getNumThreads());
588}
589
590void Sf__::executeSubroutine(std::string name,const std::vector<RamDomain>& args,std::vector<RamDomain>& ret){
591if (name == "edge") {
592stratum_edge_31e40d0d94fe9f7c.run(args, ret);
593return;}
594if (name == "path") {
595stratum_path_2eecd83fe9440b5c.run(args, ret);
596return;}
597fatal(("unknown subroutine " + name).c_str());
598}
599
600} // namespace souffle
601namespace souffle {
602SouffleProgram *newInstance__(){return new souffle::Sf__;}
603SymbolTable *getST__(SouffleProgram *p){return &reinterpret_cast<souffle::Sf__*>(p)->getSymbolTable();}
604} // namespace souffle
605
606#ifndef __EMBEDDED_SOUFFLE__
607#include "souffle/CompiledOptions.h"
608int main(int argc, char** argv)
609{
610try{
611souffle::CmdOptions opt(R"(deps/source.medo/souffle/smoke-test.dl)",
612R"()",
613R"()",
614false,
615R"()",
6161);
617if (!opt.parse(argc,argv)) return 1;
618souffle::Sf__ obj;
619#if defined(_OPENMP)
620obj.setNumThreads(opt.getNumJobs());
621
622#endif
623obj.runAll(opt.getInputFileDir(), opt.getOutputFileDir());
624return 0;
625} catch(std::exception &e) { souffle::SignalHandler::instance()->error(e.what());}
626}
627#endif
628
629namespace souffle {
630using namespace souffle;
631class factory_Sf__: souffle::ProgramFactory {
632public:
633souffle::SouffleProgram* newInstance();
634 factory_Sf__();
635private:
636};
637} // namespace souffle
638namespace souffle {
639using namespace souffle;
640souffle::SouffleProgram* factory_Sf__::newInstance(){
641return new souffle::Sf__();
642}
643
644 factory_Sf__::factory_Sf__():
645souffle::ProgramFactory("_"){
646}
647
648} // namespace souffle
649namespace souffle {
650
651#ifdef __EMBEDDED_SOUFFLE__
652extern "C" {
653souffle::factory_Sf__ __factory_Sf___instance;
654}
655#endif
656} // namespace souffle
657