Talk:Addpocalypse
Computational class
This is sub-TC at the moment. An equivalent view of the language is to imagine that "0+" instead decrements all registers except #0, and register #0 is thus always 0 (which is clearly equivalent to the current definition). Then, because "n?" restarts the program if #n is not equal to 0, in any case where the program continues then register n will have a known value for the rest of the program. This means, among other things, that there's never any point in testing the same register twice in the program, so we can assume that any program that might demonstrate TCness tests each register once. Then, imagine renumbering the registers in the order that they're tested (so that 1? comes before 2? comes before 3?, etc.) – this means that it's impossible for the value of a higher-numbered register (other than its zeroness/non-zeroness) to affect the value of a lower-numbered register, and that in turn makes it impossible for the language to retrieve an arbitrary amount of data (because data has to be retrieved into a register with a higher number and once it reaches the highest-numbered register, it can't be retrieved any more).
The language would be more powerful if the n? instruction were reversed (i.e. to jump to the start if the values were the same, rather than if they were different), although it would probably be harder to write in. I think that's probably enough to make it TC, via using a separate register to remember which register you just tested – I'm not 100% sure though because I haven't yet figured out how to start up the program in the desired state. --ais523 15:40, 16 May 2024 (UTC)
Turing-complete variation
I posted this elsewhere a while ago, but thought it might be worth adding here -- as far as I can tell the language would be turing-complete with these changes:
- register #0 is initialized at 1, while the others are initialized at 0 (the important thing, I believe, being that #0 has a higher value than at least one other register)
- the condition for
?
is inverted, giving the instructions:n+
- increment register #n (identical to the+
instructions in Addpocalypse and Brainpocalypse II)n?
- jump to start of program if register #n is equal to register #0
Brainpocalypse II's -n
can then be simulated with the sequence of instructions:
n+
n?
- for each register r other than n,
+r +r
register #0 defines what value is used to represent a simulated value of 1; in the simulated -n
, n is incremented, and then the program jumps to the beginning if n is equal to 1 (i.e., if n was 0, it gets incremented and then the program jumps to the beginning); if n isn't equal to 1, then all other registers are incremented by 2, meaning n has now decreased by 1 relative to register 0, while everything else retains the same relative value