1 / 27

Synthesis, Analysis, and Verification Lecture 03b

Synthesis, Analysis, and Verification Lecture 03b. More Hoare Logic. Building Formulas Substitutions. Lectures: Viktor Kuncak. Programs, Relations, Formulas. Forms of Hoare Triple. Transitivity Rule. Expanding Paths. Transitive Closure. More on Hoare Logic. see wiki.

juana
Download Presentation

Synthesis, Analysis, and Verification Lecture 03b

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. Synthesis, Analysis, and VerificationLecture 03b More Hoare Logic. Building Formulas Substitutions Lectures: Viktor Kuncak

  2. Programs, Relations, Formulas

  3. Forms of Hoare Triple

  4. Transitivity Rule

  5. Expanding Paths

  6. Transitive Closure

  7. More on Hoare Logic • see wiki

  8. Programs, Relations, Formulas

  9. Programs to Formulas (VCG) Three methods • compositionally compute formulas for relations • then compare them to spec • forward propagation – compute sp of pre • backward propagation – compute wp of post

  10. From Programs to Formulas(compositional way) Given • guarded program p with set of variables V, Compute • formula F • whose free variables can be x and x’ , for all x in V such that F holds iff program starting in state given by unprimed variables can end up in state given by primed variables we should already know the answer

  11. Construct formulas recursively Guarded program given by tree Leaves: x=E, assume(P) assume(P)  x=E

  12. Tree nodes (recursion) Non-deterministic choice [] Sequential composition ;

  13. Consequences assume(P); c c; assume(P)

  14. About One-Point Rules Which formula simplifications are correct? For each either • find counterexample, or • prove equivalence (how?)

  15. Definition of Formulas

  16. Definition of Substitution

  17. Semantics: Formula  Set of states

  18. formula semantics

  19. Formula(‘)  Set of Pairs of States Formulas with primed and unprimed variables

  20. Pairs of Disjoint Functions Let f1 , f2 - partial functions with disjoint domain Then (f1 , f2) can be represented with (f1 U f2) Given semantics for sets of partial functions, we also know how to give semantics for relations on such states

  21. Programs, Relations, Formulas

  22. Lemma for One-Point Rule

  23. One Point Rule Proved

  24. Programs to Formulas (VCG)

  25. Further Reading • C A R Hoare and He Jifeng. Unifying Theories of Programming. Prentice Hall, 1998 • Semantics-based Program Analysis via Symbolic Composition of Transfer Relations, PhD dissertation by Christopher Colby, 1996

More Related