Skip to content

Commit 4dc2782

Browse files
committed
Fix breakage
1 parent b0d5951 commit 4dc2782

File tree

2 files changed

+24
-28
lines changed

2 files changed

+24
-28
lines changed

semantics/proofs/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ TODO: delete this theory (it has no content)
77
[cmlPtreeConversionPropsScript.sml](cmlPtreeConversionPropsScript.sml):
88
Definition of a function for mapping types back to ASTs, and proofs that
99
check that the conversion functions are doing something reasonable.
10-
TODO: check this description is correct
1110

1211
[evaluateComputeLib.sml](evaluateComputeLib.sml):
1312
A compset for the operational semantics.

semantics/proofs/cmlPtreeConversionPropsScript.sml

+24-27
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
(*
22
Definition of a function for mapping types back to ASTs, and proofs that
33
check that the conversion functions are doing something reasonable.
4-
TODO: check this description is correct
54
*)
65
open HolKernel Parse boolLib bossLib;
76
open preamble boolSimps
@@ -17,29 +16,44 @@ val _ = option_monadsyntax.temp_add_option_monadsyntax()
1716
(* first, capture those types that we expect to be in the range of the
1817
conversion *)
1918
Definition user_expressible_tyname_def:
20-
(user_expressible_tyname (Short s) ⇔ T) ∧
21-
(user_expressible_tyname (Long m (Short s)) ⇔ T) ∧
22-
(user_expressible_tyname _ ⇔ F)
19+
(user_expressible_tyname _ ⇔ T)
2320
End
2421
val _ = augment_srw_ss [rewrites [user_expressible_tyname_def]]
2522

2623
Overload ND[local] = “λn. Nd (mkNT n, ARB)”
2724
Overload LF[local] = “λt. Lf (TOK t, ARB)”
2825

26+
Definition id_to_path_def:
27+
id_to_path (Short n) = (End,n) ∧
28+
id_to_path (Long s t) =
29+
let (p,n) = id_to_path t in
30+
(Mod s p,n)
31+
End
32+
2933
Definition tyname_to_AST_def:
3034
tyname_to_AST (Short n) = ND nTyOp [ND nUQTyOp [LF (AlphaT n)]] ∧
31-
tyname_to_AST (Long md (Short n)) = ND nTyOp [LF (LongidT md n)] ∧
32-
tyname_to_AST _ = ARB
35+
tyname_to_AST other = let (p,n) = id_to_path other in
36+
ND nTyOp [LF (LongidT p n)]
3337
End
3438

39+
Theorem id_to_path_Long_Short:
40+
∀i p n. id_to_path i = (p,n) ⇒ Long_Short p n = i
41+
Proof
42+
Induct
43+
\\ gvs [id_to_path_def,Long_Short_def]
44+
\\ rw [] \\ pairarg_tac \\ gvs []
45+
\\ gvs [id_to_path_def,Long_Short_def]
46+
QED
47+
3548
Theorem tyname_inverted:
3649
∀id. user_expressible_tyname id ⇒
3750
ptree_Tyop (tyname_to_AST id) = SOME id
3851
Proof
3952
Cases >>
4053
simp[ptree_Tyop_def, tyname_to_AST_def, ptree_UQTyop_def] >>
41-
rename [‘Long m j’] >> Cases_on ‘j’ >>
42-
simp[ptree_Tyop_def, tyname_to_AST_def, ptree_UQTyop_def]
54+
pairarg_tac >> gvs [] >>
55+
simp[ptree_Tyop_def, tyname_to_AST_def, ptree_UQTyop_def] >>
56+
imp_res_tac id_to_path_Long_Short
4357
QED
4458

4559
Theorem tyname_validptree:
@@ -48,11 +62,10 @@ Theorem tyname_validptree:
4862
ptree_head (tyname_to_AST id) = NN nTyOp
4963
Proof
5064
Cases >> simp[tyname_to_AST_def, cmlG_FDOM, cmlG_applied] >>
51-
rename [‘Long m j’] >> Cases_on ‘j’ >>
65+
pairarg_tac >> gvs [] >>
5266
simp[tyname_to_AST_def, cmlG_applied, cmlG_FDOM]
5367
QED
5468

55-
5669
Definition user_expressible_type_def:
5770
(user_expressible_type (Atvar _) ⇔ T) ∧
5871
(user_expressible_type (Atapp tys tycon) ⇔
@@ -137,8 +150,7 @@ Theorem destTyvarPT_tyname_to_AST:
137150
∀i. user_expressible_tyname i ⇒ destTyvarPT (tyname_to_AST i) = NONE
138151
Proof
139152
Cases >> simp[tyname_to_AST_def] >>
140-
rename [‘Long _ j’] >> Cases_on ‘j’ >>
141-
simp[tyname_to_AST_def]
153+
pairarg_tac >> gvs []
142154
QED
143155

144156
Type PT = “:(token,MMLnonT,α) parsetree”
@@ -833,19 +845,4 @@ Proof
833845
metis_tac[Decl_OK, grammarTheory.ptree_fringe_def])
834846
QED
835847

836-
(*
837-
Theorem REPLTop_OK:
838-
valid_ptree cmlG pt ∧ ptree_head pt = NN nREPLTop ∧
839-
MAP TK toks = ptree_fringe pt ⇒
840-
∃r. ptree_REPLTop pt = SOME r
841-
Proof
842-
start >> fs[MAP_EQ_APPEND, MAP_EQ_CONS, DISJ_IMP_THM, FORALL_AND_THM] >>
843-
simp[ptree_REPLTop_def]
844-
>- (erule strip_assume_tac (n TopLevelDec_OK) >> simp[]) >>
845-
rename1 `ptree_TopLevelDec pt0` >>
846-
Cases_on `ptree_TopLevelDec pt0` >> simp[] >>
847-
erule strip_assume_tac (n E_OK) >> simp[]
848-
QED
849-
*)
850-
851848
val _ = export_theory();

0 commit comments

Comments
 (0)