Skip to content

Commit 93a13df

Browse files
committed
Define eval_to_sim which should imply app_bisim
1 parent df70a3c commit 93a13df

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

meta-theory/pure_exp_relScript.sml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,4 +781,81 @@ Proof
781781
\\ fs [] \\ fs [closed_def,FILTER_EQ_NIL,EVERY_MEM,SUBSET_DEF]
782782
QED
783783

784+
Definition eval_to_sim_def:
785+
eval_to_sim rel ⇔
786+
∀e1 k e2.
787+
rel e1 e2 ∧ closed e1 ∧ closed e2 ⇒
788+
∃ck.
789+
case eval_wh_to k e1 of
790+
| wh_Closure v x =>
791+
(∃w y. eval_wh_to (k+ck) e2 = wh_Closure w y ∧
792+
∀e. closed e ⇒ rel (subst v e x) (subst w e y))
793+
| wh_Constructor a xs =>
794+
(∃ys. eval_wh_to (k+ck) e2 = wh_Constructor a ys ∧ LIST_REL rel xs ys)
795+
| res => eval_wh_to (k+ck) e2 = res
796+
End
797+
798+
Theorem eval_to_sim_thm:
799+
∀x y. eval_to_sim rel ∧ rel x y ∧ closed x ∧ closed y ⇒ x ≃ y
800+
Proof
801+
ho_match_mp_tac app_bisimilarity_coinduct
802+
\\ Cases_on ‘eval_to_sim rel’ \\ fs []
803+
\\ fs [FF_def,EXISTS_PROD]
804+
\\ fs [unfold_rel_def,opp_def,IN_DEF]
805+
\\ rw []
806+
THEN1
807+
(fs [eval_wh_eq,PULL_EXISTS]
808+
\\ fs [eval_to_sim_def]
809+
\\ first_x_assum drule_all
810+
\\ disch_then (qspec_then ‘k’ mp_tac) \\ fs []
811+
\\ rw [] \\ fs []
812+
\\ goal_assum (first_assum o mp_then Any mp_tac)
813+
\\ rw [] \\ fs []
814+
\\ irule IMP_closed_subst
815+
\\ fs [FRANGE_DEF]
816+
\\ imp_res_tac eval_wh_to_Closure_freevars_SUBSET
817+
\\ fs [SUBSET_DEF] \\ rw []
818+
\\ res_tac \\ fs []
819+
\\ gvs [closed_def])
820+
THEN1
821+
(fs [eval_wh_eq,PULL_EXISTS]
822+
\\ fs [eval_to_sim_def]
823+
\\ first_x_assum drule_all
824+
\\ disch_then (qspec_then ‘k’ mp_tac) \\ fs []
825+
\\ rw [] \\ fs []
826+
\\ goal_assum (first_assum o mp_then Any mp_tac)
827+
\\ fs [LIST_REL_EL_EQN]
828+
\\ cheat)
829+
THEN1
830+
(fs [eval_wh_eq,PULL_EXISTS,eval_to_sim_def]
831+
\\ first_x_assum drule_all
832+
\\ disch_then (qspec_then ‘k’ mp_tac) \\ fs [] \\ rw [] \\ fs []
833+
\\ goal_assum (first_assum o mp_then Any mp_tac))
834+
THEN1
835+
(fs [eval_wh_eq,PULL_EXISTS,eval_to_sim_def]
836+
\\ first_x_assum drule_all
837+
\\ disch_then (qspec_then ‘k’ mp_tac) \\ fs [] \\ rw [] \\ fs []
838+
\\ goal_assum (first_assum o mp_then Any mp_tac))
839+
THEN1
840+
(fs [eval_wh_eq,PULL_EXISTS]
841+
\\ fs [eval_to_sim_def]
842+
\\ first_x_assum drule_all
843+
\\ disch_then (qspec_then ‘k’ mp_tac) \\ fs []
844+
\\ rw [] \\ fs []
845+
\\ ‘eval_wh_to k y ≠ wh_Diverge’ by fs []
846+
\\ drule eval_wh_inc
847+
\\ disch_then (qspec_then ‘ck+k’ mp_tac) \\ fs []
848+
\\ strip_tac
849+
\\ fs [] \\ Cases_on ‘eval_wh_to k x’ \\ fs []
850+
\\ goal_assum (first_assum o mp_then Any mp_tac)
851+
\\ rw []
852+
\\ irule IMP_closed_subst
853+
\\ fs [FRANGE_DEF]
854+
\\ imp_res_tac eval_wh_to_Closure_freevars_SUBSET
855+
\\ fs [SUBSET_DEF] \\ rw []
856+
\\ res_tac \\ fs []
857+
\\ gvs [closed_def])
858+
\\ cheat
859+
QED
860+
784861
val _ = export_theory();

0 commit comments

Comments
 (0)