use of at.ac.tuwien.kr.alpha.api.AnswerSet in project Alpha by alpha-asp.
the class FixedInterpretationLiteralsTest method positiveExternalBindingOutput.
@Test
public void positiveExternalBindingOutput() {
Optional<AnswerSet> answer = this.alpha.solve(this.alpha.readProgramString(TEST_PROG, this.externals)).findFirst();
assertTrue(answer.isPresent());
AnswerSet answerSet = answer.get();
Predicate pred = Predicates.getPredicate("positive_external_binding_output", 2);
assertTrue(answerSet.getPredicates().contains(pred));
Set<Atom> instances = answerSet.getPredicateInstances(pred);
assertEquals(3, instances.size());
assertTrue(instances.contains(Atoms.newBasicAtom(pred, Terms.newConstant("Klagenfurt"), Terms.newConstant("Villach"))));
assertTrue(instances.contains(Atoms.newBasicAtom(pred, Terms.newConstant("Klagenfurt"), Terms.newConstant("Graz"))));
assertTrue(instances.contains(Atoms.newBasicAtom(pred, Terms.newConstant("Villach"), Terms.newConstant("Salzburg"))));
}
use of at.ac.tuwien.kr.alpha.api.AnswerSet in project Alpha by alpha-asp.
the class FixedInterpretationLiteralsTest method negativeExternalWithOutputDontfire.
@Test
public void negativeExternalWithOutputDontfire() {
Optional<AnswerSet> answer = this.alpha.solve(this.alpha.readProgramString(TEST_PROG, this.externals)).findFirst();
assertTrue(answer.isPresent());
AnswerSet answerSet = answer.get();
assertFalse(answerSet.getPredicates().contains(Predicates.getPredicate("negative_external_with_output_dontfire", 0)));
}
use of at.ac.tuwien.kr.alpha.api.AnswerSet in project Alpha by alpha-asp.
the class FixedInterpretationLiteralsTest method negativeExternalMultioutput.
@Test
public void negativeExternalMultioutput() {
Optional<AnswerSet> answer = this.alpha.solve(this.alpha.readProgramString(TEST_PROG, this.externals)).findFirst();
assertTrue(answer.isPresent());
AnswerSet answerSet = answer.get();
assertTrue(answerSet.getPredicates().contains(Predicates.getPredicate("negative_external_multioutput", 0)));
}
use of at.ac.tuwien.kr.alpha.api.AnswerSet in project Alpha by alpha-asp.
the class FixedInterpretationLiteralsTest method positiveExternalMultioutputDontfire.
@Test
public void positiveExternalMultioutputDontfire() {
Optional<AnswerSet> answer = this.alpha.solve(this.alpha.readProgramString(TEST_PROG, this.externals)).findFirst();
assertTrue(answer.isPresent());
AnswerSet answerSet = answer.get();
assertFalse(answerSet.getPredicates().contains(Predicates.getPredicate("positive_external_multioutput_dontfire", 0)));
}
use of at.ac.tuwien.kr.alpha.api.AnswerSet in project Alpha by alpha-asp.
the class FixedInterpretationLiteralsTest method positiveExternalWithOutput.
@Test
public void positiveExternalWithOutput() {
Optional<AnswerSet> answer = this.alpha.solve(this.alpha.readProgramString(TEST_PROG, this.externals)).findFirst();
assertTrue(answer.isPresent());
AnswerSet answerSet = answer.get();
assertTrue(answerSet.getPredicates().contains(Predicates.getPredicate("positive_external_with_output", 0)));
}
Aggregations