Exemple #1
0
            internal static bool IsFinal(DomainBoolExpr expression)
            {
                IsFinalVisitor visitor = new IsFinalVisitor();

                return(expression.Accept <bool>(visitor));
            }
Exemple #2
0
 // effects: Creates a boolean expression based on expr
 internal BoolExpression(DomainBoolExpr expr, MemberDomainMap memberDomainMap)
 {
     m_tree            = expr;
     m_memberDomainMap = memberDomainMap;
 }
Exemple #3
0
            // effectS: Returns all the terms in expression. If
            // allowAllOperators is true, ensures that there are no NOTs or ORs
            internal static IEnumerable <DomainTermExpr> GetTerms(DomainBoolExpr expression, bool allowAllOperators)
            {
                TermVisitor visitor = new TermVisitor(allowAllOperators);

                return(expression.Accept <IEnumerable <DomainTermExpr> >(visitor));
            }
Exemple #4
0
            internal static StringBuilder ToBuilder(DomainBoolExpr expression, StringBuilder builder)
            {
                CompactStringVisitor visitor = new CompactStringVisitor(builder);

                return(expression.Accept <StringBuilder>(visitor));
            }
Exemple #5
0
            internal static DbExpression AsCqt(DomainBoolExpr expression, DbExpression row)
            {
                AsCqtVisitor visitor = new AsCqtVisitor(row);

                return(expression.Accept <DbExpression>(visitor));
            }
Exemple #6
0
            internal static StringBuilder AsUserString(DomainBoolExpr expression, StringBuilder builder, string blockAlias)
            {
                AsUserStringVisitor visitor = new AsUserStringVisitor(builder, blockAlias);

                return(expression.Accept <StringBuilder>(visitor));
            }
Exemple #7
0
 // effects: Creates a new boolean expression using the memberDomainMap of this expression
 internal BoolExpression Create(DomainBoolExpr expression)
 {
     return(new BoolExpression(expression, m_memberDomainMap));
 }
Exemple #8
0
 internal void FixDomainMap(MemberDomainMap domainMap)
 {
     Debug.Assert(domainMap != null, "Member domain map is not set");
     m_tree = FixRangeVisitor.FixRange(m_tree, domainMap);
 }
Exemple #9
0
        // effects: Creates a new boolean expression using the memberDomainMap of this expression
        internal BoolExpression Create(BoolLiteral literal)
        {
            DomainBoolExpr expr = literal.GetDomainBoolExpression(m_memberDomainMap);

            return(new BoolExpression(expr, m_memberDomainMap));
        }
Exemple #10
0
        // effects: Given a mapping from old jointree nodes to new ones,
        // creates a boolean expression from "this" in which the references
        // to old join tree nodes are replaced by references to new nodes
        // from remap (boolean expressions other than constants can contain
        // references to jointree nodes, e.g., "var in values" -- var is a
        // reference to a JoinTreeNode
        internal BoolExpression RemapBool(Dictionary <MemberPath, MemberPath> remap)
        {
            DomainBoolExpr expr = RemapBoolVisitor.RemapExtentTreeNodes(m_tree, m_memberDomainMap, remap);

            return(new BoolExpression(expr, m_memberDomainMap));
        }
Exemple #11
0
        // effects: Create a boolean expression from a literal value
        internal static BoolExpression CreateLiteral(BoolLiteral literal, MemberDomainMap memberDomainMap)
        {
            DomainBoolExpr expr = literal.GetDomainBoolExpression(memberDomainMap);

            return(new BoolExpression(expr, memberDomainMap));
        }