src/LCF/LCF.thy
author wenzelm
Wed, 31 Oct 2001 21:59:25 +0100
changeset 12005 291593391010
parent 3837 d7f033c74b38
child 17248 81bf91654e73
permissions -rw-r--r--
added local_standard;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1474
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
     1
(*  Title:      LCF/lcf.thy
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
1474
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
     3
    Author:     Tobias Nipkow
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
    Copyright   1992  University of Cambridge
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     6
Natural Deduction Rules for LCF
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
LCF = FOL +
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    10
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    11
classes cpo < term
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    12
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
default cpo
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    14
283
76caebd18756 new type declaration syntax instead of numbers
lcp
parents: 0
diff changeset
    15
types
76caebd18756 new type declaration syntax instead of numbers
lcp
parents: 0
diff changeset
    16
 tr
76caebd18756 new type declaration syntax instead of numbers
lcp
parents: 0
diff changeset
    17
 void
1474
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    18
 ('a,'b) "*"            (infixl 6)
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    19
 ('a,'b) "+"            (infixl 5)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    20
283
76caebd18756 new type declaration syntax instead of numbers
lcp
parents: 0
diff changeset
    21
arities
76caebd18756 new type declaration syntax instead of numbers
lcp
parents: 0
diff changeset
    22
 fun, "*", "+" :: (cpo,cpo)cpo
76caebd18756 new type declaration syntax instead of numbers
lcp
parents: 0
diff changeset
    23
 tr,void       :: cpo
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    24
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    25
consts
1474
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    26
 UU     :: "'a"
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    27
 TT,FF  :: "tr"
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    28
 FIX    :: "('a => 'a) => 'a"
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    29
 FST    :: "'a*'b => 'a"
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    30
 SND    :: "'a*'b => 'b"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    31
 INL    :: "'a => 'a+'b"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    32
 INR    :: "'b => 'a+'b"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    33
 WHEN   :: "['a=>'c, 'b=>'c, 'a+'b] => 'c"
1474
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    34
 adm    :: "('a => o) => o"
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    35
 VOID   :: "void"               ("'(')")
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    36
 PAIR   :: "['a,'b] => 'a*'b"   ("(1<_,/_>)" [0,0] 100)
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    37
 COND   :: "[tr,'a,'a] => 'a"   ("(_ =>/ (_ |/ _))" [60,60,60] 60)
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    38
 "<<"   :: "['a,'a] => o"       (infixl 50)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    39
rules
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    40
  (** DOMAIN THEORY **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    41
1474
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    42
  eq_def        "x=y == x << y & y << x"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    43
1474
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    44
  less_trans    "[| x << y; y << z |] ==> x << z"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    45
1474
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    46
  less_ext      "(ALL x. f(x) << g(x)) ==> f << g"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    47
1474
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    48
  mono          "[| f << g; x << y |] ==> f(x) << g(y)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    49
1474
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    50
  minimal       "UU << x"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    51
1474
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    52
  FIX_eq        "f(FIX(f)) = FIX(f)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    53
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    54
  (** TR **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    55
1474
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    56
  tr_cases      "p=UU | p=TT | p=FF"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    57
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    58
  not_TT_less_FF "~ TT << FF"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    59
  not_FF_less_TT "~ FF << TT"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    60
  not_TT_less_UU "~ TT << UU"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    61
  not_FF_less_UU "~ FF << UU"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    62
1474
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    63
  COND_UU       "UU => x | y  =  UU"
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    64
  COND_TT       "TT => x | y  =  x"
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    65
  COND_FF       "FF => x | y  =  y"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    66
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    67
  (** PAIRS **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    68
1474
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    69
  surj_pairing  "<FST(z),SND(z)> = z"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    70
1474
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    71
  FST   "FST(<x,y>) = x"
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    72
  SND   "SND(<x,y>) = y"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    73
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    74
  (*** STRICT SUM ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    75
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    76
  INL_DEF "~x=UU ==> ~INL(x)=UU"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    77
  INR_DEF "~x=UU ==> ~INR(x)=UU"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    78
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    79
  INL_STRICT "INL(UU) = UU"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    80
  INR_STRICT "INR(UU) = UU"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    81
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    82
  WHEN_UU  "WHEN(f,g,UU) = UU"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    83
  WHEN_INL "~x=UU ==> WHEN(f,g,INL(x)) = f(x)"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    84
  WHEN_INR "~x=UU ==> WHEN(f,g,INR(x)) = g(x)"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    85
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    86
  SUM_EXHAUSTION
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    87
    "z = UU | (EX x. ~x=UU & z = INL(x)) | (EX y. ~y=UU & z = INR(y))"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    88
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    89
  (** VOID **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    90
1474
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    91
  void_cases    "(x::void) = UU"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    92
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    93
  (** INDUCTION **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    94
1474
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    95
  induct        "[| adm(P); P(UU); ALL x. P(x) --> P(f(x)) |] ==> P(FIX(f))"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    96
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    97
  (** Admissibility / Chain Completeness **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    98
  (* All rules can be found on pages 199--200 of Larry's LCF book.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    99
     Note that "easiness" of types is not taken into account
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   100
     because it cannot be expressed schematically; flatness could be. *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   101
3837
d7f033c74b38 fixed dots;
wenzelm
parents: 1474
diff changeset
   102
  adm_less      "adm(%x. t(x) << u(x))"
1474
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
   103
  adm_not_less  "adm(%x.~ t(x) << u)"
3837
d7f033c74b38 fixed dots;
wenzelm
parents: 1474
diff changeset
   104
  adm_not_free  "adm(%x. A)"
d7f033c74b38 fixed dots;
wenzelm
parents: 1474
diff changeset
   105
  adm_subst     "adm(P) ==> adm(%x. P(t(x)))"
d7f033c74b38 fixed dots;
wenzelm
parents: 1474
diff changeset
   106
  adm_conj      "[| adm(P); adm(Q) |] ==> adm(%x. P(x)&Q(x))"
d7f033c74b38 fixed dots;
wenzelm
parents: 1474
diff changeset
   107
  adm_disj      "[| adm(P); adm(Q) |] ==> adm(%x. P(x)|Q(x))"
d7f033c74b38 fixed dots;
wenzelm
parents: 1474
diff changeset
   108
  adm_imp       "[| adm(%x.~P(x)); adm(Q) |] ==> adm(%x. P(x)-->Q(x))"
d7f033c74b38 fixed dots;
wenzelm
parents: 1474
diff changeset
   109
  adm_all       "(!!y. adm(P(y))) ==> adm(%x. ALL y. P(y,x))"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   110
end