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;
}
Aggregations