arXiv:2610.19414cs.PLOct 2026

Manuscript Offprint

arXiv:2610.19414

Recursive Formation and First-Class Reuse of Compositional Capabilities

Hang Lin

Abstract

We introduce FormCraft, a framework for representing acquired operations as first-class capabilities that can be recursively composed, directly invoked, and selectively retained in a persistent library through domain-specific verification. The framework separates capability well-formedness and public callability from later admission to persistent storage while preserving formation provenance and operational identity. We formalize recursive compositional closure over a uniform capability space and show that formed composites can be reused through the same public interface without re-forming their historical derivation. Experiments across continuous, discrete, propositional, and sequence domains demonstrate instance-independent reuse, independent checking, persistent acquisition, and reduced reuse-time search work under first-class exposure.

1 Introduction

Program synthesis turns specifications or examples into executable programs, using search, constraints, and learned guidance [3, 5, 4, 8, 9]. Library-learning systems go further by extracting abstractions from solved tasks and making them useful for later synthesis [10, 11, 12]. These advances motivate a question about the resulting artifacts: once a useful operation has been formed, what makes it a reusable operational object rather than only a derivation or a search result, and how can that object later be retained?

We study that question as a capability lifecycle. A formed operation should be represented independently of the instance that elicited it, composed through compatible public contracts, and exposed for later invocation as an operation in its own right. Long-term persistence is a separate concern: a capability may subsequently be checked before it is retained in a persistent library. The framework therefore centers on representation, composition, persistence, and reuse after formation, while abstraction-discovery methods can serve as upstream sources of capabilities. In elementary arithmetic, an operation is more reusable than the example that first demonstrated it. The analogy captures the intended separation between a concrete instance and an operation that accepts new operands.

FormCraft represents primitive capabilities f and composite capabilities F within one well-formed capability space F\mathfrak{F}. Instance data X and parameters α\alpha enter through public invocation ports, while a composite retains its formation provenance. Compatible recursive composition produces another first-class capability in the same space; verification is invoked only when a formed capability is considered for persistent library membership. Proposition 2 establishes finite compositional closure, and Corollary 5 isolates the consequence of first-class exposure for historical re-formation depth.

The evaluation progresses from instance-independent reuse to independently checked composition, persistent acquisition, and increasing-depth first-class reuse. Continuous and discrete prototypes examine instance separation; a Lean-checked propositional microdomain tests independently verifiable composites [14]. In the main sequence-domain study, sequential acquisition expands the persistent store from 12 to 26 and then 38 records. A paired reuse experiment over the increasing-depth task family reduces candidate attempts from 16,570 to 144 when persisted composites are exposed directly through their public interfaces. The paired study reports reuse-time search work under controlled snapshots.

The contributions are:

  1. A formal account of structural axioms and first-class compositional closure for instance-independent capabilities.

  2. A lifecycle that separates well-formed capability formation and first-class reuse from the later verification decision governing persistent library membership.

  3. A record-based implementation that gives primitive and composite capabilities one public operational interface while retaining operation identity and formation provenance.

  4. Cross-domain evaluation of instance-independent reuse and independently checked composition, together with sequential persistent-store growth and a paired comparison of first-class reuse with historical expansion.

Section 2 gives the formalization; Section 3 describes its implementation; Section 4 reports the evidence; and Section 5 positions the work.