58 TEST(RamScan, CloneAndEquals) {
62 VecOwn<Expression> a_return_args;
63 a_return_args.emplace_back(
new SignedConstant(0));
64 auto a_return = mk<SubroutineReturn>(std::move(a_return_args));
65 Scan a(
"A", 0, std::move(a_return),
"Scan test");
69 auto b_return = mk<SubroutineReturn>(std::move(b_return_args));
70 Scan b(
"A", 0, std::move(b_return),
"Scan test");
81 TEST(RamParallelScan, CloneAndEquals) {
85 VecOwn<Expression> a_return_args;
86 a_return_args.emplace_back(
new SignedConstant(0));
87 auto a_return = mk<SubroutineReturn>(std::move(a_return_args));
88 ParallelScan a(
"A", 0, std::move(a_return),
"ParallelScan test");
92 auto b_return = mk<SubroutineReturn>(std::move(b_return_args));
93 ParallelScan b(
"A", 0, std::move(b_return),
"ParallelScan test");
104 TEST(RamIndexScan, CloneAndEquals) {
112 auto a_project = mk<Project>(
"vertex", std::move(a_project_args));
115 a_criteria.first.emplace_back(
new UndefValue);
117 a_criteria.second.emplace_back(
new UndefValue);
119 IndexScan a(
"edge", 1, std::move(a_criteria), std::move(a_project),
"IndexScan test");
123 auto b_project = mk<Project>(
"vertex", std::move(b_project_args));
126 b_criteria.first.emplace_back(
new UndefValue);
128 b_criteria.second.emplace_back(
new UndefValue);
130 IndexScan b(
"edge", 1, std::move(b_criteria), std::move(b_project),
"IndexScan test");
140 TEST(RamParallelIndexScan, CloneAndEquals) {
149 auto a_project = mk<Project>(
"new_edge", std::move(a_project_args));
151 a_criteria.first.emplace_back(
new UndefValue);
153 a_criteria.second.emplace_back(
new UndefValue);
156 ParallelIndexScan a(
"edge", 1, std::move(a_criteria), std::move(a_project),
"ParallelIndexScan test");
161 auto b_project = mk<Project>(
"new_edge", std::move(b_project_args));
163 b_criteria.first.emplace_back(
new UndefValue);
165 b_criteria.second.emplace_back(
new UndefValue);
168 ParallelIndexScan b(
"edge", 1, std::move(b_criteria), std::move(b_project),
"ParallelIndexScan test");
178 TEST(RamChoice, CloneAndEquals) {
183 VecOwn<Expression> a_return_args;
186 auto a_return = mk<SubroutineReturn>(std::move(a_return_args));
189 auto a_neg1 = mk<Negation>(std::move(a_constraint1));
192 auto a_neg2 = mk<Negation>(std::move(a_constraint2));
193 auto a_cond = mk<Conjunction>(std::move(a_neg1), std::move(a_neg2));
194 Choice a(
"edge", 1, std::move(a_cond), std::move(a_return),
"Choice test");
199 auto b_return = mk<SubroutineReturn>(std::move(b_return_args));
202 auto b_neg1 = mk<Negation>(std::move(b_constraint1));
205 auto b_neg2 = mk<Negation>(std::move(b_constraint2));
206 auto b_cond = mk<Conjunction>(std::move(b_neg1), std::move(b_neg2));
207 Choice b(
"edge", 1, std::move(b_cond), std::move(b_return),
"Choice test");
218 TEST(RamParallelChoice, CloneAndEquals) {
223 VecOwn<Expression> a_return_args;
226 auto a_return = mk<SubroutineReturn>(std::move(a_return_args));
229 auto a_neg1 = mk<Negation>(std::move(a_constraint1));
232 auto a_neg2 = mk<Negation>(std::move(a_constraint2));
233 auto a_cond = mk<Conjunction>(std::move(a_neg1), std::move(a_neg2));
234 ParallelChoice a(
"edge", 1, std::move(a_cond), std::move(a_return),
"ParallelChoice test");
239 auto b_return = mk<SubroutineReturn>(std::move(b_return_args));
242 auto b_neg1 = mk<Negation>(std::move(b_constraint1));
245 auto b_neg2 = mk<Negation>(std::move(b_constraint2));
246 auto b_cond = mk<Conjunction>(std::move(b_neg1), std::move(b_neg2));
247 ParallelChoice b(
"edge", 1, std::move(b_cond), std::move(b_return),
"ParallelChoice test");
258 TEST(RamIndexChoice, CloneAndEquals) {
263 VecOwn<Expression> a_return_args;
266 auto a_return = mk<SubroutineReturn>(std::move(a_return_args));
267 auto a_constraint = mk<Constraint>(
BinaryConstraintOp::EQ, mk<TupleElement>(1, 1), mk<SignedConstant>(5));
268 auto a_neg = mk<Negation>(std::move(a_constraint));
271 a_criteria.first.emplace_back(
new UndefValue);
273 a_criteria.second.emplace_back(
new UndefValue);
275 "edge", 1, std::move(a_neg), std::move(a_criteria), std::move(a_return),
"IndexChoice test");
280 auto b_return = mk<SubroutineReturn>(std::move(b_return_args));
281 auto b_constraint = mk<Constraint>(
BinaryConstraintOp::EQ, mk<TupleElement>(1, 1), mk<SignedConstant>(5));
282 auto b_neg = mk<Negation>(std::move(b_constraint));
285 b_criteria.first.emplace_back(
new UndefValue);
287 b_criteria.second.emplace_back(
new UndefValue);
289 "edge", 1, std::move(b_neg), std::move(b_criteria), std::move(b_return),
"IndexChoice test");
299 TEST(RamiParallelIndexChoice, CloneAndEquals) {
304 VecOwn<Expression> a_return_args;
307 auto a_return = mk<SubroutineReturn>(std::move(a_return_args));
308 auto a_constraint = mk<Constraint>(
BinaryConstraintOp::EQ, mk<TupleElement>(1, 1), mk<SignedConstant>(5));
309 auto a_neg = mk<Negation>(std::move(a_constraint));
312 a_criteria.first.emplace_back(
new UndefValue);
314 a_criteria.second.emplace_back(
new UndefValue);
316 "edge", 1, std::move(a_neg), std::move(a_criteria), std::move(a_return),
"IndexChoice test");
321 auto b_return = mk<SubroutineReturn>(std::move(b_return_args));
322 auto b_constraint = mk<Constraint>(
BinaryConstraintOp::EQ, mk<TupleElement>(1, 1), mk<SignedConstant>(5));
323 auto b_neg = mk<Negation>(std::move(b_constraint));
326 b_criteria.first.emplace_back(
new UndefValue);
328 b_criteria.second.emplace_back(
new UndefValue);
330 "edge", 1, std::move(b_neg), std::move(b_criteria), std::move(b_return),
"IndexChoice test");
340 TEST(RamAggregate, CloneAndEquals) {
344 VecOwn<Expression> a_return_args;
345 a_return_args.emplace_back(
new TupleElement(0, 0));
346 auto a_return = mk<SubroutineReturn>(std::move(a_return_args));
351 auto b_return = mk<SubroutineReturn>(std::move(b_return_args));
362 TEST(RamIndexAggregate, CloneAndEquals) {
367 VecOwn<Expression> a_return_args;
369 auto a_return = mk<SubroutineReturn>(std::move(a_return_args));
372 a_criteria.first.emplace_back(
new UndefValue);
373 a_criteria.first.emplace_back(
new UndefValue);
374 a_criteria.second.emplace_back(
new UndefValue);
375 a_criteria.second.emplace_back(
new UndefValue);
377 std::move(a_criteria), 1);
381 auto b_return = mk<SubroutineReturn>(std::move(b_return_args));
384 b_criteria.first.emplace_back(
new UndefValue);
385 b_criteria.first.emplace_back(
new UndefValue);
386 b_criteria.second.emplace_back(
new UndefValue);
387 b_criteria.second.emplace_back(
new UndefValue);
389 std::move(b_criteria), 1);
399 TEST(RamUnpackedRecord, CloneAndEquals) {
404 auto a_return = mk<SubroutineReturn>(std::move(a_return_args));
408 auto a_record = mk<PackRecord>(std::move(a_record_args));
409 UnpackRecord a(std::move(a_return), 1, std::move(a_record), 2);
413 auto b_return = mk<SubroutineReturn>(std::move(b_return_args));
417 auto b_record = mk<PackRecord>(std::move(b_record_args));
418 UnpackRecord b(std::move(b_return), 1, std::move(b_record), 2);
428 TEST(RamFilter, CloneAndEquals) {
432 VecOwn<Expression> a_return_args;
433 a_return_args.emplace_back(
new SignedConstant(0));
434 auto a_return = mk<SubroutineReturn>(std::move(a_return_args));
436 a_existence_check_args.emplace_back(
new TupleElement(0, 1));
437 auto a_existence_check = mk<ExistenceCheck>(
"A", std::move(a_existence_check_args));
438 Filter a(mk<Negation>(std::move(a_existence_check)), std::move(a_return),
"Filter test");
442 auto b_return = mk<SubroutineReturn>(std::move(b_return_args));
444 b_existence_check_args.emplace_back(
new TupleElement(0, 1));
445 auto b_existence_check = mk<ExistenceCheck>(
"A", std::move(b_existence_check_args));
446 Filter b(mk<Negation>(std::move(b_existence_check)), std::move(b_return),
"Filter test");
456 TEST(RamBreak, CloneAndEquals) {
460 VecOwn<Expression> a_return_args;
461 a_return_args.emplace_back(
new SignedConstant(0));
462 auto a_return = mk<SubroutineReturn>(std::move(a_return_args));
463 Break a(mk<EmptinessCheck>(
"A"), std::move(a_return),
"Break test");
467 auto b_return = mk<SubroutineReturn>(std::move(b_return_args));
468 Break b(mk<EmptinessCheck>(
"A"), std::move(b_return),
"Break test");
478 TEST(RamProject, CloneAndEquals) {
481 VecOwn<Expression> a_args;
482 a_args.emplace_back(
new TupleElement(0, 1));
483 a_args.emplace_back(
new TupleElement(0, 3));
499 TEST(RamSubroutineReturn, CloneAndEquals) {