src/HOLCF/Ssum0.thy
author kleing
Wed, 14 Apr 2004 14:13:05 +0200
changeset 14565 c6dc17aab88a
parent 12114 a8e860c86252
child 14981 e73f8140af78
permissions -rw-r--r--
use more symbols in HTML output
slotosch@2640
     1
(*  Title:      HOLCF/Ssum0.thy
nipkow@243
     2
    ID:         $Id$
clasohm@1479
     3
    Author:     Franz Regensburger
wenzelm@12030
     4
    License:    GPL (GNU GENERAL PUBLIC LICENSE)
nipkow@243
     5
slotosch@2640
     6
Strict sum with typedef
nipkow@243
     7
*)
nipkow@243
     8
nipkow@243
     9
Ssum0 = Cfun3 +
nipkow@243
    10
slotosch@2640
    11
constdefs
slotosch@2640
    12
  Sinl_Rep      :: ['a,'a,'b,bool]=>bool
slotosch@2640
    13
 "Sinl_Rep == (%a.%x y p. (a~=UU --> x=a & p))"
slotosch@2640
    14
  Sinr_Rep      :: ['b,'a,'b,bool]=>bool
slotosch@2640
    15
 "Sinr_Rep == (%b.%x y p.(b~=UU --> y=b & ~p))"
nipkow@243
    16
slotosch@2640
    17
typedef (Ssum)  ('a, 'b) "++" (infixr 10) = 
wenzelm@6382
    18
	"{f.(? a. f=Sinl_Rep(a::'a))|(? b. f=Sinr_Rep(b::'b))}"
nipkow@243
    19
wenzelm@12114
    20
syntax (xsymbols)
slotosch@2640
    21
  "++"		:: [type, type] => type	("(_ \\<oplus>/ _)" [21, 20] 20)
kleing@14565
    22
syntax (HTML output)
kleing@14565
    23
  "++"		:: [type, type] => type	("(_ \\<oplus>/ _)" [21, 20] 20)
oheimb@2394
    24
nipkow@243
    25
consts
clasohm@1479
    26
  Isinl         :: "'a => ('a ++ 'b)"
clasohm@1479
    27
  Isinr         :: "'b => ('a ++ 'b)"
clasohm@1479
    28
  Iwhen         :: "('a->'c)=>('b->'c)=>('a ++ 'b)=> 'c"
nipkow@243
    29
regensbu@1168
    30
defs   (*defining the abstract constants*)
clasohm@1479
    31
  Isinl_def     "Isinl(a) == Abs_Ssum(Sinl_Rep(a))"
clasohm@1479
    32
  Isinr_def     "Isinr(b) == Abs_Ssum(Sinr_Rep(b))"
nipkow@243
    33
clasohm@1479
    34
  Iwhen_def     "Iwhen(f)(g)(s) == @z.
clasohm@1479
    35
                                    (s=Isinl(UU) --> z=UU)
nipkow@10834
    36
                        &(!a. a~=UU & s=Isinl(a) --> z=f$a)  
nipkow@10834
    37
                        &(!b. b~=UU & s=Isinr(b) --> z=g$b)"  
nipkow@243
    38
nipkow@243
    39
end