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
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Doub DoubleChec leCheck Y k Your T

  • ur Theor

heorems ems

Car Carl Eastlund l Eastlund cce@ccs.neu.edu Northeastern University Boston, Massachusetts

1

slide-2
SLIDE 2

A T A Tale Of ale Of T Two Students

  • Students

2

slide-3
SLIDE 3

Happy Student

3

slide-4
SLIDE 4

Happy Student

4

slide-5
SLIDE 5

Happy Student

5

slide-6
SLIDE 6

Sad Student

6

slide-7
SLIDE 7

Sad Student

7

slide-8
SLIDE 8

Sad Student

8

slide-9
SLIDE 9

Mad Student

9

slide-10
SLIDE 10

Mad Student

10

slide-11
SLIDE 11

Mad Student

11

slide-12
SLIDE 12

Mad Student

12

slide-13
SLIDE 13

Another Happy Student

13

slide-14
SLIDE 14

Chec Check and Doub k and DoubleChec leCheck

14

slide-15
SLIDE 15

Check

(defthm sqr>=0 (implies (integerp x) (>= (sqr x) 0)))

15

slide-16
SLIDE 16

DoubleCheck

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

16

slide-17
SLIDE 17

DoubleCheck

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

17

slide-18
SLIDE 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

slide-19
SLIDE 19

DoubleCheck

(defthm sqr>=0 (implies (integerp x) (>= (sqr x) 0)))

19

slide-20
SLIDE 20

Random Generators

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

20

slide-21
SLIDE 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

slide-22
SLIDE 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

slide-23
SLIDE 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

slide-24
SLIDE 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

slide-25
SLIDE 25

Thank Y hank You.

  • u.

25