Building a Wall

Project wiring diagrams · Essay 02

One diagram,
several meanings.

A roof sends a load to a wall. The picture says what connects. A model says what the connection means—and whether the whole arrangement meets its stated conditions.

Begin with a deliberately small example: the roof passes its entire load to one wall. We compare available capacity with a factored load, then hide the internal reaction to obtain one condition at the outer boundary. This is a teaching calculation, not a structural design.

Follow the reaction

Roof, wall and a Boolean combinerRoof inputs are S of type Load, Cap R of type Capacity, and flag R of type Bool. Its outputs are reaction r of type Load into Wall and ok R of type Bool into AND. Wall also receives Cap W of type Capacity and flag W of type Bool, and outputs ok W of type Bool to AND. AND returns ok S of type Bool. Factors gamma R and gamma W are fixed positive parameters for each calculation. OUTER INTERFACE · external inputs → Bool Roofr = SCap_R ≥ γ_R Sflag_R; ok_R = trueparameter γ_R > 0 S : LoadCap_R : Capacityflag_R : Bool WallCap_W ≥ γ_W rflag_W; ok_W = trueparameter γ_W > 0 r : LoadCap_W : Capacityflag_W : Bool ANDok_W : Boolok_R : Boolok_S : BoolLoad and Capacity have nonnegative numerical values in the same toy load unit U. Bool = {false, true}.

Every wire is typed. Load and Capacity are distinct named port types even though both use nonnegative numbers. Left → right is dependency, not elapsed time. Flags are supplied assertions, not checks of a building code.

End

Meaning that survives assembly

Understand which conditions a larger work package inherits when smaller packages connect.

Way

Separate syntax and interpretation

Use an operad of typed, acyclic wiring; interpret its boxes with relations and its wiring with relational composition.

Means

Make the calculation visible

Inspect a derived boundary condition, vary inputs, and compare two ways of evaluating the same wiring.

01 / FROM THREE BOXES TO ONE CONDITION

Hide the wires, retain their obligations

Fix positive factors γ_R and γ_W. The roof relation permits an output only when its flag and capacity condition hold; the wall relation does the same. AND joins their Boolean outputs. The algebra combines all three predicates and eliminates their internal variables.

P_R(S, Cap_R, flag_R; r, ok_R) ⇔ flag_R ∧ r = S ∧ Cap_R ≥ γ_R·S ∧ ok_R = true P_W(r, Cap_W, flag_W; ok_W) ⇔ flag_W ∧ Cap_W ≥ γ_W·r ∧ ok_W = true P_∧(ok_R, ok_W; ok_S) ⇔ ok_S = (ok_R ∧ ok_W)
P_shell(S, Cap_R, flag_R, Cap_W, flag_W; ok_S) ⇔ ∃ r, ok_R, ok_W : P_R ∧ P_W ∧ P_∧ ⇔ flag_R ∧ flag_W ∧ Cap_R ≥ γ_R·S ∧ Cap_W ≥ γ_W·S ∧ ok_S = true ⇔ flag_R ∧ flag_W ∧ S ≤ min(Cap_R/γ_R, Cap_W/γ_W) ∧ ok_S = true

The first line suppresses repeated arguments only to keep it readable; they are exactly the arguments in the three component predicates above. Substitution of r = S and ok_R = ok_W = true gives the second line. Dividing the two inequalities is valid because both factors are strictly positive.

U is an invented common load unit. Factors are dimensionless. The controls calculate with finite numbers; the written derivation assumes nonnegative real load/capacities and positive real factors.

Example awaiting calculation

Enable JavaScript to evaluate the entered numbers.

Roof permits up to
—
Wall permits up to
—
Joint numerical bound
—
The live calculation will appear here.

A diagnostic is a different relation. A total diagnostic computes r := S, ok_R := flag_R ∧ (Cap_R ≥ γ_R·S), ok_W := flag_W ∧ (Cap_W ≥ γ_W·r), and ok_S := ok_R ∧ ok_W. It can return false. The acceptance contract above permits only true; a failed condition gives an empty set of permitted outputs. A false diagnostic is not a witness satisfying that contract.

02 / WHAT IS THE OPERAD? WHAT IS ITS ALGEBRA?

A box shape is not its behaviour

The compositional grammar

Choose a finite ordered input list I and output list O of named port types. The pair B = (I, O) is one colour of the wiring operad. A diagram Φ ∈ W(B₁,…,Bₙ; B) connects n inner box interfaces inside one outer interface B.

The operadic “one output” is this whole outer interface. It may have many output ports. Substitution replaces an inner box by a matching diagram; it does not silently copy a physical resource.

Here W uses acyclic directed wiring with one-to-one port attachments. In the interpreting SMC, a passing wire is identity; independent juxtaposition gives the tensor product. The operadic unit instead has one inner box wired unchanged to a matching outer interface. Patterson, Spivak & Vagner, §§4–5, supplies this syntax.

A specific relational algebra

Assign each port type t a value set V_t. Write V_I = ∏i∈I V_i and V_O = ∏o∈O V_o; the empty product is a singleton. Then:

A(I,O) = Rel(V_I,V_O) = 𝒫(V_I × V_O) A(Φ) : A(B₁) × ⋯ × A(Bₙ) → A(B)

A(B) is the set of all relations with that interface. For a supplied relation in each inner box, A(Φ) returns the relation obtained by conjoining box predicates and wire equalities, then existentially hiding internal port values. Rel is notation for a set of relations here, not one chosen relation.

(x,y) ∈ A(Φ)(R₁,…,Rₙ) ⇔ ∃ internal values z : every box satisfies its Rᵢ and every connected source/target value is equal.

