doub doublechec lecheck y k your t our theor heorems ems
play

Doub DoubleChec leCheck Y k Your T our Theor heorems ems Car - PowerPoint PPT Presentation

Doub DoubleChec leCheck Y k Your T our Theor heorems ems Car Carl Eastlund l Eastlund cce@ccs.neu.edu Northeastern University Boston, Massachusetts 1 A T A Tale Of ale Of T Two Students o Students 2 Happy Student 3 Happy


  1. Doub DoubleChec leCheck Y k Your T our Theor heorems ems Car Carl Eastlund l Eastlund cce@ccs.neu.edu Northeastern University Boston, Massachusetts 1

  2. A T A Tale Of ale Of T Two Students o Students 2

  3. Happy Student 3

  4. Happy Student 4

  5. Happy Student 5

  6. Sad Student 6

  7. Sad Student 7

  8. Sad Student 8

  9. Mad Student 9

  10. Mad Student 10

  11. Mad Student 11

  12. Mad Student 12

  13. Another Happy Student 13

  14. Chec Check and Doub k and DoubleChec leCheck 14

  15. Check (defthm sqr>=0 (implies (integerp x) (>= (sqr x) 0))) 15

  16. DoubleCheck (include-book "doublecheck" :dir :teachpacks) (defproperty sqr>=0 (x) (implies (integerp x) (>= (sqr x) 0))) (generate-properties) 16

  17. DoubleCheck (include-book "doublecheck" :dir :teachpacks) (defproperty sqr>=0 (x :value (random-integer) :where (integerp x)) (>= (sqr x) 0)) (generate-properties) 17

  18. DoubleCheck (include-book "doublecheck" :dir :teachpacks) (defproperty sqr>=0 :repeat 1000 :limit 5000 (x :value (random-integer) :where (integerp x)) (>= (sqr x) 0)) (generate-properties) 18

  19. DoubleCheck (defthm sqr>=0 (implies (integerp x) (>= (sqr x) 0))) 19

  20. Random Generators (random-boolean) (random-natural) (random-char) (random-integer) (random-string) (random-rational) (random-symbol) (random-number) (random-atom) (random-data-size) (random-sexp) (random-between lo hi) (random-element-of lst) 20

  21. Random Generators (random-list-of expr [:size size]) (random-sexp-of expr [:size size]) (random-case expr [:weight weight] ...) (defrandom name (arg ...) body) 21

  22. Random Generators (random-list-of expr [:size size]) (random-sexp-of expr [:size size]) (random-case expr [:weight weight] ...) (defrandom name (arg ...) body) ; random-multiset : [Listof X] -> [Listof X] (defrandom random-multiset (elements) (random-case nil :weight 1/4 (cons (random-element-of elements) (random-multiset elements)))) 22

  23. RealityCheck • Random testing based on SchemeUnit defproperty constructs test suite & all cases generate-properties runs all suites random values pulled from lazy stream • Theorem proving macro-expands to defthm generators are vacuous, program-mode 23

  24. Other Approaches • Claessen and Hughes. QuickCheck: a lightweight tool for random testing of Haskell programs. ICFP 2000. • Runciman et al. SmallCheck and Lazy SmallCheck: automatic exhaustive testing for small values. Haskell 2008. • Berghofer and Nipkow. Random testing in Isabelle/HOL. SEFM 2004. • Spiridinov and Khurshid. Pythia: automatic generation of counterexamples for ACL2 using Alloy. ACL2 2007. • Sumners. Checking ACL2 theorems via SAT checking. ACL2 2002. 24

  25. Thank Y hank You. ou. 25

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend