module 0x42::Demo { struct S1 has key, store { t: T, v: u8, } struct S2 has key, store { t: T, v: u8, } fun f1(addr: address) acquires S1 { if (exists>(addr)) { *&mut borrow_global_mut>(addr).v = 0; }; if (exists>(addr)) { *&mut borrow_global_mut>(addr).v = 0; }; } spec module { invariant (exists>(@0x2) && exists>(@0x2)) ==> global>(@0x2).v == 0; } }