I made a rulestring specification that can simulate some things. It might be terrible.
The transitions for each state are seperated by a |.
A transition consists of many (n):(INT transition list). n is which state to consider. Anything not stated is ignored. An INT transition list just consists of things such as 0123-ac or such. For exmaple, 3:44:3 means "3 of state 4 and 4 of state 3 surrounding a cell".
Instead of B/S, X(n) is used, where (n) is the state to turn into. This is followed by any number of transitions, seperated by dots. If two of these conflict, the one that is first takes precedence.
A default state to transition into is stated first also for each state.
For example, the behaviour of state 0 could be specified as 0X11:3. The 0 indicates that it stays as state 0 by default, the X1 specifies the following transition(s) will indicate a transition into state 1, the 1:3 indicates "3 of state 1". This is equivalent to "B3", effectively.
By extension, any INT rule can be encoded via 0X11:(BIRTH TRANSITIONS)|0X11:(SURVIVAL TRANSITIONS).
Here are some examples of rules:
CGOL: 0X11:3|0X11:23
Wireworld: 0|2|3|3X11:12
Alternating B3/S23 - B4/S56: 0X12:4X21:3|0X21:23|0X12:56
Please inform me of any (non)constructive criticism/thoughts/suggestions you have for/on this.
Some rulestring specification thing
- Heav
- Posts: 28
- Joined: April 19th, 2021, 11:29 am
- Location: Rapidly approaching from an unknown direction
- Contact:
Some rulestring specification thing
We know what you did.
- wirehead
- Posts: 259
- Joined: June 18th, 2022, 2:37 pm
- Location: fish: wirehead: command not found
- Contact:
Re: Some rulestring specification thing
I noticed a slight problem with the X(n) notation that arises with more than 9 states. For example, consider "X122:3". Does this mean that you need 3 of state 22 to turn into state 1, or 3 of state 2 to turn into state 12? It's ambiguous -- so I would say insert an equals sign between the state to turn into and the state considered by the transition (so it would be "X1=22:3" and "X12=2:3" respectively).Heav wrote: ↑April 26th, 2021, 12:24 pmThe transitions for each state are seperated by a |.
A transition consists of many (n):(INT transition list). n is which state to consider. Anything not stated is ignored. An INT transition list just consists of things such as 0123-ac or such. For exmaple, 3:44:3 means "3 of state 4 and 4 of state 3 surrounding a cell".
Instead of B/S, X(n) is used, where (n) is the state to turn into. This is followed by any number of transitions, seperated by dots. If two of these conflict, the one that is first takes precedence.
A default state to transition into is stated first also for each state.
For example, the behaviour of state 0 could be specified as 0X11:3. The 0 indicates that it stays as state 0 by default, the X1 specifies the following transition(s) will indicate a transition into state 1, the 1:3 indicates "3 of state 1". This is equivalent to "B3", effectively.
Also, when specifying the state and transitions with the colon, does the state come first, then the transitions after the colon? Your 3:44:3 example puts the state after the colon, and then you say 1:3 indicates 1 of state 3, putting the state before the colon. I would write the state before the colon, which would no longer read as "N of state M" anymore, probably something like "state-M cells in the N configuration", and that's what I'll use here.
I would add that in a particular Hensel transition (2a, 3y, or whatever), you can have a list of states in square brackets ([]) separated by commas, which will fill in clockwise around the transition, using the canonical orientation on the LifeWiki page. This overrides the state before the colon which applies if there is no square brackets.
Then there's also the problem of Boolean and, or and not. Your example "4:33:4" assumes "3 of state 4 and 4 of state 3", but what if you meant "3 of state 4 or 4 of state 3"? I propose to add punctuation between two sets of transitions to clarify this: "N.M" (period) means N and M, "N,M" (comma) means N or M, "N;M" (semicolon) means N or M but not both (xor), and "-N" means not N.
Short of making this Turing-complete, adding parenthesis so that N or M (or both!) could be arbitrary sets of transitions would make this a lot easier to write strings as you know when conditions are being or'ed, and'ed, etc. Then the rule engine will simply recursively evaluate all the expressions, and the first one that is "true" will be applied.
I hope this is helpful. If this raises any other questions, let me know.
-
- Posts: 131
- Joined: January 26th, 2021, 12:19 am
Re: Some rulestring specification thing
How would this be used to notate a 3-state INT rule?
I wrote a stdin script that generates random soups of a provided number of a given spaceship. It works for all (non-B0) spaceships in the INT rulespace!
A Multistate INT notation + script.
A Multistate INT notation + script.
- wirehead
- Posts: 259
- Joined: June 18th, 2022, 2:37 pm
- Location: fish: wirehead: command not found
- Contact:
Re: Some rulestring specification thing
The same way Golly does it: You would have state 0 turn to 1 on the B conditions, and state 1 not turn to 2 on the S conditions, and have 2 turn back to 0:
Code: Select all
0X1=1:<B conditions>|2X1=1:<S conditions>|0