Language Reference

Every ecaxpr file corresponds to an ecaxpr expression.

An ecaxpr expression consists of three parts:

  1. L-expr: A predicate logic expression representing the rules.

  2. State-expr: An expression representing the initial state.

  3. 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 are l, t, and r.

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 as X, we take its negation as ~X in an L-expr. Thus, if X is t, 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 as A and B, respectively. Then, their conjunction is written as A & 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 as L1, L2, L3, ..., LN, respectively. Then, their conjunction is written out as L1 & 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 as A and B, respectively. Then, their disjunction is written as A | 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 as L1, L2, L3, ..., LN, respectively. Then, their disjunction is written out as L1 | 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 as A and B, respectively. Then, their equality is written as A == B.

State-expr

A State-expr consists of * and # in succession.

  • * represents white or false cells.
  • # represents black or true 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.