Equation

sealed class Equation : TermConvertible, Castable<Equation>

A class representing an Equation of logic terms, to be unified;

LHS stands for Left-Hand side and RHS stands for Right-Hand side, of the Equation

Types

Assignment
Link copied to clipboard
data class Assignment(lhs: Var, rhs: Term) : Equation
An equation stating Var = Term
Companion
Link copied to clipboard
object Companion
Equation companion object
Comparison
Link copied to clipboard
data class Comparison(lhs: Term, rhs: Term) : Equation
An equation comparing Terms, possibly different
Contradiction
Link copied to clipboard
data class Contradiction(lhs: Term, rhs: Term) : Equation
A contradicting equation, trying to equate non equal Terms
Identity
Link copied to clipboard
data class Identity(lhs: Term, rhs: Term) : Equation
An equation of identical Terms

Functions

apply
Link copied to clipboard
fun apply(substitution: Substitution, equalityChecker: (Term, Term) -> Boolean = Term::equals): Equation
Applies given substitution to the Equation left-hand and right-hand sides, returning the new EquationTo modify default equality between Terms, a custom equalityChecker can be provided
as
Link copied to clipboard
open fun <U : Equation> as(): U?
asAssignment
Link copied to clipboard
open fun asAssignment(): Equation.Assignment?
asComparison
Link copied to clipboard
open fun asComparison(): Equation.Comparison?
asContradiction
Link copied to clipboard
open fun asContradiction(): Equation.Contradiction?
asIdentity
Link copied to clipboard
open fun asIdentity(): Equation.Identity?
castTo
Link copied to clipboard
open fun <U : Equation> castTo(): U
castToAssignment
Link copied to clipboard
fun castToAssignment(): Equation.Assignment
castToComparison
Link copied to clipboard
fun castToComparison(): Equation.Comparison
castToContradiction
Link copied to clipboard
fun castToContradiction(): Equation.Contradiction
castToIdentity
Link copied to clipboard
fun castToIdentity(): Equation.Identity
swap
Link copied to clipboard
fun swap(): Equation
toPair
Link copied to clipboard
open fun toPair(): Pair<Term, Term>
toTerm
Link copied to clipboard
open override fun toTerm(): Struct

Properties

isAssignment
Link copied to clipboard
open val isAssignment: Boolean
isComparison
Link copied to clipboard
open val isComparison: Boolean
isContradiction
Link copied to clipboard
open val isContradiction: Boolean
isIdentity
Link copied to clipboard
open val isIdentity: Boolean
lhs
Link copied to clipboard
open val lhs: Term
The left-hand side of the equation
rhs
Link copied to clipboard
open val rhs: Term
The right-hand side of the equation

Inheritors

Equation
Link copied to clipboard
Equation
Link copied to clipboard
Equation
Link copied to clipboard
Equation
Link copied to clipboard

Extensions

toAssignmentPair
Link copied to clipboard
fun Equation.toAssignmentPair(): Pair<Var, Term>
toSubstitution
Link copied to clipboard
fun Equation.toSubstitution(): Substitution.Unifier
Transforms an Equation of a Var with a Term to the corresponding Substitution