
nipkow@10213: (*  Title:      HOL/Relation_Power.thy
nipkow@10213:     ID:         $Id$
nipkow@10213:     Author:     Tobias Nipkow
nipkow@10213:     Copyright   1996  TU Muenchen
nipkow@10213: 
nipkow@10213: R^n = R O ... O R, the n-fold composition of R
nipkow@11305: Both for functions and relations.
nipkow@10213: *)
nipkow@10213: 
nipkow@10213: Relation_Power = Nat +
nipkow@10213: 
nipkow@10213: instance
nipkow@10213:   set :: (term) {power}   (* only ('a * 'a) set should be in power! *)
nipkow@10213: 
nipkow@10213: primrec (relpow)
nipkow@10213:   "R^0 = Id"
nipkow@10213:   "R^(Suc n) = R O (R^n)"
nipkow@10213: 
nipkow@11305: 
nipkow@11305: instance fun :: (term,term)power   (* only 'a \<Rightarrow> 'a should be in power! *)
nipkow@11305: 
nipkow@11305: primrec (funpow)
nipkow@11305:   "f^0 = id"
nipkow@11305:   "f^(Suc n) = f o (f^n)"
nipkow@11305: 
nipkow@10213: end




