コード例 #1
0
        public void Negate_Optimize_FullyConstant_Value()
        {
            var originalnode = new NegateNode(new ShortValueNode(1));

            var optimizednode = originalnode.Optimize(NoVariables);

            Assert.AreEqual(0, optimizednode.GetValue());
        }
コード例 #2
0
        public void Negate_Optimize_RecursiveReduction()
        {
            var originalnode = new NegateNode(new VariableValueNode("a"));

            var optimizednode = originalnode.Optimize(new Dictionary <string, ushort> {
                { "a", 0 }
            });

            Assert.IsInstanceOfType(optimizednode, typeof(ConstantNode));
        }
コード例 #3
0
        public DomainId <INegateNode> CreateNegationOperation(
            string definition,
            DomainId <IBooleanLogicNode> childExpression)
        {
            var negateNode = new NegateNode(
                m_ids.Next,
                definition,
                childExpression);

            return(DomainItemRegistration <INegateNode>(negateNode));
        }
コード例 #4
0
 protected virtual QueryNode VisitNegate(NegateNode node, AzureQueryOptimizerState state)
 {
     return((QueryNode) new NegateNode(this.Visit(node.Operand, state)));
 }
 protected virtual QueryNode VisitNegate(NegateNode node, ElasticSearchQueryOptimizerState state)
 {
     return(new NegateNode(Visit(node.Operand, state)));
 }