Created
May 6, 2014 06:48
-
-
Save jroesch/1f223b42856fb3b53fff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Lattice where | |
| data Nat : Set where | |
| Z : Nat | |
| S : Nat -> Nat | |
| data Lattice : Set where | |
| Lo : Lattice | |
| Hi : Lattice | |
| -- sketch of how we can add security lattice features | |
| join : Lattice -> Lattice -> Lattice | |
| join Lo Lo = Lo | |
| join _ Hi = Hi | |
| join Hi _ = Hi | |
| data Wire : (n : Nat) -> (l : Lattice) -> Set where | |
| W : (n : Nat) -> (l : Lattice) -> Wire n l | |
| add : {n : Nat} {l l' : Lattice} -> Wire n l -> Wire n l' -> Wire n (join l l') | |
| add = _ |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
we need a general way to provide "compilers" for these data types so that the user can extend the language with primitives like this, where each wire becomes more complex.