src/HOL/Groups.thy
changeset 42247 12fe41a92cd5
parent 42245 29e3967550d5
child 42248 04bffad68aa4
equal deleted inserted replaced
42246:8f798ba04393 42247:12fe41a92cd5
   123 
   123 
   124 simproc_setup reorient_zero ("0 = x") = Reorient_Proc.proc
   124 simproc_setup reorient_zero ("0 = x") = Reorient_Proc.proc
   125 simproc_setup reorient_one ("1 = x") = Reorient_Proc.proc
   125 simproc_setup reorient_one ("1 = x") = Reorient_Proc.proc
   126 
   126 
   127 typed_print_translation (advanced) {*
   127 typed_print_translation (advanced) {*
   128 let
   128   let
   129   fun tr' c = (c, fn ctxt => fn show_sorts => fn T => fn ts =>
   129     fun tr' c = (c, fn ctxt => fn T => fn ts =>
   130     if not (null ts) orelse T = dummyT
   130       if not (null ts) orelse T = dummyT
   131       orelse not (Config.get ctxt show_types) andalso can Term.dest_Type T
   131         orelse not (Config.get ctxt show_types) andalso can Term.dest_Type T
   132     then raise Match
   132       then raise Match
   133     else Syntax.const Syntax.constrainC $ Syntax.const c $ Syntax_Phases.term_of_typ show_sorts T);
   133       else Syntax.const Syntax.constrainC $ Syntax.const c $ Syntax_Phases.term_of_typ ctxt T);
   134 in map tr' [@{const_syntax Groups.one}, @{const_syntax Groups.zero}] end;
   134   in map tr' [@{const_syntax Groups.one}, @{const_syntax Groups.zero}] end;
   135 *} -- {* show types that are presumably too general *}
   135 *} -- {* show types that are presumably too general *}
   136 
   136 
   137 class plus =
   137 class plus =
   138   fixes plus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"  (infixl "+" 65)
   138   fixes plus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"  (infixl "+" 65)
   139 
   139