use of suite.lp.kb.RuleSet in project suite by stupidsing.
the class CompiledProverBuilder method build.
@Override
public Fun<Node, Finder> build(RuleSet ruleSet) {
Node rules = Suite.getRules(ruleSet);
return goal -> {
Node code = compile(Suite.substitute(".0 >> .1", rules, goal));
return (source, sink) -> {
ProverConfig proverConfig1 = new ProverConfig(ruleSet, proverConfig);
proverConfig1.setSource(source);
proverConfig1.setSink(sink);
try (InstructionExecutor executor = new LogicInstructionExecutor(code, proverConfig1)) {
executor.execute();
}
};
};
}
use of suite.lp.kb.RuleSet in project suite by stupidsing.
the class InterpretedProverBuilder method build.
@Override
public Fun<Node, Finder> build(RuleSet ruleSet) {
return goal -> {
Node goal1 = SewingGeneralizerImpl.generalize(goal);
return (source, sink) -> {
ProverConfig proverConfig1 = new ProverConfig(ruleSet, proverConfig);
proverConfig1.setSource(source);
proverConfig1.setSink(sink);
new Prover(proverConfig1).elaborate(goal1);
};
};
}
use of suite.lp.kb.RuleSet in project suite by stupidsing.
the class CompileUtil method precompile.
public boolean precompile(String libraryName, ProverConfig pc) {
System.out.println("Pre-compiling [" + libraryName + "]...");
Builder builder = new SewingProverBuilder(pc);
RuleSet rs = funCompilerRuleSet();
boolean b = Suite.proveLogic(builder, rs, "fc-precompile-lib " + libraryName);
if (b)
System.out.println("Pre-compilation success [" + libraryName + "]");
else
System.out.println("Pre-compilation failed [" + libraryName + "]");
return b;
}
use of suite.lp.kb.RuleSet in project suite by stupidsing.
the class Suite method getRuleSet.
public static RuleSet getRuleSet(Node node) {
RuleSet rs = newRuleSet();
importUtil.importFrom(rs, node);
return rs;
}
Aggregations