1 / 15

Designing a type system for BoogiePL 2

Designing a type system for BoogiePL 2. K. Rustan M. Leino Microsoft Research, Redmond , WA. 10 Oct 2007 IFIP WG 2.3 meeting Santa Fe, NM. 10 Oct 2007 IFIP WG 2.3 meeting Santa Fe, NM. Boogie verifier architecture. C. Spec#. C. Spec# compiler. HAVOC. VerifiedC. MSIL. Translator.

gwenifer
Download Presentation

Designing a type system for BoogiePL 2

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. Designing a type system for BoogiePL 2 K. Rustan M. Leino Microsoft Research, Redmond, WA 10 Oct 2007IFIP WG 2.3 meetingSanta Fe, NM 10 Oct 2007IFIP WG 2.3 meetingSanta Fe, NM

  2. Boogie verifier architecture C Spec# C Spec# compiler HAVOC VerifiedC MSIL Translator BoogiePL Inference engine Static program verifier (Boogie) V.C. generator verification condition SMT solver (Z3) “correct” or list of errors

  3. Modeling the heap • a := o.f • o.f := a • a := Heap[o,f] • a := select(Heap, o, f) • Heap[o,f] := a • Heap := Heap[o,f := a] • Heap := store(Heap, o, f, a)

  4. Modeling records • a := r.f • r.f := a • a := r [ f ] • a := select(r, f) • r [ f ] := a • r := r [ f := a ] • r := store(r, f, a)

  5. Select-of-store axioms • (r,f,g,a  f = g  select(store(r,f,a), g) = a) • (r,f,g,a  f  g  select(store(r,f,a), g) = select(r,g))

  6. Type system for intermediate verification language • Types find errors in translation • Some types are required by some provers (e.g., SMT Lib)

  7. Type of heap • Heap: ref x Field  Value • HeapBool: ref x Field  boolHeapInt: ref x Field  int… • Heap: . ref x Field   

  8. Type of records • type Record; • type Field ; • function select: . Record x Field    • function store: . Record x Field  x   Record

  9. Type of records (abbreviations) • type R; • type F; • function select: . R x F   • function store: . R x F x   R

  10. Typed select-of-store axioms • (: type  (r: R, f: F, g: F, a:   f = g  select(store(r,f,a), g) = a)) • (: type, : type  (r: R, f: F, g: F, a:   f  g  select(store(r,f,a), g) = select(r,g))) type error

  11. Typed select-of-store axioms– type constraints • (: type  (r: R, f: F, g: F, a:   f = g  select(store(r,f,a), g) = a)) • (: type  (r: R, f: F, g: F, a:   f  g  select(store(r,f,a), g) = select(r,g))) • (: type, : type |    (r: R, f: F, g: F, a:   select(store(r,f,a), g) = select(r,g)))

  12. Typed select-of-store axioms – guarded types • (: type  (r: R, f: F, g: F, a:   f = g  select(store(r,f,a), g) = a)) • (: type, : type  (r: R, f: F, g: F, a:       f  g  select(store(r,f,a), g) = select(r,g)))

  13. Frame conditions • class C {int x; bool y;void M() modifiesthis.x, this.y; { … } • constx: Field int;const y: Field bool;procedure M(this: ref);modifies Heap;ensures(: type  (o: ref, f: Field   Heap[o,f] = old(Heap)[o,f]  (o = this  f = x)  (o = this  f = y)  … )

  14. Types and the theorem prover • How to generate verification conditions targeting a theorem prover whose input is • untyped formulas, or • multi-sorted formulas and has no direct support for • parametric polymorphism, • type constraints, • guarded types, • … ?

  15. Summary • What types to include in BoogiePL 2? • How to type equality? • How to translate into more primitive type systems? • perhaps let this drive the other issues?

More Related