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

Lifelib bugs

Has something gone haywire? Let us know about it!

Lifelib bugs

Postby Freywa » April 2nd, 2019, 1:21 am

Most likely due to a parsing error, the following does not work in Lifelib (the most recent version, 2.2.5):
lifelib.load_rules("LifeHistory")

But it should work, and I should be able to fire up LifeViewer for LifeHistory patterns in a Jupyter notebook and run them exactly like on the forums:
x = 84, y = 50, rule = LifeHistory
20.B$20.B$20.B$20.B$3.D.3D.D7.D.3D2.D8.D.3D4.D$3.D2.D2.D7.D2.D2.D.D7.
D2.D5.D$3.D2.D2.D7.D2.D2.D.D7.D2.D2.2D.D$3.D2.D2.D7.D2.D2.D.D7.D2.D5.
D12.D10.3D$3.D2.D2.D7.D2.D3.D8.D2.D5.D13.D9.D8.D5.D$20.B33.3D10.D6.3D
4.D$20.B52.D.D.D.5D$5.A14.A54.D5.D$6.2A12.BA11.A.A17.2D.3D4.D2.D.D3.D
2.D5.D$5.AC12.ACA12.CA16.D3.D6.2D.D.D.D.D2.D$20.B13.A18.D2.3D4.D.2D.D
.D.D$20.B33.D.D6.D2.D.D.D.D2.D$20.B31.2D2.3D2.D.D2.D2.D.D3.D$20.B39.D
14.D$20.B52.D.D.D.5D$20.B53.3D$2.D2.3D.D6.D2.3D2.D7.D2.3D4.D32.D$.D.D
2.D2.D5.D.D2.D2.D.D5.D.D2.D5.D$.D.D2.D2.D5.D.D2.D2.D.D5.D.D2.D2.2D.D$
.D.D2.D2.D5.D.D2.D2.D.D5.D.D2.D5.D$2.D3.D2.D6.D3.D3.D7.D3.D5.D$20.B$
20.B$5.A14.A$6.CA12.DA11.ADA$5.2A12.3A12.2A$20.B13.A23.D9.3D$20.B36.D
12.D4.D$20.B36.3D9.D4.3D$20.B52.D.D.D.5D$20.B54.D$20.B33.2D.D3.D3.D2.
D.3D2.D$3.D.3D.D7.D.3D2.D8.D.3D4.D10.D3.D.D.D3.2D.D.D4.D$3.D2.D2.D7.D
2.D2.D.D7.D2.D5.D11.D2.D.D.D3.D.2D.3D$2D.D2.D2.D4.2D.D2.D2.D.D4.2D.D
2.D2.2D.D12.D.D.D.D3.D2.D.D4.D$3.D2.D2.D7.D2.D2.D.D7.D2.D5.D10.2D3.D.
D2.D.D2.D.3D2.D5.D$3.D2.D2.D7.D2.D3.D8.D2.D5.D19.D12.D5.D$20.B52.D.D.
D.5D$20.B53.3D4.D$5.AD13.C13.D40.D5.D$6.2A13.A11.A.A$5.2A12.3A12.2A$
20.B13.A$20.B$20.B$20.B!
Last edited by Freywa on April 7th, 2019, 11:37 pm, edited 1 time in total.
Princess of Science, Parcly Taxel
User avatar
Freywa
 
Posts: 580
Joined: June 23rd, 2011, 3:20 am
Location: Singapore

Re: Lifelib and LifeHistory

Postby calcyman » April 2nd, 2019, 5:56 am

Thanks for the bug report. Both issues are fixed in version 2.2.7:

  • The load_rules() function accepts History versions of rulestrings (even though the behaviour is identical to omitting the History);
  • RLEs are saved with Golly's state numbering instead of lifelib's internal state numbering;
  • 'Life' is accepted as a synonym for 'b3s23'.
What do you do with ill crystallographers? Take them to the mono-clinic!
User avatar
calcyman
 
Posts: 2089
Joined: June 1st, 2009, 4:32 pm

Re: Lifelib bugs

Postby Freywa » April 8th, 2019, 1:31 am

