11 instantiations of BoolExpression
System.Data.Entity (11)
System\Data\Mapping\ViewGeneration\Structures\BoolExpression.cs (11)
40return new BoolExpression(expr, memberDomainMap); 47return new BoolExpression(expr, m_memberDomainMap); 53return new BoolExpression(ExprType.Not, new BoolExpression[] { expression }); 60return new BoolExpression(ExprType.And, children); 67return new BoolExpression(ExprType.Or, children); 78return new BoolExpression(expression, m_memberDomainMap); 144internal static readonly BoolExpression True = new BoolExpression(true); 145internal static readonly BoolExpression False = new BoolExpression(false); 161yield return new BoolExpression(atom, m_memberDomainMap); 312return new BoolExpression(m_tree.Accept(rewriter), m_memberDomainMap); 364return new BoolExpression(expr, m_memberDomainMap);
284 references to BoolExpression
System.Data.Entity (284)
System\Data\Mapping\ViewGeneration\CellCreator.cs (22)
240BoolExpression leftQueryWhereClause = BoolExpression.CreateLiteral(new ScalarRestriction(memberToExpand, new ScalarConstant(conditionValue)), null); 241leftQueryWhereClause = BoolExpression.CreateAnd(originalCell.GetLeftQuery(viewTarget).WhereClause, leftQueryWhereClause); 243BoolExpression rightQueryWhereClause = BoolExpression.CreateLiteral(new ScalarRestriction(rightSidePath, new ScalarConstant(conditionValue)), null); 244rightQueryWhereClause = BoolExpression.CreateAnd(originalCell.GetRightQuery(viewTarget).WhereClause, rightQueryWhereClause); 324BoolExpression cQueryWhereClause = BoolExpression.True; 330cQueryWhereClause = BoolExpression.CreateLiteral(new TypeRestriction(cRootExtent, allTypes), null); 335BoolExpression sQueryWhereClause = BoolExpression.True; 365ref BoolExpression cQueryWhereClause, 368ref BoolExpression sQueryWhereClause) 419BoolExpression complexInTypes = BoolExpression.CreateLiteral(new TypeRestriction(complexMemberNode, allTypes), null); 420cQueryWhereClause = BoolExpression.CreateAnd(cQueryWhereClause, complexInTypes); 444BoolExpression conditionExpression = GetConditionExpression(sRootExtent, conditionMap); 446sQueryWhereClause = BoolExpression.CreateAnd(sQueryWhereClause, conditionExpression); 452BoolExpression conditionExpression = GetConditionExpression(cNode, conditionMap); 454cQueryWhereClause = BoolExpression.CreateAnd(cQueryWhereClause, conditionExpression); 468private static BoolExpression GetConditionExpression(MemberPath member, StorageConditionPropertyMapping conditionMap) 496return BoolExpression.CreateLiteral(conditionExpression, null);
System\Data\Mapping\ViewGeneration\CellTreeSimplifier.cs (35)
419BoolExpression g1 = null; 420BoolExpression g2 = null; 427g2 = BoolExpression.True; 431g1 = BoolExpression.True; 432g2 = BoolExpression.True; 454BoolExpression conjunct1 = BoolExpression.True; 455BoolExpression conjunct2 = BoolExpression.True; 456BoolExpression whereClause = null; 467whereClause = BoolExpression.CreateAnd(query1.WhereClause, query2.WhereClause); 476conjunct2 = BoolExpression.CreateAnd(query2.WhereClause, g2); 486conjunct1 = BoolExpression.CreateAnd(query1.WhereClause, g1); 487conjunct2 = BoolExpression.CreateAnd(query2.WhereClause, g2); 490whereClause = BoolExpression.CreateOr(BoolExpression.CreateAnd(query1.WhereClause, g1), 491BoolExpression.CreateAnd(query2.WhereClause, g2)); 500conjunct2 = BoolExpression.CreateAnd(query2.WhereClause, g2); 501whereClause = BoolExpression.CreateAnd(query1.WhereClause, BoolExpression.CreateNot(conjunct2)); 511List<BoolExpression> boolExprs = 551static private List<BoolExpression> 553BoolExpression conjunct1, BoolExpression conjunct2, CellTreeOpType opType) 556List<BoolExpression> bools1 = query1.BoolVars; 557List<BoolExpression> bools2 = query2.BoolVars; 562bools1 = BoolExpression.AddConjunctionToBools(bools1, conjunct1); 567bools2 = BoolExpression.AddConjunctionToBools(bools2, conjunct2); 572List<BoolExpression> bools = new List<BoolExpression>(); 579BoolExpression merged = null; 592merged = BoolExpression.CreateAnd(bools1[i], bools2[i]); 596merged = BoolExpression.CreateOr(bools1[i], bools2[i]); 600merged = BoolExpression.CreateAnd(bools1[i], 601BoolExpression.CreateNot(bools2[i]));
System\Data\Mapping\ViewGeneration\CqlGeneration\BooleanProjectedSlot.cs (2)
29internal BooleanProjectedSlot(BoolExpression expr, CqlIdentifiers identifiers, int originalCellNum) 43private readonly BoolExpression m_expr;
System\Data\Mapping\ViewGeneration\CqlGeneration\CaseCqlBlock.cs (5)
30internal CaseCqlBlock(SlotInfo[] slots, int caseSlot, CqlBlock child, BoolExpression whereClause, CqlIdentifiers identifiers, int blockAliasNum) 66if (false == BoolExpression.EqualityComparer.Equals(this.WhereClause, BoolExpression.True)) 86if (!BoolExpression.EqualityComparer.Equals(this.WhereClause, BoolExpression.True))
System\Data\Mapping\ViewGeneration\CqlGeneration\CqlBlock.cs (3)
33protected CqlBlock(SlotInfo[] slotInfos, List<CqlBlock> children, BoolExpression whereClause, CqlIdentifiers identifiers, int blockAliasNum) 53private readonly BoolExpression m_whereClause; 85protected BoolExpression WhereClause
System\Data\Mapping\ViewGeneration\CqlGeneration\ExtentCqlBlock.cs (5)
33BoolExpression whereClause, 69if (!BoolExpression.EqualityComparer.Equals(this.WhereClause, BoolExpression.True)) 85if (!BoolExpression.EqualityComparer.Equals(this.WhereClause, BoolExpression.True))
System\Data\Mapping\ViewGeneration\CqlGeneration\JoinCqlBlock.cs (1)
36: base(slotInfos, children, BoolExpression.True, identifiers, blockAliasNum)
System\Data\Mapping\ViewGeneration\CqlGeneration\UnionCqlBlock.cs (1)
30: base(slotInfos, children, BoolExpression.True, identifiers, blockAliasNum)
System\Data\Mapping\ViewGeneration\CqlGenerator.cs (4)
39BoolExpression topLevelWhereClause, 73private readonly BoolExpression m_topLevelWhereClause; 252BoolExpression whereClause = startSlotNum == 0 ? m_topLevelWhereClause : BoolExpression.True;
System\Data\Mapping\ViewGeneration\QueryRewriting\FragmentQuery.cs (15)
25private BoolExpression m_fromVariable; // optional 29private BoolExpression m_condition; 36public BoolExpression Condition 41public static FragmentQuery Create(BoolExpression fromVariable, CellQuery cellQuery) 43BoolExpression whereClause = cellQuery.WhereClause; 51BoolExpression whereClause = cellQuery.WhereClause.Create(roleBoolean); 52whereClause = BoolExpression.CreateAnd(whereClause, cellQuery.WhereClause); 60public static FragmentQuery Create(IEnumerable<MemberPath> attrs, BoolExpression whereClause) 65public static FragmentQuery Create(BoolExpression whereClause) 70internal FragmentQuery(string label, BoolExpression fromVariable, IEnumerable<MemberPath> attrs, BoolExpression condition) 78public BoolExpression FromVariable 119internal static BoolExpression CreateMemberCondition(MemberPath path, Constant domainValue, MemberDomainMap domainMap) 123return BoolExpression.CreateLiteral(new TypeRestriction(new MemberProjectedSlot(path), 128return BoolExpression.CreateLiteral(new ScalarRestriction(new MemberProjectedSlot(path),
System\Data\Mapping\ViewGeneration\QueryRewriting\FragmentQueryKB.cs (25)
46BoolExpression assocSetExpr = BoolExpression.CreateLiteral(new RoleBoolean(assocSet), domainMap); 66BoolExpression typeCondition = CreateIsOfTypeCondition(new MemberPath(end.EntitySet), 69BoolExpression inRoleExpression = BoolExpression.CreateLiteral(new RoleBoolean(end), domainMap); 70BoolExpression inSetExpression = BoolExpression.CreateAnd( 71BoolExpression.CreateLiteral(new RoleBoolean(end.EntitySet), domainMap), 119BoolExpression inRoleExpression1 = BoolExpression.CreateLiteral(new RoleBoolean(assocSet.AssociationSetEnds[0]), domainMap); 120BoolExpression inRoleExpression2 = BoolExpression.CreateLiteral(new RoleBoolean(assocSet.AssociationSetEnds[1]), domainMap); 147BoolExpression fromSetExpression = BoolExpression.CreateLiteral(new RoleBoolean(fromEntitySet), domainMap); 148BoolExpression toSetExpression = BoolExpression.CreateLiteral(new RoleBoolean(toEntitySet), domainMap); 168BoolExpression typeCondition = CreateIsOfTypeCondition(currentPath, derivedTypes, domainMap); 169BoolExpression typeConditionComplement = BoolExpression.CreateNot(typeCondition); 183BoolExpression nullCondition; 187nullCondition = BoolExpression.CreateLiteral(new ScalarRestriction(new MemberProjectedSlot(childPath), 192nullCondition = BoolExpression.CreateLiteral(new TypeRestriction(new MemberProjectedSlot(childPath), 209private static BoolExpression CreateIsOfTypeCondition(MemberPath currentPath, IEnumerable<EdmType> derivedTypes, MemberDomainMap domainMap) 212BoolExpression typeCondition = BoolExpression.CreateLiteral(new TypeRestriction(new MemberProjectedSlot(currentPath), typeDomain), domainMap);
System\Data\Mapping\ViewGeneration\QueryRewriting\FragmentQueryProcessor.cs (8)
54BoolExpression condition = BoolExpression.CreateOr(q1.Condition, q2.Condition); 80BoolExpression condition = BoolExpression.CreateAnd(q1.Condition, q2.Condition); 87return FragmentQuery.Create(qA.Attributes, BoolExpression.CreateAndNot(qA.Condition, qB.Condition)); 95private bool IsSatisfiable(BoolExpression condition) 98BoolExpression conditionUnderKB = condition.Create( 134BoolExpression exclusion = view.Condition.Create(
System\Data\Mapping\ViewGeneration\QueryRewriting\QueryRewriter.cs (45)
61BoolExpression _topLevelWhereClause; 71static Tile<FragmentQuery> TrueViewSurrogate = CreateTile(FragmentQuery.Create(BoolExpression.True)); 156_topLevelWhereClause = BoolExpression.True; 179internal BoolExpression TopLevelWhereClause 268BoolExpression domainWhereClause = CreateMemberCondition(currentPath, domainValue); 301BoolExpression domainQueryCondition = null; 307domainQueryCondition = BoolExpression.True; 326domainQueryCondition = BoolExpression.CreateLiteral(new TypeRestriction(new MemberProjectedSlot(_extentPath), typeDomain), _domainMap); 332IEnumerable<BoolExpression> whereClauses = from fragmentQuery in fragmentQueries 335BoolExpression exposedRegionCondition = BoolExpression.CreateOr(whereClauses.ToArray()); 343BoolExpression whenCondition = BoolExpression.True; 376whenCondition = BoolExpression.True; 387BoolExpression currentWhereClause, 400BoolExpression domainAddedWhereClause = CreateMemberCondition(currentPath, domainValue); 402BoolExpression domainWhereClause = BoolExpression.CreateAnd(currentWhereClause, domainAddedWhereClause); 412BoolExpression whereClause = rewriting.Query.Condition; 480private void AddUnrecoverableAttributesError(IEnumerable<MemberPath> attributes, BoolExpression domainAddedWhereClause, ErrorLog errorLog) 526caseStatement.AddWhenThen(BoolExpression.False /* arbitrary condition */, 619caseStatement.AddWhenThen(BoolExpression.True, new ConstantProjectedSlot(defaultValue, currentPath)); 634private BoolExpression GetTopLevelWhereClause(HashSet<FragmentQuery> outputUsedViews) 636BoolExpression topLevelWhereClause = BoolExpression.True; 666EnsureConfigurationIsFullyMapped(_extentPath, BoolExpression.True, outputUsedViews, _errorLog); 694Tile<FragmentQuery> noNullToAvoid = CreateTile(FragmentQuery.Create(_keyAttributes, BoolExpression.CreateNot(fragmentQuery.Condition))); 712Tile<FragmentQuery> toAvoid = CreateTile(FragmentQuery.Create(_keyAttributes, BoolExpression.CreateNot(toFill.Query.Condition))); 791caseStmt.AddWhenThen(BoolExpression.True, new ConstantProjectedSlot(typeConstant, memberPath)); 804private bool FindRewritingAndUsedViews(IEnumerable<MemberPath> attributes, BoolExpression whereClause, 814private bool FindRewritingAndUsedViews(IEnumerable<MemberPath> attributes, BoolExpression whereClause, 827private bool FindRewriting(IEnumerable<MemberPath> attributes, BoolExpression whereClause, 832Tile<FragmentQuery> toAvoid = CreateTile(FragmentQuery.Create(_keyAttributes, BoolExpression.CreateNot(whereClause))); 862toFillQuery = FragmentQuery.Create(toFillQuery.Attributes, BoolExpression.CreateAndNot(toFillQuery.Condition, rewriting.Query.Condition)); 902attributeConditions[attribute] = FragmentQuery.Create(BoolExpression.CreateAndNot(toFillQuery.Condition, remainingCondition.Condition)); 995currentAttributeCondition = FragmentQuery.Create(BoolExpression.CreateAndNot(currentAttributeCondition.Condition, view.Condition)); 1116private BoolExpression CreateMemberCondition(MemberPath path, Constant domainValue) 1130BoolExpression domainWhereClause = FragmentQuery.CreateMemberCondition(currentPath, domainValue, domainMap); 1206private static BoolExpression TileToBoolExpr(Tile<FragmentQuery> tile) 1214return BoolExpression.True; 1222return BoolExpression.CreateAnd(TileToBoolExpr(tile.Arg1), TileToBoolExpr(tile.Arg2)); 1224return BoolExpression.CreateAnd(TileToBoolExpr(tile.Arg1), BoolExpression.CreateNot(TileToBoolExpr(tile.Arg2))); 1226return BoolExpression.CreateOr(TileToBoolExpr(tile.Arg1), TileToBoolExpr(tile.Arg2)); 1263return !_context.LeftFragmentQP.IsSatisfiable(FragmentQuery.Create(BoolExpression.CreateNot(query.Condition)));
System\Data\Mapping\ViewGeneration\QueryRewriting\RewritingValidator.cs (24)
87BoolExpression inExtentCondition = BoolExpression.CreateLiteral(wrapper.CreateRoleBoolean(), _viewgenContext.MemberMaps.QueryDomainMap); 89BoolExpression unsatisfiedConstraint; 136private bool CheckEquivalence(FragmentQuery cQuery, FragmentQuery sQuery, BoolExpression inExtentCondition, 137out BoolExpression unsatisfiedConstraint) 143FragmentQuery cMinusS = FragmentQuery.Create(BoolExpression.CreateAnd(cMinusSx.Condition, inExtentCondition)); 144FragmentQuery sMinusC = FragmentQuery.Create(BoolExpression.CreateAnd(sMinusCx.Condition, inExtentCondition)); 171private void ReportConstraintViolation(string message, BoolExpression extraConstraint, ViewGenErrorCode errorCode, IEnumerable<LeftCellWrapper> relevantWrappers) 239private void CheckConstraintsOnProjectedConditionMembers(Dictionary<MemberValueBinding, CellTreeNode> memberValueTrees, LeftCellWrapper wrapper, CellTreeNode sQueryTree, BoolExpression inExtentCondition) 256BoolExpression cWhereClause = PropagateCellConstantsToWhereClause(wrapper, wrapper.RightCellQuery.WhereClause, 263BoolExpression unsatisfiedConstraint; 283internal static BoolExpression PropagateCellConstantsToWhereClause(LeftCellWrapper wrapper, BoolExpression expression, 316BoolExpression result = BoolExpression.CreateAnd(expression, BoolExpression.CreateLiteral(restriction, memberMaps.QueryDomainMap)); 333BoolExpression expression = wrapper.RightCellQuery.WhereClause; 341BoolExpression resultingExpr = BoolExpression.CreateAnd(expression, BoolExpression.CreateLiteral(restriction, memberMaps.QueryDomainMap)); 350private void CheckConstraintsOnNonNullableMembers(Dictionary<MemberValueBinding, CellTreeNode> memberValueTrees, LeftCellWrapper wrapper, CellTreeNode sQueryTree, BoolExpression inExtentCondition) 374internal static void EntityConfigurationToUserString(BoolExpression condition, StringBuilder builder) 379internal static void EntityConfigurationToUserString(BoolExpression condition, StringBuilder builder, bool writeRoundTrippingMessage) 400internal CellTreeNode GetCellTreeNode(BoolExpression whereClause)
System\Data\Mapping\ViewGeneration\Structures\BoolExpression.cs (38)
37internal static BoolExpression CreateLiteral(BoolLiteral literal, MemberDomainMap memberDomainMap) 44internal BoolExpression Create(BoolLiteral literal) 51internal static BoolExpression CreateNot(BoolExpression expression) 53return new BoolExpression(ExprType.Not, new BoolExpression[] { expression }); 58internal static BoolExpression CreateAnd(params BoolExpression[] children) 65internal static BoolExpression CreateOr(params BoolExpression[] children) 70internal static BoolExpression CreateAndNot(BoolExpression e1, BoolExpression e2) 76internal BoolExpression Create(DomainBoolExpr expression) 97private BoolExpression(ExprType opType, IEnumerable<BoolExpression> children) 99List<BoolExpression> childList = new List<BoolExpression>(children); 102foreach (BoolExpression child in children) 143internal static readonly IEqualityComparer<BoolExpression> EqualityComparer = new BoolComparer(); 144internal static readonly BoolExpression True = new BoolExpression(true); 145internal static readonly BoolExpression False = new BoolExpression(false); 152internal IEnumerable<BoolExpression> Atoms 281private IEnumerable<DomainBoolExpr> ToBoolExprList(IEnumerable<BoolExpression> nodes) 283foreach (BoolExpression node in nodes) 302internal BoolExpression RemapLiterals(Dictionary<BoolLiteral, BoolLiteral> remap) 309return remap.TryGetValue(BoolExpression.GetBoolLiteral(term), out newLiteral) ? 361internal BoolExpression RemapBool(Dictionary<MemberPath, MemberPath> remap) 370internal static List<BoolExpression> AddConjunctionToBools(List<BoolExpression> bools, 371BoolExpression conjunct) 373List<BoolExpression> result = new List<BoolExpression>(); 375foreach (BoolExpression b in bools) 401internal BoolExpression MakeCopy() 403BoolExpression copy = Create(m_tree.Accept(CopyVisitorInstance)); 441private class BoolComparer : IEqualityComparer<BoolExpression> 445public bool Equals(BoolExpression left, BoolExpression right) 462public int GetHashCode(BoolExpression expression)
System\Data\Mapping\ViewGeneration\Structures\BoolExpressionVisitors.cs (8)
64BoolLiteral literal = BoolExpression.GetBoolLiteral(expression); 97BoolLiteral literal = BoolExpression.GetBoolLiteral(expression); 175BoolLiteral literal = BoolExpression.GetBoolLiteral(expression); 211BoolLiteral literal = BoolExpression.GetBoolLiteral(expression); 403BoolLiteral literal = BoolExpression.GetBoolLiteral(expression); 467BoolLiteral literal = BoolExpression.GetBoolLiteral(expression); 484BoolLiteral literal = BoolExpression.GetBoolLiteral(termExpr); 647BoolLiteral literal = BoolExpression.GetBoolLiteral(expression);
System\Data\Mapping\ViewGeneration\Structures\BoolLiteral.cs (5)
28/// which may be modified upon calling <see cref="BoolExpression.ExpensiveSimplify"/>. This is what the method <see cref="BoolLiteral.FixRange"/> is used for. 72/// See <see cref="BoolExpression.RemapBool"/>. 77/// See <see cref="BoolExpression.GetRequiredSlots"/>. 84/// See <see cref="BoolExpression.AsEsql"/>. 89/// See <see cref="BoolExpression.AsCqt"/>.
System\Data\Mapping\ViewGeneration\Structures\CaseStatement.cs (4)
101internal void AddWhenThen(BoolExpression condition, ProjectedSlot value) 407internal WhenThen(BoolExpression condition, ProjectedSlot value) 415private readonly BoolExpression m_condition; 423internal BoolExpression Condition
System\Data\Mapping\ViewGeneration\Structures\CellQuery.cs (21)
52private List<BoolExpression> m_boolExprs; 57private BoolExpression m_whereClause; 58private BoolExpression m_originalWhereClause; // m_originalWhereClause is not changed 71internal CellQuery(List<ProjectedSlot> slots, BoolExpression whereClause, MemberPath rootMember, SelectDistinct eliminateDuplicates) 72: this(slots.ToArray(), whereClause, new List<BoolExpression>(), eliminateDuplicates, rootMember) 80BoolExpression whereClause, 81List<BoolExpression> boolExprs, 145internal List<BoolExpression> BoolVars 156internal BoolExpression WhereClause 673List<BoolExpression> atoms = new List<BoolExpression>(); 674foreach (BoolExpression atom in WhereClause.Atoms) 699atoms.Add(BoolExpression.CreateLiteral(newOneOf, domainMap)); 710m_whereClause = BoolExpression.CreateAnd(atoms.ToArray()); 718internal BoolExpression GetBoolVar(int varNum) 728m_boolExprs = new List<BoolExpression>(numBoolVars); 734m_boolExprs[cellNum] = BoolExpression.True; 754private IEnumerable<MemberRestriction> GetConjunctsFromWhereClause(BoolExpression whereClause) 756foreach (BoolExpression boolExpr in whereClause.Atoms) 819List<BoolExpression> boolExprs = m_boolExprs; 822foreach (BoolExpression boolExpr in boolExprs)
System\Data\Mapping\ViewGeneration\Structures\LeafCellTreeNode.cs (2)
161BoolExpression expr = cellQuery.GetBoolVar(boolNum); 169boolSlot = new BooleanProjectedSlot(BoolExpression.False, identifiers, boolNum);
System\Data\Mapping\ViewGeneration\Structures\LeftCellWrapper.cs (2)
360bool whereClauseEqual = BoolExpression.EqualityComparer.Equals(left.RightCellQuery.WhereClause, 368return BoolExpression.EqualityComparer.GetHashCode(wrapper.RightCellQuery.WhereClause) ^ wrapper.RightExtent.GetHashCode();
System\Data\Mapping\ViewGeneration\Structures\OpCellTreeNode.cs (6)
249new BooleanProjectedSlot(BoolExpression.False, identifiers, SlotToBoolIndex(slotNum)), null /* member path*/); 501slot = new BooleanProjectedSlot(BoolExpression.False, identifiers, SlotToBoolIndex(slotNum)); 575BoolExpression originBool = BoolExpression.False; 583originBool = BoolExpression.CreateOr(originBool, BoolExpression.CreateLiteral(boolExpr, RightDomainMap));
System\Data\Mapping\ViewGeneration\Validation\ForeignConstraint.cs (1)
440BoolExpression endCondition = pNode.RightFragmentQuery.Condition.Create(endRoleBoolean);
System\Data\Mapping\ViewGeneration\ViewgenContext.cs (2)
309BoolExpression fromVariable = BoolExpression.CreateLiteral(new CellIdBoolean(m_identifiers, extentCellsList[i].CellNumber), m_memberMaps.LeftDomainMap);