src/LCF/lcf.thy
author clasohm
Fri, 03 Mar 1995 12:04:45 +0100
changeset 925 15539deb6863
parent 283 76caebd18756
permissions -rw-r--r--
new version of HOL/Integ with curried function application
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     1
(*  Title: 	LCF/lcf.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     3
    Author: 	Tobias Nipkow
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
76caebd18756 new type declaration syntax instead of numbers
lcp
parents: 0
diff changeset
    18
 ('a,'b) "*"		(infixl 6)
76caebd18756 new type declaration syntax instead of numbers
lcp
parents: 0
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
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    26
 UU	:: "'a"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    27
 TT,FF	:: "tr"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    28
 FIX	:: "('a => 'a) => 'a"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    29
 FST	:: "'a*'b => 'a"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    30
 SND	:: "'a*'b => 'b"
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"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    34
 adm	:: "('a => o) => o"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    35
 VOID	:: "void"		("()")
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    36
 PAIR	:: "['a,'b] => 'a*'b"	("(1<_,/_>)" [0,0] 100)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    37
 COND	:: "[tr,'a,'a] => 'a"	("(_ =>/ (_ |/ _))" [60,60,60] 60)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    38
 "<<"	:: "['a,'a] => o"	(infixl 50)
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
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    42
  eq_def	"x=y == x << y & y << x"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    43
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    44
  less_trans	"[| x << y; y << z |] ==> x << z"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    45
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    46
  less_ext	"(ALL x. f(x) << g(x)) ==> f << g"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    47
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    48
  mono		"[| f << g; x << y |] ==> f(x) << g(y)"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    49
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    50
  minimal	"UU << x"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    51
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    52
  FIX_eq	"f(FIX(f)) = FIX(f)"
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
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    56
  tr_cases	"p=UU | p=TT | p=FF"
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
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    63
  COND_UU	"UU => x | y  =  UU"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    64
  COND_TT	"TT => x | y  =  x"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    65
  COND_FF	"FF => x | y  =  y"
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
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    69
  surj_pairing	"<FST(z),SND(z)> = z"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    70
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    71
  FST	"FST(<x,y>) = x"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    72
  SND	"SND(<x,y>) = y"
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
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    91
  void_cases	"(x::void) = UU"
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
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    95
  induct	"[| adm(P); P(UU); ALL x. P(x) --> P(f(x)) |] ==> P(FIX(f))"
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
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   102
  adm_less	"adm(%x.t(x) << u(x))"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   103
  adm_not_less	"adm(%x.~ t(x) << u)"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   104
  adm_not_free  "adm(%x.A)"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   105
  adm_subst	"adm(P) ==> adm(%x.P(t(x)))"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   106
  adm_conj	"[| adm(P); adm(Q) |] ==> adm(%x.P(x)&Q(x))"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   107
  adm_disj	"[| adm(P); adm(Q) |] ==> adm(%x.P(x)|Q(x))"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   108
  adm_imp	"[| adm(%x.~P(x)); adm(Q) |] ==> adm(%x.P(x)-->Q(x))"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   109
  adm_all	"(!!y.adm(P(y))) ==> adm(%x.ALL y.P(y,x))"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   110
end