author | oheimb |
Wed, 12 Aug 1998 17:40:18 +0200 | |
changeset 5307 | 6a699d5cdef4 |
parent 3947 | eb707467f8c5 |
child 8882 | 9df44a4f1bf7 |
permissions | -rw-r--r-- |
1475 | 1 |
(* Title: HOL/wf.ML |
923 | 2 |
ID: $Id$ |
1475 | 3 |
Author: Tobias Nipkow |
923 | 4 |
Copyright 1992 University of Cambridge |
5 |
||
6 |
Well-founded Recursion |
|
7 |
*) |
|
8 |
||
9 |
WF = Trancl + |
|
1558 | 10 |
|
3947 | 11 |
global |
12 |
||
1558 | 13 |
constdefs |
14 |
wf :: "('a * 'a)set => bool" |
|
3842 | 15 |
"wf(r) == (!P. (!x. (!y. (y,x):r --> P(y)) --> P(x)) --> (!x. P(x)))" |
1558 | 16 |
|
3413
c1f63cc3a768
Finite.ML Finite.thy: Replaced `finite subset of' by mere `finite'.
nipkow
parents:
3320
diff
changeset
|
17 |
acyclic :: "('a*'a)set => bool" |
c1f63cc3a768
Finite.ML Finite.thy: Replaced `finite subset of' by mere `finite'.
nipkow
parents:
3320
diff
changeset
|
18 |
"acyclic r == !x. (x,x) ~: r^+" |
c1f63cc3a768
Finite.ML Finite.thy: Replaced `finite subset of' by mere `finite'.
nipkow
parents:
3320
diff
changeset
|
19 |
|
1558 | 20 |
cut :: "('a => 'b) => ('a * 'a)set => 'a => 'a => 'b" |
3320 | 21 |
"cut f r x == (%y. if (y,x):r then f y else arbitrary)" |
923 | 22 |
|
1558 | 23 |
is_recfun :: "('a * 'a)set => (('a=>'b) => ('a=>'b)) =>'a=>('a=>'b) => bool" |
24 |
"is_recfun r H a f == (f = cut (%x. H (cut f r x) x) r a)" |
|
923 | 25 |
|
1558 | 26 |
the_recfun :: "('a * 'a)set => (('a=>'b) => ('a=>'b)) => 'a => 'a => 'b" |
27 |
"the_recfun r H a == (@f. is_recfun r H a f)" |
|
923 | 28 |
|
1558 | 29 |
wfrec :: "('a * 'a)set => (('a=>'b) => ('a=>'b)) => 'a => 'b" |
30 |
"wfrec r H == (%x. H (cut (the_recfun (trancl r) (%f v. H (cut f r v) v) x) |
|
31 |
r x) x)" |
|
923 | 32 |
|
3947 | 33 |
local |
34 |
||
923 | 35 |
end |