Commit Graph

1172 Commits

Author SHA1 Message Date
Ryan Scott
80231d4fa1 Draft: BaseVariantType
TODO RGS: Cite T251

[ci skip]
2024-01-29 09:45:35 -05:00
Ryan Scott
6f9915b553 CI: Remove Yices-2.6.1 configuration
This was removed from the `flakes` repo in GaloisInc/flakes#7. The rationale is
that odd Yices version numbers are development versions, and we only want to
test release versions. `what4`'s CI was testing 2.6.1 (a development version),
so let's just remove it.
2024-01-12 15:35:02 -05:00
Tristan Ravitch
108aac7777 Add a solver adapter for bitwuzla
Bitwuzla is a relatively new SMT solver with support for the bitvector,
floating point, array, and uninterpreted function theories. This patch adds the
necessary plumbing to invoke Bitwuzla using What4.

Co-authored-by: Ryan Scott <rscott@galois.com>
2024-01-12 15:35:02 -05:00
Langston Barrett
e46dff4209 Remove getUnannotatedTerm case for bound variables 2023-12-06 12:06:21 -05:00
Langston Barrett
be3e8b1189 what4: Don't annotate bound variables 2023-12-06 12:06:21 -05:00
Ryan Scott
076f49b996 Bump what4 development version to 1.5.1.0.99 2023-10-13 10:51:11 -04:00
Ryan Scott
13e788f234 Bump what4 release version to 1.5.1 2023-10-13 10:51:11 -04:00
Ryan Scott
1de86e42fc Mention versions-6–related changes in what4 changelog 2023-10-13 10:51:11 -04:00
Ryan Scott
c3f9e1bbeb Require versions >= 6.0.2
`versions-6.0.2` introduces a `Lift Version` instance, which finally allows us
to delete the ugly, CPP'd mess of orphan instances that we define in
`What4.Utils.Versions`.

