Commit 8917e2c3 authored by Andrew Hirsch's avatar Andrew Hirsch
Browse files

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 :
Import E. Import TE. Import STE.
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),
Γ;; Δ 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.
apply CompleteRelativePreservation. intros Γ e τ H e' H0.
apply RelativePreservation. intros Γ e τ H e' H0.
apply ExprPreservation with (e1 := e); auto.
Qed.
Theorem Progress :
forall (C : Chor) (Γ : L.t -> nat -> ExprTyp) (Δ : nat -> ChorTyp) (τ : ChorTyp),
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.
apply RelativeProgress; auto.
intros e τ Γ H H0; eapply ExprProgress; eauto.
intros v Γ H H0; eapply BoolInversion; eauto.
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.
......@@ -347,14 +347,14 @@ Module TypedChoreography (L : Locations) (E : Expression) (TE : TypedExpression
rewrite (ExprTypingUnique (Γ l2) e' τ0 τ1 H11 H10); auto.
Qed.
Theorem CompleteRelativePreservation :
Theorem 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),
CompleteRChorStep R B C C' -> Γ;; Δ c C' ::: τ.
ChorStep R B C C' -> Γ;; Δ c C' ::: τ.
Proof using.
intros expr_pres Γ Δ C τ typing R B C' step; revert Γ Δ τ typing; induction step;
intros Γ Δ τ typing; inversion typing; subst;
......@@ -382,18 +382,6 @@ Module TypedChoreography (L : Locations) (E : Expression) (TE : TypedExpression
apply AppGlobalSubstTyping; auto.
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)
(Δ1 Δ2 : nat -> ChorTyp)
......@@ -458,7 +446,8 @@ Module TypedChoreography (L : Locations) (E : Expression) (TE : TypedExpression
eapply ChorClosedTyping; eauto. apply ChorValuesClosed; auto.
Qed.
Theorem RelativeProgress :
Corollary RelativeProgress :
(forall (e : Expr) (τ : ExprTyp) (Γ : nat -> ExprTyp),
Γ e e ::: τ -> ExprClosed e ->
ExprVal e \/ exists e' : Expr, ExprStep e e') ->
......@@ -466,8 +455,8 @@ Module TypedChoreography (L : Locations) (E : Expression) (TE : TypedExpression
Γ 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', RChorStep R nil C C'.
Proof.
ChorVal C \/ exists R C', ChorStep R nil C C'.
Proof using.
intros ExprProgress BoolInversion C Γ Δ τ cc typ; revert cc; induction typ; intro cc;
inversion cc; subst.
2: inversion H2.
......@@ -499,20 +488,5 @@ Module TypedChoreography (L : Locations) (E : Expression) (TE : TypedExpression
all: eexists; eexists; eauto with Chor.
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.
......@@ -11,3 +11,4 @@ FunLMap.v
Choreography.v
TypedChoreography.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!
Please register or to comment