Handbook
Prompt 06 — Algorithm, invariant, and representation builder
Build objects for algorithms, procedures, invariants, and representations.
Updated
Inputs
TARGET_PARTITION: {{TARGET_PARTITION}}
SOURCE_CANDIDATES: {{SOURCE_CANDIDATES_JSON}}
EXISTING_LIBRARY_INDEX: {{EXISTING_LIBRARY_INDEX_JSON}}
TEST_FIXTURES: {{TEST_FIXTURES_JSON}}
EXECUTION_RECEIPTS: {{EXECUTION_RECEIPTS_JSON}}
Task
Build objects for algorithms, procedures, invariants, and representations.
Algorithm requirements
- typed input and output contract;
- preconditions and termination conditions;
- deterministic pseudocode or symbolic procedure;
- loop/recursion invariant;
- correctness obligations;
- termination argument;
- complexity claim and its evidence status;
- normal, edge, adversarial, and invalid-input tests;
- relationship to existing algorithms;
- numerical stability or exactness notes when relevant.
Invariant requirements
- transformation or process under which it is invariant;
- expression/property preserved;
- proof or test status;
- failure conditions and counterexamples;
- downstream uses.
Representation requirements
- source and target structures;
- encoding and decoding maps;
- information preserved and lost;
- equivalence or approximation status;
- conditions for invertibility;
- solver gain or compression benefit;
- examples and boundary cases.
Do not mark an algorithm correct merely because test fixtures pass. Do not treat a representation as equivalent when it is only approximate or one-way.
Return a library-batch object.
Return JSON matching schemas/library-batch.schema.json.