
diff -r d134bd4f6d1b -r aecebd5ed424 Nominal/NewParser.thy
--- a/Nominal/NewParser.thy	Fri May 21 05:58:23 2010 +0100
+++ b/Nominal/NewParser.thy	Fri May 21 11:40:18 2010 +0100
@@ -251,7 +251,7 @@
   
   val (raw_dt_names, raw_dts) = rawify_dts dt_names dts dts_env
   val (raw_bn_funs, raw_bn_eqs) = rawify_bn_funs dts_env cnstrs_env bn_fun_env bn_funs bn_eqs 
-  val raw_bclauses = rawify_bclauses dts_env cnstrs_env bn_fun_full_env binds 
+  val raw_bclauses = rawify_bclauses dts_env cnstrs_env bn_fun_env binds 
   val raw_bn_descr = prep_bn_descr lthy dt_full_names' raw_dts (map snd raw_bn_eqs)
 
   val (raw_dt_names, lthy1) = add_datatype_wrapper raw_dt_names raw_dts lthy
@@ -261,7 +261,7 @@
   fun export_fun f (t, n , l) = (f t, n, map (map (apsnd (Option.map f))) l);
   val raw_bn_descr_exp = map (export_fun (Morphism.term morphism_2_0)) raw_bn_descr;
 in
-  (raw_dt_names, raw_bclauses, raw_bn_funs, raw_bn_eqs, raw_bn_funs2, raw_bn_eqs2, raw_bn_descr_exp, raw_bn_descr, lthy2)
+  (raw_dt_names, raw_bclauses, raw_bn_funs, raw_bn_eqs, raw_bn_funs2, raw_bn_eqs2, raw_bn_descr_exp, raw_bn_descr, lthy1)
 end
 *}
 
@@ -312,7 +312,7 @@
 
   val _ = tracing ("raw_bn_descr " ^ @{make_string} raw_bn_descr)
   val _ = tracing ("raw_bn_descr2 " ^ @{make_string} raw_bn_descr2)
-  val _ = tracing ("bclauses " ^ @{make_string} bclauses)
+  val _ = tracing ("raw_bclauses " ^ @{make_string} raw_bclauses)
   val _ = tracing ("raw_bn_fund " ^ @{make_string} raw_bn_funs)
   val _ = tracing ("raw_bn_eqs " ^ @{make_string} raw_bn_eqs)
   val _ = tracing ("raw_bn_fund2 " ^ @{make_string} raw_bn_funs2)
@@ -349,7 +349,7 @@
 
   val (fv, fvbn, fv_def, lthy3a) = 
     if get_STEPS lthy2 > 3 
-    then define_raw_fvs (map (fn (x, _, _) => Binding.name_of x) bn_funs) (map snd bn_eqs) descr sorts raw_bn_descr raw_bn_descr2 raw_bclauses lthy3
+    then define_raw_fvs (map (fn (x, _, _) => Binding.name_of x) raw_bn_funs2) (map snd raw_bn_eqs2) descr sorts raw_bn_descr2 raw_bn_descr2 raw_bclauses lthy3
     else raise TEST lthy3
   
 
@@ -575,7 +575,7 @@
   fun prep_binder env bn_str =
     case (Syntax.read_term lthy bn_str) of
       Free (x, _) => (NONE, index_lookup env x)
-    | Const (a, T) $ Free (x, _) => (SOME (Const (a, T)), index_lookup env x)
+    | Const (a, T) $ Free (x, _) => (SOME (Free (Long_Name.base_name a, T)), index_lookup env x)
     | _ => error ("The term " ^ bn_str ^ " is not allowed as binding function.")
  
   fun prep_body env bn_str = index_lookup env bn_str




