1
; The WyoM1 Utility Lemmas
2
; Copyright (C) 2004 J Strother Moore,
3
; University of Texas at Austin
5
; This program is free software; you can redistribute it and/or
6
; modify it under the terms of the GNU General Public License as
7
; published by the Free Software Foundation; either version 2 of
8
; the License, or (at your option) any later version.
10
; This program is distributed in the hope that it will be useful,
11
; but WITHOUT ANY WARRANTY; without even the implied warranty of
12
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
; GNU General Public License for more details.
15
; You should have received a copy of the GNU General Public
16
; License along with this program; if not, write to the Free
17
; Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
20
; Written by: J Strother Moore
21
; email: Moore@cs.utexas.edu
22
; Department of Computer Science
23
; University of Texas at Austin
24
; Austin, TX 78701 U.S.A.
26
; Modified by: John Cowles
27
; email: cowles@uwyo.edu
28
; Department of Computer Science
29
; University of Wyoming
30
; Laramie, WY 82071 U.S.A.
31
;==============================================================
32
; This file is a certified book containing some simple lemmas
33
; used to make it easier to do proofs about WyoM1 programs.
37
; To certify this book, you must first have certified your local
38
; copy of WyoM1.lisp. Then, copy this book to the same directory on
39
; which your certified copy of WyoM1.lisp resides and on which you
40
; have write permission, fire up ACL2 while connected to that
41
; directory and then execute the following two events.
43
(include-book "WyoM1")
45
(certify-book "WyoM1-utilities" 1)
47
; After certification, the book may be used in an ACL2 session or
48
; in other books, by writing the form
50
; (include-book "WyoM1-utilities")
52
; using the full path name as necessary.
55
;----------------------------------------------------------------
56
; Every ACL2 book must begin with an in-package form.
58
; The following was changed from "WyoM1" by Matt K. for ACL2 2.9.3 because
59
; package names may no longer contain lower case characters.
62
; Some Simple Utility Lemmas
64
; The standard arithmetic lemmas are brought in here.
66
(include-book "../../../../arithmetic/top")
68
; Now make stacks and states behave like abstract data types.
71
(and (equal (top (push x s)) x)
72
(equal (pop (push x s)) s)))
74
(in-theory (disable push top pop))
77
(equal (binding x (bind var val alist))
83
(and (equal (call-stack (make-state call-stack defs))
85
(equal (defs (make-state call-stack defs)) defs)
86
(equal (pc (make-state
87
(push (make-frame pc locals stack program)
91
(equal (locals (make-state
92
(push (make-frame pc locals stack program)
96
(equal (stack (make-state
97
(push (make-frame pc locals stack program)
101
(equal (program (make-state
102
(push (make-frame pc locals stack program)
107
(in-theory (disable make-state call-stack defs
108
make-frame pc locals stack program))
110
; The next block of lemmas force ACL2 to expand certain functions
111
; in certain common situations, augmenting its heuristics
112
; controlling expansion.
115
(implies (consp (next-inst s))
116
(equal (step s) (do-inst (next-inst s) s))))
118
(in-theory (disable step))
121
(and (equal (run s 0) s)
122
(implies (and (integerp n)
125
(run (step s)(+ -1 n))))))
128
(implies (and (integerp i)
132
(equal (run s (+ i j))
135
(in-theory (disable run))