Sense and Navigability
Our environment will be a simple two-dimensional grid of patches1. Some patches on the grid will be empty, others will be walls that our agent cannot pass through. Our first task is to provide the agent with a means to move. The chosen method
1 I use the word “patch” to avoid confusion with the “cells” that make up the agent itself.
We need to define how our agent will move around the grid world. The simplest approach is give the agent a location in the grid, and a heading (North, East, South, or West). Then, at each time-step, it could optionally rotate to a new heading, then attempt to move forward. It would either go into the adjacent patch, or bump into a wall.
I am going to make our agent less Roomba-like, however, and more like an inchworm. (The reasons for this will become clear later). It will still start with a location and a heading, but it will move in a different way. It will move by stretching its head forward into an adjacent patch at one time-step, leaving its tail behind. In the next time, step it will contract its tail forward to occupy the same patch as its head. So it alternates between occupying one patch and two patches as it moves about.

Binding a Program to the Sensory-Motor System
Sensory Input: To begin, our agent will have just one sensory input: Stretched. This is proprioceptive input indicating whether it is currently stretched (over two-patches) or contracted. We will add further sensors later.
We can put this together in a simple AND program that does basic navigation. We can now produce a regulatory diagram with these labels.
UNXb_+BNB__*XNBb_->B
QZQbb*BNB__+QZQac->C
BVBc_*BVB_b+XNU_c->D
UVB_b*BVUcb*UNU_a->E
BNBb_+BNUb_+BNB__->F