diff -r 6471e252f14e -r 78fdc6b36a1c Nominal-General/Nominal2_Eqvt.thy --- a/Nominal-General/Nominal2_Eqvt.thy Fri Apr 09 09:02:54 2010 -0700 +++ b/Nominal-General/Nominal2_Eqvt.thy Fri Apr 09 21:51:01 2010 +0200 @@ -223,6 +223,13 @@ shows "a \ ()" by (simp add: fresh_def supp_unit) +lemma permute_eqvt_raw: + shows "p \ permute = permute" +apply(simp add: expand_fun_eq permute_fun_def) +apply(subst permute_eqvt) +apply(simp) +done + section {* Equivariance automation *} text {* Setup of the theorem attributes @{text eqvt} and @{text eqvt_force} *} @@ -237,9 +244,7 @@ imp_eqvt [folded induct_implies_def] (* nominal *) - (*permute_eqvt commented out since it loops *) supp_eqvt fresh_eqvt - permute_pure (* datatypes *) permute_prod.simps append_eqvt rev_eqvt set_eqvt @@ -251,6 +256,9 @@ atom_eqvt add_perm_eqvt +lemmas [eqvt_raw] = + permute_eqvt_raw[THEN eq_reflection] (* the normal version of this lemma loops *) + thm eqvts thm eqvts_raw @@ -274,31 +282,93 @@ shows "p \ unpermute p x \ x" unfolding unpermute_def by simp +ML {* @{const Trueprop} *} + use "nominal_permeq.ML" - +setup Nominal_Permeq.setup -lemma "p \ (A \ B = C)" -apply (tactic {* Nominal_Permeq.eqvt_tac @{context} 1 *}) +method_setup perm_simp = + {* Attrib.thms >> (fn thms => fn ctxt => SIMPLE_METHOD (HEADGOAL (Nominal_Permeq.eqvt_tac ctxt thms))) *} + {* pushes permutations inside *} + +declare [[trace_eqvt = true]] + +lemma + fixes B::"'a::pt" + shows "p \ (B = C)" +apply(perm_simp) oops -lemma "p \ (\(x::'a::pt). A \ (B::'a \ bool) x = C) = foo" -apply (tactic {* Nominal_Permeq.eqvt_tac @{context} 1 *}) +lemma + fixes B::"bool" + shows "p \ (B = C)" +apply(perm_simp) +oops + +lemma + fixes B::"bool" + shows "p \ (A \ B = C)" +apply (perm_simp) +oops + +lemma + shows "p \ (\(x::'a::pt). A \ (B::'a \ bool) x = C) = foo" +apply(perm_simp) +oops + +lemma + shows "p \ (\B::bool. A \ (B = C)) = foo" +apply (perm_simp) +oops + +lemma + shows "p \ (\x y. \z. x = z \ x = y \ z \ x) = foo" +apply (perm_simp) oops -lemma "p \ (\x y. \z. x = z \ x = y \ z \ x) = foo" -apply (tactic {* Nominal_Permeq.eqvt_tac @{context} 1 *}) +lemma + shows "p \ (\f x. f (g (f x))) = foo" +apply (perm_simp) +oops + +lemma + fixes p q::"perm" + and x::"'a::pt" + shows "p \ (q \ x) = foo" +apply(perm_simp) +oops + +lemma + fixes p q r::"perm" + and x::"'a::pt" + shows "p \ (q \ r \ x) = foo" +apply(perm_simp) oops -lemma "p \ (\f x. f (g (f x))) = foo" -apply (tactic {* Nominal_Permeq.eqvt_tac @{context} 1 *}) +lemma + fixes p r::"perm" + shows "p \ (\q::perm. q \ (r \ x)) = foo" +apply (perm_simp) oops -lemma "p \ (\q. q \ (r \ x)) = foo" -apply (tactic {* Nominal_Permeq.eqvt_tac @{context} 1 *}) +lemma + fixes p q r::"perm" + and x::"'a::pt" + shows "p \ (q \ r \ x) = foo" +apply(perm_simp) oops -lemma "p \ (q \ r \ x) = foo" -apply (tactic {* Nominal_Permeq.eqvt_tac @{context} 1 *}) +lemma + fixes C D::"bool" + shows "B (p \ (C = D))" +apply(perm_simp) +oops + +declare [[trace_eqvt = false]] + +text {* Problem: there is no raw eqvt-rule for The *} +lemma "p \ (THE x. P x) = foo" +apply(perm_simp) oops