Nominal/nominal_permeq.ML
author Christian Urban <urbanc@in.tum.de>
Sat, 02 Jul 2011 00:27:47 +0100
changeset 2931 aaef9dec5e1d
parent 2781 542ff50555f5
child 3183 313e6f2cdd89
permissions -rw-r--r--
side-by-side tests of lets with single assignment; deep-binder case works if the recursion is avoided using an auxiliary function
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1801
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
     1
(*  Title:      nominal_permeq.ML
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
     2
    Author:     Christian Urban
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
     3
    Author:     Brian Huffman
1037
2845e736dc1a added a first eqvt_tac which pushes permutations inside terms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
*)
2845e736dc1a added a first eqvt_tac which pushes permutations inside terms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
2765
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
     6
infix 4 addpres addposts addexcls
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
     7
1037
2845e736dc1a added a first eqvt_tac which pushes permutations inside terms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
signature NOMINAL_PERMEQ =
2845e736dc1a added a first eqvt_tac which pushes permutations inside terms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
sig
2765
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    10
  datatype eqvt_config = 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    11
    Eqvt_Config of {strict_mode: bool, pre_thms: thm list, post_thms: thm list, excluded: string list}
2610
f5c7375ab465 added theorem-rewriter conversion
Christian Urban <urbanc@in.tum.de>
parents: 2568
diff changeset
    12
2765
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    13
  val eqvt_relaxed_config: eqvt_config 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    14
  val eqvt_strict_config: eqvt_config
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    15
  val addpres : (eqvt_config * thm list) -> eqvt_config
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    16
  val addposts : (eqvt_config * thm list) -> eqvt_config
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    17
  val addexcls : (eqvt_config * string list) -> eqvt_config
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    18
  val delpres : eqvt_config -> eqvt_config
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    19
  val delposts : eqvt_config -> eqvt_config
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    20
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    21
  val eqvt_rule: Proof.context -> eqvt_config -> thm -> thm
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    22
  val eqvt_tac: Proof.context -> eqvt_config -> int -> tactic
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    23
1947
51f411b1197d tuned and cleaned
Christian Urban <urbanc@in.tum.de>
parents: 1866
diff changeset
    24
  val perm_simp_meth: thm list * string list -> Proof.context -> Method.method
51f411b1197d tuned and cleaned
Christian Urban <urbanc@in.tum.de>
parents: 1866
diff changeset
    25
  val perm_strict_simp_meth: thm list * string list -> Proof.context -> Method.method
51f411b1197d tuned and cleaned
Christian Urban <urbanc@in.tum.de>
parents: 1866
diff changeset
    26
  val args_parser: (thm list * string list) context_parser
51f411b1197d tuned and cleaned
Christian Urban <urbanc@in.tum.de>
parents: 1866
diff changeset
    27
1800
78fdc6b36a1c changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
    28
  val trace_eqvt: bool Config.T
1037
2845e736dc1a added a first eqvt_tac which pushes permutations inside terms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
end;
2845e736dc1a added a first eqvt_tac which pushes permutations inside terms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
1801
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
    31
(* 
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
    32
2765
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    33
- eqvt_tac and eqvt_rule take a  list of theorems which 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    34
  are first tried to simplify permutations
1801
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
    35
2765
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    36
- the string list contains constants that should not be
1801
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
    37
  analysed (for example there is no raw eqvt-lemma for
2080
0532006ec7ec added eqvt-lemma for split; changed semantics of perm_simp: excluded stands for constants about which no complaint is written out...eqvt_apply is now always applied
Christian Urban <urbanc@in.tum.de>
parents: 2069
diff changeset
    38
  the constant The); therefore it should not be analysed 
1037
2845e736dc1a added a first eqvt_tac which pushes permutations inside terms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
1801
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
    40
- setting [[trace_eqvt = true]] switches on tracing 
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
    41
  information  
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
    42
1037
2845e736dc1a added a first eqvt_tac which pushes permutations inside terms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
*)
2845e736dc1a added a first eqvt_tac which pushes permutations inside terms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
2845e736dc1a added a first eqvt_tac which pushes permutations inside terms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
structure Nominal_Permeq: NOMINAL_PERMEQ =
2845e736dc1a added a first eqvt_tac which pushes permutations inside terms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
struct
2845e736dc1a added a first eqvt_tac which pushes permutations inside terms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
1801
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
    48
