This file contains 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
// each state element is of the form [value, bitmask, expression] | |
// - `expression` is a string representing an arithmetic expressoin | |
// - `value` is the arithmetic value of `expression` | |
// - `bitmask` is a bitmask recording which of the 4 numbers (6,6,5,2) we've | |
// used | |
const state = [[6,1,"6"],[6,2,"6"],[5,4,"5"],[2,8,"2"]]; | |
// combines compatible states using arithmetic operations to produce new states. | |
// | |
// x and y are states (see above) |
This file contains 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
?an:id can fly | |
= ?an is a bird | |
- ?an is a penguin | |
+ ?an is Harry the Rocket Penguin | |
// nb. left-associative; a - b + c = (a - b) + c. | |
safe path from ?a to ?c | |
= edge from ?a to ?c | |
+ (edge from ?a to ?b | |
- ?b is dangerous |