protected override IEnumerable <SubstitutionSet> CheckActivation(KB kb, Name perspective, IEnumerable <SubstitutionSet> constraints) { //if (!m_other.HasModifier && (m_other.InnerName.IsVariable || m_other.InnerName.IsPrimitive)) //{ // foreach (var constraint in constraints) // { // var sub = new Substitution(m_variable, m_other.InnerName); // if (!constraint.Conflicts(sub)) // { // var c = new SubstitutionSet(constraint); // c.AddSubstitution(sub); // yield return c; // } // } //} //else //{ //} foreach (var result in m_other.Retrive(kb, perspective, constraints)) { var sub = new Substitution(m_variable, Name.BuildName(result.Item1)); if (result.Item2.AddSubstitution(sub)) { yield return(result.Item2); } } }
protected override IEnumerable <SubstitutionSet> CheckActivation(KB kb, Name perspective, IEnumerable <SubstitutionSet> constraints) { foreach (var pair in m_retriver.Retrive(kb, perspective, constraints)) { if (CompareValues(pair.Item1, m_value, m_operation)) { yield return(pair.Item2); } } }
protected override IEnumerable <SubstitutionSet> CheckActivation(KB kb, Name perspective, IEnumerable <SubstitutionSet> constraints) { var r1 = Property1.Retrive(kb, perspective, constraints).GroupBy(p => p.Item1, p => p.Item2); foreach (var g in r1) { foreach (var crossPair in Property2.Retrive(kb, perspective, g)) { if (CompareValues(g.Key, crossPair.Item1, Operator)) { yield return(crossPair.Item2); } } } }
protected override IEnumerable <SubstitutionSet> CheckActivation(KB kb, Name perspective, IEnumerable <SubstitutionSet> constraints) { foreach (var pair in m_predicate.Retrive(kb, perspective, constraints)) { if (pair.Item1.TypeCode != TypeCode.Boolean) { continue; } if (((bool)pair.Item1) != m_invert) { yield return(pair.Item2); } } }