Skip to content

Commit 79cc52d

Browse files
committed
fixup! Fix cmlPEGScript.sml
1 parent 0e9a684 commit 79cc52d

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

compiler/parsing/cmlPEGScript.sml

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -810,31 +810,32 @@ local
810810
SOME(e,t') => recurse (e :: acc) t'
811811
| NONE => acc
812812
val nts = recurse [] r
813-
fun p t = Q.prove(`^t ∈ FDOM cmlPEG.rules`, simp[FDOM_cmlPEG])
814-
val th = LIST_CONJ (map p nts)
815813
in
816-
Theorem FDOM_cmlPEG_nts[simp] = th;
817-
end
818814

819-
local
820-
val exprs_th' = REWRITE_RULE [pnt_def] PEG_exprs
821-
|> INST_TYPE [alpha |-> “:string”]
822-
val exprs_t = rhs (concl exprs_th')
823-
val nt = mk_thy_const{Thy = "peg", Name = "nt",
824-
Ty = ``:MMLnonT inf -> (mlptree list -> mlptree list) ->
825-
(token,MMLnonT,mlptree list,string) pegsym``}
826-
val I_t = mk_thy_const{Thy = "combin", Name = "I",
827-
Ty = ``:mlptree list -> mlptree list``}
828-
fun p t = let
829-
val _ = print ("PEGexpr: "^term_to_string t^"\n")
830-
val th0 = prove(pred_setSyntax.mk_in(list_mk_comb(nt,[t,I_t]), exprs_t),
831-
simp[pnt_def])
832-
handle e => (print("Failed on "^term_to_string t^"\n");
833-
raise e)
815+
local
816+
fun p t = Q.prove(`^t ∈ FDOM cmlPEG.rules`, simp[FDOM_cmlPEG])
834817
in
835-
CONV_RULE (RAND_CONV (K (SYM exprs_th'))) th0
818+
Theorem FDOM_cmlPEG_nts[simp] = LIST_CONJ (map p nts);
836819
end
837-
val th = LIST_CONJ (map p nts)
838-
in
839-
Theorem NTS_in_PEG_exprs[simp] = th;
840-
end
820+
821+
local
822+
val exprs_th' = REWRITE_RULE [pnt_def] PEG_exprs
823+
|> INST_TYPE [alpha |-> “:string”]
824+
val exprs_t = rhs (concl exprs_th')
825+
val nt = mk_thy_const{Thy = "peg", Name = "nt",
826+
Ty = ``:MMLnonT inf -> (mlptree list -> mlptree list) ->
827+
(token,MMLnonT,mlptree list,string) pegsym``}
828+
val I_t = mk_thy_const{Thy = "combin", Name = "I",
829+
Ty = ``:mlptree list -> mlptree list``}
830+
fun p t = let
831+
val _ = print ("PEGexpr: "^term_to_string t^"\n")
832+
val th0 = prove(pred_setSyntax.mk_in(list_mk_comb(nt,[t,I_t]), exprs_t),
833+
simp[pnt_def])
834+
handle e => (print("Failed on "^term_to_string t^"\n");
835+
raise e)
836+
in CONV_RULE (RAND_CONV (K (SYM exprs_th'))) th0 end
837+
in
838+
Theorem NTS_in_PEG_exprs[simp] = LIST_CONJ (map p nts);
839+
end
840+
841+
end (* local *)

0 commit comments

Comments
 (0)