-
-
Save JossWhittle/3310151 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
BUFF = (in[i:0..3] -> out[i] -> BUFF). | |
The same as saying... | |
BUFF = (in[0] -> out[0] -> BUFF | |
| in[1] -> out[1] -> BUFF | |
| in[2] -> out[2] -> BUFF | |
| in[3] -> out[3] -> BUFF). | |
Or you can use input parameters... | |
BUFF (N = 3) = (in[i:0..N] -> out[i] -> BUFF). |
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
COIN = (toss -> HEADS | toss -> TAILS), | |
HEADS = (heads -> HEADS), | |
TAILS = (tails -> TAILS). |
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
COUNT (N = 3) = COUNT[0], | |
COUNT[i:0..N] = (when (i < N) inc -> COUNT[i + 1] | |
| when (i > 0) dec -> COUNT[i - 1]). |
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
DRINKS = (red -> coffee -> DRINKS | blue -> tea -> DRINKS). | |
Trace: red->coffee->red->coffee->blue->tea->red->coffee->blue->tea->... |
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
CHAN = (in -> CHAN | in -> out -> CHAN). |
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
SWITCH = OFF, | |
OFF = (on -> ON), | |
ON = (off -> OFF). | |
Or alternatively... | |
SWITCH = (on -> off -> SWITCH). |
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
on->off->on->off->on->off->... |
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
CS-116 Notation: | |
oneshot = once.0 | |
FSP Notation: | |
oneshot = (once -> STOP). |
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
const N = 1 | |
range T = 0..N | |
range R = 0..2*N | |
SUM = (in[a:T][b:T] -> TOTAL[a+b]), | |
TOTAL[s:R] = (out[s] -> SUM). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment