A challenge problem: Toward better ACL2 proof technique Matt - - PowerPoint PPT Presentation

a challenge problem toward better acl2 proof technique
SMART_READER_LITE
LIVE PREVIEW

A challenge problem: Toward better ACL2 proof technique Matt - - PowerPoint PPT Presentation

A challenge problem: Toward better ACL2 proof technique Matt Kaufmann The University of Texas at Austin Dept. of Computer Science, GDC 7.804 ACL2 Workshop 2015 October 1, 2015 I NTRODUCTION I took a break this summer to return to my roots as


slide-1
SLIDE 1

A challenge problem: Toward better ACL2 proof technique

Matt Kaufmann The University of Texas at Austin

  • Dept. of Computer Science, GDC 7.804

ACL2 Workshop 2015 October 1, 2015

slide-2
SLIDE 2

INTRODUCTION

I took a break this summer to return to my roots as a mathematical logician, hosted by Prof. Ali Enayat of the University of Gothenburg, Sweden.

2/13

slide-3
SLIDE 3

INTRODUCTION

I took a break this summer to return to my roots as a mathematical logician, hosted by Prof. Ali Enayat of the University of Gothenburg, Sweden.

◮ Lots of fun chats!

2/13

slide-4
SLIDE 4

INTRODUCTION

I took a break this summer to return to my roots as a mathematical logician, hosted by Prof. Ali Enayat of the University of Gothenburg, Sweden.

◮ Lots of fun chats! ◮ We are co-authoring a tutorial paper on iterated ultrapowers.

2/13

slide-5
SLIDE 5

INTRODUCTION

I took a break this summer to return to my roots as a mathematical logician, hosted by Prof. Ali Enayat of the University of Gothenburg, Sweden.

◮ Lots of fun chats! ◮ We are co-authoring a tutorial paper on iterated ultrapowers. ◮ A key lemma in that paper can be abstracted to a lemma

about finite sequences, with a pretty simple hand proof.

2/13

slide-6
SLIDE 6

INTRODUCTION

I took a break this summer to return to my roots as a mathematical logician, hosted by Prof. Ali Enayat of the University of Gothenburg, Sweden.

◮ Lots of fun chats! ◮ We are co-authoring a tutorial paper on iterated ultrapowers. ◮ A key lemma in that paper can be abstracted to a lemma

about finite sequences, with a pretty simple hand proof.

◮ Why not prove the abstracted lemma in ACL2?

2/13

slide-7
SLIDE 7

INTRODUCTION

I took a break this summer to return to my roots as a mathematical logician, hosted by Prof. Ali Enayat of the University of Gothenburg, Sweden.

◮ Lots of fun chats! ◮ We are co-authoring a tutorial paper on iterated ultrapowers. ◮ A key lemma in that paper can be abstracted to a lemma

about finite sequences, with a pretty simple hand proof.

◮ Why not prove the abstracted lemma in ACL2?

Horrors! It took me about 16 hours to complete that exercise in ACL2.

2/13

slide-8
SLIDE 8

INTRODUCTION (PAGE 2)

Possible conclusions:

3/13

slide-9
SLIDE 9

INTRODUCTION (PAGE 2)

Possible conclusions:

◮ I suck at using ACL2?

3/13

slide-10
SLIDE 10

INTRODUCTION (PAGE 2)

Possible conclusions:

◮ I suck at using ACL2? ◮ ACL2 sucks?

3/13

slide-11
SLIDE 11

INTRODUCTION (PAGE 2)

Possible conclusions:

◮ I suck at using ACL2? ◮ ACL2 sucks? ◮ There are ways to use ACL2 more productively that I

didn’t use.

3/13

slide-12
SLIDE 12

INTRODUCTION (PAGE 2)

Possible conclusions:

◮ I suck at using ACL2? ◮ ACL2 sucks? ◮ There are ways to use ACL2 more productively that I

didn’t use.

◮ Structured development methodologies? 3/13

slide-13
SLIDE 13

INTRODUCTION (PAGE 2)

Possible conclusions:

◮ I suck at using ACL2? ◮ ACL2 sucks? ◮ There are ways to use ACL2 more productively that I

didn’t use.

◮ Structured development methodologies? ◮ More help from existing libraries? 3/13

slide-14
SLIDE 14

INTRODUCTION (PAGE 2)

Possible conclusions:

◮ I suck at using ACL2? ◮ ACL2 sucks? ◮ There are ways to use ACL2 more productively that I

didn’t use.

◮ Structured development methodologies? ◮ More help from existing libraries? ◮ Nicer formalization of the problem? 3/13

slide-15
SLIDE 15

INTRODUCTION (PAGE 2)

