equal
deleted
inserted
replaced
573 hence orig: "(2 * bv_to_nat w + 1) mod 2 = 2 * q mod 2" (is "?lhs = ?rhs") |
573 hence orig: "(2 * bv_to_nat w + 1) mod 2 = 2 * q mod 2" (is "?lhs = ?rhs") |
574 by simp |
574 by simp |
575 have "?lhs = (1 + 2 * bv_to_nat w) mod 2" |
575 have "?lhs = (1 + 2 * bv_to_nat w) mod 2" |
576 by (simp add: add_commute) |
576 by (simp add: add_commute) |
577 also have "... = 1" |
577 also have "... = 1" |
578 by (subst mod_add1_eq) simp |
578 by (subst mod_add_eq) simp |
579 finally have eq1: "?lhs = 1" . |
579 finally have eq1: "?lhs = 1" . |
580 have "?rhs = 0" by simp |
580 have "?rhs = 0" by simp |
581 with orig and eq1 |
581 with orig and eq1 |
582 show "nat_to_bv (Suc (2 * bv_to_nat w) div 2) @ [\<zero>] = norm_unsigned (w @ [\<one>])" |
582 show "nat_to_bv (Suc (2 * bv_to_nat w) div 2) @ [\<zero>] = norm_unsigned (w @ [\<one>])" |
583 by simp |
583 by simp |