I created my own programming language that compiles before the Turing Machine instructions, and I was wondering how to implement it if(a>b) do _ end. Here's the language definition (also available here )
Variables are dynamically distributed over any width, so they can have arbitrarily large integers
Each line can perform one of three functions, it can call a function (which changes its argument), run a while loop (which is really more from the for loop), or assign a variable.
Available functions: incr(Increment by one, may overflow), decr(Decrease by one, overflow), pop(Delete the last digit from the variable), first(Changes the most significant value of 0 in the variable to 1) and frost(changes the most significant 1 to zero).
The while loop has the following syntax:
while a <func> {
_
}
Basically, every time he loops, he is <func>up ato the error state. The error conditions are as follows: incrit firsthas all 1, decrand frosthas all 0, popdeletes the last digit. After a while loop with incror, frostall bits of the loop variable will be 0, on the contrary - firstand decr. Although the loops should end with a function call, and they delete all the variables contained within each run.
. a=b b , a, b , a, undefined, a - . a=b,5 b a ( ) , undefined, a . a=a,0 a. a=5,3 5 % 2**3 to a 3 .
if(a != 0) do _ end
while a decr {
_
t=0,1
while a incr {
incr(t)
}
incr(t)
}
, if, if(a==b), if(a!=b) if(a>b)
- Turing Complete, , , Turing?. , 1-5, 6.