Logic Life Search

For scripts to aid with computation or simulation in cellular automata.
User avatar
muzik
Posts: 5652
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Logic Life Search

Post by muzik » March 25th, 2024, 7:08 am

Been trying to follow the wiki's instructions to get this to work, but I end up with this error:

Code: Select all

$ python lls -c -b 16 6 -s p3 x0 y1
Traceback (most recent call last):
  File "lls", line 7, in <module>
    import src.search_patterns
ImportError: No module named src.search_patterns

User avatar
confocaloid
Posts: 3066
Joined: February 8th, 2022, 3:15 pm

Re: Logic Life Search

Post by confocaloid » March 25th, 2024, 7:16 am

muzik wrote:
March 25th, 2024, 7:08 am

Code: Select all

$ python lls -c -b 16 6 -s p3 x0 y1
Traceback (most recent call last):
  File "lls", line 7, in <module>
    import src.search_patterns
ImportError: No module named src.search_patterns
Since you were able to run the main script with "python lls", the script lls must be in the current directory. Check whether there is a subdirectory 'src' and a file 'src/search_patterns.py' there. If not, probably the files were not unpacked completely.
127:1 B3/S234c User:Confocal/R (isotropic CA, incomplete)
Unlikely events happen.
My silence does not imply agreement, nor indifference. If I disagreed with something in the past, then please do not construe my silence as something that could change that.

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

Re: Logic Life Search

Post by muzik » March 25th, 2024, 7:18 am

confocaloid wrote:
March 25th, 2024, 7:16 am
Check whether there is a subdirectory 'src' and a file 'src/search_patterns.py' there.
Affirmative. I've also tested the other two example commands; the second (for Brain) gives the same error as the first. The third reports that ".python" is not a valid command, so I'm not sure if there's a typo at the wiki or if the python installation I'm using is somehow at fault.

User avatar
confocaloid
Posts: 3066
Joined: February 8th, 2022, 3:15 pm

Re: Logic Life Search

Post by confocaloid » March 25th, 2024, 7:32 am

The dot is a typo in the wiki tutorial - it should not be there.
Not sure about the cause of the first error. On my system I have "python3" for Python 3, and the modified invocation (python -> python3) worked

Code: Select all

# python3 lls -c -b 16 6 -s p3 x0 y1

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

Re: Logic Life Search

Post by dvgrn » March 25th, 2024, 9:33 am


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

Re: Logic Life Search

Post by muzik » March 25th, 2024, 1:32 pm

confocaloid wrote:
March 25th, 2024, 7:32 am
Not sure about the cause of the first error. On my system I have "python3" for Python 3, and the modified invocation (python -> python3) worked

Code: Select all

# python3 lls -c -b 16 6 -s p3 x0 y1
This did the trick. However, the second command on the page returns dart instead, which I don't think is right:

Code: Select all

$ python3 lls -c -b 17 12 -s p3 x0 y1 -s "D2|"
Getting search pattern...
Done

Preprocessing...
Done

Width: 19
Height: 14
Duration: 4

Number of undetermined cells: 315
Number of variables: 424
Number of clauses: 43364

x = 19, y = 14, rule = B3/S23
bbbbbbbbbbbbbbbbbbb$
bbbbbbbbbbbbbbbbbbb$
bbbbbbbbbbbbbbbbbbb$
bbbooboboboboboobbb$
bbobbbooobooobbbobb$
bbbobooboboboobobbb$
bbbboboobbboobobbbb$
bbbbbbbobbbobbbbbbb$
bbbbbbbbbbbbbbbbbbb$
bbbbbbbobbbobbbbbbb$
bbbbbbbbooobbbbbbbb$
bbbbbbbbooobbbbbbbb$
bbbbbbbbbbbbbbbbbbb$
bbbbbbbbbbbbbbbbbbb!


Total solver time: 6.353018522262573
The command I used is clearly the same as the one on the wiki, minus the python3 detail - did I do something wrong?

The third command works as expected.

User avatar
confocaloid
Posts: 3066
Joined: February 8th, 2022, 3:15 pm

Re: Logic Life Search

Post by confocaloid » March 25th, 2024, 1:50 pm

muzik wrote:
March 25th, 2024, 1:32 pm
However, the second command on the page returns dart instead, which I don't think is right:
IIRC LLS traverses search space in different order on different invocations, and also depending on which SAT solver is used behind the scenes. If both spaceships are small enough to be solutions, either of them may be returned.

You can try running with "-n" to find all solutions (in some order, which again may be different for different invocations):

Code: Select all

# python3 lls -c -b 17 12 -s p3 x0 y1 -s "D2|" -n
Note though that in this case, for every found object, it will find every phase of every translation that fits in the bounds and print as a separate solution.

Edit: you can instead require that the population in first phase be equal to 62:

Code: Select all

#C found using LLS/kissat with:
#C python3 lls -c -b 17 12 -s p3 x0 y1 -s "D2|" -p "=62"
#C Total solver time: 140.29749941825867
x = 19, y = 14, rule = B3/S23
bbbbbbbbbbbbbbbbbbb$
bbbbbbbooboobbbbbbb$
booobobbbbbbbobooob$
bbbbbbbbobobbbbbbbb$
bbbobbobobobobbobbb$
bbbooboboboboboobbb$
bbbbbbobobobobbbbbb$
bbbbbobbobobbobbbbb$
bobobbbooboobbbobob$
bobbboobbbbboobbbob$
bbooboobbbbbooboobb$
bboobbbbbbbbbbboobb$
bbbbbbbbbbbbbbbbbbb$
bbbbbbbbbbbbbbbbbbb!
Or less than 35:

Code: Select all

#C found using LLS/kissat with:
#C python3 lls -c -b 17 12 -s p3 x0 y1 -s "D2|" -p "<35"
#C Total solver time: 309.99119544029236
x = 19, y = 14, rule = B3/S23
bbbbbbbbbbbbbbbbbbb$
bbbobooboboboobobbb$
bbobbbbbobobbbbbobb$
bbboobbbobobbboobbb$
bbbbobbbobobbbobbbb$
bbbbbboobbboobbbbbb$
bbbbbbbbbbbbbbbbbbb$
bbbbbbbbooobbbbbbbb$
bbbbbbbobbbobbbbbbb$
bbbbbbbbobobbbbbbbb$
bbbbbbbbbobbbbbbbbb$
bbbbbbbbbbbbbbbbbbb$
bbbbbbbbbbbbbbbbbbb$
bbbbbbbbbbbbbbbbbbb!
127:1 B3/S234c User:Confocal/R (isotropic CA, incomplete)
Unlikely events happen.
My silence does not imply agreement, nor indifference. If I disagreed with something in the past, then please do not construe my silence as something that could change that.

Post Reply