Backtracking fixed

This commit is contained in:
Tibo De Peuter 2025-05-05 20:11:44 +02:00
parent a85169dced
commit fd16c4cedc
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
18 changed files with 213 additions and 39 deletions

View file

@ -1,14 +1,18 @@
package prolog.ast.terms
import prolog.Substitutions
import prolog.ast.arithmetic.Float
import prolog.ast.arithmetic.Integer
import prolog.logic.compare
/**
* Value in Prolog.
*
* A [Term] is either a [Variable], [Atom], [Integer][prolog.ast.arithmetic.Integer],
* [Float][prolog.ast.arithmetic.Float] or [CompoundTerm].
* A [Term] is either a [Variable], [Atom], [Integer],
* [Float] or [CompoundTerm].
* In addition, SWI-Prolog also defines the type TODO string.
*/
interface Term : Comparable<Term> {
override fun compareTo(other: Term): Int = compare(this, other, emptyMap())
fun applySubstitution(subs: Substitutions): Term
}