src/HOLCF/Tr.thy
author kleing
Mon Jun 21 10:25:57 2004 +0200 (2004-06-21)
changeset 14981 e73f8140af78
parent 12030 46d57d0290a2
child 15649 f8345ee4f607
permissions -rw-r--r--
Merged in license change from Isabelle2004
slotosch@2640
     1
(*  Title:      HOLCF/Tr.thy
slotosch@2640
     2
    ID:         $Id$
slotosch@2640
     3
    Author:     Franz Regensburger
slotosch@2640
     4
slotosch@2640
     5
Introduce infix if_then_else_fi and boolean connectives andalso, orelse
slotosch@2640
     6
*)
slotosch@2640
     7
slotosch@3327
     8
Tr = Lift + Fix +
slotosch@2640
     9
wenzelm@2782
    10
types
wenzelm@2782
    11
  tr = "bool lift"
wenzelm@2782
    12
wenzelm@2766
    13
translations
wenzelm@2782
    14
  "tr" <= (type) "bool lift" 
slotosch@2640
    15
slotosch@2640
    16
consts
slotosch@2640
    17
	TT,FF           :: "tr"
slotosch@2640
    18
        Icifte          :: "tr -> 'c -> 'c -> 'c"
slotosch@2640
    19
        trand           :: "tr -> tr -> tr"
slotosch@2640
    20
        tror            :: "tr -> tr -> tr"
slotosch@2640
    21
        neg             :: "tr -> tr"
mueller@3036
    22
        If2             :: "tr=>'c=>'c=>'c"
slotosch@2640
    23
slotosch@2640
    24
syntax  "@cifte"        :: "tr=>'c=>'c=>'c" ("(3If _/ (then _/ else _) fi)" 60)
slotosch@2640
    25
        "@andalso"      :: "tr => tr => tr" ("_ andalso _" [36,35] 35)
slotosch@2640
    26
        "@orelse"       :: "tr => tr => tr" ("_ orelse _"  [31,30] 30)
slotosch@2640
    27
 
slotosch@2640
    28
translations 
nipkow@10834
    29
	     "x andalso y" == "trand$x$y"
nipkow@10834
    30
             "x orelse y"  == "tror$x$y"
nipkow@10834
    31
             "If b then e1 else e2 fi" == "Icifte$b$e1$e2"
slotosch@2640
    32
defs
slotosch@2640
    33
  TT_def      "TT==Def True"
slotosch@2640
    34
  FF_def      "FF==Def False"
paulson@2719
    35
  neg_def     "neg == flift2 Not"
nipkow@10834
    36
  ifte_def    "Icifte == (LAM b t e. flift1(%b. if b then t else e)$b)"
wenzelm@3842
    37
  andalso_def "trand == (LAM x y. If x then y else FF fi)"
wenzelm@3842
    38
  orelse_def  "tror == (LAM x y. If x then TT else y fi)"
mueller@3036
    39
  If2_def     "If2 Q x y == If Q then x else y fi"
slotosch@2640
    40
slotosch@2640
    41
end
slotosch@2640
    42