┌─────────┐ ┌─────────┐ ───┤ pick ch ├───►┤ chip ├──► └─────────┘ └─────────┘ | = | ┌─────────┐ ┌─────────┐ ───┤ chip ├───►┤ pick ch ├──► └─────────┘ └─────────┘ |
chip :: [Packet] → [Packet]
type Packet = (Channel,Data)
type Channel = Int
type Data = [Word]
| ┌──────┐ ps ───┤ chip ├──► ps' └──────┘ |
┌─────────┐ ┌─────────┐ ──┤ chip ├──►┤ pick ch ├──► └─────────┘ └─────────┘ | = | ┌─────────┐ ┌─────────┐ ──┤ pick ch ├──►┤ chip ├──► └─────────┘ └─────────┘ |
┌──────┐ ───┤ chip ├──► └──────┘ | = |
┌─────────┐ ┌─────────┐ ┌─►┤ pick 1 ├──►┤ chip ├──┐ │ └─────────┘ └─────────┘ │ │ ┌─────────┐ ┌─────────┐ │ ───┼─►┤ pick 2 ├──►┤ chip ├──┼──► │ └─────────┘ └─────────┘ │ │ ... ... │ │ ┌─────────┐ ┌─────────┐ │ └─►┤ pick n ├──►┤ chip ├──┘ └─────────┘ └─────────┘ |
Separation
assertion:
chip
is defined in a monadic style,
it is equivalent(*) to a simple list traversing function:
Under the assumption that onePacket
has the right properties,
we can prove Separation
with induction over the input packet list,
without reasoning about monadic code.
(*) This equivalence follows directly from the definitions.
Separation
is obtained by combining
two the proofs of two main properties: CondSeparation
and
AllGoodAlgs
.
Invariant
makes sure that there is no information
leaks through the register files.
GoodAlgs
makes sure that there are no information leaks through
the shared memory.
GoodAlgs
as an assumption, the proof of
CondSeparation
is valid even if memory protection is
removed from the chip. This opens up for some design choices...
ps = (ch',ws):ps'
ch' == ch
: the equation reduces to
{p1:pick ch (chip algs state1' ps')}
=== {p2:chip algs state2' (pick ch ps')}
This follows from follows from the invariant,
GoodAlg (algs ch)
and the induction
hypothesis
(using Invariant ch state1' state2'
).
Seems to correspond to step consistency in [Rus92].
ch' /= ch
: the equation reduces to
{pick ch (chip algs state1' ps')}
=== {chip algs state2 (pick ch ps')}
This follows from the invariant and the induction hypothesis.
Seems to correspond to local respect in [Rus92].
>>=
, liftM
and return
.
Two main modules:
proves CondSeparation
(separation holds provided the observed channel
algorithm is well-behaved)
proves AllGoodAlgs
(thanks to memory protection, all algorithms are well-behaved)