Skip to content

Fix off-by-one error in What4 implementation of (@)#1361

Merged
RyanGlScott merged 2 commits intomasterfrom
T1359
Jun 7, 2022
Merged

Fix off-by-one error in What4 implementation of (@)#1361
RyanGlScott merged 2 commits intomasterfrom
T1359

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 requested a review from robdockins June 2, 2022 14:21
@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