-
Notifications
You must be signed in to change notification settings - Fork 75
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 STP and Yices2 #273
Merged
Merged
Changes from 19 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
01cf9f3
stp support
vcanumalla cd7c074
added yices2
vcanumalla 5994ae2
yices2 addition
vcanumalla 82a3458
workflow
vcanumalla ad210a6
add some sudos
vcanumalla 3e69e04
delete some random whitespace
vcanumalla 7aeac35
end files in newline
vcanumalla 507a9a7
fix added whitespace
vcanumalla 1c531f3
fix workflows test
vcanumalla 47450f0
fix path
vcanumalla eab0001
bin should be in right folder now
vcanumalla 53fd00a
debugging for stp failure
vcanumalla 3f01d86
some debugging info and output
vcanumalla 3a7fc3c
is yices2 working
vcanumalla becbfab
Skip `ASSERT` lines during `check-sat` for STP
gussmith23 5d5cfae
Revert "Skip `ASSERT` lines during `check-sat` for STP"
gussmith23 f1ad290
don't need the -p flag
gussmith23 c405c6f
Undo unnecessary changes
gussmith23 a486654
Convert new tests.yml code to match existing style
gussmith23 1f8e33a
Add documentation
gussmith23 4d364f2
Rename to Yices and attempt to use `yices` binary
gussmith23 4b63276
Switch back to yices-smt2 binary
gussmith23 f8dfb4b
Update documentation
gussmith23 5c92eec
More updates
gussmith23 974d8e4
Run `install` so that binary gets renamed
gussmith23 5b2fcef
Forgot to before
gussmith23 e00ac84
yices->yices-smt2 in docs
gussmith23 c4eacea
Add imports
gussmith23 44f4c3c
More detail in the documentation
gussmith23 5d15047
fix docs
gussmith23 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#lang racket | ||
|
||
(require racket/runtime-path | ||
"server.rkt" "env.rkt" | ||
"../solver.rkt" | ||
(prefix-in base/ "base-solver.rkt")) | ||
|
||
(provide (rename-out [make-stp stp]) stp? stp-available?) | ||
|
||
(define-runtime-path stp-path (build-path ".." ".." ".." "bin" "stp")) | ||
(define stp-opts '("--SMTLIB2")) | ||
|
||
(define (stp-available?) | ||
(not (false? (base/find-solver "stp" stp-path #f)))) | ||
|
||
(define (make-stp [solver #f] #:options [options (hash)] #:logic [logic #f] #:path [path #f]) | ||
(define config | ||
(cond | ||
[(stp? solver) | ||
(base/solver-config solver)] | ||
[else | ||
(define real-stp-path (base/find-solver "stp" stp-path path)) | ||
(when (and (false? real-stp-path) (not (getenv "PLT_PKG_BUILD_SERVICE"))) | ||
(error 'stp "stp binary is not available (expected to be at ~a); try passing the #:path argument to (stp)" (path->string (simplify-path stp-path)))) | ||
(base/config options real-stp-path logic)])) | ||
(stp (server (base/config-path config) stp-opts (base/make-send-options config)) config '() '() '() (env) '())) | ||
|
||
(struct stp base/solver () | ||
#:property prop:solver-constructor make-stp | ||
#:methods gen:custom-write | ||
[(define (write-proc self port mode) (fprintf port "#<stp>"))] | ||
#:methods gen:solver | ||
[ | ||
(define (solver-features self) | ||
'(qf_bv)) | ||
|
||
(define (solver-options self) | ||
(base/solver-options self)) | ||
|
||
(define (solver-assert self bools) | ||
(base/solver-assert self bools)) | ||
|
||
(define (solver-minimize self nums) | ||
(base/solver-minimize self nums)) | ||
|
||
(define (solver-maximize self nums) | ||
(base/solver-maximize self nums)) | ||
|
||
(define (solver-clear self) | ||
(base/solver-clear self)) | ||
|
||
(define (solver-shutdown self) | ||
(base/solver-shutdown self)) | ||
|
||
(define (solver-push self) | ||
(base/solver-push self)) | ||
|
||
(define (solver-pop self [k 1]) | ||
(base/solver-pop self k)) | ||
|
||
(define (solver-check self) | ||
(base/solver-check self)) | ||
|
||
(define (solver-debug self) | ||
(base/solver-debug self))]) | ||
|
||
(define (set-default-options server) | ||
void) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#lang racket | ||
|
||
(require racket/runtime-path | ||
"server.rkt" "env.rkt" | ||
"../solver.rkt" | ||
(prefix-in base/ "base-solver.rkt")) | ||
|
||
(provide (rename-out [make-yices-smt2 yices-smt2]) yices-smt2? yices-smt2-available?) | ||
|
||
(define-runtime-path yices-smt2-path (build-path ".." ".." ".." "bin" "yices-smt2")) | ||
(define yices-smt2-opts '("--incremental")) | ||
|
||
(define (yices-smt2-available?) | ||
(not (false? (base/find-solver "yices-smt2" yices-smt2-path #f)))) | ||
(define default-logic 'QF_BV) ;; YICES_2 needs a default logic set otherwise it will error | ||
(define (make-yices-smt2 [solver #f] #:options [options (hash)] #:logic [logic default-logic] #:path [path #f]) | ||
(define config | ||
(cond | ||
[(yices-smt2? solver) | ||
(base/solver-config solver)] | ||
[else | ||
(define real-yices-smt2-path (base/find-solver "yices-smt2" yices-smt2-path path)) | ||
(when (and (false? real-yices-smt2-path) (not (getenv "PLT_PKG_BUILD_SERVICE"))) | ||
(error 'yices-smt2 "yices-smt2 binary is not available (expected to be at ~a); try passing the #:path argument to (yices-smt2)" (path->string (simplify-path yices-smt2-path)))) | ||
(base/config options real-yices-smt2-path logic)])) | ||
(yices-smt2 (server (base/config-path config) yices-smt2-opts (base/make-send-options config)) config '() '() '() (env) '())) | ||
|
||
(struct yices-smt2 base/solver () | ||
#:property prop:solver-constructor make-yices-smt2 | ||
#:methods gen:custom-write | ||
[(define (write-proc self port mode) (fprintf port "#<yices-smt2>"))] | ||
#:methods gen:solver | ||
[ | ||
(define (solver-features self) | ||
'(qf_bv)) | ||
|
||
(define (solver-options self) | ||
(base/solver-options self)) | ||
|
||
(define (solver-assert self bools) | ||
(base/solver-assert self bools)) | ||
|
||
(define (solver-minimize self nums) | ||
(base/solver-minimize self nums)) | ||
|
||
(define (solver-maximize self nums) | ||
(base/solver-maximize self nums)) | ||
|
||
(define (solver-clear self) | ||
(base/solver-clear self)) | ||
|
||
(define (solver-shutdown self) | ||
(base/solver-shutdown self)) | ||
|
||
(define (solver-push self) | ||
(base/solver-push self)) | ||
|
||
(define (solver-pop self [k 1]) | ||
(base/solver-pop self k)) | ||
|
||
(define (solver-check self) | ||
(base/solver-check self)) | ||
|
||
(define (solver-debug self) | ||
(base/solver-debug self))]) | ||
|
||
(define (set-default-options server) | ||
void) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this called
yices-smt2
rather than e.g.yices2
(oryices
)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See here: https://github.com/SRI-CSL/yices2/blob/e27cf308cffb0ecc6cc7165c10e81ca65bc303b3/doc/NOTES#L1182
Apparently they make different binaries for each frontend (rather than changing the frontend with a flag, as other solvers do)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be called
yices
, for consistency with other Rosette solvers.