use of at.ac.tuwien.kr.alpha.api.rules.heads.Head 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