]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_cprs.ma
3fa433c0f4de4dcd5a5017a21ba5a3ee7b5a6438
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / rt_computation / cprs_cprs.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "basic_2/rt_computation/cpms_cpms.ma".
16 include "basic_2/rt_computation/cprs_cpr.ma".
17
18 (* CONTEXT-SENSITIVE PARALLEL R-COMPUTATION FOR TERMS ***********************)
19
20 (* Main properties **********************************************************)
21
22 (* Basic_1: was: pr3_t *)
23 (* Basic_1: includes: pr1_t *)
24 theorem cprs_trans (h) (G) (L): Transitive … (cpms h G L 0).
25 /2 width=3 by cpms_trans/ qed-.
26
27 (* Basic_1: was: pr3_confluence *)
28 (* Basic_1: includes: pr1_confluence *)
29 theorem cprs_conf (h) (G) (L): confluent2 … (cpms h G L 0) (cpms h G L 0).
30 #h #G #L #T0 #T1 #HT01 #T2 #HT02
31 elim (TC_confluent2 … T0 T1 … T2)
32 [ /3 width=3 by cprs_CTC, ex2_intro/ |5,6: skip
33 | /2 width=1 by cprs_inv_CTC/
34 | /2 width=1 by cprs_inv_CTC/
35 | /2 width=3 by cpr_conf/
36 ]
37 qed-.
38
39 (* Basic_1: was: pr3_flat *)
40 theorem cprs_flat (h) (G) (L):
41                   ∀T1,T2. ⦃G,L⦄ ⊢ T1 ➡*[h] T2 →
42                   ∀V1,V2. ⦃G,L⦄ ⊢ V1 ➡*[h] V2 →
43                   ∀I. ⦃G,L⦄ ⊢ ⓕ{I}V1.T1 ➡*[h] ⓕ{I}V2.T2.
44 #h #G #L #T1 #T2 #HT12 #V1 #V2 #H @(cprs_ind_dx … H) -V2
45 [ /2 width=3 by cprs_flat_dx/
46 | /3 width=3 by cpr_pair_sn, cprs_step_dx/
47 ]
48 qed.
49
50 (* Advanced inversion lemmas ************************************************)
51
52 (* Basic_1: was pr3_gen_appl *)
53 (* Basic_2A1: was: cprs_inv_appl1 *)
54 lemma cprs_inv_appl_sn (h) (G) (L):
55                        ∀V1,T1,X2. ⦃G,L⦄ ⊢ ⓐV1.T1 ➡*[h] X2 →
56                        ∨∨ ∃∃V2,T2.       ⦃G,L⦄ ⊢ V1 ➡*[h] V2 &
57                                          ⦃G,L⦄ ⊢ T1 ➡*[h] T2 &
58                                          X2 = ⓐV2. T2
59                         | ∃∃p,W,T.       ⦃G,L⦄ ⊢ T1 ➡*[h] ⓛ{p}W.T &
60                                          ⦃G,L⦄ ⊢ ⓓ{p}ⓝW.V1.T ➡*[h] X2
61                         | ∃∃p,V0,V2,V,T. ⦃G,L⦄ ⊢ V1 ➡*[h] V0 & ⇧*[1] V0 ≘ V2 &
62                                          ⦃G,L⦄ ⊢ T1 ➡*[h] ⓓ{p}V.T &
63                                          ⦃G,L⦄ ⊢ ⓓ{p}V.ⓐV2.T ➡*[h] X2.
64 #h #G #L #V1 #T1 #X2 #H elim (cpms_inv_appl_sn … H) -H *
65 [ /3 width=5 by or3_intro0, ex3_2_intro/
66 | #n1 #n2 #p #V2 #T2 #HT12 #HTX2 #H
67   elim (plus_inv_O3 … H) -H #H1 #H2 destruct
68   /3 width=5 by or3_intro1, ex2_3_intro/
69 | #n1 #n2 #p #V2 #W2 #V #T2 #HV12 #HVW2 #HT12 #HTX2 #H
70   elim (plus_inv_O3 … H) -H #H1 #H2 destruct
71   /3 width=9 by or3_intro2, ex4_5_intro/
72 ]
73 qed-.