Checks if a cause matches a fact, i.e. is the cause's pattern
can be satisfied by the fact.
@param cause
@param fact
@returns {*}
193225
function(cause, fact) {
        return this.causeMemberMatchesFactMember(cause.predicate, fact.predicate) 
            && this.causeMemberMatchesFactMember(cause.subject, fact.subject)
            && this.causeMemberMatchesFactMember(cause.object, fact.object);
    }
38460
public boolean assertFact(final Object behaviorContext,
                              final InternalFactHandle factHandle,
                              final PropagationContext pctx,
                              final InternalWorkingMemory workingMemory) {
        boolean result = true;
        for ( int i = 0; i < behaviors.length; i++ ) {
            result = result && behaviors[i].assertFact( ((Object[]) behaviorContext)[i],
                                                        factHandle,
                                                        pctx,
                                                        workingMemory );
        }
        return result;
    }
272857
public boolean matches(String path, MatchingStrategy matchingStrategy) {
    return path!=null && matchingStrategy.matches(clause, path);
  }
1186218
function(mapping, notYetSubstitutedFact, causedBy, graphs) {
        var subject, predicate, object, substitutedFact;
        if (mapping == {}) {
            return notYetSubstitutedFact;
        }
        subject = this.substituteElementVariablesWithMapping(notYetSubstitutedFact.subject, mapping);
        predicate = this.substituteElementVariablesWithMapping(notYetSubstitutedFact.predicate, mapping);
        object = this.substituteElementVariablesWithMapping(notYetSubstitutedFact.object, mapping);        

        substitutedFact = new Fact(predicate, subject, object, [], false);

        if (causedBy) {
            substitutedFact.causedBy = causedBy;
            substitutedFact.explicit = false;
        }

        if (graphs) {
            substitutedFact.graphs = graphs;
        }

        return substitutedFact;
    }
513102
private boolean restartStory(Throwable cause) {
		while (cause != null) {
			if (cause instanceof RestartingStoryFailure) {
				return true;
			}
			cause = cause.getCause();
		}
		return false;
	}
723646
function(facts) {
        var ttl = '', fact,
            that = this;
        for (var i = 0; i < facts.length; i++) {
            fact = facts[i];
            ttl += that.factToTurtle(fact);
        }
        return ttl;
    }
181905
function(rule, facts) {
        var mappingList = this.getMappings(rule, facts),
            consequences = [], deferred = q.defer();

        try {
            this.checkOperators(rule, mappingList);
            
            for (var i = 0; i < mappingList.length; i++) {
                if (mappingList[i]) {
                    // Replace mappings on all consequences
                    for (var j = 0; j < rule.consequences.length; j++) {                        
                        consequences.push(this.substituteFactVariables(mappingList[i], rule.consequences[j], [], rule));
                        
                    }
                }
            }
            deferred.resolve(consequences);
        } catch(e) {
            deferred.reject(e);
        }

        return deferred.promise;
    }
346305
private static void addCauseToBacktrace(final Throwable cause, final List<String> bTrace) {
        if (cause.getMessage() == null) {
            bTrace.add(BT_CAUSED_BY_PREFIX + cause.getClass().getName());
        } else {
            bTrace.add(BT_CAUSED_BY_PREFIX + cause.getClass().getName() + ": " + cause.getMessage());
        }
        for (final StackTraceElement ste : cause.getStackTrace()) {
            bTrace.add(BT_PREFIX + ste.toString());
        }
        if (cause.getCause() != null) {
            addCauseToBacktrace(cause.getCause(), bTrace);
        }
    }
587445
public FactPattern getLHSBoundFact(final String var) {
        if (this.lhs == null) {
            return null;
        }
        for (int i = 0; i < this.lhs.length; i++) {
            IPattern pat = this.lhs[i];
            if (pat instanceof FromCompositeFactPattern) {
                pat = ((FromCompositeFactPattern) pat).getFactPattern();
            }
            if (pat instanceof FactPattern) {
                final FactPattern p = (FactPattern) pat;
                if (p.getBoundName() != null && var.equals(p.getBoundName())) {
                    return p;
                }
            }
        }
        return null;
    }
279318
function(fs, subset) {
        for (var i = 0; i < fs.length; i++) {
            for (var j = 0; j < subset.length; j++) {
                if ((subset[j] !== undefined) && (fs[i].equivalentTo(subset[j]))) {
                    fs[i].causedBy = this.uniquesCausedBy(fs[i].causedBy, subset[j].causedBy);
                    fs[i].consequences = fs[i].consequences.concat(subset[j].consequences);
                    subset[j].doPropagate(fs[i]);                                                            
                    delete subset[j];
                }
            }
        }
        for (i = 0; i < subset.length; i++) {
            if (subset[i] !== undefined) fs.push(subset[i]);
        }
    }
665064
private static boolean failedEquivalenceCheck(
      EquivalenceMatch eqMatch, EquivalenceMethod eqMethod) {
    return eqMatch == EquivalenceMatch.VALUE_MISMATCH
        || (eqMatch == EquivalenceMatch.NO_KEY_MATCH && eqMethod != EquivalenceMethod.INVARIANT);
  }
253278
public static boolean isCertPathBuilderException(Throwable cause) {
        if (cause == null)
            return false;
        if (cause instanceof java.security.cert.CertPathBuilderException)
            return true;
        return isCertPathBuilderException(cause.getCause());
    }
990832
public boolean enforceNode(int x, ICause cause) throws ContradictionException {
		assert cause != null;
		assert (x >= 0 && x < n);
		if (UB.getNodes().contains(x)) {
			if (LB.addNode(x)) {
				if (reactOnModification) {
					delta.add(x, GraphDelta.NE, cause);
				}
				GraphEventType e = GraphEventType.ADD_NODE;
				notifyPropagators(e, cause);
				return true;
			}
			return false;
		}
		this.contradiction(cause, "enforce node which is not in the domain");
		return true;
	}
392958
@Factory
    public static <T extends Throwable, C extends Throwable> Matcher<T> withCause(final Matcher<C> matcher) {
        return new CustomTypeSafeMatcher<T>(CustomMatchers.fixedDescription("cause ", matcher)) {
            @Override
            protected boolean matchesSafely(T item) {
                return matcher.matches(item.getCause());
            }

            public void describeMismatchSafely(T item, Description mismatchDescription) {
                matcher.describeMismatch(item.getCause(), mismatchDescription);
            }
        };
    }
1097413
public static ProofViewException fromThrowable(Throwable cause) {
    return (cause instanceof ProofViewException)
                   ? (ProofViewException) cause
                   : new ProofViewException(cause);
  }
1272514
public <T extends Cause> T findCause(Class<T> type) {
        for (Cause c : causeBag.keySet())
            if (type.isInstance(c))
                return type.cast(c);
        return null;
    }
1143662
public static Fact fact(String key, @NullableDecl Object value) {
    return new Fact(key, String.valueOf(value));
  }