module 0x42::Bug { struct Diem { /// The value of this coin in the base units for `CoinType` value: u64 } public fun withdraw(coin: &mut Diem, amount: u64): Diem { coin.value = coin.value - amount; Diem { value: amount } } spec withdraw { pragma opaque; include WithdrawAbortsIf; ensures coin.value == old(coin.value) - amount; ensures result.value == amount; } spec schema WithdrawAbortsIf { coin: Diem; amount: u64; aborts_if coin.value < amount; } public fun split(coin: Diem, amount: u64): (Diem, Diem) { let other = withdraw(&mut coin, amount); (coin, other) } spec split { aborts_if coin.value < amount; ensures result_1.value == coin.value - amount; ensures result_2.value == amount; } }