1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
|
(in-package "ACL2")
(include-book "jvm-model")
(include-book "bcv-simple-model")
(defthm g-pc-extract-sig-frame
(equal (G 'PC
(EXTRACT-SIG-FRAME frame method-table))
(g 'pc frame))
:hints (("Goal" :in-theory (enable extract-sig-frame))))
(defthm g-max-stack-extract-sig-frame
(equal (G 'max-stack
(EXTRACT-SIG-FRAME frame method-table))
(g 'max-stack frame))
:hints (("Goal" :in-theory (enable extract-sig-frame))))
(defthm g-opstack-stack-extract-sig-frame
(equal (G 'op-stack
(EXTRACT-SIG-FRAME frame method-table))
(len (g 'op-stack frame)))
:hints (("Goal" :in-theory (enable extract-sig-frame))))
(defthm g-method-table-extract-sig-frame
(equal (G 'method-table
(EXTRACT-SIG-FRAME frame method-table))
method-table)
:hints (("Goal" :in-theory (enable extract-sig-frame))))
(defthm g-method-name-extract-sig-frame
(equal (G 'method-name
(EXTRACT-SIG-FRAME frame method-table))
(g 'method-name frame))
:hints (("Goal" :in-theory (enable extract-sig-frame))))
;----------------------------------------------------------------------
(defthm integerp-implies-integper-plus-1
(implies (integerp x)
(integerp (+ 1 x))))
;----------------------------------------------------------------------
(defthm g-opstack-create-init-frame
(equal (g 'op-stack (createinitframe anymethod anylocals st))
nil))
(defthm g-max-stack-create-init-frame
(equal (g 'max-stack (createinitframe anymethod anylocals st))
(g 'max-stack (cdr (assoc-equal anymethod
(g 'method-table st))))))
(defthm g-method-name-create-init-frame
(equal (g 'method-name (createinitframe method-name anylocals st))
method-name))
;----------------------------------------------------------------------
(defthm g-method-table-popStack-n
(equal (g 'method-table (popStack-n st n))
(g 'method-table st)))
;----------------------------------------------------------------------
;; (local
;; (defthm nth-out-of-bound-is-nil-1
;; (implies (and (true-listp l)
;; (integerp x)
;; (>= x (len l)))
;; (not (nth x l)))))
;; ;; nth is a strange. if x is not a number,
;; ;; it returns (car l) ...
;; (local
;; (defthm nth-out-of-bound-is-nil-2
;; (implies (and (true-listp l)
;; (integerp x)
;; (< x 0))
;; (not (nth x l)))))
;----------------------------------------------------------------------
(defthm g-max-stack-popStack-n
(equal (g 'max-stack (car (g 'call-stack (popStack-n st n))))
(g 'max-stack (car (g 'call-stack st)))))
(defthm g-method-name-popStack-n
(equal (g 'method-name (car (g 'call-stack (popStack-n st n))))
(g 'method-name (car (g 'call-stack st)))))
(defthm g-pc-sig-frame-pop-n
(equal (G 'PC
(SIG-FRAME-POP-N n pre))
(g 'pc pre)))
(defthm g-max-stack-sig-frame-pop-n
(equal (G 'max-stack
(SIG-FRAME-POP-N n pre))
(g 'max-stack pre)))
;----------------------------------------------------------------------
(defthm g-method-table-sig-frame-pop-n
(equal (G 'METHOD-TABLE
(SIG-FRAME-POP-N n PRE))
(g 'method-table pre)))
;----------------------------------------------------------------------
(defthm g-method-name-sig-frame-pop-n
(equal (G 'METHOD-name
(SIG-FRAME-POP-N n PRE))
(g 'method-name pre)))
;----------------------------------------------------------------------
(defthm inst?-implies-not-stackmap
(implies (inst? inst)
(not (stack-map? inst))))
|