Error Explanation with Distance Metrics

Slides:



Advertisements
Similar presentations
1 Decision Procedures An algorithmic point of view Equality Logic and Uninterpreted Functions.
Advertisements

Continuing Abstract Interpretation We have seen: 1.How to compile abstract syntax trees into control-flow graphs 2.Lattices, as structures that describe.
A Survey of Program Slicing Techniques A Survey of Program Slicing Techniques Sections 3.1,3.6 Swathy Shankar
Type Checking, Inference, & Elaboration CS153: Compilers Greg Morrisett.
Finding bugs: Analysis Techniques & Tools Symbolic Execution & Constraint Solving CS161 Computer Security Cho, Chia Yuan.
Delta Debugging and Model Checkers for fault localization
A System to Generate Test Data and Symbolically Execute Programs Lori A. Clarke September 1976.
An Introduction to the Model Verifier verds Wenhui Zhang September 15 th, 2010.
Programming with Constraint Solvers CS294: Program Synthesis for Everyone Ras Bodik Emina Torlak Division of Computer Science University of California,
Approximation Algorithms Chapter 14: Rounding Applied to Set Cover.
The Software Model Checker BLAST by Dirk Beyer, Thomas A. Henzinger, Ranjit Jhala and Rupak Majumdar Presented by Yunho Kim Provable Software Lab, KAIST.
Scalable Error Detection using Boolean Satisfiability 1 Yichen Xie and Alex Aiken Stanford University.
1 Predicate Abstraction of ANSI-C Programs using SAT Edmund Clarke Daniel Kroening Natalia Sharygina Karen Yorav (modified by Zaher Andraus for presentation.
Ofer Strichman, Technion 1 Decision Procedures in First Order Logic Part II – Equality Logic and Uninterpreted Functions.
Program Analysis Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
CS 267: Automated Verification Lecture 13: Bounded Model Checking Instructor: Tevfik Bultan.
SAT Solving Presented by Avi Yadgar. The SAT Problem Given a Boolean formula, look for assignment A for such that.  A is a solution for. A partial assignment.
1 Revisiting Difficult Constraints if (hash(x) == hash(y)) {... } How do we cover this code? Suppose we’re running (DART, SAGE, SMART, CUTE, SPLAT, etc.)
Formal Verification of SpecC Programs using Predicate Abstraction Himanshu Jain Daniel Kroening Edmund Clarke Carnegie Mellon University.
Ch 2.2 Objective: To solve problems involving absolute value of numbers or variables.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
Predicates and Quantifiers
Inferring Specifications to Detect Errors in Code Mana Taghdiri Presented by: Robert Seater MIT Computer Science & AI Lab.
Predicate Abstraction of ANSI-C Programs Using SAT By Edmund Clarke, Daniel Kroening, Natalia Sharygina, Karen Yorav Presented by Yunho Kim Provable Software.
Equations Reducible to Quadratic
TABLES AND VALUES Section 1.5. Open Sentence Equation.
Martin-Gay, Beginning Algebra, 5ed 22 Location of NewportD1 Location of GatlinburgC2 Location of RobbinsvilleA5.
Author: Alex Groce, Daniel Kroening, and Flavio Lerda Computer Science Department, Carnegie Mellon University Pittsburgh, PA Source: R. Alur and.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02: QUANTIFIERS Sections 1.3 and 1.4 Jarek Rossignac CS1050:
Solve the following system using the elimination method.
Planning as Satisfiability (SAT-Plan). SAT-Plan Translate the planning problem into a satisfiability problem for length n of Plan garb 0 (proposition)present.
3.1 Solving Systems Using Tables and Graphs When you have two or more related unknowns, you may be able to represent their relationship with a system of.
System To Generate Test Data: The Analysis Program Syed Nabeel.
© 2006 Carnegie Mellon University Introduction to CBMC: Part 1 Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Arie Gurfinkel,
Error Explanation with Distance Metrics Authors: Alex Groce, Sagar Chaki, Daniel Kroening, and Ofer Strichman International Journal on Software Tools for.
CHARME’03 Predicate abstraction with Minimum Predicates Sagar Chaki*, Ed Clarke*, Alex Groce*, Ofer Strichman** * Carnegie Mellon University ** Technion.
Boolean Programs: A Model and Process For Software Analysis By Thomas Ball and Sriram K. Rajamani Microsoft technical paper MSR-TR Presented by.
Section 1.4. Propositional Functions Propositional functions become propositions (and have truth values) when their variables are each replaced by a value.
© 2006 Carnegie Mellon University Introduction to CBMC: Part 1 Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Arie Gurfinkel,
Finding bugs with a constraint solver daniel jackson. mandana vaziri mit laboratory for computer science issta 2000.
Bernd Fischer RW714: SAT/SMT-Based Bounded Model Checking of Software.
TRUE FALSE QUIZCORE 3 & 4 Round 1 Round 2Round TOTAL OVERALL SCORE
Algebra 1 Section 4.2 Graph linear equation using tables The solution to an equation in two variables is a set of ordered pairs that makes it true. Is.
2( ) 8x + 14y = 4 -12x – 14y = x = x = 4 8x + 14y = 4 8(4) + 14y = y = y = -28 ___ ___ y = -2 The solution is (4, -2)
SAT for Software Model Checking Introduction to SAT-problem for newbie
Automatic Test Generation
SS 2017 Software Verification Bounded Model Checking, Outlook
Further with Hoare Logic Sections 6.12, 6.10, 6.13
Control Flow Testing Handouts
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 4 Control Flow Testing
Operators and Expressions
EQUATION IN TWO VARIABLES:
Outline of the Chapter Basic Idea Outline of Control Flow Testing
Solving Linear Arithmetic with SAT-based MC
Planning: Representation and Forward Search
Introduction to Software Verification
Princeton University Spring 2016
Planning: Representation and Forward Search
Over-Approximating Boolean Programs with Unbounded Thread Creation
Unit 3 - The while Loop - Extending the Vic class - Examples
Algorithms Take a look at the worksheet. What do we already know, and what will we have to learn in this term?
NP-Complete Problems.
Vulnerability Analysis of False Data Injection
Lecture Notes – Week 4 Chapter 5 (Loops).
The Zoo of Software Security Techniques
Variables and Equations
C. M. Overstreet Old Dominion University Fall 2005
Variables.
Planning: Representation and Forward Search
Data Structures & Programming
Presentation transcript:

Error Explanation with Distance Metrics 2006.11.2 최윤라

Contents Overview Distance Metric d Producing Explanation (s) -Slicing Experiments

Overview CBMC explain S S’ SAT solver PBS s P + spec counterexample closest successful execution S S’ SAT solver PBS finds closest successful execution as measured by distance metric finds a counterexample

Explanation with distance metrics The metric d is based on Static Single Assignment (SSA) (plus loop unrolling). CBMC model checker (bounded model checker for C programs) translates an ANSI C program into a set of equations. An execution of the program is just a solution to this set of equations.

SSA Transformation int main () { int input1#0,input2#0,input3#0; int least#0 = input1#0; int most#0 = input1#0; most#1 = input2#0; guard#1 = most#0<input2#0; most#2=guard#1?most#1:most#0; most#3 = input3#0; guard#2 = most#2<input3#0; most#4=guard#2?most#3:most#2; most#5 = input2#0; guard#3 = least#0input2#0; most#6=guard#3?most#5:most#4; least#1 = input3#0; guard#4 = least#0input3#0; least#2= guard#4?least#1:least#0; assert(least#2<=most#6); } int main () { int input1, input2, input3; int least = input1; int most = input1; if (most < input2) most = input2; if (most < input3) most = input3; if (least > input2) if (least > input3) least = input3; assert(least<=most); }

Transformation to Equations int main () { int input1#0,input2#0,input3#0; int least#0 = input1#0; int most#0 = input1#0; most#1 = input2#0; guard#1 = most#0<input2#0; most#2=guard#1?most#1:most#0; most#3 = input3#0; guard#2 = most#2<input3#0; most#4=guard#2?most#3:most#2; most#5 = input2#0; guard#3 = least#0input2#0; most#6=guard#3?most#5:most#4; least#1 = input3#0; guard#4 = least#0input3#0; least#2= guard#4?least#1:least#0; assert(least#2<=most#6); } (least#0 == input1#0  most#0 == input1#0  most#1 == input2#0  guard#1 == most#0<input2#0  most#2==guard#1?most#1:most#0 most#3 == input3#0  guard#2 == most#2<input3#0  most#4==guard#2?most#3:most#2 most#5 == input2#0  guard#3 == least#0input2#0  most#6==guard#3?most#5:most#4 least#1 == input3#0  guard#4 == least#0input3#0  least#2== guard#4?least#1:least#0  least#2<=most#6)

Negation of Claim int main () { int input1#0,input2#0,input3#0; int least#0 = input1#0; int most#0 = input1#0; most#1 = input2#0; guard#1 = most#0<input2#0; most#2=guard#1?most#1:most#0; most#3 = input3#0; guard#2 = most#2<input3#0; most#4=guard#2?most#3:most#2; most#5 = input2#0; guard#3 = least#0input2#0; most#6=guard#3?most#5:most#4; least#1 = input3#0; guard#4 = least#0input3#0; least#2= guard#4?least#1:least#0; assert(least#2<=most#6); } (least#0 == input1#0  most#0 == input1#0  most#1 == input2#0  guard#1 == most#0<input2#0  most#2==guard#1?most#1:most#0 most#3 == input3#0  guard#2 == most#2<input3#0  most#4==guard#2?most#3:most#2 most#5 == input2#0  guard#3 == least#0input2#0  most#6==guard#3?most#5:most#4 least#1 == input3#0  guard#4 == least#0input3#0  least#2== guard#4?least#1:least#0  least#2>most#6)

Execution Representation counterexample input1#0 = 1 input2#0 = 0 input3#0 = 1 least#0 = 1 most#0 = 0 \guard#1 = FALSE most#1 = 0 most#2 = 1 \guard#2 = FALSE most#3 = 1 most#4 = 1 \guard#3 = TRUE most#5 = 0 most#6 = 0 \guard#4 = FALSE \least#1 = 1 \least#2 = 1 (least#0 == input1#0  most#0 == input1#0  most#1 == input2#0  guard#1 == most#0<input2#0  most#2==guard#1?most#1:most#0 most#3 == input3#0  guard#2 == most#2<input3#0  most#4==guard#2?most#3:most#2 most#5 == input2#0  guard#3 == least#0input2#0  most#6==guard#3?most#5:most#4 least#1 == input3#0  guard#4 == least#0input3#0  least#2== guard#4?least#1:least#0  least#2>most#6)

Distance Metric d counterexample successful execution d=5 input1#0 = 1 least#0 = 1 most#0 = 1 \guard#1 = FALSE most#1 = 0 most#2 = 1 \guard#2 = FALSE most#3 = 1 most#4 = 1 \guard#3 = TRUE most#5 = 0 most#6 = 0 \guard#4 = FALSE \least#1 = 1 \least#2 = 1 input1#0 = 1 input2#0 = 1 input3#0 = 1 least#0 = 1 most#0 = 1 \guard#1 = FALSE most#1 = 1 most#2 = 1 \guard#2 = FALSE most#3 = 1 most#4 = 1 \guard#3 = FALSE most#5 = 1 most#6 = 1 \guard#4 = FALSE \least#1 = 1 \least#2 = 1 d=5

New SAT variables counterexample input1#0 = 1 least#0 = 1 most#0 = 1 \guard#1 = FALSE most#1 = 0 most#2 = 1 \guard#2 = FALSE most#3 = 1 most#4 = 1 \guard#3 = TRUE most#5 = 0 most#6 = 0 \guard#4 = FALSE \least#1 = 1 \least#2 = 1 input1#0 == (input1#0 != 1) input2#0 == (input2#0 != 0) input3#0 == (input3#0 != 1) least#0 == (least#0 != 1) most#0 == (most#0 != 1) \guard#1 == (\guard#1 != FALSE) most#1 == (most#1 == 0) most#2 == (most#2 == 1) \guard#2 == (\guard#2 != FALSE) most#3 == (most#3 != 1) most#4 == (most#4 != 1) \guard#3 == (\guard#3 != TRUE) most#5 == (most#5 != 0) most#6 == (most#6 != 0) \guard#4 == (\guard#4 != FALSE) \least#1 == (\least#1 != 1) \least#2 == (\least#2 != 1)

-Slicing irrelevant to assertion ! int main () { int input1,input2; int x=1,y=1,z=1; if (input1 > 0) { x += 5; y += 6; z += 4; } if (input2 > 0) { x += 6; y += 5; assert((x<10)||(y<10)); irrelevant to assertion ! What is the smallest subset of changes in values between two executions that result in a change in the value of the predicate?

algorithm Produce an explanation (a set of s) for a counterexample. Modify the SAT constraints replace the constraints for variables in s with (vi=valia)((vi=valib)(vi=expr)) replace the constraints for all other vars with vi=valia Find a new solution to the modified constraint system.

-Slicing for the Example partial constraints for slice.c -slicing constraints for slice.c -slice for slice.c

Experiments Scores were generally much better than other methods—when they could be applied at all. Much more consistent. Testing-based methods of Renieris and Reiss occasionally worked better Also gave useless (score 0) explanations much of the time.