Commit Graph

1172 Commits

Author SHA1 Message Date
Ryan Scott
200b6c9ce6 Remove data-binary-ieee754 dependency in favor of GHC.Float
The `data-binary-ieee754` library, which `what4` depends on, is deprecated.
Fortunately, `what4` only uses this library for converting `Float`s and
`Double`s to `Word`s, which is functionality that the `base` library has
provided since GHC 8.2. As a result, removing the `data-binary-ieee754`
dependency is straightforward.
2022-06-21 12:48:41 -04:00
Ryan Scott
835238d875 What4 development version number 2022-04-19 13:43:05 -04:00
Ryan Scott
8c0a5a557e Bump what4 version to 1.3 2022-04-19 13:39:12 -04:00
Ryan Scott
400337e88f Update changelog 2022-04-19 13:39:12 -04:00
robdockins
1786acf8d7
Merge pull request #199 from GaloisInc/rwd/interface-tweaks
Add operations for projecting the `SymInteger` from a `SymNat`
2022-04-19 09:28:25 -07:00
Rob Dockins
c648cd1d71 Add operations for projecting the SymInteger from a SymNat
and for obtaining the original, unannotated term from an annotation.

Fixes #192
Fixes #193
2022-04-18 13:46:56 -07:00
Ryan Scott
2bd3b5d7a6 Avoid testProperty deprecation warnings with tasty-hedgehog-1.2
This fixes #195—or, at the very least, makes the deprecation warnings that
arise from `tasty-hedgehog`'s version of `testProperty` go away. The "real"
fix would be to convert every use of `testProperty` into a top-level `Property`
value, but given how tedious that would be, I'm disinclined to do this unless
someone specifically requests it.
2022-04-14 18:21:52 -04:00
Ryan Scott
4183a84d75 CI: Test GHC 9.2.2 2022-04-12 05:24:50 -04:00
Ryan Scott
aa61bf7579 Allow building with GHC 9.2
This contains a variety of changes needed to make the libraries in the `what4`
compile warning-free with GHC 9.2:

* GHC 9.2 includes `-Woperator-whitespace-ext-conflict` as a part of `-Wall`,
  which causes `Test.Verification` to warn when built with GHC 9.2. The fix is
  simple: just add spaces after certain uses of the `$` character.
* GHC 9.2 includes `-Wincomplete-uni-patterns` as a part of `-Wall`, which
  causes `GenWhat4Expr` to warn when built with GHC 9.2. I fixed the warnings
  by introducing new `from{Bool,Int,BV8,BV16,BV32,BV64}TestExpr` functions to
  extract the payloads of different `TestExpr` constructors. This is no less
  partial than before, but at least this way any accidental partiality will
  result in a more descriptive error message than
  `Non-exhaustive patterns in ...`.
* In `base-4.16.*`, `Nat` is now a type synonym for `Natural`, and
  `GHC.TypeNats` now re-exports `Natural`. This causes an import of
  `Numeric.Natural` in `What4.SemiRing` (previously required to bring `Natural`
  into scope) trigger an `-Wunused-imports` warning. I fixed the warning by
  using explicit imports from `GHC.TypeNats` and `Numeric.Natural`.
* The `aig` and `abcBridge` submodules were bumped to bring in the changes
  from GaloisInc/aig#12 and GaloisInc/abcBridge#19, respectively, which allows
  them to build with `base-4.16.*`.
* The upper version bounds on `base` were raised in `what4-abc`, `what4-blt`,
  and `what4-transition-system` to allow them to build with `base-4.16.*`.
2022-04-12 05:24:50 -04:00
Kevin Quick
5dca5cfbff
Merge pull request #180 from GaloisInc/fix_solver_versions
Fix solver versions
2022-04-11 15:31:01 -07:00
Ryan Scott
1008c66e32 CI: Bump CACHE_VERSION 2022-04-11 16:51:47 -04:00
Ryan Scott
87b360b17c Remove lingering references to Sally
The `what4-transition-system-tests` test suite in particular will be moved to
`language-sally`.
2022-04-11 16:51:47 -04:00
Valentin Robert
5901b3686e remove what4-transition-system dependency on language-sally 2022-04-11 16:51:47 -04:00
Kevin Quick
6625efbc67
Add yices 2.6.4 version to CI to match current master testing. 2022-04-05 08:43:53 -07:00
Kevin Quick
272e7acb1b
Cleanup CI matrix generation and address review comments. 2022-04-05 07:52:45 -07:00
Kevin Quick
c34b76b985
The string_6 test requires at least CVC 1.8. 2022-04-05 00:10:11 -07:00
Kevin Quick
82a6d7a74e
Z3 4.8.11 passes string tests. 2022-04-05 00:09:47 -07:00
Kevin Quick
255cbdbef8
Merged string test fixes. 2022-04-04 23:32:15 -07:00
Kevin Quick
9d86c50944
Merge branch 'master' into fix_solver_versions 2022-04-04 22:59:13 -07:00
Kevin Quick
ebd703c958
Fixes to CI matrix generation. 2022-04-04 22:40:36 -07:00
Kevin Quick
f6dfc9118b
Remove reference to field no longer provided via CI matrix. 2022-04-04 22:18:32 -07:00
Kevin Quick
255254ca47
Generate matrix dynamically for optimal testing without over-testing. 2022-04-04 22:14:59 -07:00
robdockins
c8e6381b9a
Merge pull request #191 from GaloisInc/string-fix
Fix some issues with string escaping/unescaping in the SMTLib2 writer
2022-03-28 13:33:38 -07:00
Rob Dockins
08ec293cc4 Add some comments regarding the nature of the tests.
Change Z3/stringTest7 to expected success on older Z3.
2022-03-28 13:11:09 -07:00
Rob Dockins
6fb17adb21 Add test cases 2022-03-28 11:01:54 -07:00
Rob Dockins
0ac42a32ba Fix some issues with string escaping/unescaping in the SMTLib2 writer.
Previously, we were too liberal with the characters we would emit
without escaping, and we would incorrectly fail to escape `\` characters
if they had a following `u` character.  In addition, our unescaping routine
was incorrectly rejecting strings from solvers if they ended with a literal
`\` character.

Fixes #184
Fixes #185
2022-02-25 10:45:40 -08:00
Ryan Scott
ea717ac94a resolveSymBV: Make note of possible future work
See also #188
2022-02-18 07:44:34 -05:00
Ryan Scott
76b5e0a2b4 resolveSymBV: Allow configuring search strategy
Instead of doing exponential search followed by binary search, there may be
situations in which it is faster to jump straight into binary search. This
commit allows configuring which search strategy to use in `resolveSymBV` by way
of a `SearchStrategy` data type. In the future, we may even consider adding
other search strategies.
2022-02-18 07:44:34 -05:00
Ryan Scott
2966739d72 Add resolveSymBV
Sometimes, `{un,}signedBVBounds` aren't sufficient to determine the lower and
upper bounds of a `SymBV`. For these situations, it can be helpful to query the
SMT solver to search for the bounds, later using `unsafeSetAbstractValue` to
update the newly discovered bounds to unlock further What4 simplifications.
The `resolveSymBV` function does exactly this kind of search. I've added
`hedgehog` tests which ensure that it behaves the way you'd expect it to.
2022-02-18 07:44:34 -05:00
Ryan Scott
9ef3072892 Add unsafeSetAbstractValue
This allows unsafely setting the abstract domain used by an expression.
This is primarily useful for symbolic expressions whose bounds have been
queried externally, as updating the bounds can sometimes unlock further
simplifications in subsequent What4 operations.
2022-02-18 07:44:34 -05:00
Ryan Scott
ac64bcd580 Don't use rationalTerm when ground-evaluating integers
Doing so will cause the integers to be rendered with decimals (e.g., `0.0`
instead of `0`). While some solvers are OK with such integers, CVC4 is picky
and will reject integers with decimal places, as seen in #182. The fix is
straightforward: just use `integerTerm` instead of
`rationalTerm . fromInteger`.

Fixes #182.
2022-01-25 16:34:41 -05:00
robdockins
629f9f1d6f
Merge pull request #181 from GaloisInc/more-exports
Export some additional operations from `What4.Expr`
2022-01-21 11:49:33 -08:00
Rob Dockins
f14b4a4fc7 Test fixs 2022-01-21 11:37:11 -08:00
Rob Dockins
d70e1f73aa haddock tweak 2022-01-21 10:57:50 -08:00
Rob Dockins
fe93384c28 Update tests and examples to use the new EmptyExprBuilderState. 2022-01-21 10:57:26 -08:00
Rob Dockins
7cfda4f432 Export some additional operations from What4.Expr, and
define a new dummy data type that can be used for the
expression builder state field.
2022-01-20 16:21:16 -08:00
Kevin Quick
52f453cdca
Remove Yices 2.5 tests (instead of allowing failure). 2022-01-13 18:02:18 -08:00
Kevin Quick
414e053f4a
The goal timeout feature does not work well for Z3 4.8.11 either. 2022-01-13 15:43:37 -08:00
Kevin Quick
949c4811b5
Z3 4.8.11 is capable of supporting unicode strings and escapes.
This was previously mis-identified because the Z3 4.8.11 test
configuration was accidentally using Z3 4.8.10.
2022-01-13 13:10:43 -08:00
Kevin Quick
085811c5d4
[CI] add ABC solver versions to test matrix 2022-01-13 05:30:16 -08:00
Kevin Quick
b1f7a2bab9
Update README solver compatibility for boolector and stp lower bounds. 2022-01-13 05:04:10 -08:00
Kevin Quick
d9a9acbce6
Add tests for STP 2.3.1 (as lower bound) 2022-01-13 04:21:08 -08:00
Kevin Quick
fabd4ca397
Add tests for boolector 3.2.0 (as lower bound) 2022-01-13 04:20:18 -08:00
Kevin Quick
5d0467a664
[CI] add matrix versions for boolector solver to testing. 2022-01-12 21:31:31 -08:00
Kevin Quick
223831a817
[CI] Add STP solver versions to testing matrix. 2022-01-12 20:30:40 -08:00
Kevin Quick
b8389562b5
[CI] skip and note CVC4 v1.7's many problems 2022-01-12 13:57:50 -08:00
Kevin Quick
4c4a569ff8
Update solver compatibility matrix for Yices and CVC4 results. 2022-01-12 13:03:30 -08:00
Kevin Quick
cf0780c674
[CI] strings not supported for CVC4 version 1.7 2022-01-12 13:02:01 -08:00
Kevin Quick
bb7e98883d
Add CVC4 testing variations. 2022-01-12 10:15:41 -08:00
Kevin Quick
6968028144
Allow failure for Yices 2.5 and test Yices 2.6.1 as well as latest. 2022-01-12 09:27:54 -08:00