I made a few choices so far that can probably be discussed: - got rid of `modn` on `UInt`, nobody seems to use it apart from the definition of `shift` which can use normal `mod` - removed the previous defeq optimized definition of `USize.size` in favor for a normal one. The motivation was to allow `OfNat` to work which doesn't seem to be necessary anymore afaict. - Minimized uses of `.val`, should we maybe mark it deprecated? - Mostly got rid of `.val` in basically all theorems as the proper next level of API would now be `.toBitVec`. We could probably re-prove them but it would be more annoying given the change of definition. - Did not yet redefine `log2` in terms of `BitVec` as this would require a `log2` in `BitVec` as well, do we want this? - I added a couple of theorems around the relation of `<` on `UInt` and `Nat`. These were previously not needed because defeq was used all over the place to save us. I did not yet generalize these to all types as I wasn't sure if they are the appropriate lemma that we want to have.
29 lines
696 B
Text
29 lines
696 B
Text
/-- info: { val := { toBitVec := { toFin := ⟨0, ⋯⟩ } }, valid := ⋯ } -/
|
|
#guard_msgs in
|
|
#reduce Char.ofNat (nat_lit 0)
|
|
|
|
/--
|
|
info: { val := { toBitVec := { toFin := ⟨0, isValidChar_UInt32 (Or.inl (Nat.le_of_ble_eq_true rfl))⟩ } },
|
|
valid := Or.inl (Nat.le_of_ble_eq_true rfl) }
|
|
-/
|
|
#guard_msgs in
|
|
set_option pp.proofs true in
|
|
#reduce Char.ofNat (nat_lit 0)
|
|
|
|
/-- info: 2 = 1 + 1 -/
|
|
#guard_msgs in
|
|
#reduce 2 = 1 + 1
|
|
|
|
/-- info: 2 = 2 -/
|
|
#guard_msgs in
|
|
#reduce (types := true) 2 = 1 + 1
|
|
|
|
/-- info: Eq.refl (2 + 2) -/
|
|
#guard_msgs in
|
|
set_option pp.proofs true in
|
|
#reduce Eq.refl (2+2)
|
|
|
|
/-- info: Eq.refl 4 -/
|
|
#guard_msgs in
|
|
set_option pp.proofs true in
|
|
#reduce (proofs := true) Eq.refl (2+2)
|