Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Arthur Azevedo de Amorim
Tutorial POPL20
Commits
46acdea4
Commit
46acdea4
authored
Jan 20, 2020
by
Robbert Krebbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Comments in demo file.
parent
a155e29a
Changes
2
Hide whitespace changes
Inline
Sidebyside
Showing
2 changed files
with
12 additions
and
3 deletions
+12
3
theories/demo.v
theories/demo.v
+10
2
theories/language.v
theories/language.v
+2
1
No files found.
theories/demo.v
View file @
46acdea4
...
...
@@ 2,7 +2,14 @@ From tutorial_popl20 Require Import language.
From
iris
.
base_logic
.
lib
Require
Import
invariants
.
From
iris
.
heap_lang
Require
Import
adequacy
.
(** Plan:
(** This file contains a simplified version of the development that we used
throughout the lectures. This simplified version contains a subset of the
features in the full version. Notably, it does not support unary and binary
operators, sums, polymorphic functions, and existential types. Moreover, in
this version, we define the interpretation of types [interp] in a direct style,
instead of using semantic type formers as combinators on [sem_ty].
Overview of the lecture:
1. HeapLang is a untyped language. We first define a syntactic types and a
syntactic typing judgment.
...
...
@@ 49,7 +56,7 @@ Inductive typed : gmap string ty → expr → ty → Prop :=
Γ
⊢
ₜ
#
b
:
TBool

IntV_val_typed
Γ
(
i
:
Z
)
:
Γ
⊢
ₜ
#
i
:
TInt
(** Products
and sums
*)
(** Products *)

Pair_typed
Γ
e1
e2
τ
1
τ
2
:
Γ
⊢
ₜ
e1
:
τ
1
→
Γ
⊢
ₜ
e2
:
τ
2
→
Γ
⊢
ₜ
Pair
e1
e2
:
TProd
τ
1
τ
2
...
...
@@ 144,6 +151,7 @@ Section semtyp.
Proof
.
intros
Htyped
.
iInduction
Htyped
as
[]
"IH"
.
5
:
{
iApply
Pair_sem_typed
;
auto
.
}
(** Other cases left as an exercise to the reader *)
Admitted
.
Lemma
sem_typed_unsafe_pure
:
...
...
theories/language.v
View file @
46acdea4
...
...
@@ 427,7 +427,8 @@ Qed.
(** Since HeapLang is an untyped language, we can write down arbitrary
programs, i.e. that are not typeable by any reasonable type system, and prove
logical specifications of them. We will show this on two small examples that
will use at other places in this tutorial. *)
will use at other places in this tutorial to demonstrate the advances of
semantic typing. *)
(** The program below containts the expression [#13 #37] in the elsebranch
of the conditional. The expression [#13 #37], which will get stuck in the
...
...
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