Search in sources :

Example 1 with QueryRewriter

use of suite.lp.sewing.impl.QueryRewriter in project suite by stupidsing.

the class SewingProverBuilder2 method build.

@Override
public Fun<Node, Finder> build(RuleSet ruleSet) {
    boolean isRewrite = !proverConfig.isTrace();
    QueryRewriter qr = isRewrite ? new QueryRewriter(Prototype.multimap(ruleSet)) : null;
    RuleSet ruleSet1;
    if (qr != null) {
        ruleSet1 = Suite.newRuleSet();
        qr.rules().entries().forEach(p -> ruleSet1.addRule(p.t1));
    } else
        ruleSet1 = ruleSet;
    Fun<Node, Finder> fun = new SewingProverBuilder(proverConfig).build(ruleSet1);
    if (qr != null)
        return goal -> fun.apply(qr.rewriteClause(goal));
    else
        return fun;
}
Also used : RuleSet(suite.lp.kb.RuleSet) QueryRewriter(suite.lp.sewing.impl.QueryRewriter) Node(suite.node.Node) Finder(suite.lp.search.ProverBuilder.Finder)

Aggregations

RuleSet (suite.lp.kb.RuleSet)1 Finder (suite.lp.search.ProverBuilder.Finder)1 QueryRewriter (suite.lp.sewing.impl.QueryRewriter)1 Node (suite.node.Node)1