Search in sources :

Example 6 with Finder

use of suite.lp.search.ProverBuilder.Finder 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)

Example 7 with Finder

use of suite.lp.search.ProverBuilder.Finder 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);
        };
    };
}
Also used : Prover(suite.lp.doer.Prover) SewingGeneralizerImpl(suite.lp.sewing.impl.SewingGeneralizerImpl) Finder(suite.lp.search.ProverBuilder.Finder) 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) ProverConfig(suite.lp.Configuration.ProverConfig) Prover(suite.lp.doer.Prover)

Aggregations

Finder (suite.lp.search.ProverBuilder.Finder)7 RuleSet (suite.lp.kb.RuleSet)6 Node (suite.node.Node)6 ProverConfig (suite.lp.Configuration.ProverConfig)5 Fun (suite.util.FunUtil.Fun)4 Builder (suite.lp.search.ProverBuilder.Builder)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Suite (suite.Suite)2 Source (suite.util.FunUtil.Source)2 Map (java.util.Map)1 Entry (java.util.Map.Entry)1 Collectors (java.util.stream.Collectors)1 Pattern (suite.BindArrayUtil.Pattern)1 Pair (suite.adt.pair.Pair)1 Intrinsics (suite.fp.intrinsic.Intrinsics)1 Intrinsic (suite.fp.intrinsic.Intrinsics.Intrinsic)1 IntrinsicCallback (suite.fp.intrinsic.Intrinsics.IntrinsicCallback)1 Matcher (suite.fp.match.Matcher)1