This method takes a rule and populates the ruleIndex field.
@param rule
4629
private void updateRuleIndexes(CQIE rule) {
		Function head = rule.getHead();
		ruleIndex.put(head.getFunctionSymbol(), rule);
		updateRuleIndexByBodyPredicate(rule);
	}
1037055
public final function removeRule($field, $rule = null) {
		if ($rule == null) {
			unset($this->rules[ $field ]);
		} else {
			$idx = $this->ruleKeys[ $field ][ $rule ];
			unset($this->rules[ $field ][ $idx ]);
		}
	}
454969
public ResultHandlerContext<D, O> check(final Rule<D, O>... rules) {
        if (rules != null) {
            Collections.addAll(registeredRules, rules);
        }
        return this;
    }
250967
public void apply(HashMap<String, Object> data) {
        for (HashMap<String, String> rule : rules) {
            if (!isSWExtracted || (!isSoilRules(rule) && !isWthRules(rule))) {
                applyRule(data, rule);
            }
        }
    }
351863
public void setRules(Map<String, ReplicationRule> rules) {
        if (rules == null) {
            throw new IllegalArgumentException(
                    "Replication rules cannot be null");
        }
        this.rules = new HashMap<String, ReplicationRule>(rules);
    }
237554
public void setRules(List rules) {
        Assert.notNull(rules);
        if (logger.isDebugEnabled()) {
            logger.debug("Configuring rules in source...");
        }
        getRuleContext(DEFAULT_CONTEXT_ID).clear();
        for (Iterator i = rules.iterator(); i.hasNext();) {
            addRules((Rules) i.next());
        }
    }
552382
public String gaRuleElementsMethodName(final AbstractRule rule) {
    String _gaRuleIdentifyer = this.gaRuleIdentifyer(rule);
    String _plus = ("get" + _gaRuleIdentifyer);
    return (_plus + "Access");
  }
720890
public function collectRule(Rule $rule): void
    {
        $this->data['rule'] = [
            'id' => $rule->getId(),
        ];

        foreach ($rule->getTargets() as $target) {
            $this->data['rule']['targets'][] = [
                'type' => $target->getTargetType()::getType(),
                'value' => $this->formatVar($target->getValue()),
            ];
        }

        foreach ($rule->getConditions() as $condition) {
            $this->data['rule']['conditions'][] = [
                'type' => $condition->getConditionType()::getType(),
                'value' => $this->formatVar($condition->getValue()),
            ];
        }
    }
590782
public <RO> SingleRuleContext<DPO, Collection<DPO>, RO> check(Collection<Rule<Collection<DPO>, RO>> rules) {
        List<Rule<Collection<DPO>, RO>> addedRules = new ArrayList<Rule<Collection<DPO>, RO>>();
        if (rules != null) {
            addedRules.addAll(rules);
        }

        // Change context
        return new SingleRuleContext<DPO, Collection<DPO>, RO>(addedTriggers, addedDataProviders,
                GeneralValidator.MappingStrategy.JOIN, null, addedRules);
    }
1012582
public <RO> SingleRuleContext<DPO, TDPO, RO> check(Rule<TDPO, RO> rule) {
        List<Rule<TDPO, RO>> addedRules = new ArrayList<Rule<TDPO, RO>>();
        if (rule != null) {
            addedRules.add(rule);
        }

        // Change context
        return new SingleRuleContext<DPO, TDPO, RO>(addedTriggers, addedDataProviders, dataProviderToRuleMapping,
                addedRuleInputTransformers, addedRules);
    }
1001137
public String gaRuleIdentifyer(final AbstractRule rule) {
    final String plainName = RuleNames.getRuleNames(rule).getUniqueRuleName(rule);
    return this.toJavaIdentifier(plainName, true);
  }
72973
public void setRules(java.util.Collection<Rule> rules) {
        if (rules == null) {
            this.rules = null;
            return;
        }

        this.rules = new java.util.ArrayList<Rule>(rules);
    }
1216707
public final void ruleXExpression() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXbase.g:71:2: ( ( ruleXAssignment ) )
            // InternalXbase.g:72:2: ( ruleXAssignment )
            {
            // InternalXbase.g:72:2: ( ruleXAssignment )
            // InternalXbase.g:73:3: ruleXAssignment
            {
            if ( state.backtracking==0 ) {
               before(grammarAccess.getXExpressionAccess().getXAssignmentParserRuleCall()); 
            }
            pushFollow(FOLLOW_2);
            ruleXAssignment();

            state._fsp--;
            if (state.failed) return ;
            if ( state.backtracking==0 ) {
               after(grammarAccess.getXExpressionAccess().getXAssignmentParserRuleCall()); 
            }

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {

            	restoreStackSize(stackSize);

        }
        return ;
    }
488916
public final void ruleAbstractRule() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXtext.g:116:2: ( ( ( rule__AbstractRule__Alternatives ) ) )
            // InternalXtext.g:117:2: ( ( rule__AbstractRule__Alternatives ) )
            {
            // InternalXtext.g:117:2: ( ( rule__AbstractRule__Alternatives ) )
            // InternalXtext.g:118:3: ( rule__AbstractRule__Alternatives )
            {
             before(grammarAccess.getAbstractRuleAccess().getAlternatives()); 
            // InternalXtext.g:119:3: ( rule__AbstractRule__Alternatives )
            // InternalXtext.g:119:4: rule__AbstractRule__Alternatives
            {
            pushFollow(FollowSets000.FOLLOW_2);
            rule__AbstractRule__Alternatives();

            state._fsp--;


            }

             after(grammarAccess.getAbstractRuleAccess().getAlternatives()); 

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {

            	restoreStackSize(stackSize);

        }
        return ;
    }
381224
public void setRules(Collection<ServerSideEncryptionRule> rules) {
        if (rules == null) {
            this.rules = null;
            return;
        }

        this.rules = new ArrayList<ServerSideEncryptionRule>(rules);
    }
1225215
@Override
    public void activate(RuleBlock ruleBlock) {
        if (FuzzyLite.isDebugging()) {
            FuzzyLite.logger().log(Level.FINE, "Activation: {0} {1}",
                    new String[]{getClass().getName(), parameters()});
        }
        TNorm conjunction = ruleBlock.getConjunction();
        SNorm disjunction = ruleBlock.getDisjunction();
        TNorm implication = ruleBlock.getImplication();

        double sumActivationDegrees = 0.0;
        List<Rule> rulesToActivate = new ArrayList<Rule>(ruleBlock.getRules().size());
        for (Rule rule : ruleBlock.getRules()) {
            rule.deactivate();
            if (rule.isLoaded()) {
                double activationDegree = rule.activateWith(conjunction, disjunction);
                rulesToActivate.add(rule);
                sumActivationDegrees += activationDegree;
            }
        }
        for (Rule rule : rulesToActivate) {
            double activationDegree = rule.getActivationDegree() / sumActivationDegrees;
            rule.setActivationDegree(activationDegree);
            rule.trigger(implication);
        }
    }
1328294
def add_rule(self, rule):
        """"""
        parsed_rule = None

        if rule.count('->') == 1 and rule.count('=>') == 0:
            parsed_rule = tuple(''.join(part.split()) for part in rule.split('->')) + (0,)
        elif rule.count('->') == 0 and rule.count('=>') == 1:
            parsed_rule = tuple(''.join(part.split()) for part in rule.split('=>')) + (1,)

        if parsed_rule is None:
            raise SyntaxError('Wrong format: ' + rule)
        else:
            self.rules.append(parsed_rule)