Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Andrew Hirsch
Pirouette Coq Code
Commits
8917e2c3
Commit
8917e2c3
authored
Mar 12, 2021
by
Andrew Hirsch
Browse files
Move restricted semantics results to own file.
parent
abe3058e
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Choreography.v
View file @
8917e2c3
This diff is collapsed.
Click to expand it.
RestrictedSemantics.v
0 → 100644
View file @
8917e2c3
This diff is collapsed.
Click to expand it.
SoundlyTypedChoreography.v
View file @
8917e2c3
...
...
@@ -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
Complete
Preservation
:
Theorem
Preservation
:
forall
(
Γ
:
L
.
t
->
nat
->
ExprTyp
)
(
Δ
:
nat
->
ChorTyp
)
(
C
:
Chor
)
(
τ
:
ChorTyp
),
Γ
;;
Δ
⊢
c
C
:::
τ
->
forall
(
R
:
Redex
)
(
B
:
list
L
.
t
)
(
C
'
:
Chor
),
CompleteR
ChorStep
R
B
C
C
'
->
Γ
;;
Δ
⊢
c
C
'
:::
τ
.
ChorStep
R
B
C
C
'
->
Γ
;;
Δ
⊢
c
C
'
:::
τ
.
Proof
.
apply
Complete
RelativePreservation
.
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
'
,
R
ChorStep
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
.
TypedChoreography.v
View file @
8917e2c3
...
...
@@ -347,14 +347,14 @@ Module TypedChoreography (L : Locations) (E : Expression) (TE : TypedExpression
rewrite
(
ExprTypingUnique
(
Γ
l2
)
e
'
τ
0
τ
1
H11
H10
);
auto
.
Qed
.
Theorem
Complete
RelativePreservation
:
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
),
CompleteR
ChorStep
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
'
,
R
ChorStep
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
.
...
...
@@ -498,21 +487,6 @@ Module TypedChoreography (L : Locations) (E : Expression) (TE : TypedExpression
all:
inversion
IHtyp1
;
subst
;
inversion
typ1
;
subst
.
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
.
_CoqProject
View file @
8917e2c3
...
...
@@ -11,3 +11,4 @@ FunLMap.v
Choreography.v
TypedChoreography.v
SoundlyTypedChoreography.v
RestrictedSemantics.v
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment