Commit 46acdea4 authored by Robbert Krebbers's avatar Robbert Krebbers

Comments in demo file.

parent a155e29a
......@@ -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.
intros Htyped. iInduction Htyped as [] "IH".
5:{ iApply Pair_sem_typed; auto. }
(** Other cases left as an exercise to the reader *)
Lemma sem_typed_unsafe_pure :
......@@ -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 else-branch
of the conditional. The expression [#13 #37], which will get stuck in the
Markdown is supported
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