We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

User:Salpynx/Abysys

From Esolang
Jump to navigation Jump to search

Abysys(?) is a tag-system comprising 8 symbols in the abelian group C2xC2xC2.

Inspired by Abysys, A bliss-pit, Grill Tag, and searching for a mechanism to embed a tag-system inside a group, ideally abelian. Is this meaningful, or possible? Turns out: maybe and yes.

The system operates through the composition of symbols in two strings: instruction, and state, each a sequence of Trigrams within the C23 group.

Group table

☷ ☶ ☵ ☴ ☳ ☲ ☱ ☰ 
☶ ☷ ☴ ☵ ☲ ☳ ☰ ☱ 
☵ ☴ ☷ ☶ ☱ ☰ ☳ ☲ 
☴ ☵ ☶ ☷ ☰ ☱ ☲ ☳ 
☳ ☲ ☱ ☰ ☷ ☶ ☵ ☴ 
☲ ☳ ☰ ☱ ☶ ☷ ☴ ☵ 
☱ ☰ ☳ ☲ ☵ ☴ ☷ ☶ 
☰ ☱ ☲ ☳ ☴ ☵ ☶ ☷ 

((U+2637) Earth) is the identity element: ground. The table above lacks separate headings, but the first row and column represent the identity, so the result of composing two symbols is found by finding the intersection of two symbols by row and column. Order of operation does not matter as this group is abelian, which means the table is symmetrical about the diagonal.

Execution

Each instruction symbol, i, is read in order and composed with the current head, h, of the state string. Instructions are read in a loop. Execution halts when the data string is empty since two symbols are required for composition.

i ∘ h = r

  • If the top line is unbroken, the head (leftmost) symbol of the state string is deleted
  • If the middle line is unbroken, append (add to right) r ∘ r (i.e. (Earth)) to the state-string (this anchors the following appendant)
  • If the lower line is also unbroken (anchored by the middle line), append r ∘ i (i.e. h) to the state-string

Computational class and relation to other tag systems

This group contains a subset of symbols that can directly implement Grill Tag. Translation is given in trigrams as well as equivalent ASCII options for convenience, since in practice the alphabet is any Unicode codepoint Mod 8.

Grill Tag Trigram ASCII
command 10 (Mountain) 6 . ^
11 (Thunder) 3 + #
data 0 (Earth) 7 o O
1 (Water) 5 = -

Cyclic Tag

Cyclic Tag Trigram(s) ASCII
command 0
1
0;
1;
data 0 (Earth) 7 o O
1 (Water) 5 = -

TODO: The fact that translation from CT seems blocked suggests there might be a better way to generalise the rules. Hard-coding the addition of the identity symbol, ☷ (Earth), seems to restrict possibilities too much in a system that otherwise doesn't use that symbol. WIP

Examples

Test Grill_Tag#Example, demonstrating equivalent output in parentheses: 1011101110 => ☶☳☶☳☶, data: 110110 => ☵☵☷☵☵☷

./abysys.py ☶☳☶☳☶ ☵☵☷☵☵☷
☵☵☷☵☵☷		(110110)
☵☷☵☵☷☷		(101100)
☵☷☵☵☷☷☷☵	(10110001)
☷☵☵☷☷☷☵☷	(01100010)
☷☵☵☷☷☷☵☷	(01100010)
☵☵☷☷☷☵☷		(1100010)
☵☷☷☷☵☷☷		(1000100)
☵☷☷☷☵☷☷☷☵	(100010001)
☷☷☷☵☷☷☷☵☷	(000100010)
☷☷☷☵☷☷☷☵☷	(000100010)
☷☷☵☷☷☷☵☷	(00100010)
☷☵☷☷☷☵☷		(0100010)
☷☵☷☷☷☵☷		(0100010)
☵☷☷☷☵☷		(100010)
☵☷☷☷☵☷☷☵	(10001001)
☷☷☷☵☷☷☵☷	(00010010)
☷☷☵☷☷☵☷		(0010010)
☷☷☵☷☷☵☷		(0010010)
☷☵☷☷☵☷		(010010)
☷☵☷☷☵☷		(010010)
☵☷☷☵☷		(10010)
☷☷☵☷☷		(00100)
☷☷☵☷☷		(00100)
☷☵☷☷		(0100)
☷☵☷☷		(0100)
☵☷☷		(100)
☷☷☷		(000)
☷☷☷		(000)
☷☷		(00)
☷☷		(00)
☷		(0)

Interpreter

#!/usr/bin/env python3
import sys

EARTH = 0x2637  # Unicode Trigram For Earth
WATER = EARTH - 2

# Convert to Grill tag data string:
def gt(s):
    return s.replace(chr(EARTH), '0').replace(chr(WATER), '1')

# C2xC2xC2 group operator: XOR
def xor(a, b):
    return (EARTH - ord(a)) ^ (EARTH - ord(b))


def main():
    commands, data = sys.argv[1:]
    ip = 0
    while data:
        print(f'{data}\t({gt(data)})')
        cmd, head = commands[ip], data[0]
        r = xor(cmd, head)
        data = (data[r&1:] +          # delete head?
               chr(EARTH)*(r>>1&1) +  # append earth?
               head*((r&6)//6)))      # append head?
        ip = (ip + 1) % len(commands)


if __name__ == '__main__':
    main()