src/HOLCF/ex/Loop.thy
author wenzelm
Sat Nov 03 18:41:28 2001 +0100 (2001-11-03)
changeset 12036 49f6c49454c2
parent 10835 f4745d77e620
child 14981 e73f8140af78
permissions -rw-r--r--
GPLed;
clasohm@1479
     1
(*  Title:      HOLCF/ex/Loop.thy
nipkow@244
     2
    ID:         $Id$
clasohm@1479
     3
    Author:     Franz Regensburger
wenzelm@12036
     4
    License:    GPL (GNU GENERAL PUBLIC LICENSE)
nipkow@244
     5
nipkow@244
     6
Theory for a loop primitive like while
nipkow@244
     7
*)
nipkow@244
     8
slotosch@2642
     9
Loop = Tr +
nipkow@244
    10
nipkow@244
    11
consts
clasohm@1479
    12
        step  :: "('a -> tr)->('a -> 'a)->'a->'a"
clasohm@1479
    13
        while :: "('a -> tr)->('a -> 'a)->'a->'a"
nipkow@244
    14
regensbu@1168
    15
defs
nipkow@244
    16
nipkow@10835
    17
  step_def      "step == (LAM b g x. If b$x then g$x else x fi)"
nipkow@10835
    18
  while_def     "while == (LAM b g. fix$(LAM f x.
nipkow@10835
    19
                   If b$x then f$(g$x) else x fi))"
nipkow@244
    20
nipkow@244
    21
end
nipkow@244
    22