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
16ce9dad
Commit
16ce9dad
authored
May 10, 2021
by
Andrew Hirsch
Browse files
Added concurrent lambda and proved (one direction of) simulation.
parent
8917e2c3
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Choreography.v
View file @
16ce9dad
...
...
@@ -1088,8 +1088,8 @@ Module Choreography (Import E : Expression) (L : Locations).
Definition
AppGlobalSubst
(
C1
C2
:
Chor
)
:
nat
->
Chor
:=
fun
n
=>
match
n
with
|
0
=>
RecGlobal
C1
|
1
=>
C2
|
0
=>
C2
|
1
=>
RecGlobal
C1
|
S
(
S
m
)
=>
Var
m
end
.
...
...
@@ -1396,7 +1396,7 @@ Module Choreography (Import E : Expression) (L : Locations).
|
CAppLocalArgStep
:
forall
(
l
:
Loc
)
(
C
:
Chor
)
(
e1
e2
:
Expr
)
B
,
~
In
l
B
->
ExprStep
e1
e2
->
ChorStep
(
RAppLocalE
l
e1
e2
)
B
(
AppLocal
l
C
e1
)
(
AppLocal
l
C
e2
)
ChorStep
(
RAppLocalE
l
e1
e2
)
B
(
AppLocal
l
(
RecLocal
l
C
)
e1
)
(
AppLocal
l
(
RecLocal
l
C
)
e2
)
|
CAppLocalStep
:
forall
(
l
:
Loc
)
(
C
:
Chor
)
(
v
:
Expr
),
ExprVal
v
->
ChorStep
(
RAppLocal
l
v
)
[]
(
AppLocal
l
(
RecLocal
l
C
)
v
)
...
...
@@ -1406,7 +1406,7 @@ Module Choreography (Import E : Expression) (L : Locations).
ChorStep
R
B
(
AppGlobal
C1
C2
)
(
AppGlobal
C1
'
C2
)
|
CAppGlobalArgStep
:
forall
(
C1
C2
C2
'
:
Chor
)
R
B
,
ChorStep
R
B
C2
C2
'
->
ChorStep
R
B
(
AppGlobal
C1
C2
)
(
AppGlobal
C1
C2
'
)
ChorStep
R
B
(
AppGlobal
(
RecGlobal
C1
)
C2
)
(
AppGlobal
(
RecGlobal
C1
)
C2
'
)
|
CAppGlobalStep
:
forall
(
C1
C2
:
Chor
),
ChorVal
C2
->
ChorStep
RAppGlobal
[]
(
AppGlobal
(
RecGlobal
C1
)
C2
)
...
...
ConcurrentLambda.v
0 → 100644
View file @
16ce9dad
This diff is collapsed.
Click to expand it.
Expression.v
View file @
16ce9dad
...
...
@@ -73,6 +73,8 @@ Module Type Expression.
Parameter
tt
ff
:
Expr
.
Parameter
ttValue
:
ExprVal
tt
.
Parameter
ffValue
:
ExprVal
ff
.
Parameter
boolSeperation
:
tt
<>
ff
.
Parameter
ExprStep
:
Expr
->
Expr
->
Prop
.
Parameter
NoExprStepFromVal
:
forall
v
,
ExprVal
v
->
forall
e
,
~
ExprStep
v
e
.
End
Expression
.
LambdaCalc.v
View file @
16ce9dad
...
...
@@ -290,4 +290,14 @@ Module LambdaCalc <: Expression.
end
;
eauto
.
apply
Lt
.
lt_le_S
in
l
.
apply
Lt
.
le_lt_or_eq
in
l
;
destruct
l
;
subst
;
eauto
.
Qed
.
Theorem
NoExprStepFromVal
:
forall
v
,
ExprVal
v
->
forall
e
,
~
ExprStep
v
e
.
Proof
using
.
intros
v
;
induction
v
;
intros
val_v
e
step
;
inversion
val_v
;
subst
;
inversion
step
;
subst
.
apply
(
IHv
H0
e2
H1
).
Qed
.
Theorem
boolSeperation
:
tt
<>
ff
.
discriminate
.
Qed
.
End
LambdaCalc
.
TypedChoreography.v
View file @
16ce9dad
...
...
@@ -74,8 +74,8 @@ Module TypedChoreography (L : Locations) (E : Expression) (TE : TypedExpression
|
TRecGlobal
:
forall
(
Γ
:
Loc
->
nat
->
ExprTyp
)
(
Δ
:
nat
->
ChorTyp
)
(
C
:
Chor
)
(
τ
σ
:
ChorTyp
),
Γ
;;
(
fun
n
=>
match
n
with
|
0
=>
ChorFun
τ
σ
|
1
=>
τ
|
0
=>
τ
|
1
=>
ChorFun
τ
σ
|
S
(
S
n
)
=>
Δ
n
end
)
⊢
c
C
:::
σ
->
Γ
;;
Δ
⊢
c
RecGlobal
C
:::
ChorFun
τ
σ
...
...
@@ -251,7 +251,7 @@ Module TypedChoreography (L : Locations) (E : Expression) (TE : TypedExpression
destruct
n
;
[
apply
TVar
|
].
destruct
n
;
[
apply
TVar
|
].
apply
TypeChorWeakening
with
(
Δ
1
:=
fun
m
=>
match
m
with
|
0
=>
τ
|
0
=>
ChorFun
τ
ρ
|
S
m
=>
Δ
2
m
end
);
auto
.
apply
TypeChorWeakening
with
(
Δ
1
:=
Δ
2
);
auto
.
...
...
@@ -295,20 +295,20 @@ Module TypedChoreography (L : Locations) (E : Expression) (TE : TypedExpression
Lemma
AppGlobalSubstTyping
:
forall
(
Γ
:
Loc
->
nat
->
ExprTyp
)
(
Δ
:
nat
->
ChorTyp
)
(
τ
σ
:
ChorTyp
)
(
C1
C2
:
Chor
),
Γ
;;
(
fun
n
=>
match
n
with
|
0
=>
ChorFun
τ
σ
|
1
=>
τ
|
0
=>
τ
|
1
=>
ChorFun
τ
σ
|
S
(
S
n
)
=>
Δ
n
end
)
⊢
c
C1
:::
σ
->
Γ
;;
Δ
⊢
c
C2
:::
τ
->
ChorSubstTyping
Γ
(
fun
n
=>
match
n
with
|
0
=>
ChorFun
τ
σ
|
1
=>
τ
|
0
=>
τ
|
1
=>
ChorFun
τ
σ
|
S
(
S
n
)
=>
Δ
n
end
)
(
AppGlobalSubst
C1
C2
)
Δ
.
Proof
using
.
intros
Γ
Δ
τ
σ
C1
C2
typing1
typing2
;
unfold
ChorSubstTyping
;
unfold
AppGlobalSubst
;
intro
n
;
destruct
n
;
[
|
destruct
n
];
auto
;
[
|
apply
TVar
].
apply
TRecGlobal
;
auto
.
intro
n
;
destruct
n
;
[
|
destruct
n
];
auto
;
[
|
apply
TVar
].
apply
TRecGlobal
;
auto
.
Qed
.
Theorem
ChorEquivTyping
:
forall
(
C1
C2
:
Chor
),
...
...
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