refactor: Herstructurering
This commit is contained in:
parent
1acd1cfb67
commit
e3c84e1761
33 changed files with 290 additions and 178 deletions
|
@ -1,24 +0,0 @@
|
|||
package prolog.components.expressions
|
||||
|
||||
import prolog.Substituted
|
||||
import prolog.components.Provable
|
||||
import prolog.components.terms.Atom
|
||||
import prolog.components.terms.CompoundTerm
|
||||
import prolog.components.terms.Goal
|
||||
|
||||
typealias Operand = Goal
|
||||
|
||||
abstract class Operator(
|
||||
private val symbol: Atom,
|
||||
val leftOperand: Operand? = null,
|
||||
val rightOperand: Operand
|
||||
) : CompoundTerm(symbol, listOfNotNull(leftOperand, rightOperand)), Provable {
|
||||
abstract override fun prove(subs: Substituted): Sequence<Substituted>
|
||||
|
||||
override fun toString(): String {
|
||||
return when (leftOperand) {
|
||||
null -> "${symbol.name} $rightOperand"
|
||||
else -> "$leftOperand ${symbol.name} $rightOperand"
|
||||
}
|
||||
}
|
||||
}
|
Reference in a new issue