_Equivalent

it.grypho.scala.leonardo.logic._Equivalent
case class _Equivalent(a: _Expression, b: _Expression) extends _Expression

equivalent(f, g) -- whether two formulas agree on every assignment of their free names as booleans (F_0322, LT L_0079).

Logical equivalence is not ==. == compares values and stays what it was (f == g between two formulas echoes itself, and a connective is not even an operand of ==, L_0066); equivalence asks about every row of the table, which is what the BL lessons built by hand as truth f xor g reading false throughout.

Both sides are evaluated first, so a name bound in the session is read as its value and is not enumerated; the names left over -- the free names of the two reduced sides together -- are enumerated as truth does, the first name the most significant. true when every row agrees, false as soon as one differs (the first such row is in detailed, for the REPL's note), and unevaluated past the table's cap or when a row is no boolean: crisp only, the cnf / dnf convention (F_0133), since a graded value has no row to be equal on.

Value parameters

a

the left formula

b

the right formula

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait _Expression
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def children: List[_Expression]

Sub-expressions subject to recursive structural traversal. Binder positions (e.g. the differentiation variable) are excluded.

Sub-expressions subject to recursive structural traversal. Binder positions (e.g. the differentiation variable) are excluded.

Attributes

Definition Classes

The verdict, or why there is none; what the REPL queries -- computed once per environment, so its note reads the table eval built (F_0212).

The verdict, or why there is none; what the REPL queries -- computed once per environment, so its note reads the table eval built (F_0212).

Value parameters

env

bindings, and the table's cap

Attributes

Returns

the verdict, or the reason the node stays unevaluated

override def eval(env: Environment): Either[_Expression, _Value]

Reduces this expression in the given environment.

Reduces this expression in the given environment.

Value parameters

env

variable bindings and display precision

Attributes

Returns

Right(v) when all free variables resolved to concrete values; Left(e) when reduction is partial or impossible

Definition Classes
override def rebuild(c: List[_Expression]): _Expression

Reconstructs the same node shape with replacement sub-expressions.

Reconstructs the same node shape with replacement sub-expressions.

Value parameters

newChildren

replacements in the same order and count as children

Attributes

Definition Classes
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Inherited fields

lazy val freeVars: Set[String]

Cached set of free variable names; O(1) after the first access.

Cached set of free variable names; O(1) after the first access.

Attributes

Inherited from:
_Expression