Search in sources :

Example 6 with ProverFactory

use of suite.lp.doer.ProverFactory in project suite by stupidsing.

the class SewingProverTest method testCut.

@Test
public void testCut() {
    RuleSet rs = Suite.newRuleSet();
    Suite.addRule(rs, "a :- b");
    Suite.addRule(rs, "a");
    Suite.addRule(rs, "b :- !, fail");
    ProverFactory sp = new SewingProverImpl(rs);
    ProverConfig pc = new ProverConfig(rs);
    assertTrue(sp.prover(Suite.parse("a")).test(pc));
}
Also used : RuleSet(suite.lp.kb.RuleSet) ProverConfig(suite.lp.Configuration.ProverConfig) ProverFactory(suite.lp.doer.ProverFactory) SewingProverImpl(suite.lp.sewing.impl.SewingProverImpl) Test(org.junit.Test)

Example 7 with ProverFactory

use of suite.lp.doer.ProverFactory in project suite by stupidsing.

the class SewingProverTest method testEnv.

@Test
public void testEnv() {
    RuleSet rs = Suite.newRuleSet();
    Suite.addRule(rs, "a :- b .a, b .b");
    Suite.addRule(rs, "b 1");
    ProverFactory sp = new SewingProverImpl(rs);
    ProverConfig pc = new ProverConfig(rs);
    assertTrue(sp.prover(Suite.parse("a")).test(pc));
}
Also used : RuleSet(suite.lp.kb.RuleSet) ProverConfig(suite.lp.Configuration.ProverConfig) ProverFactory(suite.lp.doer.ProverFactory) SewingProverImpl(suite.lp.sewing.impl.SewingProverImpl) Test(org.junit.Test)

Aggregations

ProverConfig (suite.lp.Configuration.ProverConfig)7 ProverFactory (suite.lp.doer.ProverFactory)7 RuleSet (suite.lp.kb.RuleSet)7 SewingProverImpl (suite.lp.sewing.impl.SewingProverImpl)7 Test (org.junit.Test)6 Generalizer (suite.lp.doer.Generalizer)2 Prove_ (suite.lp.doer.ProverFactory.Prove_)2 Builder (suite.lp.search.ProverBuilder.Builder)1 Finder (suite.lp.search.ProverBuilder.Finder)1 SewingGeneralizerImpl (suite.lp.sewing.impl.SewingGeneralizerImpl)1 Atom (suite.node.Atom)1 Node (suite.node.Node)1 Stopwatch (suite.os.Stopwatch)1 Fun (suite.util.FunUtil.Fun)1