lect10b.pdf
lect10b.pdf
lect10b.pdf
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Bounded Model Checking<br />
void f(...) {<br />
...<br />
while(cond) {<br />
Body;<br />
}<br />
Rest;<br />
}<br />
Comp 3153 Ansgar Fehnker<br />
Bounded Model Checking<br />
void f(...) {<br />
...<br />
if(cond) {<br />
Body;<br />
if(cond) {<br />
Body;<br />
while(cond) {<br />
Body;<br />
}<br />
}<br />
}<br />
Rest;<br />
}<br />
Comp 3153 Ansgar Fehnker<br />
Bounded Model Checking<br />
void f(...) {<br />
...<br />
if(cond) {<br />
Body;<br />
if(cond) {<br />
Body;<br />
if(cond) {<br />
Body;<br />
if(cond) {<br />
assert(FALSE);<br />
}<br />
}<br />
}<br />
}<br />
Rest;<br />
}<br />
Comp 3153 Ansgar Fehnker<br />
Rather than checking infinite<br />
loops, check finite unwinding<br />
� Unwind while() loops<br />
Rather than checking infinite<br />
loops, check finite unwinding<br />
� Unwind while() loops<br />
Rather than checking infinite<br />
loops, check finite unwinding<br />
� Unwind while() loops<br />
� Until the bound k is<br />
reached<br />
� Add assertion after last<br />
iteration.<br />
Check whether error is<br />
real or due to<br />
insufficient bound k.<br />
Bounded Model Checking<br />
void f(...) {<br />
...<br />
if(cond) {<br />
Body;<br />
while(cond) {<br />
Body;<br />
}<br />
}<br />
Rest;<br />
}<br />
void f(...) {<br />
...<br />
if(cond) {<br />
Body;<br />
if(cond) {<br />
Body;<br />
if(cond) {<br />
Body;<br />
while(cond) {<br />
Body;<br />
}<br />
}<br />
}<br />
}<br />
Rest;<br />
}<br />
Comp 3153 Ansgar Fehnker<br />
Bounded Model Checking<br />
Comp 3153 Ansgar Fehnker<br />
Rather than checking infinite<br />
loops, check finite unwinding<br />
� Unwind while() loops<br />
Rather than checking infinite<br />
loops, check finite unwinding<br />
� Unwind while() loops<br />
� Until the bound k is<br />
reached<br />
Bounded Model Checking<br />
Basic Idea<br />
� Show absence of counterexamples of length k<br />
� Translate model checking problem to SAT problem<br />
� Use SAT solver to show absence of counterexamples.<br />
� Complete for sufficiently large k<br />
Comp 3153 Ansgar Fehnker<br />
Based on<br />
presentations Daniel<br />
Kroening and Ofer<br />
Shtrichman<br />
2