Cleanup 2
This commit is contained in:
parent
a9bb6e0338
commit
3c938749d0
22 changed files with 299 additions and 110 deletions
|
@ -23,7 +23,7 @@ import prolog.logic.unifyLazy
|
|||
* return, unifying Cont with a Goal that represents the continuation after shift.
|
||||
*/
|
||||
class Reset(private val goal: Goal, private val ball: Term, private val cont: Term) :
|
||||
Structure(Atom("reset"), listOf(goal, ball, cont)) {
|
||||
Structure("reset", goal, ball, cont) {
|
||||
override fun satisfy(subs: Substitutions): Answers = sequence {
|
||||
goal.satisfy(subs).forEach { goalResult ->
|
||||
goalResult.fold(
|
||||
|
@ -63,7 +63,7 @@ class Reset(private val goal: Goal, private val ball: Term, private val cont: Te
|
|||
/**
|
||||
* Variables that have been bound during the procedure called by reset/3 stay bound after a shift/1:
|
||||
*/
|
||||
class Shift(private val ball: Term) : Structure(Atom("shift"), listOf(ball)) {
|
||||
class Shift(private val ball: Term) : Structure("shift", ball) {
|
||||
override fun satisfy(subs: Substitutions): Answers = sequence {
|
||||
val shift = AppliedShift(
|
||||
subs = subs,
|
||||
|
|
Reference in a new issue