locales
play

locales 1 C ONTENT Intro & motivation, getting started with - PowerPoint PPT Presentation

NICTA Advanced Course Theorem Proving Principles, Techniques, Applications locales 1 C ONTENT Intro & motivation, getting started with Isabelle Foundations & Principles Lambda Calculus Higher Order Logic, natural


  1. NICTA Advanced Course Theorem Proving Principles, Techniques, Applications locales 1

  2. C ONTENT ➜ Intro & motivation, getting started with Isabelle ➜ Foundations & Principles • Lambda Calculus • Higher Order Logic, natural deduction • Term rewriting ➜ Proof & Specification Techniques • Inductively defined sets, rule induction • Datatypes, recursion, induction • More recursion, Calculational reasoning • Hoare logic, proofs about programs • Locales, Presentation C ONTENT 2

  3. L AST T IME ➜ Syntax and semantics of IMP ➜ Hoare logic rules ➜ Soundness of Hoare logic ➜ Verification conditions ➜ Example program proofs L AST T IME 3

  4. I SAR I S B ASED O N C ONTEXTS theorem � x. A = ⇒ C proof - fix x assume Ass : A . . . from Ass show C . . . qed I SAR I S B ASED O N C ONTEXTS 4

  5. I SAR I S B ASED O N C ONTEXTS theorem � x. A = ⇒ C proof - fix x assume Ass : A . . . x and Ass are visible from Ass show C . . . inside this context qed I SAR I S B ASED O N C ONTEXTS 4- A

  6. B EYOND I SAR C ONTEXTS Locales are extended contexts B EYOND I SAR C ONTEXTS 5

  7. B EYOND I SAR C ONTEXTS Locales are extended contexts ➜ Locales are named B EYOND I SAR C ONTEXTS 5- A

  8. B EYOND I SAR C ONTEXTS Locales are extended contexts ➜ Locales are named ➜ Fixed variables may have syntax B EYOND I SAR C ONTEXTS 5- B

  9. B EYOND I SAR C ONTEXTS Locales are extended contexts ➜ Locales are named ➜ Fixed variables may have syntax ➜ It is possible to add and export theorems B EYOND I SAR C ONTEXTS 5- C

  10. B EYOND I SAR C ONTEXTS Locales are extended contexts ➜ Locales are named ➜ Fixed variables may have syntax ➜ It is possible to add and export theorems ➜ Locale expression: combine and modify locales B EYOND I SAR C ONTEXTS 5- D

  11. C ONTEXT E LEMENTS Locales consist of context elements . C ONTEXT E LEMENTS 6

  12. C ONTEXT E LEMENTS Locales consist of context elements . fixes Parameter, with syntax C ONTEXT E LEMENTS 6- A

  13. C ONTEXT E LEMENTS Locales consist of context elements . fixes Parameter, with syntax assumes Assumption C ONTEXT E LEMENTS 6- B

  14. C ONTEXT E LEMENTS Locales consist of context elements . fixes Parameter, with syntax assumes Assumption defines Definition C ONTEXT E LEMENTS 6- C

  15. C ONTEXT E LEMENTS Locales consist of context elements . fixes Parameter, with syntax assumes Assumption defines Definition notes Record a theorem C ONTEXT E LEMENTS 6- D

  16. C ONTEXT E LEMENTS Locales consist of context elements . fixes Parameter, with syntax assumes Assumption defines Definition notes Record a theorem includes Import other locales (locale expressions) C ONTEXT E LEMENTS 6- E

  17. D ECLARING L OCALES Declaring locale (named context) loc : locale loc = D ECLARING L OCALES 7

  18. D ECLARING L OCALES Declaring locale (named context) loc : locale loc = loc 1 + Import D ECLARING L OCALES 7- A

  19. D ECLARING L OCALES Declaring locale (named context) loc : locale loc = loc 1 + Import fixes . . . Context elements assumes . . . D ECLARING L OCALES 7- B

  20. D ECLARING L OCALES Theorems may be stated relative to a named locale. lemma ( in loc ) P [simp]: proposition proof D ECLARING L OCALES 8

  21. D ECLARING L OCALES Theorems may be stated relative to a named locale. lemma ( in loc ) P [simp]: proposition proof ➜ Adds theorem P to context loc . D ECLARING L OCALES 8- A

  22. D ECLARING L OCALES Theorems may be stated relative to a named locale. lemma ( in loc ) P [simp]: proposition proof ➜ Adds theorem P to context loc . ➜ Theorem P is in the simpset in context loc . D ECLARING L OCALES 8- B

  23. D ECLARING L OCALES Theorems may be stated relative to a named locale. lemma ( in loc ) P [simp]: proposition proof ➜ Adds theorem P to context loc . ➜ Theorem P is in the simpset in context loc . ➜ Exported theorem loc.P visible in the entire theory. D ECLARING L OCALES 8- C

  24. D EMO : L OCALES 1 9

  25. P ARAMETERS M UST B E C ONSISTENT ! ➜ Parameters in fixes are distinct. P ARAMETERS M UST B E C ONSISTENT ! 10

  26. P ARAMETERS M UST B E C ONSISTENT ! ➜ Parameters in fixes are distinct. ➜ Free variables in assumes and defines occur in preceding fixes . P ARAMETERS M UST B E C ONSISTENT ! 10- A

  27. P ARAMETERS M UST B E C ONSISTENT ! ➜ Parameters in fixes are distinct. ➜ Free variables in assumes and defines occur in preceding fixes . ➜ Defined parameters cannot occur in preceding assumes nor defines . P ARAMETERS M UST B E C ONSISTENT ! 10- B

  28. L OCALE E XPRESSIONS Locale name: n L OCALE E XPRESSIONS 11

  29. L OCALE E XPRESSIONS Locale name: n Rename: e q 1 . . . q n Change names of parameters in e . L OCALE E XPRESSIONS 11- A

  30. L OCALE E XPRESSIONS Locale name: n Rename: e q 1 . . . q n Change names of parameters in e . Merge: e 1 + e 2 Context elements of e 1 , then e 2 . L OCALE E XPRESSIONS 11- B

  31. L OCALE E XPRESSIONS Locale name: n Rename: e q 1 . . . q n Change names of parameters in e . Merge: e 1 + e 2 Context elements of e 1 , then e 2 . ➜ Syntax is lost after rename ( currently ). L OCALE E XPRESSIONS 11- C

  32. D EMO : L OCALES 2 12

  33. N ORMAL F ORM OF L OCALE E XPRESSIONS Locale expressions are converted to flattened lists of locale names. N ORMAL F ORM OF L OCALE E XPRESSIONS 13

  34. N ORMAL F ORM OF L OCALE E XPRESSIONS Locale expressions are converted to flattened lists of locale names. ➜ With full parameter lists N ORMAL F ORM OF L OCALE E XPRESSIONS 13- A

  35. N ORMAL F ORM OF L OCALE E XPRESSIONS Locale expressions are converted to flattened lists of locale names. ➜ With full parameter lists ➜ Duplicates removed N ORMAL F ORM OF L OCALE E XPRESSIONS 13- B

  36. N ORMAL F ORM OF L OCALE E XPRESSIONS Locale expressions are converted to flattened lists of locale names. ➜ With full parameter lists ➜ Duplicates removed Allows for multiple inheritance ! N ORMAL F ORM OF L OCALE E XPRESSIONS 13- C

  37. I NSTANTIATION Move from abstract to concrete . I NSTANTIATION 14

  38. I NSTANTIATION Move from abstract to concrete . instantiate label : loc I NSTANTIATION 14- A

  39. I NSTANTIATION Move from abstract to concrete . instantiate label : loc ➜ From chained fact loc t 1 . . . t n instantiate locale loc . I NSTANTIATION 14- B

  40. I NSTANTIATION Move from abstract to concrete . instantiate label : loc ➜ From chained fact loc t 1 . . . t n instantiate locale loc . ➜ Imports all theorems of loc into current context. I NSTANTIATION 14- C

  41. I NSTANTIATION Move from abstract to concrete . instantiate label : loc ➜ From chained fact loc t 1 . . . t n instantiate locale loc . ➜ Imports all theorems of loc into current context. • Instantiates the parameters with t 1 . . . t n . • Interprets attributes of theorems. • Prefixes theorem names with label I NSTANTIATION 14- D

  42. I NSTANTIATION Move from abstract to concrete . instantiate label : loc ➜ From chained fact loc t 1 . . . t n instantiate locale loc . ➜ Imports all theorems of loc into current context. • Instantiates the parameters with t 1 . . . t n . • Interprets attributes of theorems. • Prefixes theorem names with label ➜ Currently only works inside Isar contexts. I NSTANTIATION 14- E

  43. D EMO : L OCALES 3 15

  44. P RESENTATION 16

  45. I SABELLE ’ S B ATCH M ODE ➜ used to process and check larger number of theories I SABELLE ’ S B ATCH M ODE 17

  46. I SABELLE ’ S B ATCH M ODE ➜ used to process and check larger number of theories ➜ no interactive niceties (no sorry, no quick and dirty) I SABELLE ’ S B ATCH M ODE 17- A

  47. I SABELLE ’ S B ATCH M ODE ➜ used to process and check larger number of theories ➜ no interactive niceties (no sorry, no quick and dirty) ➜ controlled by file ROOT.ML and script set isatool I SABELLE ’ S B ATCH M ODE 17- B

  48. I SABELLE ’ S B ATCH M ODE ➜ used to process and check larger number of theories ➜ no interactive niceties (no sorry, no quick and dirty) ➜ controlled by file ROOT.ML and script set isatool ➜ can save state for later use (images) I SABELLE ’ S B ATCH M ODE 17- C

  49. I SABELLE ’ S B ATCH M ODE ➜ used to process and check larger number of theories ➜ no interactive niceties (no sorry, no quick and dirty) ➜ controlled by file ROOT.ML and script set isatool ➜ can save state for later use (images) ➜ can generate HTML and L A T EX documentation I SABELLE ’ S B ATCH M ODE 17- D

  50. I SATOOL isatool <tool> <options> I SATOOL 18

  51. I SATOOL isatool <tool> <options> Get help with: shows available tools isatool shows options for <tool> isatool <tool> -? I SATOOL 18- A

  52. I SATOOL isatool <tool> <options> Get help with: shows available tools isatool shows options for <tool> isatool <tool> -? Interesting tools: create session directory isatool mkdir run make for directory/all logics make/makeall batch session usedir (documents, HTML, session graph) run L A T EX for generated sources document/latex I SATOOL 18- B

  53. G ENERATING L A TEX FROM I SABELLE <..>/isatool usedir -d pdf HOL <session> <..>/<session>/ROOT.ML <..>/<session>/MyTheory.thy <..>/<session>/document/root.tex G ENERATING L A TEX FROM I SABELLE 19

Recommend


More recommend