Faithfulness and clarification gates for generated formal specifications
Teams using LLMs to draft ACSL or STL should require a pre-acceptance gate that checks whether the output preserved the target program, assertion, and user intent. For ACSL, LiveFMBench shows that naive prover success can overstate direct-prompting accuracy by about 20% unless outputs that changed the program AST or original assertion expressions are filtered. The same benchmark identifies loop invariants as the most common failure type, which gives reviewers a concrete place to focus manual review.
For CPS requirements, ClarifySTL gives a build pattern: detect vague time bounds, thresholds, conditional logic, and unclear references; ask targeted questions; rewrite the requirement; then generate STL. The cheap implementation test is a small gate in front of a spec generator: reject any ACSL candidate that changes the checked program or assertion, and block STL generation until missing numeric and temporal details are supplied. Requirements teams can add a deterministic structural validator for product-line constraints where requirement IDs and parent-child selections already exist, following the OOMRAM agent’s Python validator pattern.