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
Fengmin Zhu
Tutorial POPL20
Commits
7f235325
Commit
7f235325
authored
Jan 16, 2020
by
Amin Timany
Browse files
Merge branch 'master' of gitlab.mpi-sws.org:iris/tutorial-popl20
parents
6ac306ae
3df550b1
Changes
3
Hide whitespace changes
Inline
Side-by-side
_CoqProject
View file @
7f235325
...
...
@@ -21,3 +21,4 @@ theories/two_state_ghost.v
theories/symbol_ghost.v
theories/unsafe.v
theories/parametricity.v
theories/interp.v
theories/fundamental.v
View file @
7f235325
From
tutorial_popl20
Require
Export
typing
compatibility
.
Reserved
Notation
"⟦ τ ⟧"
.
Fixpoint
interp
`
{
heapG
Σ
}
(
τ
:
ty
)
(
ρ
:
list
(
sem_ty
Σ
))
:
sem_ty
Σ
:
=
match
τ
return
_
with
|
TVar
x
=>
default
sem_ty_unit
(
ρ
!!
x
)
(* dummy in case [x ∉ ρ] *)
|
TUnit
=>
sem_ty_unit
|
TBool
=>
sem_ty_bool
|
TInt
=>
sem_ty_int
|
TProd
τ
1
τ
2
=>
⟦
τ
1
⟧
ρ
*
⟦
τ
2
⟧
ρ
|
TSum
τ
1
τ
2
=>
⟦
τ
1
⟧
ρ
+
⟦
τ
2
⟧
ρ
|
TArr
τ
1
τ
2
=>
⟦
τ
1
⟧
ρ
→
⟦
τ
2
⟧
ρ
|
TForall
τ
=>
∀
X
,
⟦
τ
⟧
(
X
::
ρ
)
|
TExist
τ
=>
∃
X
,
⟦
τ
⟧
(
X
::
ρ
)
|
TRef
τ
=>
ref
(
⟦
τ
⟧
ρ
)
end
%
sem_ty
where
"⟦ τ ⟧"
:
=
(
interp
τ
).
Instance
:
Params
(@
interp
)
2
:
=
{}.
From
tutorial_popl20
Require
Export
typing
compatibility
interp
.
Definition
interp_env
`
{
heapG
Σ
}
(
Γ
:
gmap
string
ty
)
(
ρ
:
list
(
sem_ty
Σ
))
:
gmap
string
(
sem_ty
Σ
)
:
=
flip
interp
ρ
<$>
Γ
.
Instance
:
Params
(@
interp_env
)
3
:
=
{}.
Section
fundamental
.
Context
`
{
heapG
Σ
}.
Implicit
Types
Γ
:
gmap
string
ty
.
Implicit
Types
τ
:
ty
.
Implicit
Types
ρ
:
list
(
sem_ty
Σ
).
Implicit
Types
i
n
j
:
nat
.
Global
Instance
interp_ne
τ
:
NonExpansive
⟦
τ
⟧
.
Proof
.
induction
τ
;
solve_proper
.
Qed
.
...
...
theories/interp.v
0 → 100644
View file @
7f235325
From
tutorial_popl20
Require
Export
sem_type_formers
types
.
Reserved
Notation
"⟦ τ ⟧"
.
Fixpoint
interp
`
{
heapG
Σ
}
(
τ
:
ty
)
(
ρ
:
list
(
sem_ty
Σ
))
:
sem_ty
Σ
:
=
match
τ
return
_
with
|
TVar
x
=>
default
()
(
ρ
!!
x
)
(* dummy in case [x ∉ ρ] *)
|
TUnit
=>
()
|
TBool
=>
sem_ty_bool
|
TInt
=>
sem_ty_int
|
TProd
τ
1
τ
2
=>
⟦
τ
1
⟧
ρ
*
⟦
τ
2
⟧
ρ
|
TSum
τ
1
τ
2
=>
⟦
τ
1
⟧
ρ
+
⟦
τ
2
⟧
ρ
|
TArr
τ
1
τ
2
=>
⟦
τ
1
⟧
ρ
→
⟦
τ
2
⟧
ρ
|
TForall
τ
=>
∀
X
,
⟦
τ
⟧
(
X
::
ρ
)
|
TExist
τ
=>
∃
X
,
⟦
τ
⟧
(
X
::
ρ
)
|
TRef
τ
=>
ref
(
⟦
τ
⟧
ρ
)
end
%
sem_ty
where
"⟦ τ ⟧"
:
=
(
interp
τ
).
Instance
:
Params
(@
interp
)
2
:
=
{}.
Write
Preview
Markdown
is supported
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