SBV is a Haskell framework, allowing high-level use of SMT solvers directly from Haskell. SBV is an acronym for "SMT Based Verification," and SMT is an acronym for "Satisfiability Modulo Theories."
Questions tagged [sbv]
39 questions
0
votes
1 answer
No output from Z3/SMT solver for weight balancing problem with nested quantifiers
Let Z3 solve the following puzzle: You have a balance scale with four weights. With these four weights you must balance any whole number load from 1kg all the way up to 40kg. How much should each of the four weights weigh? (You may place weights on…

abus
- 51
- 5
0
votes
1 answer
I'm considering learning Clingo but would like to see if it could solve this logic problem of my own devising
You are the detective in a crime. From your research you know that Jill and John are lying however the others may be telling the truth or lying. What can you deduce from the statements below?
Jill said: IF John is not involved and Joe told the…

Bob Bixler
- 103
- 3
0
votes
2 answers
Are linear problems on rational numbers decidable in Z3?
I'm working with linear problems on rationals in Z3. To use Z3 I take SBV.
An example of a problem I pose is:
import Data.SBV
solution1 = do
x <- sRational "x"
w <- sRational "w"
constrain $ x.< w
constrain $ x + 2*w .>=0 .|| x .== 1
My…

Shenkok Kotoro
- 29
- 6
0
votes
2 answers
How to avoid the IO monad when solving arithmetic problems in SBV
I am trying to solve arithmetic problems with SBV.
For example
solution :: SymbolicT IO ()
solution = do
[x, y] <- sFloats ["x", "y"]
constrain $ x + y .<= 2
Main> s1 = sat solution
Main> s2 = isSatisfiable solution
Main> s1
Satisfiable.…

Shenkok Kotoro
- 29
- 6
0
votes
1 answer
Get a random satisfiable solution (or multiple solutions) when running runSMT
When running the following code:
answer = do
-- elts is a list of the values we're trying to satisfy for
x <- doSomething
{- ... constraints and other stuff ... -}
query $ do cs <- checkSat
case cs of
…

Jivan
- 21,522
- 15
- 80
- 131
0
votes
1 answer
Sequence of states in Haskell SBV doesn't satisfy constraints
I have a symbolic enumeration like the following:
data State = Start | Dot
mkSymbolicEnumeration ''State
The function to evaluate whether a state is valid within a sequence, relative to the previous state, is defined so that sDot should only be…

Jivan
- 21,522
- 15
- 80
- 131
0
votes
1 answer
Using Z3 with parallelization from SBV
I'd like to use Z3 via SBV using multiple cores. Based on this answer I should be able to do that just by passing parallel.enable=true to the z3 executable on the command line. Since I am using SBV, I need to go through SBV's interface to various…

Cactus
- 27,075
- 9
- 69
- 149
0
votes
1 answer
How do I debug missing variables from SMT-Lib output?
Based on this very helpful answer I rewrote my solver-for-a-stateful-program to use the Query monad and an ever-increasing list of SMT variables standing for the inputs. I expected one of two outcomes from this: either the first part (generating the…

Cactus
- 27,075
- 9
- 69
- 149
0
votes
1 answer
How do I get symbolic square root and logarithm functions in SBV?
The only solution I can find is to do a square root approximation, but this doesn't work symbolically so I can't use it for proving.

Reed Oei
- 1,427
- 2
- 13
- 19