You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LLBC backend: translate promoted MIR, so Lean models have no drop flags #5048
#5045 makes LLBC runs compile at -Zmir-opt-level=0, so moves stay moves and Aeneas accepts generic code. The backend still reads the MIR after drop elaboration, though, and the drop flags rustc inserts end up in the Lean model. For push in the experiment from #5045, upstream Charon reading promoted MIR (its default) gives:
match s.a with
| none =>
let i ← s.len + 1#u8
ok ({ s with a := (some x), len := i }, none)
...
while Kani's output gives a model with the drop flag threaded through:
let (t, o, i, o1, b) ← match s.a with ...
if b
then ok ({ a := (some t), b := o, len := i }, o1)
else ok ({ a := (some t), b := o, len := i }, o1)
Both are correct (the same Lean proof goes through on both), but the second is harder to read and to prove things about as code grows.
The obstacle is timing: rustc has already discarded (stolen) the promoted MIR by the end of analysis, and the drop-elaborated MIR by the time a codegen backend runs. Getting promoted MIR needs a query override that keeps a copy of each local body, which Charon's own driver sketches as a TODO (charon-driver/driver.rs), or translating before analysis finishes. Only LLBC runs would install it.
Activity