OpenSMT2
A Parallel, Interpolating SMT Solver
Antti Hyvärinen, Matteo Marescotti, Leonardo Alt, Sepideh Asadi, and Natasha Sharygina
OpenSMT2 A Parallel, Interpolating SMT Solver Antti Hyvrinen, - - PowerPoint PPT Presentation
OpenSMT2 A Parallel, Interpolating SMT Solver Antti Hyvrinen, Matteo Marescotti, Leonardo Alt, Sepideh Asadi, and Natasha Sharygina Why another SMT solver? Interpolation Model checking OpenSMT Parallel SMT Solving OpenSMT2
A Parallel, Interpolating SMT Solver
Antti Hyvärinen, Matteo Marescotti, Leonardo Alt, Sepideh Asadi, and Natasha Sharygina
Parallel SMT Solving Model checking Interpolation
OpenSMT Why another SMT solver?
italiana,
, QF_LRA, and to some extent QF_BV
, and QF_LRA, with proof compression
to CNF SMT parser Theory solvers SAT solver API Program Theory specific simplification results smt2 file results translation
c c′ φs φCNF φ σ
Logic
SAT solver THandler
TSolverHandler UFTHandler LRATHandler TSolver Egraph LRASolver Theory UFTheory LRATheory LRALogic
EL ES ET
A I I' B
A ∧ B
I
A → I I ∧ B
does not need to take care of such details.
Model Checker SMT Solver
Interpolation Module
Boolean EUF LRA Proof Analysis Boolean EUF LRA Labeling Boolean EUF LRA Interpolator OpenSMT2
φ = A ∧ B SAT / UNSAT Partitions A and B Proof of UNSAT Proof statistics Strength requirements Partitions A and B Proof of UNSAT
Labeling functions Partitions A and B
Proof of UNSAT
Interpolant
Then also is an interpolant over-approximating
with different interpolant strength
I(A, B)
A
¬I(B, A)
A
I(A, B) → ¬I(B, A)
Single interpolant Previous interpolation algorithm
Multiple interpolants Previous interpolation algorithm Dual interpolation algorithm EUF-interpolation system Strength/size requirements s s s s w w w w w Labeling function
constraints with a constant
4 5 1 2 3 2 3 4 5 1 B A IM I0.5 ID
(inc(y0) = y0 + 1) ∧ ((y0 ≥ 0 ∧ y0 < 10) → ((z0 = inc(y0)) ∧ ¬(z0 > 0 ∧ z0 ≤ 20))
semantics
to bit-precise circuits
functions to the circuits
SMT solver Model checker UFP BVP BVP BVP FB FB Symbolically encoded program
Algorithm 1: The Counterexample-Guided Theory Refinement Algorithm
input : P = {(x1 = t1), . . . , (xn = tn)}: a program, and t: a safety property
1 For all 1 i n initialize ρ[xi = ti] [xi = ti]u 2 ρ[t] [t]u 3 FB > 4 while true do 5
Query ρ[x1 = t1] ^ . . . ^ ρ[xn = tn] ^ ¬ρ[t] ^ FB
6
hresult, CEi checkSAT(Query)
7
if result is UnSAT then
8
return hSafe, ?i
9
end
10
CE b getValues(CE)
11
foreach s 2 P [ {t} s.t. ρ[s] 6| = [s]b do
12
hresult, i checkSAT([s]b ^ CE b)
13
if result is UnSAT then
14
ρ[s] refines(ρ[s])
15
FB computeBinding(ρ)
16
break
17
end
18
end
19
if No s was refined at line 14 then
20
return hUnsafe, CE bi
21
end
22 end
From Hyvärinen & al.: Theory Refinement for Program Verification, to appear at SAT 2017
Construct a query Get a counterexample Refine
distributing work
with algorithm portfolios
partitioning in several different ways
0.2 0.4 0.6 0.8 1 10000 20000 30000 40000 decisions
runtimes to obtain speed-up
instance
provides little speed-up
more potential
0.2 0.4 0.6 0.8 1 30 100 1000 probability time (s) partition 1 partititon 2
F F ≡ F1 ∨ . . . ∨ Fn
Use a partitioning function to produce from an instance a set of instances such that
F1, . . . , Fn
Solve each separately in parallel
Fi
0.2 0.4 0.6 0.8 1 30 100 1000 probability time (s) partition 1 partititon 2
The efficiency also depends significantly
very even instances
easy and one equally hard instance
0.2 0.4 0.6 0.8 1 10 100 1000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 probability time
Divide-and-conquer can be tricky, the efficiency depends on the theory The figure shows the run-time probability for an LRA instance when fixing n literals Initially the instance changes little, after a while takes a big jump, and finally gets harder (as presumably the
and stagnates
satisfiable
shown unsatisfiable
Original instance Different ways to partition Partitions Different ways to partition Or-node And-node
http://verify.inf.usi.ch/opensmt