src/HOL/Nominal/nominal_permeq.ML
author urbanc
Tue, 29 Aug 2006 21:43:34 +0200
changeset 20431 eef4e9081bea
parent 20289 ba7a7c56bed5
child 20854 f9cf9e62d11c
permissions -rw-r--r--
added a FIXME-comment
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19494
2e909d5309f4 Renamed "nominal" theory to "Nominal".
berghofe
parents: 19477
diff changeset
     1
(*  Title:      HOL/Nominal/nominal_permeq.ML
2e909d5309f4 Renamed "nominal" theory to "Nominal".
berghofe
parents: 19477
diff changeset
     2
    ID:         $Id$
2e909d5309f4 Renamed "nominal" theory to "Nominal".
berghofe
parents: 19477
diff changeset
     3
    Author:     Christian Urban, TU Muenchen
17870
c35381811d5c Initial revision.
berghofe
parents:
diff changeset
     4
19494
2e909d5309f4 Renamed "nominal" theory to "Nominal".
berghofe
parents: 19477
diff changeset
     5
Methods for simplifying permutations and
2e909d5309f4 Renamed "nominal" theory to "Nominal".
berghofe
parents: 19477
diff changeset
     6
for analysing equations involving permutations.
2e909d5309f4 Renamed "nominal" theory to "Nominal".
berghofe
parents: 19477
diff changeset
     7
*)
17870
c35381811d5c Initial revision.
berghofe
parents:
diff changeset
     8
20431
eef4e9081bea added a FIXME-comment
urbanc
parents: 20289
diff changeset
     9
(*
eef4e9081bea added a FIXME-comment
urbanc
parents: 20289
diff changeset
    10
FIXMES:
eef4e9081bea added a FIXME-comment
urbanc
parents: 20289
diff changeset
    11
eef4e9081bea added a FIXME-comment
urbanc
parents: 20289
diff changeset
    12
 - allow the user to give an explicit set S in the
eef4e9081bea added a FIXME-comment
urbanc
parents: 20289
diff changeset
    13
   fresh_guess tactic which is then verified
eef4e9081bea added a FIXME-comment
urbanc
parents: 20289
diff changeset
    14
eef4e9081bea added a FIXME-comment
urbanc
parents: 20289
diff changeset
    15
 - the perm_compose tactic does not do an "outermost
eef4e9081bea added a FIXME-comment
urbanc
parents: 20289
diff changeset
    16
   rewriting" and can therefore not deal with goals
eef4e9081bea added a FIXME-comment
urbanc
parents: 20289
diff changeset
    17
   like
eef4e9081bea added a FIXME-comment
urbanc
parents: 20289
diff changeset
    18
eef4e9081bea added a FIXME-comment
urbanc
parents: 20289
diff changeset
    19
      [(a,b)] o pi1 o pi2 = ....
eef4e9081bea added a FIXME-comment
urbanc
parents: 20289
diff changeset
    20
eef4e9081bea added a FIXME-comment
urbanc
parents: 20289
diff changeset
    21
   rather it tries to permute pi1 over pi2, which 
eef4e9081bea added a FIXME-comment
urbanc
parents: 20289
diff changeset
    22
   results in a failure when used with the 
eef4e9081bea added a FIXME-comment
urbanc
parents: 20289
diff changeset
    23
   perm_(full)_simp tactics
eef4e9081bea added a FIXME-comment
urbanc
parents: 20289
diff changeset
    24
eef4e9081bea added a FIXME-comment
urbanc
parents: 20289
diff changeset
    25
*)
eef4e9081bea added a FIXME-comment
urbanc
parents: 20289
diff changeset
    26
eef4e9081bea added a FIXME-comment
urbanc
parents: 20289
diff changeset
    27
19987
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
    28
signature NOMINAL_PERMEQ =
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
    29
sig
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
    30
  val perm_simp_tac : simpset -> int -> tactic
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
    31
  val perm_full_simp_tac : simpset -> int -> tactic
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
    32
  val supports_tac : simpset -> int -> tactic
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
    33
  val finite_guess_tac : simpset -> int -> tactic
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
    34
  val fresh_guess_tac : simpset -> int -> tactic
17870
c35381811d5c Initial revision.
berghofe
parents:
diff changeset
    35
20289
ba7a7c56bed5 normalized Proof.context/method type aliases;
wenzelm
parents: 19993
diff changeset
    36
  val perm_eq_meth : Method.src -> Proof.context -> Proof.method
