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

Concrete floats #89

Merged
merged 11 commits into from
Feb 4, 2021
Merged

Concrete floats #89

merged 11 commits into from
Feb 4, 2021

Conversation

robdockins
Copy link
Contributor

Use the libBF library to implement concrete floating-point ground evaluation and constant folding.

This is especially a tricky area to get right, so I've implemented a new testing technique using "expression templates." These are fragments of syntax containing variables at base types. We can enumerate an interesting collection of these templates and use them to generate test cases. For each test case, we will chose random concrete values for the variables and evaluate the syntax in a variety of ways and test that they agree. In particular, we can ask solvers to act as computational oracles and verify that our ground evaluation agrees with their theory.

@robdockins
Copy link
Contributor Author

Will fix #5 when merged.

@robdockins
Copy link
Contributor Author

@kquick, This isn't quite ready to merge yet, but I'm interested in your thoughts about the new kind of tests I've been working on (CF https://github.com/GaloisInc/what4/blob/concrete-floats/what4/test/TestTemplate.hs).

Currently they're focused on the floating-point operations, but there's no particular reason the templates idea couldn't be extended to most or all of the main what4 interface.

@robdockins robdockins marked this pull request as ready for review February 2, 2021 00:58
based on the `libBF` representation.  Change the `GroundValue`
type for floating point values to use `BigFloat`.

Still TOOD: constant folding in the expression builder,
ground evaluation, hashing and (maybe?) abstract domains.
produces a bunch of failures related to evaluating floating-point
values, which indicate what work needs to be done in the ground
evaluation module.
and test that expression constant folding agrees with
ground evaluation.
…ator

computes a value for an expression, the solver can prove the expression
must have that value.  This complements the previous solver test,
which showed that the solver computes the same value in a computed
satisfying model.  This complementary test proves that the value
we compute is the _only_ value this term may take on, which
demonstrates that we are not computing any underspecified values.
This provides support for floating-point values that hide
their precision at the type level, similar to how the `SWord` module
hides the width of bitvectors.
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.

1 participant