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

add support for bitwuzla #438

Merged
merged 1 commit into from
Jan 16, 2024
Merged

add support for bitwuzla #438

merged 1 commit into from
Jan 16, 2024

Conversation

d-xo
Copy link
Collaborator

@d-xo d-xo commented Jan 14, 2024

Description

Adds support for Bitwuzla. This is the same as the old PR, but uses a new bitwuzla version (0.3.0), which has support for timeouts This pr also messes with the smt generation less (only real change is replacing define-const with define-fun).

It currently can't pass the full test suite (currently 9 failures due to issues support for comparison of constant arrays), but I enabled it for a few tests where it doesn't error out to make sure we're exercising it in CI.

Checklist

  • tested locally
  • added automated tests
  • updated the docs
  • updated the changelog

@d-xo d-xo mentioned this pull request Jan 14, 2024
4 tasks
Comment on lines +279 to +288
(readout, writeout) <- createPipe
let cmd
= (proc (show solver) (fmap T.unpack $ solverArgs solver timeout))
{ std_in = CreatePipe
, std_out = UseHandle writeout
, std_err = UseHandle writeout
}
(Just stdin, Nothing, Nothing, process) <- createProcess cmd
hSetBuffering stdin (BlockBuffering (Just 1000000))
let solverInstance = SolverInstance solver stdin stdout stderr process
let solverInstance = SolverInstance solver stdin readout process
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This sends stdout and stderr from the solvers into the same pipe so we can react to both when doing solver interaction...

@@ -160,11 +160,11 @@ declareIntermediates bufs stores =
where
compareFst (l, _) (r, _) = compare l r
encodeBuf n expr =
SMT2 ["(define-const buf" <> (fromString . show $ n) <> " Buf " <> exprToSMT expr <> ")\n"] mempty mempty mempty <> encodeBufLen n expr
SMT2 ["(define-fun buf" <> (fromString . show $ n) <> "() Buf " <> exprToSMT expr <> ")\n"] mempty mempty mempty <> encodeBufLen n expr
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why fun and not const? Is this bitwuzla related?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah, bitwuzla doesn't support define-const, and it's just a macro around define-fun

Copy link
Collaborator

@zoep zoep left a comment

Choose a reason for hiding this comment

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

Looks good!

@d-xo d-xo merged commit 7f41208 into main Jan 16, 2024
8 checks passed
@d-xo d-xo deleted the bitwuza-v2 branch January 16, 2024 12:03
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.

2 participants