Skip to content

Commit 1c0c3b5

Browse files
authored
docs: clarify check-rust vs Verus on COMPARE page (#1455)
## Summary - Update [docs/COMPARE.md](docs/COMPARE.md) so Verus comparison matches product reality: Assura supports **inline** `/// @requires` / `@ensures` via `assura check-rust`, not only `.assura` files. - Keep the honest split: Verus is still preferred for deep borrow-aware proofs of existing Rust; Assura `check-rust` has a partial body model and fails closed with `body_not_modeled`. ## Why Launch messaging said "not Verus-in-place" so strongly that it sounded like Assura cannot annotate existing Rust at all. That is wrong and confuses HN/Reddit answers. ## Test plan - [x] Read COMPARE.md for accuracy against README `check-rust` and CONTRIBUTING body-proof section - [ ] Docs site rebuild (mdBook) on merge / CI Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
1 parent 23d4ff8 commit 1c0c3b5

1 file changed

Lines changed: 41 additions & 8 deletions

File tree

docs/COMPARE.md

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,57 @@ just Dafny / Verus / Liquid Haskell / better unit tests?*
1111

1212
| | Assura | Dafny | Verus | Liquid Haskell | Unit / property tests |
1313
|--|--------|-------|-------|----------------|------------------------|
14-
| **Primary surface** | Dedicated `.assura` contracts | Dafny language | Annotations on Rust | Liquid types / refinements on Haskell | Tests in host language |
14+
| **Primary surface** | `.assura` contracts; optional `/// @requires` / `@ensures` on Rust via `check-rust` | Dafny language | Specs and proofs as annotations on Rust | Liquid types / refinements on Haskell | Tests in host language |
1515
| **Implementation author** | Often AI (IR / auto-implement / check-rust) | Human (or AI as ordinary code) | Human-written Rust | Human-written Haskell | Human or AI |
1616
| **Proof backend** | Z3 / CVC5 via Assura pipeline | Boogie / Z3 | VIR / Z3 | Liquid Fixpoint / SMT | None (sampling) |
1717
| **Default emit** | Rust source (`rustc` / WASM) | C#, Go, JS, Java, Python, … | Stays Rust | Stays Haskell | N/A |
1818
| **AI agent loop** | First-class (MCP, check-rust, auto-implement) | Possible but not the product shape | Possible | Possible | Common, no proof |
19-
| **What "success" means** | No counterexample for modeled clauses; layers 0–2 | Verified method / module | Verified function | Type-checked refinements | Tests green |
19+
| **What "success" means** | No counterexample for modeled clauses; layers 0–2; unmodeled Rust bodies are `body_not_modeled`, not silent success | Verified method / module | Verified function under Verus's Rust model | Type-checked refinements | Tests green |
20+
21+
## Assura on existing Rust vs Verus
22+
23+
Assura can annotate **existing Rust** without a separate `.assura` file per
24+
function: put contracts in doc comments and run `assura check-rust`
25+
(human or LLM can add the annotations). Example shape:
26+
27+
```rust
28+
/// @requires x >= 0
29+
/// @ensures result >= 0
30+
pub fn abs_i64(x: i64) -> i64 { /* ... */ }
31+
```
32+
33+
That is real, but it is **not** the same product as Verus:
34+
35+
| | Assura `check-rust` | Verus |
36+
|--|---------------------|-------|
37+
| **How you attach specs** | `/// @requires` / `@ensures` (and related) on Rust items | Verus attributes / proof blocks in Rust |
38+
| **What is modeled** | Growing but intentional subset of bodies (arith, control flow, wrapping/bitops, …) or a co-located `.ir` sidecar | Deep model of Rust (including ownership/borrow patterns Verus supports) |
39+
| **Unmodeled code** | Reports `body_not_modeled` (not treated as verified) | Outside Verus's supported surface, or unfinished proof, as Verus defines |
40+
| **Primary story** | Contracts first; AI loop; also annotate-and-check | Prove the Rust you keep writing in place |
41+
42+
**Prefer Verus** when the goal is fine-grained, borrow-aware proofs of
43+
**existing Rust crates** as the long-term source of truth.
44+
45+
**Prefer Assura** when you want a separate contract language and/or an
46+
agent-friendly check loop, including optional inline annotations on Rust
47+
with honest body modeling limits (see [What we prove](WHAT-WE-PROVE.md)
48+
and CONTRIBUTING "check-rust body proof").
2049

2150
## When Assura is a better fit
2251

2352
- You want **specs separate from host-language syntax** so agents and humans
24-
share a stable contract surface.
53+
share a stable contract surface (`.assura`), or light `/// @…` contracts
54+
on Rust via `check-rust`.
2555
- You care about an **AI write → SMT check → fix** loop with structured
26-
results (counterexample vs unknown vs verified).
27-
- You want **Rust as the ship format** without requiring the implementation
28-
to be authored as verified Rust-in-place first.
56+
results (counterexample vs unknown vs verified vs body_not_modeled).
57+
- You want **Rust as the ship format** without requiring Verus-style
58+
verified Rust-in-place as the only workflow.
2959

3060
## When another tool is a better fit
3161

3262
| Need | Prefer |
3363
|------|--------|
34-
| Verify **existing Rust** in place with fine-grained borrow-aware proofs | [Verus](https://github.com/verus-lang/verus) |
64+
| Deep **borrow-aware** proofs of existing Rust as the main workflow | [Verus](https://github.com/verus-lang/verus) |
3565
| Mature multi-target verified language with large libraries | [Dafny](https://dafny.org/) |
3666
| Refinement types inside Haskell | [Liquid Haskell](https://ucsd-progsys.github.io/liquidhaskell/) |
3767
| Fast feedback without SMT, or non-modeled effects | Property tests / fuzzing (still useful *with* Assura) |
@@ -42,7 +72,10 @@ Assura does **not** claim:
4272

4373
- That every clause is always decided (see [What we prove](WHAT-WE-PROVE.md)).
4474
- That it replaces human review for product requirements.
45-
- That it is a drop-in Verus substitute for verifying arbitrary Rust crates.
75+
- That `check-rust` is a drop-in Verus substitute for verifying arbitrary
76+
Rust crates (partial body model; unmodeled paths fail closed as
77+
`body_not_modeled`).
78+
- That every green check means full mathematical coverage of all features.
4679

4780
For competitive research notes (internal depth), see
4881
[INVESTIGATION.md](INVESTIGATION.md). For a short public pitch, start with

0 commit comments

Comments
 (0)