digraph G 
{
    fontname = "Bitstream Vera Sans"
    fontsize = 8
    rankdir = TB
    center=1
    pad=.5
    sep=3

    node [
        fontname = "Bitstream Vera Sans"
        fontsize = 8
        shape = "record"
        style="filled,solid"
    ]

    edge [
        fontname = "Bitstream Vera Sans"
        fontsize = 8
    ]

    // This is the world. In second-order cybernetics, both the observer and the observed must be accounted for in the system.
    // The world is Ashby's black box: we don't know what it does. But, we can make inputs to it and examine the outputs
    // to learn how it transforms our messages. We never measure the world, only ourselves. We compare what we feel before
    // we do something to what we feel after we do something. That is the transformation we are decoding.
    Environment [
        label = "{Environment (BLACK BOX TRANSFORMER) | IN actuator movement | OUT detectable state | OUT noise / entropy }"
        fontcolor=white
        fillcolor=black
    ]

    subgraph clusterPayload  
    {
        label = "Univeral Constructor Payload (Andromeda Intelligence Pattern \\ UTM)"
        labelloc="b"
        style="filled,dashed"
        fillcolor=darkseagreen1

        // An SDR is a Sparse Distributed Representation, but it's also the instantaneous state of the processes in a BEAM nervous network. 
        // BEAM nervous networks by their nature produce sparse representations because cells inhibit nearby cells. 
        // Vin is "voltage in" from an analog sensor, Vout is "voltage out" to an actuator. BEAM Nu/Nv neurons act as 
        // both ADC and DAC, so analog hardware can be directly connected to the cells. SIGNAL is just voltage high on a data line.
        // (Or a set of ganged voltages for redundancy reasons.)
 
        // The control layer is the central processor of the machine. This is where decisions are made. The control layer is
        // implemented as a BEAM nervous network. The control layer is very large by BEAM standards--hundreds or thousands of
        // cells versus the half dozen typically seen. BEAM nervous networks are compact, semi-analog spiking systems rooted 
        // in concepts like central pattern generators, Peixoto's Theorem, and non-linear vector fields. Unlike conventional 
        // artificial neural networks, they leverage subsumption architecture and behaviors akin to Braitenberg vehicles to 
        // produce robust emergent intelligence through simple processes. Despite their simplicity, these networks exhibit 
        // remarkable power and adaptability. Here, BEAM neurons (built with Schmitt triggers \ operational amplifiers) are 
        // also used to perform mathematics, including integrals, similar to how op-amp circuits achieve analog computation.
        ControlLayer [
            label = "{Control Layer (CPU) | IN internal senses : SDR | IN external senses : SDR (V in) | OUT sensorimotor state : SDR | OUT actuator movement : motor (V out) }"
            fillcolor=lightgoldenrodyellow
        ]

        // The learning layer is the memory of the machine, in both the computational and the biological sense. It's a sheet of 
        // sparse distributed memory that is randomly connected in random clusters to the control layer. The cellular layout is 
        // similar to the layout of individual cortical columns of the human neocortex, but it is behaving as random access memory (RAM).
        // It learns the sequences of states produced by the BEAM nervous network in the control layer. Because the BEAM network 
        // is managing both sensorimotor information and performing mathematics functions, the learning layer is learning to predict
        // sequences of both. "Sequences" is a key word here, as sparse distributed memory remembers sequences and not single events.
        // By recalling sequences of math operations to perform which will be sent to the nervous network by the attention layer (BUS),
        // this forms the instruction fetch of our Turing machine. The memory is inherently multimodal and auto-associative, predicting 
        // both seqeuences of sensory states and mathematical instructions from partial fragments of either.
        LearningLayer [
            label = "{Learning Layer (RAM) | IN sensorimotor state : SDR | IN reality indicator : SIGNAL | OUT sensorimotor state : SDR}"
            fillcolor=pink
        ]

        // The attention layer is both the main bus \ DMA channel and a signal amplifier \ squelch. It decides if-and-when to 
        // forward predictions from the learning layer to the control layer, and attentuates the information when it does. A 
        // strong predicted sensor state will overwhelm the actual sensor state in the control layer, and the control layer will 
        // react to the prediction as if it were actually happening. So in a vehicle, if the learning layer predicts the *sensation*
        // of a collision, the control layer will react and apply the brakes (even though no collision occurred). This is how the
        // learning layer acts on the future state of the machine, even though it has direct control over nothing at all. The 
        // attention layer doesn't know anything about what the predictions in the SDR mean. Instead, think of it as signal shaping.
        // The attention layer also generates "internal" states based on the activity it sees. For instance, when sparse distributed memory
        // is not able to predict a sequence (because it's never seen the state before), the cortical columns "burst" meaning that many
        // cells fire all at once. When the attention layer sees this, it generates its own SDR and squelches the prediction in order
        // to prevent the control layer from acting on a hallucination. The learning layer sees this SDR generated by the attention layer 
        // the same as any other sensorimotor state, so the learning layer learns to predict when it's not going to be able to predict.
        AttentionLayer [
            label = "{Attention Layer (BUS\\DMA) | IN sensorimotor state : SDR | OUT reality indicator : SIGNAL | OUT internal senses : SDR }"
            fillcolor=pink
        ]

        {rank = same; LearningLayer; AttentionLayer;}
    }
   
    // This is how we understand the world, by decrypting the black box. We never really see the world, only how it transforms our "messages". 
    // Sensation out, different sensation back in again. We never analyze the world, only ourselves, but in learning to predict the next 
    // sensation that we will experience we build a model of the world implicitly.
    ControlLayer -> Environment [label=" send state message\n(sent via motor activity)"]
    Environment -> ControlLayer [label=" decode transformed state \n(received via sensors)"]

    // This is how we understand ourself--not the content of the sensation, but the reaction to the sensation. When the cortical columns 
    // "burst" and pulse like a thousand twinkling stars, we know we are "surprised". When the sequence loops too many times or the 
    // input signal lacks salience for too long, we know we are "bored". The control layer can't tell which sensations are real and which 
    // are predicted, so it responds equally to both. However, the learning layer needs to know where the sensations originate in order to 
    // prevent a self-reinforcement loop. This is just a flag to make the SDR "different enough" that the sparse memory doesn't ignore the 
    // outcome of an event when it happens in the real world if it's similar to something that it predicted (perhaps wrongly) many times over.  
    // As an unintentional side effect, the machine knows when it "dreams" about a future that hasn't happened. 
    LearningLayer -> AttentionLayer [label="cell activity levels\nused for self-inspection"]
    AttentionLayer -> LearningLayer [label=" send internal state,\n reality signal (notification)"]

    // This is the second-order cybernetic loop. The key to it all. Because of the semi-analog nature of the system, several "frames" of
    // experience may pass through the loop at the same time as independent waveforms.
    ControlLayer -> LearningLayer [label=" send live sensorimotor state"]        
    LearningLayer -> AttentionLayer [label=" send predicted state sequence"]
    AttentionLayer -> ControlLayer [label=" amplify or squelch predictions,\nsend predicted and internal state"]
}