src/HOL/Induct/Tree.thy
author wenzelm
Thu, 16 Mar 2000 00:35:27 +0100
changeset 8490 6e0f23304061
parent 7018 ae18bb3075c3
child 11046 b5f5942781a0
permissions -rw-r--r--
added HOL/PreLIst.thy;

(*  Title:      HOL/Induct/Tree.thy
    ID:         $Id$
    Author:     Stefan Berghofer,  TU Muenchen
    Copyright   1999  TU Muenchen

Infinitely branching trees
*)

Tree = Main +

datatype 'a tree = Atom 'a | Branch "nat => 'a tree"

consts
  map_tree :: "('a => 'b) => 'a tree => 'b tree"

primrec
  "map_tree f (Atom a) = Atom (f a)"
  "map_tree f (Branch ts) = Branch (%x. map_tree f (ts x))"

consts
  exists_tree :: "('a => bool) => 'a tree => bool"

primrec
  "exists_tree P (Atom a) = P a"
  "exists_tree P (Branch ts) = (? x. exists_tree P (ts x))"

end