src/HOLCF/ex/Loop.thy
author paulson
Mon, 23 Jan 2006 11:38:43 +0100
changeset 18752 c9c6ae9e8b88
parent 17291 94f6113fe9ed
child 19742 86f21beabafc
permissions -rw-r--r--
Clausification now handles some IFs in rewrite rules (if-split did not work)

(*  Title:      HOLCF/ex/Loop.thy
    ID:         $Id$
    Author:     Franz Regensburger
*)

header {* Theory for a loop primitive like while *}

theory Loop
imports HOLCF
begin

constdefs
  step  :: "('a -> tr)->('a -> 'a)->'a->'a"
  "step == (LAM b g x. If b$x then g$x else x fi)"
  while :: "('a -> tr)->('a -> 'a)->'a->'a"
  "while == (LAM b g. fix$(LAM f x.
    If b$x then f$(g$x) else x fi))"

ML {* use_legacy_bindings (the_context ()) *}

end