Autopsy

From Esolang
Jump to navigation Jump to search

Autopsy is a minimal esolanguage designed in 2018 by Keymaker.

Program and execution

An Autopsy program consists of two kinds of instructions, . and ;. When reading the program, all other characters are ignored. The program must be at least one instruction long.

There are four registers/counters (a, b, c, d) which are all initially 0, which is also their minimum value. They have no upper bound. Initially the first register (a) is chosen.

When the program begins the instruction pointer is pointing at the first instruction. After executing an instruction, the instruction pointer moves forward two or three times (see below). If stepping past the last instruction, the instruction pointer returns to the first instruction.

Executing an instruction:

If instruction is .
Increase value of current register by one
Move forward two times
Else if instruction is ;
If value of current register is 0
Move forward three times
Else if value of current register is larger than 0
Decrease value of current register by one
Move forward two times
Whether decreasing happened or not, switch register focus to next register (if presently in last, switch to first)

The program never halts.

Computational class

The language has been proven Turing-complete via Minsky Machine translation. Detailed explanation can be found on the language's page (see link below).

Example MM translation

Here is a simple 7-instruction test program in Minsky Machine. It sets A to 3, then decreases it until zero while simulatenously increasing B, then settling into an endless loop decreasing A (which is already 0 at that point).

1 inc A 4
2 inc A 5
3 inc B 3
4 inc A 2
5 dec A 6 7
6 inc B 5
7 dec A 7 7

The resulting Autopsy program (1842 instructions):

;...;;..;;..;;..;...;;..;..;...;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;...;.
..;...;.;...;;..;;..;;.;;.;...;;..;;..;;..;...;;..;..;...;.;;...;...;...;.;...;;..;;..;;.;;...;...;.
..;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;.;...;;..;;..;;..;...;...;....;...;.....;.;;...;.
..;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;.
..;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..
;;.;;.;...;;..;;..;;..;...;...;;.....;...;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..
;;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;.;...
;;..;;...;;...;;.;;..;;..;...............;...;...;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...
;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..;;
.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;...;...
;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...
;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;.;...;;..;;..;;..;...;...;.
.;...;.....;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..
;;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;.;...
;;..;;...;..........;...;;.;;..;;..;...;...;...;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;
..;;..;;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;
;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;...;...;.
..;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;..;;..;;.;;...;...;...;.;...;;
..;;..;;.;;...;...;...;.;...;;..;;..;;.;;.

External resources

  • Autopsy page (exhaustive explanation of the language and the MM translation, MM-to-Autopsy translator, Autopsy interpreter in Python)