11 lines
No EOL
353 B
Kotlin
11 lines
No EOL
353 B
Kotlin
package prolog
|
|
|
|
import prolog.ast.terms.Term
|
|
|
|
abstract class Substitution(val from: Term, val to: Term) {
|
|
val mapped: Pair<Term, Term>? = if (from != to) from to to else null
|
|
override fun toString(): String = "$from -> $to"
|
|
}
|
|
typealias Substitutions = Map<Term, Term>
|
|
typealias Answer = Result<Substitutions>
|
|
typealias Answers = Sequence<Answer> |