An algebra must respect substitution: interpreting an inner diagram first and then its surroundings gives the same relation as interpreting the flattened wiring. Its operadic unit acts as the identity on the set A(B). This definition explains the preceding calculation. A different diagram hides different values; a different relation changes what the same interface permits. The relational construction is informed by Bakirtzis, Fleming & Vasilakopoulou, §3.3.1. We use its timeless relational idea with our chosen acyclic syntax, rather than importing its feedback-capable wiring theory wholesale.

Three possible interpretations of the same acyclic interfaces
InterpretationWhat fills a boxWhat it can express
Total functions in Setf : V_I → V_OExactly one output tuple per input. Several physical output ports are represented by one tuple. The total diagnostic is an example.
Partial functionsf : V_I ⇀ V_OAt most one output tuple; some inputs have no result. A checked work step can reject an input. Its graph is a relation.
RelationsR ⊆ V_I × V_OZero, one or many permitted tuples. Suitable for static constraints or alternatives. A relation alone supplies no probabilities or preferred choice.

Each interpretation has its own composition. Choosing an algebra does not make differently interpreted outputs interchangeable. It also does not establish behavioural substitutability: identical ports can conceal incompatible requirements.

03 / THE LAWS, VISIBLE

Regroup the same work

All named letters below are port types. For associativity, take functions or relations f : X → Y, g : Y → Z, h : Z → T; the adjacent types must match. The interchange panel declares its own two chains. Equations use g ∘ f for “f, then g”. Grouping boxes changes neither the wires nor their order.

1. Unit

fid_YfX →Y →YX →Y=

id_Y ∘ f = f = f ∘ id_X id_X = {(x,x) | x ∈ X}

An unchanged wire is identity. Storage is identity only in an abstraction that forgets its effects.

Finite check not yet run.

2. Associativity

fghfghX →Y →Z →TX →Y →Z →T=

h ∘ (g ∘ f) = (h ∘ g) ∘ f

Both hide the same intermediate Y and Z values. This law does not license doing h before f.

Finite check not yet run.

3. Symmetry

X →A →AXXAσ_X,Aσ_A,X

σ_A,X ∘ σ_X,A = id_(X⊗A) σ_X,A(x,a) = (a,x)

Reorder ports while retaining their values. Crossing wires do not merge, copy, or imply an action sequence.

Finite check not yet run.

4. Interchange

X f Y g Z above A h B k C; grouping changes with the buttonfghkX →Y →ZA →B →C

(g ∘ f) ⊗ (k ∘ h) = (g ⊗ k) ∘ (f ⊗ h)

The pair of lanes has type X⊗A → Z⊗C. Independence here concerns the model; it does not assert simultaneous use of a shared worker.

Finite check not yet run.

Try the finite interpretation

Six distinct Boolean relations include rejection, partiality, branching, identity and unrestricted choice. The checks compute both sides independently with serial composition and tensor.

These illustrative finite checks exercise this implementation; they are not proofs for arbitrary sets. The general relational laws follow from equality, conjunction and reordering existential quantifiers. Operadic substitution likewise flattens nested wiring; the unit passes the boundary unchanged. The diagrams above display the corresponding SMC laws.

See a relation that is not a function

For one supplied Boolean input, two outputs may be allowed. Select an input and compare three different box interpretations, all with interface (Bool, Bool).

Identity: {(false,false), (true,true)} Partial: {(true,true)} Choice: {(false,false), (false,true), (true,true)}

Choose an input to inspect the permitted outputs.

04 / WHERE THE INTERPRETATION ENDS

More meanings need stated rules

Resource, time, feedback

A scaffold may pass through several processes and return with the same identity. That conservation belongs in their relations; a matching colour alone does not enforce it. Quantities, readiness, wear, duration and competing uses need further state or constraints.

Our syntax is acyclic. Feedback-capable dynamical wiring and undirected shared-variable diagrams use different composition rules. Adding a backwards arrow to this example would not supply a valid dynamical model.

An experimental route onward

The retained construction operad and dynamics working explores discrete/continuous behaviour and includes a Julia/AlgebraicDynamics notebook template. Its own record says the Julia template was not executed. It remains experimental material; this essay neither runs nor validates that solver.

For the distinct mathematical route, Libkind, Baas, Patterson & Fairbanks, Operadic Modeling of Dynamical Systems: Mathematics and Computation, separates directed and undirected composition and associated dynamics. Those results have their own hypotheses.

What this construction contributes: explicit typed rule drawings, a finite relation evaluator, the visible elimination of the wall/roof predicate, and a clear distinction between diagnostic output and permitted behaviour. The scalar load transfer and supplied flags are our toy assumptions. This model omits real load combinations, geometry, materials, detailed standards and evidence of physical adequacy. It is not an engineering approval, schedule optimizer or human-use validation.

Source map for the consolidated essays

Sources and the scope of borrowing
  • Patterson, Spivak & Vagner (2021), introduction and §§4–5: acyclic wiring, operadic substitution and interpretation through SMCs. The finite implementation here is independent teaching code, not Catlab.
  • Bakirtzis, Fleming & Vasilakopoulou (2021), §3.3.1: static relational contracts. Their Cat-valued construction and broader wiring category are richer than our set-of-relations presentation. Static constraints are not automatically assume–guarantee or temporal contracts.
  • Vagner, Spivak & Lerman (2015), definitions 2.1–2.3: operads and algebras distinguish compositional architecture from a supplied interpretation. Their dynamical algebra is a separate example.
  • Earlier wall/roof contract working: the three predicates and boundary inequality retained here, with explicit numerical domain, units and verdict distinction.