Class BinaryNode
- Namespace
- LogicalOptimizer
- Assembly
- LogicalOptimizer.Core.dll
Base class for the derived binary connectives (ImpNode, XorNode, NandNode, NorNode, EqvNode) that live outside the canonical core. The core connectives And/Or are n-ary (NaryNode); Import(AstNode) decomposes derived nodes into And/Or/Not. Nodes are immutable and the hash code is computed once in the constructor.
public abstract class BinaryNode : AstNode
- Inheritance
-
BinaryNode
- Derived
- Inherited Members
Constructors
BinaryNode(AstNode, AstNode)
Creates a derived binary node over the two operands.
protected BinaryNode(AstNode left, AstNode right)
Parameters
Properties
Left
Left operand.
public AstNode Left { get; }
Property Value
Operator
Operator symbol used when rendering.
public abstract string Operator { get; }
Property Value
Right
Right operand.
public AstNode Right { get; }
Property Value
Methods
Clone()
Nodes are fully immutable, so cloning returns the same instance.
public override AstNode Clone()
Returns
Equals(object?)
Structural equality: same runtime type and equal operands.
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
GetVariables()
public override HashSet<string> GetVariables()
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.