open Nominal_ThmDecls;
1800
78fdc6b36a1c changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
    49
2765
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    50
datatype eqvt_config = Eqvt_Config of 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    51
  {strict_mode: bool, pre_thms: thm list, post_thms: thm list, excluded: string list}
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    52
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    53
fun (Eqvt_Config {strict_mode, pre_thms, post_thms, excluded}) addpres thms = 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    54
  Eqvt_Config { strict_mode = strict_mode, 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    55
                pre_thms = thms @ pre_thms, 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    56
                post_thms = post_thms, 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    57
                excluded = excluded }
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    58
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    59
fun (Eqvt_Config {strict_mode, pre_thms, post_thms, excluded}) addposts thms = 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    60
  Eqvt_Config { strict_mode = strict_mode, 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    61
                pre_thms = pre_thms, 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    62
                post_thms = thms @ post_thms,
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    63
                excluded = excluded }
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    64
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    65
fun (Eqvt_Config {strict_mode, pre_thms, post_thms, excluded}) addexcls excls = 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    66
  Eqvt_Config { strict_mode = strict_mode, 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    67
                pre_thms = pre_thms, 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    68
                post_thms = post_thms,
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    69
                excluded = excls @ excluded }
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    70
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    71
fun delpres (Eqvt_Config {strict_mode, pre_thms, post_thms, excluded}) = 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    72
  Eqvt_Config { strict_mode = strict_mode, 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    73
                pre_thms = [], 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    74
                post_thms = post_thms,
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    75
                excluded = excluded }
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    76
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    77
fun delposts (Eqvt_Config {strict_mode, pre_thms, post_thms, excluded}) = 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    78
  Eqvt_Config { strict_mode = strict_mode, 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    79
                pre_thms = pre_thms, 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    80
                post_thms = [],
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    81
                excluded = excluded }
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    82
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    83
val eqvt_relaxed_config =
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    84
  Eqvt_Config { strict_mode = false, 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    85
                pre_thms = @{thms eqvt_bound}, 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    86
                post_thms = @{thms permute_pure},
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    87
                excluded = [] }
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    88
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    89
val eqvt_strict_config = 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    90
  Eqvt_Config { strict_mode = true, 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    91
                pre_thms = @{thms eqvt_bound}, 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    92
                post_thms = @{thms permute_pure},
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    93
                excluded = [] }
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    94
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
    95
1801
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
    96
(* tracing infrastructure *)
2781
542ff50555f5 updated to new Isabelle (> 9 May)
Christian Urban <urbanc@in.tum.de>
parents: 2765
diff changeset
    97
val trace_eqvt = Attrib.setup_config_bool @{binding "trace_eqvt"} (K false);
1800
78fdc6b36a1c changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
    98
78fdc6b36a1c changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
    99
fun trace_enabled ctxt = Config.get ctxt trace_eqvt
1037
2845e736dc1a added a first eqvt_tac which pushes permutations inside terms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
1801
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
   101
fun trace_msg ctxt result = 
2477
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   102
  let
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   103
    val lhs_str = Syntax.string_of_term ctxt (term_of (Thm.lhs_of result))
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   104
    val rhs_str = Syntax.string_of_term ctxt (term_of (Thm.rhs_of result))
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   105
  in
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   106
    warning (Pretty.string_of (Pretty.strs ["Rewriting", lhs_str, "to", rhs_str]))
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   107
  end
1801
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
   108
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
   109
fun trace_conv ctxt conv ctrm =
2477
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   110
  let
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   111
    val result = conv ctrm
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   112
  in
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   113
    if Thm.is_reflexive result 
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   114
    then result
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   115
    else (trace_msg ctxt result; result)
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   116
  end
1801
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
   117
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
   118
(* this conversion always fails, but prints 
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
   119
   out the analysed term  *)
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
   120
