Merge branch 'fix-comparisons' of github.com:potassco/anthem into develop
This commit is contained in:
commit
67864fedbd
@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
## (unreleased)
|
## (unreleased)
|
||||||
|
|
||||||
|
Bug Fixes:
|
||||||
|
|
||||||
|
* fixes incorrectly simplified rules with comparisons
|
||||||
|
|
||||||
## 0.1.2 (2017-03-23)
|
## 0.1.2 (2017-03-23)
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
|
@ -81,7 +81,7 @@ struct ReplaceVariableInFormulaVisitor : public ast::RecursiveFormulaVisitor<Rep
|
|||||||
static void accept(ast::Comparison &comparison, ast::Formula &, const ast::Variable &variable, const ast::Term &term)
|
static void accept(ast::Comparison &comparison, ast::Formula &, const ast::Variable &variable, const ast::Term &term)
|
||||||
{
|
{
|
||||||
comparison.left.accept(ReplaceVariableInTermVisitor(), comparison.left, variable, term);
|
comparison.left.accept(ReplaceVariableInTermVisitor(), comparison.left, variable, term);
|
||||||
comparison.right.accept(ReplaceVariableInTermVisitor(), comparison.left, variable, term);
|
comparison.right.accept(ReplaceVariableInTermVisitor(), comparison.right, variable, term);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void accept(ast::In &in, ast::Formula &, const ast::Variable &variable, const ast::Term &term)
|
static void accept(ast::In &in, ast::Formula &, const ast::Variable &variable, const ast::Term &term)
|
||||||
|
@ -41,4 +41,12 @@ TEST_CASE("[simplification] Rules are simplified correctly", "[simplified]")
|
|||||||
|
|
||||||
REQUIRE(output.str() == "((not covered(I) and I in 1..n) -> #false)\n");
|
REQUIRE(output.str() == "((not covered(I) and I in 1..n) -> #false)\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SECTION("comparisons")
|
||||||
|
{
|
||||||
|
input << ":- M > N.";
|
||||||
|
anthem::translate("input", input, context);
|
||||||
|
|
||||||
|
REQUIRE(output.str() == "(M > N -> #false)\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user