ba7a7c56bed5 normalized Proof.context/method type aliases;
wenzelm
parents: 19993
diff changeset
    37
  val perm_eq_meth_debug : Method.src -> Proof.context -> Proof.method
ba7a7c56bed5 normalized Proof.context/method type aliases;
wenzelm
parents: 19993
diff changeset
    38
  val perm_full_eq_meth : Method.src -> Proof.context -> Proof.method
ba7a7c56bed5 normalized Proof.context/method type aliases;
wenzelm
parents: 19993
diff changeset
    39
  val perm_full_eq_meth_debug : Method.src -> Proof.context -> Proof.method
ba7a7c56bed5 normalized Proof.context/method type aliases;
wenzelm
parents: 19993
diff changeset
    40
  val supports_meth : Method.src -> Proof.context -> Proof.method
ba7a7c56bed5 normalized Proof.context/method type aliases;
wenzelm
parents: 19993
diff changeset
    41
  val supports_meth_debug : Method.src -> Proof.context -> Proof.method
ba7a7c56bed5 normalized Proof.context/method type aliases;
wenzelm
parents: 19993
diff changeset
    42
  val finite_gs_meth : Method.src -> Proof.context -> Proof.method
ba7a7c56bed5 normalized Proof.context/method type aliases;
wenzelm
parents: 19993
diff changeset
    43
  val finite_gs_meth_debug : Method.src -> Proof.context -> Proof.method
ba7a7c56bed5 normalized Proof.context/method type aliases;
wenzelm
parents: 19993
diff changeset
    44
  val fresh_gs_meth : Method.src -> Proof.context -> Proof.method
ba7a7c56bed5 normalized Proof.context/method type aliases;
wenzelm
parents: 19993
diff changeset
    45
  val fresh_gs_meth_debug : Method.src -> Proof.context -> Proof.method
19987
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
    46
end
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
    47
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
    48
structure NominalPermeq : NOMINAL_PERMEQ =
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
    49
struct
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
    50
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
    51
(* pulls out dynamically a thm via the proof state *)
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
    52
fun dynamic_thms st name = PureThy.get_thms (theory_of_thm st) (Name name);
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
    53
fun dynamic_thm st name = PureThy.get_thm (theory_of_thm st) (Name name);
18012
23e6cfda8c4b Added (optional) arguments to the tactics
urbanc
parents: 17870
diff changeset
    54
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
    55
(* a tactic simplyfying permutations *)
19494
2e909d5309f4 Renamed "nominal" theory to "Nominal".
berghofe
parents: 19477
diff changeset
    56
val perm_fun_def = thm "Nominal.perm_fun_def"
2e909d5309f4 Renamed "nominal" theory to "Nominal".
berghofe
parents: 19477
diff changeset
    57
val perm_eq_app = thm "Nominal.pt_fun_app_eq"
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
    58
19987
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
    59
