Skip to content

Commit

Permalink
Fix state_to_cakeProof after updates to CakeML's Loc
Browse files Browse the repository at this point in the history
Following changes in CakeML/cakeml#1107
  • Loading branch information
hrutvik committed Dec 28, 2024
1 parent 6636ae1 commit 917417d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions compiler/backend/passes/proofs/state_to_cakeProofScript.sml
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ Theorem strle_v_def[local] = SRULE [strle_exp_def] strle_v_def;

Definition env_ok_def:
env_ok env ⇔
nsLookup env.v (Short "ffi_array") = SOME (semanticPrimitives$Loc 0) ∧
nsLookup env.v (Short "ffi_array") = SOME (semanticPrimitives$Loc T 0) ∧
(∃env'.
nsLookup env.v (Short "strle") = SOME $ strle_v env' ∧
nsLookup env'.c (Short $ "True") = SOME (0n, TypeStamp "True" bool_type_num) ∧
Expand Down Expand Up @@ -435,7 +435,7 @@ Inductive v_rel:
v_rel cnenv (Atom $ Str s) (Litv $ StrLit s)

[~Loc:]
v_rel cnenv (Atom $ Loc n) (Loc (n + 1)) (* leave space for FFI array *)
v_rel cnenv (Atom $ Loc n) (Loc T (n + 1)) (* leave space for FFI array *)

[~env_rel:]
(cnenv_rel cnenv cenv.c ∧
Expand Down Expand Up @@ -709,7 +709,7 @@ Definition get_ffi_ch_def[simp]:
End

Definition get_ffi_args_def[simp]:
get_ffi_args [Litv (StrLit conf); Loc lnum] = SOME (conf, lnum) ∧
get_ffi_args [Litv (StrLit conf); Loc b lnum] = SOME (conf, lnum) ∧
get_ffi_args _ = NONE
End

Expand Down Expand Up @@ -2274,7 +2274,7 @@ Proof
first_x_assum $ qspec_then `1` assume_tac >> gvs[sstep] >>
TOP_CASE_TAC >> gvs[] >>
ntac 3 (qrefine `SUC n` >> simp[cstep_n_def, cstep]) >>
`nsLookup cenv'.v (Short "ffi_array") = SOME (Loc 0)` by gvs[env_ok_def] >>
`nsLookup cenv'.v (Short "ffi_array") = SOME (Loc T 0)` by gvs[env_ok_def] >>
simp[] >>
ntac 3 (qrefine `SUC n` >> simp[cstep_n_def, cstep]) >>
`∃ws. store_lookup 0 cst = SOME $ W8array ws ∧
Expand Down Expand Up @@ -2432,7 +2432,7 @@ Proof
unabbrev_all_tac >>
ntac 7 (qrefine `SUC m` >> simp[dstep, cstep]) >>
simp[namespaceTheory.nsOptBind_def] >>
`nsLookup cenv.v (Short "ffi_array") = SOME (Loc 0)` by gvs[env_ok_def] >>
`nsLookup cenv.v (Short "ffi_array") = SOME (Loc T 0)` by gvs[env_ok_def] >>
simp[] >> qrefine `SUC m` >> simp[dstep, cstep, do_app_def] >>
Cases_on `dst.refs` >> gvs[store_lookup_def, LUPDATE_DEF] >>
ntac 9 (qrefine `SUC m` >> simp[dstep, cstep, do_app_def]) >>
Expand Down

0 comments on commit 917417d

Please sign in to comment.