refactor: Rework
This commit is contained in:
parent
ac55ed4c64
commit
6469dd6ced
34 changed files with 593 additions and 552 deletions
|
@ -1,16 +1,13 @@
|
|||
package prolog.ast.terms
|
||||
|
||||
import prolog.logic.Substituted
|
||||
import prolog.logic.compare
|
||||
|
||||
/**
|
||||
* Value in Prolog.
|
||||
*
|
||||
* A [Term] is either a [Variable], [Atom], integer, float or [CompoundTerm].
|
||||
* A [Term] is either a [Variable], [Atom], [Integer], float or [CompoundTerm].
|
||||
* In addition, SWI-Prolog also defines the type string.
|
||||
*/
|
||||
interface Term : Comparable<Term> {
|
||||
/**
|
||||
* Returns the term that this expression evaluates to. (All the way down.)
|
||||
*/
|
||||
fun evaluate(subs: Substituted): Pair<Term, Substituted>
|
||||
override fun compareTo(other: Term): Int = compare(this, other, emptyMap())
|
||||
}
|
||||
|
|
Reference in a new issue