src/HOLCF/ex/Coind.thy
author nipkow
Wed, 19 Jan 1994 17:40:26 +0100
changeset 244 929fc2c63bd0
child 1168 74be52691d62
permissions -rw-r--r--
HOLCF examples
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
244
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
     1
(*  Title: 	HOLCF/coind.thy
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
     2
    ID:         $Id$
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
     3
    Author: 	Franz Regensburger
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
     4
    Copyright   1993 Technische Universitaet Muenchen
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
     5
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
     6
Example for co-induction on streams
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
     7
*)
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
     8
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
     9
Coind = Stream2 +
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    10
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    11
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    12
consts
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    13
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    14
nats		:: "dnat stream"
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    15
from		:: "dnat -> dnat stream"
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    16
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    17
rules
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    18
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    19
nats_def	"nats = fix[LAM h.scons[dzero][smap[dsucc][h]]]"
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    20
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    21
from_def	"from = fix[LAM h n.scons[n][h[dsucc[n]]]]"
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    22
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    23
end
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    24
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    25
(*
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    26
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    27
		smap[f][UU] = UU
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    28
      x~=UU --> smap[f][scons[x][xs]] = scons[f[x]][smap[f][xs]]
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    29
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    30
		nats = scons[dzero][smap[dsucc][nats]]
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    31
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    32
		from[n] = scons[n][from[dsucc[n]]]
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    33
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    34
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    35
*)
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    36
929fc2c63bd0 HOLCF examples
nipkow
parents:
diff changeset
    37