Skip to content

Commit b567a3c

Browse files
committed
Do not require isabelle patch
1 parent 6894628 commit b567a3c

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

.github/workflows/build_theories.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
build:
1616
runs-on: ubuntu-latest
1717
container:
18-
image: jvanbruegge/isabelle:2024-inductive
18+
image: makarius/isabelle:Isabelle2024
1919
options: "--user root"
2020

2121
if: github.event_name != 'pull_request' || !github.event.pull_request.draft

Tools/binder_inductive.ML

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,19 @@ fun mk_insert x S =
2525
fun binder_inductive_cmd ((pred_name, binds_opt), perms_supps) no_defs_lthy =
2626
let
2727
val binds = the_default [] binds_opt;
28-
val ({names, ...}, { def, preds, mono, induct, intrs, ... }) = Inductive.the_inductive_global no_defs_lthy (long_name no_defs_lthy pred_name);
28+
29+
val (context, facts) = (Proof_Context.theory_of #>
30+
`Context.Theory ##> Proof_Context.init_global) no_defs_lthy ||> Proof_Context.facts_of;
31+
fun lookup name = the_single (#thms (the (
32+
Facts.lookup context facts (Facts.intern facts name)
33+
)));
34+
35+
val long_name = long_name no_defs_lthy pred_name;
36+
val ({names, ...}, { preds, induct, intrs, ... }) = Inductive.the_inductive_global no_defs_lthy long_name;
37+
38+
(* TODO: remove, this is a hack until the Isabelle patch is merged *)
39+
val def = lookup (long_name ^ "_def");
40+
val operator = snd (Term.dest_comb (snd (Logic.dest_equals (Thm.prop_of def))));
2941

3042
val param_Ts = Term.binder_types (fastype_of (hd preds));
3143

@@ -231,7 +243,6 @@ fun binder_inductive_cmd ((pred_name, binds_opt), perms_supps) no_defs_lthy =
231243
val thy = Proof_Context.theory_of no_defs_lthy;
232244
fun mk_match mk_T ts = map2 (fn t => fn T =>
233245
let
234-
val _ = @{print} (Thm.cterm_of no_defs_lthy t, T, mk_T T)
235246
val t = Logic.varify_types_global t;
236247
val tyenv = Sign.typ_match thy (fastype_of t, mk_T T) Vartab.empty;
237248
in Envir.subst_term (tyenv, Vartab.empty) t end
@@ -383,6 +394,17 @@ fun binder_inductive_cmd ((pred_name, binds_opt), perms_supps) no_defs_lthy =
383394
\<^Const>\<open>top \<^Type>\<open>set predT\<close>\<close> \<^Const>\<open>less_eq predT\<close> \<^Const>\<open>less_eq predT'\<close> t\<close>)
384395
end;
385396

397+
val mono = Goal.prove_sorry lthy [] [] (mk_mono operator) (fn {context=ctxt, ...} => EVERY1 [
398+
rtac ctxt @{thm monoI},
399+
REPEAT_DETERM o resolve_tac ctxt @{thms le_funI le_boolI'},
400+
REPEAT_DETERM o FIRST' [
401+
assume_tac ctxt,
402+
resolve_tac ctxt (Inductive.get_monos ctxt),
403+
etac ctxt @{thm le_funE},
404+
dtac ctxt @{thm le_boolD}
405+
]
406+
]);
407+
386408
val G_mono = Goal.prove_sorry lthy [] [] (mk_mono (fst G))
387409
(fn {context=ctxt,...} => EVERY1 [
388410
K (Local_Defs.unfold0_tac ctxt [snd G]),

thys/MRBNF_Recursor.thy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ ML_file \<open>../Tools/mrbnf_vvsubst.ML\<close>
1111
ML_file \<open>../Tools/mrbnf_tvsubst.ML\<close>
1212
ML_file \<open>../Tools/mrbnf_sugar.ML\<close>
1313

14+
declare [[inductive_internals]]
15+
1416
context begin
1517
ML_file \<open>../Tools/binder_induction.ML\<close>
1618
end

thys/Untyped_Lambda_Calculus/LC_Beta.thy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ binder_inductive step :: "trm \<Rightarrow> trm \<Rightarrow> bool" where
2929
apply (elim disj_forward exE; simp)
3030
apply (metis Lam_eq_tvsubst Lam_inject_swap singletonD)
3131
by blast
32-
done
32+
done
3333

3434
thm step.strong_induct step.equiv
3535

0 commit comments

Comments
 (0)