Chapter 11
Practical Syntax Reference
Flow Algebra
Author: Mark Higgins
© Mark Anthony Higgins 11 October 2025
Revised Date: 11 February 2026
Author: Mark Higgins
This chapter serves as a complete guide to the written form of Flow Algebra.
While earlier chapters explored theory, this section focuses on precision of expression — how to define, nest, and compose flows that remain both machine-readable and human-intuitive.
Flow Algebra syntax is minimal by design:
flow "NameOfFlow"
# ---------- SECTIONS ----------
# states, params, transitions, monitors, invariants, limits, ioIndentation defines hierarchy; # introduces comments.
Typical order:
States
Mutable variables representing system conditions.
state temperature = 25
state velocity = (1, 0, 0)Parameters
Fixed or slowly varying constants controlling transitions.
param gain = 0.1
param tolerance = 0.05Parameters may be overridden at runtime or imported from external sources.
11.4 IO Formats
Flows can import or export structured data:
io.read:
format: csv
path: "input/data.csv"
schema:
- "time" as t:float
- "value" as v:float
io.write:
format: json
path: "output/results.json"Supported formats: csv, json, yaml, xml, txt, binary
Encoding defaults to UTF-8 but may be declared explicitly:
encoding: utf-8-sig for Excel-safe CSVs.
Basic Transition
transition update:
output' = f(input)
update(output = output')transition blocks define rules of change; primes (') denote next-state values.
Conditional Form
when condition → expression
else → fallbackIterative Evolution
iterate update until limit11.6 Operators and Notation
| Symbol | Name / Meaning | Example | Description |
|---|---|---|---|
|
=
|
Assignment |
x = 3 |
Define or update value |
|
'
|
Prime
|
x'
|
Next-state variable
|
|
→
|
Transition / mapping
|
A → B
|
Direction of flow
|
|
←
|
Reverse mapping
|
x ← F(y)
|
Receive from function
|
|
↺
|
Cyclic / feedback
|
phase ↺ sin(ωt)
|
Closed recursion
|
|
∑, ∏
|
Summation / product
|
∑ forces
|
Aggregate operators
|
|
≈
|
Approximate equality
|
x ≈ y
|
Used in tolerance checks
|
|
∈, ∉
|
Set membership
|
value ∈ range
|
Logical filter
|
|
≡
|
Definition identity
|
energy ≡ mc²
|
Constant relation
|
Logical connectors follow standard Boolean logic: and, or, not.
Annotations allow human-readable notes inside a flow:
@purpose: "Thermal regulation test"
@version: 1.2
@author: "Research Lab A"These can be parsed by documentation generators or version control systems.
Invariant
Condition that must remain true:
invariant energy_conserved: kinetic + potential = totalMonitor
Watches variables and triggers responses:
monitor drift:
when |Δtemp| > 2 → warn("Instability detected")Limit
Defines termination or steady-state criteria:
limit when |Δx| < 1e-5 → stopNested flows inherit parameters from parents unless overridden:
flow "Parent"
param gain = 0.1
flow "Child"
use gain
param offset = 2Child scopes may shadow parent variables using local declarations.
on error(type = "IOError") → retry(3)
on warning → log("Check input range")Events may trigger corrective transitions or alerts.
flow "TemplateExample"
@purpose: "Demonstration of complete syntax"
@version: 1.0
io.read:
format: csv
path: "input.csv"
state x = 0
state y = 0
param gain = 0.05
transition evolve:
x' = x + gain * y
y' = y - gain * x
update(x = x', y = y')
invariant energy: x² + y² = 1
monitor stability:
when |Δx| > 0.01 → warn("Divergence")
limit when |Δx| + |Δy| < 1e-5 → stop
io.write:
format: json
path: "output.json"This example demonstrates the full structural stack — I/O, states, transitions, invariants, monitors, and limit conditions — in canonical Flow Algebra style.
This syntax reference turns Flow Algebra from idea into working language.
It defines the exact shapes, rules, and stylistic discipline that make flows both expressive and reliable.
Once mastered, this grammar becomes the foundation for modelling any coherent system — from a cell to a galaxy, from a neural net to a city.
Flow Algebra syntax is not just a language but a coherence protocol.
Each indentation, transition, and invariant reflects a physical truth: order emerging through structure.
Syntax≡Constraint⇒Clarity
A well-written flow is a stable geometric object — readable, reproducible, and resistant to entropy.
In this sense, Flow Algebra is to systems what crystal lattices are to matter:
a structure that holds meaning through precision.
<flow-file> ::= <flow-block>+
<flow-block> ::= "flow" <string> [<annotations>] ":"? <section-list>
<section-list> ::= (<io-section> | <state-section> | <param-section> |
<transition-section> | <monitor-section> |
<invariant-section> | <limit-section> )*
<io-section> ::= "io.read:" <io-body> | "io.write:" <io-body>
<io-body> ::= INDENT (<key> ":" <value>)+ DEDENT
<state-section> ::= "state" <identifier> "=" <expression>
<param-section> ::= "param" <identifier> "=" <expression>
<transition-section> ::= "transition" <identifier> ":" INDENT <rule-list> DEDENT
<rule-list> ::= (<assignment> | <conditional> | <update>)+
<monitor-section>::= "monitor" <identifier> ":" INDENT <when-clause>+ DEDENT
<invariant-section> ::= "invariant" <identifier> ":" <expression>
<limit-section> ::= "limit" "when" <condition> "→" <action>
<assignment> ::= <identifier> [ "'"] "=" <expression>
<conditional> ::= "when" <condition> "→" <action> [ "else" "→" <action> ]
<update> ::= "update(" <assignment-list> ")"
<action> ::= <identifier> "(" <arguments> ")" | <assignment>
<annotations> ::= (<annotation>)+
<annotation> ::= "@" <key> ":" <value>
<condition> ::= <expression> ((">" | "<" | "=" | "≥" | "≤") <expression>)?
<expression> ::= <literal> | <identifier> | <function-call> |
<expression> <operator> <expression>
<operator> ::= "+" | "-" | "*" | "/" | "≈" | "∈" | "∉" | "and" | "or" | "not"
<function-call> ::= <identifier> "(" <arguments>? ")"
<arguments> ::= <expression> ("," <expression>)*
<key> ::= <identifier>
<value> ::= <literal> | <string> | <number> | <list> | <map>
<literal> ::= <number> | <string> | "True" | "False"
<identifier> ::= [A-Za-z_][A-Za-z0-9_]*
<string> ::= '"' [^"]* '"' | "'" [^']* "'"
<number> ::= [0-9]+("."[0-9]+)?
<list> ::= "[" (<value> ("," <value>)*)? "]"
<map> ::= "{" (<key> ":" <value> ("," <key> ":" <value>)*)? "}"
In formal terms, Flow Algebra is a context-sensitive grammar of coherence —
its syntax enforces clarity, its semantics preserve balance.
When parsed correctly, every valid flow is both an executable model and a philosophical statement:
structure is meaning, rendered in motion.
Flow Algebra syntax is more than a programming style; it is the operational geometry of coherence. Every indentation defines scope, every invariant defines stability, and every monitor defines awareness.
When read by an interpreter, these written relationships become executable ethics — a system that evolves while remaining accountable to its own structure.
\[ \text{Form} \;\Rightarrow\; \text{Function} \;\Rightarrow\; \text{Integrity} \]
In this sense, the language itself is a contract between mathematics and meaning: clarity becomes enforceable, and ambiguity collapses into error rather than chaos.
To write in Flow Algebra is to participate in the discipline of coherence.