use of suite.lp.checker.Checker in project suite by stupidsing.
the class ImportUtil method importFrom.
public synchronized boolean importFrom(RuleSet ruleSet, Node node) {
List<Rule> rules = new ArrayList<>();
for (Node elem : Tree.iter(node, TermOp.NEXT__)) rules.add(Rule.of(elem));
Prover prover = new Prover(ruleSet);
boolean b = true;
IList<Node> importing0 = importing.get();
try {
importing.set(IList.cons(node, importing0));
for (Rule rule : rules) if (rule.head != Atom.NIL)
ruleSet.addRule(rule);
else {
Node goal = SewingGeneralizerImpl.generalize(rule.tail);
b &= prover.prove(goal);
}
} finally {
importing.set(importing0);
}
if (// check after all files are imported
importing0.isEmpty())
new Checker().check(ruleSet.getRules());
return b;
}