Reduced indentation; no change in function
authorpaulson
Thu Dec 28 12:37:57 1995 +0100 (1995-12-28)
changeset 142815a69dd0a145
parent 1427 ecd90b82ab8e
child 1429 1f0009009219
Reduced indentation; no change in function
src/ZF/thy_syntax.ML
     1.1 --- a/src/ZF/thy_syntax.ML	Thu Dec 28 12:37:00 1995 +0100
     1.2 +++ b/src/ZF/thy_syntax.ML	Thu Dec 28 12:37:57 1995 +0100
     1.3 @@ -12,55 +12,55 @@
     1.4  (*Inductive definitions theory section.   co is either "" or "Co"*)
     1.5  fun inductive_decl co =
     1.6    let open ThyParse 
     1.7 -      fun mk_intr_name (s,_) =  (*the "op" cancels any infix status*)
     1.8 -	  if Syntax.is_identifier s then "op " ^ s  else "_"
     1.9 -      fun mk_params ((((((rec_tms, sdom_sum), ipairs), 
    1.10 -			monos), con_defs), type_intrs), type_elims) =
    1.11 -        let val big_rec_name = space_implode "_" 
    1.12 -		             (map (scan_to_id o trim) rec_tms)
    1.13 -	    and srec_tms = mk_list rec_tms
    1.14 -	    and sintrs   = mk_big_list (map snd ipairs)
    1.15 -            val stri_name = big_rec_name ^ "_Intrnl"
    1.16 -        in
    1.17 -	   (";\n\n\
    1.18 -            \structure " ^ stri_name ^ " =\n\
    1.19 -            \  struct\n\
    1.20 -            \  val _ = writeln \"" ^ co ^ 
    1.21 -	               "Inductive definition " ^ big_rec_name ^ "\"\n\
    1.22 -            \  val rec_tms\t= map (readtm (sign_of thy) Ind_Syntax.iT) "
    1.23 -	                     ^ srec_tms ^ "\n\
    1.24 -            \  and dom_sum\t= readtm (sign_of thy) Ind_Syntax.iT " ^ sdom_sum ^ "\n\
    1.25 -            \  and intr_tms\t= map (readtm (sign_of thy) propT)\n"
    1.26 -	                     ^ sintrs ^ "\n\
    1.27 -            \  end;\n\n\
    1.28 -            \val thy = thy |> " ^ co ^ "Ind.add_fp_def_i \n    (" ^ 
    1.29 -	       stri_name ^ ".rec_tms, " ^
    1.30 -               stri_name ^ ".dom_sum, " ^
    1.31 -               stri_name ^ ".intr_tms)"
    1.32 -           ,
    1.33 -	    "structure " ^ big_rec_name ^ " =\n\
    1.34 -            \ let\n\
    1.35 -            \  val _ = writeln \"Proofs for " ^ co ^ 
    1.36 -	               "Inductive definition " ^ big_rec_name ^ "\"\n\
    1.37 -            \  structure Result = " ^ co ^ "Ind_section_Fun\n\
    1.38 -            \\t  (open " ^ stri_name ^ "\n\
    1.39 -            \\t   val thy\t\t= thy\n\
    1.40 -            \\t   val monos\t\t= " ^ monos ^ "\n\
    1.41 -            \\t   val con_defs\t\t= " ^ con_defs ^ "\n\
    1.42 -            \\t   val type_intrs\t= " ^ type_intrs ^ "\n\
    1.43 -            \\t   val type_elims\t= " ^ type_elims ^ ")\n\
    1.44 -            \ in\n\
    1.45 -            \  struct\n\
    1.46 -            \  val " ^ mk_list (map mk_intr_name ipairs) ^ " = Result.intrs;\n\
    1.47 -            \  open Result\n\
    1.48 -            \  end\n\
    1.49 -            \ end;\n\n\
    1.50 -            \structure " ^ stri_name ^ " = struct end;\n\n"
    1.51 -	   )
    1.52 -	end
    1.53 -      val domains = "domains" $$-- enum1 "+" string --$$ "<=" -- !! string
    1.54 -      val ipairs  = "intrs"   $$-- repeat1 (ident -- !! string)
    1.55 -      fun optstring s = optional (s $$-- string) "\"[]\"" >> trim
    1.56 +    fun mk_intr_name (s,_) =  (*the "op" cancels any infix status*)
    1.57 +	if Syntax.is_identifier s then "op " ^ s  else "_"
    1.58 +    fun mk_params ((((((rec_tms, sdom_sum), ipairs), 
    1.59 +		      monos), con_defs), type_intrs), type_elims) =
    1.60 +      let val big_rec_name = space_implode "_" 
    1.61 +			   (map (scan_to_id o trim) rec_tms)
    1.62 +	  and srec_tms = mk_list rec_tms
    1.63 +	  and sintrs   = mk_big_list (map snd ipairs)
    1.64 +	  val stri_name = big_rec_name ^ "_Intrnl"
    1.65 +      in
    1.66 +	 (";\n\n\
    1.67 +	  \structure " ^ stri_name ^ " =\n\
    1.68 +	  \  struct\n\
    1.69 +	  \  val _ = writeln \"" ^ co ^ 
    1.70 +		     "Inductive definition " ^ big_rec_name ^ "\"\n\
    1.71 +	  \  val rec_tms\t= map (readtm (sign_of thy) Ind_Syntax.iT) "
    1.72 +			   ^ srec_tms ^ "\n\
    1.73 +	  \  and dom_sum\t= readtm (sign_of thy) Ind_Syntax.iT " ^ sdom_sum ^ "\n\
    1.74 +	  \  and intr_tms\t= map (readtm (sign_of thy) propT)\n"
    1.75 +			   ^ sintrs ^ "\n\
    1.76 +	  \  end;\n\n\
    1.77 +	  \val thy = thy |> " ^ co ^ "Ind.add_fp_def_i \n    (" ^ 
    1.78 +	     stri_name ^ ".rec_tms, " ^
    1.79 +	     stri_name ^ ".dom_sum, " ^
    1.80 +	     stri_name ^ ".intr_tms)"
    1.81 +	 ,
    1.82 +	  "structure " ^ big_rec_name ^ " =\n\
    1.83 +	  \ let\n\
    1.84 +	  \  val _ = writeln \"Proofs for " ^ co ^ 
    1.85 +		     "Inductive definition " ^ big_rec_name ^ "\"\n\
    1.86 +	  \  structure Result = " ^ co ^ "Ind_section_Fun\n\
    1.87 +	  \\t  (open " ^ stri_name ^ "\n\
    1.88 +	  \\t   val thy\t\t= thy\n\
    1.89 +	  \\t   val monos\t\t= " ^ monos ^ "\n\
    1.90 +	  \\t   val con_defs\t\t= " ^ con_defs ^ "\n\
    1.91 +	  \\t   val type_intrs\t= " ^ type_intrs ^ "\n\
    1.92 +	  \\t   val type_elims\t= " ^ type_elims ^ ")\n\
    1.93 +	  \ in\n\
    1.94 +	  \  struct\n\
    1.95 +	  \  val " ^ mk_list (map mk_intr_name ipairs) ^ " = Result.intrs;\n\
    1.96 +	  \  open Result\n\
    1.97 +	  \  end\n\
    1.98 +	  \ end;\n\n\
    1.99 +	  \structure " ^ stri_name ^ " = struct end;\n\n"
   1.100 +	 )
   1.101 +      end
   1.102 +    val domains = "domains" $$-- enum1 "+" string --$$ "<=" -- !! string
   1.103 +    val ipairs  = "intrs"   $$-- repeat1 (ident -- !! string)
   1.104 +    fun optstring s = optional (s $$-- string) "\"[]\"" >> trim
   1.105    in domains -- ipairs -- optstring "monos" -- optstring "con_defs"
   1.106               -- optstring "type_intrs" -- optstring "type_elims"
   1.107       >> mk_params