Countertrue
Countertrue is a simple counter-based esolang designed by User:Keymaker in 2025. The language was originally meant to be a nameless intermediate language in a Minsky Machine to Exoshell translation, but as it proved to be quite useful it was made into a language of its own.
Program and execution
The program is a list of counters (at least one) and the operations associated with the counters. Each counter has a value ranging from 0 to an arbitrary integer value. Initially the first defined counter is 1, all others are 0.
A counter's set of operations may, in maximum case, contain an operation for altering each counter in the program once. A counter may increase or decrease (but not do both) any counter (including itself) once. Increasing is always successful, decreasing 0 does nothing (value remains 0).
The counters are executed in sequence from first to last, after which the focus cycles back to the first counter. The system never halts. If a counter's value is larger than 0, the operations associated with the counter are executed. If a counter's value is 0, the operations are not executed.
In the actual source, a line may be either empty or contain a counter definition. The definition begins with the counter's name/label followed by :: followed by a list of counters that are manipulated (if any); those that are decreased have - preceding their label, those that are increased have +. The counters that are not changed are not listed. An example line:
i22 :: -i21 +i23 +A
Computational class
The language is Turing-complete, which can be shown via Minsky Machine translation. The language was designed to be receptive to Minsky Machine translation and to be somewhat easily translatable into Exoshell.
Translation example
This MM program
1 inc A 2 2 inc A 3 3 dec A 4 4 4 inc A 5 5 dec A 6 7 6 inc B 5 7 inc C 7
becomes, after put through MM to Countertrue translator:
1 :: -1 +A_0 +A_1 +2 2 :: -2 +A_0 +A_1 +3 3 :: -3 +3_fai +3_suc A_0 :: -3_fai 3_fai :: -3_fai -3_suc +4 3_suc :: -3_suc -A_0 -A_1 +4 4 :: -4 +A_0 +A_1 +5 5 :: -5 +5_fai +5_suc A_1 :: -5_fai 5_fai :: -5_fai -5_suc +7 5_suc :: -5_suc -A_0 -A_1 +6 6 :: -6 +B_0 +5 7 :: +C_0 B_0 :: C_0 ::
Notice how there are two copies of register A, and when A is manipulated both copies are increased/decreased at the same time. More about this 'peculiarity' can be found on the page linked in external resources.
See also
- The Waterfall Model (2018) - A rather different language, but one that also explores the terrain of simplistic counter-machines without control flow / arbitrary program state.
- The Amnesiac From Minsk (2015) - Another language that removes the arbitrary state from counter-machines.
External resources
- Countertrue information (more details about the language and the MM translation, translator program, interpreter in Python)