fun perm_eval_tac ss i = ("general simplification step", fn st =>
18012
23e6cfda8c4b Added (optional) arguments to the tactics
urbanc
parents: 17870
diff changeset
    60
    let
19139
af69e41eab5d improved the decision-procedure for permutations;
urbanc
parents: 18434
diff changeset
    61
        fun perm_eval_simproc sg ss redex =
19169
20a73345dd6e fixed a problem where a permutation is not analysed
urbanc
parents: 19163
diff changeset
    62
        let 
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
    63
	   (* the "application" case below is only applicable when the head   *)
19169
20a73345dd6e fixed a problem where a permutation is not analysed
urbanc
parents: 19163
diff changeset
    64
           (* of f is not a constant  or when it is a permuattion with two or *) 
20a73345dd6e fixed a problem where a permutation is not analysed
urbanc
parents: 19163
diff changeset
    65
           (* more arguments                                                  *)
20a73345dd6e fixed a problem where a permutation is not analysed
urbanc
parents: 19163
diff changeset
    66
           fun applicable t = 
20a73345dd6e fixed a problem where a permutation is not analysed
urbanc
parents: 19163
diff changeset
    67
	       (case (strip_comb t) of
19494
2e909d5309f4 Renamed "nominal" theory to "Nominal".
berghofe
parents: 19477
diff changeset
    68
		  (Const ("Nominal.perm",_),ts) => (length ts) >= 2
19169
20a73345dd6e fixed a problem where a permutation is not analysed
urbanc
parents: 19163
diff changeset
    69
		| (Const _,_) => false
20a73345dd6e fixed a problem where a permutation is not analysed
urbanc
parents: 19163
diff changeset
    70
		| _ => true)
20a73345dd6e fixed a problem where a permutation is not analysed
urbanc
parents: 19163
diff changeset
    71
20a73345dd6e fixed a problem where a permutation is not analysed
urbanc
parents: 19163
diff changeset
    72
	in
19139
af69e41eab5d improved the decision-procedure for permutations;
urbanc
parents: 18434
diff changeset
    73
        (case redex of 
19169
20a73345dd6e fixed a problem where a permutation is not analysed
urbanc
parents: 19163
diff changeset
    74
        (* case pi o (f x) == (pi o f) (pi o x)          *)
20a73345dd6e fixed a problem where a permutation is not analysed
urbanc
parents: 19163
diff changeset
    75
        (* special treatment according to the head of f  *)
19494
2e909d5309f4 Renamed "nominal" theory to "Nominal".
berghofe
parents: 19477
diff changeset
    76
        (Const("Nominal.perm",
19169
20a73345dd6e fixed a problem where a permutation is not analysed
urbanc
parents: 19163
diff changeset
    77
          Type("fun",[Type("List.list",[Type("*",[Type(n,_),_])]),_])) $ pi $ (f $ x)) => 
20a73345dd6e fixed a problem where a permutation is not analysed
urbanc
parents: 19163
diff changeset
    78
	   (case (applicable f) of
20a73345dd6e fixed a problem where a permutation is not analysed
urbanc
parents: 19163
diff changeset
    79
                false => NONE  
19163
b61039bf141f made some small tunings in the decision-procedure
urbanc
parents: 19151
diff changeset
    80
              | _ => 
b61039bf141f made some small tunings in the decision-procedure
urbanc
parents: 19151
diff changeset
    81
		let
b61039bf141f made some small tunings in the decision-procedure
urbanc
parents: 19151
diff changeset
    82
		    val name = Sign.base_name n
19987
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
    83
		    val at_inst     = dynamic_thm st ("at_"^name^"_inst")
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
    84
		    val pt_inst     = dynamic_thm st ("pt_"^name^"_inst")  
19163
b61039bf141f made some small tunings in the decision-procedure
urbanc
parents: 19151
diff changeset
    85
		in SOME ((at_inst RS (pt_inst RS perm_eq_app)) RS eq_reflection) end)
19139
af69e41eab5d improved the decision-procedure for permutations;
urbanc
parents: 18434
diff changeset
    86
af69e41eab5d improved the decision-procedure for permutations;
urbanc
parents: 18434
diff changeset
    87
        (* case pi o (%x. f x) == (%x. pi o (f ((rev pi)o x))) *)
19494
2e909d5309f4 Renamed "nominal" theory to "Nominal".
berghofe
parents: 19477
diff changeset
    88
        | (Const("Nominal.perm",_) $ pi $ (Abs _)) => SOME (perm_fun_def)
19139
af69e41eab5d improved the decision-procedure for permutations;
urbanc
parents: 18434
diff changeset
    89
af69e41eab5d improved the decision-procedure for permutations;
urbanc
parents: 18434
diff changeset
    90
        (* no redex otherwise *) 
19169
20a73345dd6e fixed a problem where a permutation is not analysed
urbanc
parents: 19163
diff changeset
    91
        | _ => NONE) end
19139
af69e41eab5d improved the decision-procedure for permutations;
urbanc
parents: 18434
diff changeset
    92
af69e41eab5d improved the decision-procedure for permutations;
urbanc
parents: 18434
diff changeset
    93
	val perm_eval =
af69e41eab5d improved the decision-procedure for permutations;
urbanc
parents: 18434
diff changeset
    94
	    Simplifier.simproc (Theory.sign_of (the_context ())) "perm_eval" 
19494
2e909d5309f4 Renamed "nominal" theory to "Nominal".
berghofe
parents: 19477
diff changeset
    95
	    ["Nominal.perm pi x"] perm_eval_simproc;
19139
af69e41eab5d improved the decision-procedure for permutations;
urbanc
parents: 18434
diff changeset
    96
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
    97
      (* these lemmas are created dynamically according to the atom types *) 
19987
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
    98
      val perm_swap        = dynamic_thms st "perm_swap"
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
    99
      val perm_fresh       = dynamic_thms st "perm_fresh_fresh"
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
   100
      val perm_bij         = dynamic_thms st "perm_bij"
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
   101
      val perm_pi_simp     = dynamic_thms st "perm_pi_simp"
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   102
      val ss' = ss addsimps (perm_swap@perm_fresh@perm_bij@perm_pi_simp)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   103
    in
19987
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
   104
      asm_full_simp_tac (ss' addsimprocs [perm_eval]) i st
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
   105
    end);
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   106
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   107
(* applies the perm_compose rule such that                             *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   108
(*                                                                     *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   109
(*   pi o (pi' o lhs) = rhs                                            *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   110
(*                                                                     *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   111
(* is transformed to                                                   *) 
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   112
(*                                                                     *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   113
(*  (pi o pi') o (pi' o lhs) = rhs                                     *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   114
(*                                                                     *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   115
(* this rule would loop in the simplifier, so some trick is used with  *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   116
(* generating perm_aux'es for the outermost permutation and then un-   *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   117
(* folding the definition                                              *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   118
val pt_perm_compose_aux = thm "pt_perm_compose_aux";
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   119
val cp1_aux             = thm "cp1_aux";
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   120
val perm_aux_fold       = thm "perm_aux_fold"; 
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   121
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   122
fun perm_compose_tac ss i = 
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   123
    let
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   124
	fun perm_compose_simproc sg ss redex =
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   125
	(case redex of
19494
2e909d5309f4 Renamed "nominal" theory to "Nominal".
berghofe
parents: 19477
diff changeset
   126
           (Const ("Nominal.perm", Type ("fun", [Type ("List.list", 
2e909d5309f4 Renamed "nominal" theory to "Nominal".
berghofe
parents: 19477
diff changeset
   127
             [Type ("*", [T as Type (tname,_),_])]),_])) $ pi1 $ (Const ("Nominal.perm", 
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   128
               Type ("fun", [Type ("List.list", [Type ("*", [U as Type (uname,_),_])]),_])) $ 
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   129
                pi2 $ t)) =>
19350
2e1c7ca05ee0 modified the perm_compose rule such that it
urbanc
parents: 19169
diff changeset
   130
        let
2e1c7ca05ee0 modified the perm_compose rule such that it
urbanc
parents: 19169
diff changeset
   131
	    val tname' = Sign.base_name tname
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   132
            val uname' = Sign.base_name uname
19350
2e1c7ca05ee0 modified the perm_compose rule such that it
urbanc
parents: 19169
diff changeset
   133
        in
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   134
            if pi1 <> pi2 then  (* only apply the composition rule in this case *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   135
               if T = U then    
19350
2e1c7ca05ee0 modified the perm_compose rule such that it
urbanc
parents: 19169
diff changeset
   136
                SOME (Drule.instantiate'
2e1c7ca05ee0 modified the perm_compose rule such that it
urbanc
parents: 19169
diff changeset
   137
	              [SOME (ctyp_of sg (fastype_of t))]
2e1c7ca05ee0 modified the perm_compose rule such that it
urbanc
parents: 19169
diff changeset
   138
		      [SOME (cterm_of sg pi1), SOME (cterm_of sg pi2), SOME (cterm_of sg t)]
2e1c7ca05ee0 modified the perm_compose rule such that it
urbanc
parents: 19169
diff changeset
   139
		      (mk_meta_eq ([PureThy.get_thm sg (Name ("pt_"^tname'^"_inst")),
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   140
	               PureThy.get_thm sg (Name ("at_"^tname'^"_inst"))] MRS pt_perm_compose_aux)))
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   141
               else
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   142
                SOME (Drule.instantiate'
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   143
	              [SOME (ctyp_of sg (fastype_of t))]
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   144
		      [SOME (cterm_of sg pi1), SOME (cterm_of sg pi2), SOME (cterm_of sg t)]
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   145
		      (mk_meta_eq (PureThy.get_thm sg (Name ("cp_"^tname'^"_"^uname'^"_inst")) RS 
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   146
                       cp1_aux)))
19350
2e1c7ca05ee0 modified the perm_compose rule such that it
urbanc
parents: 19169
diff changeset
   147
            else NONE
2e1c7ca05ee0 modified the perm_compose rule such that it
urbanc
parents: 19169
diff changeset
   148
        end
2e1c7ca05ee0 modified the perm_compose rule such that it
urbanc
parents: 19169
diff changeset
   149
       | _ => NONE);
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   150
	  
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   151
      val perm_compose  =
19350
2e1c7ca05ee0 modified the perm_compose rule such that it
urbanc
parents: 19169
diff changeset
   152
	Simplifier.simproc (the_context()) "perm_compose" 
19494
2e909d5309f4 Renamed "nominal" theory to "Nominal".
berghofe
parents: 19477
diff changeset
   153
	["Nominal.perm pi1 (Nominal.perm pi2 t)"] perm_compose_simproc;
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   154
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   155
      val ss' = Simplifier.theory_context (the_context ()) empty_ss	  
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   156
18012
23e6cfda8c4b Added (optional) arguments to the tactics
urbanc
parents: 17870
diff changeset
   157
    in
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   158
	("analysing permutation compositions on the lhs",
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   159
         EVERY [rtac trans i,
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   160
                asm_full_simp_tac (ss' addsimprocs [perm_compose]) i,
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   161
                asm_full_simp_tac (HOL_basic_ss addsimps [perm_aux_fold]) i])
18012
23e6cfda8c4b Added (optional) arguments to the tactics
urbanc
parents: 17870
diff changeset
   162
    end
23e6cfda8c4b Added (optional) arguments to the tactics
urbanc
parents: 17870
diff changeset
   163
23e6cfda8c4b Added (optional) arguments to the tactics
urbanc
parents: 17870
diff changeset
   164
(* applying Stefan's smart congruence tac *)
23e6cfda8c4b Added (optional) arguments to the tactics
urbanc
parents: 17870
diff changeset
   165
fun apply_cong_tac i = 
23e6cfda8c4b Added (optional) arguments to the tactics
urbanc
parents: 17870
diff changeset
   166
    ("application of congruence",
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   167
     (fn st => DatatypeAux.cong_tac i st handle Subscript => no_tac st));
17870
c35381811d5c Initial revision.
berghofe
parents:
diff changeset
   168
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   169
(* unfolds the definition of permutations     *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   170
(* applied to functions such that             *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   171
(*                                            *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   172
(*   pi o f = rhs                             *)  
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   173
(*                                            *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   174
(* is transformed to                          *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   175
(*                                            *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   176
(*   %x. pi o (f ((rev pi) o x)) = rhs        *)
18012
23e6cfda8c4b Added (optional) arguments to the tactics
urbanc
parents: 17870
diff changeset
   177
fun unfold_perm_fun_def_tac i = 
23e6cfda8c4b Added (optional) arguments to the tactics
urbanc
parents: 17870
diff changeset
   178
    let
19494
2e909d5309f4 Renamed "nominal" theory to "Nominal".
berghofe
parents: 19477
diff changeset
   179
	val perm_fun_def = thm "Nominal.perm_fun_def"
18012
23e6cfda8c4b Added (optional) arguments to the tactics
urbanc
parents: 17870
diff changeset
   180
    in
23e6cfda8c4b Added (optional) arguments to the tactics
urbanc
parents: 17870
diff changeset
   181
	("unfolding of permutations on functions", 
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   182
         rtac (perm_fun_def RS meta_eq_to_obj_eq RS trans) i)
17870
c35381811d5c Initial revision.
berghofe
parents:
diff changeset
   183
    end
c35381811d5c Initial revision.
berghofe
parents:
diff changeset
   184
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   185
(* applies the ext-rule such that      *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   186
(*                                     *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   187
(*    f = g    goes to /\x. f x = g x  *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   188
fun ext_fun_tac i = ("extensionality expansion of functions", rtac ext i);
17870
c35381811d5c Initial revision.
berghofe
parents:
diff changeset
   189
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   190
(* FIXME FIXME FIXME *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   191
(* should be able to analyse pi o fresh_fun () = fresh_fun instances *) 
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   192
fun fresh_fun_eqvt_tac i =
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   193
    let
19494
2e909d5309f4 Renamed "nominal" theory to "Nominal".
berghofe
parents: 19477
diff changeset
   194
	val fresh_fun_equiv = thm "Nominal.fresh_fun_equiv_ineq"
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   195
    in
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   196
	("fresh_fun equivariance", rtac (fresh_fun_equiv RS trans) i)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   197
    end		       
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   198
		       
17870
c35381811d5c Initial revision.
berghofe
parents:
diff changeset
   199
(* debugging *)
c35381811d5c Initial revision.
berghofe
parents:
diff changeset
   200
fun DEBUG_tac (msg,tac) = 
19169
20a73345dd6e fixed a problem where a permutation is not analysed
urbanc
parents: 19163
diff changeset
   201
    CHANGED (EVERY [tac, print_tac ("after "^msg)]); 
17870
c35381811d5c Initial revision.
berghofe
parents:
diff changeset
   202
fun NO_DEBUG_tac (_,tac) = CHANGED tac; 
c35381811d5c Initial revision.
berghofe
parents:
diff changeset
   203
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   204
(* Main Tactics *)
18012
23e6cfda8c4b Added (optional) arguments to the tactics
urbanc
parents: 17870
diff changeset
   205
fun perm_simp_tac tactical ss i = 
19139
af69e41eab5d improved the decision-procedure for permutations;
urbanc
parents: 18434
diff changeset
   206
    DETERM (tactical (perm_eval_tac ss i));
af69e41eab5d improved the decision-procedure for permutations;
urbanc
parents: 18434
diff changeset
   207
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   208
(* perm_full_simp_tac is perm_simp_tac plus additional tactics    *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   209
(* to decide equation that come from support problems             *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   210
(* since it contains looping rules the "recursion" - depth is set *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   211
(* to 10 - this seems to be sufficient in most cases              *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   212
fun perm_full_simp_tac tactical ss =
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   213
  let fun perm_full_simp_tac_aux tactical ss n = 
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   214
	  if n=0 then K all_tac
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   215
	  else DETERM o 
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   216
	       (FIRST'[fn i => tactical ("splitting conjunctions on the rhs", rtac conjI i),
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   217
                       fn i => tactical (perm_eval_tac ss i),
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   218
		       fn i => tactical (perm_compose_tac ss i),
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   219
		       fn i => tactical (apply_cong_tac i), 
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   220
                       fn i => tactical (unfold_perm_fun_def_tac i),
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   221
                       fn i => tactical (ext_fun_tac i), 
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   222
                       fn i => tactical (fresh_fun_eqvt_tac i)]
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   223
		      THEN_ALL_NEW (TRY o (perm_full_simp_tac_aux tactical ss (n-1))))
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   224
  in perm_full_simp_tac_aux tactical ss 10 end;
19151
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   225
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   226
(* tactic that first unfolds the support definition           *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   227
(* and strips off the intros, then applies perm_full_simp_tac *)
18012
23e6cfda8c4b Added (optional) arguments to the tactics
urbanc
parents: 17870
diff changeset
   228
fun supports_tac tactical ss i =
23e6cfda8c4b Added (optional) arguments to the tactics
urbanc
parents: 17870
diff changeset
   229
  let 
19494
2e909d5309f4 Renamed "nominal" theory to "Nominal".
berghofe
parents: 19477
diff changeset
   230
      val supports_def = thm "Nominal.op supports_def";
2e909d5309f4 Renamed "nominal" theory to "Nominal".
berghofe
parents: 19477
diff changeset
   231
      val fresh_def    = thm "Nominal.fresh_def";
2e909d5309f4 Renamed "nominal" theory to "Nominal".
berghofe
parents: 19477
diff changeset
   232
      val fresh_prod   = thm "Nominal.fresh_prod";
18012
23e6cfda8c4b Added (optional) arguments to the tactics
urbanc
parents: 17870
diff changeset
   233
      val simps        = [supports_def,symmetric fresh_def,fresh_prod]
17870
c35381811d5c Initial revision.
berghofe
parents:
diff changeset
   234
  in
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   235
      EVERY [tactical ("unfolding of supports   ", simp_tac (HOL_basic_ss addsimps simps) i),
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   236
             tactical ("stripping of foralls    ", REPEAT_DETERM (rtac allI i)),
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   237
             tactical ("geting rid of the imps  ", rtac impI i),
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   238
             tactical ("eliminating conjuncts   ", REPEAT_DETERM (etac  conjE i)),
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   239
             tactical ("applying perm_full_simp ", perm_full_simp_tac tactical ss i
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   240
                                                   (*perm_simp_tac tactical ss i*))]
17870
c35381811d5c Initial revision.
berghofe
parents:
diff changeset
   241
  end;
c35381811d5c Initial revision.
berghofe
parents:
diff changeset
   242
19151
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   243
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   244
(* tactic that guesses the finite-support of a goal       *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   245
(* it collects all free variables and tries to show       *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   246
(* that the support of these free variables (op supports) *)
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   247
(* the goal                                               *)
19151
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   248
fun collect_vars i (Bound j) vs = if j < i then vs else Bound (j - i) ins vs
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   249
  | collect_vars i (v as Free _) vs = v ins vs
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   250
  | collect_vars i (v as Var _) vs = v ins vs
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   251
  | collect_vars i (Const _) vs = vs
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   252
  | collect_vars i (Abs (_, _, t)) vs = collect_vars (i+1) t vs
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   253
  | collect_vars i (t $ u) vs = collect_vars i u (collect_vars i t vs);
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   254
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   255
val supports_rule = thm "supports_finite";
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   256
19987
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
   257
val supp_prod = thm "supp_prod";
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
   258
val supp_unit = thm "supp_unit";
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
   259
19151
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   260
fun finite_guess_tac tactical ss i st =
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   261
    let val goal = List.nth(cprems_of st, i-1)
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   262
    in
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   263
      case Logic.strip_assums_concl (term_of goal) of
19494
2e909d5309f4 Renamed "nominal" theory to "Nominal".
berghofe
parents: 19477
diff changeset
   264
          _ $ (Const ("op :", _) $ (Const ("Nominal.supp", T) $ x) $
19151
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   265
            Const ("Finite_Set.Finites", _)) =>
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   266
          let
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   267
            val cert = Thm.cterm_of (sign_of_thm st);
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   268
            val ps = Logic.strip_params (term_of goal);
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   269
            val Ts = rev (map snd ps);
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   270
            val vs = collect_vars 0 x [];
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   271
            val s = foldr (fn (v, s) =>
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   272
                HOLogic.pair_const (fastype_of1 (Ts, v)) (fastype_of1 (Ts, s)) $ v $ s)
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   273
              HOLogic.unit vs;
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   274
            val s' = list_abs (ps,
19494
2e909d5309f4 Renamed "nominal" theory to "Nominal".
berghofe
parents: 19477
diff changeset
   275
              Const ("Nominal.supp", fastype_of1 (Ts, s) --> body_type T) $ s);
19151
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   276
            val supports_rule' = Thm.lift_rule goal supports_rule;
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   277
            val _ $ (_ $ S $ _) =
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   278
              Logic.strip_assums_concl (hd (prems_of supports_rule'));
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   279
            val supports_rule'' = Drule.cterm_instantiate
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   280
              [(cert (head_of S), cert s')] supports_rule'
19987
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
   281
            val ss' = ss addsimps [supp_prod, supp_unit, finite_Un, Finites.emptyI]
19151
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   282
          in
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   283
            (tactical ("guessing of the right supports-set",
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   284
                      EVERY [compose_tac (false, supports_rule'', 2) i,
19987
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
   285
                             asm_full_simp_tac ss' (i+1),
19151
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   286
                             supports_tac tactical ss i])) st
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   287
          end
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   288
        | _ => Seq.empty
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   289
    end
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   290
    handle Subscript => Seq.empty
66e841b1001e added a finite_guess tactic, which solves
urbanc
parents: 19144
diff changeset
   291
19857
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   292
val supports_fresh_rule = thm "supports_fresh";
19993
e0a5783d708f added simplification rules to the fresh_guess tactic
urbanc
parents: 19987
diff changeset
   293
val fresh_def           = thm "Nominal.fresh_def";
e0a5783d708f added simplification rules to the fresh_guess tactic
urbanc
parents: 19987
diff changeset
   294
val fresh_prod          = thm "Nominal.fresh_prod";
e0a5783d708f added simplification rules to the fresh_guess tactic
urbanc
parents: 19987
diff changeset
   295
val fresh_unit          = thm "Nominal.fresh_unit";
19857
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   296
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   297
fun fresh_guess_tac tactical ss i st =
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   298
    let 
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   299
	val goal = List.nth(cprems_of st, i-1)
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   300
    in
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   301
      case Logic.strip_assums_concl (term_of goal) of
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   302
          _ $ (Const ("Nominal.fresh", Type ("fun", [T, _])) $ _ $ t) => 
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   303
          let
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   304
            val cert = Thm.cterm_of (sign_of_thm st);
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   305
            val ps = Logic.strip_params (term_of goal);
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   306
            val Ts = rev (map snd ps);
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   307
            val vs = collect_vars 0 t [];
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   308
            val s = foldr (fn (v, s) =>
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   309
                HOLogic.pair_const (fastype_of1 (Ts, v)) (fastype_of1 (Ts, s)) $ v $ s)
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   310
              HOLogic.unit vs;
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   311
            val s' = list_abs (ps,
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   312
              Const ("Nominal.supp", fastype_of1 (Ts, s) --> (HOLogic.mk_setT T)) $ s);
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   313
            val supports_fresh_rule' = Thm.lift_rule goal supports_fresh_rule;
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   314
            val _ $ (_ $ S $ _) =
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   315
              Logic.strip_assums_concl (hd (prems_of supports_fresh_rule'));
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   316
            val supports_fresh_rule'' = Drule.cterm_instantiate
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   317
              [(cert (head_of S), cert s')] supports_fresh_rule'
19993
e0a5783d708f added simplification rules to the fresh_guess tactic
urbanc
parents: 19987
diff changeset
   318
	    val ss1 = ss addsimps [symmetric fresh_def,fresh_prod,fresh_unit]
e0a5783d708f added simplification rules to the fresh_guess tactic
urbanc
parents: 19987
diff changeset
   319
            val ss2 = ss addsimps [supp_prod,supp_unit,finite_Un,Finites.emptyI]
e0a5783d708f added simplification rules to the fresh_guess tactic
urbanc
parents: 19987
diff changeset
   320
            (* FIXME sometimes these rewrite rules are already in the ss, *)
e0a5783d708f added simplification rules to the fresh_guess tactic
urbanc
parents: 19987
diff changeset
   321
            (* which produces a warning                                   *)
19857
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   322
          in
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   323
            (tactical ("guessing of the right set that supports the goal",
19858
d319e39a2e0e added lemma fresh_unit to Nominal.thy
urbanc
parents: 19857
diff changeset
   324
                      EVERY [compose_tac (false, supports_fresh_rule'', 3) i,
19993
e0a5783d708f added simplification rules to the fresh_guess tactic
urbanc
parents: 19987
diff changeset
   325
                             asm_full_simp_tac ss1 (i+2),
e0a5783d708f added simplification rules to the fresh_guess tactic
urbanc
parents: 19987
diff changeset
   326
                             asm_full_simp_tac ss2 (i+1), 
19858
d319e39a2e0e added lemma fresh_unit to Nominal.thy
urbanc
parents: 19857
diff changeset
   327
                             supports_tac tactical ss i])) st
19857
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   328
          end
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   329
        | _ => Seq.empty
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   330
    end
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   331
    handle Subscript => Seq.empty
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   332
18012
23e6cfda8c4b Added (optional) arguments to the tactics
urbanc
parents: 17870
diff changeset
   333
fun simp_meth_setup tac =
18046
b7389981170b Changed Simplifier.simp_modifiers to Simplifier.simp_modifiers'.
urbanc
parents: 18012
diff changeset
   334
  Method.only_sectioned_args (Simplifier.simp_modifiers' @ Splitter.split_modifiers)
18012
23e6cfda8c4b Added (optional) arguments to the tactics
urbanc
parents: 17870
diff changeset
   335
  (Method.SIMPLE_METHOD' HEADGOAL o tac o local_simpset_of);
17870
c35381811d5c Initial revision.
berghofe
parents:
diff changeset
   336
19477
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   337
val perm_eq_meth            = simp_meth_setup (perm_simp_tac NO_DEBUG_tac);
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   338
val perm_eq_meth_debug      = simp_meth_setup (perm_simp_tac DEBUG_tac);
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   339
val perm_full_eq_meth       = simp_meth_setup (perm_full_simp_tac NO_DEBUG_tac);
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   340
val perm_full_eq_meth_debug = simp_meth_setup (perm_full_simp_tac DEBUG_tac);
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   341
val supports_meth           = simp_meth_setup (supports_tac NO_DEBUG_tac);
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   342
val supports_meth_debug     = simp_meth_setup (supports_tac DEBUG_tac);
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   343
val finite_gs_meth          = simp_meth_setup (finite_guess_tac NO_DEBUG_tac);
a95176d0f0dd isar-keywords.el
urbanc
parents: 19350
diff changeset
   344
val finite_gs_meth_debug    = simp_meth_setup (finite_guess_tac DEBUG_tac);
19857
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   345
val fresh_gs_meth           = simp_meth_setup (fresh_guess_tac NO_DEBUG_tac);
a0c36e0fc897 Added fresh_guess_tac.
berghofe
parents: 19494
diff changeset
   346
val fresh_gs_meth_debug     = simp_meth_setup (fresh_guess_tac DEBUG_tac);
17870
c35381811d5c Initial revision.
berghofe
parents:
diff changeset
   347
19987
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
   348
(* FIXME: get rid of "debug" versions? *)
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
   349
val perm_simp_tac = perm_simp_tac NO_DEBUG_tac;
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
   350
val perm_full_simp_tac = perm_full_simp_tac NO_DEBUG_tac;
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
   351
val supports_tac = supports_tac NO_DEBUG_tac;
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
   352
val finite_guess_tac = finite_guess_tac NO_DEBUG_tac;
b97607d4d9a5 - put declarations inside a structure (NominalPermeq)
berghofe
parents: 19858
diff changeset
   353
val fresh_guess_tac = fresh_guess_tac NO_DEBUG_tac;
17870
c35381811d5c Initial revision.
berghofe
parents:
diff changeset
   354
20289
ba7a7c56bed5 normalized Proof.context/method type aliases;
wenzelm
parents: 19993
diff changeset
   355
end