-
Notifications
You must be signed in to change notification settings - Fork 62
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
CVC4 from Macports in OS X does not work with SAW/SBV #146
Comments
Do you get a similar error with the Cryptol REPL if you use |
Yup. Main> :set prover=cvc4 |
The relevant SBV code is at It doesn't look like SBV is doing anything weird; it's possible the library functions for finding and running the executable are at fault. The relevant library functions are
Perhaps you could try running |
import System.Process
import Control.Concurrent
import System.IO
main = do
putStrLn "Running cvc4 ..."
(inp, out, err, pid) <- runInteractiveProcess "cvc4" [] Nothing Nothing
forkIO (hPutStrLn inp "EXIT;" >> hClose inp)
forkIO (putStrLn =<< hGetContents out)
forkIO (putStrLn =<< hGetContents err)
threadDelay 1000000
return () |
I tried the following SMT2 query. CVC4 works using import System.Process
import Control.Concurrent
import System.IO
main = do
putStrLn "Running cvc4 ..."
(inp, out, err, pid) <- runInteractiveProcess "cvc4" ["--language", "smt2"] Nothing Nothing
forkIO (hPutStrLn inp "(set-logic AUFLIA) \
\(declare-const l_n Int) \
\(declare-const l_r_0 Int) \
\(declare-const l_r Int) \
\(declare-const l_r_1 Int) \
\(assert (not (=> (and (> l_n (- 128)) (or (and (> l_n 0) (and (= l_r_0 0) (= l_r l_n))) (and (not (> l_n 0)) (and (= l_r_1 0) (= l_r (- l_n)))))) (>= l_r 0)))) \
\(check-sat)" >> hClose inp)
forkIO (putStrLn =<< hGetContents out)
forkIO (putStrLn =<< hGetContents err)
threadDelay 1000000
return () |
I think this is ultimately a problem with the MacPorts version of CVC4. The version I've compiled from source seems to work fine with the latest Cryptol, SAW, and SBV. In my experience, the MacPorts version of CVC4 has frequently crashed, while from-source builds from the latest GitHub code seem pretty stable. Feel free to re-open with more information if you still see this happening. |
I am having a similar issues with the Linux version of CVC4 (within WSL2, but that shouldn't make a difference). Cryptol and SAW cannot find CVC4, but findExecutable finds it, the above program runs (with a small modification, but not relevant I think...) Is CVC4 still supported? |
In OS X, SAW complains that it cannot find CVC4 executable if CVC4 is installed using Macports. A quick inspection indicates that it seems SBV cannot find CVC4 in /opt/local/bin, although it's installed there by Macports. Oddly, it works if one installs CVC4 pre-compiled binary downloaded from the CVC4 website (which interestingly, is created using Macports).
The text was updated successfully, but these errors were encountered: