Checkpoint
This commit is contained in:
parent
39c3af4ba5
commit
da21d890fb
39 changed files with 1166 additions and 48 deletions
19
src/prolog/components/Operator.kt
Normal file
19
src/prolog/components/Operator.kt
Normal file
|
@ -0,0 +1,19 @@
|
|||
package prolog.components
|
||||
|
||||
import prolog.components.terms.Argument
|
||||
import prolog.components.terms.Atom
|
||||
|
||||
open class Operator(
|
||||
val symbol: Atom,
|
||||
val leftOperand: Operand? = null,
|
||||
val rightOperand: Operand
|
||||
) {
|
||||
override fun toString(): String {
|
||||
return when (leftOperand) {
|
||||
null -> "${symbol.name} $rightOperand"
|
||||
else -> "$leftOperand ${symbol.name} $rightOperand"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
typealias Operand = Argument
|
Reference in a new issue