Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differentiate execution plan checker messages #2295

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/ast/transform/ExecutionPlanChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,14 @@ bool ExecutionPlanChecker::transform(TranslationUnit& translationUnit) {
}
}
auto numAtoms = getBodyLiterals<Atom>(*clause).size();
if (order.size() != numAtoms || !isComplete) {
report.addError("Invalid execution order in plan", cur.second->getSrcLoc());
if (order.size() != numAtoms) {
report.addError("Invalid execution order in plan (expected " +
std::to_string(numAtoms) + " atoms, not " +
std::to_string(order.size()) + ")",
cur.second->getSrcLoc());
} else if (!isComplete) {
report.addError(
"Invalid execution order in plan (incomplete)", cur.second->getSrcLoc());
}
}

Expand Down
6 changes: 3 additions & 3 deletions tests/semantic/execution_plan/execution_plan.err
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ Error: execution plan for version 3 in file execution_plan.dl at line 21
.plan 1: (1,2,3), 2: (3,2,1), 3: (2,3,1)
-----------------------------------------^-------
only versions 0..2 permitted
Error: Invalid execution order in plan in file execution_plan.dl at line 25
Error: Invalid execution order in plan (incomplete) in file execution_plan.dl at line 25
.plan 0: (1,2,2), 1: (3,2), 2: (2,3,1,3)
-----------------^-------------------------------
Error: Invalid execution order in plan in file execution_plan.dl at line 25
Error: Invalid execution order in plan (expected 3 atoms, not 2) in file execution_plan.dl at line 25
.plan 0: (1,2,2), 1: (3,2), 2: (2,3,1,3)
-----------------------------^-------------------
Error: Invalid execution order in plan in file execution_plan.dl at line 25
Error: Invalid execution order in plan (expected 3 atoms, not 4) in file execution_plan.dl at line 25
.plan 0: (1,2,2), 1: (3,2), 2: (2,3,1,3)
---------------------------------------^---------
4 errors generated, evaluation aborted
2 changes: 1 addition & 1 deletion tests/semantic/plan1/plan1.err
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Error: Invalid execution order in plan in file plan1.dl at line 15
Error: Invalid execution order in plan (incomplete) in file plan1.dl at line 15
A(v1,v4) :- B(v1,v2), v1 < v2, C(v2,v3), D(v3,v4), !E(v1,v4). .plan 0:(1,2,4)
----------------------------------------------------------------------^-------
1 errors generated, evaluation aborted