80 likes | 157 Views
Register Machines ≤ Factor Replacement Systems. Chris Ellis Bruce Meeks, Jr. Register Machines. Natural numbers stored in finite set of registers (result in n th register) Finite length programs of instructions labeled 1 to m Two types of instructions:
E N D
Register Machines ≤Factor Replacement Systems Chris Ellis Bruce Meeks, Jr.
Register Machines • Natural numbers stored in finite set of registers (result in nth register) • Finite length programs of instructions labeled 1 to m • Two types of instructions: • INCr [i] : Increment value of register r by 1, jump to instruction 1 • DECr[p,z] : If register r > 0, decrement by 1 and jump to p, otherwise jump to z
Factor Replacement Systems • Single natural number x used for information storage (multiple values encoded as exponents of prime numbers, result stored as exponent of 2) • “Instructions” stored as list of rational numbers a/b • First fraction a/b for which x is divisible by b is multiplied by x, which replaces the value of x by xa/b
RM ≤ FRS • Show that RMs are no more powerful than FRS • Encode state of RM as natural number • Simulate behavior of RM by FRS
Encoding RM State as FRS State • Convert value of all registers to a single natural number (prime factorization) • <r0, r1, r2, … , rn > p1r0p2r1p3r2…pnrn • Maintain one prime per RM instruction • Instruction 1,2,…,m pn+1,pn+2,…,pn+m • Keep one last prime to represent halt state • pn+m+1
Simulating Behavior of RM • For each instruction 1 ≤ j ≤ m • If j is an INC instruction (j. INCk[l]) • Add FRS rule pn+jx pn+lpkx • If j is a DEC instruction (j. DECk[p,z]) • Add FRS rule pn+jpkx pn+px • Add FRS rule pn+jx pn+zx • Clean-up rules 0 ≤ i ≤ n-1 • pn+m+1pix pn+m+1x • Finally • pn+m+1x x
Example – Limited Subtraction • Register Machine • r2 r1 – r2, if r1 ≥ r2; 0, otherwise • Factor Replacement System • Input: 3x5y • Output: 2z where z = x – y, if x ≥ y; 0, otherwise
Example – Limited Subtraction Associated Primes 7 11 13 17 19 • DEC2[2,3] • INC1[1] • DEC3[4,5] • DEC1[3,3] 3*7x 11x 7x 13x 11x 2*7x 5*13x 17x 13x 19x 2*17x 13x 17x 13x