A simple machine forgetting library.
Here is an example of how you can instruct the machine to forget the answer:
| <?php | |
| /* | |
| * This file is part of the Symfony package. | |
| * | |
| * (c) Fabien Potencier <fabien@symfony.com> | |
| * | |
| * @see Symfony\Component\HttpFoundation; | |
| /** |
| <?php | |
| $n = 6; | |
| $rules = []; | |
| $ngrams = []; | |
| foreach (read_csv('tweets.csv') as $data) { | |
| $source = $data['text']; | |
| $source = htmlspecialchars_decode($source); |
| .comm tape,4000,32 | |
| .globl i | |
| .data | |
| .align 8 | |
| .type i, @object | |
| .size i, 8 | |
| i: | |
| .quad tape | |
| .section .rodata |
| <?php | |
| namespace igorw; | |
| class Past { | |
| private $value; | |
| private $pastValues; | |
| function __construct($value, array $pastValues = []) { | |
| $this->value = $value; |
| # data | |
| store 0 "Hello, world of spaces!" | |
| # p = 0 | |
| push 0 | |
| label 3 # beginning | |
| # *p | |
| dup |
| <?php | |
| function bit_xor($x, $y) { | |
| return intval($x xor $y); | |
| } | |
| function bit_and($x, $y) { | |
| return intval($x && $y); | |
| } |
| <?php | |
| namespace igorw\lusp; | |
| // all functions return a pair of [val, env] | |
| function evaluate($expr, $env = []) { | |
| if (is_string($expr)) { | |
| if (is_numeric($expr)) { | |
| $val = (float) $expr; |
| <?php | |
| require 'vendor/autoload.php'; | |
| $loop = React\EventLoop\Factory::create(); | |
| $socket = new React\Socket\Server($loop); | |
| $socket->on('connection', function ($conn) { | |
| echo "Oh look! A connection!\n"; | |
| $conn->pipe($conn); |
| (run* [q] | |
| (fresh [a d] | |
| (!= (lcons a d) '(2)) | |
| (== (lcons a d) '(2)) | |
| (== q [a d]))) | |
| ;= ([2 ()]) |