Universal construction of complex patterns from 1 cell

For discussion of other cellular automata.
User avatar
blah
Posts: 311
Joined: April 9th, 2016, 7:22 pm

Universal construction of complex patterns from 1 cell

Post by blah » September 11th, 2017, 9:32 am

There are a lot of RuleLoader rules (proof somewhere here). If we take the binary logarithm of the amount of rules, we can basically conclude, though simplified, that we can encode 4 billion terabytes of information in one rule. We can thus have a significant ROM built into the ruletable itself.

Say you have a cell, O (for origin), which is a cell of state 1 surrounded by state 0. Counter cells then appear around the cell, which then count up through all their possible combinations, thus meaning that O is exposed to countless neighbourhood conditions. Each condition could make O take a certain state, which would have the effect of reading a ROM to the outside world.

As such, it is possible to build a 1-cell constructor for basically any arbitrary pattern. Here's one I prepared earlier (this is a rule):
monalisa.txt.zip
(169.04 KiB) Downloaded 372 times
Run it with this pattern:

Code: Select all

x = 1, y = 1, rule = BLAHMONALISA
A!
Does anyone find this idea interesting or useful? I don't know if it really has any significant implications; I guess it might be nice as an example pattern in Golly, though there is plenty of room for optimisation, including an idea I had that would probably make it twice as fast. Also, please tell me if this idea has been discussed before.
succ

User avatar
Saka
Posts: 3627
Joined: June 19th, 2015, 8:50 pm
Location: Indonesia
Contact:

Re: Universal construction of complex patterns from 1 cell

Post by Saka » September 11th, 2017, 9:42 am

I have been thinking about this since starting to learn RuleLoader, but as the person that I am, I'm too lazy to make these :P

Do you have a script or something to make these?

User avatar
blah
Posts: 311
Joined: April 9th, 2016, 7:22 pm

Re: Universal construction of complex patterns from 1 cell

Post by blah » September 11th, 2017, 9:48 am

Saka wrote:I have been thinking about this since starting to learn RuleLoader, but as the person that I am, I'm too lazy to make these :P
So you came up with the idea of generating complex patterns from a single cell using counters, or are you speaking more generally?
Saka wrote:Do you have a script or something to make these?
I wrote a program in C++ to take an XPM and convert it to a set of transitions, and prepend the rule file itself to it, thus generating the version of the rule with the ROM of the picture built into it.
succ

User avatar
Saka
Posts: 3627
Joined: June 19th, 2015, 8:50 pm
Location: Indonesia
Contact:

Re: Universal construction of complex patterns from 1 cell

Post by Saka » September 11th, 2017, 9:50 am

blah wrote:
Saka wrote:I have been thinking about this since starting to learn RuleLoader, but as the person that I am, I'm too lazy to make these :P
So you came up with the idea of generating complex patterns from a single cell using counters, or are you speaking more generally?
I was thinking of generating a painting with cell-specific instructions and stuff, starting from 1 cell.
blah wrote:
Saka wrote:Do you have a script or something to make these?
I wrote a program in C++ to take an XPM and convert it to a set of transitions, and prepend the rule file itself to it, thus generating the version of the rule with the ROM of the picture built into it.
Please share!

User avatar
blah
Posts: 311
Joined: April 9th, 2016, 7:22 pm

Re: Universal construction of complex patterns from 1 cell

Post by blah » September 11th, 2017, 9:58 am

Saka wrote:Please share!
Sadly, it requires quite a bit of minimal configuration and tweaking, and it would take a while to explain, so I might as well spend that effort writing a program which is simpler to use rather than explaining how to use the hacked-together .c++ file that I wrote over the course of ~5 hours. Plus, unless you want to make a two-colour image, you'd have to manually write all the colours down; that's what I did with the mona lisa.
Saka wrote:I was thinking of generating a painting with cell-specific instructions and stuff, starting from 1 cell.
How detailed was that idea? Did you image it having a stationary core that all the signals came out of, like my implementation?
succ

User avatar
Saka
Posts: 3627
Joined: June 19th, 2015, 8:50 pm
Location: Indonesia
Contact:

Re: Universal construction of complex patterns from 1 cell

Post by Saka » September 11th, 2017, 10:04 am

blah wrote:
Saka wrote:Please share!
Sadly, it requires quite a bit of minimal configuration and tweaking, and it would take a while to explain, so I might as well spend that effort writing a program which is simpler to use rather than explaining how to use the hacked-together .c++ file that I wrote over the course of ~5 hours. Plus, unless you want to make a two-colour image, you'd have to manually write all the colours down; that's what I did with the mona lisa.
What a shame (No sarcasm)
blah wrote:
Saka wrote:I was thinking of generating a painting with cell-specific instructions and stuff, starting from 1 cell.
How detailed was that idea? Did you image it having a stationary core that all the signals came out of, like my implementation?
Just finished writing a very simple implementation of it:

Code: Select all

@RULE SAKASMILEY

#State 1 is the drawing state, so do state 2
@TABLE
n_states:14
neighborhood:vonNeumann
symmetries:none
#State 2
2,0,0,0,0,1
0,0,0,0,2,3
#State 3
0,0,0,0,3,4
3,0,0,0,1,0
#State 4
0,0,0,0,4,5
4,0,0,0,0,0
#State 5
5,0,0,0,0,1
0,5,0,0,0,6
#State 6
6,1,0,0,0,0
0,6,0,0,0,7
#State 7
7,0,0,0,0,1
0,0,7,0,0,8
#State 8
8,0,1,0,0,0
0,0,8,0,0,9
#State 9
9,0,0,0,0,0
0,0,9,0,0,10
#State 10
10,0,0,0,0,1
0,10,0,0,0,11
#State 11
11,1,0,0,0,0
0,0,0,0,11,12
#State 12
12,0,0,0,0,1
0,0,0,0,12,13
#State 13
13,0,0,0,1,1
This:

Code: Select all

x = 1, y = 1, rule = SAKASMILEY
B!

User avatar
muzik
Posts: 5612
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Universal construction of complex patterns from 1 cell

Post by muzik » September 11th, 2017, 10:55 am

Could a concept similar to this be used to make a 1-cell spaceship of any speed up to (m,n)c/256, assuming said speed is possible in the given neighbourhood?

User avatar
blah
Posts: 311
Joined: April 9th, 2016, 7:22 pm

Re: Universal construction of complex patterns from 1 cell

Post by blah » September 11th, 2017, 12:06 pm

muzik wrote:Could a concept similar to this be used to make a 1-cell spaceship of any speed up to (m,n)c/256, assuming said speed is possible in the given neighbourhood?
It would be relatively simple to make a rule which allows (m,n)c/p spaceships for allowable values of m,n, and p, but what do you mean "up to (m,n)c/256"? Why would 2^8 be the limit?
succ

User avatar
muzik
Posts: 5612
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Universal construction of complex patterns from 1 cell

Post by muzik » September 11th, 2017, 12:14 pm

Well, that would be the limit were the ship to stay as a single cell forever. If that wasn't the case, i'm pretty sure the range of speeds would be a lot higher.

User avatar
blah
Posts: 311
Joined: April 9th, 2016, 7:22 pm

Re: Universal construction of complex patterns from 1 cell

Post by blah » September 11th, 2017, 12:22 pm

muzik wrote:Well, that would be the limit were the ship to stay as a single cell forever. If that wasn't the case, i'm pretty sure the range of speeds would be a lot higher.
Well, I thought you meant the ship would only have to be a single cell in at least one phase. Otherwise you're not talking about my idea; that would be something unrelated. To be fair, I guess you did say "a concept similar to this".

Either way, there are only a finite number of RuleLoader rules. Therefore, there are only a finite number of one-cell speeds, though they can probably get pretty slow; I can imagine someone making a rule where a single cell creates a computer which computes graham's number and writes it in binary and counts up to it and moves one cell or something; something that you could never run in its entirety.
succ

User avatar
dvgrn
Moderator
Posts: 10610
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Universal construction of complex patterns from 1 cell

Post by dvgrn » September 13th, 2017, 3:13 pm

blah wrote:Does anyone find this idea interesting or useful? I don't know if it really has any significant implications; I guess it might be nice as an example pattern in Golly, though there is plenty of room for optimisation, including an idea I had that would probably make it twice as fast.
Interesting, definitely. Useful -- that's always a loaded word. It's useful as a way to teach people how to creatively misuse rule-table format, if nothing else...!

The rule table is big enough that I'd like to add a ZIP file, ironically enough, to Very Large Patterns in Golly's online archives. It will be the smallest Very Large Pattern ever, unless you can figure out how to pull a similar trick starting from empty space.

