A naive reasoner that recalculates the entire knowledge base.
@deprecated
@param triplesIns
@param triplesDel
@param rules
@returns {{fi: *, fe: *}}
547774
function(FeAdd, FeDel, F, R) {
        var FiAdd = [], FiAddNew = [], additions, deletions,
            Fe = Logics.getOnlyExplicitFacts(F), FiAddNew = [];

        // Deletion
        if(FeDel && FeDel.length) {
            Fe = Logics.minus(Fe, FeDel);
        }

        // Insertion
        if(FeAdd && FeAdd.length) {
            Fe = Utils.uniques(Fe, FeAdd);
        }

        // Recalculation
        do {
            FiAdd = Utils.uniques(FiAdd, FiAddNew);
            FiAddNew = Solver.evaluateRuleSet(R, Utils.uniques(Fe, FiAdd));
        } while (!Logics.containsFacts(FiAdd, FiAddNew));

        additions = Utils.uniques(FeAdd, FiAdd);
        deletions = Logics.minus(F, Utils.uniques(Fe, FiAdd));

        F = Utils.uniques(Fe, FiAdd);

        return {
            additions: additions,
            deletions: deletions,
            updatedF: F
        };
    }
132106
public MultipleRuleContext<DPO, RI, RO> check(Collection<Rule<RI, RO>> rules) {
        if (rules != null) {
            addedRules.addAll(rules);
        }

        // Stay in the same context and re-use the same instance because no type has changed
        return this;
    }
225828
public static <A, B, C> Triple<A, B, C> newTriple (A a, B b, C c)
    {
        return new Triple<A, B, C>(a, b, c);
    }
190610
public static <T1, T2, T3> Triple<T1, T2, T3> newTuple(T1 e1, T2 e2, T3 e3) {
		return new Triple<T1, T2, T3>(e1, e2, e3);
	}
573105
@SafeVarargs
  private final Map<String, FieldSpec> buildConditionFields(Map<String, PluralData>... pluralMaps) {
    Map<String, FieldSpec> index = new LinkedHashMap<>();
    int seq = 0;

    for (Map<String, PluralData> pluralMap : pluralMaps) {
      for (Map.Entry<String, PluralData> entry : pluralMap.entrySet()) {
        PluralData data = entry.getValue();

        // Iterate over the rules, drilling into the OR conditions and
        // building a field to evaluate each AND condition.
        for (Map.Entry<String, PluralData.Rule> rule : data.rules().entrySet()) {
          Node<PluralType> orCondition = rule.getValue().condition;
          if (orCondition == null) {
            continue;
          }

          // Render the representation for each AND condition, using that as a
          // key to map to the corresponding lambda Condition field that
          // computes it.
          for (Node<PluralType> andCondition : orCondition.asStruct().nodes()) {
            String repr = PluralRulePrinter.print(andCondition);
            if (index.containsKey(repr)) {
              continue;
            }

            // Build the field that represents the evaluation of the AND condition.
            FieldSpec field = buildConditionField(seq, andCondition.asStruct());
            index.put(repr, field);
            seq++;
          }
        }
      }
    }
    return index;
  }
1069639
private static boolean memberContainerConstraints(final Triple triple) {
        return triple.getPredicate().equals(ACL.accessControl) || triple.getPredicate().equals(LDP.contains);
    }
606722
public final void ruleOpMultiAssign() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXbase.g:146:2: ( ( ( rule__OpMultiAssign__Alternatives ) ) )
            // InternalXbase.g:147:2: ( ( rule__OpMultiAssign__Alternatives ) )
            {
            // InternalXbase.g:147:2: ( ( rule__OpMultiAssign__Alternatives ) )
            // InternalXbase.g:148:3: ( rule__OpMultiAssign__Alternatives )
            {
            if ( state.backtracking==0 ) {
               before(grammarAccess.getOpMultiAssignAccess().getAlternatives()); 
            }
            // InternalXbase.g:149:3: ( rule__OpMultiAssign__Alternatives )
            // InternalXbase.g:149:4: rule__OpMultiAssign__Alternatives
            {
            pushFollow(FOLLOW_2);
            rule__OpMultiAssign__Alternatives();

            state._fsp--;
            if (state.failed) return ;

            }

            if ( state.backtracking==0 ) {
               after(grammarAccess.getOpMultiAssignAccess().getAlternatives()); 
            }

            }


            }

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

            	restoreStackSize(stackSize);

        }
        return ;
    }
68404
def visitTripleConstraint(self, ctx: ShExDocParser.TripleConstraintContext):
        
        # This exists because of the predicate within annotation - if we default to visitchildren, we intercept both
        # predicates
        if ctx.senseFlags():
            self.visit(ctx.senseFlags())
        self.visit(ctx.predicate())
        self.visit(ctx.inlineShapeExpression())
        self._card_annotations_and_semacts(ctx)
585152
def get_triples(self, subject=None, predicate=None, object_=None):
        """"""

        for triple in self.triples:

            # Filter out non-matches
            if subject is not None and triple['subject'] != subject:
                continue
            if predicate is not None and triple['predicate'] != predicate:
                continue
            if object_ is not None and triple['object'] != object_:
                continue

            yield triple
320030
public static Rule conditionsRule(final Set<Condition> conditions, final Map<String, String> results) {
        return conditionsRule(conditions, States.state(results));
    }
405549
function(rule, orderDesc){
    rule = basis.getter(rule || $true);
    orderDesc = !!orderDesc;

    if (this.rule != rule || this.orderDesc != orderDesc)
    {
      var oldRule = this.rule;
      var oldOrderDesc = this.orderDesc;

      // rebuild index only if rule changing
      if (this.rule != rule)
      {
        var index = this.index_;

        for (var i = 0; i < index.length; i++)
          index[i].value = nanToUndefined(rule(index[i].object));

        index.sort(sliceIndexSort);

        this.rule = rule;
      }

      // set new values
      this.orderDesc = orderDesc;
      this.rule = rule;
      this.emit_ruleChanged(oldRule, oldOrderDesc);

      return this.applyRule();
    }
  }
783703
function reportDuplicateRules( ast, session ) {

    const rules = {};

    const check = session.buildVisitor( {
        rule( node ) {

            const name = node.name;

            if ( __hasOwnProperty.call( rules, name ) ) {

                const start = rules[ name ].start;

                session.error(
                    `Rule "${ name }" is already defined at line ${ start.line }, column ${ start.column }.`,
                    node.location
                );

            }

            rules[ node.name ] = node.location;

        }
    } );

    check( ast );

}
196928
boolean rule2(final IFactory factory, final Inclusion[] gcis) {
        boolean result = false;

        if (lhs instanceof Conjunction) {
            Conjunction conjunction = (Conjunction) lhs;
            final AbstractConcept[] concepts = conjunction.getConcepts();

            if (concepts.length == 1) {
                // unwrap redundant conjuncts
                gcis[0] = new GCI(concepts[0], rhs);
                result = true;
            } else if (concepts.length == 0) {
                log.warn("Empty conjunct detected in: " + this);
                gcis[0] = new GCI(IFactory.TOP_CONCEPT, rhs);
                result = true;
            } else {
                // Swap out any non-Concept concepts (ie Existentials)
                for (int i = 0; !result && i < concepts.length; i++) {
                    if (!(concepts[i] instanceof Concept)) {
                        final Concept a = getA(factory, concepts[i]);
                        gcis[0] = new GCI(concepts[i], a);

                        final AbstractConcept[] newConcepts = new AbstractConcept[concepts.length];
                        System.arraycopy(concepts, 0, newConcepts, 0,
                                concepts.length);
                        newConcepts[i] = a;
                        gcis[1] = new GCI(new Conjunction(newConcepts), rhs);
                        result = true;
                    }
                }

                if (!result) {
                    if (concepts.length > 2) {
                        // Binarise a conjunction of Concepts (expected/assumed
                        // by NF1)
                        result = true;
                        final AbstractConcept[] newConcepts = new AbstractConcept[concepts.length - 1];
                        System.arraycopy(concepts, 1, newConcepts, 0,
                                concepts.length - 1);
                        final AbstractConcept d = new Conjunction(newConcepts);
                        final Concept a = getA(factory, d);
                        final AbstractConcept cAndA = new Conjunction(
                                new AbstractConcept[] { concepts[0], a });

                        gcis[0] = new GCI(cAndA, rhs);
                        gcis[1] = new GCI(d, a);
                    } else if (concepts.length < 2) {
                        throw new AssertionError(
                                "Conjunctions of fewer than "
                                        + "two elements should not exist at this point: "
                                        + this);
                    }
                }
            }
        }

        return result;
    }
1303778
private Triple toTriple(TripleID tripleId) {
        return new Triple(
            dictionary.getNode(tripleId.getSubject(), TripleComponentRole.SUBJECT),
            dictionary.getNode(tripleId.getPredicate(), TripleComponentRole.PREDICATE),
            dictionary.getNode(tripleId.getObject(), TripleComponentRole.OBJECT)
        );
    }
855388
public static <T> RuleRouter<T> of(final Iterable<Rule<T>> rules) {
    return new RuleRouter<>(ImmutableList.copyOf(rules));
  }
1012954
function(rules) {
      var normalizedRules = {};
      _.each(rules, function(rule) {
        _.each(rule.apiGroups, function(apiGroup) {
          if (!normalizedRules[apiGroup]) {
            normalizedRules[apiGroup] = {};
          }
          _.each(rule.resources, function(resource) {
            normalizedRules[apiGroup][resource] = rule.verbs;
          });
        });
      });
      return normalizedRules;
    }
1134828
def to_triples(self, short_pred=True, properties=True):
        
        ts = []
        qs = set(self.nodeids(quantifier=True))
        for n in nodes(self):
            pred = n.pred.short_form() if short_pred else n.pred.string
            ts.append((n.nodeid, 'predicate', pred))
            if n.lnk is not None:
                ts.append((n.nodeid, 'lnk', '"{}"'.format(str(n.lnk))))
            if n.carg is not None:
                ts.append((n.nodeid, 'carg', '"{}"'.format(n.carg)))
            if properties and n.nodeid not in qs:
                for key, value in n.sortinfo.items():
                    ts.append((n.nodeid, key.lower(), value))

        for l in links(self):
            if safe_int(l.start) == LTOP_NODEID:
                ts.append((l.start, 'top', l.end))
            else:
                relation = '{}-{}'.format(l.rargname.upper(), l.post)
                ts.append((l.start, relation, l.end))
        return ts