Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
ca_critters_reversible_example.cc File Reference

Phase 13 example: Toffoli & Margolus' Critters reversible CA. More...

#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <iostream>
#include <limits>
#include <random>
#include <stdexcept>
#include <string>
#include <ca-traits.H>
#include <tpl_ca_async_engine.H>
#include <tpl_ca_block_rule.H>
#include <tpl_ca_lattice.H>
#include <tpl_ca_storage.H>
#include <tpl_ca_update_scheme.H>
Include dependency graph for ca_critters_reversible_example.cc:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Phase 13 example: Toffoli & Margolus' Critters reversible CA.

Critters is the canonical Margolus block-rule CA. The 2×2 partition alternates origin between (0,0) and (1,1) on consecutive steps, and the rule is its own inverse: applying it twice to the same block is the identity. Combined with the alternating partition, the CA is fully reversible.

The example runs the rule N steps forward, prints the final frame, runs it N steps backward, and verifies that the recovered frame is bit-identical to the initial random soup.

Run: ./ca_critters_reversible_example [steps] [side] [seed]

Definition in file ca_critters_reversible_example.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)