lifelib's pattern-matching functionality fails at some points of the Life plane. As an example, the last line of this code evaluates to False in v2.2.7 instead of the expected True:
import lifelib
lt = lifelib.load_rules("b3s23").lifetree()
a = lt.pattern("bo$2bo$3o5$5bobo$6b2o$6bo")
b = lt.pattern("bo$2bo$3o")
a(-10, -16).match(b).nonempty()

even through a clearly contains b as shown below:
x = 17, y = 19, rule = B3/S23
12bo$12bo$3b3o6bob2o$2bo3bo5b2o2bo$2bo3bo5bo3bo$2bo2b2o5b2o2bo$3b2obo
5bob2o3$bo8bo3bo$2bo12bo$3o7bo2b3o2$10bo2$10bo$5bobo$6b2o2bo$6bo!

If the -10 and -16 above were both 0, True would be returned correctly. I discovered this bug when testing out my new glider synthesis database, Shinjuku, which relies on lifelib for finding and manipulating gliders.

Edit: With -200 <= x, y <= 200 the match fails if (-10, -16) above is replaced with (x, y) and cell (x, y) below is state 4 (the origin is the state-1 cell):
x = 249, y = 247, rule = LifeHistory
249D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$
D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D63.
121D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.
D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D
63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D31.57D$D63.
D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D
63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$
D63.D31.D$D63.D31.D15.25D$D63.D31.D15.D$D63.D31.D15.D$D63.D31.D15.D$D
63.D31.D15.D$D63.D31.D15.D$D63.D31.D15.D$D63.D31.D15.D$D63.D31.D15.D$
D63.D31.D15.D$D63.D31.D15.D$D63.D31.D15.D$D63.D31.D15.D$D63.D31.D15.D
$D63.D31.D15.D$D63.D31.D15.D$D63.D31.D15.D15.A$D63.D31.D15.D$D63.D31.
D15.D$D63.D31.D15.D$D63.D31.D15.D$D63.D31.D15.D$D63.D31.D15.D$D63.D
31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.
D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D
63.D31.D$D63.D31.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D
63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.
D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D
63.D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$
D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D!
Princess of Science, Parcly Taxel
User avatar
Freywa
 
Posts: 580
Joined: June 23rd, 2011, 3:20 am
Location: Singapore

Re: Lifelib bugs

Postby calcyman » April 8th, 2019, 9:31 am

Freywa wrote:Edit: With -200 <= x, y <= 200 the match fails if (-10, -16) above is replaced with (x, y) and cell (x, y) below is state 4 (the origin is the state-1 cell):
x = 249, y = 247, rule = LifeHistory
249D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$
D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D63.
121D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.
D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D
63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D31.57D$D63.
D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D
63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$
D63.D31.D$D63.D31.D15.25D$D63.D31.D15.D$D63.D31.D15.D$D63.D31.D15.D$D
63.D31.D15.D$D63.D31.D15.D$D63.D31.D15.D$D63.D31.D15.D$D63.D31.D15.D$
D63.D31.D15.D$D63.D31.D15.D$D63.D31.D15.D$D63.D31.D15.D$D63.D31.D15.D
$D63.D31.D15.D$D63.D31.D15.D$D63.D31.D15.D15.A$D63.D31.D15.D$D63.D31.
D15.D$D63.D31.D15.D$D63.D31.D15.D$D63.D31.D15.D$D63.D31.D15.D$D63.D
31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.
D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D63.D31.D$D
63.D31.D$D63.D31.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D
63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.
D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D63.D$D
63.D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$
D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D$D!


Thank you very much! That diagram made it clear what the problem was -- I hadn't increased the universe size enough in the pattern_match() function. Another call to pyramid_up() was sufficient to resolve the bug:

https://gitlab.com/apgoucher/lifelib/co ... a225b49d4a

This is fixed in v2.2.10 on PyPI.
What do you do with ill crystallographers? Take them to the mono-clinic!
User avatar
calcyman
 
Posts: 2089
Joined: June 1st, 2009, 4:32 pm


Return to Bugs & Errors

Who is online

Users browsing this forum: No registered users and 1 guest