Reverse Arbitrary Binary Rewriting

From Esolang
Jump to navigation Jump to search

Reverse Arbitrary Binary Rewriting, or RABR for short, is an esolang, originally created as a "reverse" of Binary combinatory logic, however it "frees" itself from syntax, and any binary string can be interpreted, making it Pattern-based. Its rewrite rules are quite messy though.

Semantics

The program "pointer" is written as |, and starts at the start of the program. It is implied, and so doesn't need to be written in the program. The following rules are applied, from left to right:

w|11xz1yzw -> w11101xyz|w (where x y and z are length 2)
y|xz -> 1100x|yz (where x is length 2)
x1| -> |x11 (where x is length >0)
x| -> |x
y|xz -> yx|z (when x doesn't match any of the above)

Examples

Infinite Loop(where nothing changes):

0