use of at.ac.tuwien.kr.alpha.api.programs.literals.Literal in project Alpha by alpha-asp.
the class LiteralBindingNonBindingVariablesTest method testPositiveComparisonLiteral_NEQ_Bidirectional.
@Test
public void testPositiveComparisonLiteral_NEQ_Bidirectional() {
Rule<Head> rule = parser.parse("p(X) :- q(X,Y), X != Y.").getRules().get(0);
Literal literal = rule.getBody().stream().filter((lit) -> lit.getPredicate() == ComparisonOperators.NE.toPredicate()).findFirst().get();
assertEquals(false, literal.isNegated());
expectVariables(literal.getBindingVariables());
expectVariables(literal.getNonBindingVariables(), "X", "Y");
}
use of at.ac.tuwien.kr.alpha.api.programs.literals.Literal in project Alpha by alpha-asp.
the class LiteralBindingNonBindingVariablesTest method testPositiveComparisonLiteral_NEQ_RightAssigning.
@Test
public void testPositiveComparisonLiteral_NEQ_RightAssigning() {
Rule<Head> rule = parser.parse("p(X) :- q(X,Y), 5 != Y.").getRules().get(0);
Literal literal = rule.getBody().stream().filter((lit) -> lit.getPredicate() == ComparisonOperators.NE.toPredicate()).findFirst().get();
assertEquals(false, literal.isNegated());
expectVariables(literal.getBindingVariables());
expectVariables(literal.getNonBindingVariables(), "Y");
}
Aggregations