type theory
play

Type Theory Proof by reflection Marene Dimmendaal, Pleun Koldewijn - PowerPoint PPT Presentation

Type Theory Proof by reflection Marene Dimmendaal, Pleun Koldewijn Overview - What is proof by reflection? - The two main classes: - Direct computation proofs - Algebraic computation proofs - Example Direct proof - Example


  1. Type Theory Proof by reflection Marene Dimmendaal, Pleun Koldewijn

  2. Overview - What is ‘proof by reflection’? - The two main classes: - Direct computation proofs - Algebraic computation proofs - Example Direct proof - Example Algebraic proof - Summary

  3. What is proof by reflection? Statements involving computations - Automated proof development system -

  4. General presentation Coq file - Complex combinations of reasoning steps replaced by few - computation steps Two classes of problems: - Direct computation proofs Algebraic computation proofs

  5. Direct computation proofs predicate function Proof of “C t ”: Proof of ‘C t ’:

  6. Algebraic computational proofs Functions and The reflection process relies on the following theorem:

  7. Example direct computation proof Coq proof: A reasonably sized natural number is prime Proved by computing remainders In this case, C x is the mathematical statement for ‘x is prime’, i.e. there is no integer n (not equal to 1 or x) which divides x.

  8. Setting up reflection Existence of a divisor: Only smaller number need to be checked:

  9. Function for division To check presence of divisors:

  10. Primality To check primality:

  11. Function check_range Isn’t it simpler with two arguments?

  12. Duration of the functions

  13. Duration of the functions

  14. Deduced result This is our f_correct!

  15. Primality proof TTTT This proof takes a few minutes while the naïve procedure could not cope with a number this size.

  16. Example Algebraic computational proofs For set A and a binary operation *, we have that Easily use Associativity law: ( x * y ) * z = x * ( y * z ) for all x y z in A For With

  17. Example Algebraic computational proofs x x y u y t z z t u

  18. Example Algebraic computational proofs x x y u y t z z t u

  19. Data Type and functions Data Type A : Function f :

  20. Data Type and functions Data Type A : Function i :

  21. The required proofs

  22. Example Algebraic computational proofs x x y u y t z z t u

  23. Using the proof

  24. Ltac: transforming equation to binary tree

  25. Ltac: automated proof steps

  26. Ltac: automated proof steps

  27. Example Algebraic computational proofs x x y u y t z z t u

  28. Generic version For set A and a binary operation *, we have that Associativity law: ( x * y ) * z = x * ( y * z ) for all x y z in A represented as f x ( f ( f y z ) ( f t u ) )

  29. Generic version f x ( f ( f y z ) ( f t x ) ) x x y z y t z x t x

  30. Generic version - theorems Original : Generic :

  31. Generic version f x ( f ( f y z ) ( f t x ) ) x x y z y t z x t x f x ( f ( f y z ) ( f t x ) ) cons x ( cons y ( cons z ( cons t ( cons x ) ) ) )

  32. Generic version f x ( f ( f y z ) ( f t x ) ) 0 0 1 2 1 3 2 0 3 0 f x ( f ( f y z ) ( f t x ) ) cons x ( cons y ( cons z ( cons t ( cons x ) ) ) )

  33. Generic version f x ( f ( f y z ) ( f t x ) ) 0 0 1 2 1 3 2 0 3 0 f x ( f ( f y z ) ( f t x ) ) cons x ( cons y ( cons z ( cons t ( cons x ) ) ) )

  34. Generic version - theorems

  35. Generic version

  36. Generic version - with commutativity f x ( f ( f y z ) ( f t x ) ) 0 0 1 2 1 3 2 0 3 0

  37. Generic version - with commutativity f x ( f ( f y z ) ( f t x ) ) 0 0 0 1 0 2 1 1 3 2 0 3 0 2 3

Recommend


More recommend