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

Concretization: Getting concrete RegValues from a model #1207

Merged
merged 8 commits into from
Jun 6, 2024

Conversation

langston-barrett
Copy link
Contributor

@langston-barrett langston-barrett commented Jun 4, 2024

What4 has the capacity to turn symbolic values into plausible "concrete" (/"ground") values, given a model from the SMT solver (GroundEvalFn). This commit builds on this feature to enable concretizing more complex Crucible types.

A possible use-case is to present concrete instances where safety assertions fail, e.g. when symbolically executing the following function:

int f(int x, int y) { return x / (y - 2); }

it would be nice to say which particular values of x and y would cause either signed underflow (y < INT_MIN + 2) or division by zero (y == 2). This particular case could be handled by existing What4 functionality, but the same motivation applies to more complex cases involving Crucible-specific types.

@langston-barrett langston-barrett self-assigned this Jun 4, 2024
@langston-barrett langston-barrett force-pushed the lb/concretize branch 3 times, most recently from 6c3f670 to 8421be4 Compare June 5, 2024 16:28
What4 has the capacity to turn symbolic values into plausible
"concrete" (/"ground") values, given a model from the SMT solver
(`GroundEvalFn`). This commit builds on this feature to enable
concretizing more complex Crucible types.

A possible use-case is to present concrete instances where safety
assertions fail, e.g. when symbolically executing the following function:

  int f(int x, int y) { return x / (y - 2); }

it would be nice to say which particular values of `x` and `y` would
cause either signed underflow (`y < INT_MIN + 2`) or division by zero
(`y == 2`). This particular case could be handled by existing What4
functionality, but the same motivation applies to more complex cases
involving Crucible-specific types.
@langston-barrett langston-barrett marked this pull request as ready for review June 5, 2024 19:00
crucible/src/Lang/Crucible/Concretize.hs Show resolved Hide resolved
crucible/src/Lang/Crucible/Concretize.hs Outdated Show resolved Hide resolved
crucible/src/Lang/Crucible/Concretize.hs Outdated Show resolved Hide resolved
crucible/src/Lang/Crucible/Concretize.hs Outdated Show resolved Hide resolved
Copy link
Contributor

@RyanGlScott RyanGlScott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a nice utility to have when concretizing Crucible values. We could potentially go even further and offer feature parity with the API in What4.Expr.GroundEval, but perhaps we should wait until someone requests this before adding it.

@langston-barrett langston-barrett merged commit 2163926 into GaloisInc:master Jun 6, 2024
32 checks passed
@langston-barrett langston-barrett deleted the lb/concretize branch June 6, 2024 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants