Use 'alpha_bn_refl' to get rid of one of the sorrys.
authorCezary Kaliszyk <kaliszyk@in.tum.de>
Sat, 20 Mar 2010 09:27:28 +0100
changeset 1561 c3dca6e600c8
parent 1560 604c4cffc5b9
child 1562 41294e4fc870
Use 'alpha_bn_refl' to get rid of one of the sorrys.
Nominal/LFex.thy
Nominal/Parser.thy
Nominal/Rsp.thy
Nominal/TySch.thy
TODO
--- a/Nominal/LFex.thy	Sat Mar 20 08:56:07 2010 +0100
+++ b/Nominal/LFex.thy	Sat Mar 20 09:27:28 2010 +0100
@@ -6,7 +6,7 @@
 atom_decl ident
 
 ML {* val _ = cheat_fv_rsp := false *}
-ML {* val _ = cheat_const_rsp := false *}
+ML {* val _ = cheat_alpha_bn_rsp := false *}
 ML {* val _ = cheat_equivp := false *}
 
 nominal_datatype kind =
--- a/Nominal/Parser.thy	Sat Mar 20 08:56:07 2010 +0100
+++ b/Nominal/Parser.thy	Sat Mar 20 09:27:28 2010 +0100
@@ -267,7 +267,7 @@
 
 (* These 2 are critical, we don't know how to do it in term5 *)
 ML {* val cheat_fv_rsp = Unsynchronized.ref true *}
-ML {* val cheat_const_rsp = Unsynchronized.ref true *} (* For alpha_bn 0 and alpha_bn_rsp *)
+ML {* val cheat_alpha_bn_rsp = Unsynchronized.ref true *}
 
 ML {* val cheat_equivp = Unsynchronized.ref true *}
 
@@ -363,10 +363,13 @@
   val ((_, fv_rsp), lthy10) = prove_const_rsp Binding.empty fv_ts fv_rsp_tac lthy9
   val (perms_rsp, lthy11) = prove_const_rsp Binding.empty perms
     (fn _ => asm_simp_tac (HOL_ss addsimps alpha_eqvt) 1) lthy10;
-  fun const_rsp_tac _ = if !cheat_const_rsp then Skip_Proof.cheat_tac thy
-    else constr_rsp_tac alpha_eq_iff (fv_rsp @ bns_rsp) alpha_equivp 1
-  val (const_rsps, lthy12) = fold_map (fn cnst => prove_const_rsp Binding.empty [cnst]
-    const_rsp_tac) (raw_consts @ alpha_ts_bn) lthy11
+  val alpha_alphabn = build_alpha_alphabn fv_alpha_all alpha_inducts alpha_eq_iff lthy11;
+  fun const_rsp_tac _ = constr_rsp_tac alpha_eq_iff (fv_rsp @ bns_rsp @ reflps @ alpha_alphabn) 1
+  fun alpha_bn_rsp_tac x = if !cheat_alpha_bn_rsp then Skip_Proof.cheat_tac thy else const_rsp_tac x
+  val (const_rsps, lthy11a) = fold_map (fn cnst => prove_const_rsp Binding.empty [cnst]
+    const_rsp_tac) raw_consts lthy11
+  val (alpha_bn_rsps, lthy12) = fold_map (fn cnst => prove_const_rsp Binding.empty [cnst]
+    alpha_bn_rsp_tac) alpha_ts_bn lthy11a
   val qfv_names = map (unsuffix "_raw" o Long_Name.base_name o fst o dest_Const) ordered_fv_ts
   val (qfv_ts, qfv_defs, lthy12a) = quotient_lift_consts_export (qfv_names ~~ ordered_fv_ts) lthy12;
   val (qfv_ts_nobn, qfv_ts_bn) = chop (length perms) qfv_ts;
--- a/Nominal/Rsp.thy	Sat Mar 20 08:56:07 2010 +0100
+++ b/Nominal/Rsp.thy	Sat Mar 20 09:27:28 2010 +0100
@@ -95,18 +95,15 @@
 *}
 
 ML {*
-fun constr_rsp_tac inj rsp equivps =
-let
-  val reflps = map (fn x => @{thm equivp_reflp} OF [x]) equivps
-in
+fun constr_rsp_tac inj rsp =
   REPEAT o rtac impI THEN'
   simp_tac (HOL_ss addsimps inj) THEN' split_conjs THEN_ALL_NEW
   (asm_simp_tac HOL_ss THEN_ALL_NEW (
-   rtac @{thm exI[of _ "0 :: perm"]} THEN'
-   asm_full_simp_tac (HOL_ss addsimps (rsp @ reflps @
-     @{thms alpha_gen fresh_star_def fresh_zero_perm permute_zero ball_triv}))
+   REPEAT o rtac @{thm exI[of _ "0 :: perm"]} THEN_ALL_NEW
+   simp_tac (HOL_basic_ss addsimps @{thms alpha_gen2}) THEN_ALL_NEW
+   asm_full_simp_tac (HOL_ss addsimps (rsp @
+     @{thms alpha_gen fresh_star_def fresh_zero_perm permute_zero ball_triv add_0_left}))
   ))
-end
 *}
 
 (* Testing code
--- a/Nominal/TySch.thy	Sat Mar 20 08:56:07 2010 +0100
+++ b/Nominal/TySch.thy	Sat Mar 20 09:27:28 2010 +0100
@@ -5,7 +5,7 @@
 atom_decl name
 
 ML {* val _ = cheat_fv_rsp := false *}
-ML {* val _ = cheat_const_rsp := false *}
+ML {* val _ = cheat_alpha_bn_rsp := false *}
 ML {* val _ = cheat_equivp := false *}
 
 nominal_datatype t =
--- a/TODO	Sat Mar 20 08:56:07 2010 +0100
+++ b/TODO	Sat Mar 20 09:27:28 2010 +0100
@@ -24,10 +24,10 @@
 
 - strong induction rules
 
-- show support equations
+- check support equations for more bindings per constructor
 
 - automate the proofs that are currently proved with sorry:
-  alpha_equivp, fv_rsp, alpha_bn_rsp, alpha_bn_reflp
+  alpha_equivp, fv_rsp, alpha_bn_rsp
 
 - store information about defined nominal datatypes, so that
   it can be used to define new types that depend on these