Possible conclusions:

◮ I suck at using ACL2? ◮ ACL2 sucks? ◮ There are ways to use ACL2 more productively that I

didn’t use.

◮ Structured development methodologies? ◮ More help from existing libraries? ◮ Nicer formalization of the problem? ◮ . . . 3/13

slide-16
SLIDE 16

INTRODUCTION (PAGE 3)

Goal for today: Present a challenge to construct an ACL2 proof more efficiently and to present lessons learned . . .

4/13

slide-17
SLIDE 17

INTRODUCTION (PAGE 3)

Goal for today: Present a challenge to construct an ACL2 proof more efficiently and to present lessons learned . . . perhaps in a future ACL2 Workshop.

4/13

slide-18
SLIDE 18

INTRODUCTION (PAGE 3)

Goal for today: Present a challenge to construct an ACL2 proof more efficiently and to present lessons learned . . . perhaps in a future ACL2 Workshop. In this talk I’ll point you to relevant books and I’ll also present a very informal hand proof.

4/13

slide-19
SLIDE 19

THE CHALLENGE(S)

The community book books/demos/proofs/tightness-lemma.lisp contains:

5/13

slide-20
SLIDE 20

THE CHALLENGE(S)

The community book books/demos/proofs/tightness-lemma.lisp contains:

◮ a self-contained informal proof (as a Lisp comment) using

standard mathematical notation;

5/13

slide-21
SLIDE 21

THE CHALLENGE(S)

The community book books/demos/proofs/tightness-lemma.lisp contains:

◮ a self-contained informal proof (as a Lisp comment) using

standard mathematical notation;

◮ encapsulate and defun events introducing the requisite

notions; and

5/13

slide-22
SLIDE 22

THE CHALLENGE(S)

The community book books/demos/proofs/tightness-lemma.lisp contains:

◮ a self-contained informal proof (as a Lisp comment) using

standard mathematical notation;

◮ encapsulate and defun events introducing the requisite

notions; and

◮ a statement of the final theorem.

5/13

slide-23
SLIDE 23

THE CHALLENGE(S)

The community book books/demos/proofs/tightness-lemma.lisp contains:

◮ a self-contained informal proof (as a Lisp comment) using

standard mathematical notation;

◮ encapsulate and defun events introducing the requisite

notions; and

◮ a statement of the final theorem.

I’m putting forth the following challenges.

5/13

slide-24
SLIDE 24

THE CHALLENGE(S)

The community book books/demos/proofs/tightness-lemma.lisp contains:

◮ a self-contained informal proof (as a Lisp comment) using

standard mathematical notation;

◮ encapsulate and defun events introducing the requisite

notions; and

◮ a statement of the final theorem.

I’m putting forth the following challenges.

◮ Preferred challenge: Do a better, faster job than the proof

given in community book books/demos/proofs/tightness-lemma-proof.lisp. NOTE: It’s OK to change the formalization!

5/13

slide-25
SLIDE 25

THE CHALLENGE(S)

The community book books/demos/proofs/tightness-lemma.lisp contains:

◮ a self-contained informal proof (as a Lisp comment) using

standard mathematical notation;

◮ encapsulate and defun events introducing the requisite

notions; and

◮ a statement of the final theorem.

I’m putting forth the following challenges.

◮ Preferred challenge: Do a better, faster job than the proof

given in community book books/demos/proofs/tightness-lemma-proof.lisp. NOTE: It’s OK to change the formalization!

◮ Alternate challenge: “Reverse engineer” that proof into

  • ne that shows how to complete such proofs more

efficiently.

5/13

slide-26
SLIDE 26

VERY INFORMAL THEOREM STATEMENT

I’ll be sloppy here and using pictures, just to give the idea. A more careful hand proof is in the aforementioned tightness-lemma.lisp book.

6/13

slide-27
SLIDE 27

VERY INFORMAL THEOREM STATEMENT

I’ll be sloppy here and using pictures, just to give the idea. A more careful hand proof is in the aforementioned tightness-lemma.lisp book. Assume that we have:

◮ a set I and strict total ordering ≺ on I; ◮ functions f(s) and g(s), on ≺-increasing sequences from I

  • f length nf and ng, respectively; and

◮ a unary predicate P.

6/13

slide-28
SLIDE 28

VERY INFORMAL THEOREM STATEMENT

I’ll be sloppy here and using pictures, just to give the idea. A more careful hand proof is in the aforementioned tightness-lemma.lisp book. Assume that we have:

◮ a set I and strict total ordering ≺ on I; ◮ functions f(s) and g(s), on ≺-increasing sequences from I

  • f length nf and ng, respectively; and

◮ a unary predicate P.

