An interesting aspect of fractions and prime factorization is that multiplying fractions is the same as adding the prime numerators and subtracting the prime denominators.
For example, multiplying 42 by 5/14 means incrementing the power of prime 5, and decrementing the power of primes 2 and 7 — For a result of 42. A division is simply the inversion of the effects of the numerator and denumerator.
For example, multiplying 42 by 5/14 means incrementing the power of prime 5, and decrementing the power of primes 2 and 7 — For a result of 42. A division is simply the inversion of the effects of the numerator and denumerator.
Andy Alderwick
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to Andy Alderwick • • •Andy Alderwick
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to Andy Alderwick • • •Devine Lu Linvega
in reply to Devine Lu Linvega • • •Multiplying by zero has the effect of unsetting one, which is not a prime, I don't even-
⛧ esoterik ⛧
in reply to Devine Lu Linvega • • •2^0 * 3^0 * ... = 1.
you can only reach zero using zero and once you're there you can never leave.
⛧ esoterik ⛧
in reply to ⛧ esoterik ⛧ • • •for multiplication, one is the identity element (x * 1 = 1 * x = x). zero is called the annihilator (x * 0 = 0 * x = 0). addition does not have an annihilator.
Devine Lu Linvega
in reply to ⛧ esoterik ⛧ • • •If annihilation is the mirror to identity, shouldn't it be reversible?
⛧ esoterik ⛧
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to ⛧ esoterik ⛧ • • •⛧ esoterik ⛧
in reply to Devine Lu Linvega • • •if i give you 0 and say that i just multiplied some number by 0 you can't possibly know which one i used.
Devine Lu Linvega
in reply to ⛧ esoterik ⛧ • • •Andy Alderwick
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to Andy Alderwick • • •automatic server maid
in reply to Devine Lu Linvega • • •⛧ esoterik ⛧
in reply to automatic server maid • • •Devine Lu Linvega
in reply to ⛧ esoterik ⛧ • • •Andy Alderwick
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to Andy Alderwick • • •I understand that Incrementing 2/1, would expect 3/1 to come out the other end. It seems like we're adding the numerator over the source.
Would incrementing 2/3 be 4/3?
Devine Lu Linvega
in reply to Devine Lu Linvega • • •s-ol
in reply to Devine Lu Linvega • • •if incrementing means "add $denominator to the numerator" it works out in both directions even if you simplify fractions along the way:
inc 2/4 = (2+4)/4 = 6/4
6/4 = 3/2
dec 3/2 = (3-2)/2 = 1/2
1/2 = 2/4
is this what you mean?
⛧ esoterik ⛧
in reply to Devine Lu Linvega • • •⛧ esoterik ⛧
in reply to ⛧ esoterik ⛧ • • •Devine Lu Linvega
in reply to ⛧ esoterik ⛧ • • •⛧ esoterik ⛧
in reply to Devine Lu Linvega • • •- add/subtract 1
- for fixed point (or floating point) find next highest or next lowest value
the second one doesn't work for rational numbers in general (you can always find a rational number between any two rational numbers that aren't equal)
Devine Lu Linvega
in reply to ⛧ esoterik ⛧ • • •5/6 INC, would be 11/6
automatic server maid
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to automatic server maid • • •⛧ esoterik ⛧
in reply to Devine Lu Linvega • • •⛧ esoterik ⛧
in reply to ⛧ esoterik ⛧ • • •Devine Lu Linvega
in reply to ⛧ esoterik ⛧ • • •⛧ esoterik ⛧
in reply to Devine Lu Linvega • • •there's no "next largest rational number" (unlike integers) so it's not clear there's one particular thing here.
WimⓂ️
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to WimⓂ️ • • •Pendulum Instruction Set Architecture - Esolang
esolangs.orgDevine Lu Linvega
in reply to WimⓂ️ • • •WimⓂ️
in reply to Devine Lu Linvega • • •Another problem is that the one you have been discussing: if your algebra has an annihilator, your computation is not reversible. So basically we would need to compute and program in quite a different way.
Devine Lu Linvega
in reply to WimⓂ️ • • •Devine Lu Linvega
in reply to Devine Lu Linvega • • •I'm trying to figure, is there a variance of Uxntal that could be reversible?
I'm thinking something like a loop:
#1000 &l LDAk #18 DEO INC GTHk ,&l JCN
I feel like this could be run in reverse without annihilation, maybe. So at the end of the loop, I would normally POP2, if I knew its exact value then, could I "unliteral" it? Like, #1010 SUB2 , so this whole thing could be run backward?
Andy Alderwick
in reply to Devine Lu Linvega • • •Thinking more generally, though, the “#18 DEO” is shortspeak for “print this byte to the Console device”: how do we make that reversible? This Uxntal variant would need to store the information about every byte you print, 1/2
Andy Alderwick
in reply to Andy Alderwick • • •With each step you are storing more and more information about the computer's state that in ordinary languages we would throw away. We printed a string or overdrew a UI widget, we don't really care what was there before. 2/2
Devine Lu Linvega
in reply to Andy Alderwick • • •Devine Lu Linvega
in reply to Devine Lu Linvega • • •Andy Alderwick
in reply to Devine Lu Linvega • • •It's the last bit where I think retaining data and reversibility is most helpful.
Devine Lu Linvega
in reply to Andy Alderwick • • •Imagine that we could also unliteralize values to reduce that garbage, is there something to explore with that? I'm not sure exactly how that'd work, but if you know a value in the "graveyard" stack precisely, you could UNLIT/UNLIT2 it?
Andy Alderwick
in reply to Devine Lu Linvega • • •If there's room for ten sprites, then it's obvious that an “UNLIT 0a” thing would work. My problem then is dealing with numbers that come from external sources, such as the mouse pointer location or the current time of day.
Devine Lu Linvega
in reply to Andy Alderwick • • •So, #ff DEI2 pops 1 byte, in reverse if would push one literal from the graveyard, and not trigger any device event, just stack effects I suppose.
Devine Lu Linvega
in reply to Devine Lu Linvega • • •Even instructions like add would have to add to the graveyard, and would have to unlit there second param.
WimⓂ️
in reply to Devine Lu Linvega • • •WimⓂ️
in reply to Devine Lu Linvega • • •I found an interesting programing language that implements time-reversible computation:
http://revcomp.info/legacy/mpf/rc/janus.html
Janus
revcomp.infoDevine Lu Linvega
in reply to WimⓂ️ • • •I understand if I ran a program that INC, instead DEC, I should find my way back to the original state. That seems to be what uncomputing means, is there an angle that I'm missing?
WimⓂ️
in reply to Devine Lu Linvega • • •But where it gets really tricky is when you add control flow. In particular when you consider recursive function application. Basically, it means you need to be able to follow your path back through all jumps.
Devine Lu Linvega
in reply to WimⓂ️ • • •WimⓂ️
in reply to Devine Lu Linvega • • •But the way I see it: if it's not recursion, you can inline the function so no problem.
If it is a recursion across multiple functions, you can still inline until it becomes a single function.
If the recursion is a proper tail recursion, then all you need to keep track of is the total number of iterations.
So the only hard case is non-tail recursion, which you don't want in general anyway as it makes the stack explode.
Devine Lu Linvega
in reply to WimⓂ️ • • •WimⓂ️
in reply to WimⓂ️ • • •https://github.com/chessai/theseus
The paper is more detailed:
https://cs.indiana.edu/~sabry/papers/theseus.pdf
GitHub - chessai/theseus: theseus, functional programming language with fully reversible computation
GitHubDevine Lu Linvega
in reply to WimⓂ️ • • •⛧ esoterik ⛧
in reply to Devine Lu Linvega • • •nitrofurano
in reply to WimⓂ️ • • •Iligks Episode One - Theseus | テセウス by ASCII Cooperation - Play this MSX game online on File-Hunter.com!
File-Hunter.comDevine Lu Linvega
in reply to nitrofurano • • •WimⓂ️
in reply to Devine Lu Linvega • • •⛧ esoterik ⛧
in reply to Devine Lu Linvega • • •Andy Alderwick
in reply to Devine Lu Linvega • • •Devine Lu Linvega
Unknown parent • • •Niles Johnson
in reply to Devine Lu Linvega • • •in the [[arcades]]
in reply to Devine Lu Linvega • • •poetaster
in reply to Devine Lu Linvega • • •pindola
in reply to Devine Lu Linvega • • •Those formulas always apply:
(x^a) * (x^b) = x^(a+b)
x^(-a) = 1/(x^a)
(x^a)^b = x^(a*b)
so much so that it's basically just a notation thing, and not even something that requires proof. It's syntactic sugar, in a way.
But, yes, you can write them down as primes and cross out all the things that match.
(x^1)*(x^(-1)) = x^(1-1) = x^0 = 1
yay!