1 Block computes ANYTHING

by Ricardo Fernández Serrata

Version 1 (January 20, 2021)

Download (29 downloads)

Automate as a whole is obviously Turing Complete. But did you know Array Add + expressions = TC? So I wrote some functions/algorithms to demonstrate the ludicrous TC of just 1 Automate block. Some parameters are specified in "reverse prefix/postfix polish notation" because of the way stack machines work.

Meaning of some parameters:
"a, b" Are the initial values. 0, 1 is for standard Fib. 2, 1 is the Lucas Sequence.
"s" Is "shortcut mode", it skips some Even numbers (Truthy Parity). Accepts 0 or 1.

1) The "Expression True" (AKA While Loop) is only needed to halt the flow, return external output and reduce resource usage. A TM can detect when it's finished and leave its tape untouched even if the program is still running and doing infinite conditional checking.

2) Variable Set {M} is only needed to parse external inputs and initialize the stack. Array Add can set default values to {M} (No need of Variable Set). And parsing can also be done by the "programs", but I wanted a modular flow because it's easier to see what each algorithm really does.

3) This uses Array Add instead of Set because for the iterative Fs to easily detect the amount of changes in their state (in this flow) they need to push data to the stack. It's possible to use Array Set in the same way as Add with the help of {Now} but that would be tricky (of course is just better to use Arr Set the same way as Var Set because it's easier, but that would be a register machine).

4) Array Set and Variable Set are also TC and, unlike Array Add, they don't waste infinite memory (this stack machine never pops frames). I wanted to do this with Array Add because it's more weird, and because it can be used to log a history of previous values.

Fun Fact: The closest thing Automate has to a Switch-Case Statement is an array of expressions. #ChangeMyMind

Note: I tried to program the MultiFactorial (instead of the basic and standard Fact.), but the results weren't correct (even DoubleFact was wrong). If someone knows how to do it, please let me (and everyone else) know.

The choices tagged with "future" are the ones I want to finish. Sort is more difficult than Crack MD5, so maybe the cracker will get ready first

3.5 average rating from 2 reviews

5 stars
4 stars
3 stars
2 stars
1 star

Reviews and ratings can be submitted in the app.