The next slide illustrates the remaining assumptions for nf = 4 and ng = 3.

6/13

slide-29
SLIDE 29

VERY INFORMAL THEOREM STATEMENT (2)

7/13

slide-30
SLIDE 30

VERY INFORMAL THEOREM STATEMENT (2)

ASSUMPTIONS

7/13

slide-31
SLIDE 31

VERY INFORMAL THEOREM STATEMENT (2)

ASSUMPTIONS (d) If f(s1) = f(s2) and all of s1 precedes all of s2, then P(f(s1)): (s1) a a a a (s2) b b b b

7/13

slide-32
SLIDE 32

VERY INFORMAL THEOREM STATEMENT (2)

ASSUMPTIONS (d) If f(s1) = f(s2) and all of s1 precedes all of s2, then P(f(s1)): (s1) a a a a (s2) b b b b (e) For disjoint sequences s1 and s2, the truth of the equation f(s1) = g(s2) depends only on how s1 and s2 are interleaved. (s1) x x x x (s2) y y y

7/13

slide-33
SLIDE 33

VERY INFORMAL THEOREM STATEMENT (2)

ASSUMPTIONS (d) If f(s1) = f(s2) and all of s1 precedes all of s2, then P(f(s1)): (s1) a a a a (s2) b b b b (e) For disjoint sequences s1 and s2, the truth of the equation f(s1) = g(s2) depends only on how s1 and s2 are interleaved. (s1) x x x x (s2) y y y (g) For two specific disjoint sequences sf and sg, f(sf) = g(sg).

7/13

slide-34
SLIDE 34

VERY INFORMAL THEOREM STATEMENT (2)

ASSUMPTIONS (d) If f(s1) = f(s2) and all of s1 precedes all of s2, then P(f(s1)): (s1) a a a a (s2) b b b b (e) For disjoint sequences s1 and s2, the truth of the equation f(s1) = g(s2) depends only on how s1 and s2 are interleaved. (s1) x x x x (s2) y y y (g) For two specific disjoint sequences sf and sg, f(sf) = g(sg). CONCLUSION: P(f(sf)).

7/13

slide-35
SLIDE 35

VERY INFORMAL PROOF SKETCH

(d) If f(s1) = f(s2) and all of s1 precedes all of s2, then P(f(s1)): (s1) a a a a (s2) b b b b (e) For disjoint sequences s1 and s2, the truth of the equation f(s1) = g(s2) depends only on how s1 and s2 are interleaved. (s1) x x x x (s2) y y y (g) For two specific disjoint sequences sf and sg, f(sf) = g(sg).

8/13

slide-36
SLIDE 36

VERY INFORMAL PROOF SKETCH

(d) If f(s1) = f(s2) and all of s1 precedes all of s2, then P(f(s1)): (s1) a a a a (s2) b b b b (e) For disjoint sequences s1 and s2, the truth of the equation f(s1) = g(s2) depends only on how s1 and s2 are interleaved. (s1) x x x x (s2) y y y (g) For two specific disjoint sequences sf and sg, f(sf) = g(sg). Plan: We will see how to derive P(f(sf)) from (g) by applying (e) repeatedly and then (d).

8/13

slide-37
SLIDE 37

VERY INFORMAL PROOF SKETCH

(d) If f(s1) = f(s2) and all of s1 precedes all of s2, then P(f(s1)): (s1) a a a a (s2) b b b b (e) For disjoint sequences s1 and s2, the truth of the equation f(s1) = g(s2) depends only on how s1 and s2 are interleaved. (s1) x x x x (s2) y y y (g) For two specific disjoint sequences sf and sg, f(sf) = g(sg). Plan: We will see how to derive P(f(sf)) from (g) by applying (e) repeatedly and then (d). x x y y x y x

8/13

slide-38
SLIDE 38

We wish to show P(f(sf)).

9/13

slide-39
SLIDE 39

We wish to show P(f(sf)). Below, all f(sf) and g(sg) equal the first f(sf) and g(sg):

9/13

slide-40
SLIDE 40

We wish to show P(f(sf)). Below, all f(sf) and g(sg) equal the first f(sf) and g(sg): x x y y x y x

9/13

slide-41
SLIDE 41

We wish to show P(f(sf)). Below, all f(sf) and g(sg) equal the first f(sf) and g(sg): x x y y x y x x x y y x y x

9/13

slide-42
SLIDE 42

We wish to show P(f(sf)). Below, all f(sf) and g(sg) equal the first f(sf) and g(sg): x x y y x y x x x y y x y x x x y y x y x

9/13

slide-43
SLIDE 43

We wish to show P(f(sf)). Below, all f(sf) and g(sg) equal the first f(sf) and g(sg): x x y y x y x x x y y x y x x x y y x y x x x y y x y x

