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

left AstNode
right AstNode

Properties

Left

Left operand.

public AstNode Left { get; }

Property Value

AstNode

Operator

Operator symbol used when rendering.

public abstract string Operator { get; }

Property Value

string

Right

Right operand.

public AstNode Right { get; }

Property Value

AstNode

Methods

Clone()

Nodes are fully immutable, so cloning returns the same instance.

public override AstNode Clone()

Returns

AstNode

Equals(object?)

Structural equality: same runtime type and equal operands.

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

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

HashSet<string>

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.