src/HOLCF/ex/Loop.thy
author berghofe
Wed, 11 Feb 2004 17:36:08 +0100
changeset 14382 9fb68cd74719
parent 12036 49f6c49454c2
child 14981 e73f8140af78
permissions -rw-r--r--
Added flag short_names

(*  Title:      HOLCF/ex/Loop.thy
    ID:         $Id$
    Author:     Franz Regensburger
    License:    GPL (GNU GENERAL PUBLIC LICENSE)

Theory for a loop primitive like while
*)

Loop = Tr +

consts
        step  :: "('a -> tr)->('a -> 'a)->'a->'a"
        while :: "('a -> tr)->('a -> 'a)->'a->'a"

defs

  step_def      "step == (LAM b g x. If b$x then g$x else x fi)"
  while_def     "while == (LAM b g. fix$(LAM f x.
                   If b$x then f$(g$x) else x fi))"

end