1 / 10

Refuting Untrue Verification Conditions

Refuting Untrue Verification Conditions. Diego S. Zaccai - The Ohio State University. Introduction. Most of the focus has been on proving VCs we assume to be right. Most programmers will make mistakes Our current tools time out most of the time when faced with a VC that is not true . True.

kert
Télécharger la présentation

Refuting Untrue Verification Conditions

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Refuting Untrue Verification Conditions Diego S. Zaccai - The Ohio State University

  2. Introduction • Most of the focus has been on proving VCs we assume to be right. • Most programmers will make mistakes • Our current tools time out most of the time when faced with a VC that is not true True False Provable Refutable

  3. An Example procedureMultiply (updates n: Natural, restores m: Natural) decreasesm variablezero: Natural ifAreEqual (m, zero) then Clear (n) else variableone: Natural Increment (one) ifIsGreater (m, one) then variablenCopy: Natural nCopy:= Replica (n) Decrement (m) Multiply (n, m) // Increment (m) Add (n, nCopy) endif endif endMultiply

  4. An Example (Cont.)

  5. A Sample Untrue VC Verification Condition #5 (state index: 14, parameter mode) ⌚ Prove m0– 1 = m0 Given • 0 ≤ n0 • 0 ≤ m0 • 0 ≤ 0 • 0 ≤ 0 + 1 • 0 ≤ m0 – 1 • 0 ≤ n0 × (m0 – 1) • 0 ≤ n0 × (m0 – 1) + n0 • 0 + 1 < m0 • m0 ≠ 0

  6. Why don’t we disprove them? • Implicit Universal Quantification • Every variable in the VC can take every possible value • This is important when trying to disprove them • We only need a counter example! • Prove: m0 – 1 = m0 • Not necessarily untrue, there might be a contradiction • Can we assign some values to m0 and so n0 that the VC becomes false?

  7. Small Scope Hypothesis • A high proportion of the bugs in code can be found by testing the program for all “small” inputs • Easy enough for Integers and Naturals • Start with zero and “count” up in each variable • Not so obvious for more complex types • Text: Create predefined Strings • Sets: The elements inside are usually not part of the VC • ArrayOfIntegerAsStringFacility? • We do have the model in the VC…

  8. Improving the Search of States • Take into account simple enough givens • 0 ≤ n0 • 0 ≤ m0 • No all of them will be useful • 0 ≤ n0 × (m0 – 1) + n0 • Too complex to create a useful relation between the variables • Cannot replace the original test cases • Just improve on them by refining the state spaces we are interested in

  9. Conclusion • We could take small steps towards providing negative answers • Huge step in terms of usability • Could be able to find counter examples • Is it finally the end of debugging as we know it? • Could potentially end up with yet another tool timing out…

  10. Thank You • Questions? • Comments?

More Related