fun trace_info_conv ctxt ctrm = 
2477
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   121
  let
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   122
    val trm = term_of ctrm
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   123
    val _ = case (head_of trm) of 
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   124
        @{const "Trueprop"} => ()
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   125
      | _ => warning ("Analysing term " ^ Syntax.string_of_term ctxt trm)
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   126
  in
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   127
    Conv.no_conv ctrm
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   128
  end
1801
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
   129
2080
0532006ec7ec added eqvt-lemma for split; changed semantics of perm_simp: excluded stands for constants about which no complaint is written out...eqvt_apply is now always applied
Christian Urban <urbanc@in.tum.de>
parents: 2069
diff changeset
   130
(* conversion for applications *)
0532006ec7ec added eqvt-lemma for split; changed semantics of perm_simp: excluded stands for constants about which no complaint is written out...eqvt_apply is now always applied
Christian Urban <urbanc@in.tum.de>
parents: 2069
diff changeset
   131
fun eqvt_apply_conv ctrm =
1801
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
   132
  case (term_of ctrm) of
2080
0532006ec7ec added eqvt-lemma for split; changed semantics of perm_simp: excluded stands for constants about which no complaint is written out...eqvt_apply is now always applied
Christian Urban <urbanc@in.tum.de>
parents: 2069
diff changeset
   133
    Const (@{const_name "permute"}, _) $ _ $ (_ $ _) =>
1800
78fdc6b36a1c changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
   134
      let
1801
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
   135
        val (perm, t) = Thm.dest_comb ctrm
1037
2845e736dc1a added a first eqvt_tac which pushes permutations inside terms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   136
        val (_, p) = Thm.dest_comb perm
2845e736dc1a added a first eqvt_tac which pushes permutations inside terms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   137
        val (f, x) = Thm.dest_comb t
2845e736dc1a added a first eqvt_tac which pushes permutations inside terms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   138
        val a = ctyp_of_term x;
2845e736dc1a added a first eqvt_tac which pushes permutations inside terms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   139
        val b = ctyp_of_term t;
2845e736dc1a added a first eqvt_tac which pushes permutations inside terms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   140
        val ty_insts = map SOME [b, a]
1800
78fdc6b36a1c changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
   141
        val term_insts = map SOME [p, f, x]                        
1037
2845e736dc1a added a first eqvt_tac which pushes permutations inside terms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   142
      in
2080
0532006ec7ec added eqvt-lemma for split; changed semantics of perm_simp: excluded stands for constants about which no complaint is written out...eqvt_apply is now always applied
Christian Urban <urbanc@in.tum.de>
parents: 2069
diff changeset
   143
        Drule.instantiate' ty_insts term_insts @{thm eqvt_apply}
1037
2845e736dc1a added a first eqvt_tac which pushes permutations inside terms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   144
      end
1801
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
   145
  | _ => Conv.no_conv ctrm
1037
2845e736dc1a added a first eqvt_tac which pushes permutations inside terms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   146
1800
78fdc6b36a1c changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
   147
(* conversion for lambdas *)
1801
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
   148
fun eqvt_lambda_conv ctrm =
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
   149
  case (term_of ctrm) of
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
   150
    Const (@{const_name "permute"}, _) $ _ $ (Abs _) =>
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
   151
      Conv.rewr_conv @{thm eqvt_lambda} ctrm
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
   152
  | _ => Conv.no_conv ctrm
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
   153
2080
0532006ec7ec added eqvt-lemma for split; changed semantics of perm_simp: excluded stands for constants about which no complaint is written out...eqvt_apply is now always applied
Christian Urban <urbanc@in.tum.de>
parents: 2069
diff changeset
   154
1801
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
   155
(* conversion that raises an error or prints a warning message, 
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
   156
   if a permutation on a constant or application cannot be analysed *)
2080
0532006ec7ec added eqvt-lemma for split; changed semantics of perm_simp: excluded stands for constants about which no complaint is written out...eqvt_apply is now always applied
Christian Urban <urbanc@in.tum.de>
parents: 2069
diff changeset
   157
0532006ec7ec added eqvt-lemma for split; changed semantics of perm_simp: excluded stands for constants about which no complaint is written out...eqvt_apply is now always applied
Christian Urban <urbanc@in.tum.de>
parents: 2069
diff changeset
   158
