17456

1 
(* Title: CCL/Wfd.thy

0

2 
ID: $Id$

1474

3 
Author: Martin Coen, Cambridge University Computer Laboratory

0

4 
Copyright 1993 University of Cambridge


5 
*)


6 

17456

7 
header {* Wellfounded relations in CCL *}


8 


9 
theory Wfd


10 
imports Trancl Type Hered


11 
uses ("wfd.ML") ("genrec.ML") ("typecheck.ML") ("eval.ML")


12 
begin

0

13 


14 
consts


15 
(*** Predicates ***)


16 
Wfd :: "[i set] => o"


17 
(*** Relations ***)


18 
wf :: "[i set] => i set"


19 
wmap :: "[i=>i,i set] => i set"


20 
"**" :: "[i set,i set] => i set" (infixl 70)


21 
NatPR :: "i set"


22 
ListPR :: "i set => i set"


23 

17456

24 
axioms

0

25 

17456

26 
Wfd_def:

3837

27 
"Wfd(R) == ALL P.(ALL x.(ALL y.<y,x> : R > y:P) > x:P) > (ALL a. a:P)"

0

28 

17456

29 
wf_def: "wf(R) == {x. x:R & Wfd(R)}"

0

30 

17456

31 
wmap_def: "wmap(f,R) == {p. EX x y. p=<x,y> & <f(x),f(y)> : R}"


32 
lex_def:

3837

33 
"ra**rb == {p. EX a a' b b'. p = <<a,b>,<a',b'>> & (<a,a'> : ra  (a=a' & <b,b'> : rb))}"

0

34 

17456

35 
NatPR_def: "NatPR == {p. EX x:Nat. p=<x,succ(x)>}"


36 
ListPR_def: "ListPR(A) == {p. EX h:A. EX t:List(A). p=<t,h$t>}"


37 


38 
ML {* use_legacy_bindings (the_context ()) *}


39 


40 
use "wfd.ML"


41 
use "genrec.ML"


42 
use "typecheck.ML"


43 
use "eval.ML"


44 

0

45 
end
