Skip to content

Commit 0e666b3

Browse files
committed
Package resulting theorems in tvsubst_result
1 parent 716002e commit 0e666b3

File tree

1 file changed

+17
-55
lines changed

1 file changed

+17
-55
lines changed

Tools/tvsubst.ML

Lines changed: 17 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,16 @@ sig
1616

1717
type tvsubst_result = {
1818
tvsubst: term,
19-
SSupps: term list,
20-
IImsuppss: term list list,
21-
VVrs: (term * thm) list,
22-
isVVrs: thm list,
23-
tvsubst_VVrs: thm list,
24-
tvsubst_cctor_not_isVVr: thm,
25-
tvsubst_permute: thm
19+
isInjs: (term * thm) list,
20+
tvsubst_Injs: thm list,
21+
tvsubst_not_isInj: thm,
22+
mrsbnf: MRSBNF_Def.mrsbnf
2623
};
2724

2825
val create_tvsubst_of_mrsbnf: (binding -> binding) -> MRBNF_FP_Def_Sugar.fp_result
2926
-> MRSBNF_Def.mrsbnf -> MRBNF_Def.mrbnf -> thm -> binding
3027
-> (Proof.context -> tactic) eta_model option list -> string -> local_theory
31-
-> tvsubst_result list * local_theory
28+
-> tvsubst_result * local_theory
3229
end
3330

3431
structure TVSubst : TVSUBST =
@@ -54,13 +51,10 @@ type 'a eta_model = {
5451

5552
type tvsubst_result = {
5653
tvsubst: term,
57-
SSupps: term list,
58-
IImsuppss: term list list,
59-
VVrs: (term * thm) list,
60-
isVVrs: thm list,
61-
tvsubst_VVrs: thm list,
62-
tvsubst_cctor_not_isVVr: thm,
63-
tvsubst_permute: thm
54+
isInjs: (term * thm) list,
55+
tvsubst_Injs: thm list,
56+
tvsubst_not_isInj: thm,
57+
mrsbnf: MRSBNF_Def.mrsbnf
6458
};
6559

6660
val names = map (fst o dest_Free);
@@ -1720,45 +1714,13 @@ fun create_tvsubst_of_mrsbnf qualify fp_res mrsbnf rec_mrbnf vvsubst_ctor tvsubs
17201714
set_Vrs = replicate nvars (fn ctxt => rtac ctxt refl 1)
17211715
}) (0 upto length ops - 1)) lthy;
17221716

1723-
val _ = @{print} rec_mrsbnf
1724-
1725-
(*
1726-
val results = @{map 6} (fn tvsubst => fn defs => fn tvsubst_VVrs => fn tvsubst_not_isVVr => fn VVrs' => fn tvsubst_permute => {
1717+
val result = {
17271718
tvsubst = fst tvsubst,
1728-
SSupps = map_filter (Option.map (fst o #SSupp)) defs,
1729-
IImsuppss = map_filter (Option.map (map fst o #IImsupps)) defs,
1730-
VVrs = VVrs',
1731-
isVVrs = map_filter (Option.map (snd o #isVVr)) defs,
1732-
tvsubst_VVrs = map_filter I tvsubst_VVrs,
1733-
tvsubst_cctor_not_isVVr = tvsubst_not_isVVr,
1734-
tvsubst_permute = tvsubst_permute
1735-
}: tvsubst_result) tvsubsts defss tvsubst_VVrss tvsubst_not_isVVrs VVrss' tvsubst_permutes;
1736-
1737-
(* TODO: Remove *)
1738-
val notes =
1739-
[("SSupp_VVr_empty", maps (map_filter I) SSupp_VVr_emptiess),
1740-
("SSupp_VVr_bound", maps (map_filter I) SSupp_VVr_boundss),
1741-
("in_IImsupp", flat (maps (map_filter I) in_IImsuppsss)),
1742-
("is_VVr_rrename", maps (map_filter I) isVVr_renamess),
1743-
("rrename_VVr", maps (map_filter I) permute_VVrss),
1744-
("SSupp_natural", maps (map_filter I) SSupp_naturalss),
1745-
("SSupp_comp_rename_bound", maps (map_filter (Option.map #SSupp_comp_rename_bound)) SSupp_compss),
1746-
("SSupp_comp_bound_old", maps (map_filter (Option.map #SSupp_comp_bound)) SSupp_compss),
1747-
("eta_set_empties", flat (maps (map_filter I) eta_set_emptiess)),
1748-
("FVars_VVr", flat (maps (map_filter I) FVars_VVrss)),
1749-
("tvsubst_VVr", maps (map_filter I) tvsubst_VVrss),
1750-
("tvsubst_cctor_not_isVVr", tvsubst_not_isVVrs),
1751-
("tvsubst_permutes", tvsubst_permutes),
1752-
("IImsupp_permute_commute", maps (map_filter I) IImsupp_imsupp_permute_commutess),
1753-
("IImsupp_Diff", maps (map_filter I) IImsupp_Diffss),
1754-
("IImsupp_natural", flat (maps (map_filter I) IImsupp_naturalsss))
1755-
(*("FFVars_tvsubst", map_filter I FFVars_tvsubsts)*)
1756-
] |> (map (fn (thmN, thms) =>
1757-
((Binding.qualify true (short_type_name (fst (dest_Type (#T (hd (#quotient_fps fp_res))))))
1758-
(Binding.name thmN), []), [(thms, [])])
1759-
));
1760-
val (_, lthy) = Local_Theory.notes notes lthy
1761-
1762-
in (results, lthy) end;
1763-
*) in error "tvsubst" end
1719+
isInjs = map_filter (Option.map #isInj) defs,
1720+
tvsubst_Injs = map_filter I tvsubst_Injs,
1721+
tvsubst_not_isInj = tvsubst_not_isInj,
1722+
mrsbnf = rec_mrsbnf
1723+
}: tvsubst_result;
1724+
1725+
in (result, lthy) end;
17641726
end

0 commit comments

Comments
 (0)