--- a/Nominal/Parser.thy Tue Mar 02 15:10:47 2010 +0100
+++ b/Nominal/Parser.thy Tue Mar 02 15:11:41 2010 +0100
@@ -1,5 +1,5 @@
theory Parser
-imports "Nominal2_Atoms" "Nominal2_Eqvt" "Nominal2_Supp" "Perm" "Fv"
+imports "Nominal2_Atoms" "Nominal2_Eqvt" "Nominal2_Supp" "Perm" "Fv" "Rsp"
begin
atom_decl name
@@ -215,13 +215,30 @@
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 descr = #descr dtinfo;
+ val all_full_tnames = map (fn (_, (n, _, _)) => n) descr;
+ val dtinfos = map (Datatype.the_info (ProofContext.theory_of lthy2)) all_full_tnames;
+ val inject = flat (map #inject dtinfos);
+ val distinct = flat (map #distinct dtinfos);
+ val inducts = #inducts dtinfo;
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;
+ val dts_names = map (fn (i, (s, _, _)) => (s, i)) (#descr dtinfo);
+ val _ = tracing (PolyML.makestring dts_names);
+ val bn_tys = map (domain_type o fastype_of) raw_bn_funs;
+ val _ = tracing (PolyML.makestring bn_tys);
+ val bn_nos = map (dtyp_no_of_typ dts_names) bn_tys;
+ val _ = tracing (PolyML.makestring bn_nos);
+ val bns = raw_bn_funs ~~ bn_nos;
+ val alpha_intros = #intrs alpha;
+ val alpha_cases = #elims alpha
+ val alpha_inj_loc = build_alpha_inj alpha_intros (inject @ distinct) alpha_cases lthy4
+ val (bv_eqvts, lthy5) = fold_map (build_bv_eqvt perms (raw_bn_eqs @ raw_perm_def) inducts) bns lthy4;
in
- ((raw_dt_names, raw_bn_funs, raw_bn_eqs, raw_binds), lthy4)
+ ((raw_dt_names, raw_bn_funs, raw_bn_eqs, raw_binds), lthy5)
end
*}