# DRCT v16 — Ontology / Arity Discovery

## Goal

v15 assumed that the missing primitive was binary.

v16 removes that assumption. The learner must decide whether the predictive
description requires:

- no new nonlinear relation;
- a unary relation;
- a binary relation;
- a ternary relation;

and which measured/current/history coordinates the relation acts on.

A generic relation has the form

\[
T_S:\mathcal A^{|S|}\to\mathcal A
\]

for an unknown coordinate scope \(S\).

The semantics of \(T_S\) are an unrestricted finite table inferred from data.

The model class also allows an affine residual on coordinates outside the
relation scope:

\[
Q=T_S(X_S)+L(X_{\bar S}).
\]

The learner searches over scope, arity, relation table and affine residual.

This is still a meta-language. It does not invent the concepts of "relation",
"arity", "scope", or "affine residual" from nothing.

---

## Definition — Relational Ontology Cost

For carrier size \(p\), an unrestricted arity-\(r\) relation table contains

\[
p^r
\]

values.

A minimum-description principle therefore strongly penalizes unnecessary
arity.

Among descriptors that close the training data, v16 minimizes a code length
containing:

- model-family tag;
- arity/scope wiring;
- \(p^r\) table values;
- nonzero affine residual coefficients.

Thus a unary relation is preferred to a binary one when both explain the same
data, and affine structure is preferred to inventing a relation when it
already closes the process.

---

## Definition — Arity Closure Depth

Let \(\mathcal H_r\) be the descriptor family allowing latent relations of
arity at most \(r\). Define

\[
\boxed{
R_r
=
\min_{Q\in\mathcal H_r}H(F\mid Q).
}
\]

Because

\[
\mathcal H_0\subseteq\mathcal H_1\subseteq\mathcal H_2\subseteq\cdots,
\]

\[
\boxed{
R_{r+1}\le R_r.
}
\]

Define

\[
\boxed{
r^\star=\min\{r:R_r=0\}.
}
\]

Then \(r^\star\) is the minimum relational arity required for predictive closure
relative to the supplied meta-language and measurement coordinates.

---

## Temporal structure

History coordinates such as

\[
u_t,\quad u_{t-1},\quad u_{t-2}
\]

are treated as ordinary candidate coordinates during scope discovery.

If the selected scope contains both current and lagged coordinates, the
discovered relation is temporally relational.

If an affine-only model closes the system using several lags,

\[
Q=\sum_k h_k u_{t-k},
\]

the coefficients \(h_k\) form a finite impulse response filter. Difference
operators and discrete convolutions therefore arise as special affine temporal
ontologies rather than requiring a nonlinear invented relation.

---

## Prospective criterion

The training set is selected independently of the hidden benchmark laws and is
required to cover every relation-table input tuple up to arity three.

Ontology, arity, scope and table are selected using training data and
description length.

The selected ontology is frozen before holdout performance is reported.

A complete finite-domain audit is performed only after the holdout test.

---

## Prior-art boundary

Predicate invention in inductive logic programming is explicitly concerned
with inventing new relations, and the literature identifies deciding the
number and ordering of invented predicate arguments as a longstanding
difficulty.

Grammar-based equation discovery likewise treats the grammar as an inductive
bias over possible mathematical forms.

DRCT does not claim to invent predicate invention, MDL, relation learning or
grammar induction.

The candidate DRCT synthesis is:

\[
\text{closure residual}
\to
\text{exhaust existing ontology}
\to
\text{infer minimum missing relation arity and scope}
\to
\text{tomograph its semantics}
\to
\text{compress its law}
\to
\text{prospective closure}.
\]

The remaining wall is the meta-language itself: v16 still assumes that useful
new concepts are representable as finite relations plus affine composition.
