Nominal/Parser.thy
changeset 1295 0ecc775e5fce
parent 1293 dca51a1f0c0d
child 1309 b395b902cf0d
--- a/Nominal/Parser.thy	Tue Mar 02 06:43:09 2010 +0100
+++ b/Nominal/Parser.thy	Tue Mar 02 08:42:10 2010 +0100
@@ -1,5 +1,5 @@
 theory Parser
-imports "Nominal2_Atoms" "Nominal2_Eqvt" "Nominal2_Supp"
+imports "Nominal2_Atoms" "Nominal2_Eqvt" "Nominal2_Supp" "Perm" "Fv"
 begin
 
 atom_decl name
@@ -212,10 +212,16 @@
 ML {* 
 fun nominal_datatype2 dts bn_funs bn_eqs binds lthy =
 let
-  val (((raw_dt_names, (raw_bn_funs, raw_bn_eqs)), raw_binds), lthy') =
+  val (((raw_dt_names, (raw_bn_funs, raw_bn_eqs)), raw_binds), lthy2) =
     raw_nominal_decls dts bn_funs bn_eqs binds lthy
+  val dtinfo = Datatype.the_info (ProofContext.theory_of lthy2) (hd raw_dt_names);
+  val ((raw_perm_def, raw_perm_simps, perms), lthy3) =
+    Local_Theory.theory_result (define_raw_perms dtinfo (length dts)) lthy2;
+  val raw_binds_flat = map (map flat) raw_binds;
+  val (((fv_ts_loc, fv_def_loc), alpha), lthy4) = define_fv_alpha dtinfo raw_binds_flat lthy3;
+
 in
-  ((raw_dt_names, raw_bn_funs, raw_bn_eqs, raw_binds), lthy')
+  ((raw_dt_names, raw_bn_funs, raw_bn_eqs, raw_binds), lthy4)
 end
 *}