Proving Skipping Refinement with ACL2s
Mitesh Jain and Pete Manolios Northeastern University ACL2 2015
1
Proving Skipping Refinement with ACL2s Mitesh Jain and Pete Manolios - - PowerPoint PPT Presentation
Proving Skipping Refinement with ACL2s Mitesh Jain and Pete Manolios Northeastern University ACL2 2015 1 Motivation 2 Motivation Property-based e.g. , Temporal logics 2 Motivation Property-based e.g. , Temporal logics
1
2
2
2
3
3
3
4
5
5
5
5
5
1CAV 2015 6
1CAV 2015 6
7
Instruction Set Architecture
add rd, ra, rb
sub rd, ra, rb
jnz imm
. . .
8
Instruction Set Architecture
add rd, ra, rb
sub rd, ra, rb
jnz imm
. . .
8
Instruction Set Architecture
add rd, ra, rb
sub rd, ra, rb
jnz imm
. . .
8
L.s = L.w and
∀σ : fp.σ.s: ∃δ : fp.δ.w : match(B, σ, δ)
9
L.s = L.w and
∀σ : fp.σ.s: ∃δ : fp.δ.w : match(B, σ, δ)
9
L.s = L.w and
∀σ : fp.σ.s: ∃δ : fp.δ.w : match(B, σ, δ)
9
∃v : w − → v : uBv ≥ 2 skipping on right ∃v : w →≥2 v : uBv
stuttering on left (uBw ∧ rankT(u, w) ≺ rankT(s, w))
stuttering on right ∃v : w − → v : sBv ∧ rankL(v, s, u) < rankL(w, s, u) 10
∃v : w − → v : uBv ≥ 2 skipping on right ∃v : w →≥2 v : uBv
stuttering on left (uBw ∧ rankT(u, w) ≺ rankT(s, w))
stuttering on right ∃v : w − → v : sBv ∧ rankL(v, s, u) < rankL(w, s, u) 10
∃v : w − → v : uBv ≥ 2 skipping on right ∃v : w →≥2 v : uBv
stuttering on left (uBw ∧ rankT(u, w) ≺ rankT(s, w))
stuttering on right ∃v : w − → v : sBv ∧ rankL(v, s, u) < rankL(w, s, u) 10
∃v : w − → v : uBv ≥ 2 skipping on right ∃v : w →≥2 v : uBv
stuttering on left (uBw ∧ rankT(u, w) ≺ rankT(s, w))
stuttering on right ∃v : w − → v : sBv ∧ rankL(v, s, u) < rankL(w, s, u) 10
∃v : w − → v : uBv ≥ 2 skipping on right ∃v : w →≥2 v : uBv
stuttering on left (uBw ∧ rankT(u, w) ≺ rankT(s, w))
stuttering on right ∃v : w − → v : sBv ∧ rankL(v, s, u) < rankL(w, s, u) 10
∃v : w − → v : uBv ≥ 2 skipping on right ∃v : w →≥2 v : uBv
stuttering on left (uBw ∧ rankT(u, w) ≺ rankT(s, w))
stuttering on right ∃v : w − → v : sBv ∧ rankL(v, s, u) < rankL(w, s, u) 10
∃v : w − → v : uBv
≥ 2 skipping on right ∃v : w →≥2 v : uBv
stuttering on left (uBw ∧ rankT(u, w) ≺ rankT(s, w))
stuttering on right ∃v : w − → v : sBv ∧ rankL(v, s, u) < rankL(w, s, u) 10
11
12
12
12
(defdata scalar-op (enum ’(add sub mul ...))) (defdata scalar-prog (listof scalar-inst)) (defdata sprg-state (record (pc . program-counter) (regs . register-file) (sprg . scalar-prog))) 13
(defdata scalar-op (enum ’(add sub mul ...))) (defdata scalar-prog (listof scalar-inst)) (defdata sprg-state (record (pc . program-counter) (regs . register-file) (sprg . scalar-prog)))
(defun step-sprg (s) (let* ((inst (nth (sprg-state-pc s) (sprg-state-sprg s))) (op (inst-scalar-op inst)) ...) (case op (add (execute-add ... )) ... ))) 13
(defdata vector-ops (enum ’(vadd vsub vmul ...))) (defdata inst (oneof scalar-inst vector-inst)) (defdata vector-prog (listof inst)) (defdata vprg-state (record (pc . program-counter) (regs . register-file) (vprg . vector-prog)))
(defun step-vprg (s) (let* ((inst (nth (vprg-state-pc s) (vprg-state-vprg s))) (op (get-op inst)) ... ) (case op (add (execute-add ...)) (vadd (execute-vadd ...)) ... ))) 14
15
∃v : w − → v : uBv
≥ 2 ≥ 2 ≥ 2 ≥ 2 ≤ k skipping on right skipping on right skipping on right skipping on right bounded skipping on ∃v : w →≥2 v : uBv ∃v : w →≥2 v : uBv ∃v : w →≥2 v : uBv ∃v : w →≥2 v : uBv ∃v : w →≥2 v : uBv ∃v : w →≤k v : uBv
stuttering on left stuttering on left
(uBw ∧ rankT(u, w) ≺ rankT(s, w)) (uBw ∧ rankT(u, w) ≺ rankT(s, w))
stuttering on right
∃v : w − → v : sBv ∧ rankL(v, s, u) < rankL(w, s, u) 16
∃v : w − → v : uBv
≥ 2 ≥ 2 ≥ 2 ≥ 2 ≤ k skipping on right skipping on right skipping on right skipping on right bounded skipping on ∃v : w →≥2 v : uBv ∃v : w →≥2 v : uBv ∃v : w →≥2 v : uBv ∃v : w →≥2 v : uBv ∃v : w →≥2 v : uBv ∃v : w →≤k v : uBv
stuttering on left stuttering on left
(uBw ∧ rankT(u, w) ≺ rankT(s, w)) (uBw ∧ rankT(u, w) ≺ rankT(s, w))
stuttering on right
∃v : w − → v : sBv ∧ rankL(v, s, u) < rankL(w, s, u) 16
∃v : w − → v : uBv
≥ 2 ≥ 2 ≥ 2 ≥ 2 ≤ k skipping on right skipping on right skipping on right skipping on right bounded skipping on ∃v : w →≥2 v : uBv ∃v : w →≥2 v : uBv ∃v : w →≥2 v : uBv ∃v : w →≥2 v : uBv ∃v : w →≥2 v : uBv ∃v : w →≤k v : uBv stuttering on left stuttering on left
(uBw ∧ rankT(u, w) ≺ rankT(s, w)) (uBw ∧ rankT(u, w) ≺ rankT(s, w))
stuttering on right
∃v : w − → v : sBv ∧ rankL(v, s, u) < rankL(w, s, u) 16
∃v : w − → v : uBv
≥ 2 ≥ 2 ≥ 2 ≥ 2 ≤ k skipping on right skipping on right skipping on right skipping on right bounded skipping on ∃v : w →≥2 v : uBv ∃v : w →≥2 v : uBv ∃v : w →≥2 v : uBv ∃v : w →≥2 v : uBv ∃v : w →≥2 v : uBv ∃v : w →≤k v : uBv stuttering on left stuttering on left
(uBw ∧ rankT(u, w) ≺ rankT(s, w)) (uBw ∧ rankT(u, w) ≺ rankT(s, w))
stuttering on right
∃v : w − → v : sBv ∧ rankL(v, s, u) < rankL(w, s, u) 16
∃v : w − → v : uBv
≥ 2 ≥ 2 ≥ 2 ≥ 2 ≤ k skipping on right skipping on right skipping on right skipping on right bounded skipping on ∃v : w →≥2 v : uBv ∃v : w →≥2 v : uBv ∃v : w →≥2 v : uBv ∃v : w →≥2 v : uBv ∃v : w →≥2 v : uBv ∃v : w →≤k v : uBv stuttering on left stuttering on left
(uBw ∧ rankT(u, w) ≺ rankT(s, w)) (uBw ∧ rankT(u, w) ≺ rankT(s, w))
stuttering on right
∃v : w − → v : sBv ∧ rankL(v, s, u) < rankL(w, s, u)
16
≤ k bounded skipping on right
17
18
19
(defthm optmemc-skip-refines-memc (implies (and (good-statep s) (equal w (ref-map s)) (equal u (impl-step s)) (not (and (equal w (ref-map u)) (< (rank u) (rank s))))) (spec-step-k-skip-rel w (ref-map u))))
(defthm bstk-skip-refines-stk (implies (and (good-statep s) (equal w (ref-map s)) (equal u (impl-step s)) (not (and (equal w (ref-map u)) (< (rank u) (rank s))))) (spec-step-k-skip-rel w (ref-map u))))
20
(defthm optmemc-skip-refines-memc (implies (and (good-statep s) (equal w (ref-map s)) (equal u (impl-step s)) (not (and (equal w (ref-map u)) (< (rank u) (rank s))))) (spec-step-k-skip-rel w (ref-map u))))
(defthm bstk-skip-refines-stk (implies (and (good-statep s) (equal w (ref-map s)) (equal u (impl-step s)) (not (and (equal w (ref-map u)) (< (rank u) (rank s))))) (spec-step-k-skip-rel w (ref-map u))))
20
21
22
23