Horn Clauses mc(x) = x-10 if x > 100 mc(x) = mc(mc(x+11)) if x  100 assert (x ≤

Slides:



Advertisements
Similar presentations
Model Checking Base on Interoplation
Advertisements

A practical and complete approach to predicate abstraction Ranjit Jhala UCSD Ken McMillan Cadence Berkeley Labs.
Quantified Invariant Generation using an Interpolating Saturation Prover Ken McMillan Cadence Research Labs TexPoint fonts used in EMF: A A A A A.
Demand-driven inference of loop invariants in a theorem prover
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Efficient Implementation of Property Directed Reachability Niklas Een, Alan Mishchenko, Robert Brayton.
Technology from seed Automatic Equivalence Checking of UF+IA Programs Nuno Lopes and José Monteiro.
50.530: Software Engineering
I NTERPOLANT S TRENGTH presenter 志瑋. O UTLINE Introduction Preliminaries Comparison of Interpolation Systems Labelled Interpolation Systems Proof Transformation.
Algorithmic Software Verification VII. Computation tree logic and bisimulations.
© 2006 Carnegie Mellon University Combining Predicate and Numeric Abstraction for Software Model Checking Software Engineering Institute Carnegie Mellon.
Satisfiability Modulo Theories (An introduction)
SMT Solvers (an extension of SAT) Kenneth Roe. Slide thanks to C. Barrett & S. A. Seshia, ICCAD 2009 Tutorial 2 Boolean Satisfiability (SAT) ⋁ ⋀ ¬ ⋁ ⋀
A Program Transformation For Faster Goal-Directed Search Akash Lal, Shaz Qadeer Microsoft Research.
Verification of Functional Programs in Scala Philippe Suter (joint work w/ Ali Sinan Köksal and Viktor Kuncak) ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE,
Software Engineering & Automated Deduction Willem Visser Stellenbosch University With Nikolaj Bjorner (Microsoft Research, Redmond) Natarajan Shankar (SRI.
© Anvesh Komuravelli Spacer Automatic Abstraction in SMT-Based Unbounded Software Model Checking Anvesh Komuravelli Carnegie Mellon University Joint work.
Logic as the lingua franca of software verification Ken McMillan Microsoft Research TexPoint fonts used in EMF: A A A A A Joint work with Andrey Rybalchenko.
Interpolants from Z3 proofs Ken McMillan Microsoft Research TexPoint fonts used in EMF: A A A A A.
© Anvesh Komuravelli IC3/PDR Overview of IC3/PDR Anvesh Komuravelli Carnegie Mellon University.
Proofs from Tests Nels E. Beckman Aditya V. Nori Sriram K. Rajamani Robert J. Simmons Carnegie Mellon UniversityMicrosoft Research India Carnegie Mellon.
Review of topics Final exam : -May 2nd to May 7 th - Projects due on May 7th.
SAT and Model Checking. Bounded Model Checking (BMC) A.I. Planning problems: can we reach a desired state in k steps? Verification of safety properties:
The Software Model Checker BLAST by Dirk Beyer, Thomas A. Henzinger, Ranjit Jhala and Rupak Majumdar Presented by Yunho Kim Provable Software Lab, KAIST.
Revisiting Generalizations Ken McMillan Microsoft Research Aws Albarghouthi University of Toronto.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Proof-system search ( ` ) Interpretation search ( ² ) Main search strategy DPLL Backtracking Incremental SAT Natural deduction Sequents Resolution Main.
Lazy Predicate Abstraction in BLAST John Gallagher CS4117.
Formal Verification Group © Copyright IBM Corporation 2008 IBM Haifa Labs SAT-based unbounded model checking using interpolation Based on a paper “Interpolation.
Lazy Abstraction with Interpolants Yakir Vizel (based on the work and slides of K. L. McMillan at CAV06)
Quantifier Elimination Procedures in Z3 Support for Non-linear arithmetic Fixed-points – features and a preview.
Introduction to Optimization Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved.
1 Abstraction Refinement for Bounded Model Checking Anubhav Gupta, CMU Ofer Strichman, Technion Highly Jet Lagged.
Constraint-based Invariant Inference. Invariants Dictionary Meaning: A function, quantity, or property which remains unchanged Property (in our context):
© 2015 Carnegie Mellon University Interpolating Property Directed Reachability Software Engineering Institute Carnegie Mellon University Pittsburgh, PA.
Rahul Sharma Joint work with Aditya Nori (MSR India) and Alex Aiken (Stanford)
1 Software Model Checking Andrey Rybalchenko Max Planck Institute for Software Systems Incomplete notes summarizing the 2 nd lecture, Nov 5 th, 2007.
Lazy Annotation for Program Testing and Verification Speaker: Chen-Hsuan Adonis Lin Advisor: Jie-Hong Roland Jiang November 26,
Proving Non-Termination Gupta, Henzinger, Majumdar, Rybalchenko, Ru-Gang Xu presentation by erkan.
Symbolic and Concolic Execution of Programs Information Security, CS 526 Omar Chowdhury 10/7/2015Information Security, CS 5261.
© 2015 Carnegie Mellon University Parametric Symbolic Reachability Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Arie.
CS357 Lecture 13: Symbolic model checking without BDDs Alex Aiken David Dill 1.
R-Verify: Deep Checking of Embedded Code James Ezick † Donald Nguyen † Richard Lethin † Rick Pancoast* (†) Reservoir Labs (*) Lockheed Martin The Eleventh.
Lazy Annotation for Program Testing and Verification (Supplementary Materials) Speaker: Chen-Hsuan Adonis Lin Advisor: Jie-Hong Roland Jiang December 3,
© Anvesh Komuravelli Spacer Compositional Verification of Procedural Programs using Horn Clauses over Integers and Arrays Anvesh Komuravelli work done.
Finding bugs with a constraint solver daniel jackson. mandana vaziri mit laboratory for computer science issta 2000.
© Anvesh Komuravelli Spacer Model Checking with Proofs and Counterexamples Anvesh Komuravelli Carnegie Mellon University Joint work with Arie Gurfinkel,
The software model checker BLAST Dirk Beyer, Thomas A. Henzinger, Ranjit Jhala, Rupak Majumdar Presented by Yunho Kim TexPoint fonts used in EMF. Read.
Efficient Generation of Small Interpolants in CNF (for Model Checking)
Presentation Title 2/4/2018 Software Verification using Predicate Abstraction and Iterative Refinement: Part Bug Catching: Automated Program Verification.
Introduction to Optimization
Introduction to Software Verification
Satisfiability Modulo Theories
Solving Constrained Horn Clauses by Property Directed Reachability
Interpolating Property Directed Reachability
SMT-Based Verification of Parameterized Systems
Property Directed Reachability
Parametric Symbolic Reachability
Automating Induction for Solving Horn Clauses
Introduction to Software Verification
Lifting Propositional Interpolants to the Word-Level
Automatic Software Verification with SMT
Introduction to Optimization
Inferring Simple Solutions to Recursion-free Horn Clauses via Sampling
Introduction to Formal Verification
Introduction to Optimization
Predicate Abstraction
Follow-up of MoU objectives
Rich Model Toolkit – An Infrastructure for Reliable Computer Systems
Verifying Clausal Proofs, DRUPing and Interpolants SAT/SMT Seminar
Presentation transcript:

Horn Clauses mc(x) = x-10 if x > 100 mc(x) = mc(mc(x+11)) if x  100 assert (x ≤𝟏𝟎𝟏→mc(x) = 91) ∀𝑿. 𝑿 > 𝟏𝟎𝟎  mc(𝑿,𝑿−𝟏𝟎) ∀𝑿,𝒀,𝑹. 𝑿≤ 𝟏𝟎𝟎  mc(𝑿+𝟏𝟏,𝒀)  mc(𝒀,𝑹)  mc(𝑿,𝑹) ∀𝑿,𝑹. mc(𝑿,𝑹) ∧𝑿≤𝟏𝟎𝟏→𝑹= 𝟗𝟏 Solver finds solution for mc

Horn Clauses and E+LFP Formulate as Horn clauses: Solve for mc ∀𝑿,𝒀,𝑹. 𝑿≤ 𝟏𝟎𝟎  mc(𝑿+𝟏𝟏,𝒀)  mc(𝒀,𝑹)  mc(𝑿,𝑹) ∀𝑿,𝑹. mc(𝑿,𝑹) ∧𝑿≥𝟏𝟎𝟏  𝑹= 𝟗𝟏 Solve for mc Symbolic Model: 𝒎𝒄 𝑿,𝒀 ≔𝒀≥𝟗𝟏∧ 𝒀≤𝟗𝟏∨𝒀≤𝑿−𝟏𝟎

Caught by the Interpolants Horn Clauses are Magical Yakir Vizel Yo betcha Interpolation is a special case of finding solutions to Horn Clauses Program Proof Systems = Horn Clauses Ergo: Solve Programs = Solve Horn Clauses Andrey, you just made me sink the past few years into Horn clauses Ken McMillan Andrey Rybalchenko

How to Solve It? - Z Z – portfolio of solvers for Horn Clauses in Z3. Datalog for finite domains using optimized tables, bottom-up evaluation, Magic sets. Property Directed Reachability algorithm for Horn clauses over arithmetic. Approach: maintain over-approximations 𝑅 𝑖 of properties derivable in 𝑖 steps. Strengthen approximations by solving interpolation and inductiveness formulas. [Krystof Hoder & B, SAT 2012]

How to Solve It? - HSF [Grebenshchikov, Lopes, Popeea, Rybalchenko, PLDI 2012]

How to Solve It? - Duality When query fails, build a derivation tree for the unwinding, and compute interpolants, then update the solution with the interpolants. 𝑄 1 𝑥,𝑧 ⇒𝑥≤𝑧 𝑃 0 𝑥,𝑦 :𝐹𝑎𝑙𝑠𝑒 Q 0 𝑥,𝑧 :𝐹𝑎𝑙𝑠𝑒 𝑥=𝑦⇒ 𝑃 1 (𝑥,𝑦) 𝑃 1 𝑥,𝑦 :𝑇𝑟𝑢𝑒 𝑃 1 𝑥,𝑦 ∧𝑧=𝑦+1⇒ 𝑃 2 (𝑥,𝑧) Q 1 𝑥,𝑧 :𝑇𝑟𝑢𝑒 Q 1 𝑥,𝑧 :𝑥≤𝑧 unwinding solved! P 2 𝑥,𝑦 :𝑥≤𝑦−1 solution inductive! 𝑃 𝑥,𝑦 : 𝑥=𝑦∨𝑥≤𝑦−1 P 1 𝑥,𝑦 :𝑥=𝑦 𝑄 𝑥,𝑧 : 𝑥≤𝑧 Ken McMillan 2012

How to Solve It? - SeaHorn Arie Gurfinkel

Several more Horn Clause Solvers Eldarica Kuncak, Hojjat, Ruemmer Fioravanti Jaffar Gallagher We are always recruiting

A format for Software Model Checking Collection of about 10,000 benchmarks from various sources, including device driver software, at Dirk Beyer’s software verification repository. Used as backend in SeaHorn, HSF, Duality tool chains.

Application: Network Verification Sample belief: packets flow through middle-box Engine: Network Optimized Datalog: Datalog A(src,dst, 0). R1(src,dst,n) :- A(src,dst,n), Rule1(src,dst). R2(src,dst,n) :- R1(src,dst,n), Rule2(src,dst).… R4(src,dst,1) :- M(src,dst,_), Rule4(src,dst)….. ? B(src,dst,0). Nuno Lopes, B, Patrice Godefroid, Karthick Jayaraman, George Varghese [NSDI 2015]

Programs  Horn Clauses Boogie/Duality – Weakest liberal pre-conditions HSF – Reps-Horwitz-Sagiv based transformation SeaHorn – Large block encoding with error propagation Terraces Winery, Rutherford, Napa

Boogie/Dijkstra A procedure def p(x) { .. ret := y} Rustan Leino A procedure def p(x) { .. ret := y} is a predicate 𝑝 𝑥, 𝑟𝑒𝑡 for effect, and 𝑝 𝑝𝑟𝑒 (𝑥) for pre-condition.

Transforming Horn Clauses Query-Answer transformation (Magic Sets) Inlines calling context Fold-Unfold - Complete for refutations K-induction - Variant of Unfold operation Assertion in-lining Inlines paths to assertion check All: Symbolic Models preserved modulo feasible interpolation

K-induction as reinforced unfold 𝑖𝑛𝑖𝑡 𝑣 →𝐼𝑛𝑣 𝑣 𝐼𝑛𝑣 𝑣 ∧𝑠𝑡𝑒𝑝 𝑣, 𝑣 ′ →𝐼𝑛𝑣 𝑣 ′ 𝐼𝑛𝑣 𝑣 →𝑠𝑎𝑓𝑒(𝑣) 𝑖𝑛𝑖𝑡 𝑣′ ∨(𝐼𝑛𝑣 𝑣 ∧𝑠𝑡𝑒𝑝 𝑣, 𝑣 ′ )→𝐼𝑛𝑣 𝑣 ′ 𝐼𝑛𝑣 𝑣 →𝑠𝑎𝑓𝑒(𝑣) 𝑖𝑛𝑖𝑡 𝑣′ ∨((𝑖𝑛𝑖𝑡 𝑣 0 ∨ 𝐼𝑛𝑣 𝑣 0 ∧𝑠𝑡𝑒𝑝 𝑣 0 ,𝑣 ∧𝐼𝑛𝑣 𝑣 ∧𝑠𝑡𝑒𝑝 𝑣, 𝑣 ′ )→𝐼𝑛𝑣 𝑣 ′ 𝐼𝑛𝑣 𝑣 →𝑠𝑎𝑓𝑒(𝑣) 𝑖𝑛𝑖𝑡 𝑣 →𝑠𝑎𝑓𝑒 𝑣 𝑖𝑛𝑖𝑡 𝑣 ∧𝑠𝑡𝑒𝑝 𝑣, 𝑣 ′ →𝑠𝑎𝑓𝑒 𝑣 ′ 𝑠𝑎𝑓𝑒(𝑣)∧𝑠𝑡𝑒𝑝 𝑣, 𝑣 ′ ∧𝐼𝑛𝑣 𝑣 ′ ∧𝑠𝑡𝑒𝑝( 𝑣 ′ , 𝑣 ′′ )→𝑠𝑎𝑓𝑒 𝑣 ′′ 𝑠𝑎𝑓𝑒(𝑣)→𝑠𝑎𝑓𝑒(𝑣) 𝑖𝑛𝑖𝑡 𝑣 →𝐼𝑛𝑣 𝑣 𝑖𝑛𝑖𝑡 𝑣 ∧𝑠𝑡𝑒𝑝 𝑣, 𝑣 ′ →𝐼𝑛𝑣 𝑣 ′ 𝐼𝑛𝑣 𝑣 ∧𝑠𝑡𝑒𝑝 𝑣, 𝑣 ′ ∧𝐼𝑛𝑣 𝑣 ′ ∧𝑠𝑡𝑒𝑝( 𝑣 ′ , 𝑣 ′′ )→𝐼𝑛𝑣 𝑣 ′′ 𝐼𝑛𝑣 𝑣 →𝑠𝑎𝑓𝑒(𝑣)