ConwayLife.com - A community for Conway's Game of Life and related cellular automata
Home  •  LifeWiki  •  Forums  •  Download Golly

Making a python version of Gfind

For scripts to aid with computation or simulation in cellular automata.

Making a python version of Gfind

Postby googleplex » February 20th, 2018, 2:14 pm

I would like to make a python version of Gfind so that people can run gfind without using a c compiler.
The source code can be found here.
The Paper describing how it works can be found here.

I think we should write pseudocode and then I can port it to python.
Look at me! I make patterns in golly and go on the forums! I wanna be Famous!
googleplex
 
Posts: 203
Joined: January 24th, 2018, 4:36 pm

Re: Making a python version of Gfind

Postby Macbi » February 20th, 2018, 3:49 pm

I suspect that this program would run very slowly, because Python is generally slower than C (being an interpreted language rather than a compiled one).

I got away with writing LLS in Python because all the actual work is done by the SAT solver; which is written in C.
User avatar
Macbi
 
Posts: 506
Joined: March 29th, 2009, 4:58 am

Re: Making a python version of Gfind

Postby googleplex » February 20th, 2018, 4:43 pm

Yes, but this would be easier to use. No installing Cygwin, just using golly.
Look at me! I make patterns in golly and go on the forums! I wanna be Famous!
googleplex
 
Posts: 203
Joined: January 24th, 2018, 4:36 pm

Re: Making a python version of Gfind

Postby dvgrn » February 20th, 2018, 5:25 pm

googleplex wrote:Yes, but this would be easier to use. No installing Cygwin, just using golly.

"Just using Golly" in this case would technically also involve installing Python. These days a script most likely to Just Work for everybody should really be written in Lua instead.

This has always been a difficult dividing line -- basically between people who think that compiling these C/C++ search utilities is trivial, and those who find it to be a very high and mysterious barrier.

As Macbi mentions, the problem is that a Lua or Python script will be only maybe one-tenth as fast as the equivalent compiled C code. What this seems to mean in practice is that for anything interesting that can be found by running a hypothetical gfind script, the odds are very high that it has already been found long ago by someone running a compiled executable.

googleplex wrote:...I think we should write pseudocode and then I can port it to python.

Given the size and complexity of the gfind utility, it doesn't seem as if any possible pseudocode is likely to end up being any easier to understand -- or less buggy -- than the C code that already exists. Might as well start porting to Python or Lua right away, if that still seems like a good idea.
User avatar
dvgrn
Moderator
 
Posts: 4977
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI

Re: Making a python version of Gfind

Postby Sokwe » February 20th, 2018, 5:59 pm

As one of the very few people with an in-depth understanding of the gfind source code, I can say that this would be a lot of work, and probably not worth the effort.

I would rather help guide people through installing a c compiler. There are other utilities besides gfind that are written in c (e.g. knight2, knightt, zfind, qfind). Learning to compile c programs will allow users to make use of a much broader spectrum of search programs.
-Matthias Merzenich
Sokwe
Moderator
 
Posts: 1334
Joined: July 9th, 2009, 2:44 pm

Re: Making a python version of Gfind

Postby AforAmpere » February 24th, 2018, 12:11 pm

Is it possible that this idea could be adapted to search for ships in LTL? There are no spaceship searching scripts for LTL that don't involve soup searching, and it would be cool to see one that implemented similar methods to the "find" programs. Golly might help, as it has LTL built in.
Things to work on:
- Find a (7,1)c/8 ship in a Non-totalistic rule (someone please search the rules)
- Find a C/10 in JustFriends
- Find a C/10 in Day and Night
AforAmpere
 
Posts: 758
Joined: July 1st, 2016, 3:58 pm

Re: Making a python version of Gfind

Postby markus_z » May 14th, 2018, 4:08 am

Dev C++ portable compiles gfind and gfind-pt easily in Windows. No installation required.
markus_z
 
Posts: 3
Joined: May 6th, 2018, 3:07 pm


Return to Scripts

Who is online

Users browsing this forum: No registered users and 1 guest