src/HOL/Induct/Tree.thy
author berghofe
Fri Jul 16 14:03:03 1999 +0200 (1999-07-16)
changeset 7018 ae18bb3075c3
child 11046 b5f5942781a0
permissions -rw-r--r--
Infinitely branching trees.
     1 (*  Title:      HOL/Induct/Tree.thy
     2     ID:         $Id$
     3     Author:     Stefan Berghofer,  TU Muenchen
     4     Copyright   1999  TU Muenchen
     5 
     6 Infinitely branching trees
     7 *)
     8 
     9 Tree = Main +
    10 
    11 datatype 'a tree = Atom 'a | Branch "nat => 'a tree"
    12 
    13 consts
    14   map_tree :: "('a => 'b) => 'a tree => 'b tree"
    15 
    16 primrec
    17   "map_tree f (Atom a) = Atom (f a)"
    18   "map_tree f (Branch ts) = Branch (%x. map_tree f (ts x))"
    19 
    20 consts
    21   exists_tree :: "('a => bool) => 'a tree => bool"
    22 
    23 primrec
    24   "exists_tree P (Atom a) = P a"
    25   "exists_tree P (Branch ts) = (? x. exists_tree P (ts x))"
    26 
    27 end