1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "terms/parallel_computation.ma".
17 (* SEQUENTIAL COMPUTATION (MULTISTEP) ***************************************)
19 definition sreds: relation term ≝ star … sred.
21 interpretation "sequential computation"
22 'SeqRedStar M N = (sreds M N).
24 lemma sreds_refl: reflexive … sreds.
28 lemma sreds_step_sn: ∀M1,M. M1 ↦ M → ∀M2. M ↦* M2 → M1 ↦* M2.
32 lemma sreds_step_dx: ∀M1,M. M1 ↦* M → ∀M2. M ↦ M2 → M1 ↦* M2.
36 lemma sreds_step_rc: ∀M1,M2. M1 ↦ M2 → M1 ↦* M2.
40 lemma lsred_compatible_abst: compatible_abst sreds.
44 lemma sreds_compatible_sn: compatible_sn sreds.
48 lemma sreds_compatible_dx: compatible_dx sreds.
52 lemma sreds_compatible_appl: compatible_appl sreds.
56 lemma sreds_lift: liftable sreds.
60 lemma sreds_inv_lift: deliftable_sn sreds.
61 /3 width=3 by star_deliftable_sn, sred_inv_lift/
64 lemma sreds_dsubst: dsubstable_dx sreds.
68 theorem sreds_trans: transitive … sreds.
69 /2 width=3 by trans_star/
72 (* Note: the substitution should be unparentesized *)
73 lemma sreds_compatible_beta: ∀B1,B2. B1 ↦* B2 → ∀A1,A2. A1 ↦* A2 →
74 @B1.𝛌.A1 ↦* ([↙B2] A2).
75 #B1 #B2 #HB12 #A1 #A2 #HA12
76 @(sreds_trans … (@B2.𝛌.A1)) /2 width=1/ -B1
77 @(sreds_step_dx … (@B2.𝛌.A2)) // /3 width=1/
80 theorem sreds_preds: ∀M1,M2. M1 ↦* M2 → M1 ⤇* M2.
81 #M1 #M2 #H @(star_ind_l ??????? H) -M1 //
83 @(preds_step_sn … IHM2) -M2 /2 width=2/
86 lemma pred_sreds: ∀M1,M2. M1 ⤇ M2 → M1 ↦* M2.
87 #M1 #M2 #H elim H -M1 -M2 // /2 width=1/
90 theorem preds_sreds: ∀M1,M2. M1 ⤇* M2 → M1 ↦* M2.
91 #M1 #M2 #H elim H -M2 //
93 lapply (pred_sreds … HM2) -HM2 #HM2
94 @(sreds_trans … HM1 … HM2)
97 theorem sreds_conf: ∀M0,M1. M0 ↦* M1 → ∀M2. M0 ↦* M2 →
98 ∃∃M. M1 ↦* M & M2 ↦* M.
99 #M0 #M1 #HM01 #M2 #HM02
100 lapply (sreds_preds … HM01) #HM01
101 lapply (sreds_preds … HM02) #HM02
102 elim (preds_conf … HM01 … HM02) -M0 #M #HM1 #HM2
103 lapply (preds_sreds … HM1) -HM1
104 lapply (preds_sreds … HM2) -HM2 /2 width=3/