Skip to content

Commit 17632da

Browse files
author
Aslan Askarov
committed
Adding an exampple about type labels
1 parent 42279d5 commit 17632da

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

body.tex

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,6 @@ \subsection{Monitoring for information flow}
423423

424424

425425

426-
427426
\paragraph{Implicit flows and I/O}
428427
The implicit information flows are further propagated between processes.
429428
In the mailbox, each message is additionally tagged with a label that
@@ -478,6 +477,33 @@ \subsection{Monitoring for information flow}
478477

479478

480479

480+
\paragraph{Implicit flows and type labels}
481+
Type labels of values created in branches are also tainted by the pc-label.
482+
Operations that check the type label, e.g., arithmetics or pattern
483+
matching, use the information in the type label to appropriately taint the blocking level.
484+
the value.
485+
\begin{lstlisting}
486+
(* ifc_type_labels.trp *)
487+
let val x = 100 raisedTo {alice}
488+
val y = 200 raisedTo {bob}
489+
val z = 300 raisedTo {charlie}
490+
val a = let pini authority
491+
val a = if y > 10 then z else "not an integer"
492+
in a
493+
end
494+
val _ = printWithLabels a
495+
val _ = debugpc()
496+
val w = a + x
497+
val _ = printWithLabels w
498+
in debugpc()
499+
end
500+
\end{lstlisting}
501+
\begin{verbatim}
502+
300@{charlie,bob}%{bob}
503+
PID:2dfdc81f-1027-40e2-810c-11fadb2dd40f@{}%{} PC:{} BL:{}
504+
400@{charlie,bob,alice}%{}
505+
PID:2dfdc81f-1027-40e2-810c-11fadb2dd40f@{}%{} PC:{} BL:{bob}
506+
\end{verbatim}
481507

482508

483509
\paragraph{Implementation note}

0 commit comments

Comments
 (0)