Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix variable handling in Succ() #320

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading