
diff -r c145c380e195 -r d3101a5b9c4d Nominal/Fv.thy
--- a/Nominal/Fv.thy	Tue Mar 02 12:28:07 2010 +0100
+++ b/Nominal/Fv.thy	Tue Mar 02 13:28:54 2010 +0100
@@ -54,6 +54,13 @@
       in the database.
 *)
 
+ML {*
+fun map2i _ [] [] = []
+  | map2i f (x :: xs) (y :: ys) = f x y :: map2i f xs ys
+  | map2i f (x :: xs) [] = f x [] :: map2i f xs []
+  | map2i _ _ _ = raise UnequalLengths;
+*}
+
 (* TODO: should be const_name union *)
 ML {*
   open Datatype_Aux; (* typ_of_dtyp, DtRec, ... *);
@@ -185,8 +192,8 @@
     in
       (fv_eq, alpha_eq)
     end;
-  fun fv_alpha_eq (i, (_, _, constrs)) binds = map2 (fv_alpha_constr i) constrs binds;
-  val (fv_eqs, alpha_eqs) = split_list (flat (map2 fv_alpha_eq descr bindsall))
+  fun fv_alpha_eq (i, (_, _, constrs)) binds = map2i (fv_alpha_constr i) constrs binds;
+  val (fv_eqs, alpha_eqs) = split_list (flat (map2i fv_alpha_eq descr bindsall))
   val add_binds = map (fn x => (Attrib.empty_binding, x))
   val (fvs, lthy') = (Primrec.add_primrec
     (map (fn s => (Binding.name s, NONE, NoSyn)) fv_names) (add_binds fv_eqs) lthy)




