src/ZF/Tools/inductive_package.ML
changeset 22567 1565d476a9e2
parent 22101 6d13239d5f52
child 22675 acf10be7dcca
equal deleted inserted replaced
22566:535ae9dd4c45 22567:1565d476a9e2
   133                    mk_Collect(z', dom_sum,
   133                    mk_Collect(z', dom_sum,
   134                               fold_bal FOLogic.mk_disj part_intrs));
   134                               fold_bal FOLogic.mk_disj part_intrs));
   135 
   135 
   136   val fp_rhs = Fp.oper $ dom_sum $ fp_abs
   136   val fp_rhs = Fp.oper $ dom_sum $ fp_abs
   137 
   137 
   138   val dummy = List.app (fn rec_hd => deny (Logic.occs (rec_hd, fp_rhs))
   138   val dummy = List.app (fn rec_hd => (Logic.occs (rec_hd, fp_rhs) andalso
   139                              "Illegal occurrence of recursion operator")
   139                              error "Illegal occurrence of recursion operator"; ()))
   140            rec_hds;
   140            rec_hds;
   141 
   141 
   142   (*** Make the new theory ***)
   142   (*** Make the new theory ***)
   143 
   143 
   144   (*A key definition:
   144   (*A key definition:
   150 
   150 
   151   val _ =
   151   val _ =
   152     if verbose then
   152     if verbose then
   153       writeln ((if coind then "Coind" else "Ind") ^ "uctive definition " ^ quote big_rec_name)
   153       writeln ((if coind then "Coind" else "Ind") ^ "uctive definition " ^ quote big_rec_name)
   154     else ();
   154     else ();
   155 
       
   156   (*Forbid the inductive definition structure from clashing with a theory
       
   157     name.  This restriction may become obsolete as ML is de-emphasized.*)
       
   158   val dummy = deny (big_rec_base_name mem (Context.names_of thy))
       
   159                ("Definition " ^ big_rec_base_name ^
       
   160                 " would clash with the theory of the same name!");
       
   161 
   155 
   162   (*Big_rec... is the union of the mutually recursive sets*)
   156   (*Big_rec... is the union of the mutually recursive sets*)
   163   val big_rec_tm = list_comb(Const(big_rec_name,recT), rec_params);
   157   val big_rec_tm = list_comb(Const(big_rec_name,recT), rec_params);
   164 
   158 
   165   (*The individual sets must already be declared*)
   159   (*The individual sets must already be declared*)