src/HOL/BNF_Examples/IsaFoR_Datatypes.thy
author traytel
Mon Jul 21 18:04:08 2014 +0200 (2014-07-21)
changeset 57586 5efff4075b63
child 57634 efc00b9b8680
permissions -rw-r--r--
regression test for datatypes defined in IsaFoR
traytel@57586
     1
(*  Title:      HOL/BNF_Examples/IsaFoR_Datatypes.thy
traytel@57586
     2
    Author:     René Thiemann
traytel@57586
     3
    Copyright   2014
traytel@57586
     4
traytel@57586
     5
Benchmark of datatypes defined in IsaFoR
traytel@57586
     6
*)
traytel@57586
     7
traytel@57586
     8
theory IsaFoR_Datatypes
traytel@57586
     9
imports
traytel@57586
    10
  Real
traytel@57586
    11
begin
traytel@57586
    12
traytel@57586
    13
datatype_new ('f, 'l) lab =
traytel@57586
    14
  Lab "('f, 'l) lab" 'l
traytel@57586
    15
| FunLab "('f, 'l) lab" "('f, 'l) lab list"
traytel@57586
    16
| UnLab 'f
traytel@57586
    17
| Sharp "('f, 'l) lab"
traytel@57586
    18
traytel@57586
    19
datatype_new 'f projL = Projection "(('f \<times> nat) \<times> nat) list"
traytel@57586
    20
traytel@57586
    21
datatype_new ('f, 'v) "term" = Var 'v | Fun 'f "('f, 'v) term list"
traytel@57586
    22
datatype_new ('f, 'v) ctxt =
traytel@57586
    23
  Hole ("\<box>")
traytel@57586
    24
| More 'f "('f, 'v) term list" "('f, 'v) ctxt" "('f, 'v) term list"
traytel@57586
    25
traytel@57586
    26
traytel@57586
    27
type_synonym ('f, 'v) rule = "('f, 'v) term \<times> ('f, 'v) term"
traytel@57586
    28
type_synonym ('f, 'v) trs  = "('f, 'v) rule set"
traytel@57586
    29
traytel@57586
    30
type_synonym ('f, 'v) rules = "('f,'v) rule list"
traytel@57586
    31
type_synonym ('f, 'l, 'v) ruleLL  = "(('f, 'l) lab, 'v) rule"
traytel@57586
    32
type_synonym ('f, 'l, 'v) trsLL   = "(('f, 'l) lab, 'v) rules"
traytel@57586
    33
type_synonym ('f, 'l, 'v) termsLL = "(('f, 'l) lab, 'v) term list"
traytel@57586
    34
datatype_new pos = Empty ("\<epsilon>") | PCons "nat" "pos" (infixr "<#" 70)
traytel@57586
    35
type_synonym  ('f, 'v) prseq = "(pos \<times> ('f, 'v) rule \<times> bool \<times> ('f, 'v) term) list"
traytel@57586
    36
type_synonym  ('f, 'v) rseq = "(pos \<times> ('f, 'v) rule \<times> ('f, 'v) term) list"
traytel@57586
    37
traytel@57586
    38
type_synonym ('f, 'l, 'v) rseqL   = "((('f, 'l) lab, 'v) rule \<times> (('f, 'l) lab, 'v) rseq) list"
traytel@57586
    39
type_synonym ('f, 'l, 'v) dppLL   =
traytel@57586
    40
  "bool \<times> bool \<times> ('f, 'l, 'v) trsLL \<times> ('f, 'l, 'v) trsLL \<times>
traytel@57586
    41
  ('f, 'l, 'v) termsLL \<times>
traytel@57586
    42
  ('f, 'l, 'v) trsLL \<times> ('f, 'l, 'v) trsLL"
traytel@57586
    43
traytel@57586
    44
type_synonym ('f, 'l, 'v) qreltrsLL =
traytel@57586
    45
  "bool \<times> ('f, 'l, 'v) termsLL \<times> ('f, 'l, 'v) trsLL \<times> ('f, 'l, 'v) trsLL"
traytel@57586
    46
traytel@57586
    47
type_synonym ('f, 'l, 'v) qtrsLL =
traytel@57586
    48
  "bool \<times> ('f, 'l, 'v) termsLL \<times> ('f, 'l, 'v) trsLL"
traytel@57586
    49
traytel@57586
    50
datatype_new location = H | A | B | R
traytel@57586
    51
traytel@57586
    52
type_synonym ('f,'v)forb_pattern = "('f,'v)ctxt \<times> ('f,'v)term \<times> location"
traytel@57586
    53
type_synonym ('f,'v)forb_patterns = "('f,'v)forb_pattern set"
traytel@57586
    54
traytel@57586
    55
type_synonym ('f, 'l, 'v) fptrsLL =
traytel@57586
    56
  "(('f, 'l)lab, 'v) forb_pattern list \<times> ('f, 'l, 'v) trsLL"
traytel@57586
    57
traytel@57586
    58
type_synonym ('f, 'l, 'v) prob = "('f, 'l, 'v) qreltrsLL + ('f, 'l, 'v) dppLL"
traytel@57586
    59
traytel@57586
    60
type_synonym ('f, 'a) lpoly_inter = "'f \<times> nat \<Rightarrow> ('a \<times> 'a list)"
traytel@57586
    61
type_synonym ('f, 'a) lpoly_interL = "(('f \<times> nat) \<times> ('a \<times> 'a list)) list"
traytel@57586
    62
traytel@57586
    63
type_synonym 'v monom = "('v \<times> nat)list" 
traytel@57586
    64
type_synonym ('v,'a)poly = "('v monom \<times> 'a)list"
traytel@57586
    65
type_synonym ('f,'a)poly_inter_list = "(('f \<times> nat) \<times> (nat,'a)poly)list"
traytel@57586
    66
type_synonym 'a vec = "'a list"
traytel@57586
    67
type_synonym 'a mat = "'a vec list" 
traytel@57586
    68
traytel@57586
    69
traytel@57586
    70
datatype_new arctic = MinInfty | Num_arc int
traytel@57586
    71
datatype_new 'a arctic_delta = MinInfty_delta | Num_arc_delta 'a
traytel@57586
    72
datatype_new order_tag = Lex | Mul
traytel@57586
    73
traytel@57586
    74
type_synonym 'f status_prec_repr = "(('f \<times> nat) \<times> (nat \<times> order_tag))list"
traytel@57586
    75
datatype_new af_entry = Collapse nat | AFList "nat list"
traytel@57586
    76
type_synonym 'f afs_list = "(('f \<times> nat) \<times> af_entry)list"
traytel@57586
    77
type_synonym 'f prec_weight_repr = "(('f \<times> nat) \<times> (nat \<times> nat \<times> (nat list option)))list \<times> nat"
traytel@57586
    78
traytel@57586
    79
traytel@57586
    80
datatype_new 'f redtriple_impl = 
traytel@57586
    81
    Int_carrier "('f, int) lpoly_interL" 
traytel@57586
    82
  | Int_nl_carrier "('f, int) poly_inter_list" 
traytel@57586
    83
  | Rat_carrier "('f, rat) lpoly_interL"
traytel@57586
    84
  | Rat_nl_carrier rat "('f, rat) poly_inter_list"
traytel@57586
    85
  | Real_carrier "('f, real) lpoly_interL"
traytel@57586
    86
  | Real_nl_carrier real "('f, real) poly_inter_list"
traytel@57586
    87
  | Arctic_carrier "('f, arctic) lpoly_interL" 
traytel@57586
    88
  | Arctic_rat_carrier "('f, rat arctic_delta) lpoly_interL" 
traytel@57586
    89
  | Int_mat_carrier nat nat "('f, int mat) lpoly_interL"
traytel@57586
    90
  | Rat_mat_carrier nat nat "('f, rat mat) lpoly_interL"
traytel@57586
    91
  | Real_mat_carrier nat nat "('f, real mat) lpoly_interL"
traytel@57586
    92
  | Arctic_mat_carrier nat "('f, arctic mat) lpoly_interL"
traytel@57586
    93
  | Arctic_rat_mat_carrier nat "('f, rat arctic_delta mat) lpoly_interL"
traytel@57586
    94
  | RPO "'f status_prec_repr" "'f afs_list"
traytel@57586
    95
  | KBO "'f prec_weight_repr" "'f afs_list"
traytel@57586
    96
traytel@57586
    97
datatype_new list_order_type = MS_Ext | Max_Ext | Min_Ext  | Dms_Ext 
traytel@57586
    98
type_synonym 'f scnp_af = "(('f \<times> nat) \<times> (nat \<times> nat) list) list"
traytel@57586
    99
traytel@57586
   100
datatype_new 'f root_redtriple_impl = SCNP list_order_type "'f scnp_af" "'f redtriple_impl"
traytel@57586
   101
traytel@57586
   102
type_synonym 'f sig_map_list = "(('f \<times> nat) \<times> 'f list) list"
traytel@57586
   103
type_synonym ('f,'v) uncurry_info = "'f \<times> 'f sig_map_list \<times> ('f,'v)rules \<times> ('f,'v)rules"
traytel@57586
   104
traytel@57586
   105
datatype_new arithFun =
traytel@57586
   106
  Arg nat
traytel@57586
   107
| Const nat
traytel@57586
   108
| Sum "arithFun list"
traytel@57586
   109
| Max "arithFun list"
traytel@57586
   110
| Min "arithFun list"
traytel@57586
   111
| Prod "arithFun list"
traytel@57586
   112
| IfEqual arithFun arithFun arithFun arithFun
traytel@57586
   113
traytel@57586
   114
datatype_new 'f sl_inter = SL_Inter nat "(('f \<times> nat) \<times> arithFun) list"
traytel@57586
   115
datatype_new ('f,'v)sl_variant = Rootlab "('f \<times> nat) option" | Finitelab "'f sl_inter" | QuasiFinitelab "'f sl_inter" 'v
traytel@57586
   116
traytel@57586
   117
type_synonym ('f,'v)crit_pair_joins = "(('f,'v)term \<times> ('f,'v)rseq \<times> ('f,'v)term \<times> ('f,'v)rseq)list"
traytel@57586
   118
datatype_new 'f join_info = Guided "('f,string)crit_pair_joins" | Join_NF | Join_BFS nat
traytel@57586
   119
traytel@57586
   120
type_synonym unknown_info = string
traytel@57586
   121
traytel@57586
   122
type_synonym dummy_prf = unit
traytel@57586
   123
traytel@57586
   124
traytel@57586
   125
datatype_new ('f,'v)complex_constant_removal_prf = Complex_Constant_Removal_Proof 
traytel@57586
   126
  "('f,'v)term" 
traytel@57586
   127
  "(('f,'v)rule \<times> ('f,'v)rule) list" 
traytel@57586
   128
traytel@57586
   129
datatype_new ('f,'v)cond_constraint 
traytel@57586
   130
  = CC_cond bool "('f,'v)rule" 
traytel@57586
   131
  | CC_rewr "('f,'v)term" "('f,'v)term"
traytel@57586
   132
  | CC_impl "('f,'v)cond_constraint list" "('f,'v)cond_constraint"
traytel@57586
   133
  | CC_all 'v "('f,'v)cond_constraint"
traytel@57586
   134
traytel@57586
   135
type_synonym ('f, 'v, 'w) gsubstL = "('v \<times> ('f, 'w) term) list"
traytel@57586
   136
type_synonym ('f, 'v) substL = "('f, 'v, 'v) gsubstL"
traytel@57586
   137
traytel@57586
   138
datatype_new ('f,'v)cond_constraint_prf = 
traytel@57586
   139
  Final 
traytel@57586
   140
| Delete_Condition "('f,'v)cond_constraint" "('f,'v)cond_constraint_prf"
traytel@57586
   141
| Different_Constructor "('f,'v)cond_constraint"
traytel@57586
   142
| Same_Constructor "('f,'v)cond_constraint" "('f,'v)cond_constraint" "('f,'v)cond_constraint_prf"
traytel@57586
   143
| Variable_Equation 'v "('f,'v)term" "('f,'v)cond_constraint" "('f,'v)cond_constraint_prf"
traytel@57586
   144
| Funarg_Into_Var "('f,'v)cond_constraint" nat 'v "('f,'v)cond_constraint" "('f,'v)cond_constraint_prf"
traytel@57586
   145
| Simplify_Condition "('f,'v)cond_constraint" "('f,'v)substL" "('f,'v)cond_constraint" "('f,'v)cond_constraint_prf"
traytel@57586
   146
| Induction "('f,'v)cond_constraint" "('f,'v)cond_constraint list" "(('f,'v)rule \<times> (('f,'v)term \<times> 'v list) list \<times> ('f,'v)cond_constraint \<times> ('f,'v)cond_constraint_prf) list"
traytel@57586
   147
traytel@57586
   148
traytel@57586
   149
datatype_new ('f,'v)cond_red_pair_prf = Cond_Red_Pair_Prf 
traytel@57586
   150
  'f 
traytel@57586
   151
  "(('f,'v)cond_constraint \<times> ('f,'v)rules \<times> ('f,'v)cond_constraint_prf) list"
traytel@57586
   152
  nat 
traytel@57586
   153
  nat 
traytel@57586
   154
traytel@57586
   155
datatype_new ('q,'f)ta_rule = TA_rule 'f "'q list" 'q ("_ _ \<rightarrow> _")
traytel@57586
   156
datatype_new ('q,'f)tree_automaton = Tree_Automaton "'q list" "('q,'f)ta_rule list" "('q \<times> 'q)list"
traytel@57586
   157
datatype_new 'q ta_relation = Decision_Proc | Id_Relation | Some_Relation "('q \<times> 'q) list"
traytel@57586
   158
traytel@57586
   159
datatype_new boundstype = Roof | Match
traytel@57586
   160
datatype_new ('f,'q)bounds_info = Bounds_Info boundstype nat "'q list" "('q, 'f \<times> nat) tree_automaton" "'q ta_relation"
traytel@57586
   161
traytel@57586
   162
datatype_new ('f, 'v) pat_eqv_prf =
traytel@57586
   163
  Pat_Dom_Renaming "('f, 'v) substL"
traytel@57586
   164
| Pat_Irrelevant "('f, 'v) substL" "('f, 'v) substL"
traytel@57586
   165
| Pat_Simplify "('f, 'v) substL" "('f, 'v) substL"
traytel@57586
   166
traytel@57586
   167
datatype_new pat_rule_pos = Pat_Base | Pat_Pump | Pat_Close
traytel@57586
   168
traytel@57586
   169
datatype_new ('f, 'v) pat_rule_prf = 
traytel@57586
   170
  Pat_OrigRule "('f, 'v) rule" bool
traytel@57586
   171
| Pat_InitPump "('f, 'v) pat_rule_prf" "('f, 'v) substL" "('f, 'v) substL"
traytel@57586
   172
| Pat_InitPumpCtxt "('f, 'v) pat_rule_prf" "('f, 'v) substL" pos 'v
traytel@57586
   173
| Pat_Equiv "('f, 'v) pat_rule_prf" bool "('f, 'v) pat_eqv_prf"
traytel@57586
   174
| Pat_Narrow "('f, 'v) pat_rule_prf" "('f, 'v) pat_rule_prf" pos
traytel@57586
   175
| Pat_Inst "('f, 'v) pat_rule_prf" "('f, 'v) substL" pat_rule_pos
traytel@57586
   176
| Pat_Rewr "('f, 'v) pat_rule_prf" "('f, 'v) term \<times> ('f, 'v) rseq" pat_rule_pos 'v 
traytel@57586
   177
| Pat_Exp_Sigma "('f, 'v) pat_rule_prf" nat
traytel@57586
   178
traytel@57586
   179
datatype_new ('f, 'v) non_loop_prf =
traytel@57586
   180
  Non_Loop_Prf "('f, 'v) pat_rule_prf" "('f, 'v) substL" "('f, 'v) substL" nat nat pos
traytel@57586
   181
traytel@57586
   182
traytel@57586
   183
datatype_new ('f, 'l, 'v) problem = 
traytel@57586
   184
  SN_TRS "('f,'l,'v)qreltrsLL"
traytel@57586
   185
| SN_FP_TRS "('f,'l,'v)fptrsLL" 
traytel@57586
   186
| Finite_DPP "('f,'l,'v) dppLL"
traytel@57586
   187
| Unknown_Problem unknown_info
traytel@57586
   188
| Not_SN_TRS "('f,'l,'v)qtrsLL" 
traytel@57586
   189
| Not_RelSN_TRS "('f,'l,'v)qreltrsLL" 
traytel@57586
   190
| Infinite_DPP "('f,'l,'v) dppLL"
traytel@57586
   191
| Not_SN_FP_TRS "('f,'l,'v)fptrsLL" 
traytel@57586
   192
declare [[bnf_timing]]
traytel@57586
   193
datatype_new ('f, 'l, 'v, 'a, 'b, 'c, 'd, 'e) generic_assm_proof = 
traytel@57586
   194
  SN_assm_proof "('f,'l,'v)qreltrsLL" 'a
traytel@57586
   195
| Finite_assm_proof "('f,'l,'v)dppLL" 'b
traytel@57586
   196
| SN_FP_assm_proof "('f,'l,'v)fptrsLL" 'c
traytel@57586
   197
| Not_SN_assm_proof "('f,'l,'v)qtrsLL" 'a
traytel@57586
   198
| Infinite_assm_proof "('f,'l,'v)dppLL" 'b
traytel@57586
   199
| Not_RelSN_assm_proof "('f,'l,'v)qreltrsLL" 'c
traytel@57586
   200
| Not_SN_FP_assm_proof "('f,'l,'v)fptrsLL" 'd
traytel@57586
   201
| Unknown_assm_proof unknown_info 'e
traytel@57586
   202
traytel@57586
   203
type_synonym ('f,'l,'v,'a,'b,'c,'d)assm_proof = "('f,'l,'v,'a,'b,'c,dummy_prf,'d)generic_assm_proof"
traytel@57586
   204
traytel@57586
   205
datatype_new ('f, 'l, 'v) assm = 
traytel@57586
   206
  SN_assm "('f,'l,'v)problem list" "('f,'l,'v)qreltrsLL" 
traytel@57586
   207
| SN_FP_assm "('f,'l,'v)problem list" "('f,'l,'v)fptrsLL"
traytel@57586
   208
| Finite_assm "('f,'l,'v)problem list" "('f,'l,'v)dppLL"
traytel@57586
   209
| Unknown_assm "('f,'l,'v)problem list" unknown_info
traytel@57586
   210
| Not_SN_assm "('f,'l,'v)problem list" "('f,'l,'v)qtrsLL" 
traytel@57586
   211
| Not_RelSN_assm "('f,'l,'v)problem list" "('f,'l,'v)qreltrsLL" 
traytel@57586
   212
| Not_SN_FP_assm "('f,'l,'v)problem list" "('f,'l,'v)fptrsLL"
traytel@57586
   213
| Infinite_assm "('f,'l,'v)problem list" "('f,'l,'v)dppLL"
traytel@57586
   214
traytel@57586
   215
fun satisfied :: "('f,'l,'v)problem \<Rightarrow> bool" where
traytel@57586
   216
  "satisfied (SN_TRS t) = (t = t)"
traytel@57586
   217
| "satisfied (SN_FP_TRS t) = (t \<noteq> t)"
traytel@57586
   218
| "satisfied (Finite_DPP d) = (d \<noteq> d)"
traytel@57586
   219
| "satisfied (Unknown_Problem s) = (s = ''foo'')"
traytel@57586
   220
| "satisfied (Not_SN_TRS (nfs,q,r)) = (length q = length r)"
traytel@57586
   221
| "satisfied (Not_RelSN_TRS (nfs,q,r,rw)) = (r = rw)"
traytel@57586
   222
| "satisfied (Infinite_DPP d) = (d = d)"
traytel@57586
   223
| "satisfied (Not_SN_FP_TRS t) = (t = t)"
traytel@57586
   224
traytel@57586
   225
fun collect_assms :: "('tp \<Rightarrow> ('f,'l,'v) assm list) 
traytel@57586
   226
  \<Rightarrow> ('dpp \<Rightarrow> ('f,'l,'v) assm list)
traytel@57586
   227
  \<Rightarrow> ('fptp \<Rightarrow> ('f,'l,'v) assm list)
traytel@57586
   228
  \<Rightarrow> ('unk \<Rightarrow> ('f,'l,'v) assm list)
traytel@57586
   229
  \<Rightarrow> ('f,'l,'v,'tp,'dpp,'fptp,'unk) assm_proof \<Rightarrow> ('f,'l,'v) assm list" where
traytel@57586
   230
  "collect_assms tp dpp fptp unk (SN_assm_proof t prf) = tp prf"
traytel@57586
   231
| "collect_assms tp dpp fptp unk (SN_FP_assm_proof t prf) = fptp prf"
traytel@57586
   232
| "collect_assms tp dpp fptp unk (Finite_assm_proof d prf) = dpp prf"
traytel@57586
   233
| "collect_assms tp dpp fptp unk (Unknown_assm_proof p prf) = unk prf"
traytel@57586
   234
| "collect_assms _ _ _ _ _ = []"
traytel@57586
   235
traytel@57586
   236
fun collect_neg_assms :: "('tp \<Rightarrow> ('f,'l,'v) assm list) 
traytel@57586
   237
  \<Rightarrow> ('dpp \<Rightarrow> ('f,'l,'v) assm list)
traytel@57586
   238
  \<Rightarrow> ('rtp \<Rightarrow> ('f,'l,'v) assm list)
traytel@57586
   239
  \<Rightarrow> ('fptp \<Rightarrow> ('f,'l,'v) assm list)
traytel@57586
   240
  \<Rightarrow> ('unk \<Rightarrow> ('f,'l,'v) assm list) 
traytel@57586
   241
  \<Rightarrow> ('f,'l,'v,'tp,'dpp,'rtp,'fptp,'unk) generic_assm_proof \<Rightarrow> ('f,'l,'v) assm list" where
traytel@57586
   242
  "collect_neg_assms tp dpp rtp fptp unk (Not_SN_assm_proof t prf) = tp prf"
traytel@57586
   243
| "collect_neg_assms tp dpp rtp fptp unk (Infinite_assm_proof d prf) = dpp prf"
traytel@57586
   244
| "collect_neg_assms tp dpp rtp fptp unk (Not_RelSN_assm_proof t prf) = rtp prf"
traytel@57586
   245
| "collect_neg_assms tp dpp rtp fptp unk (Not_SN_FP_assm_proof t prf) = fptp prf"
traytel@57586
   246
| "collect_neg_assms tp dpp rtp fptp unk (Unknown_assm_proof p prf) = unk prf"
traytel@57586
   247
| "collect_neg_assms tp dpp rtp fptp unk _ = []"
traytel@57586
   248
traytel@57586
   249
traytel@57586
   250
traytel@57586
   251
datatype_new ('f, 'l, 'v) dp_nontermination_proof =
traytel@57586
   252
  DP_Loop "(('f,'l)lab, 'v) term" "(('f,'l)lab, 'v) prseq" "(('f,'l)lab, 'v) substL" "(('f,'l)lab, 'v) ctxt"
traytel@57586
   253
| DP_Nonloop "(('f,'l)lab, 'v)non_loop_prf"
traytel@57586
   254
| DP_Rule_Removal "('f,'l,'v)trsLL option" "('f,'l,'v)trsLL option" "('f,'l,'v) dp_nontermination_proof"
traytel@57586
   255
| DP_Q_Increase "('f,'l,'v)termsLL" "('f,'l,'v) dp_nontermination_proof"
traytel@57586
   256
| DP_Q_Reduction "('f,'l,'v)termsLL" "('f,'l,'v) dp_nontermination_proof"
traytel@57586
   257
| DP_Termination_Switch "('f,'l)lab join_info" "('f,'l,'v) dp_nontermination_proof"
traytel@57586
   258
| DP_Instantiation "('f,'l,'v)trsLL" "('f,'l,'v) dp_nontermination_proof"
traytel@57586
   259
| DP_Rewriting "('f,'l,'v)trsLL option" "('f,'l,'v)ruleLL" "('f,'l,'v)ruleLL" "('f,'l,'v)ruleLL" "(('f,'l)lab,'v)rule" pos "('f,'l,'v) dp_nontermination_proof"
traytel@57586
   260
| DP_Narrowing "('f,'l,'v)ruleLL" pos "('f,'l,'v)trsLL" "('f,'l,'v) dp_nontermination_proof"
traytel@57586
   261
| DP_Assume_Infinite  "('f, 'l, 'v) dppLL" 
traytel@57586
   262
    "('f,'l,'v,('f, 'l, 'v) trs_nontermination_proof,
traytel@57586
   263
     ('f, 'l, 'v) dp_nontermination_proof, 
traytel@57586
   264
     ('f, 'l, 'v) reltrs_nontermination_proof, 
traytel@57586
   265
     ('f, 'l, 'v) fp_nontermination_proof,
traytel@57586
   266
     ('f, 'l, 'v) neg_unknown_proof) generic_assm_proof list"
traytel@57586
   267
 and
traytel@57586
   268
('f,'l,'v) "trs_nontermination_proof" = 
traytel@57586
   269
  TRS_Loop "(('f,'l)lab, 'v) term" "(('f,'l)lab, 'v) rseq" "(('f,'l)lab, 'v) substL" "(('f,'l)lab, 'v) ctxt"
traytel@57586
   270
| TRS_Not_Well_Formed
traytel@57586
   271
| TRS_Rule_Removal "('f,'l,'v)trsLL" "('f,'l,'v) trs_nontermination_proof"
traytel@57586
   272
| TRS_String_Reversal "('f,'l,'v) trs_nontermination_proof"
traytel@57586
   273
| TRS_DP_Trans "('f,'l,'v)trsLL" "('f,'l,'v) dp_nontermination_proof"
traytel@57586
   274
| TRS_Nonloop "(('f,'l)lab,'v) non_loop_prf"
traytel@57586
   275
| TRS_Q_Increase "('f,'l,'v)termsLL" "('f,'l,'v) trs_nontermination_proof"
traytel@57586
   276
| TRS_Assume_Not_SN  "('f, 'l, 'v)qtrsLL" 
traytel@57586
   277
    "('f,'l,'v,('f, 'l, 'v) trs_nontermination_proof,
traytel@57586
   278
     ('f, 'l, 'v) dp_nontermination_proof, 
traytel@57586
   279
     ('f, 'l, 'v) reltrs_nontermination_proof, 
traytel@57586
   280
     ('f, 'l, 'v) fp_nontermination_proof,
traytel@57586
   281
     ('f, 'l, 'v) neg_unknown_proof) generic_assm_proof list"
traytel@57586
   282
 and
traytel@57586
   283
('f,'l,'v)"reltrs_nontermination_proof" = 
traytel@57586
   284
  Rel_Loop "(('f,'l)lab,'v) term" "(('f,'l)lab, 'v) prseq" "(('f,'l)lab, 'v) substL" "(('f,'l)lab, 'v) ctxt"
traytel@57586
   285
| Rel_Not_Well_Formed
traytel@57586
   286
| Rel_Rule_Removal "('f,'l,'v)trsLL option" "('f,'l,'v)trsLL option" "('f,'l,'v) reltrs_nontermination_proof"
traytel@57586
   287
| Rel_R_Not_SN "('f,'l,'v) trs_nontermination_proof"
traytel@57586
   288
| Rel_TRS_Assume_Not_SN  "('f, 'l, 'v)qreltrsLL" 
traytel@57586
   289
    "('f,'l,'v,('f, 'l, 'v) trs_nontermination_proof,
traytel@57586
   290
     ('f, 'l, 'v) dp_nontermination_proof, 
traytel@57586
   291
     ('f, 'l, 'v) reltrs_nontermination_proof, 
traytel@57586
   292
     ('f, 'l, 'v) fp_nontermination_proof,
traytel@57586
   293
     ('f, 'l, 'v) neg_unknown_proof) generic_assm_proof list"
traytel@57586
   294
 and
traytel@57586
   295
 ('f, 'l, 'v) "fp_nontermination_proof" = 
traytel@57586
   296
  FPTRS_Loop "(('f,'l)lab, 'v) term" "(('f,'l)lab, 'v) rseq" "(('f,'l)lab, 'v) substL" "(('f,'l)lab, 'v) ctxt"
traytel@57586
   297
| FPTRS_Rule_Removal "('f,'l,'v)trsLL" "('f,'l,'v) fp_nontermination_proof" 
traytel@57586
   298
| FPTRS_Assume_Not_SN  "('f, 'l, 'v)fptrsLL" 
traytel@57586
   299
    "('f,'l,'v,('f, 'l, 'v) trs_nontermination_proof,
traytel@57586
   300
     ('f, 'l, 'v) dp_nontermination_proof, 
traytel@57586
   301
     ('f, 'l, 'v) reltrs_nontermination_proof, 
traytel@57586
   302
     ('f, 'l, 'v) fp_nontermination_proof,
traytel@57586
   303
     ('f, 'l, 'v) neg_unknown_proof) generic_assm_proof list"
traytel@57586
   304
 and
traytel@57586
   305
 ('f, 'l, 'v) neg_unknown_proof =
traytel@57586
   306
  Assume_NT_Unknown unknown_info 
traytel@57586
   307
    "('f,'l,'v,('f, 'l, 'v) trs_nontermination_proof,
traytel@57586
   308
     ('f, 'l, 'v) dp_nontermination_proof, 
traytel@57586
   309
     ('f, 'l, 'v) reltrs_nontermination_proof, 
traytel@57586
   310
     ('f, 'l, 'v) fp_nontermination_proof,
traytel@57586
   311
     ('f, 'l, 'v) neg_unknown_proof) generic_assm_proof list"
traytel@57586
   312
traytel@57586
   313
traytel@57586
   314
datatype_new ('f, 'l, 'v) dp_termination_proof =
traytel@57586
   315
  P_is_Empty
traytel@57586
   316
| Subterm_Criterion_Proc "('f, 'l) lab projL" "('f, 'l, 'v) rseqL"
traytel@57586
   317
    "('f, 'l, 'v) trsLL" "('f, 'l, 'v) dp_termination_proof"
traytel@57586
   318
| Redpair_Proc "('f,'l)lab root_redtriple_impl + ('f, 'l) lab redtriple_impl" "('f, 'l, 'v) trsLL"  "('f, 'l, 'v) dp_termination_proof"
traytel@57586
   319
| Redpair_UR_Proc "('f, 'l) lab root_redtriple_impl + ('f, 'l) lab redtriple_impl"
traytel@57586
   320
    "('f, 'l, 'v) trsLL" "('f, 'l, 'v) trsLL" "('f, 'l, 'v) dp_termination_proof" 
traytel@57586
   321
| Usable_Rules_Proc "('f, 'l, 'v) trsLL" "('f, 'l, 'v) dp_termination_proof" 
traytel@57586
   322
| Dep_Graph_Proc "(('f, 'l, 'v) dp_termination_proof option \<times> ('f, 'l, 'v) trsLL) list"
traytel@57586
   323
| Mono_Redpair_Proc "('f, 'l) lab redtriple_impl"
traytel@57586
   324
    "('f, 'l, 'v) trsLL" "('f, 'l, 'v) trsLL" "('f, 'l, 'v) dp_termination_proof" 
traytel@57586
   325
| Mono_Redpair_UR_Proc "('f, 'l) lab redtriple_impl"
traytel@57586
   326
    "('f, 'l, 'v) trsLL" "('f, 'l, 'v) trsLL" "('f, 'l, 'v) trsLL" "('f, 'l, 'v) dp_termination_proof"
traytel@57586
   327
| Size_Change_Subterm_Proc "((('f, 'l) lab, 'v) rule \<times> ((nat \<times> nat) list \<times> (nat \<times> nat) list)) list"
traytel@57586
   328
| Size_Change_Redpair_Proc "('f, 'l) lab redtriple_impl" "('f, 'l, 'v) trsLL option"
traytel@57586
   329
    "((('f, 'l) lab, 'v) rule \<times> ((nat \<times> nat) list \<times> (nat \<times> nat) list)) list"
traytel@57586
   330
| Uncurry_Proc "nat option" "(('f, 'l) lab, 'v) uncurry_info"
traytel@57586
   331
    "('f, 'l, 'v) trsLL" "('f, 'l, 'v) trsLL" "('f, 'l, 'v) dp_termination_proof"
traytel@57586
   332
| Fcc_Proc "('f, 'l) lab" "(('f, 'l) lab, 'v) ctxt list"
traytel@57586
   333
    "('f, 'l, 'v) trsLL" "('f, 'l, 'v) trsLL" "('f, 'l, 'v) dp_termination_proof"
traytel@57586
   334
| Split_Proc
traytel@57586
   335
    "('f, 'l, 'v) trsLL" "('f, 'l, 'v) trsLL" 
traytel@57586
   336
    "('f, 'l, 'v) dp_termination_proof" "('f, 'l, 'v) dp_termination_proof"
traytel@57586
   337
| Semlab_Proc
traytel@57586
   338
    "(('f, 'l) lab, 'v) sl_variant" "('f, 'l, 'v) trsLL"
traytel@57586
   339
    "(('f, 'l) lab, 'v) term list" "('f, 'l, 'v) trsLL"
traytel@57586
   340
    "('f, 'l, 'v) dp_termination_proof"
traytel@57586
   341
| Switch_Innermost_Proc "('f, 'l) lab join_info" "('f, 'l, 'v) dp_termination_proof"
traytel@57586
   342
| Rewriting_Proc
traytel@57586
   343
    "('f, 'l, 'v) trsLL option" "('f, 'l, 'v) ruleLL" "('f, 'l, 'v) ruleLL"
traytel@57586
   344
    "('f, 'l, 'v) ruleLL" "('f, 'l, 'v) ruleLL" pos "('f, 'l, 'v) dp_termination_proof"
traytel@57586
   345
| Instantiation_Proc "('f, 'l, 'v) ruleLL" "('f, 'l, 'v) trsLL" "('f, 'l, 'v) dp_termination_proof"
traytel@57586
   346
| Forward_Instantiation_Proc
traytel@57586
   347
    "('f, 'l, 'v) ruleLL" "('f, 'l, 'v) trsLL" "('f, 'l, 'v) trsLL option" "('f, 'l, 'v) dp_termination_proof"
traytel@57586
   348
| Narrowing_Proc "('f, 'l, 'v) ruleLL" pos "('f, 'l, 'v) trsLL" "('f, 'l, 'v) dp_termination_proof"
traytel@57586
   349
| Assume_Finite
traytel@57586
   350
    "('f, 'l, 'v) dppLL" "('f,'l,'v,('f, 'l, 'v) trs_termination_proof,('f, 'l, 'v) dp_termination_proof,('f, 'l, 'v) fptrs_termination_proof,('f, 'l, 'v) unknown_proof) assm_proof list"
traytel@57586
   351
| Unlab_Proc "('f, 'l, 'v) trsLL" "('f, 'l, 'v) trsLL" "('f, 'l, 'v) dp_termination_proof"
traytel@57586
   352
| Q_Reduction_Proc "('f, 'l, 'v) termsLL" "('f, 'l, 'v) dp_termination_proof"
traytel@57586
   353
| Complex_Constant_Removal_Proc "(('f,'l)lab,'v)complex_constant_removal_prf" "('f, 'l, 'v) dp_termination_proof"
traytel@57586
   354
| General_Redpair_Proc
traytel@57586
   355
    "('f, 'l) lab redtriple_impl" "('f, 'l, 'v) trsLL" "('f, 'l, 'v) trsLL"
traytel@57586
   356
    "(('f, 'l) lab, 'v) cond_red_pair_prf" "('f, 'l, 'v) dp_termination_proof list" 
traytel@57586
   357
| To_Trs_Proc "('f, 'l, 'v) trs_termination_proof"
traytel@57586
   358
and ('f, 'l, 'v) trs_termination_proof =
traytel@57586
   359
  DP_Trans bool bool "(('f, 'l) lab, 'v) rules" "('f, 'l, 'v) dp_termination_proof"
traytel@57586
   360
| Rule_Removal "('f, 'l) lab redtriple_impl" "('f, 'l, 'v) trsLL" "('f, 'l, 'v)trs_termination_proof"
traytel@57586
   361
| String_Reversal "('f, 'l, 'v) trs_termination_proof"
traytel@57586
   362
| Bounds "(('f, 'l) lab, 'v) bounds_info"
traytel@57586
   363
| Uncurry "(('f, 'l) lab, 'v) uncurry_info" "('f, 'l, 'v) trsLL" "('f, 'l, 'v) trs_termination_proof"
traytel@57586
   364
| Semlab
traytel@57586
   365
    "(('f, 'l) lab, 'v) sl_variant" "(('f, 'l) lab, 'v) term list"
traytel@57586
   366
    "('f, 'l, 'v) trsLL" "('f, 'l, 'v) trs_termination_proof"
traytel@57586
   367
| R_is_Empty
traytel@57586
   368
| Fcc "(('f, 'l) lab, 'v) ctxt list" "('f, 'l, 'v) trsLL" "('f, 'l, 'v) trs_termination_proof"
traytel@57586
   369
| Split "('f, 'l, 'v) trsLL" "('f, 'l, 'v) trs_termination_proof" "('f, 'l, 'v) trs_termination_proof"
traytel@57586
   370
| Switch_Innermost "('f, 'l) lab join_info" "('f, 'l, 'v) trs_termination_proof" 
traytel@57586
   371
| Drop_Equality "('f, 'l, 'v) trs_termination_proof"
traytel@57586
   372
| Remove_Nonapplicable_Rules "('f, 'l, 'v) trsLL" "('f, 'l, 'v) trs_termination_proof"
traytel@57586
   373
| Assume_SN "('f, 'l, 'v) qreltrsLL" "('f,'l,'v,('f, 'l, 'v) trs_termination_proof,('f, 'l, 'v) dp_termination_proof,('f, 'l, 'v) fptrs_termination_proof,('f, 'l, 'v) unknown_proof) assm_proof list"
traytel@57586
   374
and ('f, 'l, 'v) unknown_proof =
traytel@57586
   375
  Assume_Unknown unknown_info "('f,'l,'v,('f, 'l, 'v) trs_termination_proof,('f, 'l, 'v) dp_termination_proof,('f, 'l, 'v) fptrs_termination_proof,('f, 'l, 'v) unknown_proof) assm_proof list"
traytel@57586
   376
and ('f, 'l, 'v) fptrs_termination_proof =
traytel@57586
   377
  Assume_FP_SN "('f,'l,'v)fptrsLL" "('f,'l,'v,('f, 'l, 'v) trs_termination_proof,('f, 'l, 'v) dp_termination_proof,('f, 'l, 'v) fptrs_termination_proof,('f, 'l, 'v) unknown_proof) assm_proof list"
traytel@57586
   378
traytel@57586
   379
traytel@57586
   380
end