CS 4160 Formal Verification Prof. Clarkson Spring 2019 Approaches - - PowerPoint PPT Presentation

cs 4160
SMART_READER_LITE
LIVE PREVIEW

CS 4160 Formal Verification Prof. Clarkson Spring 2019 Approaches - - PowerPoint PPT Presentation

CS 4160 Formal Verification Prof. Clarkson Spring 2019 Approaches to validation Social Less formal: Techniques may Code reviews miss problems in programs Extreme/Pair programming Methodological Design patterns


slide-1
SLIDE 1

CS 4160

Formal Verification

  • Prof. Clarkson

Spring 2019

slide-2
SLIDE 2
slide-3
SLIDE 3

Approaches to validation

  • Social
– Code reviews – Extreme/Pair programming
  • Methodological
– Design patterns – Test-driven development – Version control – Bug tracking
  • Technological
– Static analysis (“lint” tools, FindBugs, …) – Fuzzers
  • Mathematical
– Sound type systems – “Formal” verification

More formal: eliminate with certainty as many problems as possible. Less formal: Techniques may miss problems in programs All of these methods should be used! Even the most formal can still have holes:

  • did you prove the right thing?
  • do your assumptions match reality?
slide-4
SLIDE 4

Verification

  • In the 1970s, scaled to about tens of LOC
  • Now, research projects scale to real software:

– CompCert: verified C compiler – seL4: verified microkernel OS – Ynot: verified DBMS, web services

  • In another 40 years?
slide-5
SLIDE 5

Automated theorem provers

theorem proof counter- example timeout prover

slide-6
SLIDE 6

Automated theorem provers

  • Z3

Z3: Microsoft started shipping with device driver developer's kit in Windows 7

  • AC

ACL2: used to verify AMD chip compliance with IEEE floating-point specification, as well as parts

  • f the Java virtual machine
slide-7
SLIDE 7

Proof assistant

theorem proof assistant human guidance

slide-8
SLIDE 8

Proof assistants

  • Nu

NuPRL [Prof. Constable]: Formalization of mathematics, distributed protocols, security

  • Co

Coq: CompCert, Ynot [Dean Morrisett]

slide-9
SLIDE 9

COQ

slide-10
SLIDE 10

Coq

  • 1984:

1984: Coquand and Huet implement Coq based

  • n calculus of inductive constructions
  • 1992:

1992: Coq ported to Caml

  • Now implemented in OCaml
Thierry Coquand 1961 –
slide-11
SLIDE 11

Coq for program verification

Coq program Coq theorem

guidance with tactics

Proof of theorem Verified OCaml program

slide-12
SLIDE 12

Coq's full system

slide-13
SLIDE 13

Subset of Coq we'll use

slide-14
SLIDE 14
slide-15
SLIDE 15

LOGISTICS

slide-16
SLIDE 16
  • Prof. Michael Clarkson
  • PhD 2010 Cornell University
  • BS (CS) & BM (piano) 1999 Miami University
  • Regularly teach: CS 3110 (OCaml), CS 5430 (security)
  • AMA: D&D, wine, Gregorian chant
  • I like hats
46
  • XI. —
For Sundays throughout the Year.
  • XI. — For Sundays throughout the Year.
(Orbis factor) hr M=^
  • V. . . .--
(x) XIV-XVI. c. Y-ri- e * e- le- i-son. iij. Chrfste

b:

'* .
  • e-
le"-i-son.///. Ky'-ri-e e- le-i-son. */. Jtl*. V ri-e e- le- t-son. Another Chant (X ad libitum), p. 85. 2 .
  • x. c.

G

___ J . 1

z

r

  • i
  • L6-ri- a in excelsis De- o. Et in tdrra pax ho-
  • C P,
i-ftr 1 mf-ni-bus bonae volunta- tis. Laudamus te. Benedi- cimus
  • • ?
' - I n
  • **•;
te. Ado-ramus te. Glo-ri-ficamus te. Gra-ti-as agi-
  • p ,- •
  • :=3
mus j _
  • r %
tf-bi propter
  • "
  • 1
magnam i
  • glo-ri- am
  • • ]
tu- 1
  • am. D6mi-ne
1 •_ S i J r 1
  • us, Rex caelestis, D^-us Pater omni-potens. D6mi-ne
A . . d Ff-li unig^ni-te, J^-su Chrf-ste. D6mi-ne Dd-us,
slide-17
SLIDE 17

Course website

https://www.cs.cornell.edu/courses/cs4160/2019sp/

slide-18
SLIDE 18

Acknowledgment

CS 4160 is based on the online textbook Software Foundations and especially on the work of Prof. Benjamin C. Pierce at the University of Pennsylvania and Prof. Andrew Appel at Princeton University in courses they teach.