fun is_excluded excluded (Const (a, _)) = member (op=) excluded a 
0532006ec7ec added eqvt-lemma for split; changed semantics of perm_simp: excluded stands for constants about which no complaint is written out...eqvt_apply is now always applied
Christian Urban <urbanc@in.tum.de>
parents: 2069
diff changeset
   159
  | is_excluded _ _ = false 
0532006ec7ec added eqvt-lemma for split; changed semantics of perm_simp: excluded stands for constants about which no complaint is written out...eqvt_apply is now always applied
Christian Urban <urbanc@in.tum.de>
parents: 2069
diff changeset
   160
0532006ec7ec added eqvt-lemma for split; changed semantics of perm_simp: excluded stands for constants about which no complaint is written out...eqvt_apply is now always applied
Christian Urban <urbanc@in.tum.de>
parents: 2069
diff changeset
   161
fun progress_info_conv ctxt strict_flag excluded ctrm =
2477
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   162
  let
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   163
    fun msg trm =
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   164
      if is_excluded excluded trm then () else 
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   165
        (if strict_flag then error else warning) 
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   166
          ("Cannot solve equivariance for " ^ (Syntax.string_of_term ctxt trm))
1801
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
   167
2477
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   168
    val _ = case (term_of ctrm) of
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   169
        Const (@{const_name "permute"}, _) $ _ $ (trm as Const _) => msg trm
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   170
      | Const (@{const_name "permute"}, _) $ _ $ (trm as _ $ _) => msg trm
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   171
      | _ => () 
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   172
  in
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   173
    Conv.all_conv ctrm 
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   174
  end
1037
2845e736dc1a added a first eqvt_tac which pushes permutations inside terms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   175
2064
2725853f43b9 solved the problem with equivariance by first eta-normalising the goal
Christian Urban <urbanc@in.tum.de>
parents: 1947
diff changeset
   176
(* main conversion *) 
2765
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
   177
fun main_eqvt_conv ctxt config ctrm =
2477
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   178
  let
2765
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
   179
    val Eqvt_Config {strict_mode, pre_thms, post_thms, excluded} = config
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
   180
2477
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   181
    val first_conv_wrapper = 
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   182
      if trace_enabled ctxt 
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   183
      then Conv.first_conv o (cons (trace_info_conv ctxt)) o (map (trace_conv ctxt))
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   184
      else Conv.first_conv
1801
6d2a39db3862 added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents: 1800
diff changeset
   185
2765
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
   186
    val all_pre_thms = map safe_mk_equiv (pre_thms @ get_eqvts_raw_thms ctxt)
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
   187
    val all_post_thms = map safe_mk_equiv post_thms
2477
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   188
  in
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   189
    first_conv_wrapper
2765
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
   190
      [ Conv.rewrs_conv all_pre_thms,
2477
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   191
        eqvt_apply_conv,
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   192
        eqvt_lambda_conv,
2765
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
   193
        Conv.rewrs_conv all_post_thms,
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
   194
        progress_info_conv ctxt strict_mode excluded
2477
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   195
      ] ctrm
2f289c1f6cf1 tuned code
Christian Urban <urbanc@in.tum.de>
parents: 2301
diff changeset
   196
  end
1037
2845e736dc1a added a first eqvt_tac which pushes permutations inside terms
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   197
2765
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
   198
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
   199
(* the eqvt-conversion first eta-normalises goals in 
2064
2725853f43b9 solved the problem with equivariance by first eta-normalising the goal
Christian Urban <urbanc@in.tum.de>
parents: 1947
diff changeset
   200
   order to avoid problems with inductions in the
2610
f5c7375ab465 added theorem-rewriter conversion
Christian Urban <urbanc@in.tum.de>
parents: 2568
diff changeset
   201
   equivariance command. *)
2765
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
   202
fun eqvt_conv ctxt config = 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
   203
  Conv.top_conv (fn ctxt => Thm.eta_conversion then_conv (main_eqvt_conv ctxt config)) ctxt
2610
f5c7375ab465 added theorem-rewriter conversion
Christian Urban <urbanc@in.tum.de>
parents: 2568
diff changeset
   204
