private static bool TryNonExclusiveQueryEnumeratedParent( out ELNode foundNode, out ELNodeEnumerator enumerator, object key, LogicVariable v, ELNodeEnumerator parentEnumerator) { // Enumerated parent path // NonUniqueParent/Something foundNode = null; if (v == null) { // NonUniqueParent/Key // Enumerate parent, then do deterministic lookup for child. enumerator = new ELNodeEnumeratorFixedChildFromParentEnumerator(parentEnumerator, key); return true; } if (parentEnumerator.BindsVar(v)) { // We're doing a search for a variable that's aready bound. enumerator = new ELNodeEnumeratorPreboundVariable(parentEnumerator, v, false); return true; } // NonUniqueParent/Variable // Enumerate both parent and child. enumerator = new ELNodeEnumeratorLogicVariableFromParentEnumerator(parentEnumerator, v); return true; }
public ELNodeEnumeratorBindEnumeratedNodesToVariable(ELNodeEnumerator nodeEnumerator, LogicVariable variableToBind) { this.nodeEnumerator = nodeEnumerator; this.variableToBind = variableToBind; if (nodeEnumerator.BindsVar(variableToBind)) throw new InvalidOperationException("Variable appears on both the LHS and RHS of >>: "+ variableToBind.Name); }
private static bool TryExclusiveQueryEnumeratedParent( out ELNode foundNode, out ELNodeEnumerator enumerator, ELNodeEnumerator parentEnumerator, object key, LogicVariable v) { // Non-deterministic parent path // NonUniqueParent:Something foundNode = null; enumerator = (v == null) ? new ELNodeEnumeratorEnumerateParentAndLookupExclusiveKey(parentEnumerator, key) : (parentEnumerator.BindsVar(v)? (ELNodeEnumerator)new ELNodeEnumeratorPreboundVariable(parentEnumerator, v, true) : new ELNodeEnumeratorEnumerateParentAndBindVariable(parentEnumerator, v)); return true; }
public ELNodeEnumeratorBindEnumeratedNodesToVariable(ELNodeEnumerator nodeEnumerator, LogicVariable variableToBind) { this.nodeEnumerator = nodeEnumerator; this.variableToBind = variableToBind; if (nodeEnumerator.BindsVar(variableToBind)) throw new InvalidOperationException("Variable appears on both the LHS and RHS of >>: "+ variableToBind.Name); }
private static bool TryNonExclusiveQueryEnumeratedParent( out ELNode foundNode, out ELNodeEnumerator enumerator, object key, LogicVariable v, ELNodeEnumerator parentEnumerator) { // Enumerated parent path // NonUniqueParent/Something foundNode = null; if (v == null) { // NonUniqueParent/Key // Enumerate parent, then do deterministic lookup for child. enumerator = new ELNodeEnumeratorFixedChildFromParentEnumerator(parentEnumerator, key); return true; } if (parentEnumerator.BindsVar(v)) { // We're doing a search for a variable that's aready bound. enumerator = new ELNodeEnumeratorPreboundVariable(parentEnumerator, v, false); return true; } // NonUniqueParent/Variable // Enumerate both parent and child. enumerator = new ELNodeEnumeratorLogicVariableFromParentEnumerator(parentEnumerator, v); return true; }
private static bool TryExclusiveQueryEnumeratedParent( out ELNode foundNode, out ELNodeEnumerator enumerator, ELNodeEnumerator parentEnumerator, object key, LogicVariable v) { // Non-deterministic parent path // NonUniqueParent:Something foundNode = null; enumerator = (v == null) ? new ELNodeEnumeratorEnumerateParentAndLookupExclusiveKey(parentEnumerator, key) : (parentEnumerator.BindsVar(v)? (ELNodeEnumerator)new ELNodeEnumeratorPreboundVariable(parentEnumerator, v, true) : new ELNodeEnumeratorEnumerateParentAndBindVariable(parentEnumerator, v)); return true; }
public override bool BindsVar(LogicVariable v) { return v == this.variable || parentEnumerator.BindsVar(v); }
public override bool BindsVar(LogicVariable v) { return parentEnumerator.BindsVar(v); }
public override bool BindsVar(LogicVariable v) { return v == variableToBind || nodeEnumerator.BindsVar(v); }