Language Reference
Every ecaxpr
file corresponds to an ecaxpr
expression.
An ecaxpr
expression consists of three parts:
-
L-expr
: A predicate logic expression representing the rules. -
State-expr
: An expression representing the initial state. -
Steps-expr
: A non-negative integer representing the number of steps to simulate.
These names are mostly neologisms given for convenience and precise reference.
Each part of the ecaxpr
expression must occur in order exactly as stated.
Newlines, spaces, and tabs do not matter.
L-expr
The following is a verbal description of the grammar of L-expr
.
For any operation that is mentioned as "taking in" L-expr
, it should be assumed that what they produce are also L-expr
. No exceptions arise.
Predicates
The simplest of
L-expr
arel
,t
, andr
.
Given any cell in our elementary cellular automaton, l
is the value of the cell to the left, t
the value of the present cell ("this" cell), and r
the value of the cell to the right.
These are called predicates, a fancy name for variables in logic.
Negation
Given any L-expr
, we can take its negation.
To take the negation of a statement or predicate in logic means to invert its truth value. If it is true, then its negation is false, and vice versa.
If an
L-expr
predicate is writen asX
, we take its negation as~X
in anL-expr
. Thus, ifX
ist
, its negation is~t
.
Conjunction ("AND")
Given any set of at least two L-expr
, we can take their conjunction.
To take the conjunction in logic means to check if all the conjuncted statements or predicates are true. The conjunction statement/predicate itself is only true if all of them are true, and false otherwise.
For two statements/predicates, this corresponds to stating that both of them are true. In general, it corresponds to stating that all of them are true.
Suppose that we have two
L-expr
predicates written asA
andB
, respectively. Then, their conjunction is written asA & B
.
Suppose that we have a list of N
L-expr
predicates, where N is some non-negative integer greater than or equal to 2. Suppose that they are written asL1
,L2
,L3
, ...,LN
, respectively. Then, their conjunction is written out asL1 & L2 & ... & LN
.
Disjunction ("OR")
Given any set of at least two L-expr
, we can take their disjunction.
To take the disjunction in logic means to check if at least one of the disjuncted statements or predicates is true. The disjunction statement/predicate itself is only false if all of them are false, and true otherwise.
Suppose that we have two
L-expr
predicates written asA
andB
, respectively. Then, their disjunction is written asA | B
.
Suppose that we have a list of N
L-expr
predicates, where N is some positive integer greater than or equal to 2. Suppose that they are written asL1
,L2
,L3
, ...,LN
, respectively. Then, their disjunction is written out asL1 | L2 | ... | LN
.
Equality
Given any two L-expr
, we can take their equality.
To "take the equality" here means to check if both of the operands are of the same truth values. If so, then the equality is true, and false otherwise.
Suppose that we have two
L-expr
predicates written asA
andB
, respectively. Then, their equality is written asA == B
.
State-expr
A State-expr
consists of *
and #
in succession.
*
represents white orfalse
cells.#
represents black ortrue
cells.
Thus, ***#***
would correspond to an initial states configuration where the first three cells are false
, followed by a true
one, which is then followed by three more false
cells.
Steps-expr
A Steps-expr
is simply a non-negative integer.