Search in sources :

Example 1 with LogicInstructionExecutor

use of suite.instructionexecutor.LogicInstructionExecutor 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();
            }
        };
    };
}
Also used : Suite(suite.Suite) InstructionExecutor(suite.instructionexecutor.InstructionExecutor) LogUtil(suite.os.LogUtil) Finder(suite.lp.search.ProverBuilder.Finder) LogicInstructionExecutor(suite.instructionexecutor.LogicInstructionExecutor) Builder(suite.lp.search.ProverBuilder.Builder) RuleSet(suite.lp.kb.RuleSet) Fun(suite.util.FunUtil.Fun) ProverConfig(suite.lp.Configuration.ProverConfig) Node(suite.node.Node) Node(suite.node.Node) InstructionExecutor(suite.instructionexecutor.InstructionExecutor) LogicInstructionExecutor(suite.instructionexecutor.LogicInstructionExecutor) ProverConfig(suite.lp.Configuration.ProverConfig) LogicInstructionExecutor(suite.instructionexecutor.LogicInstructionExecutor)

Aggregations

Suite (suite.Suite)1 InstructionExecutor (suite.instructionexecutor.InstructionExecutor)1 LogicInstructionExecutor (suite.instructionexecutor.LogicInstructionExecutor)1 ProverConfig (suite.lp.Configuration.ProverConfig)1 RuleSet (suite.lp.kb.RuleSet)1 Builder (suite.lp.search.ProverBuilder.Builder)1 Finder (suite.lp.search.ProverBuilder.Finder)1 Node (suite.node.Node)1 LogUtil (suite.os.LogUtil)1 Fun (suite.util.FunUtil.Fun)1