Hyperbrain

From Esolang
Jump to navigation Jump to search
This is still a work in progress. It may be changed in the future.

Hyperbrain is the ultimate programming language invented by User:Ttulka to decide any problem in the multiverse.

It consists of an infinite instruction set that operates on an unbounded tape of binary cells.

The instruction set forms an infinite hierarchy of ordered levels, where level 0 is Boolfuck without IO, with the instruction * generating a truly random value (0 or 1) into the current cell.

Generates a random number:

+[*>+]

Starting from level 1, the instruction set expands with oracle instructions that determine whether the given program of a lower level sets the current cell to 1 after it halts. The answer (1 or 0) is stored in the current cell.

Level Instruction set Meaning
0 +<>[]* Boolfuck w/o IO w/ a random generator
1 ? Oracle for level 0
2 ?? Oracle for level 1
3 ??? Oracle for level 2
... ... ...

The instruction ? takes a non-empty program as input that follows immediately after until the next ? instruction appears.

Answers 0:

?+[]?

This means that oracle instructions of the same level cannot be nested.

Two sequential oracles answer 0 and 1:

?+[]??+[+]?

The oracle instruction does not execute the input program; thus, the tape remains unchanged, and only the answer from the oracle is provided.

For example, the tape is [..., 1, 1, 0, ...] after executing the following program ("..." denotes an infinite sequence of zeros):

+>+>?+[>+]?

With higher levels, oracle instructions are denoted by the symbol ? in unary format. The oracle instructions are interpreted greedily from lower to higher levels.

For instance, this program, consisting of one level 2 oracle instruction followed by a level 1 program (containing two oracle instructions), sets the tape to [..., 1, ...]:

???+[]??+[+]+???

Examples

Halting problem

To solve the halting problem generically, a program can be aligned with code that always sets the current bit to 1:

?program[+]+?

Three-level oracles

Answers 1:

???+??+?+??????

Answers 0:

???+[??+[?+[]?+]??+]???

Hello, World!

In a rather peculiar way:

?+??+[]??+[]??+??+[]??+[]??+[]??+??+??+[]??+[]??+??+[]??+??+??+??+[]??+??+??+[]??+[]??+??+??+[]??+??+??+[]?
?+[]??+??+??+[]??+??+??+??+??+[]??+??+[]??+??+??+[]??+[]??+[]??+??+[]??+[]??+[]??+[]??+[]??+??+[]??+??+[]??
+??+??+??+??+??+[]??+??+??+??+??+??+??+??+[]??+[]??+??+[]??+??+??+[]??+??+??+[]??+[]??+??+??+[]??+[]??+??+[
]??+[]??+[]??+??+[]??+[]??+[]??+[]??+?

The answer to life, the universe, and everything

?+?>?+[]?>?++?>?+[+]?>?*[+]+[]?