Skip to content

Commit

Permalink
Move a practical theorem into evaluateProps
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarabrahamsson committed Apr 18, 2022
1 parent 8b19654 commit f38753e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
21 changes: 0 additions & 21 deletions candle/prover/candle_prover_semanticsScript.sml
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,6 @@ Proof
\\ gvs [LPREFIX_LCONS, SF SFY_ss]
QED

(* TODO move to evaluateProps (or wherever evaluate_decs_cons is)
*)

Theorem evaluate_decs_append:
∀ds1 s env ds2.
evaluate_decs s env (ds1 ++ ds2) =
case evaluate_decs s env ds1 of
(s1,Rval env1) =>
(case evaluate_decs s1 (extend_dec_env env1 env) ds2 of
(s2,r) => (s2,combine_dec_result env1 r))
| (s1,Rerr v7) => (s1,Rerr v7)
Proof
Induct \\ rw []
>- (
rw [extend_dec_env_def, combine_dec_result_def]
\\ rpt CASE_TAC)
\\ once_rewrite_tac [evaluate_decs_cons] \\ simp []
\\ gs [combine_dec_result_def, extend_dec_env_def]
\\ rpt CASE_TAC \\ gs []
QED

(* -------------------------------------------------------------------------
* - The basis program:
* basis, basis_env, basis_state
Expand Down
18 changes: 18 additions & 0 deletions semantics/proofs/evaluatePropsScript.sml
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,24 @@ Proof
>> simp [combine_dec_result_def, sem_env_component_equality]
QED

Theorem evaluate_decs_append:
∀ds1 s env ds2.
evaluate_decs s env (ds1 ++ ds2) =
case evaluate_decs s env ds1 of
(s1,Rval env1) =>
(case evaluate_decs s1 (extend_dec_env env1 env) ds2 of
(s2,r) => (s2,combine_dec_result env1 r))
| (s1,Rerr v7) => (s1,Rerr v7)
Proof
Induct \\ rw []
>- (
rw [extend_dec_env_def, combine_dec_result_def]
\\ rpt CASE_TAC)
\\ once_rewrite_tac [evaluate_decs_cons] \\ simp []
\\ gs [combine_dec_result_def, extend_dec_env_def]
\\ rpt CASE_TAC \\ gs []
QED

Theorem evaluate_match_list_result:
evaluate_match s e v p er = (s',r) ⇒
∃r'. r = list_result r'
Expand Down

0 comments on commit f38753e

Please sign in to comment.