public void Negate_Optimize_FullyConstant_Value() { var originalnode = new NegateNode(new ShortValueNode(1)); var optimizednode = originalnode.Optimize(NoVariables); Assert.AreEqual(0, optimizednode.GetValue()); }
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)); }
public DomainId <INegateNode> CreateNegationOperation( string definition, DomainId <IBooleanLogicNode> childExpression) { var negateNode = new NegateNode( m_ids.Next, definition, childExpression); return(DomainItemRegistration <INegateNode>(negateNode)); }
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))); }