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.

Alexandrion

From Esolang
Jump to navigation Jump to search

Alexandrion is an description language for Kontakion-machines. A Kontakion-machine uses heptavtinimal terscii encoding and generates a Kontakion.

It can evaluate a word or a set of words and operates by producing a jump-address in the case of a collision between two words.

The Kontakion-machine

A Kontakion-machine is defined by four choices, which are what an Alexandrion program specifies:

  • Seed rule. How a word becomes a starting value. The word is refined through an interval-narrowing evaluation over a descending sequence of radices, and the result is forced into the unit group of the working modulus.
  • Working modulus and orbit generator. The canonical machine works modulo 3^9 = 19683 and advances by doubling. Because 2 generates the entire multiplicative unit group modulo 3^9, the orbit visits all 13,122 units exactly once, so the finished Kontakion is a complete discrete log table: an entry's position in generation order is the discrete logarithm of its value.
  • Notation. Values are written in heptavintimal (base 27, one digit per 3 trits) and all text, including the hexadecimal address strings, is re-encoded in TERSCII.
  • Radix schedule. Each registry entry is stamped with a descending radix and an ascending sequence counter, packed into a 24-digit hexadecimal address.

A finished Kontakion line has the form

index:HEPT<terscii of the address tail>terscii of the word

and the registry is sorted by heptavintimal value, so the machine's generation order (the discrete log) can only be recovered from the address fields.

Functions

Alexandrion exposes two functions, which run as passes over the raw orbit.

Ordinator

`Alexandrion(Ordinator)` performs the ordering pass: it deduplicates orbit values, assigns each surviving entry its radix and sequence stamp, packs the address, and sorts the registry into heptavintimal order.

Streetsweeper

`Alexandrion(Streetsweeper)` performs the collision pass. When several words are evaluated into one Kontakion, their registries may claim the same address. Streetsweeper walks the combined registry, bumps a colliding entry's sequence counter until it finds a free address, and records the original-to-final mapping in a jump register. A Kontakion produced from multiple words is therefore self-relocating: the jump register is part of its meaning.

Programming Alexandrion

Varying the four choices produces different types of Kontakions. Shrinking the modulus to a smaller power of three yields miniature Kontakions; changing the generator reorders the discrete logs; restricting the radix schedule truncates the registry; evaluating word sets rather than single words exercises Streetsweeper. The A + B problem below is the two-word machine run to exhaustion of distinct heptavintimal keys.

Kontakions as memory images

A Kontakion entry is a pair of one value and one position, and its heptavintimal key of up to three digits is exactly one 9-trit tryte. A Kontakion is therefore a memory image of 9 trits, 19683 trytes: decode each key to a tryte, decode each address tail to a discrete log k, and store the tryte at address 2^k. The full single-word Kontakion is a complete core dump of that machine; a sparse Kontakion is a program loader for it. Note that a loader Kontakion must retain duplicate heptavintimal keys, which the Ordinator would otherwise remove.

discreet log Kontakion

example

A + B problem

-- Processing Words ---

Analyzing WORD: A
Analyzing WORD: B

--- Final Registry Output ---

0:0<020242335332020202>13
1:0<020222720253024212>23
2:A<020242335332020212>23
3:B<020242335322020212>23
4:D<020242335312020222>23
5:H<020242335302020232>23
6:P<020242334363020242>23
7:AE<020242334353020252>23
8:BJ<020242334343020262>23
9:DT<020242334333020272>23
10:IM<020242334323020282>23
11:RZ<020242334313020203>23
12:AJY<020242334303020213>23
13:BMP<020242333343021262>23
14:BST<020242331362023243>23
15:BUW<020242334382020223>23
16:BWT<020242332382022223>23
17:CEA<020242332363022242>23
18:E0E<020242333333021272>23
19:EFH<020242331313023203>23
20:EJN<020242331353023252>23
21:ELM<020242331352023253>23
22:EPS<020242334372020233>23
23:ETM<020242332372022233>23
24:FJB<020242332353022252>23
25:GJD<020242333363021242>23
26:HBQ<020242332302023232>23
27:HPA<020242334312021222>23
28:HXG<020242334332021202>23
29:J0J<020242333323021282>23
30:JLP<020242331303023213>23
31:JUA<020242331343023262>23
32:JXZ<020242331342023263>23
33:KCS<020242332332023202>23
34:KFK<020242334362020243>23
35:KMZ<020242332362022243>23
36:LTD<020242332343022262>23
37:LTK<020242333342021263>23
38:MAM<020242333303021213>23
39:NTH<020242333353021252>23
40:NWJ<020242331372023233>23
41:NYJ<020242332303022213>23
42:OBN<020242333302022232>23
43:PCD<020242331323023282>23
44:PEG<020242331363023242>23
45:QEB<020242334302021232>23
46:QNV<020242332312023222>23
47:QUN<020242334322021212>23
48:QYQ<020242334342020263>23
49:SAW<020242332342022263>23
50:SWS<020242333352021253>23
51:T0T<020242333313021203>23
52:TYE<020242331382023223>23
53:TZE<020242332313022203>23
54:UAG<020242333312022222>23
55:UOB<020242331333023272>23
56:UVY<020242331332024202>23
57:VGK<020242332322023212>23
58:VLV<020242334352020253>23
59:W0Y<020242332352022253>23
60:WKW<020242333362021243>23
61:WZP<020242332323022282>23
62:X0Q<020242333322022212>23
63:YEY<020242333372021233>23
64:YMH<020242332333022272>23
65:YMV<020242333332022202>23
66:ZBZ<020242333382021223>23

Computational class

Alexandrion is a Finite state machine. Its working modulus is fixed, its orbit is finite, and every Kontakion it can emit is bounded, so a Kontakion-machine is a finite state transducer from words to registries.

See also