|
4 | 4 | rosette/solver/solver rosette/solver/solution
|
5 | 5 | rosette/solver/smt/z3 rosette/solver/smt/cvc4
|
6 | 6 | rosette/solver/smt/boolector
|
| 7 | + rosette/solver/smt/bitwuzla |
| 8 | + rosette/solver/smt/cvc5 |
| 9 | + rosette/solver/smt/stp |
| 10 | + rosette/solver/smt/yices |
7 | 11 | rosette/base/form/define rosette/query/query
|
8 | 12 | rosette/base/core/term (only-in rosette/base/base bv?)
|
9 | 13 | (only-in rosette/base/base assert)
|
|
22 | 26 | rosette/solver/smt/z3
|
23 | 27 | rosette/solver/smt/cvc4
|
24 | 28 | rosette/solver/smt/boolector
|
| 29 | + rosette/solver/smt/bitwuzla |
| 30 | + rosette/solver/smt/cvc5 |
| 31 | + rosette/solver/smt/stp |
| 32 | + rosette/solver/smt/yices |
25 | 33 | #:use-sources
|
26 | 34 | (rosette/query/finitize
|
27 | 35 | rosette/query/query
|
28 | 36 | rosette/solver/solver
|
29 | 37 | rosette/solver/solution
|
30 | 38 | rosette/solver/smt/z3
|
31 | 39 | rosette/solver/smt/cvc4
|
32 |
| - rosette/solver/smt/boolector)] |
| 40 | + rosette/solver/smt/boolector |
| 41 | + rosette/solver/smt/bitwuzla |
| 42 | + rosette/solver/smt/cvc5 |
| 43 | + rosette/solver/smt/stp |
| 44 | + rosette/solver/smt/yices)] |
33 | 45 |
|
34 | 46 | A @deftech{solver} is an automatic reasoning engine, used to answer
|
35 | 47 | @seclink["sec:queries"]{queries} about Rosette programs. The result of
|
@@ -279,6 +291,146 @@ Returns true if the Boolector solver is available for use (i.e., Rosette can loc
|
279 | 291 | If this returns @racket[#f], @racket[(boolector)] will not succeed
|
280 | 292 | without its optional @racket[path] argument.}
|
281 | 293 |
|
| 294 | +@subsection{Bitwuzla} |
| 295 | + |
| 296 | +@defmodule[rosette/solver/smt/bitwuzla #:no-declare] |
| 297 | + |
| 298 | +@defproc*[([(bitwuzla [#:path path (or/c path-string? #f) #f] |
| 299 | + [#:logic logic (or/c symbol? #f) #f] |
| 300 | + [#:options options (hash/c symbol? any/c) (hash)]) solver?] |
| 301 | + [(bitwuzla? [v any/c]) boolean?])]{ |
| 302 | + |
| 303 | +Returns a @racket[solver?] wrapper for the @hyperlink["https://bitwuzla.github.io/"]{Bitwuzla} solver. |
| 304 | + |
| 305 | +To use this solver, download prebuilt Bitwuzla or build it yourself, |
| 306 | +and ensure the executable is on your @tt{PATH} or pass the path to the |
| 307 | +executable as the optional @racket[path] argument. |
| 308 | +Rosette currently tests Bitwuzla at commit |
| 309 | +@tt{93a3d930f622b4cef0063215e63b7c3bd10bd663}. |
| 310 | + |
| 311 | +The optional @racket[logic] argument specifies an SMT logic for the solver to use (e.g., @racket['QF_BV]). |
| 312 | +Specifying a logic can improve solving performance, but Rosette makes no effort to check that |
| 313 | +emitted constraints fall within the chosen logic. The default is @racket[#f], |
| 314 | +which uses Bitwuzla's default logic. |
| 315 | + |
| 316 | +The @racket[options] argument provides additional options that are sent to Bitwuzla |
| 317 | +via the @tt{set-option} SMT command. |
| 318 | +For example, setting @racket[options] to @racket[(hash ':seed 5)] |
| 319 | +will send the command @tt{(set-option :seed 5)} to Bitwuzla prior to solving. |
| 320 | +} |
| 321 | + |
| 322 | +@defproc[(bitwuzla-available?) boolean?]{ |
| 323 | +Returns true if the Bitwuzla solver is available for use (i.e., Rosette can locate a @tt{bitwuzla} binary). |
| 324 | +If this returns @racket[#f], @racket[(bitwuzla)] will not succeed |
| 325 | +without its optional @racket[path] argument.} |
| 326 | + |
| 327 | +@subsection{CVC5} |
| 328 | + |
| 329 | +@defmodule[rosette/solver/smt/cvc5 #:no-declare] |
| 330 | + |
| 331 | +@defproc*[([(cvc5 [#:path path (or/c path-string? #f) #f] |
| 332 | + [#:logic logic (or/c symbol? #f) #f] |
| 333 | + [#:options options (hash/c symbol? any/c) (hash)]) solver?] |
| 334 | + [(cvc5? [v any/c]) boolean?])]{ |
| 335 | + |
| 336 | +Returns a @racket[solver?] wrapper for the @hyperlink["https://cvc5.github.io/"]{CVC5} solver. |
| 337 | + |
| 338 | +To use this solver, download prebuilt CVC5 or build it yourself, |
| 339 | +and ensure the executable is on your @tt{PATH} or pass the path to the |
| 340 | +executable as the optional @racket[path] argument. |
| 341 | +Rosette currently tests CVC5 at version 1.0.7. |
| 342 | + |
| 343 | +The optional @racket[logic] argument specifies an SMT logic for the solver to use (e.g., @racket['QF_BV]). |
| 344 | +Specifying a logic can improve solving performance, but Rosette makes no effort to check that |
| 345 | +emitted constraints fall within the chosen logic. The default is @racket[#f], |
| 346 | +which uses CVC5's default logic. |
| 347 | + |
| 348 | +The @racket[options] argument provides additional options that are sent to CVC5 |
| 349 | +via the @tt{set-option} SMT command. |
| 350 | +For example, setting @racket[options] to @racket[(hash ':seed 5)] |
| 351 | +will send the command @tt{(set-option :seed 5)} to CVC5 prior to solving. |
| 352 | +} |
| 353 | + |
| 354 | +@defproc[(cvc5-available?) boolean?]{ |
| 355 | +Returns true if the CVC5 solver is available for use (i.e., Rosette can locate a @tt{cvc5} binary). |
| 356 | +If this returns @racket[#f], @racket[(cvc5)] will not succeed |
| 357 | +without its optional @racket[path] argument.} |
| 358 | + |
| 359 | +@subsection{STP} |
| 360 | + |
| 361 | +@defmodule[rosette/solver/smt/stp #:no-declare] |
| 362 | + |
| 363 | +@defproc*[([(stp [#:path path (or/c path-string? #f) #f] |
| 364 | + [#:logic logic (or/c symbol? #f) #f] |
| 365 | + [#:options options (hash/c symbol? any/c) (hash)]) solver?] |
| 366 | + [(stp? [v any/c]) boolean?])]{ |
| 367 | + |
| 368 | +Returns a @racket[solver?] wrapper for the @hyperlink["https://stp.github.io/"]{STP} solver. |
| 369 | + |
| 370 | +To use this solver, download prebuilt STP or build it yourself, |
| 371 | +and ensure the executable is on your @tt{PATH} or pass the path to the |
| 372 | +executable as the optional @racket[path] argument. |
| 373 | +Rosette currently tests STP at commit |
| 374 | +@tt{0510509a85b6823278211891cbb274022340fa5c}. |
| 375 | +Note that as of December 2023, the STP version on Mac Homebrew is too old to be |
| 376 | +supported by Rosette. |
| 377 | + |
| 378 | +The optional @racket[logic] argument specifies an SMT logic for the solver to use (e.g., @racket['QF_BV]). |
| 379 | +Specifying a logic can improve solving performance, but Rosette makes no effort to check that |
| 380 | +emitted constraints fall within the chosen logic. The default is @racket[#f], |
| 381 | +which uses STP's default logic. |
| 382 | + |
| 383 | +The @racket[options] argument provides additional options that are sent to STP |
| 384 | +via the @tt{set-option} SMT command. |
| 385 | +For example, setting @racket[options] to @racket[(hash ':seed 5)] |
| 386 | +will send the command @tt{(set-option :seed 5)} to STP prior to solving. |
| 387 | +} |
| 388 | + |
| 389 | +@defproc[(stp-available?) boolean?]{ |
| 390 | +Returns true if the STP solver is available for use (i.e., Rosette can locate a @tt{stp} binary). |
| 391 | +If this returns @racket[#f], @racket[(stp)] will not succeed |
| 392 | +without its optional @racket[path] argument.} |
| 393 | + |
| 394 | +@subsection{Yices2} |
| 395 | + |
| 396 | +@defmodule[rosette/solver/smt/yices #:no-declare] |
| 397 | + |
| 398 | +@defproc*[([(yices [#:path path (or/c path-string? #f) #f] |
| 399 | + [#:logic logic (or/c symbol? #f) 'QF_BV] |
| 400 | + [#:options options (hash/c symbol? any/c) (hash)]) solver?] |
| 401 | + [(yices? [v any/c]) boolean?])]{ |
| 402 | + |
| 403 | +Returns a @racket[solver?] wrapper for the @hyperlink["https://yices.csl.sri.com/"]{Yices2} solver. |
| 404 | + |
| 405 | +To use this solver, download prebuilt Yices2 or build it yourself, |
| 406 | +and ensure the executable is on your @tt{PATH} or pass the path to the |
| 407 | +executable as the optional @racket[path] argument. |
| 408 | +Rosette specifically uses the @tt{yices-smt2} executable, which is the Yices2 |
| 409 | +solver with its SMTLIB2 frontend enabled. |
| 410 | +Note that just building (without installing) Yices2 will produce an executable |
| 411 | +named @tt{yices_smt2}. Running the installation step produces an executable |
| 412 | +with the correct name. However, it is safe to skip the installation step and |
| 413 | +simply rename or symlink the @tt{yices_smt2} executable to @tt{yices-smt2}. |
| 414 | +Rosette currently tests Yices2 at commit |
| 415 | +@tt{e27cf308cffb0ecc6cc7165c10e81ca65bc303b3}. |
| 416 | + |
| 417 | +The optional @racket[logic] argument specifies an SMT logic for the solver to use (e.g., @racket['QF_BV]). |
| 418 | +Specifying a logic can improve solving performance, but Rosette makes no effort to check that |
| 419 | +emitted constraints fall within the chosen logic. Yices2 expects a logic to be |
| 420 | +set; Rosette defaults to @racket['QF_BV]. |
| 421 | + |
| 422 | +The @racket[options] argument provides additional options that are sent to Yices2 |
| 423 | +via the @tt{set-option} SMT command. |
| 424 | +For example, setting @racket[options] to @racket[(hash ':seed 5)] |
| 425 | +will send the command @tt{(set-option :seed 5)} to Yices2 prior to solving. |
| 426 | +} |
| 427 | + |
| 428 | +@defproc[(yices-available?) boolean?]{ |
| 429 | +Returns true if the Yices2 solver is available for use (i.e., Rosette can locate a @tt{yices-smt2} binary). |
| 430 | +If this returns @racket[#f], @racket[(yices)] will not succeed |
| 431 | +without its optional @racket[path] argument.} |
| 432 | + |
| 433 | + |
282 | 434 | @section{Solutions}
|
283 | 435 |
|
284 | 436 | A solution to a set of formulas may be satisfiable (@racket[sat?]), unsatisfiable (@racket[unsat?]),
|
|
0 commit comments