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 off-by-one error in What4 implementation of (@) #1361

Merged
merged 2 commits into from
Jun 7, 2022
Merged

Conversation

RyanGlScott
Copy link
Contributor

In the case where the index is a symbolic Integer and the sequence is of length n, the What4 backend mistakenly chose n to be the largest possible index. This corrects it to instead be n - 1.

Fixes #1359.

These cases for `Z m` indices in the What4 implementation of `(@)` are
unreachable by virtue of the fact that the index must be `Integral`. Let's
remove them to make the code simpler.

See #1359 (comment)
for where this was originally noticed.
In the case where the index is a symbolic `Integer` and the sequence is of
length `n`, the What4 backend mistakenly chose `n` to be the largest possible
index. This corrects it to instead be `n - 1`.

Fixes #1359.
@RyanGlScott RyanGlScott merged commit 7ac76ec into master Jun 7, 2022
@RyanGlScott RyanGlScott deleted the T1359 branch June 7, 2022 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

What4 panic - bvSliceLE
2 participants