-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
119 additions
and
74 deletions.
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
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,16 @@ | ||
#lang racket | ||
|
||
(require racket/runtime-path "smt.rkt" "../common/server.rkt") | ||
|
||
(provide cvc4%) | ||
|
||
(define-runtime-path cvc4 (build-path ".." ".." ".." "bin" "cvc4")) | ||
|
||
(define cvc4% | ||
(class* smt% (writable<%>) (inspect (make-inspector)) | ||
|
||
(super-new [path cvc4] | ||
[opts '("--lang=smt" "--output-lang=z3-str" "-m" "-q" "--strings-exp")]) | ||
|
||
(define/public (custom-write port) (fprintf port "cvc4%")) | ||
(define/public (custom-display port) (custom-write port)))) |
File renamed without changes.
File renamed without changes.
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,52 @@ | ||
#lang racket | ||
|
||
(require "../solver.rkt" "../solution.rkt" | ||
"../common/server.rkt" (only-in "../common/util.rkt" filter-asserts) | ||
"../../config/log.rkt" "cmd.rkt" (rename-in "env.rkt" [env make-env])) | ||
|
||
(provide smt%) | ||
|
||
(define smt% | ||
(class* object% (solver<%>) (inspect (make-inspector)) | ||
[init path] | ||
[init opts] | ||
|
||
(define server | ||
(new server% | ||
[initializer (thunk (apply subprocess #f #f #f path opts))] | ||
[stderr-handler (lambda (err) | ||
(let ([expr (read err)]) | ||
(unless (eof-object? expr) | ||
(log-error [this] "~a" expr))))])) | ||
|
||
(define asserts '()) | ||
(define env (make-env)) | ||
|
||
(super-new) | ||
|
||
(define/public assert | ||
(lambda in (set! asserts (append asserts (filter-asserts in))))) | ||
|
||
(define/public (clear) | ||
(send server shutdown) | ||
(set!-values (asserts env) (values '() (make-env)))) | ||
|
||
(define/public (shutdown) (clear)) | ||
|
||
(define/public (debug) (error 'debug "not supported by ~a" this)) | ||
(define/public (solve-all) (error 'solve-all "not supported by ~a" this)) | ||
|
||
(define/public (solve) | ||
(set! asserts (remove-duplicates asserts)) | ||
(cond [(ormap false? asserts) (unsat)] | ||
[else | ||
(parameterize ([current-log-source this]) | ||
(log-time [this] "compilation" : | ||
(send server write (curry encode env asserts)) | ||
(set! asserts '())) | ||
(log-time [this] "solving" : | ||
(send server read (curry decode env))))])))) | ||
|
||
|
||
|
||
|
File renamed without changes.
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,16 @@ | ||
#lang racket | ||
|
||
(require racket/runtime-path "smt.rkt" "../common/server.rkt") | ||
|
||
(provide z3%) | ||
|
||
(define-runtime-path z3 (build-path ".." ".." ".." "bin" "z3")) | ||
|
||
(define z3% | ||
(class* smt% (writable<%>) (inspect (make-inspector)) | ||
|
||
(super-new [path z3] | ||
[opts '("-smt2" "-in")]) | ||
|
||
(define/public (custom-write port) (fprintf port "z3%")) | ||
(define/public (custom-display port) (custom-write port)))) |
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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