# MaWaTAM `mawatam` is a simulator for the Maze-Walking Tile Assembly Model, a model introduced in the paper [Small tile sets that compute while solving mazes](https://arxiv.org/abs/2106.12341) by M. Cook, T. Stérin and D. Woods. It is written in C++ and uses the SFML as graphic library. ## Dependencies We use the SFML, a powerful graphics, game and media library. On Debian/Ubuntu, you can install SFML with: `sudo apt install libsfml-dev`, please refer to [this guide](https://www.sfml-dev.org/tutorials/2.5/) for other systems. ### SFML on a Mac with M1 architecture SFML tutorials about the M1 chip are not there yet, I managed to make it work by compiling from source but a few variables need to be set: ``` git clone https://github.com/SFML/SFML.git cd SFML mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_OSX_ARCHITECTURES=arm64 .. make all sudo make install ``` I also had to go to the `CMakeCache.txt`of SFML and set `SFML_BUILD_FRAMEWORKS` to `TRUE` then `cmake .. && make all && sudo make install`. For some reasons there are bugs in mawatam for M1, for instance glue labels are not present on seeds. I don't know yet why. ## Build ```bash git clone cd mawatam mkdir build cmake .. make ``` ## Run The simulator can either be run from a `.yml` input file (see input format below): ```bash ./mawatam -f examples/powers_of_two.yml ``` Or reading from `stdin`, in the same format: ```bash python3 mawatam-tools/four_tiles_circuits.py prime_circuit 110 | ./mawatam -i ``` **Note:** The Maze-Walking aTAM model is defined in an **asynchronous** way. However, for convenience and because it did not change terminal assemblies in the case of the constructions we considered in the paper, the default growth mode of the simulator is **synchronous**. This can be changed by pressing `G` (see controls below). ## Examples You can simulate the constructions presented in the paper by running the following commands: ### NAND-NXOR tile set - `python3 mawatam-tools/four_tiles_circuits.py prime_circuit 110 | ./mawatam -i` - `python3 mawatam-tools/four_tiles_circuits.py crossover 01 | ./mawatam -i` ### Collatz tile set - `python3 mawatam-tools/Collatz_circuits.py prime_circuit_better 111 | ./mawatam -i` - `python3 mawatam-tools/Collatz_circuits.py bridge_type_2_in_context 11 | ./mawatam -i` - `python3 mawatam-tools/Collatz_circuits.py input_x_y_on_east_canonical_gate NAND | ./mawatam -i` - `python3 mawatam-tools/Collatz_circuits.py input_x_y_on_east_canonical_gate NAND 01 | ./mawatam -i` - `python3 mawatam-tools/Collatz_forward.py Collatz_forward 1001011 | ./mawatam -i` - `python3 mawatam-tools/powers_of_two.py 100 | ./mawatam -i` ## Controls - `N`: next simulation step - `R`: reset simulation - `arrows`: translate the scene - `mouse wheel pressed`: translate the scene - `CTRL + mouse wheel down/up`: zoom in/out - `Numpad + / Numpad -`: zoom in/out - `= / -`: zoom in/out - `G`: change growth mode between asynchronous ordered, asynchronous random, synchronous - `A`: prints information about the simulation and scene in the terminal - `D`: dumps the current configuration in `out.yml` file ## Input format The input format is built on `yaml`. ```yaml # This input configuration constructs powers of two in base 3 # The format for specifying glues is: # .: # The alphabet name must comply with [_a-zA-Z][_a-zA-Z0-9]* # The glue name must comply with [a-zA-Z0-9] # Hence, the complete glue name must match [_a-zA-Z][_a-zA-Z0-9]*\\.[a-zA-Z0-9] glues: bin.0: 1 bin.1: 1 ter.0: 1 ter.1: 1 ter.2: 1 temperature: 2 # The format for specifying tile types is: # : [, , , ] # The tile type name must comply with [a-zA-Z0-9] tileset_tile_types: 0: [bin.0, ter.0, bin.0, ter.0] 1: [bin.0, ter.1, bin.1, ter.0] 2: [bin.0, ter.2, bin.0, ter.1] 3: [bin.1, ter.0, bin.1, ter.1] 4: [bin.1, ter.1, bin.0, ter.2] 5: [bin.1, ter.2, bin.1, ter.2] # When you specify a configuration, you can either use anonymous tile types that wont be registered in the tileset: # ,: [, , , ] # Or use tile types of the tileset: # , : configuration: 0,0: [null, ter.0, null, null] 0,1: [null, ter.0, null, null] 0,2: [null, ter.0, null, null] 0,3: [null, ter.0, null, null] 0,4: [null, ter.0, null, null] 0,5: [null, ter.0, null, null] 0,6: [null, ter.0, null, null] 0,7: [null, ter.0, null, null] 0,8: [null, ter.0, null, null] 0,9: [null, ter.0, null, null] 0,10: [null, ter.0, null, null] 0,11: [null, ter.0, null, null] 0,12: [null, ter.0, null, null] 0,13: [null, ter.0, null, null] 0,14: [null, ter.0, null, null] 0,15: [null, ter.0, null, null] 0,16: [null, ter.0, null, null] 1,-1: [bin.1, null, null, null] 2,-1: [bin.0, null, null, null] 3,-1: [bin.0, null, null, null] 4,-1: [bin.0, null, null, null] 5,-1: [bin.0, null, null, null] 6,-1: [bin.0, null, null, null] 7,-1: [bin.0, null, null, null] 8,-1: [bin.0, null, null, null] 9,-1: [bin.0, null, null, null] 10,-1: [bin.0, null, null, null] 11,-1: [bin.0, null, null, null] 12,-1: [bin.0, null, null, null] 13,-1: [bin.0, null, null, null] 14,-1: [bin.0, null, null, null] 15,-1: [bin.0, null, null, null] 16,-1: [bin.0, null, null, null] 17,-1: [bin.0, null, null, null] 18,-1: [bin.0, null, null, null] 19,-1: [bin.0, null, null, null] 20,-1: [bin.0, null, null, null] 21,-1: [bin.0, null, null, null] 22,-1: [bin.0, null, null, null] 23,-1: [bin.0, null, null, null] # The two following entries are not implem yet # You can specify the color with which the simulator will render # glues that use a given alphabet name: # : #hexcolor or `auto` to let the simulator choose # By default it is set to auto glue_alphabets_color: bin: auto ter: auto # The view will either display glue colors given their # alphabet name or glue char can be toggled by pressing `e` default_glue_color_mode: alphabet ```