9/13

slide-44
SLIDE 44

We wish to show P(f(sf)). Below, all f(sf) and g(sg) equal the first f(sf) and g(sg): x x y y x y x x x y y x y x x x y y x y x x x y y x y x x x y y x y x

9/13

slide-45
SLIDE 45

We wish to show P(f(sf)). Below, all f(sf) and g(sg) equal the first f(sf) and g(sg): x x y y x y x x x y y x y x x x y y x y x x x y y x y x x x y y x y x x x y y x y x

9/13

slide-46
SLIDE 46

We wish to show P(f(sf)). Below, all f(sf) and g(sg) equal the first f(sf) and g(sg): x x y y x y x x x y y x y x x x y y x y x x x y y x y x x x y y x y x x x y y x y x x x y y x y x

9/13

slide-47
SLIDE 47

We wish to show P(f(sf)). Below, all f(sf) and g(sg) equal the first f(sf) and g(sg): x x y y x y x x x y y x y x x x y y x y x x x y y x y x x x y y x y x x x y y x y x x x y y x y x x x y y x y x

9/13

slide-48
SLIDE 48

We wish to show P(f(sf)). Below, all f(sf) and g(sg) equal the first f(sf) and g(sg): x x y y x y x x x y y x y x x x y y x y x x x y y x y x x x y y x y x x x y y x y x x x y y x y x x x y y x y x Now let’s erase all but the first and last lines. . .

9/13

slide-49
SLIDE 49

x x y y x y x x x y y x y x

10/13

slide-50
SLIDE 50

x x y y x y x x x y y x y x Now let’s erase each y. . .

10/13

slide-51
SLIDE 51

x x x x x x x x

11/13

slide-52
SLIDE 52

So, we have the same value of f(sf) for the first and final sf: x x x x x x x x

12/13

slide-53
SLIDE 53

So, we have the same value of f(sf) for the first and final sf: x x x x x x x x But recall: (d) If f(s1) = f(s2) and all of s1 precedes all of s2, then P(f(s1)): (s1) a a a a (s2) b b b b

12/13

slide-54
SLIDE 54

So, we have the same value of f(sf) for the first and final sf: x x x x x x x x But recall: (d) If f(s1) = f(s2) and all of s1 precedes all of s2, then P(f(s1)): (s1) a a a a (s2) b b b b So P(f(sf)), as was to be shown!

12/13

slide-55
SLIDE 55

CONCLUSION

For a more complete informal proof, see community book books/demos/proofs/tightness-lemma.lisp.

13/13

slide-56
SLIDE 56

CONCLUSION

For a more complete informal proof, see community book books/demos/proofs/tightness-lemma.lisp. (E.g.: The ordered set I must have “room” to move to the right.)

13/13

slide-57
SLIDE 57

CONCLUSION

For a more complete informal proof, see community book books/demos/proofs/tightness-lemma.lisp. (E.g.: The ordered set I must have “room” to move to the right.) I probably did do a few good things:

13/13

slide-58
SLIDE 58

CONCLUSION

For a more complete informal proof, see community book books/demos/proofs/tightness-lemma.lisp. (E.g.: The ordered set I must have “room” to move to the right.) I probably did do a few good things:

◮ I left comments describing the next main goal.

13/13

slide-59
SLIDE 59

CONCLUSION

For a more complete informal proof, see community book books/demos/proofs/tightness-lemma.lisp. (E.g.: The ordered set I must have “room” to move to the right.) I probably did do a few good things:

◮ I left comments describing the next main goal. ◮ I introduced a predicate for the inductive theorem I was

trying to prove.

13/13

slide-60
SLIDE 60

CONCLUSION

For a more complete informal proof, see community book books/demos/proofs/tightness-lemma.lisp. (E.g.: The ordered set I must have “room” to move to the right.) I probably did do a few good things:

◮ I left comments describing the next main goal. ◮ I introduced a predicate for the inductive theorem I was

trying to prove.

◮ I put the proof in a separate book and used

SET-ENFORCE-REDUNDANCY, to keep the problem statement clean.

13/13

slide-61
SLIDE 61

CONCLUSION

For a more complete informal proof, see community book books/demos/proofs/tightness-lemma.lisp. (E.g.: The ordered set I must have “room” to move to the right.) I probably did do a few good things:

◮ I left comments describing the next main goal. ◮ I introduced a predicate for the inductive theorem I was

trying to prove.

◮ I put the proof in a separate book and used

SET-ENFORCE-REDUNDANCY, to keep the problem statement clean. BUT DID IT REALLY NEED TO TAKE 16 HOURS?

13/13