Related to #240.
2023-10-12 14:56:09 -04:00
Ryan Scott
0489772d39 Allow building with versions-6.0.*
`versions-6.0.*` removes the `VChunk` data type, which `what4` defines an
orphan `Lift` instance for. This requires some CPP to fix up. This is somewhat
messy, and in an ideal world, we'd move these orphan instances directly to the
`versions` library. (See also https://github.com/fosskers/versions/issues/68.)

Fixes #240.
2023-10-10 10:58:24 -04:00
Ryan Scott
28744e48e0 Bump what4 development version to 1.5.0.0.99 2023-07-31 11:34:35 -04:00
Ryan Scott
0f0110e320 Bump what4 release version to 1.5 2023-07-31 11:34:35 -04:00
Ryan Scott
ed2aefb8bb Mention #232 in the what4 changelog 2023-07-31 11:34:35 -04:00
Ryan Scott
3b00db770c CI: Obtain GHC 9.4.2, 9.6.2 from nixos-23.05 2023-07-28 15:13:12 -04:00
Ryan Scott
f0e5db3c44 CI: Always save cache, even on failure 2023-07-28 15:13:12 -04:00
Ryan Scott
e7381c9baf CI: Test GHC 9.6 2023-07-28 15:13:12 -04:00
Ryan Scott
3a425a85d5 gen_matrix.pl: Set main GHC version to 9.2 2023-07-28 15:13:12 -04:00
Ryan Scott
a865c6b658 Remove unused th-abstraction dependency
Not only is it not used, the version bounds were interfering with GHC 9.6 build
plans. Let's just remove it.
2023-07-28 15:13:12 -04:00
Ryan Scott
c46f802d12 Support building with GHC 9.6
This patch contains a variety of fixes needed to build the libraries in the
`what4` repo with GHC 9.6:

* GHC 9.6 bundles `mtl-2.3.*`, which no longer re-exports `Control.Monad`,
  `Control.Monad.IO.Class`, and similar modules from `mtl`-related modules.
  To accommodate this, various imports have been made more explicit.
* `MonadTrans t` now has a quantified `forall m. Monad m => Monad (t m)`
  superclass in `mtl-2.3.*`. As a result, the `MonadTrans (PartialT sym)`
  instance must now have an `IsExpr (SymExpr sym)` instance context in order
  for it to typecheck, as this is the same instance context that `PartialT`'s
  `Monad` instance has.

  This is technically a breaking change, so I have noted it in the `what4`
  changelog. That being said, this change is unlikely to affect many people
  in practice, considering that the `MonadTrans` instance for `PartialT` is
  usually used in tandem with the `Monad` instance.
* Various upper version bounds on `base` have been lifted to allow building
  with `base-4.18`.
* The `aig` submodule has been bumped to bring in the changes from
  GaloisInc/aig#15, which allows it to build with GHC 9.6.
2023-07-28 15:13:12 -04:00
Ryan Scott
b987ec4cfe Whitespace only 2023-07-28 15:13:12 -04:00
Ryan Scott
2d22d4afaf Allow building with tasty-sugar-2.2.* 2023-05-04 11:33:54 -04:00
Ryan Scott
ffbad75b1c Allow building with tasty-sugar-2.1.* 2023-04-03 11:26:35 -04:00
Andrei Stefanescu
5a6864ace5
Simplify bvult by extracting sum common when sound. (#232)
* Simplify bvult by extracting sum common when sound.

* Add tests.

* Edit comments.
2023-04-02 19:41:35 -07:00
Ryan Scott
6c462cd46e What4 development version number 2023-01-27 09:49:48 -05:00
Ryan Scott
b5402096d8 Bump what4 version to 1.4 2023-01-27 09:18:38 -05:00
Ryan Scott
d45017efe5 Update copyright dates and maintainers 2023-01-27 09:18:38 -05:00
Ryan Scott
693bb2a086 Update what4 changelog for release 2023-01-27 09:18:38 -05:00
Ryan Scott
9e9a1c37c3 CI: Test GHC 9.4.4 2023-01-23 14:10:00 -05:00
Ryan Scott
aceac148cd Fix -Wtype-equality-requires-operators warnings
GHC 9.4 adds `-Wtype-equality-requires-operators` to `-Wall`, which warns about
certain uses of type equalities that are not forward-compatible with planned
changes in GHC. See [this
section](https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.4?version_id=b60e52482a666d25638d59cd7e86851ddf971dc1#-is-now-a-type-operator)
of the GHC 9.4 Migration Guide. These warnings are easily fixed by enabling the
`TypeOperators` extension.
2023-01-23 14:10:00 -05:00
Ryan Scott
6c85dbbd04 Support building with GHC 9.4
This contains a varity of changes needed to make the libraries in the `what4`
repo compile with GHC 9.4:

* GHC 9.4 is pickier about undecidable instance checking. See
  [this section](https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.4?version_id=24540b698481cf2b0bd11029b58eaddc0fbfbb31#stricter-undecidableinstances-checking)
  of the GHC 9.4 Migration Guide. As a result, I had to explicitly enable
  `UndecidableInstances` in `What4.Utils.AbstractDomains` to make it compile.
* `ST` no longer has a `MonadFail` instance. See
  [this section](https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.4?version_id=b60e52482a666d25638d59cd7e86851ddf971dc1#st-is-no-longer-an-instance-of-monadfail)
  of the GHC 9.4 Migration Guide. To adapt to this change, I removed the
  `MonadFail` instance for `VarRecorder`, which was built on top of `ST`'s
  `MonadFail` instance. Accordingly, all uses of `fail` at type `VarRecorder`
  have now been replaced with `error`.
* I bumped the `aig` submodule to bring in the changes from
  https://github.com/GaloisInc/aig/pull/13, which are required to make `aig`
  build with GHC 9.4.
* I bumped the upper version bounds of various dependencies to allow them to
  build with GHC 9.4.

Fixes #224.
2023-01-23 14:10:00 -05:00
Andrei Stefanescu
98ae759128
SyGuS (#226)
* What4.Interface improvements.

* Add SyGuS to SMT writer and SMTLib2.

* Parse SMTLib2/SyGuS response.

* Add CVC5 SyGuS support.

* Add Z3 CHC support.

* Add test.

* Address comments.

* Fix test.

* Add comment.

* Remove stray comments.
2023-01-16 18:31:23 -08:00
Kevin Quick
92db65b90d
Merge pull request #229 from GaloisInc/tasty-sugar-2
Require tasty-sugar 2.0 or greater and address deprecation.
2023-01-09 17:51:39 -08:00
Kevin Quick
4a116f1884
Require tasty-sugar 2.0 or greater and address deprecation. 2023-01-09 15:49:41 -08:00
Kevin Quick
7ba5e90d8b
Merge pull request #221 from felixonmars/patch-1
Allow tasty-sugar 2.0+
2023-01-09 15:46:58 -08:00
Ryan Scott
2420a946b5 CI: Avoid GitHub rate limiting when using Nix flakes
This is to avoid rate limiting errors like the ones seen
[here](https://github.com/GaloisInc/what4/actions/runs/3685073307/jobs/6235597434#step:12:26):

```
error: unable to download 'https://api.github.com/repos/GaloisInc/flakes/commits/HEAD': HTTP error 403

       response body:

       {"message":"API rate limit exceeded for 40.86.18.81. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}
(use '--show-trace' to show detailed location information)
```
2022-12-13 12:26:19 -05:00
Ryan Scott
95e2cdbe8b CI: Use Nix 2.11.0
Nix 2.4 does not work well with GitHub Actions' Ubuntu 22.04 runners, as seen
in cachix/install-nix-action#141.
2022-12-13 12:26:19 -05:00
Felix Yan
766021b793
Allow tasty-sugar 2.0+
Builds fine and all tests pass here with tasty-sugar 2.0.0.0.
2022-11-14 06:36:38 +02:00
Tristan Ravitch
1748341839
Merge what4-serialize into what4 core (#217)
This change incorporates the serialization/deserialization capabilities from the what4-serialize package into what4. The new functionality enables serializing what4 terms as s-expressions that are intended to match SMTLib2. It also supports deserializing them from the text form into what4 terms in memory.

Note that this is just an import of the code from the what4-serialize library (with a few modest fixes), so if you previously relied on what4-serialize, you will need to delete your dependency on that library when updating. Post-merge, the code in what4 should be a drop-in replacement for the what4-serialize library.

Fixes #104 

Co-authored-by: Ryan Scott <ryan.gl.scott@gmail.com>
2022-09-07 09:30:48 -07:00
Arjun Viswanathan
6f5e0fe9be
Adding a feature to ask for abducts (#213)
* Added offline get-abduct feature with an example file of how to use it

* Unstable: trying to add get-abduct to the online solver

* Stable: added a way to get single abduct

* Working online version of get-abduct

* Refactored abduct commands so that variable name bound to abducts is taken from the front-end

* Changed name from getAbduct to getAbducts

* Added ability for user to specify grammar

* Turning off unsat-cores in cvc5 since unsat cores and abduction are not compatible. We need a better solution at some point

* Enabling unsat cores in cvc5

* Adding a way to push and pop frame 2

* Adding a way to push and pop frame 2

* Partially finished formula to CFG function implemented

* Removing all the grammar related stuff, readying for merge

* Addressing most of the PR feedback

* Update what4/src/What4/Protocol/SMTWriter.hs
Co-authored-by: Ryan Scott <ryan.gl.scott@gmail.com>

* Stable abduction tests

* Update what4/test/Abduct.hs

Co-authored-by: Ryan Scott <ryan.gl.scott@gmail.com>

* Update what4/test/Abduct.hs
Co-authored-by: Ryan Scott <ryan.gl.scott@gmail.com>

* Fixing imports in abduct test

* cvc5-1.0.2
Co-authored-by: Ryan Scott <ryan.gl.scott@gmail.com>
2022-09-01 11:06:56 -05:00
Daniel Matichuk
de5e73170b
Merge pull request #216 from GaloisInc/dm/issues/215
Use more abstract domain information in intMax/Min
2022-08-30 09:01:28 -07:00
Daniel Matichuk
cc222f8d2b Add tests for intMin/Max static evaluation 2022-08-29 16:25:05 -07:00
Daniel Matichuk
d7ceff4863 Use more abstract domain information in intMax/Min
For intMax/Min x y, checks if either x <= y or y <= x
can be statically determined.
Explicitly sets the abstract domain of the result
to be rangeMax/Min of the arguments.

Fixes #215.
2022-08-29 09:29:12 -07:00
Sam Breese
7b9f4563de
Add support for transition system inputs (#212) 2022-07-26 20:20:22 -04:00
Ryan Scott
e384609f34 template_tests: Emit an error code if tests fail
Running `hedgehog`'s `checkSequential` function alone isn't enough to cause a
test suite to fail if one or more of the test cases to fail. Per a comment in
the `hedgehog` source code
[here](3d4dde46e1/hedgehog-example/test/test.hs (L34-L42)),
the idiomatic way to do make a `checkSequential` failure imply test suite
failure is to check the result of running `checkSequential` and, if that is
`False`, throw `exitFailure`. This patch incorporates that advice into the
`test_templates` test suite.

Fixes #206.
2022-07-05 13:02:00 -04:00
Arjun Viswanathan
79ad25c3a2
Adding support for cvc5 (#204)
* Draft: Support CVC5

TODO RGS: Fix the test suite
TODO RGS: CI support

[ci skip]

* Deprecated ALL_SUPPORTED and added ALL

* Integrated cvc5 with tests

* Changed expected timeouts in OnlineSolverTest

* In response to Ryan's comments

* Dropping GHC 8.6.5 from CI

* Correcting cvc5 feature list and undoing a previous unintentional change

* Adding cvc5 tests in ExprBuilderSMTLib2

Co-authored-by: Ryan Scott <rscott@galois.com>
Co-authored-by: arjunvish <arjun.viswanathan23@gmail.com>
2022-07-01 13:36:44 -07:00
Kevin Quick
cff655cce0
Merge pull request #208 from GaloisInc/check_caching
Bump copyright dates.
2022-07-01 09:40:10 -07:00
Kevin Quick
3d9cb1ce75
Bump copyright dates. 2022-07-01 08:46:13 -07:00
Kevin Quick
e569514d10
Merge pull request #205 from GaloisInc/tasty-sugar-1.3
Bump tasty-sugar version to use new 1.3 release.
2022-06-29 08:51:56 -07:00
Kevin Quick
bf187d4aa3
Bump tasty-sugar version to use new 1.3 release. 2022-06-28 21:05:37 -07:00
Ryan Scott
7501e28bba CI: Pin nixpkgs to 22.05 where necessary 2022-06-21 12:48:41 -04:00