Skip to content

Commit

Permalink
Writing
Browse files Browse the repository at this point in the history
  • Loading branch information
Zalastax committed May 30, 2018
1 parent 13e5ed5 commit 003ab9f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
13 changes: 8 additions & 5 deletions src/ActorMonad.lagda.tex
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@
where variables are commonly referred to by their name.
Variable names makes expressions easy to understand for humans,
but pose two annoying problems: α-renaming and α-equivalence.

α-equivalence is a form of equivalence that captures the intuition that the particular choice of
a bound variable name does not usually matter \parencite{turbak2008design}.

Renaming the variables of an expression in a way that preserves α-equivalence
is called α-renaming \parencite{turbak2008design}.
α-renaming is a part of the general concept of substitution,
Expand Down Expand Up @@ -200,16 +202,15 @@
We choose to represent the indices as the membership proposition
in order to make the de Bruijn indices correct by construction.
This lets us define the type judgement $Γ ⊢ T$ as:

\AgdaCatch{Membership}{ElementIn}
\begin{minipage}{\textwidth}
\begin{code}
ReferenceTypes = List InboxShape
TypingContext = ReferenceTypes

_⊢_ : TypingContext → InboxShape → Set₁
Γ ⊢ T = T ∈ Γ

\end{code}
\end{minipage}
%</ActorPrecondition>

%<*ReferenceSubtype>
Expand Down Expand Up @@ -237,7 +238,8 @@
the pattern of sending a command together with what reference to reply to,
since different actors receiving the reply will have a different \AgdaFunction{InboxShape}.
This pattern, together with a selective receive construct,
can be used to implement synchronous calls \parencite{ericsson_gen}.
can be used to implement synchronous calls,
which we explore in chapter \ref{chap:selective_receive}.
%</ReferenceSubtype>

%<*Messages>
Expand Down Expand Up @@ -400,7 +402,8 @@
%</ActorMonadSpawn>
%<*ActorMonadSend>
An actor can send messages to any actor it has a reference to.
It is not explicit in the monad what happens to a sent message, but we see in (SECTION)
It is not explicit in the monad what happens to a sent message,
but we see in section \ref{sec:mact_semantics}
that evaluating Send will append the message to the actor being referenced.
The reference variable might be a subtype to the underlying actor it references,
but this fact is completely opaque to the
Expand Down
3 changes: 2 additions & 1 deletion src/Examples/Types.lagda.tex
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

%<*Cong>
\begin{code}
cong : {A B : Set} {m n : A} → (f : A → B) → m ≡ n → f m ≡ f n
cong : ∀ {a} {A B : Set a} {m n : A} → (f : A → B) → m ≡ n → f m ≡ f n
cong f refl = refl


Expand Down Expand Up @@ -66,6 +66,7 @@

OtherInbox : InboxShape
OtherInbox = StringMessage ∷ [ BoolMessage ]ˡ

RefNatMessage : MessageType
RefNatMessage = ReferenceType OtherInbox ∷ [ ValueType ℕ ]ˡ

Expand Down
6 changes: 4 additions & 2 deletions src/SimulationEnvironment.lagda.tex
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,10 @@

data Inboxes : (store : Store) → Set₁ where
[] : Inboxes []
_∷_ : ∀ {store name inbox-shape} → Inbox inbox-shape →
(inboxes : Inboxes store) → Inboxes (inbox# name [ inbox-shape ] ∷ store)
_∷_ : ∀ {store name inbox-shape} →
Inbox inbox-shape →
(inboxes : Inboxes store) →
Inboxes (inbox# name [ inbox-shape ] ∷ store)
\end{code}
%</Inboxes>
\begin{code}
Expand Down

0 comments on commit 003ab9f

Please sign in to comment.