towards automatic inference of inductive invariantsmanosk/assets/papers/i4-hotos19-slide… ·...
TRANSCRIPT
![Page 1: Towards Automatic Inference of Inductive Invariantsmanosk/assets/papers/i4-hotos19-slide… · Client2 Safety property: no two clients can be linked to the same server Server0 Client1](https://reader034.vdocuments.us/reader034/viewer/2022050610/5fb179396562be4fb82e270a/html5/thumbnails/1.jpg)
Towards Automatic Inference ofInductive Invariants
Haojun Ma, Aman Goel, Jean-Baptiste JeanninManos Kapritsos, Baris Kasikci, Karem A. Sakallah
University of Michigan
![Page 2: Towards Automatic Inference of Inductive Invariantsmanosk/assets/papers/i4-hotos19-slide… · Client2 Safety property: no two clients can be linked to the same server Server0 Client1](https://reader034.vdocuments.us/reader034/viewer/2022050610/5fb179396562be4fb82e270a/html5/thumbnails/2.jpg)
1
Distributed systems are subtle
![Page 3: Towards Automatic Inference of Inductive Invariantsmanosk/assets/papers/i4-hotos19-slide… · Client2 Safety property: no two clients can be linked to the same server Server0 Client1](https://reader034.vdocuments.us/reader034/viewer/2022050610/5fb179396562be4fb82e270a/html5/thumbnails/3.jpg)
The alternative: formal verification
Formal specification or property
Proving the system maintains the property
Successful on distributed systems
Drawback: Manual effort
2
![Page 4: Towards Automatic Inference of Inductive Invariantsmanosk/assets/papers/i4-hotos19-slide… · Client2 Safety property: no two clients can be linked to the same server Server0 Client1](https://reader034.vdocuments.us/reader034/viewer/2022050610/5fb179396562be4fb82e270a/html5/thumbnails/4.jpg)
Existing verification approaches
All existing approaches require the human to find an inductive invariant
We want to automatically find inductive invariants
3
Manual Effort
Verdi(Coq) IronFleet(Dafny) Ivy I4
AutomatedPerson-hoursPerson-monthsPerson-years
![Page 5: Towards Automatic Inference of Inductive Invariantsmanosk/assets/papers/i4-hotos19-slide… · Client2 Safety property: no two clients can be linked to the same server Server0 Client1](https://reader034.vdocuments.us/reader034/viewer/2022050610/5fb179396562be4fb82e270a/html5/thumbnails/5.jpg)
Formal verification in 2 minutes
. . .
4
0 1 2 k k+1
Goal: prove that the safety property holds at all times
Initial state
Inductive proof● Base case: prove initial state is safe● Inductive step: if state k is safe, prove state k+1 is safe
An execution:
![Page 6: Towards Automatic Inference of Inductive Invariantsmanosk/assets/papers/i4-hotos19-slide… · Client2 Safety property: no two clients can be linked to the same server Server0 Client1](https://reader034.vdocuments.us/reader034/viewer/2022050610/5fb179396562be4fb82e270a/html5/thumbnails/6.jpg)
Safety property vs. inductive invariant
All states
Reachable states
5
Safe states
Inductive invariant
![Page 7: Towards Automatic Inference of Inductive Invariantsmanosk/assets/papers/i4-hotos19-slide… · Client2 Safety property: no two clients can be linked to the same server Server0 Client1](https://reader034.vdocuments.us/reader034/viewer/2022050610/5fb179396562be4fb82e270a/html5/thumbnails/7.jpg)
Lock server protocol
6
Server1
Client2
Safety property:no two clients can be linked to the same server
Server0
Client1
Client0
![Page 8: Towards Automatic Inference of Inductive Invariantsmanosk/assets/papers/i4-hotos19-slide… · Client2 Safety property: no two clients can be linked to the same server Server0 Client1](https://reader034.vdocuments.us/reader034/viewer/2022050610/5fb179396562be4fb82e270a/html5/thumbnails/8.jpg)
Finding an inductive invariant using Ivy
7
lock_hold
Safety property
Strengthening assertion
Automatically checks if an invariant is inductive
Requires the human to find an inductive invariant (Screenshot from Ivy)
Existing approaches rely on manual effort and human intuition
![Page 9: Towards Automatic Inference of Inductive Invariantsmanosk/assets/papers/i4-hotos19-slide… · Client2 Safety property: no two clients can be linked to the same server Server0 Client1](https://reader034.vdocuments.us/reader034/viewer/2022050610/5fb179396562be4fb82e270a/html5/thumbnails/9.jpg)
Outline
I4: a new approach
Design of I4
Evaluation
Future work
8
![Page 10: Towards Automatic Inference of Inductive Invariantsmanosk/assets/papers/i4-hotos19-slide… · Client2 Safety property: no two clients can be linked to the same server Server0 Client1](https://reader034.vdocuments.us/reader034/viewer/2022050610/5fb179396562be4fb82e270a/html5/thumbnails/10.jpg)
I4: a new approach
Goal: Find an inductive invariant without relying on human intuition.
Insight: Distributed protocols exhibit regularity.
Implication: We can use inductive invariants from small instances to infer a generalized inductive invariant that holds for all instances.
9
• Behavior doesn’t fundamentally change as the size increases • E.g. lock server, Paxos, …
![Page 11: Towards Automatic Inference of Inductive Invariantsmanosk/assets/papers/i4-hotos19-slide… · Client2 Safety property: no two clients can be linked to the same server Server0 Client1](https://reader034.vdocuments.us/reader034/viewer/2022050610/5fb179396562be4fb82e270a/html5/thumbnails/11.jpg)
Leveraging model checking
Model checking
I4 applies model checking to small, finite instances …
… and then generalizes the result to all instances.
10
J Fully automated
L Doesn’t scale to distributed systems
![Page 12: Towards Automatic Inference of Inductive Invariantsmanosk/assets/papers/i4-hotos19-slide… · Client2 Safety property: no two clients can be linked to the same server Server0 Client1](https://reader034.vdocuments.us/reader034/viewer/2022050610/5fb179396562be4fb82e270a/html5/thumbnails/12.jpg)
Outline
Design of I4
Evaluation
Future work
11
![Page 13: Towards Automatic Inference of Inductive Invariantsmanosk/assets/papers/i4-hotos19-slide… · Client2 Safety property: no two clients can be linked to the same server Server0 Client1](https://reader034.vdocuments.us/reader034/viewer/2022050610/5fb179396562be4fb82e270a/html5/thumbnails/13.jpg)
Overview
12
Protocol.ivy Correct ✓
Invariant generalization
(Ivy)
Increase Size
Invariant generation ona finite instance(Model Checking)
![Page 14: Towards Automatic Inference of Inductive Invariantsmanosk/assets/papers/i4-hotos19-slide… · Client2 Safety property: no two clients can be linked to the same server Server0 Client1](https://reader034.vdocuments.us/reader034/viewer/2022050610/5fb179396562be4fb82e270a/html5/thumbnails/14.jpg)
Invariant generation on a finite instance
13
Protocol.finv
Create Small(Finite) Instance
Protocol.v ModelChecker
CounterexampleDebug(manually)
Protocol.ivy Correct ✓
Invariant generalization
(Ivy)
Increase Size
![Page 15: Towards Automatic Inference of Inductive Invariantsmanosk/assets/papers/i4-hotos19-slide… · Client2 Safety property: no two clients can be linked to the same server Server0 Client1](https://reader034.vdocuments.us/reader034/viewer/2022050610/5fb179396562be4fb82e270a/html5/thumbnails/15.jpg)
Invariant Generalization
14
Protocol.finv
Protocol.v
Counterexample
Protocol.ivy Correct ✓
Generalize
Protocol_inv.ivy Ivy
Weaken StrengtheningAssertionViolation
Increase Size
SafetyPropertyViolation
Create Small(Finite) Instance
Debug(manually)
ModelChecker
![Page 16: Towards Automatic Inference of Inductive Invariantsmanosk/assets/papers/i4-hotos19-slide… · Client2 Safety property: no two clients can be linked to the same server Server0 Client1](https://reader034.vdocuments.us/reader034/viewer/2022050610/5fb179396562be4fb82e270a/html5/thumbnails/16.jpg)
Outline
Evaluation
Future work
15
![Page 17: Towards Automatic Inference of Inductive Invariantsmanosk/assets/papers/i4-hotos19-slide… · Client2 Safety property: no two clients can be linked to the same server Server0 Client1](https://reader034.vdocuments.us/reader034/viewer/2022050610/5fb179396562be4fb82e270a/html5/thumbnails/17.jpg)
Evaluation
16
Lock Server Leader Election Distributed lock
1 server2 clients
3 nodes3 IDs
2 nodes4 epochs
~3s ~8s ~12s
✓ ✓ ✓
![Page 18: Towards Automatic Inference of Inductive Invariantsmanosk/assets/papers/i4-hotos19-slide… · Client2 Safety property: no two clients can be linked to the same server Server0 Client1](https://reader034.vdocuments.us/reader034/viewer/2022050610/5fb179396562be4fb82e270a/html5/thumbnails/18.jpg)
Outline
Future work
17
![Page 19: Towards Automatic Inference of Inductive Invariantsmanosk/assets/papers/i4-hotos19-slide… · Client2 Safety property: no two clients can be linked to the same server Server0 Client1](https://reader034.vdocuments.us/reader034/viewer/2022050610/5fb179396562be4fb82e270a/html5/thumbnails/19.jpg)
Future work
More automation
Scalability to larger protocols
Verification of Implementations
18