Reaction Networks
Glenn Puchtel
Principal Software Engineer/Architect | .Net | Azure | DevOps | FinOps | IaaS | PaaS | SaaS | FaaS | AGI (Unconventional Intelligence) | Biocybernetics | Author (book, newsletter) | Prompt Engineer (LLMs)
Note: newsletters are progressive; each augment the previous. Reading them in chronological order is suggested for context. Previous: Patterns of Behavior; Next: Biological Models of Reaction Networks.
Introduction
Everything, including us, is made of chemicals. A combination of two or more is a mixture; solid, liquid, or gas. Each is identifiable by melding the signature of its composites—H20. Chemical mixtures are cocktails of life, even artificial life. Chemical reactions—a model of circular causality—(bio)cybernetics stir them.
We assert that such cause-effect mechanisms lead to emergent, goal-directed behavior.
All systems, even natural ones, have a goal—survival, and reproduction, for example. Regardless of the conditions, they move toward it. To be successful requires coherence among the rest of the system's dynamics—parts should work together.
We see three phases of goal-directed behavior. Disturbances influence a system's state either by rules or events. Systems react to state change by actions that direct them toward some goal, causing disturbances. This circular causality is the premise of cybernetics and reaction networks—a collection of rules that describe how things transform from one thing to another.
Our goal is to employ cybernetic concepts when writing software. We believe they promote predictable, cohesive systems. To focus mainly on that, we are writing a game—Cyborg. A game affords us liberties to discover them without the burden of proving them against some arbitrary business problem. ?
In Cyborg, a player transforms a ready-made ecosystem into something less inhabitable. By introducing disturbances such as toxins, radiation, and weather. The first-person (cyborg) figure compensates by assimilating artificial devices to live, evolve artificially, or die. In gameplay, there are no winners, only survivors. Players are scored and ranked by longevity and the harshness of disturbances introduced.
Disclaimer
We do not assert expertise in mathematics, biology, or neuroscience; instead, we borrow ideas from them to solve control and behavior issues in software.
We take liberties in fundamental biological behavior if it proves a solution. Yet, we try to provide enough validity to make a compelling metaphor and basis for our models and methods.
Our intent is not to perfectly emulate biological or neural systems nor study their underlying science; rather, to mimic their structure, behavior, and elegance in software exhibiting complex behavior.
Overview
In Cyborg, disturbances are chemical waves converted to signals, forming air, water, food, and blood mixtures that embody state[1]. Behavior emerges by applying a set of rules against this state divulging conditions. These conditions and behaviors are the concern of cybernetics. They are what interest us. We study and cultivate them with the promise of yielding better, predictable, cohesive software.
In Cyborg, chemical signatures are ASCII string specifications termed SMILES (Simplified Molecular-Input Line-Entry System). We take many liberties with this specification—we use an acute short-hand variant. Aptly, water (H20) is "H=O=H; however, air is just "O=N=O=C=O"—the mixture of oxygen, nitrogen, and carbon dioxide. Admittedly, air has many other substances; however, they are insignificant in our gameplay, so we ignore them.
Signatures are a way to identify something uniquely. We chose an adapted variation of the SMILE specification as:
·???????It establishes a ubiquitous language
·???????Its notation is well-known, understood and graph-based
·???????It is human-readable, parsable, and based on biochemical properties
·???????It is open to extension—in the range and complexity of its vocabulary
Signatures also play a dual role. They distinctly identify things and express weight—a numerical value representing relative importance—calculated by taking the sum of the atomic weight of each element in the signature.
For example, carbon dioxide (CO2) has one carbon molecule and two oxygen molecules. Its (SMILE) signature is "O=C=O." Given an atomic weight of 15.999u for an oxygen molecule and 12.011u for a carbon molecule, the weight of carbon dioxide is 44.009u (15.999 + 12.011 + 15.999).
In Cyborg, weighted values are normalized between ?1.0 and 1.0 and truncated to 3 decimal places. So, 44.009u becomes 0.085. The details and usage of these values are not relevant here; rather, know that Cyborg is a reactive rules engine. It applies these values to transient or persistent state—mixtures, using rules that also expose conditions, which, if present, elicit cybernetic behavior.
For example, hypothermia is a condition of low body temperature. Rules test thresholds that invoke actions to create heat—involuntary behavior—or seek cover to retain heat—voluntary behavior—reflective or cognitive. Either one occurs when motor receptors chemical signals.
领英推荐
Mixtures (state)
The cocktails of life are three: air, water, food. Each carries a fatal rule of three: three minutes without air, three days without water, and three weeks without food. A fourth cocktail, blood, is the consequence of the first three. In Cyborg, and at periodic intervals, rules are applied against it to ascertain conditions that invoke cybernetic behavior—the objective of our work.
The vital signs of life are four: temperature, pressure, pulse, and respiration, measurable in and by blood—bodily conditions corroborated by it. In Cyborg, these four mixtures comprise state. Each is composed of temperature, pressure, and a set of substances that vary in saturation—degree of concentration. For instance, normal ambient air is 21% oxygen, 78% nitrogen, and ~1% carbon dioxide (in our model).
Note: oversaturation is possible—hyperoxemia, which occurs when cells, tissues, and organs are exposed to too much oxygen—oxygen poisoning.
Conditions
A condition exists if the rules that define it equate to true. For example, a state of hypothermia exists if the body temperature falls below 95 degrees Fahrenheit (35 Celsius). Here, any value less than or equal to the threshold of 0.27 (the normalized value for 35) asserts true.
Note: The Condition base class has an (undisclosed) Assert method that applies a value against a set of rules. Rules combine one or more (Lambda) expressions, varying in complexity using algebraic operations: 'OR 'AND,' & 'NOT.'
Cures (Cybernetic fixtures)
A cure—the act, process, or state of being fixed describes behavioral reactions that compensate for irregularities—rule violations. Reactions are either involuntary or voluntary. For example, an involuntary reaction to cold is to shiver, whereas, voluntary action is to seek or adorn cover.
Note: the example shows artifacts such as the Kit (an IoC container) and a specialized Try method, part of our library but not shown. In this contrived example, shivering increases blood temperature (if present in the Kit) by 1 degree.
It is important to understand that one or more cures are likely suitable for any condition. Knowing which, when, and how often to apply them is the essence of our work—Cybernetics & Cyborg. We correlate cause & effect with the result of our actions—we learn, adapt, and assimilate—as evident in a Cyborg's actions.
Conclusion
To discover and understand cybernetic behaviors, we are writing a game that exploits them. We use biological metaphors as they exhibit causal models of behavior. Concepts like mixtures to define state may seem whimsical, but they provide a mental model distinguishable from behavior.
We assert that robust systems distinguish between state and behavior—that state triggers actions (behavior). It arises from rules cultivated over time—knowledge. In the absence of such knowledge, behavior is random.
We propose a framework to define and investigate biocybernetics in pursuit of artifacts that facilitate writing better software. We explain basic concepts to identify forces that affect software using nature—the ultimate architect as a model.
We present fanciful metaphors using chemical signatures, weights, and reactions to explain our hypotheses. We do this to offer familiarity. In this way, the underlying concepts become more clear if the metaphors used to describe them are familiar.
We invite you to join us in constructive debates on our (LinkedIn) group as we continue a journey through cybernetic principles, patterns, and practices:
?[1] The collective, and the current value of data in a system at any given point in time