Underflow
Underflow is an esolang created by User:Yayimhere, to make a Pushdown automata able to solve the problem that it is unable to do the problem with a b and c. it is most likely Turing complete, however there is currently no proof of this.
Memory
there is an unbounded registry called R, a string called S, two stacks called X and Y, and a boolean called B. on every iteration, the bottom symbol of X is pushed to Y. If there ever is stack underflow, B will be set to false, and nothing else will happen.
R is started at 0, S is started as the empty string, X and Y are started empty, and B is started as true
Commands
Below are all the commands of Underflow:
| Command | Meaning |
|---|---|
"x" |
Push any single char x to X |
! |
Pop the top of X |
` |
Increment R |
{x} |
set S to any string x |
[...][x] |
loops ... n times, where n is equal to how many times the single char x is repeated in S |
[...] |
loops ... R times. if R changes value we can do things. if increased, simply continue until that value is reached, keeping in mind the amount of times the loop has looped. if decreased, do thee same as with increased, however if it increases below the amount of time's the loop has looped, simply stop. |
- |
pops top of second stack |
# |
NOT(B) |
= |
sets R to the amount of objects on X |
: |
sets R to the amount of objects on Y |
^ |
pops R objects off of Y |
all commands must be separated by spaces.
Examples
[`]
Solving that same abc problem:
{the string} [ "a" ][a] [ ! ][b] [ "a" ][a] [!][c] [ "b" ][b] [ ! ][a] [ "b" ][b] [ ! ][c] [ "c" ][c] [ ! ][a] [ "c" ][c] [ ! ][b]
at the end, if B is still true, then there is an equal amount, if not, B becomes false.