src/HOLCF/Dlist.thy
author regensbu
Thu, 29 Jun 1995 16:28:40 +0200
changeset 1168 74be52691d62
parent 1150 66512c9e6bd6
permissions -rw-r--r--
The curried version of HOLCF is now just called HOLCF. The old uncurried version is no longer supported
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
298
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
     1
(*  Title: 	HOLCF/dlist.thy
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
     2
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
     3
    Author: 	Franz Regensburger
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
     4
    ID:         $ $
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
     5
    Copyright   1994 Technische Universitaet Muenchen
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
     6
625
119391dd1d59 New version
nipkow
parents: 298
diff changeset
     7
Theory for finite lists  'a dlist = one ++ ('a ** 'a dlist)
119391dd1d59 New version
nipkow
parents: 298
diff changeset
     8
119391dd1d59 New version
nipkow
parents: 298
diff changeset
     9
The type is axiomatized as the least solution of the domain equation above.
119391dd1d59 New version
nipkow
parents: 298
diff changeset
    10
The functor term that specifies the domain equation is: 
119391dd1d59 New version
nipkow
parents: 298
diff changeset
    11
119391dd1d59 New version
nipkow
parents: 298
diff changeset
    12
  FT = <++,K_{one},<**,K_{'a},I>>
119391dd1d59 New version
nipkow
parents: 298
diff changeset
    13
119391dd1d59 New version
nipkow
parents: 298
diff changeset
    14
For details see chapter 5 of:
119391dd1d59 New version
nipkow
parents: 298
diff changeset
    15
119391dd1d59 New version
nipkow
parents: 298
diff changeset
    16
[Franz Regensburger] HOLCF: Eine konservative Erweiterung von HOL um LCF,
119391dd1d59 New version
nipkow
parents: 298
diff changeset
    17
                     Dissertation, Technische Universit"at M"unchen, 1994
119391dd1d59 New version
nipkow
parents: 298
diff changeset
    18
119391dd1d59 New version
nipkow
parents: 298
diff changeset
    19
298
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    20
*)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    21
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    22
Dlist = Stream2 +
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    23
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    24
types dlist 1
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    25
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    26
(* ----------------------------------------------------------------------- *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    27
(* arity axiom is validated by semantic reasoning                          *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    28
(* partial ordering is implicit in the isomorphism axioms and their cont.  *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    29
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    30
arities dlist::(pcpo)pcpo
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    31
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    32
consts
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    33
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    34
(* ----------------------------------------------------------------------- *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    35
(* essential constants                                                     *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    36
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    37
dlist_rep	:: "('a dlist) -> (one ++ 'a ** 'a dlist)"
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    38
dlist_abs	:: "(one ++ 'a ** 'a dlist) -> ('a dlist)"
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    39
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    40
(* ----------------------------------------------------------------------- *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    41
(* abstract constants and auxiliary constants                              *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    42
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    43
dlist_copy	:: "('a dlist -> 'a dlist) ->'a dlist -> 'a dlist"
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    44
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    45
dnil            :: "'a dlist"
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    46
dcons		:: "'a -> 'a dlist -> 'a dlist"
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    47
dlist_when	:: " 'b -> ('a -> 'a dlist -> 'b) -> 'a dlist -> 'b"
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    48
is_dnil    	:: "'a dlist -> tr"
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    49
is_dcons	:: "'a dlist -> tr"
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    50
dhd		:: "'a dlist -> 'a"
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    51
dtl		:: "'a dlist -> 'a dlist"
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    52
dlist_take	:: "nat => 'a dlist -> 'a dlist"
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    53
dlist_finite	:: "'a dlist => bool"
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    54
dlist_bisim	:: "('a dlist => 'a dlist => bool) => bool"
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    55
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    56
rules
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    57
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    58
(* ----------------------------------------------------------------------- *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    59
(* axiomatization of recursive type 'a dlist                               *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    60
(* ----------------------------------------------------------------------- *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    61
(* ('a dlist,dlist_abs) is the initial F-algebra where                     *)
625
119391dd1d59 New version
nipkow
parents: 298
diff changeset
    62
(* F is the locally continuous functor determined by functor term FT.      *)
119391dd1d59 New version
nipkow
parents: 298
diff changeset
    63
(* domain equation: 'a dlist = one ++ ('a ** 'a dlist)                     *)
119391dd1d59 New version
nipkow
parents: 298
diff changeset
    64
(* functor term:    FT = <++,K_{one},<**,K_{'a},I>>                        *)
298
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    65
(* ----------------------------------------------------------------------- *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    66
(* dlist_abs is an isomorphism with inverse dlist_rep                      *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    67
(* identity is the least endomorphism on 'a dlist                          *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    68
1168
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 1150
diff changeset
    69
dlist_abs_iso	"dlist_rep`(dlist_abs`x) = x"
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 1150
diff changeset
    70
dlist_rep_iso	"dlist_abs`(dlist_rep`x) = x"
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 1150
diff changeset
    71
dlist_copy_def	"dlist_copy == (LAM f. dlist_abs oo \
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 1150
diff changeset
    72
\ 		(sswhen`sinl`(sinr oo (ssplit`(LAM x y. (|x,f`y|) ))))\
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 1150
diff changeset
    73
\                                oo dlist_rep)"
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 1150
diff changeset
    74
dlist_reach	"(fix`dlist_copy)`x=x"
298
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    75
1168
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 1150
diff changeset
    76
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 1150
diff changeset
    77
defs
298
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    78
(* ----------------------------------------------------------------------- *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    79
(* properties of additional constants                                      *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    80
(* ----------------------------------------------------------------------- *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    81
(* constructors                                                            *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    82
1168
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 1150
diff changeset
    83
dnil_def	"dnil  == dlist_abs`(sinl`one)"
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 1150
diff changeset
    84
dcons_def	"dcons == (LAM x l. dlist_abs`(sinr`(|x,l|) ))"
298
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    85
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    86
(* ----------------------------------------------------------------------- *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    87
(* discriminator functional                                                *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    88
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    89
dlist_when_def 
1168
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 1150
diff changeset
    90
"dlist_when == (LAM f1 f2 l.\
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 1150
diff changeset
    91
\   sswhen`(LAM x.f1) `(ssplit`(LAM x l.f2`x`l)) `(dlist_rep`l))"
298
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    92
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    93
(* ----------------------------------------------------------------------- *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    94
(* discriminators and selectors                                            *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
    95
1168
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 1150
diff changeset
    96
is_dnil_def	"is_dnil  == dlist_when`TT`(LAM x l.FF)"
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 1150
diff changeset
    97
is_dcons_def	"is_dcons == dlist_when`FF`(LAM x l.TT)"
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 1150
diff changeset
    98
dhd_def		"dhd == dlist_when`UU`(LAM x l.x)"
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 1150
diff changeset
    99
dtl_def		"dtl == dlist_when`UU`(LAM x l.l)"
298
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
   100
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
   101
(* ----------------------------------------------------------------------- *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
   102
(* the taker for dlists                                                   *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
   103
1168
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 1150
diff changeset
   104
dlist_take_def "dlist_take == (%n.iterate n dlist_copy UU)"
298
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
   105
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
   106
(* ----------------------------------------------------------------------- *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
   107
1168
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 1150
diff changeset
   108
dlist_finite_def	"dlist_finite == (%s.? n.dlist_take n`s=s)"
298
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
   109
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
   110
(* ----------------------------------------------------------------------- *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
   111
(* definition of bisimulation is determined by domain equation             *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
   112
(* simplification and rewriting for abstract constants yields def below    *)
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
   113
1150
66512c9e6bd6 removed \...\ inside strings
clasohm
parents: 625
diff changeset
   114
dlist_bisim_def "dlist_bisim ==
66512c9e6bd6 removed \...\ inside strings
clasohm
parents: 625
diff changeset
   115
 ( %R.!l1 l2.
1168
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 1150
diff changeset
   116
 	R l1 l2 -->
1150
66512c9e6bd6 removed \...\ inside strings
clasohm
parents: 625
diff changeset
   117
  ((l1=UU & l2=UU) |
66512c9e6bd6 removed \...\ inside strings
clasohm
parents: 625
diff changeset
   118
   (l1=dnil & l2=dnil) |
66512c9e6bd6 removed \...\ inside strings
clasohm
parents: 625
diff changeset
   119
   (? x l11 l21. x~=UU & l11~=UU & l21~=UU & 
1168
74be52691d62 The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents: 1150
diff changeset
   120
               l1=dcons`x`l11 & l2 = dcons`x`l21 & R l11 l21)))"
298
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
   121
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
   122
end
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
   123
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
   124
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
   125
3a0485439396 structural induction for strict lists
nipkow
parents:
diff changeset
   126