Skip to content

Commit

Permalink
fix variable handling in Succ()
Browse files Browse the repository at this point in the history
  • Loading branch information
ichiban committed Jun 12, 2024
1 parent d6ea349 commit 5cc57f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions engine/builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -2817,9 +2817,9 @@ func nth(vm *VM, base Integer, n, list, elem Term, k Cont, env *Env) *Promise {

// Succ succeeds if s is the successor of non-negative integer x.
func Succ(vm *VM, x, s Term, k Cont, env *Env) *Promise {
switch x := x.(type) {
switch x := env.Resolve(x).(type) {
case Variable:
switch s := s.(type) {
switch s := env.Resolve(s).(type) {
case Variable:
return Error(InstantiationError(env))
case Integer:
Expand Down Expand Up @@ -2848,7 +2848,7 @@ func Succ(vm *VM, x, s Term, k Cont, env *Env) *Promise {
return Error(err)
}

switch s := s.(type) {
switch s := env.Resolve(s).(type) {
case Variable:
return Unify(vm, s, r, k, env)
case Integer:
Expand Down

0 comments on commit 5cc57f1

Please sign in to comment.