endless iteror Ψ #1
Frances K*, 2016
© Kreative commons
In the beginning there is counting, simply on your fingers. With infinite hands you could add up all the natural numbers.
To count a quantity, add unit
1 for each item,
until all items passed by once. The number of units
then equals your quantity.
You can tell a number by its name: counting
one, two, three, four, five,
or write them with
But numeral constants are not quantities, and must be translated before a calculation, where you add up fingers again. Or, when you use tables of multiplication, the calculation can stay in the dictionary.
In unary notation we write natural numbers
1.. of ones,
that repeat the unit
a number of
The number named zero
1 = 1
2 = 11
3 = 111
4 = 1111
5 = 11111
6 = 111111
7 = 1111111
8 = 11111111
9 = 111111111
ω = 1....infinity
n = 1.. :n
Click the board to show larger unary numbers.
During counting a number variable is still
but its lower bound
may already be available.
The term unary applies to units
When different units can be used,
we call this unit notation.
- is an independent unit,
with a left and right elimination rule
that is dependent on unit
We can add
m+n unary numbers
simply by concatenation. No operation is performed in between,
we just remove the plus.
mn = 1..1.. 1:m 1:n
= 1.. :mn
24 = 1..1.. 1:2 1:4
= 111111 = 6
55 = 1..1.. :5 :5
= 1111111111 =: 10
4321 = 1..1..1..1 :4 :3 :2
= 1111111111 =: 10
Show examples with numbers instead of variables.
Natural addition concatenates numbers directly
and has precedence over all other operations.
You can still use the old plus
operator to postpone addition.
V+m+n adds up after subexpression
is completely reduced.
We define a minus unit
- by adding
0 to void.
Let addition of finite numbers be associative and commutative, then
Negative numbers form by concatenation
of units minus.
We never use a sign for subtraction
as the inverse operation of addition.
In recursions we either subtract
from an entry
- to an entry
to count off the next operation. And repeat that
until the operation counter or iterator
is down to
1 as customary.
+ Advanced System
When we reduce multiplication to addition as part of a larger operation,
a neighbouring old plus
+ causes confusion.
But not if a double plus
marks the outside of the evaluation subspace.
Such a prop works in tandem with pop marks,
that set apart suboperations on the inside.
Both the left prop
++ that delimits left iterators
and the single pop
+ there just postpone addition.
Double pluses have lowest precedence.
evaluates ltr to
:= reduces to
and then adds up to
Note that if you
n the pluses in an expression become
+.. oversized, but that this need not lead to conflicts.
In our advanced system the parent entry counts down separator arrays.
A deeper operation has to add to an initial array that shields it off.
Earlier we prescribed a single first
+ plus there.
Now we start on a dedicated double
which is still optional for operations on numbers.
Without it a preceding old
pop added on top.