Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use simp-normal form in LLVM.select (#760)
This simplifies: ```lean ⊢ ∀ (x : BitVec 8), ((if false = true ∧ x >>> 7#8 <<< 7#8 ≠ x then none else if 7#8 ≥ ↑8 then none else some (x.sshiftRight (7#8).toNat)).bind fun x' => some (x'.xor 127#8)) ⊑ match some (ofBool (x >ₛ -1#8)) with | none => none | some { toFin := ⟨1, ⋯⟩ } => some 127#8 | some { toFin := ⟨0, ⋯⟩ } => some 128#8 ``` ```lean ∀ (x : BitVec 8), ((if false = true ∧ x >>> 7#8 <<< 7#8 ≠ x then none else if 7#8 ≥ ↑8 then none else some (x.sshiftRight (7#8).toNat)).bind fun x' => some (x'.xor 127#8)) ⊑ match ofBool (x >ₛ -1#8) with | 1#1 => some 127#8 | 0#1 => some 128#8 ``` In particular, we manage to get rid of the `some` in the match and do not have the annoying `{ toFin := ⟨1, ⋯⟩ } ` but instead just `1#1`. We probably want to get rid of the match entirely and replace it by an `if`, but this seems to have side-effects require further investigation.
- Loading branch information