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 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
|
(in-package "ACL2")
(include-book "djvm-model")
(include-book "bcv-simple-model")
(include-book "generic")
(include-book "consistent-state-properties")
(include-book "bcv-method-properties")
;--- EXPORT ----
(encapsulate ()
(local (include-book "djvm-IFEQ"))
(defthm consistent-state-preserved-by-DJVM-IFEQ
(implies (and (consistent-state st)
(equal (next-inst st) inst)
(equal (op-code inst) 'IFEQ)
(djvm-check-IFEQ inst st))
(consistent-state
(djvm-execute-IFEQ inst st)))))
;;(i-am-here) ;; Mon Nov 21 10:57:11 2005
(defthm bcv-simple-inst-implies-next-pc-bounded-IFEQ
(implies (and (bcv-simple-inst pc inst sig-vector)
(equal (g 'pc (cdr (assoc-equal pc sig-vector))) pc)
(equal (op-code inst) 'IFEQ))
(assoc-equal (+ 1 pc) sig-vector)))
(defthm bcv-simple-inst-implies-next-pc-bounded-IFEQ-2
(implies (and (bcv-simple-inst pc inst sig-vector)
(equal (op-code inst) 'IFEQ))
(assoc-equal (cadr inst) sig-vector)))
(local (in-theory (disable collect-witness-bcv-method)))
(defthm bcv-simple-inst-implies-next-pc-bounded-IFEQ-specific
(implies (and (bcv-simple-inst pc (next-inst st)
(collect-witness-bcv-method
(current-method st)
(g 'method-table st)))
(equal (g 'pc (cdr (assoc-equal pc
(collect-witness-bcv-method
(current-method st)
(g 'method-table st)))))
pc)
(equal (op-code (next-inst st)) 'IFEQ))
(assoc-equal (+ 1 pc) (collect-witness-bcv-method
(current-method st)
(g 'method-table st)))))
(defthm bcv-simple-inst-implies-next-pc-bounded-IFEQ-specific-2
(implies (and (bcv-simple-inst pc (next-inst st)
(collect-witness-bcv-method
(current-method st)
(g 'method-table st)))
(equal (op-code (next-inst st)) 'IFEQ))
(assoc-equal (cadr (next-inst st))
(collect-witness-bcv-method
(current-method st)
(g 'method-table st)))))
;; (defthm consistent-state-implies-bcv-simple-inst
;; (implies (consistent-state st)
;; (bcv-simple-inst (g 'pc (car (g 'call-stack st)))
;; (next-inst st)
;; (collect-witness-bcv-method
;; (current-method st)
;; (g 'method-table st)))))
(defthm bcv-simple-inst-implies-next-pc-bounded-IFEQ-specific-2-futher
(implies (and (consistent-state st)
(equal (op-code (next-inst st)) 'IFEQ))
(assoc-equal (cadr (next-inst st))
(collect-witness-bcv-method
(current-method st)
(g 'method-table st))))
:hints (("Goal" :use ((:instance
bcv-simple-inst-implies-next-pc-bounded-IFEQ-specific-2
(pc (g 'pc (car (g 'call-stack st)))))
(:instance consistent-state-implies-bcv-simple-inst))
:in-theory (disable consistent-state
bcv-simple-inst
consistent-state-implies-bcv-simple-inst
collect-witness-bcv-method))))
(local (in-theory (disable current-method consistent-state
collect-witness-bcv-method
bcv-simple-inst next-inst)))
;; (defthm bcv-method-implies-integerp-if-bound
;; (implies (and (bcv-method method method-table)
;; (assoc-equal pc (collect-witness-bcv-method method method-table)))
;; (integerp pc))
;; :hints (("Goal" :in-theory (disable merged-code-safe
;; ;;collect-witness-bcv-method
;; extract-code
;; sig-method-init-frame
;; wff-code1)
;; :cases ((member pc (collect-pc-merged-code
;; (MERGESTACKMAPANDCODE (G 'STACKMAPS METHOD)
;; (PARSECODE1 0 (G 'CODE METHOD))
;; (G 'METHOD-NAME METHOD)
;; METHOD-TABLE))))))
;; :rule-classes :forward-chaining)
(defthm bcv-simple-check-ifeq-implies-djvm-check
(IMPLIES (AND (CONSISTENT-STATE DJVM-S)
(equal (op-code (next-inst djvm-s)) 'IFEQ)
(BCV-SIMPLE-CHECK-IFEQ (next-inst djvm-s)
(EXTRACT-SIG-FRAME (CAR (G 'CALL-STACK DJVM-S))
(G 'METHOD-TABLE DJVM-S))))
(DJVM-CHECK-IFEQ (next-inst djvm-s) djvm-s))
:hints (("Goal" :in-theory (disable consistent-state)
:use ((:instance bcv-method-implies-integerp-if-bound
(method (current-method djvm-s))
(method-table (g 'method-table djvm-s))
(pc (cadr (next-inst djvm-s))))))))
|