|
|
|
|
|
by celrod
79 days ago
|
|
In my experience, llms don't reason well about expected states, contracts, invariants, etc.
Partly because that don't have long term memory and are often forced to reason about code in isolation.
Maybe this means all invariants should go into AGENTS.md/CLAUDE.md files, or into doc strings so a new human reader will quickly understand assumptions. Regardless, I think a habit of putting contracts to make pre- and post-conditions clear could help an AI reason about code. Maybe instead of suggesting a patch to cover up a symptom, an AI may reason that a post-condition somewhere was violated, and will dig towards the root cause. This applies just as well to asserts, too.
Contracts/asserts actually need to be added to tell a reader something. |
|