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

Record equality between target and source for checking bounds #845

Closed
kkjeer opened this issue Jun 6, 2020 · 0 comments
Closed

Record equality between target and source for checking bounds #845

kkjeer opened this issue Jun 6, 2020 · 0 comments
Assignees
Labels
work item This labels issues that are not exactly bugs but are about improvements.

Comments

@kkjeer
Copy link
Contributor

kkjeer commented Jun 6, 2020

After the updated bounds context is used to check bounds for variables, there will be an issue with the way that expression equality is recorded. Certain kinds of expressions (expressions that create a new object or read memory via a pointer, such as "abc", *p, s->f, etc.) are not included in the set State.EquivExprs of expressions that produce the same value. This introduces proof failures when checking bounds. Consider:

void missing_equality(array_ptr<int> a : count(1)) {
  // s->f reads memory via a pointer
  // s->f is not included in State.EquivExprs
  // Bounds checking does not know that a and s->f produce the same value
  // The inferred bounds (s->f, s->f + 1) do not provably imply
  // the declared bounds (a, a + 1)
  a = s->f;
}

When checking that the inferred bounds of a imply the declared bounds of a, equality between a and s->f should be temporarily recorded so that the bounds checker is able to prove that the inferred bounds imply the declared bounds.

@kkjeer kkjeer added the work item This labels issues that are not exactly bugs but are about improvements. label Jun 6, 2020
@kkjeer kkjeer self-assigned this Jun 6, 2020
@kkjeer kkjeer closed this as completed Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
work item This labels issues that are not exactly bugs but are about improvements.
Projects
None yet
Development

No branches or pull requests

1 participant