Recursive Formation and First-Class Reuse of Compositional Capabilities
Program synthesis and library-learning systems produce useful operations, but it is unclear what makes a formed operation a reusable object, separate from the derivation that produced it, and how it should be retained for later use.
FormCraft represents primitive and composite capabilities in one well-formed capability space with typed public ports, external parameters, and recorded formation provenance. Recursive composition of compatible capabilities yields another first-class capability. Domain-specific verification is applied only when deciding whether to admit a capability to a persistent library. Experiments cover continuous, character-substitution, Lean-checked propositional, and sequence domains.
The authors prove finite compositional closure and show that first-class exposure removes the need to re-form a composite's historical derivation. In the propositional microdomain, 5/5 composites were formed and Lean accepted all 10 generated theorem checks. In the sequence domain, the persistent store grew from 12 to 26 to 38 records, and reuse-time search work decreased.
| Measure | Result |
|---|---|
| Composite capabilities formed | 5/5 |
| Composite theorem reuses | 10/10 |
| Lean checks accepted (exit code 0) | 10/10 |
| Capability-record hash and formation provenance preserved | Yes |
