author | immler@in.tum.de |
Sat, 14 Mar 2009 16:50:25 +0100 | |
changeset 30537 | 0dd8dfe424cf |
parent 24893 | b8ef7afe3a6b |
child 35762 | af3ff2ba4c54 |
permissions | -rw-r--r-- |
1478 | 1 |
(* Title: Confluence.thy |
1048 | 2 |
ID: $Id$ |
1478 | 3 |
Author: Ole Rasmussen |
1048 | 4 |
Copyright 1995 University of Cambridge |
5 |
Logic Image: ZF |
|
6 |
*) |
|
7 |
||
16417 | 8 |
theory Confluence imports Reduction begin |
12593 | 9 |
|
24893 | 10 |
definition |
11 |
confluence :: "i=>o" where |
|
12593 | 12 |
"confluence(R) == |
13 |
\<forall>x y. <x,y> \<in> R --> (\<forall>z.<x,z> \<in> R --> (\<exists>u.<y,u> \<in> R & <z,u> \<in> R))" |
|
14 |
||
24893 | 15 |
definition |
16 |
strip :: "o" where |
|
12593 | 17 |
"strip == \<forall>x y. (x ===> y) --> |
18 |
(\<forall>z.(x =1=> z) --> (\<exists>u.(y =1=> u) & (z===>u)))" |
|
19 |
||
20 |
||
21 |
(* ------------------------------------------------------------------------- *) |
|
22 |
(* strip lemmas *) |
|
23 |
(* ------------------------------------------------------------------------- *) |
|
24 |
||
25 |
lemma strip_lemma_r: |
|
26 |
"[|confluence(Spar_red1)|]==> strip" |
|
27 |
apply (unfold confluence_def strip_def) |
|
28 |
apply (rule impI [THEN allI, THEN allI]) |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12593
diff
changeset
|
29 |
apply (erule Spar_red.induct, fast) |
12593 | 30 |
apply (fast intro: Spar_red.trans) |
31 |
done |
|
32 |
||
33 |
||
34 |
lemma strip_lemma_l: |
|
35 |
"strip==> confluence(Spar_red)" |
|
36 |
apply (unfold confluence_def strip_def) |
|
37 |
apply (rule impI [THEN allI, THEN allI]) |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12593
diff
changeset
|
38 |
apply (erule Spar_red.induct, blast) |
12593 | 39 |
apply clarify |
40 |
apply (blast intro: Spar_red.trans) |
|
41 |
done |
|
42 |
||
43 |
(* ------------------------------------------------------------------------- *) |
|
44 |
(* Confluence *) |
|
45 |
(* ------------------------------------------------------------------------- *) |
|
46 |
||
47 |
||
48 |
lemma parallel_moves: "confluence(Spar_red1)" |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12593
diff
changeset
|
49 |
apply (unfold confluence_def, clarify) |
12593 | 50 |
apply (frule simulation) |
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12593
diff
changeset
|
51 |
apply (frule_tac n = z in simulation, clarify) |
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12593
diff
changeset
|
52 |
apply (frule_tac v = va in paving) |
12593 | 53 |
apply (force intro: completeness)+ |
54 |
done |
|
55 |
||
56 |
lemmas confluence_parallel_reduction = |
|
57 |
parallel_moves [THEN strip_lemma_r, THEN strip_lemma_l, standard] |
|
58 |
||
59 |
lemma lemma1: "[|confluence(Spar_red)|]==> confluence(Sred)" |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12593
diff
changeset
|
60 |
by (unfold confluence_def, blast intro: par_red_red red_par_red) |
12593 | 61 |
|
62 |
lemmas confluence_beta_reduction = |
|
63 |
confluence_parallel_reduction [THEN lemma1, standard] |
|
64 |
||
65 |
||
66 |
(**** Conversion ****) |
|
1048 | 67 |
|
68 |
consts |
|
12593 | 69 |
Sconv1 :: "i" |
70 |
Sconv :: "i" |
|
71 |
||
22808 | 72 |
abbreviation |
73 |
Sconv1_rel (infixl "<-1->" 50) where |
|
74 |
"a<-1->b == <a,b> \<in> Sconv1" |
|
75 |
||
76 |
abbreviation |
|
77 |
Sconv_rel (infixl "<--->" 50) where |
|
78 |
"a<--->b == <a,b> \<in> Sconv" |
|
12593 | 79 |
|
80 |
inductive |
|
81 |
domains "Sconv1" <= "lambda*lambda" |
|
82 |
intros |
|
83 |
red1: "m -1-> n ==> m<-1->n" |
|
84 |
expl: "n -1-> m ==> m<-1->n" |
|
85 |
type_intros red1D1 red1D2 lambda.intros bool_typechecks |
|
86 |
||
87 |
declare Sconv1.intros [intro] |
|
1048 | 88 |
|
12593 | 89 |
inductive |
90 |
domains "Sconv" <= "lambda*lambda" |
|
91 |
intros |
|
92 |
one_step: "m<-1->n ==> m<--->n" |
|
93 |
refl: "m \<in> lambda ==> m<--->m" |
|
94 |
trans: "[|m<--->n; n<--->p|] ==> m<--->p" |
|
95 |
type_intros Sconv1.dom_subset [THEN subsetD] lambda.intros bool_typechecks |
|
96 |
||
97 |
declare Sconv.intros [intro] |
|
98 |
||
99 |
lemma conv_sym: "m<--->n ==> n<--->m" |
|
100 |
apply (erule Sconv.induct) |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12593
diff
changeset
|
101 |
apply (erule Sconv1.induct, blast+) |
12593 | 102 |
done |
103 |
||
104 |
(* ------------------------------------------------------------------------- *) |
|
105 |
(* Church_Rosser Theorem *) |
|
106 |
(* ------------------------------------------------------------------------- *) |
|
107 |
||
108 |
lemma Church_Rosser: "m<--->n ==> \<exists>p.(m --->p) & (n ---> p)" |
|
109 |
apply (erule Sconv.induct) |
|
110 |
apply (erule Sconv1.induct) |
|
111 |
apply (blast intro: red1D1 redD2) |
|
112 |
apply (blast intro: red1D1 redD2) |
|
113 |
apply (blast intro: red1D1 redD2) |
|
114 |
apply (cut_tac confluence_beta_reduction) |
|
115 |
apply (unfold confluence_def) |
|
116 |
apply (blast intro: Sred.trans) |
|
117 |
done |
|
118 |
||
1048 | 119 |
end |
120 |