示例#1
0
 /**
  * applyRules.
  *
  * @param op a {@link lupos.engine.operators.BasicOperator} object.
  * @param mapStartNodes a {@link java.util.Map} object.
  * @param rules an array of {@link lupos.optimizations.logical.rules.Rule} objects.
  * @param untilRule a {@link lupos.optimizations.logical.rules.Rule} object.
  */
 public void applyRules(
     final BasicOperator op,
     final Map<Class<? extends BasicOperator>, Set<BasicOperator>> mapStartNodes,
     final Rule[] rules,
     final Rule untilRule) {
   for (final Rule r : rules) {
     if (untilRule != null && r.equals(untilRule)) break;
     while (r.apply(op, mapStartNodes)) {
       Rule[] rulesToApply = r.getRulesToApply(this);
       if (rulesToApply == null) rulesToApply = this.rules;
       applyRules(op, mapStartNodes, rulesToApply, r);
     }
   }
 }
示例#2
0
 /**
  * applyRules.
  *
  * @param op a {@link lupos.engine.operators.BasicOperator} object.
  */
 public void applyRules(final BasicOperator op) {
   applyRules(op, RuleEngine.createStartNodeMap(op), this.rules, null);
 }