| author | paulson |
| Mon, 23 Feb 2004 17:33:38 +0100 | |
| changeset 14409 | 91181ee5860c |
| parent 12036 | 49f6c49454c2 |
| child 14981 | e73f8140af78 |
| permissions | -rw-r--r-- |
| 1479 | 1 |
(* Title: HOLCF/ex/Loop.thy |
| 244 | 2 |
ID: $Id$ |
| 1479 | 3 |
Author: Franz Regensburger |
| 12036 | 4 |
License: GPL (GNU GENERAL PUBLIC LICENSE) |
| 244 | 5 |
|
6 |
Theory for a loop primitive like while |
|
7 |
*) |
|
8 |
||
| 2642 | 9 |
Loop = Tr + |
| 244 | 10 |
|
11 |
consts |
|
| 1479 | 12 |
step :: "('a -> tr)->('a -> 'a)->'a->'a"
|
13 |
while :: "('a -> tr)->('a -> 'a)->'a->'a"
|
|
| 244 | 14 |
|
|
1168
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
regensbu
parents:
1150
diff
changeset
|
15 |
defs |
| 244 | 16 |
|
| 10835 | 17 |
step_def "step == (LAM b g x. If b$x then g$x else x fi)" |
18 |
while_def "while == (LAM b g. fix$(LAM f x. |
|
19 |
If b$x then f$(g$x) else x fi))" |
|
| 244 | 20 |
|
21 |
end |
|
22 |