src/HOL/Nominal/nominal_atoms.ML
changeset 22274 ce1459004c8d
parent 21669 c68717c16013
child 22418 49e2d9744ae1
equal deleted inserted replaced
22273:9785397cc344 22274:ce1459004c8d
    14 end
    14 end
    15 
    15 
    16 structure NominalAtoms : NOMINAL_ATOMS =
    16 structure NominalAtoms : NOMINAL_ATOMS =
    17 struct
    17 struct
    18 
    18 
    19 val Finites_emptyI = thm "Finites.emptyI";
    19 val finite_emptyI = thm "finite.emptyI";
    20 val Collect_const = thm "Collect_const";
    20 val Collect_const = thm "Collect_const";
    21 
    21 
    22 
    22 
    23 (* data kind 'HOL/nominal' *)
    23 (* data kind 'HOL/nominal' *)
    24 
    24 
    65     (* <ak>_infinite: infinite (UNIV::<ak_type> set) *)
    65     (* <ak>_infinite: infinite (UNIV::<ak_type> set) *)
    66     val (inf_axs,thy2) = PureThy.add_axioms_i (map (fn (ak_name, T) =>
    66     val (inf_axs,thy2) = PureThy.add_axioms_i (map (fn (ak_name, T) =>
    67       let 
    67       let 
    68     val name = ak_name ^ "_infinite"
    68     val name = ak_name ^ "_infinite"
    69         val axiom = HOLogic.mk_Trueprop (HOLogic.mk_not
    69         val axiom = HOLogic.mk_Trueprop (HOLogic.mk_not
    70                     (HOLogic.mk_mem (HOLogic.mk_UNIV T,
    70                     (Const ("Finite_Set.finite", HOLogic.mk_setT T --> HOLogic.boolT) $
    71                      Const ("Finite_Set.Finites", HOLogic.mk_setT (HOLogic.mk_setT T)))))
    71                        HOLogic.mk_UNIV T))
    72       in
    72       in
    73         ((name, axiom), []) 
    73         ((name, axiom), []) 
    74       end) ak_names_types) thy1;
    74       end) ak_names_types) thy1;
    75     
    75     
    76     (* declares a swapping function for every atom-kind, it is         *)
    76     (* declares a swapping function for every atom-kind, it is         *)
   250 	  val cl_name = "fs_"^ak_name;
   250 	  val cl_name = "fs_"^ak_name;
   251 	  val pt_name = Sign.full_name thy ("pt_"^ak_name);
   251 	  val pt_name = Sign.full_name thy ("pt_"^ak_name);
   252           val ty = TFree("'a",["HOL.type"]);
   252           val ty = TFree("'a",["HOL.type"]);
   253           val x   = Free ("x", ty);
   253           val x   = Free ("x", ty);
   254           val csupp    = Const ("Nominal.supp", ty --> HOLogic.mk_setT T);
   254           val csupp    = Const ("Nominal.supp", ty --> HOLogic.mk_setT T);
   255           val cfinites = Const ("Finite_Set.Finites", HOLogic.mk_setT (HOLogic.mk_setT T))
   255           val cfinite  = Const ("Finite_Set.finite", HOLogic.mk_setT T --> HOLogic.boolT)
   256           
   256           
   257           val axiom1   = HOLogic.mk_Trueprop (HOLogic.mk_mem (csupp $ x, cfinites));
   257           val axiom1   = HOLogic.mk_Trueprop (cfinite $ (csupp $ x));
   258 
   258 
   259        in  
   259        in  
   260         AxClass.define_class_i (cl_name, [pt_name]) [] [((cl_name ^ "1", []), [axiom1])] thy            
   260         AxClass.define_class_i (cl_name, [pt_name]) [] [((cl_name ^ "1", []), [axiom1])] thy            
   261        end) ak_names_types thy8; 
   261        end) ak_names_types thy8; 
   262 
   262 
   479                   let val at_thm = PureThy.get_thm thy' (Name ("at_"^ak_name^"_inst"));
   479                   let val at_thm = PureThy.get_thm thy' (Name ("at_"^ak_name^"_inst"));
   480                   in  EVERY [ClassPackage.intro_classes_tac [],
   480                   in  EVERY [ClassPackage.intro_classes_tac [],
   481                              rtac ((at_thm RS fs_at_inst) RS fs1) 1] end
   481                              rtac ((at_thm RS fs_at_inst) RS fs1) 1] end
   482                 else
   482                 else
   483                   let val dj_inst = PureThy.get_thm thy' (Name ("dj_"^ak_name'^"_"^ak_name));
   483                   let val dj_inst = PureThy.get_thm thy' (Name ("dj_"^ak_name'^"_"^ak_name));
   484                       val simp_s = HOL_basic_ss addsimps [dj_inst RS dj_supp, Finites_emptyI];
   484                       val simp_s = HOL_basic_ss addsimps [dj_inst RS dj_supp, finite_emptyI];
   485                   in EVERY [ClassPackage.intro_classes_tac [], asm_simp_tac simp_s 1] end)
   485                   in EVERY [ClassPackage.intro_classes_tac [], asm_simp_tac simp_s 1] end)
   486         in
   486         in
   487          AxClass.prove_arity (qu_name,[],[qu_class]) proof thy'
   487          AxClass.prove_arity (qu_name,[],[qu_class]) proof thy'
   488         end) ak_names thy) ak_names thy18;
   488         end) ak_names thy) ak_names thy18;
   489 
   489 
   616           fun discrete_fs_inst discrete_ty defn = 
   616           fun discrete_fs_inst discrete_ty defn = 
   617 	     fold (fn ak_name => fn thy =>
   617 	     fold (fn ak_name => fn thy =>
   618 	     let
   618 	     let
   619 	       val qu_class = Sign.full_name thy ("fs_"^ak_name);
   619 	       val qu_class = Sign.full_name thy ("fs_"^ak_name);
   620 	       val supp_def = thm "Nominal.supp_def";
   620 	       val supp_def = thm "Nominal.supp_def";
   621                val simp_s = HOL_ss addsimps [supp_def,Collect_const,Finites_emptyI,defn];
   621                val simp_s = HOL_ss addsimps [supp_def,Collect_const,finite_emptyI,defn];
   622                val proof = EVERY [ClassPackage.intro_classes_tac [], asm_simp_tac simp_s 1];
   622                val proof = EVERY [ClassPackage.intro_classes_tac [], asm_simp_tac simp_s 1];
   623              in 
   623              in 
   624 	       AxClass.prove_arity (discrete_ty,[],[qu_class]) proof thy
   624 	       AxClass.prove_arity (discrete_ty,[],[qu_class]) proof thy
   625              end) ak_names;
   625              end) ak_names;
   626 
   626