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

Else-Branch of tail recursion requires negation of the input condition #36

Open
Feliix42 opened this issue Apr 17, 2019 · 0 comments
Open
Labels

Comments

@Feliix42
Copy link
Member

Currently, writing a recursion algorithm like this:

fn transact(...) {
    // ...
    if (is_empty(remap_paths)) {
        new_maze
    } else {
        transact(new_maze, remap_paths)
    }
}

produces an semantically incorrect algorithm as the result of is_empty is used directly for determining, whether another recursion step is necessary, although is ought to be the other way around. For this case, negating the output is required.

@Feliix42 Feliix42 added the bug label Apr 17, 2019
JustusAdam added a commit that referenced this issue Apr 17, 2019
Feliix42 added a commit that referenced this issue Apr 17, 2019
Feliix42 added a commit to Feliix42/ohua-rust-benchmarks that referenced this issue Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant