use of edu.cmu.ml.proppr.util.Configuration in project ProPPR by TeamCohen.
the class SplitFactsPluginTest method test.
@Test
public void test() throws LogicProgramException {
int input = 0;
int output = 0;
int constants = Configuration.USE_WAM;
int modules = 0;
Configuration c = new Configuration(("--programFiles " + GrounderTest.RULES + ":" + GrounderTest.FACTS + ":" + ADDLFACTS).split(" "), input, output, constants, modules);
assertEquals("# of plugins", c.plugins.length, 1);
assertEquals("# of members", ((SplitFactsPlugin) c.plugins[0]).plugins.size(), 2);
assertTrue("claim", c.plugins[0]._claim("validClass/1"));
Query q = Query.parse("validClass(X)");
WamInterpreter interp = new WamInterpreter(c.program, c.plugins);
int queryStartAddr = c.program.size();
q.variabilize();
c.program.append(q);
interp.executeWithoutBranching(queryStartAddr);
List<Outlink> outs = c.plugins[0].outlinks(interp.saveState(), interp, true);
assertEquals("# outlinks", 6, outs.size());
}
use of edu.cmu.ml.proppr.util.Configuration in project ProPPR by TeamCohen.
the class FixedWeightRulesTest method testCascade.
@Test
public void testCascade() {
Configuration c = new Configuration("--fixedWeights f(*=n:*=y".split(" "), 0, 0, Configuration.USE_FIXEDWEIGHTS, 0);
assertTrue("Most rules", c.fixedWeightRules.isFixed("id(x,12,15)"));
assertFalse("f(* rules", c.fixedWeightRules.isFixed("f(x,12,15)"));
}
use of edu.cmu.ml.proppr.util.Configuration in project ProPPR by TeamCohen.
the class FixedWeightRulesTest method test.
@Test
public void test() {
Configuration c = new Configuration("--fixedWeights f(thing,pos)".split(" "), 0, 0, Configuration.USE_FIXEDWEIGHTS, 0);
assertTrue("Raw fixedWeightRules", c.fixedWeightRules.isFixed("f(thing,pos)"));
}
Aggregations