Natyre

From Esolang
Jump to: navigation, search

Natyre is a minimal, one-instruction esolanguage by Keymaker. It is the author's attempt to simplify Minsky machine further. The language was invented in 2016 but published in 2017. The language is an Infinitely Branching Counter Machine, a term coined by the author to describe the fundamental difference between this type of new counter machine and the other kind. The main difference here is that Natyre 1.) has an infinite amount of branching conditions whereas ordinary counter machines mostly have only one (such as Minsky Machine's DEC instruction) and 2.) has only one kind of instruction.

Program and execution

A program consists of instructions (at least one required), and there is only one type of instruction.

<identifier> <counter> <branch1> <branch2>

A description of an instruction consist of a unique identifier, a counter, and two branches (which are identifiers, which of course also must exist in the program).

Program execution begins in the first defined instruction. All counters are unbounded and initially 0. The system never halts.

An instruction is executed thus: The counter is increased by one. If the counter's new value is an event-number (see below), execution transfers to branch 2. Otherwise, which is a far more common case, execution transfers to branch 1.

Event-numbers (called such because they cause the other, rarer branching to happen) are numbers that appear according to a simple rule. There is an infinite supply of them, and each is larger than the previous. The first ten event-numbers are 1, 3, 6, 10, 15, 21, 28, 36, 45, and 55. Event-numbers can be generated easily: have integers q and n, both initially 0. Increase n by one, add n to q. Now q is the first event-number. Repeat (n=n+1, q=q+n). This sequnce can be found in OEIS: [1].

An example program:

1 A 1 2
2 B 1 1

At 1, counter A is increased. If it becomes event-number, execution moves to 2. Otherwise, execution moves to 1 (stays in the same instruction, in other words). If execution moved to 2, there counter B is increased. Execution moves to 1 whether B became event-number or not (because both branches point to instruction 1).

Computatinal class

The language is Turing-complete. A proof via Minsky Machine translation is offered on the page (see link below).

External resources

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