MST

interface MST

A Mathematical Syntax Tree (MST) node for mathematical expressions.

Author

Alexander Nozik

Types

Link copied to clipboard
data class Binary(operation: String, left: MST, right: MST) : MST

A node containing binary operation.

Link copied to clipboard
data class Numeric(value: Number) : MST

A node containing a numeric value or scalar.

Link copied to clipboard
data class Unary(operation: String, value: MST) : MST

A node containing a unary operation.

Inheritors

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

Extensions

Link copied to clipboard
open infix override fun MST.and(other: MST): MST

Logic 'and'

Link copied to clipboard
open operator fun MST.div(k: Number): MST
open operator fun MST.div(k: Number): MST
open operator fun MST.div(k: Number): MST
open operator fun MST.div(k: Number): MST

Division of this element by scalar.

open operator fun MST.div(arg: MST): MST
open operator fun MST.div(arg: MST): MST

Division of two elements.

Link copied to clipboard
fun <T> MST.interpret(algebra: Algebra<T>, arguments: Map<Symbol, T>): T
fun <T> MST.interpret(algebra: Algebra<T>, vararg arguments: Pair<Symbol, T>): T

Interprets the MST node with this Algebra and optional arguments

Link copied to clipboard
open operator override fun MST.minus(arg: MST): MST.Binary
open operator override fun MST.minus(arg: MST): MST.Binary
open operator override fun MST.minus(arg: MST): MST.Binary
open operator override fun MST.minus(arg: MST): MST.Binary

Subtraction of two elements.

open operator fun MST.minus(other: Number): MST
open operator fun MST.minus(other: Number): MST

Subtraction of element from number.

Link copied to clipboard
open operator override fun MST.not(): MST

Logic 'not'

Link copied to clipboard
open infix override fun MST.or(other: MST): MST

Logic 'or'

Link copied to clipboard
open operator fun MST.plus(arg: MST): MST
open operator fun MST.plus(arg: MST): MST
open operator fun MST.plus(arg: MST): MST
open operator fun MST.plus(arg: MST): MST

Addition of two elements.

open operator fun MST.plus(other: Number): MST
open operator fun MST.plus(other: Number): MST

Addition of element and scalar.

Link copied to clipboard
open infix fun MST.pow(pow: Number): MST

Raises this value to the power pow.

Link copied to clipboard
open operator fun MST.times(k: Number): MST
open operator fun MST.times(k: Number): MST
open operator fun MST.times(k: Number): MST
open operator fun MST.times(k: Number): MST

Multiplication of this element by a scalar.

open operator fun MST.times(arg: MST): MST
open operator fun MST.times(arg: MST): MST
open operator fun MST.times(arg: MST): MST

Multiplies this element by scalar.

Link copied to clipboard
fun <T : Any> MST.toExpression(algebra: Algebra<T>): Expression<T>

Interpret this MST as expression.

Link copied to clipboard
open operator override fun MST.unaryMinus(): MST.Unary
open operator override fun MST.unaryMinus(): MST.Unary
open operator override fun MST.unaryMinus(): MST.Unary
open operator override fun MST.unaryMinus(): MST.Unary

The negation of this element.

Link copied to clipboard
open operator override fun MST.unaryPlus(): MST.Unary
open operator override fun MST.unaryPlus(): MST.Unary
open operator override fun MST.unaryPlus(): MST.Unary
open operator override fun MST.unaryPlus(): MST.Unary

Returns this value.

Link copied to clipboard
open infix override fun MST.xor(other: MST): MST

Logic 'xor'

Sources

Link copied to clipboard