(It seems obviously impossible, since in a normal universe there's no way to pick a cell to start from. But maybe it's possible to work in from the corners of a non-torus bounded grid somehow, by taking advantage of the different number of neighbors at a corner...?)

(Well, no, never mind -- I think cells outside the border are still counted, they're just always OFF.)

(So it would have to be a non-torus bounded grid multistate B0-type rule...)

Anyway -- should I wait for a twice-as-fast version of the Mona Lisa Rule, or just go ahead and collect this version to check in?

User avatar
blah
Posts: 311
Joined: April 9th, 2016, 7:22 pm

Re: Universal construction of complex patterns from 1 cell

Post by blah » September 13th, 2017, 5:09 pm

dvgrn wrote:Anyway -- should I wait for a twice-as-fast version of the Mona Lisa Rule, or just go ahead and collect this version to check in?
I've thought about it, and my twice-as-fast idea contradicts itself (it required stopping the arm when it would already be at c), but I could probably make one where the horizontal arms extrude at c/2 instead of c/3 by sending "start" and "stop" signals to the arm at c. Either way, I don't really feel like going back and optimising it; there's a certain point where further optimisation is just boring, and I think I've reached that, although I did generate this interesting image while trying to remove redundant transitions:
accidentalderivativeart.png
accidentalderivativeart.png (49.68 KiB) Viewed 13379 times
Anyway, yeah, you should use the rule as it is rather than waiting.

(Doesn't Golly have a bug where on an unbounded grid, running a RuleLoader rule with b0 results in exponentially bigger squares? Maybe you could make something happen at one of the corners. Bounded grids would probably be easier to use, though; just make everything go from state 0 straight to some other state. I'll try that.)

(Golly just crashed, and I misspelled it "Folly" when I wrote that, so maybe this is a bad idea.)
succ

User avatar
dvgrn
Moderator
Posts: 10610
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Universal construction of complex patterns from 1 cell

Post by dvgrn » September 19th, 2017, 9:09 pm

Just a minor note, now that I've built the attached file anyway:

In cases where you're making a ZIP file of rule text that goes with a particular pattern, it might as well be in the following form. That way when you File > Open the archive directly in Golly, the rule gets installed automatically and the pattern opens, all in one swell foop.
monalisa.zip
Trivial one-cell pattern and Mona-Lisa-making rule in one super convenient package
(159.19 KiB) Downloaded 296 times

User avatar
gameoflifemaniac
Posts: 1242
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Universal construction of complex patterns from 1 cell

Post by gameoflifemaniac » September 20th, 2017, 10:30 am

How about a rule that prints ITSELF?
I was so socially awkward in the past and it will haunt me for the rest of my life.

Code: Select all

b4o25bo$o29bo$b3o3b3o2bob2o2bob2o2bo3bobo$4bobo3bob2o2bob2o2bobo3bobo$
4bobo3bobo5bo5bo3bobo$o3bobo3bobo5bo6b4o$b3o3b3o2bo5bo9bobo$24b4o!

User avatar
blah
Posts: 311
Joined: April 9th, 2016, 7:22 pm

Re: Universal construction of complex patterns from 1 cell

Post by blah » September 20th, 2017, 11:35 am

gameoflifemaniac wrote:How about a rule that prints ITSELF?
If we just imagine it's a binary format corresponding to the .rule file, it probably exists.

I guess you'd have to have the ROM output into a tape that stores all the states O has taken, in addition to having that ROM be used to construct a computer. The computer would then be programmed to print the beginning of the .rule, and then it would go through the history of O's states and construct a set of transitions out of that.

Kind of like a Von Neumann machine, but the instruction tape would come first, and the computer would kind of be built by it. Also it wouldn't be a direct replicator, just a quine.

Maybe there's a simpler way to do that.
succ

User avatar
Andrew
Moderator
Posts: 919
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Universal construction of complex patterns from 1 cell

Post by Andrew » September 20th, 2017, 6:19 pm

dvgrn wrote:In cases where you're making a ZIP file of rule text that goes with a particular pattern, it might as well be in the following form. ...
A minor annoyance with this approach is that it opens the Help window. It's easy to avoid that by creating a zip file with a single Lua script that writes the .rule file in the right place and then writes and opens a temporary pattern file. The script's general structure looks like this:

Code: Select all

local g = golly()
rulename = g.getdir("rules").."BLAHMONALISA.rule"
f = io.open(rulename, "w")
if f then
    f:write(
[[
@RULE BLAHMONALISA

etc...

]]
    )
    f:close()
end

pattname = g.getdir("temp").."monalisa.rle"
f = io.open(pattname, "w")
if f then
    f:write(
[[
x = 1, y = 1, rule = BLAHMONALISA
A!
]]
    )
    f:close()
end
g.open(pattname)
g.show("Rule file was created: "..rulename)
Here's the resulting zip file:
Attachments
monalisa2.zip
(169.66 KiB) Downloaded 264 times
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

User avatar
Apple Bottom
Posts: 1034
Joined: July 27th, 2015, 2:06 pm
Contact:

Re: Universal construction of complex patterns from 1 cell

Post by Apple Bottom » September 20th, 2017, 6:22 pm

Andrew wrote:A minor annoyance with this approach is that it opens the Help window. It's easy to avoid that by creating a zip file with a single Lua script that writes the .rule file in the right place and then writes and opens a temporary pattern file.
I'd say that's not a bug but a feature -- I liked it that Golly informed me that it had installed a new rule earlier, when I tried dvgrn's ZIP file. I usually would expect that merely *opening* a file (a pattern, even if it is in ZIP form and comes with a custom rule) is a stateless action that leaves Golly unchanged when you close the file again, so I was quite happy that Golly informed me that an enduring change had indeed been made.
If you speak, your speech must be better than your silence would have been. — Arabian proverb

Catagolue: Apple Bottom • Life Wiki: Apple Bottom • Twitter: @_AppleBottom_

Proud member of the Pattern Raiders!

User avatar
Andrew
Moderator
Posts: 919
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Universal construction of complex patterns from 1 cell

Post by Andrew » September 20th, 2017, 6:32 pm

Apple Bottom wrote:I liked it that Golly informed me that it had installed a new rule earlier, when I tried dvgrn's ZIP file.
Well, it would be trivial to add a g.note call to my version stating that a .rule file has been created. That would be even more informative than Dave's version, given that the Help window is opened behind the main window and you have to bring it to the front to see what it says.

EDIT: A g.show call at the very end of the script would be better than g.note. That's a nicer compromise for people like me who don't want to see any sort of window or dialog appear and people like AB who'd like to be notified that a .rule file was created. I've updated the above zip file to call g.show.
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

User avatar
blah
Posts: 311
Joined: April 9th, 2016, 7:22 pm

Re: Universal construction of complex patterns from 1 cell

Post by blah » January 25th, 2018, 10:12 am

blah wrote:
Saka wrote:Please share!
Sadly, it requires quite a bit of minimal configuration and tweaking, and it would take a while to explain, so I might as well spend that effort writing a program which is simpler to use rather than explaining how to use the hacked-together .c++ file that I wrote over the course of ~5 hours.
I did this. I recently decided to go back to this project and work on my hacked-together .c++ file, and now it can take arbitary xpm images as input (with some restrictions, detailed in the source code).

I modified the rule to make the arm destroy itself once it has finished generating the picture, thus removing the ugly arm that used to stay there. The background is completely black now, instead of grey. I made it skip redundant transitions, so it seems to run faster now.

Here's the new faster, smaller, better mona lisa rule:
BLAHMONALISA2.txt.zip
(115.36 KiB) Downloaded 263 times
And dvgrn, where did you even put the older one? You mentioned putting it in a pattern collection, but I've never seen it in any of the collections I could find.

Also, over the course of this project I've seen a large amount of weird, distorted mona lisas. I like this one in particular:
you're tearing me apart
you're tearing me apart
man.png (32.32 KiB) Viewed 12455 times
I have no idea what happened there.

Here's the c++ code along with a random xpm file that I prepared earlier. The sufficiently motivated reader could follow the instructions and hope I didn't forget something:
xpm2rule.zip
(29.64 KiB) Downloaded 241 times
succ

User avatar
dvgrn
Moderator
Posts: 10610
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Universal construction of complex patterns from 1 cell

Post by dvgrn » January 25th, 2018, 11:43 am

blah wrote:... dvgrn, where did you even put the older one? You mentioned putting it in a pattern collection, but I've never seen it in any of the collections I could find.
You're right, that checkin is still in the works. Mona Lisa has been added to a big pile of patterns that belong in Help > Online Archives > Very Large Patterns.

Unfortunately many of those patterns need minor adjustments and better comments and so on, before they're checked in. That project always seems to end up at the low end of the priority list -- because it can be done any time, so it doesn't benefit from the, um, productive panic associated with imminent Golly releases.

Thanks for the reminder, and the update -- now we might as well check in the latest and greatest.

Your rule file has a .txt extension again for some reason, so people can't try this new version without going through multiple steps -- at minimum it's extract, open in text editor, Ctrl+C, then in Golly Ctrl+Shift+O, but that's only if they know that that works. Some people may end up doing extract, rename to .rule, move to Rules folder, Control > Set Rule in Golly, draw a dot. All very awkward.

Why not just post in a usable form in the first place? I might get more good stuff checked in to Very Large Patterns quicker that way. Here's a version that Just Works:
Mona-Lisa-from-one-cell-by-blah.zip
Lua script ZIP archive following Andrew's packaging suggestion
(113.67 KiB) Downloaded 214 times

User avatar
otismo
Posts: 1201
Joined: August 18th, 2010, 1:41 pm
Location: Florida
Contact:

Re: Universal construction of complex patterns from 1 cell

Post by otismo » December 7th, 2019, 10:00 pm

wo!
did I just witness the Big Bang, again, or what ?
did I just witness the Big Bang, again, or what ?
mo.png (191.58 KiB) Viewed 7020 times
"One picture is worth 1000 words; but one thousand words, carefully crafted, can paint an infinite number of pictures."
- autonomic writing
forFUN : http://viropet.com
Art Gallery : http://cgolart.com
Video WebSite : http://conway.life

User avatar
Moosey
Posts: 4306
Joined: January 27th, 2019, 5:54 pm
Location: here
Contact:

Re: Universal construction of complex patterns from 1 cell

Post by Moosey » December 8th, 2019, 9:29 am

gameoflifemaniac wrote:
September 20th, 2017, 10:30 am
How about a rule that prints ITSELF?
I'll raise you basically every rule:
How about a rule that prints every possible 10^100 x 10^100 patterns?
like this but a ruletable
not active here but active on discord

User avatar
otismo
Posts: 1201
Joined: August 18th, 2010, 1:41 pm
Location: Florida
Contact:

Re: Universal construction of complex patterns from 1 cell

Post by otismo » December 8th, 2019, 6:23 pm

um... ( still trying to digest it all )

guys...I know this is probably the wrong place to ask

but how about a script that makes the one-cell-printer from a selection ?

and THEN

make a multi-colored bitmap paste-enabled GOLLY

( just kidding... )

P.S. do we have enuf room ? is 4 billion terabytes enuf ?

Can U imagine people seeing this for the very first time on their Impossibly Large Screen TVs ( HDMI Plug N Play ) ?
"One picture is worth 1000 words; but one thousand words, carefully crafted, can paint an infinite number of pictures."
- autonomic writing
forFUN : http://viropet.com
Art Gallery : http://cgolart.com
Video WebSite : http://conway.life

User avatar
dvgrn
Moderator
Posts: 10610
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Universal construction of complex patterns from 1 cell

Post by dvgrn » December 8th, 2019, 9:43 pm

otismo wrote:
December 8th, 2019, 6:23 pm
I know this is probably the wrong place to ask

but how about a script that makes the one-cell-printer from a selection ?
See xpm2rule.zip, five posts up. If you want it in Python or Lua, it doesn't look too difficult to port it over.

-- Not that I'm volunteering. Instead, I'm finally putting a version of the one-cell Mona Lisa generator, with some comments added to the Lua-generated one-cell pattern file, into the online Very Large Pattern collection. This pattern cleanup/checkin stuff must be a task that I really, really prefer to avoid.

Hooloovoo
Posts: 38
Joined: July 11th, 2015, 8:59 pm

Re: Universal construction of complex patterns from 1 cell

Post by Hooloovoo » December 8th, 2019, 10:54 pm

Andrew wrote:
September 20th, 2017, 6:19 pm
A minor annoyance with this approach is that it opens the Help window. It's easy to avoid that by creating a zip file with a single Lua script that writes the .rule file in the right place and then writes and opens a temporary pattern file.is:

Code: Select all

snip
I have two questions about this:
Is this approach portable to platforms like Android or iOS? If a pattern makes it into Very Large Patterns, it probably should be.
Does golly automatically run lua code from a zip file, without asking the user? Installing a rule is one thing, but silently executing code is another.

EDIT: I see that it asks the user before executing, which is good.

Post Reply