65 TEST(IO1, CloneAndEquals) {
68 std::map<std::string, std::string> ioEmptyA;
69 std::map<std::string, std::string> ioEmptyB;
70 IO a(
"A", std::move(ioEmptyA));
71 IO
b(
"A", std::move(ioEmptyB));
104 Extend* c = a.clone();
133 VecOwn<Expression> a_expressions;
134 a_expressions.emplace_back(
new TupleElement(0, 0));
135 a_expressions.emplace_back(
new TupleElement(0, 2));
136 auto a_project = mk<Project>(
"B", std::move(a_expressions));
137 auto a_scan = mk<Scan>(
"A", 0, std::move(a_project),
"");
142 auto b_project = mk<Project>(
"B", std::move(b_expressions));
143 auto b_scan = mk<Scan>(
"A", 0, std::move(b_project),
"");
145 Query a(std::move(a_scan));
146 Query b(std::move(b_scan));
162 auto d_return = mk<SubroutineReturn>(std::move(d_return_value));
165 auto d_parallel_choice = mk<ParallelChoice>(
"A", 1, std::move(d_cond), std::move(d_return),
"");
169 auto e_return = mk<SubroutineReturn>(std::move(e_return_value));
172 auto e_parallel_choice = mk<ParallelChoice>(
"A", 1, std::move(e_cond), std::move(e_return),
"");
173 Query d(std::move(d_parallel_choice));
174 Query e(std::move(e_parallel_choice));
199 Sequence
d(mk<Clear>(
"A"));
200 Sequence
e(mk<Clear>(
"A"));
204 Sequence* f =
d.clone();
212 std::map<std::string, std::string> g_load_IODir;
213 std::map<std::string, std::string> h_load_IODir;
214 Sequence g(mk<IO>(
"A", std::move(g_load_IODir)), mk<Clear>(
"A"));
215 Sequence h(mk<IO>(
"A", std::move(h_load_IODir)), mk<Clear>(
"A"));
219 Sequence*
i = g.clone();
225 TEST(Parallel, CloneAndEquals) {
240 auto a_project = mk<Project>(
"B", std::move(a_expressions));
243 std::move(a_project),
"");
244 auto a_scan = mk<Scan>(
"A", 0, std::move(a_cond),
"");
245 auto a_query = mk<Query>(std::move(a_scan));
251 auto b_project = mk<Project>(
"B", std::move(b_expressions));
254 std::move(b_project),
"");
255 auto b_scan = mk<Scan>(
"A", 0, std::move(b_cond),
"");
256 auto b_query = mk<Query>(std::move(b_scan));
278 VecOwn<Expression> a_expressions;
280 auto a_project = mk<Project>(
"B", std::move(a_expressions));
283 std::move(a_project),
"");
284 auto a_scan = mk<Scan>(
"A", 0, std::move(a_break),
"");
285 auto a_query = mk<Query>(std::move(a_scan));
286 Loop a(std::move(a_query));
290 auto b_project = mk<Project>(
"B", std::move(b_expressions));
293 std::move(b_project),
"");
294 auto b_scan = mk<Scan>(
"A", 0, std::move(b_break),
"");
295 auto b_query = mk<Query>(std::move(b_scan));
296 Loop b(std::move(b_query));
308 Exit a(mk<EmptinessCheck>(
"A"));
309 Exit
b(mk<EmptinessCheck>(
"A"));
326 std::map<std::string, std::string> a_IODir;
327 std::map<std::string, std::string> b_IODir;
328 LogRelationTimer a(mk<IO>(
"A", std::move(a_IODir)),
"file.dl [8:1-8:8]",
"A");
329 LogRelationTimer
b(mk<IO>(
"A", std::move(b_IODir)),
"file.dl [8:1-8:8]",
"A");
346 std::map<std::string, std::string> a_IODir;
347 std::map<std::string, std::string> b_IODir;
348 LogTimer a(mk<IO>(
"A", std::move(a_IODir)),
"@runtime");
349 LogTimer
b(mk<IO>(
"A", std::move(a_IODir)),
"@runtime");
361 "edge", 4, 1, {
"src",
"dest",
"a",
"b"}, {
"i",
"i",
"i",
"i"},
RelationRepresentation::DEFAULT);
363 "path", 4, 1, {
"src",
"dest",
"a",
"b"}, {
"i",
"i",
"i",
"i"},
RelationRepresentation::DEFAULT);
368 VecOwn<Expression> a_project_list;
369 a_project_list.emplace_back(
new TupleElement(0, 0));
370 a_project_list.emplace_back(
new TupleElement(0, 1));
376 auto a_project = mk<Project>(
"path", std::move(a_project_list));
382 auto a_existence_check1 = mk<ExistenceCheck>(
"path", std::move(a_filter1_list));
383 auto a_cond1 = mk<Negation>(std::move(a_existence_check1));
384 auto a_filter1 = mk<Filter>(std::move(a_cond1), std::move(a_project),
"");
385 auto a_cond2 = mk<Negation>(mk<EmptinessCheck>(
"edge"));
386 auto a_filter2 = mk<Filter>(std::move(a_cond2), std::move(a_filter1),
"");
387 auto a_scan = mk<Scan>(
"edge", 0, std::move(a_filter2),
"");
388 auto a_query = mk<Query>(std::move(a_scan));
390 "path(x,y,1,(@level_num_0+1)) :- \n edge(x,y,_,@level_num_0).\nin file /edge.dl [17:1-17:26];");
400 auto b_project = mk<Project>(
"path", std::move(b_project_list));
406 auto b_existence_check1 = mk<ExistenceCheck>(
"path", std::move(b_filter1_list));
407 auto b_cond1 = mk<Negation>(std::move(b_existence_check1));
408 auto b_filter1 = mk<Filter>(std::move(b_cond1), std::move(b_project),
"");
409 auto b_cond2 = mk<Negation>(mk<EmptinessCheck>(
"edge"));
410 auto b_filter2 = mk<Filter>(std::move(b_cond2), std::move(b_filter1),
"");
411 auto b_scan = mk<Scan>(
"edge", 0, std::move(b_filter2),
"");
412 auto b_query = mk<Query>(std::move(b_scan));
414 "path(x,y,1,(@level_num_0+1)) :- \n edge(x,y,_,@level_num_0).\nin file /edge.dl [17:1-17:26];");
427 LogSize a(
"A",
"Log message");
428 LogSize
b(
"A",
"Log message");
432 LogSize* c = a.
clone();