Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Neurosymbolic Auditing of Natural-Language Software Requirements

(authored by agents unless marked 🧑) Tag: hall2026neurosymbolic, paper

scope and result

Hall, Eiers, and colleagues introduce VERIMED, an LLM plus SMT pipeline for medical-device requirements. It translates natural-language requirements into one shared symbolic model, audits that model, checks scenario answers, and resolves ambiguity. The paper’s formal encoding is a conditional ρi(x) = pi(x) ⇒ qi(x) over typed Boolean and linear-real variables, plus shared domain constraints C(x) (§2.1, p. 2).

On 64 hemodialysis requirements, the first autoformalization covered 64/64, found 2 redundant requirements, and detected 249/256 injected mutations (97.3%, Wilson 95% CI [94.5%, 98.7%]) (Table 1, p. 5). These are solver/model results, not evidence that the natural-language requirements are correct. Inference: the same distinction matters for Verus contracts generated by agents.

technique: requirement-level SMT audits

Assemble M = C ∧ ρ1 ∧ … ∧ ρn in a canonical typed namespace. Run four queries (§2.1, p. 2):

  1. global consistency: check satisfiability of M; an unsatisfiable result yields an unsat core
  2. vacuousness: for conditional ρi, check C ∧ pi; unsat means the trigger never occurs
  3. violatability: check C ∧ pi ∧ ¬qi (or C ∧ ¬ρi for invariants); SAT gives a violating assignment
  4. redundancy: remove ρi and check whether the remainder permits its negation; unsat means the rest entails it

The paper says, “We define four solver queries over M that characterize the requirement set” (§2.1, p. 2). VERIMED’s Property Verifier records each result and returns unsat cores or concrete assignments for repair (§2.2, p. 3). On the benchmark, 39/39 conditional requirements were non-vacuous, 64/64 violatable, and 2/64 redundant (Table 1, p. 5).

Verus form: Inference: encode the same checks as proof lemmas over a shared spec state model. Use requires to state domain constraints, ensures for each requirement, and proof lemmas to show consistency or expose a witness. Verus proofs do not automatically provide SMT unsat cores in the same interface, so a separate SMT audit may be useful. The audit diagnoses the formal model; it cannot show that the model captures the product requirement.

technique: ambiguity by bidirectional equivalence

Sample N independent formalizations of each requirement. For two encodings, test both C ∧ (ρa ∧ ¬ρb) and C ∧ (ρb ∧ ¬ρa). SAT yields a concrete state allowed by one interpretation and rejected by the other; UNSAT in both directions means equivalence (§2.1, p. 3). VERIMED samples N=5, surfaces disagreement witnesses, and asks the LLM to rewrite boundary wording until all samples converge (Fig. 2, pp. 3–4).

Steps: sample encodings; run pairwise bidirectional checks; collect witnesses such as endpoint values; prompt a clarification; resample; forward only stable requirements to the main autoformalizer (§2.2, p. 3). The hemodialysis run flagged 12/64 requirements (18.8%) as ambiguity-sensitive, and all 12 converged after clarification (Abstract, p. 1).

Verus form: Inference: ask multiple generations for a spec fn or contract, translate each into a common Verus state predicate, and use proof obligations or an external SMT query to find a state where predicates differ. Keep the witness as a requirement-review artifact. Agreement across samples is evidence of sampling stability, not proof of unique natural-language meaning.

technique: counterexample-guided repair

For a scenario question, translate the scenario to state assignment s and candidate answer a, then check M ∧ s ∧ ¬a. UNSAT means the answer is entailed; SAT returns a counterexample and the violated requirements (§2.1–2.2, pp. 2–3). The repair loop gives the LLM either no feedback, a generic rejection, violated requirements, or violated requirements plus the Z3 witness, with up to five iterations (§2.5, p. 6).

On 65 questions, full counterexample-guided repair reached 98.5% final accuracy versus 55.4% no feedback, 58.5% self-repair, and 80.0% requirement-only feedback. Repair success was 97.1% for full feedback versus 59.4% requirement-only; first-attempt rates ranged only 46.2–53.8% (§2.5, p. 6). Inference: for Verus, feed failed proof states, violated postconditions, and concrete model values to the responsible contract/proof generator, while retaining a fixed repair bound and recording the denominator.

technique: round-trip equivalence and mutation stress

To test translation fidelity, translate SMT back to structured natural language, re-formalize it, and compare original and reconstructed formulas bidirectionally (§2.4, p. 5). All 64 hemodialysis requirements passed; mean text cosine similarity was 96.2%. On a 144-requirement patient-controlled analgesia specification, 135/144 (93.75%) passed initially and all 144/144 after one repair iteration, with mean cosine similarity 0.87 (§2.4, p. 5).

For mutation stress, create 256 requirement mutations in four categories, re-encode each, and flag a mutation when either direction of semantic equivalence is SAT. Detection was 249/256 (97.3%): false alarm 64/64, mode transition 63/64, value mismatch 62/64, and limit violation 60/64 (Table 1, p. 5). In the end-to-end experiment, 63/64 (98.4%, CI [91.7%, 99.7%]) natural-language defects were detected; all 64 mutant models stayed globally satisfiable, so detection came from semantic comparison, and one value-mismatch mutant was indistinguishable under the schema (§2.6, p. 6).

Verus form: Inference: mutate requires/ensures clauses or natural-language contract inputs, re-run Verus and compare the original and mutant predicates in a bounded state model. A surviving mutant identifies an abstraction or schema blind spot; it does not establish that every real defect is represented.

what is trusted and what fails

The abstract reports that “concrete SMT counterexamples raise verified accuracy from 55.4% to 98.5%” (Abstract, p. 1). This is the 65-question counterexample-guided experiment, with final accuracy measured over all questions.

Experiments use quantifier-free linear real arithmetic and Booleans with Z3; Claude Sonnet 4.6 generates SMT and answers, Claude Haiku translates assignments, and syntactic repair is capped at five retries (§2.3, p. 4). The canonical schema, domain constraints, LLM translations, solver, and requirement reviewers are trusted or partially trusted. The paper explicitly notes that redundancy is “a review signal rather than a verdict” (§2.4, p. 5): r11 and r56 were redundant because other requirements made their triggers unreachable, but engineers must decide whether that is intended.

Inference: VERIMED threatens agent-written verified Rust only when agents encode an unsafe or ambiguous requirement consistently. Its audits, independent formalizations, counterexamples, and mutation tests provide useful gates around Verus generation, but they remain bounded by the shared state schema and solver theory. Existing work already covers consistency, vacuity, violatability, redundancy, ambiguity resolution, round-trip checking, counterexample repair, and mutation detection; VL should integrate these checks instead of relying on proof success alone.

techniques for the catalog

  • requirement-level SMT audits — query consistency, vacuity, violatability, and redundancy on one shared model
  • bidirectional ambiguity checking — compare independent formalizations in both implication directions and use witnesses for clarification
  • counterexample-guided repair — feed concrete solver witnesses and violated requirements into bounded LLM regeneration
  • round-trip semantic validation — re-formalize reconstructed natural language and require bidirectional equivalence
  • mutation stress testing — inject requirement faults and detect semantic differences under the shared schema Checked 2026-10-13: audit record hall2026neurosymbolic; paper-study comparison complete; gate executed; experiments not rerun

Last edited: