- Removed redundant head_len field in datatype_info
authorberghofe
Mon Dec 17 18:31:52 2007 +0100 (2007-12-17)
changeset 256778b2ddc6e7be1
parent 25676 f3815084e89e
child 25678 2495389bc1f5
- Removed redundant head_len field in datatype_info
- Added new alt_names field in datatype_info
src/HOL/Tools/datatype_package.ML
     1.1 --- a/src/HOL/Tools/datatype_package.ML	Mon Dec 17 18:30:44 2007 +0100
     1.2 +++ b/src/HOL/Tools/datatype_package.ML	Mon Dec 17 18:31:52 2007 +0100
     1.3 @@ -456,12 +456,12 @@
     1.4  
     1.5  (**** make datatype info ****)
     1.6  
     1.7 -fun make_dt_info head_len descr sorts induct reccomb_names rec_thms
     1.8 +fun make_dt_info alt_names descr sorts induct reccomb_names rec_thms
     1.9      (((((((((i, (_, (tname, _, _))), case_name), case_thms),
    1.10        exhaustion_thm), distinct_thm), inject), nchotomy), case_cong), weak_case_cong) =
    1.11    (tname,
    1.12     {index = i,
    1.13 -    head_len = head_len,
    1.14 +    alt_names = alt_names,
    1.15      descr = descr,
    1.16      sorts = sorts,
    1.17      rec_names = reccomb_names,
    1.18 @@ -620,8 +620,7 @@
    1.19      val (weak_case_congs, thy11) = add_and_get_axioms "weak_case_cong" new_type_names
    1.20        (DatatypeProp.make_weak_case_congs new_type_names descr sorts thy10) thy10;
    1.21  
    1.22 -    val dt_infos = map (make_dt_info (length (hd descr)) descr' sorts induct
    1.23 -        reccomb_names' rec_thms)
    1.24 +    val dt_infos = map (make_dt_info NONE descr' sorts induct reccomb_names' rec_thms)
    1.25        ((0 upto length (hd descr) - 1) ~~ (hd descr) ~~ case_names' ~~ case_thms ~~
    1.26          exhaustion ~~ replicate (length (hd descr)) QuickAndDirty ~~ inject ~~
    1.27            nchotomys ~~ case_congs ~~ weak_case_congs);
    1.28 @@ -680,8 +679,7 @@
    1.29      val (weak_case_congs, thy10) = DatatypeAbsProofs.prove_weak_case_congs new_type_names
    1.30        descr sorts thy9;
    1.31  
    1.32 -    val dt_infos = map (make_dt_info (length (hd descr)) (flat descr) sorts induct
    1.33 -        reccomb_names rec_thms)
    1.34 +    val dt_infos = map (make_dt_info NONE (flat descr) sorts induct reccomb_names rec_thms)
    1.35        ((0 upto length (hd descr) - 1) ~~ (hd descr) ~~ case_names ~~ case_thms ~~
    1.36          casedist_thms ~~ simproc_dists ~~ inject ~~ nchotomys ~~ case_congs ~~ weak_case_congs);
    1.37  
    1.38 @@ -781,8 +779,7 @@
    1.39        ||> Sign.add_path (space_implode "_" new_type_names)
    1.40        ||>> PureThy.add_thms [(("induct", induction), [case_names_induct])];
    1.41  
    1.42 -    val dt_infos = map (make_dt_info (length descr) descr sorts induction'
    1.43 -        reccomb_names rec_thms)
    1.44 +    val dt_infos = map (make_dt_info alt_names descr sorts induction' reccomb_names rec_thms)
    1.45        ((0 upto length descr - 1) ~~ descr ~~ case_names ~~ case_thms ~~ casedist_thms ~~
    1.46          map FewConstrs distinct ~~ inject ~~ nchotomys ~~ case_congs ~~ weak_case_congs);
    1.47