Commit 8917e2c3 by Andrew Hirsch

### Move restricted semantics results to own file.

parent abe3058e
This diff is collapsed.
This diff is collapsed.
 ... @@ -8,43 +8,26 @@ Module SoundlyTypedChoreography (E : Expression) (TE : TypedExpression E) (STE : ... @@ -8,43 +8,26 @@ Module SoundlyTypedChoreography (E : Expression) (TE : TypedExpression E) (STE : Import E. Import TE. Import STE. Import E. Import TE. Import STE. Include (TypedChoreography L E TE). Include (TypedChoreography L E TE). Theorem Preservation : forall (Γ : L.t -> nat -> ExprTyp) (Δ : nat -> ChorTyp) (C : Chor) (τ : ChorTyp), Γ;; Δ ⊢c C ::: τ -> forall (R : Redex) (B : list L.t) (C': Chor), RChorStep R B C C' -> Γ;; Δ ⊢c C' ::: τ. Proof. apply RelativePreservation. intros Γ e τ H e' H0. apply ExprPreservation with (e1 := e); auto. Qed. Theorem CompletePreservation: Theorem Preservation: forall (Γ : L.t -> nat -> ExprTyp) (Δ : nat -> ChorTyp) (C : Chor) (τ : ChorTyp), forall (Γ : L.t -> nat -> ExprTyp) (Δ : nat -> ChorTyp) (C : Chor) (τ : ChorTyp), Γ;; Δ ⊢c C ::: τ -> forall (R : Redex) (B : list L.t) (C': Chor), Γ;; Δ ⊢c C ::: τ -> forall (R : Redex) (B : list L.t) (C': Chor), CompleteRChorStep R B C C' -> Γ;; Δ ⊢c C' ::: τ. ChorStep R B C C' -> Γ;; Δ ⊢c C' ::: τ. Proof. Proof. apply CompleteRelativePreservation. intros Γ e τ H e' H0. apply RelativePreservation. intros Γ e τ H e' H0. apply ExprPreservation with (e1 := e); auto. apply ExprPreservation with (e1 := e); auto. Qed. Qed. Theorem Progress : Theorem Progress : forall (C : Chor) (Γ : L.t -> nat -> ExprTyp) (Δ : nat -> ChorTyp) (τ : ChorTyp), forall (C : Chor) (Γ : L.t -> nat -> ExprTyp) (Δ : nat -> ChorTyp) (τ : ChorTyp), ChorClosed C -> Γ;; Δ ⊢c C ::: τ -> ChorClosed C -> Γ;; Δ ⊢c C ::: τ -> ChorVal C \/ exists R C', RChorStep R nil C C'. ChorVal C \/ exists R C', ChorStep R nil C C'. Proof. Proof. apply RelativeProgress; auto. apply RelativeProgress; auto. intros e τ Γ H H0; eapply ExprProgress; eauto. intros e τ Γ H H0; eapply ExprProgress; eauto. intros v Γ H H0; eapply BoolInversion; eauto. intros v Γ H H0; eapply BoolInversion; eauto. Qed. Qed. Theorem CompleteProgress : forall (C : Chor) (Γ : L.t -> nat -> ExprTyp) (Δ : nat -> ChorTyp) (τ : ChorTyp), ChorClosed C -> Γ;; Δ ⊢c C ::: τ -> ChorVal C \/ exists R C', CompleteRChorStep R nil C C'. Proof. apply CompleteRelativeProgress; auto. intros e τ Γ H H0; eapply ExprProgress; eauto. intros v Γ H H0; eapply BoolInversion; eauto. Qed. End SoundlyTypedChoreography. End SoundlyTypedChoreography.
 ... @@ -347,14 +347,14 @@ Module TypedChoreography (L : Locations) (E : Expression) (TE : TypedExpression ... @@ -347,14 +347,14 @@ Module TypedChoreography (L : Locations) (E : Expression) (TE : TypedExpression rewrite (ExprTypingUnique (Γ l2) e' τ0 τ1 H11 H10); auto. rewrite (ExprTypingUnique (Γ l2) e' τ0 τ1 H11 H10); auto. Qed. Qed. Theorem CompleteRelativePreservation : Theorem RelativePreservation : (forall (Γ : nat -> ExprTyp) (e : Expr) (τ : ExprTyp), (forall (Γ : nat -> ExprTyp) (e : Expr) (τ : ExprTyp), Γ ⊢e e ::: τ Γ ⊢e e ::: τ -> forall e' : Expr, ExprStep e e' -> forall e' : Expr, ExprStep e e' -> Γ ⊢e e' ::: τ) -> -> Γ ⊢e e' ::: τ) -> forall (Γ : Loc -> nat -> ExprTyp) (Δ : nat -> ChorTyp) (C : Chor) (τ : ChorTyp), forall (Γ : Loc -> nat -> ExprTyp) (Δ : nat -> ChorTyp) (C : Chor) (τ : ChorTyp), Γ;; Δ ⊢c C ::: τ -> forall (R : Redex) (B : list Loc) (C': Chor), Γ;; Δ ⊢c C ::: τ -> forall (R : Redex) (B : list Loc) (C': Chor), CompleteRChorStep R B C C' -> Γ;; Δ ⊢c C' ::: τ. ChorStep R B C C' -> Γ;; Δ ⊢c C' ::: τ. Proof using. Proof using. intros expr_pres Γ Δ C τ typing R B C' step; revert Γ Δ τ typing; induction step; intros expr_pres Γ Δ C τ typing R B C' step; revert Γ Δ τ typing; induction step; intros Γ Δ τ typing; inversion typing; subst; intros Γ Δ τ typing; inversion typing; subst; ... @@ -382,18 +382,6 @@ Module TypedChoreography (L : Locations) (E : Expression) (TE : TypedExpression ... @@ -382,18 +382,6 @@ Module TypedChoreography (L : Locations) (E : Expression) (TE : TypedExpression apply AppGlobalSubstTyping; auto. apply AppGlobalSubstTyping; auto. Qed. Qed. Corollary RelativePreservation : (forall (Γ : nat -> ExprTyp) (e : Expr) (τ : ExprTyp), Γ ⊢e e ::: τ -> forall e' : Expr, ExprStep e e' -> Γ ⊢e e' ::: τ) -> forall (Γ : Loc -> nat -> ExprTyp) (Δ : nat -> ChorTyp) (C : Chor) (τ : ChorTyp), Γ;; Δ ⊢c C ::: τ -> forall (R : Redex) (B : list Loc) (C': Chor), RChorStep R B C C' -> Γ;; Δ ⊢c C' ::: τ. Proof. intros H Γ Δ C τ H0 R B C' H1; apply LiftRChorStepToComplete in H1. eapply CompleteRelativePreservation in H1; eauto. Qed. Lemma ChorClosedBelowTyping : forall (Γ1 Γ2 : Loc -> nat -> ExprTyp) Lemma ChorClosedBelowTyping : forall (Γ1 Γ2 : Loc -> nat -> ExprTyp) (Δ1 Δ2 : nat -> ChorTyp) (Δ1 Δ2 : nat -> ChorTyp) ... @@ -458,7 +446,8 @@ Module TypedChoreography (L : Locations) (E : Expression) (TE : TypedExpression ... @@ -458,7 +446,8 @@ Module TypedChoreography (L : Locations) (E : Expression) (TE : TypedExpression eapply ChorClosedTyping; eauto. apply ChorValuesClosed; auto. eapply ChorClosedTyping; eauto. apply ChorValuesClosed; auto. Qed. Qed. Theorem RelativeProgress : Corollary RelativeProgress : (forall (e : Expr) (τ : ExprTyp) (Γ : nat -> ExprTyp), (forall (e : Expr) (τ : ExprTyp) (Γ : nat -> ExprTyp), Γ ⊢e e ::: τ -> ExprClosed e -> Γ ⊢e e ::: τ -> ExprClosed e -> ExprVal e \/ exists e' : Expr, ExprStep e e') -> ExprVal e \/ exists e' : Expr, ExprStep e e') -> ... @@ -466,8 +455,8 @@ Module TypedChoreography (L : Locations) (E : Expression) (TE : TypedExpression ... @@ -466,8 +455,8 @@ Module TypedChoreography (L : Locations) (E : Expression) (TE : TypedExpression Γ ⊢e v ::: bool -> ExprVal v -> {v = tt} + {v = ff}) -> Γ ⊢e v ::: bool -> ExprVal v -> {v = tt} + {v = ff}) -> forall (C : Chor) (Γ : Loc -> nat -> ExprTyp) (Δ : nat -> ChorTyp) (τ : ChorTyp), forall (C : Chor) (Γ : Loc -> nat -> ExprTyp) (Δ : nat -> ChorTyp) (τ : ChorTyp), ChorClosed C -> Γ;; Δ ⊢c C ::: τ -> ChorClosed C -> Γ;; Δ ⊢c C ::: τ -> ChorVal C \/ exists R C', RChorStep R nil C C'. ChorVal C \/ exists R C', ChorStep R nil C C'. Proof. Proof using. intros ExprProgress BoolInversion C Γ Δ τ cc typ; revert cc; induction typ; intro cc; intros ExprProgress BoolInversion C Γ Δ τ cc typ; revert cc; induction typ; intro cc; inversion cc; subst. inversion cc; subst. 2: inversion H2. 2: inversion H2. ... @@ -498,21 +487,6 @@ Module TypedChoreography (L : Locations) (E : Expression) (TE : TypedExpression ... @@ -498,21 +487,6 @@ Module TypedChoreography (L : Locations) (E : Expression) (TE : TypedExpression all: inversion IHtyp1; subst; inversion typ1; subst. all: inversion IHtyp1; subst; inversion typ1; subst. all: eexists; eexists; eauto with Chor. all: eexists; eexists; eauto with Chor. Qed. Qed. Corollary CompleteRelativeProgress : (forall (e : Expr) (τ : ExprTyp) (Γ : nat -> ExprTyp), Γ ⊢e e ::: τ -> ExprClosed e -> ExprVal e \/ exists e' : Expr, ExprStep e e') -> (forall (v : Expr) (Γ : nat -> ExprTyp), Γ ⊢e v ::: bool -> ExprVal v -> {v = tt} + {v = ff}) -> forall (C : Chor) (Γ : Loc -> nat -> ExprTyp) (Δ : nat -> ChorTyp) (τ : ChorTyp), ChorClosed C -> Γ;; Δ ⊢c C ::: τ -> ChorVal C \/ exists R C', CompleteRChorStep R nil C C'. Proof using. intros H H0 C Γ Δ τ H1 H2. eapply RelativeProgress in H2; eauto. destruct H2 as [H2 | [R [C' step]]]; [left|right; apply LiftRChorStepToComplete in step; eexists; eexists; eauto]; auto. Qed. End TypedChoreography. End TypedChoreography.
 ... @@ -11,3 +11,4 @@ FunLMap.v ... @@ -11,3 +11,4 @@ FunLMap.v Choreography.v Choreography.v TypedChoreography.v TypedChoreography.v SoundlyTypedChoreography.v SoundlyTypedChoreography.v RestrictedSemantics.v \ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!