lean4-htt/tests/elab/bv_parametric_struct.lean
Garmelon 08eb78a5b2
chore: switch to new test/bench suite (#12590)
This PR sets up the new integrated test/bench suite. It then migrates
all benchmarks and some related tests to the new suite. There's also
some documentation and some linting.

For now, a lot of the old tests are left alone so this PR doesn't become
even larger than it already is. Eventually, all tests should be migrated
to the new suite though so there isn't a confusing mix of two systems.
2026-02-25 13:51:53 +00:00

20 lines
547 B
Text

import Std.Tactic.BVDecide
/--
The `Byte` type can have any bitwidth `w`. It carries a two's complement integer
value of width `w` and a per-bit poison mask modeling bitwise delayed undefined
behavior.
-/
structure Byte (w : Nat) where
/-- A two's complement integer value of width `w`. -/
val : BitVec w
/-- A per-bit poison mask of width `w`. -/
poison : BitVec w
def or {w : Nat} (x y : Byte w) : Byte w :=
⟨x.val ||| y.val, x.poison ||| y.poison⟩
example (x y : Byte 8) : or x y = or y x := by
unfold _root_.or
bv_decide