Quelcal

From Esolang
Jump to navigation Jump to search

Quelcal /'kju:l.kæl/ is an esolang created by CreeperBomb in 2023. In it, programs are represented by button presses on typically calculator, plus a check operator and the number i. Specifically, these are:

Quelcal Calculator button
0 0 digit
1 1 digit
2 2 digit
3 3 digit
4 4 digit
5 5 digit
6 6 digit
7 7 digit
8 8 digit
9 9 digit
. Decimal point
i N/A (Complex number i)
+ Addition
- Subtraction
x Multiplication
÷ Division
± Negate
= Equate
? N/A (Check)

Checking is a trinary operator that takes in any number, a natural number, and an integer, in that order, with its symbol between these. The natural number represents a particular set. If the leftmost number is not in the set that the natural number represents, then the program jumps forward the integer number lines. Otherwise, nothing happens. Checking happens after addition/subtraction. For example, 3?1?0 would jump to itself and loop. The sets and associated number are:

Number Set
0 Natural numbers (incl. 0)
1 Integers
2 Rationals
3 Reals
4 Complex numbers

Turing completeness

Quelcal is trivally Turing complete as, using multiplication, division, digits, and checks, a multiplicative Minsky machine can easily be simulated. However, for specification purposes, a proof of equivalence to and completeness of such a machine will be provided.

Let us refer to "Quelcal" as "Q" and "multiplicative Minsky machine" as "MMM" for short. For formatting reasons, newlines will also be replaced with "n". Consider Q programs starting with 1. Now, add x2 & x3 for any multiplication by 2 or 3 in an MMM's code. Division is similar, but with an extra bit attached to the end; ÷2=?0?1nx2 and ÷3=?0?1nx2 for division by 2 or 3. This shows being at least as powerful as an MMM. An MMM can also be shown as Turing complete as its incremental/decremental couterpart by recognizing that, since 2 & 3 are coprime and not equal to -1, 0, or 1, an MMM's state can be represented by two numbers correponding to the amount of factors of 2 and of 3, which get incremented or decremented in the exact same manner as a regular Minsky machine, with the same decremental behavior at 0. Thus, Q is at least Turing complete, and since there the rest of its features do not grant it super-Turing complete computational abilities, Q is precisely Turing Complete.