2765
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
   205
(* thms rewriter *)
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
   206
fun eqvt_rule ctxt config = 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
   207
  Conv.fconv_rule (eqvt_conv ctxt config)
2610
f5c7375ab465 added theorem-rewriter conversion
Christian Urban <urbanc@in.tum.de>
parents: 2568
diff changeset
   208
2765
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
   209
(* tactic *)
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
   210
fun eqvt_tac ctxt config = 
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
   211
  CONVERSION (eqvt_conv ctxt config)
1800
78fdc6b36a1c changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents: 1774
diff changeset
   212
1947
51f411b1197d tuned and cleaned
Christian Urban <urbanc@in.tum.de>
parents: 1866
diff changeset
   213
51f411b1197d tuned and cleaned
Christian Urban <urbanc@in.tum.de>
parents: 1866
diff changeset
   214
(** methods **)
2291
20ee31bc34d5 proper parser for "exclude:"
Christian Urban <urbanc@in.tum.de>
parents: 2150
diff changeset
   215
fun unless_more_args scan = Scan.unless (Scan.lift ((Args.$$$ "exclude") -- Args.colon)) scan
20ee31bc34d5 proper parser for "exclude:"
Christian Urban <urbanc@in.tum.de>
parents: 2150
diff changeset
   216
20ee31bc34d5 proper parser for "exclude:"
Christian Urban <urbanc@in.tum.de>
parents: 2150
diff changeset
   217
val add_thms_parser = Scan.optional (Scan.lift (Args.add -- Args.colon) |-- 
20ee31bc34d5 proper parser for "exclude:"
Christian Urban <urbanc@in.tum.de>
parents: 2150
diff changeset
   218
   Scan.repeat (unless_more_args Attrib.multi_thm) >> flat) [];
20ee31bc34d5 proper parser for "exclude:"
Christian Urban <urbanc@in.tum.de>
parents: 2150
diff changeset
   219
1947
51f411b1197d tuned and cleaned
Christian Urban <urbanc@in.tum.de>
parents: 1866
diff changeset
   220
val exclude_consts_parser = Scan.optional (Scan.lift ((Args.$$$ "exclude") -- Args.colon) |-- 
51f411b1197d tuned and cleaned
Christian Urban <urbanc@in.tum.de>
parents: 1866
diff changeset
   221
  (Scan.repeat (Args.const true))) []
51f411b1197d tuned and cleaned
Christian Urban <urbanc@in.tum.de>
parents: 1866
diff changeset
   222
2064
2725853f43b9 solved the problem with equivariance by first eta-normalising the goal
Christian Urban <urbanc@in.tum.de>
parents: 1947
diff changeset
   223
val args_parser =  add_thms_parser -- exclude_consts_parser 
1947
51f411b1197d tuned and cleaned
Christian Urban <urbanc@in.tum.de>
parents: 1866
diff changeset
   224
2765
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
   225
fun perm_simp_meth (thms, consts) ctxt =
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
   226
  SIMPLE_METHOD (HEADGOAL (eqvt_tac ctxt (eqvt_relaxed_config addpres thms addexcls consts)))
1947
51f411b1197d tuned and cleaned
Christian Urban <urbanc@in.tum.de>
parents: 1866
diff changeset
   227
51f411b1197d tuned and cleaned
Christian Urban <urbanc@in.tum.de>
parents: 1866
diff changeset
   228
fun perm_strict_simp_meth (thms, consts) ctxt = 
2765
7ac5e5c86c7d introduced framework for finetuning eqvt-rules; this solves problem with permute_pure called in nominal_inductive
Christian Urban <urbanc@in.tum.de>
parents: 2610
diff changeset
   229
  SIMPLE_METHOD (HEADGOAL (eqvt_tac ctxt (eqvt_strict_config addpres thms addexcls consts)))
1947
51f411b1197d tuned and cleaned
Christian Urban <urbanc@in.tum.de>
parents: 1866
diff changeset
   230
2069
2b6ba4d4e19a Fixes for new isabelle
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 2064
diff changeset
   231
end; (* structure *)