SpaceSearch: A Library for Building and Verifying Solver-Aided Tools
Konstantin Weitz Steven S. Lyubomirsky Michael
- D. Ernst
Zachary Tatlock Emina Torlak Stefan Heule
SpaceSearch: A Library for Building and Verifying Solver-Aided - - PowerPoint PPT Presentation
SpaceSearch: A Library for Building and Verifying Solver-Aided Tools Konstantin Steven S. Stefan Emina Michael Zachary Weitz Lyubomirsky Heule Torlak D. Ernst Tatlock Reduction SMT Reduction SMT Reduction SpaceSearch Reduction
SpaceSearch: A Library for Building and Verifying Solver-Aided Tools
Konstantin Weitz Steven S. Lyubomirsky Michael
Zachary Tatlock Emina Torlak Stefan Heule
Reduction
Reduction
SMT
Reduction
SMT
SpaceSearch
Reduction
SMT
The Border Gateway Protocol
ISP ISP
The Border Gateway Protocol
ISP ISP ISP ISP
The Border Gateway Protocol
ISP
ISP ISP ISP ISP
The Border Gateway Protocol
ISP
ISP ISP ISP ISP
The Border Gateway Protocol
ISP ISP ISP ISP
The Border Gateway Protocol
configure terminal router bgp 1 neighbor 8.212.226.20 remote-as 2 neighbor 172.16.254.1 remote-as 3 neighbor 95.112.23.51 remote-as 4 ! prefix lists ip prefix-listISP ISP ISP ISP
The Border Gateway Protocol
configure terminal router bgp 1 neighbor 8.212.226.20 remote-as 2 neighbor 172.16.254.1 remote-as 3 neighbor 95.112.23.51 remote-as 4 ! prefix lists ip prefix-listISP ISP ISP ISP
The Border Gateway Protocol
configure terminal router bgp 1 neighbor 8.212.226.20 remote-as 2 neighbor 172.16.254.1 remote-as 3 neighbor 95.112.23.51 remote-as 4 ! prefix lists ip prefix-listISP ISP ISP ISP
The Border Gateway Protocol
configure terminal router bgp 1 neighbor 8.212.226.20 remote-as 2 neighbor 172.16.254.1 remote-as 3 neighbor 95.112.23.51 remote-as 4 ! prefix lists ip prefix-listISP ISP ISP ISP
The Border Gateway Protocol
configure terminal router bgp 1 neighbor 8.212.226.20 remote-as 2 neighbor 172.16.254.1 remote-as 3 neighbor 95.112.23.51 remote-as 4 ! prefix lists ip prefix-listISP ISP ISP ISP
The Border Gateway Protocol
configure terminal router bgp 1 neighbor 8.212.226.20 remote-as 2 neighbor 172.16.254.1 remote-as 3 neighbor 95.112.23.51 remote-as 4 ! prefix lists ip prefix-listISP ISP ISP ISP
The Border Gateway Protocol
configure terminal router bgp 1 neighbor 8.212.226.20 remote-as 2 neighbor 172.16.254.1 remote-as 3 neighbor 95.112.23.51 remote-as 4 ! prefix lists ip prefix-listBagpipe
configure terminal router bgp 1 neighbor 8.212.226.20 remote-as 2 neighbor 172.16.254.1 remote-as 3 neighbor 95.112.23.51 remote-as 4 ! prefix lists ip prefix-list outC permit 0.0.0.0/0 le 32 ip prefix-list outPeer permit 8.212.226.0/24 le p prefix-list ou permitConfiguration
Bagpipe
Specification Spec Violation Spec Holds
Bagpipe
configure terminal router bgp 1 neighbor 8.212.226.20 remote-as 2 neighbor 172.16.254.1 remote-as 3 neighbor 95.112.23.51 remote-as 4 ! prefix lists ip prefix-list outC permit 0.0.0.0/0 le 32 ip prefix-list outPeer permit 8.212.226.0/24 le p prefix-list ou permitConfiguration
Bagpipe
Specification Spec Violation Spec Holds
∀t:trace( ), check( , t)
Bagpipe
configure terminal router bgp 1Spec Violation Spec Holds Specification
configure terminal router bgp 1 neighbor 8.212.226.20 remote-as 2 neighbor 172.16.254.1 remote-as 3 neighbor 95.112.23.51 remote-as 4 ! prefix lists ip prefix-list outC permit 0.0.0.0/0 le 32 ip prefix-list outPeer permit 8.212.226.0/24 le p prefix-list ou permitConfiguration
∀t:trace( ), check( , t)
Bagpipe
Spec Violation Spec Holds Specification
configure terminal router bgp 1 neighbor 8.212.226.20 remote-as 2 neighbor 172.16.254.1 remote-as 3 neighbor 95.112.23.51 remote-as 4 ! prefix lists ip prefix-list outC permit 0.0.0.0/0 le 32 ip prefix-list outPeer permit 8.212.226.0/24 le p prefix-list ou permitConfiguration
∀t:trace( ), check( , t)
Bagpipe
fin
configure terminal router bgp 1Spec Violation Spec Holds
∀t:initTrace( ), check( , t)
configure terminal router bgp 1Reduce
Specification
configure terminal router bgp 1 neighbor 8.212.226.20 remote-as 2 neighbor 172.16.254.1 remote-as 3 neighbor 95.112.23.51 remote-as 4 ! prefix lists ip prefix-list outC permit 0.0.0.0/0 le 32 ip prefix-list outPeer permit 8.212.226.0/24 le p prefix-list ou permitConfiguration
[OOPSLA’16]
∀t:trace( ), check( , t)
Bagpipe
fin
configure terminal router bgp 1Spec Violation Spec Holds
∀t:initTrace( ), check( , t)
configure terminal router bgp 1Reduce
Specification
configure terminal router bgp 1 neighbor 8.212.226.20 remote-as 2 neighbor 172.16.254.1 remote-as 3 neighbor 95.112.23.51 remote-as 4 ! prefix lists ip prefix-list outC permit 0.0.0.0/0 le 32 ip prefix-list outPeer permit 8.212.226.0/24 le p prefix-list ou permitConfiguration
[OOPSLA’16]
∀t:trace( ), check( , t)
Bagpipe
fin
configure terminal router bgp 1Spec Violation Spec Holds
Reduce ?
∀t:initTrace( ), check( , t)
configure terminal router bgp 1Reduce
SMT
Specification
configure terminal router bgp 1 neighbor 8.212.226.20 remote-as 2 neighbor 172.16.254.1 remote-as 3 neighbor 95.112.23.51 remote-as 4 ! prefix lists ip prefix-list outC permit 0.0.0.0/0 le 32 ip prefix-list outPeer permit 8.212.226.0/24 le p prefix-list ou permitConfiguration
[OOPSLA’16]
∀t:initTrace( ), check( , t)
configure terminal router bgp 1 neighbor 8.212.226.20initTrace( )
configure terminal router bgp 1∀t:initTrace( ), check( , t)
configure terminal router bgp 1 neighbor 8.212.226.20initTrace( )
configure terminal router bgp 1∀t:initTrace( ), check( , t)
configure terminal router bgp 1 neighbor 8.212.226.20{ t:initTrace( ) | ¬check( , t) }
configure terminal router bgp 1initTrace( )
configure terminal router bgp 1∀t:initTrace( ), check( , t)
configure terminal router bgp 1 neighbor 8.212.226.20search( ) = None
{ t:initTrace( ) | ¬check( , t) }
configure terminal router bgp 1SpaceSearch Interface
a
empty = singleton(a) = union( , ) =
SpaceSearch Interface
a
empty = singleton(a) = union( , ) =
a b
f(a) f(b)
a b
bind(S,f) = Ux:S f(x) = bind( , ) =
SpaceSearch Interface
a
empty = singleton(a) = union( , ) =
a
search( ) = None search( ) = Some a
a b
f(a) f(b)
a b
bind(S,f) = Ux:S f(x) = bind( , ) =
∀t:trace( ), check( , t) ∀t:initTrace( ), check( , t)
Bagpipe
fin
Configuration Specification
configure terminal router bgp 1 neighbor 8.212.226.20 remote-as 2 neighbor 172.16.254.1 remote-as 3 neighbor 95.112.23.51 remote-as 4 ! prefix lists ip prefix-list outC permit 0.0.0.0/0 le 32 ip prefix-list outPeer permit 8.212.226.0/24 le p prefix-list ou permit configure terminal router bgp 1 configure terminal router bgp 1Spec Violation Spec Holds
Reduce
∀t:trace( ), check( , t) ∀t:initTrace( ), check( , t)
Bagpipe
fin
Configuration Specification
configure terminal router bgp 1 neighbor 8.212.226.20 remote-as 2 neighbor 172.16.254.1 remote-as 3 neighbor 95.112.23.51 remote-as 4 ! prefix lists ip prefix-list outC permit 0.0.0.0/0 le 32 ip prefix-list outPeer permit 8.212.226.0/24 le p prefix-list ou permit configure terminal router bgp 1 configure terminal router bgp 1Spec Violation Spec Holds
Reduce
search( bind(initTraceSpace( ), (λ t. if check( , t) then empty else singleton(t))) = None
configure terminal router bgp 1Reduce
∀t:trace( ), check( , t) ∀t:initTrace( ), check( , t)
Bagpipe
fin
Configuration Specification
configure terminal router bgp 1 neighbor 8.212.226.20 remote-as 2 neighbor 172.16.254.1 remote-as 3 neighbor 95.112.23.51 remote-as 4 ! prefix lists ip prefix-list outC permit 0.0.0.0/0 le 32 ip prefix-list outPeer permit 8.212.226.0/24 le p prefix-list ou permit configure terminal router bgp 1 configure terminal router bgp 1Spec Violation Spec Holds
Reduce
search( bind(initTraceSpace( ), (λ t. if check( , t) then empty else singleton(t))) = None
configure terminal router bgp 1Reduce Extract ?
SMT
Meet
Meet
∀ x y. (x /\ y) ⟺ ¬(¬x \/ ¬y) De Morgan's Law
(let ((x (symbolic-bool)) (y (symbolic-bool)))
Meet
∀ x y. (x /\ y) ⟺ ¬(¬x \/ ¬y) De Morgan's Law
(let ((x (symbolic-bool)) (y (symbolic-bool)))
Meet
∀ x y. (x /\ y) ⟺ ¬(¬x \/ ¬y)
(eq? (and x y) (not (or (not x) (not y))))
De Morgan's Law
(let ((x (symbolic-bool)) (y (symbolic-bool)))
Meet
∀ x y. (x /\ y) ⟺ ¬(¬x \/ ¬y)
(eq? (and x y) (not (or (not x) (not y)))) (solve (if (assert false) ‘counter-example))
De Morgan's Law
(let ((x (symbolic-bool)) (y (symbolic-bool))) (declare-const x Bool) (declare-const y Bool) (define-const a Bool (and x y)) (define-const b Bool (not (or (not x) (not y)))) (assert (not (and (=> a b) (=> b a)))) (check-sat)
type-driven state merging
Meet
∀ x y. (x /\ y) ⟺ ¬(¬x \/ ¬y)
(eq? (and x y) (not (or (not x) (not y)))) (solve (if (assert false) ‘counter-example))
De Morgan's Law
=> union(s,t) => (lambda (v) (if (symbolic-bool) (s v) (t v))) empty => (lambda (v) (assert false)) search(s) => (solve s) single(a) => (lambda (v) a) bind(s,f) => (lambda (v) (f (s v) v))
SpaceSearch Extraction
∀t:trace( ), check( , t) ∀t:initTrace( ), check( , t)
Bagpipe
fin
Configuration Specification
configure terminal router bgp 1 neighbor 8.212.226.20 remote-as 2 neighbor 172.16.254.1 remote-as 3 neighbor 95.112.23.51 remote-as 4 ! prefix lists ip prefix-list outC permit 0.0.0.0/0 le 32 ip prefix-list outPeer permit 8.212.226.0/24 le p prefix-list ou permit configure terminal router bgp 1 configure terminal router bgp 1Spec Violation Spec Holds
Reduce
search( bind(initTraceSpace( ), (λ t. if check( , t) then empty else singleton(t))) = None
configure terminal router bgp 1Reduce
∀t:trace( ), check( , t) ∀t:initTrace( ), check( , t)
Bagpipe
fin
Configuration Specification
configure terminal router bgp 1 neighbor 8.212.226.20 remote-as 2 neighbor 172.16.254.1 remote-as 3 neighbor 95.112.23.51 remote-as 4 ! prefix lists ip prefix-list outC permit 0.0.0.0/0 le 32 ip prefix-list outPeer permit 8.212.226.0/24 le p prefix-list ou permit configure terminal router bgp 1 configure terminal router bgp 1Spec Violation Spec Holds
Reduce
search( bind(initTraceSpace( ), (λ t. if check( , t) then empty else singleton(t))) = None
configure terminal router bgp 1Reduce Extract
/SMT
Summary
SpaceSearch
Summary
SpaceSearch
More in the paper:
Evaluation
Bagpipe
SpaceSearch
Evaluation
Bagpipe
SpaceSearch
Evaluation
Bagpipe
SpaceSearch
Bagpipe
configure terminal router bgp 1 neighbor 8.212.226.20 remote-as 2 neighbor 172.16.254.1 remote-as 3 neighbor 95.112.23.51 remote-as 4 ! prefix lists ip prefix-list outC permit 0.0.0.0/0 le 32 ip prefix-list outPeer permit 8.212.226.0/24 le p prefix-list ou permitSpecification Configuration Counter Example Correct
Bagpipe
configure terminal router bgp 1 neighbor 8.212.226.20 remote-as 2 neighbor 172.16.254.1 remote-as 3 neighbor 95.112.23.51 remote-as 4 ! prefix lists ip prefix-list outC permit 0.0.0.0/0 le 32 ip prefix-list outPeer permit 8.212.226.0/24 le p prefix-list ou permit19 Spec Violations, No False Positives 14 Specs Hold
Counter Example Equal
search( counterexamples( , ))
Query A Query B
=
E x t r a c t Reduce
SMT
Counter Example Equal
search( bind(int32, (λ x. bind(int32, (λ y. if stoke(ADD x, y) = rocksalt(ADD x, y) then empty else singleton(x,y)))))
Instruction
ADD x, y
E x t r a c t
SMT
Counter Example Equal
search( bind(int32, (λ x. bind(int32, (λ y. if stoke(ADD x, y) = rocksalt(ADD x, y) then empty else singleton(x,y)))))
Instruction
ADD x, y
E x t r a c t
Bugs found:
SMT
Related Work
Rosette Torlak et al. PLDI’14 Smten Uhler et al. CAV’13
XCert Tatlock et al. PLDI’10
Marić TCS’10 Oe et al. VMCAI’12
Thank You
Konstantin Weitz Steven S. Lyubomirsky Michael
Zachary Tatlock Emina Torlak Stefan Heule
SpaceSearch
Bagpipe
github.com/konne88/SpaceSearch