Constructive geometric models of EL++ ontologies

Learned geometric ontology embeddings in mOWL—such as ELEmbeddings, ELBE, and BoxSquaredELModule—optimise differentiable loss functions and satisfy an ontology only approximately. Recent theoretical results characterise when exact geometric region models of \(\mathcal{EL}^{++}\) ontologies exist and give explicit constructions:

  • Axis-parallel boxes (and Euclidean balls) cannot model the six-axiom propositional theory

    \[T_3 = \{A \equiv X_1 \sqcap X_2,\; B \equiv X_2 \sqcap X_3,\; C \equiv X_1 \sqcap X_3,\; A \sqcap B \sqsubseteq \bot,\; B \sqcap C \sqsubseteq \bot,\; A \sqcap C \sqsubseteq \bot\}\]

    in any non-degenerate interpretation in any dimension \(d \ge 1\), because axis-parallel boxes in \(\mathbb{R}^d\) have Helly number 2 (Eckhoff, 1988; Leemhuis & Kutz, NeSy 2025).

  • Convex polyhedra model every consistent normalised \(\mathcal{EL}^{++}\) ontology with a finite canonical model exactly in ambient dimension \(k = |\Delta^{\mathcal{I}}| - 1\) by mapping each concept name to a face of the standard simplex and each role to the convex hull of concatenated vertex pairs (Gutiérrez-Basulto & Schockaert, KR 2018, Prop. 3; Lacerda, Ozaki & Guimarães, TGDK 2024, §5). The dimension \(|\Delta^{\mathcal{I}}| - 1\) includes auxiliary names and \(\top\) and is an upper bound; a dimension linear in the number of concept names is unavoidable in the worst case for convex models that realise the relevant conjunctions (Gutiérrez-Basulto & Schockaert, KR 2018, Prop. 4).

  • Unions of closed intervals on the real line model every consistent normalised \(\mathcal{EL}^{++}\) ontology exactly in one dimension, with roles interpreted as finite unions of 2-D axis-aligned rectangles (Lacerda, Ozaki & Guimarães, TGDK 2024, Def. 12; the \(n = 1\) case of the multibox construction of Federico, Leemhuis & Kutz, JOWO 2026, Thm. 3).

The mowl.geometric package and its learnable counterparts follow a five-part progression:

  1. Canonical model (TBox, RBox, and ABox): normalise() and CanonicalModel saturate normalised \(\mathcal{EL}^{++}\) TBoxes, RBoxes, and ABoxes (encoding each named individual \(a\) as a fresh nominal concept name \(N_a\) via nominal_name(), atomic class assertions \(C(a)\) as \(N_a \sqsubseteq C\), and role assertions \(r(a, b)\) as \(N_a \sqsubseteq \exists r.N_b\), while raising InconsistentOntology if any individual is unsatisfiable).

  2. Exact constructive models and diagnostics: ConvexPolyhedralModel, IntervalUnionModel, BoxModelBuilder, ModelChecker, helly_check(), and certificate_triangles().

  3. Exact-model box initialisation and anchoring: ExactBoxInit seeds and anchors BoxSquaredEL, ELBE, MultiBoxEL, MultiELBE, and PrismEL.

  4. Learnable geometric and canonical-mixture models: init_boxes and anchor_weight hooks on ELBE and BoxSquaredEL, multi-component box models MultiBoxEL and MultiELBE, prism embeddings PrismEL, and the faithful-by-construction canonical-element mixture model CanonicalMixture (backed by MembershipStructure).

  5. Training objectives for multi-box and prism models: soft component aggregation and log-space volume-overlap diversity regularisation in mowl.nn.el.softagg, canonical-element point supervision in mowl.datasets.el.points and mowl.nn.el.pointloss, available via objective="point" | "mixed" | "hybrid" on MultiBoxEL and MultiELBE, and structural region algebra, compiled conjunction definition tables, and structural losses in mowl.nn.el.structural, available via objective="structural" on MultiBoxEL and PrismEL.

Guarantees by model and procedure

Every constructed model (ConvexPolyhedralModel, IntervalUnionModel, and BoxModel) is verified by ModelChecker before it is returned; if a constructed model ever fails verification, construction raises InternalConsistencyError.

Constructive models, learnable models, and objectives in mowl.geometric

Class / function

Supported fragment

Mathematical guarantee

Dimension

CanonicalModel

Normalised \(\mathcal{EL}^{++}\) TBox/RBox (NF1–NF4, NF6, NF7, and \(\bot\) forms) and atomic ABox assertions

Sound and complete on concept-name subsumptions and unsatisfiability wrt the normalised axiom set (Kazakov et al., JAR 2014), and sound and complete for atomic instance checking (instance_of()) and assertion contradiction (assertion_contradicted()) in \(\mathcal{ELH}_\bot\) without nominals, functionality, or range axioms via the nominal encoding \(N_a\). Raises InconsistentOntology iff \(\mathcal{O} \models \top \sqsubseteq \bot\) or \(\mathcal{O} \models N_a \sqsubseteq \bot\) for some individual \(a\).

\(n = |\Delta^{\mathcal{I}}|\) canonical elements (satisfiable concept and nominal names in \(N_C \cup \{N_a\} \cup \{\top\}\))

ConvexPolyhedralModel

Full normalised \(\mathcal{EL}^{++}\) (or propositional-only when thicken=True)

Exact model (\(\eta \models \mathcal{O}\)), non-degenerate (\(\eta(A) \neq \emptyset\) for all satisfiable \(A\)), and strongly faithful on concept names (\(\eta(A) \subseteq \eta(B) \iff \mathcal{O} \models A \sqsubseteq B\)) (Gutiérrez-Basulto & Schockaert, KR 2018, Prop. 3).

\(k = n - 1\), an upper bound that includes auxiliary names and \(\top\); a dimension linear in the number of concept names is unavoidable in the worst case for convex models that realise the relevant conjunctions (Gutiérrez-Basulto & Schockaert, KR 2018, Prop. 4)

IntervalUnionModel

Full normalised \(\mathcal{EL}^{++}\)

Exact model (\(\eta \models \mathcal{O}\)), non-degenerate, and strongly faithful on concept names (Lacerda et al., TGDK 2024, Def. 12; Federico et al., JOWO 2026, Thm. 3).

\(1\) (classes in \(\mathbb{R}\), roles in \(\mathbb{R}^2\))

helly_check()

Propositional \(\mathcal{EL}_\bot\) (exact for strong reading when complete=True); sound necessary condition with roles

Every HellyCertificate is a sound proof that no box model realises its three pairwise conjunctions simultaneously (Eckhoff, 1988; Leemhuis & Kutz, NeSy 2025, Props. 4, 5). Non-degenerate certificates exclude every non-degenerate box model; strong certificates exclude conjunction-faithful box models (every satisfiable conjunction of names non-empty), not box models that are merely strongly faithful on names. box_representable_* = True means “no Helly obstruction of this kind was found”, not that a box model exists. Re-saturates per candidate set; intended for small to medium ontologies.

Dimension-independent (excludes box models in any \(\mathbb{R}^d\))

certificate_triangles()

Any normalised \(\mathcal{EL}^{++}\) canonical model (graph of direct NF2 definitions)

Sound non-degenerate singleton certificates \((X_1, X_2, X_3)\) with \(X_1 < X_2 < X_3\) lexicographically and all three pairwise_names non-None and satisfiable. Returns every singleton non-degenerate certificate whose pairwise conjunctions are direct NF2 definitions in \(O(\sum_v \deg(v)^2)\) triangle-enumeration time; not complete for conjunctions defined through chains of equivalences or higher-arity certificates (\(|C_i| > 1\)).

Dimension-independent (excludes non-degenerate box models in any \(\mathbb{R}^d\))

BoxModelBuilder

Propositional \(\mathcal{EL}_\bot\) only (NF1, NF2, and \(\bot\) forms)

Runs helly_check() first and, in both faithful modes, raises NotBoxRepresentable iff a non-degenerate certificate is found (a proof that no non-degenerate box model exists); searches via MILP (scipy.optimize.milp) and verifies any found BoxModel with ModelChecker (a time-limited incumbent is post-checked and returned only if it passes). Raises BoxModelNotFound when inconclusive.

Searches \(d \in \{1, 2, 4, \dots, d_{\max}\}\) (default \(d_{\max} = 8\))

ModelChecker

"interval", "polyhedral" (full normalised \(\mathcal{EL}^{++}\)), and "box" (propositional \(\mathcal{EL}_\bot\))

Exact decision procedure for axiom satisfaction, non-degeneracy, and strong faithfulness on concept names (combinatorial for intervals/boxes/simplex faces; HiGHS linear programming for general polyhedra and polyhedral role axioms). Polyhedral role axioms are checked only for simplex-vertex regions (Face rows and PairHull halves one-hot or zero); other regions raise UnsupportedRegion.

Matches interpretation ambient dimension

ExactBoxInit

Normalised \(\mathcal{EL}^{++}\) (method="projected") or propositional \(\mathcal{EL}_\bot\) with fallback to "projected" (method="milp")

In "projected" mode with \(k = 1\), guarantees \(\text{box}(C) \subseteq \text{box}(D)\) (up to float32 tolerance 1e-6) and zero gci0 loss at margin \(0\) for every entailed atomic subsumption \(C \sqsubseteq D\) with satisfiable \(C\) (unsatisfiable subclasses are points at the origin and are not covered; disjointness is not guaranteed). In "milp" mode, preserves both containment and disjointness when a box model is found (its boxes are mapped coordinate-wise by an increasing affine map from the solver’s universe \([0, M]\) onto \([-\text{scale}, \text{scale}]\)), and falls back to "projected" on NotBoxRepresentable or BoxModelNotFound. For PrismModule, sets the equilateral triangle in coordinates 0..1 to inradius \(\max(o_0, o_1)\sqrt{3}\), which suffices to contain the rectangle (not minimal), so the prism contains the initialisation box. Skips classes absent from the canonical model (NaN rows left untouched by apply_to_module() and ignored by anchor_loss()).

Target \((k, d)\) matching BoxSquaredEL, ELBE, PrismEL (\(k = 1, d \ge 3\)), MultiBoxEL, or MultiELBE (\(k \ge 1\))

MultiBoxEL / MultiBoxELModule

\(\mathcal{EL}^{++}\) concept normal forms (gci0, gci1, gci2, gci3, gci0_bot, gci1_bot, gci3_bot) and ABox assertions (role_axiom_capable = False)

Every class is a union of \(k = \text{n\_components}\) axis-parallel boxes with shared class bump and Box²EL role semantics (Federico, Leemhuis & Kutz, JOWO 2026). At \(k = 1\) with component_aggregation="hard", component_reg=0.0, and diversity_reg=0.0, every GCI loss (positive and negative, including gci1 batches with empty intersections) and regularisation loss equal BoxSquaredEL to within 1e-6. Supports soft component aggregation (component_aggregation="soft", tau_anneal, diversity_reg) and canonical-element point supervision (objective="point" | "mixed" | "hybrid").

\(k\) boxes in \(\mathbb{R}^d\) per class (\(k \ge 2\) escapes the Helly number 2 obstruction on \(T_3\))

MultiELBE / MultiELBEModule

\(\mathcal{EL}^{++}\) concept normal forms (gci0, gci1, gci2, gci3, gci0_bot, gci1_bot, gci3_bot) and ABox assertions (role_axiom_capable = False)

Every class is a union of \(k = \text{n\_components}\) axis-parallel boxes with ELBE inclusion, gated pairwise intersection, translation roles, and box individuals (Federico, Leemhuis & Kutz, JOWO 2026). At \(k = 1\) with component_aggregation="hard", component_reg=0.0, and diversity_reg=0.0, every GCI loss and MSE training loss equal ELBE / ELBEModule at equal margin to within 1e-6 (preserving ELBE’s overlap formula for gci3). Supports init_boxes/anchor_weight, soft component aggregation, and canonical-element point supervision.

\(k\) boxes in \(\mathbb{R}^d\) per class

PrismEL / PrismModule

\(\mathcal{EL}^{++}\) concept normal forms and ABox assertions (role_axiom_capable = False)

Every class is a prism \(P_C = T_C \times B_C \subset \mathbb{R}^2 \times \mathbb{R}^{d-2}\) (an apex-up equilateral triangle in support coordinates times an axis-parallel box) with closed-form intersection in gci1 and translational roles (Federico, Leemhuis & Kutz, DL 2026).

\(2d - 1\) scalar parameters per class in \(\mathbb{R}^d\) (\(d \ge 3\))

CanonicalMixture / CanonicalMixtureModule

Normalised \(\mathcal{EL}^{++}\) knowledge bases with individuals (ABox completion)

Represents each individual \(a\) as a masked softmax distribution \(p_a\) over its admissible canonical support \(S_a \subseteq S\) from MembershipStructure. Guarantees hierarchy violation rate 0, exact score 0.0 on all training-entailed class assertions, and +inf score on all contradicted class assertions for all parameter values.

Low-rank factorisation \(r = \text{rank}\) over \(|S|\) canonical elements

Soft component aggregation (mowl.nn.el.softagg)

MultiBoxEL and MultiELBE (component_aggregation="soft")

Replaces hard \(\min\) over target components by \(\text{softmin}_\tau(v) = -\tau(\log\sum_j e^{-v_j/\tau} - \log K)\) (converging to \(\min\) as \(\tau \to 0^+\) and equal to the single slice at \(K = 1\)), soft-argmin emptiness weights \(w_{ij} = \text{softmax}(-\text{empt}_{ij}/\tau)\) with detached gate \(g_{ij} = \max(\text{non\_empty}_{ij}^{\text{det}}, w_{ij}^{\text{det}})\) in gci1, and dimension-independent log-space diversity_penalty() (1.0 on identical boxes at any \(d\)).

Temperature \(\tau\) annealed geometrically from tau_start (1.0) to tau_end (0.05)

Canonical-element point supervision (PointSupervision, mowl.nn.el.pointloss)

MultiBoxEL and MultiELBE (objective="point" | "mixed" | "hybrid")

Supervises class regions via soft coordinate-minimum box membership \(m(x) = \min_{\text{coord}} \sigma((|o| - |x - c|)/\beta)\) and noisy-OR union membership \(m_C(x) = 1 - \prod_i (1 - m_{C_i}(x))\) over canonical elements of satisfiable named classes and individuals (aliasing individual elements to ind_embed, with a virtual box of half-width ind_halfwidth defaulting to \(5\beta\) around ind_embed for individual targets in role edges), plus volume_reg log-side-length regularisation. Under "point" and "mixed", ABox class_assertion is still trained in the main loop via \(-\log m_C(a)\) while object_property_assertion is zeroed; "mixed" retains the backbone’s \(\bot\)-axiom losses (gci0_bot, gci1_bot, gci3_bot), and "hybrid" retains all GCI and ABox losses alongside the point losses. Class assertions are scored by \(-\log m_C(a)\).

\(|\text{elements}| \times d\) point table elem_embed

Structural objective (mowl.nn.el.structural)

MultiBoxEL and PrismEL (objective="structural")

Materialises regions with signed half-widths (Regions and PrismRegions), compiles acyclic conjunction definitions \(A \equiv X \sqcap Y\) (DefinitionTable), and supervises satisfiable classes and conjunction pairs via signed non-emptiness (ExistenceTargets, existence_loss()) and single-coordinate separation in gci1_bot. At margin \(0\) with structural_definitions=True, zero sum of the structural box losses and the existence term implies that the materialised regions form a geometric model of the box normal forms with every satisfiable class and listed conjunction non-empty; the converse holds when every active non-empty source slot (in gci0) or pair slot (in gci1) is covered by a single active target slot (see the Non-guarantees below; role normal forms inherit Box²EL/PrismEL guarantees, and an all-empty target makes a role score vacuously \(0\)).

\(K = \text{max\_components}\) slots in \(\mathbb{R}^d\) (MultiBoxEL, default \(k^2\)) or single prisms in \(\mathbb{R}^2 \times \mathbb{R}^{d-2}\) (PrismEL)

Limitations and caveats

  1. ABox nominal encoding in :class:`~mowl.geometric.completion.CanonicalModel`

    • Fragment for sound and complete instance checking: normalise() encodes each named individual \(a\) as a fresh nominal concept name \(N_a = \text{nominal\_name}(a)\) (prefix http://mowl.borg/nominal/ followed by the percent-encoded IRI), translating atomic ClassAssertion(C, a) into NF1(N_a, C) and ObjectPropertyAssertion(r, a, b) into NF3(N_a, r, N_b). Instance checking (instance_of()) and assertion contradiction (assertion_contradicted()) are sound and complete for \(\mathcal{ELH}\) (with \(\bot\)) without nominals (ObjectOneOf), functionality (FunctionalObjectProperty), and range (ObjectPropertyRange) axioms.

    • Separation of ``concept_names`` and ``names``: concept_names excludes nominal names \(N_a\), whereas names keeps all satisfiable concept and nominal names so that constructive region builders assign every satisfiable individual a non-empty region.

    • Inconsistent individuals and unsupported ABox axioms: If completion derives \(N_a \sqsubseteq \bot\) for any individual \(a\), constructing CanonicalModel raises InconsistentOntology naming \(a\). Unsupported ABox axioms (complex ClassAssertion, SameIndividual, DifferentIndividuals, ObjectPropertyAssertion with an inverse property, assertions on anonymous individuals, and negative or data assertions) are never dropped silently and raise UnsupportedAxiomError during normalise().

  2. Polyhedral dimension equals canonical-model size minus one (:math:`k = |Delta^{mathcal{I}}| - 1`) In ConvexPolyhedralModel, the ambient dimension is \(k = n - 1\), where \(n = |\text{cm.names}|\) includes all satisfiable original concept names, nominal names, owl:Thing, and any auxiliary concept names introduced by ELNormalizer. This is an upper bound: a dimension linear in the number of concept names is unavoidable in the worst case for convex models that realise the relevant conjunctions (Gutiérrez-Basulto & Schockaert, KR 2018, Prop. 4), but \(|\Delta^{\mathcal{I}}| - 1\) itself, which counts auxiliary names and \(\top\), need not be minimal. LP checks over role polyhedra scale with \(n\). For large ontologies, prefer IntervalUnionModel.

  3. Polyhedral regions are lower-dimensional simplex faces unless ``thicken=True`` By default (thicken=False), each class region \(\eta(A)\) in ConvexPolyhedralModel is the simplex face \(F(A^{\mathcal{I}}) = \text{conv}\{v_i : i \in A^{\mathcal{I}}\}\), which is non-empty for every satisfiable concept name but has zero Lebesgue volume (no interior in \(\mathbb{R}^{n-1}\)) whenever \(|A^{\mathcal{I}}| < n\). This is required for exact satisfaction of role axioms (NF3 and NF4). For role-free (propositional) ontologies, passing thicken=True replaces each face by a full-dimensional ThickFace with non-empty interior (\(\varepsilon = \tfrac{1}{2n}\)); passing thicken=True when role axioms are present raises UnsupportedAxiom.

  4. Box builder is propositional-only, may be inconclusive, and produces zero-width boxes

    • Propositional fragment only: BoxModelBuilder supports NF1 and NF2 (including \(\bot\) forms). Any role axiom (NF3, NF4, NF6, or NF7) raises UnsupportedAxiom.

    • Which certificates reject: in both faithful="weak" and faithful="strong" mode, the builder raises NotBoxRepresentable only on a non-degenerate certificate. A strong certificate alone does not reject faithful="strong": it excludes conjunction-faithful box models, not box models strongly faithful on names. For example, \(\{X_1 \sqcap X_2 \sqsubseteq Y,\; Y \sqcap X_3 \sqsubseteq \bot\}\) has the strong certificate \((X_1, X_2, X_3)\), yet the 1-D boxes \(X_1 = [0, 1], X_2 = [2, 3], X_3 = [4, 5], Y = [6, 7]\) are a non-degenerate model that is strongly faithful on names.

    • Inconclusive MILP outcome: A passing Helly check does not guarantee that an axis-parallel box model exists (no such sufficiency theorem is known); box_representable_* = True means only that the ontology is obstruction-free. Only a Helly certificate (NotBoxRepresentable) is a proof of impossibility; when no certificate is found and the MILP fails for all \(d \le d_{\max}\) or reaches time_limit without an incumbent that passes the post-check, build() raises BoxModelNotFound (inconclusive). The builder is intended for small ontologies; the MILP is exponential in the worst case.

    • Zero-width (degenerate) boxes: Because the MILP objective minimises total box width \(\sum_{A,i} (U_{A,i} - L_{A,i})\), returned boxes frequently satisfy \(\text{lo} = \text{hi}\) (single points, which are non-empty under closed-box semantics). Users exporting boxes via boxes_as_tensors() to seed gradient-based models that require positive box volume should add a small positive margin to the exported offsets (or upper corners) or modify the objective.

  5. ``HellyReport.complete`` and conservative ``box_representable_nondegenerate``

    • HellyReport.complete is True if and only if the minimal jointly unsatisfiable set enumeration was not cut off by k_max or max_certificates and the ontology contains no role axioms (has_roles == False). Whenever role axioms are present, complete is False (Leemhuis & Kutz, NAI 2026, Prop. 38), though any returned certificate remains a sound proof of non-box-representability.

    • Non-degenerate certificates exclude every non-degenerate box model in any dimension. Strong certificates exclude only conjunction-faithful box models, in which every satisfiable conjunction of concept names is non-empty; this is stronger than strong faithfulness on names.

    • box_representable_nondegenerate / box_representable_strong equal to True means “no Helly obstruction of this kind was found” (obstruction-free), not that a box model exists. Build one with BoxModelBuilder to find out.

    • When complete=True, the enumeration is exact for the strong reading (box_representable_strong / certificates_strong). For the non-degenerate reading, whether a certificate is non-degenerate depends on how an unsatisfiable concept set is split into \((C_1, C_2, C_3)\), and the union of names in a non-degenerate certificate need not itself be inclusion-minimal. Therefore box_representable_nondegenerate is conservative: it is False when certificates_nondegenerate is non-empty, True only when complete=True and certificates_strong is empty, and None otherwise.

    • Scaling: helly_check() re-saturates the ontology per candidate set and is intended for small to medium ontologies; incremental joint satisfiability is future work.

  6. Lossy bounding-box export to_bounding_boxes() replaces each simplex face of a ConvexPolyhedralModel by its elementwise coordinate minimum and maximum. Because axis-parallel bounding boxes of simplex faces intersect strictly more often than the faces themselves, the resulting boxes do not satisfy the ontology’s disjointness or conjunction axioms and must never be treated as a model.

  7. Projected box initialisation (:class:`~mowl.geometric.init.ExactBoxInit`) and ``certificate_triangles``

    • Satisfiable subclasses only; no disjointness under projected init: With method="projected" and n_components=1, ExactBoxInit places each canonical domain element at a Gaussian point in \(\mathbb{R}^d\) and assigns each satisfiable concept name the padded bounding box of its extension. Because bounding boxes are monotone under set inclusion, \(\text{box}(C) \subseteq \text{box}(D)\) holds (up to float32 rounding, 1e-6) for every entailed atomic subsumption \(C \sqsubseteq D\) with a satisfiable subclass \(C\) (giving zero gci0 loss at margin \(0\) immediately after apply_to_module()). Axioms \(U \sqsubseteq A\) with an unsatisfiable subclass \(U\) are not covered (unsatisfiable concepts and BOTTOM are placed as point boxes at the origin, and no single point placement can satisfy subsumptions into mutually disjoint superclasses). Disjointness (\(A \sqcap B \sqsubseteq \bot\)) is not guaranteed under method="projected" because projected bounding boxes overlap.

    • Incompleteness of certificate_triangles(): certificate_triangles() enumerates triangles in the graph of direct NF2 definitions (\(A \sqcap B \sqsubseteq N\) with \(\mathcal{O} \models N \equiv A \sqcap B\)). Every returned certificate is a sound non-degenerate singleton HellyCertificate, but the procedure is not complete: pairwise conjunctions defined through chains of equivalences or multi-step normalisations without a direct NF2(A, B, N) axiom, as well as higher-arity certificates where \(|C_i| > 1\), are not found.

  8. MultiBoxEL (:class:`~mowl.models.MultiBoxEL`, :class:`~mowl.nn.MultiBoxELModule`) and MultiELBE (:class:`~mowl.models.MultiELBE`, :class:`~mowl.nn.MultiELBEModule`)

    • Exact \(k = 1\) identity: When n_components=1, component_aggregation="hard", component_reg=0.0, and diversity_reg=0.0, MultiBoxELModule agrees with BoxSquaredELModule and MultiELBEModule agrees with ELBEModule at equal margin to within 1e-6 on every GCI loss (positive and negative, including gci1 batches containing empty pairwise intersections). Note that MultiELBE defaults to margin=0.1 (matching ELBEModule), whereas the ELBE wrapper defaults to margin=0, so comparing the model wrappers requires passing an equal margin explicitly.

    • Gated pairwise intersections in gci1 and overlap semantics in MultiELBE.gci3: For \(C \sqcap D \sqsubseteq E\), let \((i^*, j^*) = \arg\min_{i,j} \text{empt}(C_i, D_j)\) be the designated component pair (selected without gradient). Under "hard" aggregation, the detached gate \(g_{ij} = 1\) if \(\text{lo}_{ij} \le \text{up}_{ij}\) in every coordinate or \((i, j) = (i^*, j^*)\), else \(0\), enforces inclusion into some component \(E_m\) only on intersecting pairs (plus the designated pair, which also receives \(\text{empt}(C_{i^*}, D_{j^*})\)). In MultiELBEModule, gci3_loss preserves ELBE’s coordinatewise overlap formula \(\|\text{relu}(|c - r - d| - o_c - o_d + \text{margin})\|_2\) rather than full box inclusion so that \(k = 1\) is identical to ELBE.

    • Coordinatewise separation in gci1_bot: In both backbones, gci1_bot_loss for \(C \sqcap D \sqsubseteq \bot\) aggregates coordinatewise separation across all \(k^2\) pairs. At margin \(0\), zero loss implies that all \(k^2\) component pairs are disjoint (up to boundary contact), but not conversely: two boxes separated in one coordinate whose projections overlap in another coordinate are disjoint in \(\mathbb{R}^d\) yet incur positive gci1_bot_loss.

    • Non-convexity: Taking minima over target components and gating over pairwise intersections yields a piecewise-smooth non-convex objective; gradient-based training is not guaranteed to converge to a global optimum from arbitrary random initialisations.

  9. Soft component aggregation (:mod:`mowl.nn.el.softagg`) and canonical-element point supervision (:mod:`mowl.nn.el.pointloss`)

    • Finite-temperature collapse pressure under soft aggregation and ``tau_end=0.05`` floor: At finite \(\tau > 0\), softmin() satisfies \(\min_j v_j \le \text{softmin}_\tau(v) \le \text{mean}_j v_j\) and is strictly positive at a hard model whenever non-nearest target components have positive inclusion scores, pulling all target components together unless counteracted by diversity_reg > 0 (diversity_penalty()). In float32, softmax weights \(\exp(-\Delta/\tau)\) underflow to exact 0.0 once the score gap \(\Delta\) exceeds \(\approx 100\tau\); tau_end therefore defaults to 0.05 rather than 0.01 so non-nearest components retain non-zero gradient throughout annealing. Although module.tau is persisted as a registered buffer in state_dict(), the geometric annealing schedule in on_epoch_start restarts from tau_start at each train() call.

    • Strict positivity of BCE and region vs. point model-ness under point supervision: Because soft_box_membership() takes the minimum over \(d\) coordinate sigmoids \(m(x) = \min_{\text{coord}} \sigma((|o| - |x - c|)/\beta)\) (which is dimension-free, avoiding the \(\sigma(|o|/\beta)^d\) decay of a coordinatewise product; individual targets in role edges use a virtual box of half-width ind_halfwidth defaulting to \(5\beta\) around ind_embed), at finite \(\beta > 0\) and finite box half-widths every coordinate sigmoid is strictly in \((0, 1)\), so \(0 < m(x) < 1\) strictly (and is clamped to \([\varepsilon, 1 - \varepsilon]\) in membership_bce()) and membership_bce() never reaches exact zero. Under objective="point", all TBox GCI losses and ABox object_property_assertion are zeroed (while ABox class_assertion is still trained in the main loop via \(-\log m_C(a)\)) because finite point sets do not forbid boxes from overlapping in empty space; objective="mixed" additionally keeps the backbone’s \(\bot\)-axiom losses (gci0_bot, gci1_bot, gci3_bot) alongside the point losses, and objective="hybrid" keeps all GCI and ABox losses alongside the point losses. Under "point", "mixed", and "hybrid", ABox class assertions are scored by \(-\log m_C(a)\) and point satisfaction is measured via point_modelness().

Structural objective (learning Helly-breaking structure from random initialisation)

Standard inclusion and disjointness hinge losses have an incomplete zero set because they are trivially satisfied by empty boxes, making shrinking a universal descent direction with the degenerate all-empty interpretation as a global minimum and nothing demanding that a satisfiable class or conjunction be non-empty. Normalising a definition \(A \equiv X_1 \sqcap X_2\) into three separate hinges (\(A \sqsubseteq X_1\), \(A \sqsubseteq X_2\), \(X_1 \sqcap X_2 \sqsubseteq A\)) on an independently parametrised \(A\) leaves slack between \(A\) and \(X_1 \cap X_2\) where the \(T_3\) frustration (pushing \(A\), \(B\), \(C\) apart vs. pulling \(A\) onto \(X_1 \cap X_2\)) lives instead of forcing the parent boxes to split. Because which component of \(X_1\) realises which part of \(X_1\) is discrete, nearest-component aggregation gives gradient only to the component already closest and a \(\operatorname{relu}(\text{overlap})\) non-emptiness term gives no gradient to a separated component pair, so descent keeps the single-spanning-box assignment implied by random initialisation (where three pairwise-intersecting spanning boxes always share a point by Helly’s theorem).

The opt-in objective="structural" mode (implemented in mowl.nn.el.structural, mowl.nn.el.multiboxel, and mowl.nn.el.prism) addresses all three defects for MultiBoxEL and PrismEL. The guarantee concerns the zero set of the loss, not convergence of the optimiser; as measured on the \(T_3\) fixture in the slow tests (empirical measurements, not a convergence guarantee; the synthetic sweep results live in the experiments repository), MultiBoxEL (\(k = 4\), \(K = 16\), \(d = 2\), re-seeding every 50 epochs) reached an exact, strictly non-empty Helly-breaking model (strict_loss == 0, minimum target class size \(\ge 0.0173 > 0\), minimum target pair size \(\ge 0.0179 > 0\), and \(X_1 \cap X_2 \cap X_3 = \emptyset\)) in 4 of 5 measured seeds and PrismEL (\(d = 3\)) in 5 of 5 measured seeds (strict_loss == 0, minimum target class and pair prism_nonempty_measure \(\ge 0.0100 > 0\), and \(X_1 \cap X_2 \cap X_3 = \emptyset\)):

  1. Regions with signed half-widths and absent slots (:class:`~mowl.nn.el.structural.Regions`): Every class \(C\) is materialised as \(K = \text{max\_components}\) component slots (cen, w, active), each a box \((c, w)\) with centre \(c \in \mathbb{R}^d\), signed half-width \(w \in \mathbb{R}^d\) (negative in coordinate \(m\) iff the slot is empty along coordinate \(m\)), and boolean active flag:

    • Primitive class: slots 0 .. k - 1 hold the raw embedding rows (\(w = |o| \ge 0\), active = True); slots k .. K - 1 are inactive (cen = 0, w = -1).

    • Defined class \(A := X \sqcap Y\): pair_slots() forms all pairs \((X_i, Y_j)\) of parent slots with \(\text{lower} = \max(c_X - w_X, c_Y - w_Y)\), \(\text{upper} = \min(c_X + w_X, c_Y + w_Y)\), \(c = (\text{lower} + \text{upper})/2\), and \(w = (\text{upper} - \text{lower})/2\) (negative in a coordinate \(\iff\) the pair is disjoint there); a pair slot is active iff both parent slots are active, with active pairs packed into leading slots in lexicographic \((i, j)\) order and remaining slots padded as inactive (cen = 0, w = -1).

    • Derived differentiable quantities:

      • nonempty_measure(): \(\text{ne}(a) = \min_m 2 w_{a,m}\) — minimum signed width; slot \(a\) is non-empty iff \(\text{ne}(a) > 0\).

      • signed_overlap(): \(\text{sov}_m(a, b) = \min(c_a + w_a, c_b + w_b)_m - \max(c_a - w_a, c_b - w_b)_m\) — signed overlap per coordinate, with \(\text{ne}(a \cap b) = \min_m \text{sov}_m(a, b)\).

      • region_size() and pair_size(): \(\text{NE}(C) = \max_{i \text{ active}} \text{ne}(C_i)\) and \(\text{NE}(C \sqcap D) = \max_{(i,j) \text{ active}} \text{ne}(C_i \cap D_j)\). The maximum selects the nearest active pair even when all pairs are separated (negative values), routing gradient to pull separated components together.

      • inclusion_tight(): \(\text{incl}_m(a, b) = \|\operatorname{relu}(|c_a - c_b| + w_a - w_b + m)\|_2\) — tight inclusion with margin \(m \ge 0\) (positive \(m\) tightens, ELBE convention), equal to \(0\) at \(m = 0\) iff \(a \subseteq b\) coordinatewise (for non-empty \(a\)).

    • Absent-slot export convention: A slot that is inactive (active == False) or has \(w_m < 0\) for some coordinate \(m\) is absent. class_regions() and all_class_regions() return w = -1 in every coordinate and cen = 0 for inactive slots; consumers exporting (centers, offsets) arrays mark any absent slot (\(\neg\text{active} \vee \min_m w_m < 0\)) with offsets = -1 and centers = 0, so standard corner arithmetic (\(\text{lo} = c - o > \text{hi} = c + o\)) treats absent slots as empty automatically.

  2. Definition table (:class:`~mowl.nn.el.structural.DefinitionTable`): Built once per train() / train() call via from_normal_forms() from the training normal forms (gci0 rows \((C, D)\), gci1 rows \((C, D, E)\), and optional gci2 rows \((C, r, D)\) and gci3 rows \((r, C, D)\)):

    • Candidate (including role auxiliaries): \(A\) is a candidate defined class with definers \((X, Y)\) iff there is a gci1 row \((X, Y, A)\) with \(X \neq Y\), \(A \notin \{X, Y\}\), none of \(A, X, Y\) equal to owl:Thing or owl:Nothing, and each required inclusion \((A, D)\) for \(D \in \{X, Y\}\) is satisfied either directly by a gci0 row \((A, D)\) or through a role auxiliary by a gci2 row \((A, r, C)\) together with a gci3 row \((r, C, D)\) sharing the same \(r\) and \(C\) (i.e. \(A \sqsubseteq \exists r.C \sqsubseteq D\) is entailed, which is how ELNormalizer normalises definitions of the form \(A \equiv X \sqcap \exists r.C\) into \(A \sqsubseteq X\), \(A \sqsubseteq \exists r.C\), \(\exists r.C \sqsubseteq \text{Aux}\), and \(X \sqcap \text{Aux} \sqsubseteq A\); definitions whose normalisation introduces nested auxiliaries on both sides—e.g. \(A \equiv \text{Pizza} \sqcap \exists\text{hasTopping}.(\text{PizzaTopping} \sqcap \exists\text{hasSpiciness}.\text{Hot})\), which yields \(A \sqsubseteq \exists r.\text{Aux}_1\) and \(\exists r.\text{Aux}_2 \sqsubseteq \text{Aux}_3\) with \(\text{Aux}_1 \neq \text{Aux}_2\)—are not detected, only a single role-auxiliary step \(A \sqsubseteq \exists r.C \sqsubseteq \text{Aux}\) is). If several \((X, Y)\) qualify for the same \(A\), the lexicographically smallest \((\min(X, Y), \max(X, Y))\) is selected.

    • Bottom-up acceptance and cap: Candidates are processed in topological order of the candidate dependency graph (a candidate is ready once its definers are decided), with ties broken by increasing class index (Kahn’s algorithm with a min-heap in \(O((|G_0| + |G_1|) \log n)\) time). A ready candidate \(A \to (X, Y)\) is accepted iff \(\text{comps}(X) \cdot \text{comps}(Y) \le \text{max\_components}\) (and \(\text{level}(A) \le \text{max\_level}\) when given), where \(\text{comps}(P) = k\) for primitive classes and \(\text{comps}(X) \cdot \text{comps}(Y)\) for accepted defined classes, and \(\text{level}(A) = 1 + \max(\text{level}(X), \text{level}(Y))\) (\(\text{level} = 0\) for primitive classes). Because definers are final at acceptance time, nothing accepted earlier can be invalidated. When only cyclic (or cycle-blocked) candidates remain, the undecided candidate with the lowest class index is rejected (stays primitive) and processing resumes (deterministic, though possibly lossy because the lowest-index undecided candidate may sit downstream of a cycle rather than on it). A level-\(\ell\) class has at most \(k^{2^\ell}\) slots (when both definers are at level \(\ell - 1\)) and \(k^{\ell+1}\) slots for a chained definition \(A \equiv \text{Aux} \sqcap X\) (the shape emitted by ELNormalizer for \(n\)-ary conjunctions); max_components (default \(k^2\), one level) bounds this blow-up.

    • Masked rows: For every accepted \(A \to (X, Y)\), the rows \((A, X)\) and \((A, Y)\) in gci0 (masked_gci0()) and \((X, Y, A)\) and \((Y, X, A)\) in gci1 (masked_gci1()) hold by construction and evaluate to exact 0.0 loss in training and evaluation; when \((A, \text{Aux})\) is only entailed through the role auxiliary, no gci0 row exists for it and therefore only \((A, X)\) and the gci1 rows are masked, while the gci2 and gci3 rows are not masked and keep training \(\text{Aux}\)’s region. Setting structural_definitions=False disables the table (every class stays primitive and nothing is masked).

  3. Structural losses (:class:`~mowl.models.MultiBoxEL`) and existence / size terms: All box normal-form losses are per axiom row, squared hinges with tightening margin \(m\) (module.margin, default 0.02 on MultiBoxEL and 0.1 on PrismEL), where \([\cdots]^{\text{det}}\) denotes a detached gate and means/minima are over active slots:

    Structural normal-form losses for MultiBoxELModule

    Normal form

    Structural loss (per row)

    \(C \sqsubseteq D\) (gci0, gci0_structural())

    \(\operatorname{mean}_{i:\,\text{active},\,\text{ne}(C_i)>0}^{\text{det}} \min_{j \text{ active}} \text{incl}_m(C_i, D_j)^2\); 0 if no active non-empty \(C_i\) or if the row is masked

    \(C \sqsubseteq \bot\) (gci0_bot, gci0_bot_structural())

    \(\operatorname{mean}_{i \text{ active}} \operatorname{relu}(\text{ne}(C_i))^2\) (no margin: primitive widths satisfy \(w = |o| \ge 0\), so a positive margin would impose a floor on the loss)

    \(C \sqcap D \sqsubseteq E\) (gci1, gci1_structural())

    \(\operatorname{mean}_{(i,j):\,\text{active},\,\text{ne}(C_i \cap D_j)>0}^{\text{det}} \min_{l \text{ active}} \text{incl}_m(I_{ij}, E_l)^2\) with \(I_{ij}\) the pair slot; 0 if no pair is non-empty (vacuous; no emptiness penalty) or the row is masked

    \(C \sqcap D \sqsubseteq \bot\) (gci1_bot, gci1_bot_structural())

    \(\operatorname{agg}_{(i,j) \text{ active}} \operatorname{relu}(\text{ne}(C_i \cap D_j) + m)^2\) with agg = bot_agg \(\in \{\text{"mean"}, \text{"sum"}\}\) (default "mean"; "sum" sums over active pairs instead of dividing by the active-pair count, with module slots gated to active non-empty components \(\text{ne} > 0\): identical zero set at \(m = 0\), deviating from gating on active alone only at \(m > 0\)) — separation by \(m\) in at least one coordinate

    \(C \sqsubseteq \exists r.D\), \(\exists r.C \sqsubseteq D\), \(\exists r.C \sqsubseteq \bot\), and ABox assertions (gci2, gci3, gci3_bot, class_assertion, object_property_assertion)

    Existing Box²EL multibox scores (hard aggregation, with gci3 and gci3_bot squared) evaluated on the materialised slots \((c, |w|)\) with inactive or empty slots (\(\neg\text{active} \vee \text{ne}(w) \le 0\)) masked out (source slots excluded from means, target slots excluded from minima); because Box²EL gamma loosens inclusions (\(\operatorname{relu}(\text{dist} + 2o - \gamma)\)), positive role and assertion scores pass gamma = -m (tightening inclusion by \(m\)), whereas negative scores (gci2_score_neg() and negative object_property_assertion) keep Box²EL’s convention (gamma = +margin, which relaxes them by the margin), so the negative-sampling term is unchanged between the axiom and structural objectives; class bumps remain per-class embedding rows

    Additional per-epoch terms returned by additional_training_loss() via structural_extra_loss():

    • Existence (weight existence_weight, default 1.0, existence_loss()):

      \[\operatorname{mean}_{C \in \text{Sat}} \operatorname{relu}(m - \text{NE}(C))^2 + \operatorname{mean}_{(C, D) \in \text{SatPairs}} \operatorname{relu}(m - \text{NE}(C \sqcap D))^2,\]

      where ExistenceTargets collects Sat (satisfiable classes excluding \(\top, \bot\)) and SatPairs (distinct unordered pairs \((C, D)\) occurring in gci1 rows with \(C \sqcap D\) satisfiable). When a canonical_model (CanonicalModel) is passed, satisfiability for IRIs in canonical_model.concept_names comes from is_satisfiable() and joint_satisfiable(), while IRIs unknown to canonical_model.concept_names fall back to the asserted gci0_bot/gci1_bot rules for both single classes and pairs (note that auxiliary classes minted by ELNormalizer, http://mowl.borg/aux/..., are unknown to a CanonicalModel built with mowl.geometric’s own normaliser, so their entailed unsatisfiability cannot be detected via canonical_model and uses the asserted rules only); otherwise a class is assumed satisfiable unless a gci0_bot row \((C, \bot)\) exists and a gci1 pair unless either class appears in gci0_bot or \((C, D)\) appears in gci1_bot.

    • Size (weight size_reg, default 1e-3): mean of \(2|o|\) over raw primitive slots and coordinates (excluding \(\top\) and accepted defined classes), keeping spare components small so they can be relocated and discouraging single spanning boxes.

    • Witness points (weight witness_weight, default 0.0, witness_loss()): when witness_weight > 0, allocates module.witness_embed with one learnable witness point \(w_C \in \mathbb{R}^d\) per satisfiable class \(C \in \text{targets.witness.classes}\) (WitnessTargets) and adds

      \[\operatorname{mean}_{(C, D) \in \text{pos}} \operatorname{relu}(m - \text{inside}(w_C, D))^2 + \operatorname{mean}_{(C, D) \in \text{neg}} \operatorname{relu}(\text{inside}(w_C, D) + m)^2,\]

      where inside_measure() evaluates \(\text{inside}(p, D) = \max_{s \text{ active}} \min_m (w_{D,s,m} - |p_m - c_{D,s,m}|)\) on the materialised class_regions() of \(D\) (returning -1e6 if no slot is active), pos collects \((w_C, D)\) with \(C \sqsubseteq D\) (via entails() when canonical_model is given, or \(\{C\} \cup \{D : (C, D) \in \text{gci0}\}\) otherwise), and neg collects satisfiable \(D\) disjoint from \(C\) (via not canonical_model.joint_satisfiable([C, D]) when canonical_model is given, or asserted gci1_bot partners otherwise), excluding \(\top\) and \(\bot\) throughout. Witness coordinates can be inspected via witness_points().

    • Guarantee: With structural_definitions=True, at margin \(m = 0\), zero sum of the structural box losses (gci0, gci0_bot, gci1, gci1_bot) and the existence term implies that the materialised regions form a geometric model of the box normal forms in which every satisfiable class and listed conjunction is non-empty (up to boundary contact \(w_m = 0\)); the converse holds when every active non-empty source slot (in gci0) or pair slot (in gci1) is covered by a single active target slot (see the Non-guarantees bullet below), while role normal forms inherit the Box²EL guarantees.

    • Non-guarantees: In gci2, gci3, and class_assertion, masking out empty target slots means that an all-empty target (a target class \(D\) with no active non-empty slot) makes the target minimum fall back to 0.0 and renders the role or assertion score (or the target half of gci2) vacuously 0 unless the existence term forces \(D\) to be non-empty; similarly, in the negative score gci2_score_neg(), an all-masked (empty) source \(C\) makes the source half return 0.0 rather than \(\delta^2\) (and 0.0 overall when both source and target are all-masked). Because \(\top\) (owl:Thing) is excluded from ExistenceTargets, axioms with \(\top\) on the left-hand side are vacuous if \(\top\) collapses to an empty region. Furthermore, region_size() and pair_size() route gradient only through the argmax active slot or pair, and each non-empty source slot \(C_i\) in gci0 or pair slot \(C_i \cap D_j\) in gci1 must be covered by a single active target slot rather than a union of several target slots.

  4. Re-seeding (:meth:`~mowl.nn.MultiBoxELModule.reseed`): Controlled by reseed_every (reseed_every=0 is the default, which disables re-seeding), reseed_mode ({"dead", "idle"}, default "dead"), reseed_size (float = 0.15), and reseed_batch (int = 1); re-seeding is a heuristic discrete move rather than part of the continuous objective. When reseed_every > 0 under objective="structural", at the start of every reseed_every-th epoch (epoch > 0), on_epoch_start() invokes reseed() under torch.no_grad() on the raw embedding rows of primitive classes:

    • reseed_mode="dead" (default):

      • A primitive component \(i\) of \(C\) is classified as dead if it is nested inside another active valid component \(j\) of \(C\) (\(\text{lo}_j \le \text{lo}_i\) and \(\text{hi}_i \le \text{hi}_j\) in every coordinate, exact ties resolved by lower index) or has \(\min_m |o_{i,m}| < 10^{-3}\).

      • Violated pair targets \((C, D)\) (\(\text{NE}(C \sqcap D) < m\)) are processed in a seeded random order (seed points_seed + epoch), using each dead component at most once per epoch: take a dead component of \(C\) if available, else of \(D\); let \(P\) be the partner class and \(P_j\) its active slot with largest \(\text{ne}(P_j) > 0\), and set \(c_i := c_{P_j}\), \(o_i := 0.5 \cdot |w_{P_j}|\).

      • Violated primitive class targets (\(\text{NE}(C) < m\)) have the offset of their largest-measure component clamped to \(\max(|o|, m)\).

      • The number of moves is stored in module.last_reseed_count; optimiser moments of moved rows are not reset.

    • reseed_mode="idle" (requires witness_weight > 0, raising ValueError otherwise, and uses reseed_size: float = 0.15 and reseed_batch: int = 1):

      1. Dead defined classes: accepted defined \(A\) with \(\text{NE}(A) = \max_{s \text{ active}} \text{ne}(A_s) < m\).

      2. Usage counts \(u[X, c]\) over primitive \(X\) and component \(c\): number of accepted defined classes \(A'\) with \(\text{NE}(A') \ge m\) whose best slot (\(\arg\max \text{ne}\)) uses component \(c\) of \(X\), where the slot-to-component map (slot_components()) follows the recursion of class_regions() / pair_slots() (a slot of \(A \to (X, Y)\) is a pair of a slot of \(X\) and a slot of \(Y\), recursing to primitives).

      3. Process dead defined classes in a seeded random order (rng.permutation), at most reseed_batch per call. For \(A\) with witness \(p\): for each primitive leaf \(X\) of \(A\)’s definition tree (deduplicated): if some active component \(c\) of \(X\) has \(\text{inside}(p, X_c) \ge m\), skip \(X\); else \(c^* = \arg\min_c u[X, c]\) (lowest index on ties), \(\text{center}[X, c^*] := p + 0.01 \cdot \mathcal{N}(0, I)\) (seeded through rng), \(\text{offset}[X, c^*] := \text{reseed\_size}\) in every coordinate, \(u[X, c^*] \mathrel{+}= 1\). Count one move per re-seeded component.

      4. Keep step 3 of the "dead" mode (clamp the largest component of a primitive class target with \(\text{NE} < m\) to \(\max(|o|, m)\)).

      5. module.last_reseed_count as before; optimiser moments are not reset.

  5. Prisms (:class:`~mowl.models.PrismEL`, :class:`~mowl.nn.PrismModule`): Under PrismEL(..., margin=0.1, objective="structural", max_depth=8, structural_definitions=True, existence_weight=1.0, size_reg=1e-3, canonical_model=None), each class is materialised as a single prism PrismRegions (h, cen, w) with support vector \(h \in \mathbb{R}^3\), box centre \(\text{cen} \in \mathbb{R}^{d-2}\), and signed box half-width \(w \in \mathbb{R}^{d-2}\). Non-emptiness is measured by prism_nonempty_measure(): \(\text{ne}(P) = \min(\sum_{k=1}^3 h_k,\; \min_m 2 w_m)\) (strictly positive iff non-empty; \(\sum_{k=1}^3 h_k = 3|\rho| \ge 0\) for primitive prisms). Definitions are evaluated recursively with prism_regions_intersection() (\(h = \min(h_X, h_Y)\) and signed box half-widths from prism_intersection()); because intersecting two prisms yields a single prism, there is no slot blow-up (\(k = 1\)) and acceptance only requires acyclicity and \(\text{level} \le \text{max\_depth}\).

    Structural normal-form losses for PrismModule

    Normal form

    Structural prism loss (per row)

    \(C \sqsubseteq D\) (gci0, gci0_structural())

    \([\text{ne}(C) > 0]^{\text{det}} \bigl(\|\operatorname{relu}(h_C - h_D + m)\|_2^2 + \|\operatorname{relu}(|\text{cen}_C - \text{cen}_D| + w_C - w_D + m)\|_2^2\bigr)\) on signed widths \(w_C, w_D\) (equivalent to \(\text{prism\_inclusion\_score}(C, D, m)^2\) for non-negative widths; masked rows 0)

    \(C \sqsubseteq \bot\) (gci0_bot, gci0_bot_structural())

    \(\operatorname{relu}(\text{ne}(C))^2\)

    \(C \sqcap D \sqsubseteq E\) (gci1, gci1_structural())

    \([\text{ne}(I) > 0]^{\text{det}} \bigl(\|\operatorname{relu}(h_I - h_E + m)\|_2^2 + \|\operatorname{relu}(|\text{cen}_I - \text{cen}_E| + w_I - w_E + m)\|_2^2\bigr)\) with \(I = C \cap D\) on signed widths \(w_I, w_E\) (equivalent to \(\text{prism\_inclusion\_score}(C \cap D, E, m)^2\) for non-negative widths), masked rows 0, and no emptiness penalties on \(C \cap D\) (the existence term owns them)

    \(C \sqcap D \sqsubseteq \bot\) (gci1_bot, gci1_bot_structural())

    \(\operatorname{relu}(\text{ne}(C \cap D) + m)^2\)

    gci2, gci3, gci3_bot, and assertions

    Existing prism scores (gci2_score_prisms(), gci2_score_neg_prisms(), gci3_score_prisms(), gci3_bot_score_prisms(), class_assertion_score_prisms(), object_property_assertion_loss()) on materialised prisms with |w| (unsquared norms/hinges)

    The existence term uses \(\text{NE}(C) = \text{ne}(C)\) and \(\text{NE}(C \sqcap D) = \text{ne}(C \cap D)\), and the size term averages \(|\rho|\) and \(2|o|\) over primitive classes (excluding \(\top\)). There is no re-seeding (single component). Under objective="structural", PrismEL.compute_loss returns pos_scores.mean() directly (without an outer squaring): only the box structural GCI losses (gci0, gci0_bot, gci1, gci1_bot) are squared hinges, whereas the prism role and assertion scores (gci2, gci3, gci3_bot, class_assertion, object_property_assertion) are unsquared norms/hinges that enter linearly (while still adding MSE(neg_scores.mean(), 1) when neg_scores is present).

    • Prism non-guarantees: Because the prism role and assertion scores take \(|w|\) on materialised defined classes, a defined class that is empty only in its box part (\(w_m < 0\) in some coordinate while \(\sum_k h_k > 0\)) becomes a phantom non-empty box of half-width \(|w_m| > 0\) in gci2, gci3, and class_assertion. In addition, gci3_bot_score_prisms() (\(\operatorname{relu}(\sum_k h_{C,k} + m)\)) shrinks \(C\) itself, which conflicts with the existence term whenever \(C\) is satisfiable.

  6. Public interface:

    • MultiBoxEL(dataset, ..., margin=0.02, objective="structural", max_components=None, structural_definitions=True, existence_weight=1.0, size_reg=1e-3, reseed_every=0, canonical_model=None, bot_agg="mean", witness_weight=0.0, reseed_mode="dead", reseed_size=0.15, reseed_batch=1) (where max_components=None defaults to \(k^2\), bot_agg is "mean" or "sum", reseed_mode is "dead" or "idle", and component_aggregation must be "hard").

    • PrismEL(dataset, ..., margin=0.1, objective="structural", max_depth=8, structural_definitions=True, existence_weight=1.0, size_reg=1e-3, canonical_model=None).

    • Default objective="axiom" leaves every existing code path unchanged. Negative sampling stays enabled under objective="structural" just as in the objective="axiom" path.

    • Module region and table inspection: MultiBoxELModule.class_regions(idx) \(\to\) Regions (cen (B, K, d), w (B, K, d), active (B, K)) and MultiBoxELModule.all_class_regions() (detached on CPU); PrismModule.class_regions(idx) \(\to\) PrismRegions (h (B, 3), cen (B, d - 2), w (B, d - 2)) and PrismModule.all_class_regions() (detached on CPU); module.definition_table (DefinitionTable), module.existence_targets (ExistenceTargets), module.top_idx, and module.margin (tightening margin under both models when objective="structural", passed as gamma = -margin to positive Box²EL role/assertion scores and gamma = +margin to negative Box²EL role/assertion scores: default 0.02 on MultiBoxEL and 0.1 on PrismEL). Both models build definition_table and existence_targets via build_structural_tables() at the start of train(), cache them on the model, and preserve them across init_module(), load_best_model(), and from_pretrained().

    Recommended settings for learning from random initialisation (witness-point recipe): On deep conjunction chains such as the Helly-obstruction family \(T_k\) (\(A_i \equiv \sqcap_{j \neq i} X_j\) with \(A_i \sqcap A_j \sqsubseteq \bot\)), the round-4 defaults (bot_agg="mean", witness_weight=0.0, reseed_every=0, reseed_mode="dead", size_reg=1e-3) can fall into a component-assignment Helly trap: every live defined class selects the same component of each shared primitive \(X_j\) (reducing each \(A_i\) to a single box while spare components stay idle), and averaging gci1_bot over \(4^{k-1}\) slot pairs dilutes the single overlapping pair against \(\text{existence\_loss}\). Combining bot_agg="sum" (un-diluted disjointness penalties), witness_weight=1.0 (one learnable witness point \(w_C\) per satisfiable class pushed inside its entailed superclasses and outside disjoint classes), and reseed_every=50..100, reseed_mode="idle", size_reg=0.0 (relocating the least-used primitive leaf components of dead defined classes to their witness points with half-width reseed_size=0.15) breaks the component-sharing symmetry and reliably finds exact multi-component box models from random initialisation. See the gallery tutorial Witness-Point Structural Training on the Helly Counterexample T_k for a self-contained demonstration and 2-D visualisations on \(T_3\) and \(T_5\).

References

  • V. Gutiérrez-Basulto and S. Schockaert, From Knowledge Graph Embedding to Ontology Embedding? An Analysis of the Compatibility between Vector Space Representations and Rules, in Proceedings of KR 2018 (arXiv:1805.10461), Propositions 3 and 4.

  • V. Lacerda, A. Ozaki, and R. Guimarães, Strong Faithfulness for ELH Ontology Embeddings, Transactions on Graph Data and Knowledge (TGDK) 2(3):2, 2024, Definitions 2, 8, 12 and Theorems 13, 16, 18, 25.

  • M. Leemhuis and O. Kutz, Understanding the Expressive Capabilities of Knowledge Base Embeddings under Box Semantics, in Proceedings of NeSy 2025 (PMLR 284:303–321), Definitions 1, 3, 6 and Propositions 4, 5, 8.

  • M. Leemhuis and O. Kutz, Trustworthy Knowledge Base Embeddings: A Foundational Study of Box Semantics, Neurosymbolic Artificial Intelligence (NAI), 2026, Proposition 38 (incompleteness of ABox-closure Helly tests in the presence of roles).

  • G. Federico, M. Leemhuis, and O. Kutz, Introducing Multiboxes: Increasing the Trustworthiness of Ontology Embeddings, in Proceedings of JOWO 2026 (OSETAI workshop), Theorem 3 (1-D case).

  • G. Federico, M. Leemhuis, and O. Kutz, Introducing Prism Embeddings, in Proceedings of DL 2026, §3–4.

  • C. Bourgaux, R. Guimarães, R. Koudijs, V. Lacerda, and A. Ozaki, Knowledge Base Embeddings: Semantics and Theoretical Properties, in Proceedings of KR 2024, Definitions 5–6 and Remark 2.

  • Y. Kazakov, M. Krötzsch, and F. Simančík, The Incredible ELK: From Polynomial Procedures to Efficient Reasoning with EL Ontologies, Journal of Automated Reasoning 53(1):1–61, 2014.

  • F. Baader, S. Brandt, and C. Lutz, Pushing the EL Envelope, in Proceedings of IJCAI 2005.

  • J. Eckhoff, Intersection properties of boxes. Part I: An upper-bound theorem, Israel Journal of Mathematics 62(3):283–301, 1988.

Development setup

To work on mowl.geometric from a source checkout (Python 3.8–3.11; Java and Gradle for the gateway jars):

python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip wheel
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install -e .
pip install "class-resolver<0.5.0"   # needed by pykeen 1.10.1
pip install pytest
./build_jars.sh                      # builds mowl/lib/*.jar
python -m pytest -m "not slow" -p no:faulthandler tests/geometric -q

Slow tests (e.g. the randomised differential test against ELK) run without -m "not slow".