use of suite.lp.kb.RuleSet in project suite by stupidsing.
the class ProverTest method testLet.
@Test
public void testLet() {
RuleSet rs = Suite.newRuleSet();
assertTrue(test(rs, "let 7 (2 * 3 + 1)"));
assertFalse(test(rs, "let 7 (2 * 3 - 1)"));
}
use of suite.lp.kb.RuleSet in project suite by stupidsing.
the class ProverTest method testIsCyclic.
@Test
public void testIsCyclic() {
RuleSet rs = Suite.newRuleSet();
assertFalse(test(rs, ".a = (a, b, c,), is.cyclic .a"));
assertTrue(test(rs, ".a = (a, b, .a, c,), is.cyclic .a"));
}
use of suite.lp.kb.RuleSet in project suite by stupidsing.
the class ProverTest method testSystemPredicates.
@Test
public void testSystemPredicates() {
RuleSet rs = Suite.newRuleSet();
Suite.addRule(rs, "mem ((.e, _), .e)");
Suite.addRule(rs, "mem ((_, .remains), .e) :- mem (.remains, .e)");
assertTrue(test(rs, ".l = (1, 2,), find.all .v (mem (.l, .v)) .l"));
}
use of suite.lp.kb.RuleSet in project suite by stupidsing.
the class SewingProverTest method testIf.
@Test
public void testIf() {
RuleSet rs = Suite.newRuleSet();
ProverFactory sp = new SewingProverImpl(rs);
ProverConfig pc = new ProverConfig(rs);
assertTrue(sp.prover(Suite.parse("if () () fail")).test(pc));
assertFalse(sp.prover(Suite.parse("if () fail ()")).test(pc));
assertTrue(sp.prover(Suite.parse("if fail fail ()")).test(pc));
assertFalse(sp.prover(Suite.parse("if fail () fail")).test(pc));
}
use of suite.lp.kb.RuleSet in project suite by stupidsing.
the class SewingProverTest method test.
@Test
public void test() {
RuleSet rs = Suite.newRuleSet();
Suite.addRule(rs, "yes");
ProverFactory sp = new SewingProverImpl(rs);
ProverConfig pc = new ProverConfig(rs);
assertTrue(sp.prover(Suite.parse("yes")).test(pc));
assertTrue(sp.prover(Suite.parse("fail; yes")).test(pc));
assertTrue(sp.prover(Suite.parse("yes; yes")).test(pc));
assertFalse(sp.prover(Suite.parse("yes, fail")).test(pc));
assertFalse(sp.prover(Suite.parse("!, fail; yes")).test(pc));
assertTrue(sp.prover(new Generalizer().generalize(Suite.parse("(.v = 1; .v = 2), .v = 2"))).test(pc));
assertFalse(sp.prover(new Generalizer().generalize(Suite.parse("once (.v = 1; .v = 2), .v = 2"))).test(pc));
assertFalse(sp.prover(Suite.parse("not yes")).test(pc));
assertTrue(sp.prover(Suite.parse("not fail")).test(pc));
assertTrue(sp.prover(new Generalizer().generalize(Suite.parse(".p = yes, .p"))).test(pc));
}
Aggregations