-
Notifications
You must be signed in to change notification settings - Fork 0
Formal Model
Note
Status: IMPLEMENTED
This document outlines the mathematical and computational model that drives the HYWE engine. It answers the fundamental questions of how programmatic intent is formally evaluated, how topology is computed deterministically, and what guarantees the system provides.
The input domain consists of a declarative, hierarchical expression of programmatic intent (a relational specification), defined through the HYWE Syntax.
Input Variables:
-
Program: A hierarchical list of spaces declared via Lexel nodes (e.g.,
(ID/Area/Label/Extrusion/B=Base)). -
Sequence Operator (
$Q$ ): A topological sequence operator from the finite set$S$ ($Q \in S$ ) that dictates the order in which adjacent spaces wrap or cluster. -
Level (
$L$ ): The vertical tier or elevation index. -
Constraints (
$O, I$ ): The semantic physical boundary ($O : Boundary$ ) and internal exclusions ($I : Set$ ) within which the topology must route.
Mathematically:
The system does not represent spaces as floating-point polygons. It discretizes space into Hexels (atomic units on an integer grid) and Coxels (clustered hexels representing a programmed zone).
-
State: A structured
LexelBlockconsisting of parsed properties. -
Fields:
Sequence,Level,Base,Scale,Entry,OuterBoundary,Islands. -
Node:
{ Id, RequestedAreaWeight, Label, Extrusion, Base } - Invariants: Represents the raw relational specification tree. Must resolve to a hierarchical tree grouped by Dot-notation ID.
-
State:
AV(Available),RV(Reserved), orEX(Exposed). - Invariants: The fundamental indivisible unit of spatial discretization, anchoring the system to an integer grid without floating-point coordinates.
- State: An aggregation of Hexels around a single Base Hexel.
-
Fields:
{ Name, Rfid, Size, Seqn, Base, Hxls } -
Canonical Definition: A set of connected Hexels logically grouped around a root Base Hexel, constructed sequentially by a fixed topological operator (
$Q$ ). -
Invariants: A Coxel cannot occupy Hexels already claimed by another Coxel on the same level (Collision Avoidance). Its topology is guided by the active Sequence (
$Q$ ).
- State: Stateless functional utility.
- Invariants: Maps discrete integer Hexel/Coxel coordinates into standard 2D vector geometry using purely integer-based boundary tracing, preventing floating-point drift at the topological boundary.
-
State: A computed
LayoutContextdefining the boundaries and constraints. - Invariants: Reproportions requested node area weights to fit physical boundaries exactly and resolves 2D layout geometry deterministically.
- State: A topological router mapping parent Coxel boundaries into nested child constraints.
-
Invariants: Enforces strict hierarchical spatial containment (
$Child \subset Parent$ ).
-
State: A purely functional state loop carrying
BuildStateacross multiple levels. - Invariants: Preserves uniform scaling and relational continuity across floors to maintain massing volumetric logic.
HYWE distinguishes formally between different types of spatial relations. Let
-
Adjacency (
$A \sim B$ ): A physically neighboring relationship (shared boundaries). -
Connectivity (
$A \leftrightarrow B$ ): A traversable relationship (e.g., doors). -
Flow (
$A \xrightarrow{w} B$ ): A directed or weighted movement path. -
Visibility (
$A \rightleftharpoons B$ ): A perceptual sightline relationship. -
Containment (
$A \subset B$ ): A parent/child spatial relationship (handled via Nexel). -
Hierarchy (
$A < B$ ): A programmatic/organizational relationship (handled via Lexel).
These relations are computationally distinct; adjacency does not imply connectivity.
HYWE organizes these spatial relationships through hierarchical indexing (e.g., (3/20/C), (3.1/15/CA), (3.1.1/10/CAA)).
This establishes:
-
Cas a parent space -
CAas a nested relationship -
CAAas a deeper relational branch
This hierarchy is organizational rather than purely geometric. Nested indices allow spatial systems to evolve through relational continuity rather than isolated placement. This enables branching organizational structures, clustered adjacency behavior, nested spatial conditions, and topology propagation.
Discrete Spatial Topology in HYWE is the non-geometric relationship of how spaces connect, border, or contain each other.
- Layer 1 (Intent) defines that Space A is a parent of Space B and C.
-
Layer 2 (Discrete Spatial Topology) translates this intent by assigning a Base Hexel to Space A, and sequentially clustering Hexels for Space B and C according to the active Sequence operator (
$Q$ ) and the adjacency rules defined in the Coxel module. The topology is deterministic: given the exact same sequence and grid parameters, the same Hexel allocation always occurs.
Geometry is the physical resolution of the topology into coordinates.
- Layer 3 (Geometry) reads the topological Hexel allocations of a Coxel and passes them through the Goxel utility module.
- Functions like
hxlPgn(Hexel Polygon generation) trace the outer boundaries of the Hexel cluster. - Sawtooth artifacts (inherent to grid-based allocations) are removed using integer math (
removeSawtooth). - Winding orders are normalized (
normalizeWinding), resulting in a clean physical layout that can be rendered.
HYWE stratifies its claims into three distinct layers of rigor:
Properties proven from the algorithm itself.
-
Determinism:
$$Configuration = F(P, Q, L, O, I)$$ Given identical inputs, the function$F$ mathematically yields identical discrete topological state. -
Adjacency Equivalence: Two configurations
$A$ and$B$ are considered adjacency-equivalent ($A \equiv_{adj} B$ ) if and only if their functional Adjacency Matrices (cxlAdj) are identical.
Properties verified by the WebAssembly benchmark suite across the tested input space.
- Integer Constancy: Core topological operations execute using integer math, eliminating floating-point rounding error.
- Collision Avoidance: Two Coxels on the same level will never claim the same underlying Hexel coordinate.
Properties of the complete pipeline under stated version/configuration conditions.
- Reproducibility: Given identical inputs and an identical engine version, the system will produce the exact same discrete topological state.
To illustrate the deterministic transformation from syntax to massing, consider a program with a primary container housing a smaller nested room.
1. INPUT (Programmatic Intent)
(Q=VRCWEE/L=0)
(1/100/Main)
(1.1/30/SubRoom/3.0/B=1)
2. LEXEL (Parser)
The Lexel engine constructs a rooted relational tree containing the active sequence
Tree:
1 (ReqAreaWeight: 100, Extrusion: None)
└── 1.1 (ReqAreaWeight: 30, Extrusion: 3.0)
Context: Q = VRCWEE, L = 0
3. XYXEL / NEXEL (Constraint Mapping)
Xyxel evaluates the total unconstrained requested area against the physical boundaries (Nexel registers 1 as the bounding constraint for 1.1.
4. HEXEL / COXEL (Topology Allocation)
Coxel.fs allocates discrete integer coordinates. Using the VRCWEE sequence operator, 1 is anchored and wrapped. 1.1 is anchored inside the boundary of 1.
Coxel(1): Base = AV(0,0,0), Hxls = [AV(0,0,0), AV(2,0,0), ...]
Coxel(1.1): Base = AV(2,2,0), Hxls = [AV(2,2,0), ...]
5. ADJACENCY MATRIX The engine computes connectivity based on shared edges.
cxlAdj: [ Main ↔ SubRoom ]
6. GOXEL (Geometry Resolution)
The discrete integer coordinates are converted into 2D vectorized boundaries using hxlPgn and winding normalization.
Polygon(1): [(0,2), (4,4), (4,0), ...]
Polygon(1.1): [(2,4), (4,5), (4,3), ...]
7. ZAXEL (Massing) Extrusion parameters are read, transforming the 2D polygon footprint into 3D bounding boxes.
Z-Massing(1.1): Z_Base = 0.0, Z_Height = 3.0
8. EVALUATION & ANALYSIS (Research Boundary) This trace reveals the current computational boundary of the project:
- HYWE currently has a fully defined Generation Function:
$G(P,Q,L,O,I) \rightarrow C$ - HYWE does not yet have a fully defined Evaluation Function:
$E(C,P) \rightarrow score$
Given the determinism of the generation operators, defining