lh-l4v/lib/Word_Lib/WordBitwise_Signed.thy

34 lines
932 B
Plaintext

(*
* Copyright 2014, NICTA
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(NICTA_BSD)
*)
section "Bitwise tactic for Signed Words"
theory WordBitwise_Signed
imports
"HOL-Word.More_Word"
Signed_Words
begin
ML \<open>fun bw_tac_signed ctxt = let
val (ss, sss) = Word_Bitwise_Tac.expand_word_eq_sss
val sss = nth_map 2 (fn ss => put_simpset ss ctxt addsimps @{thms len_signed} |> simpset_of) sss
in
foldr1 (op THEN_ALL_NEW)
((CHANGED o safe_full_simp_tac (put_simpset ss ctxt)) ::
map (fn ss => safe_full_simp_tac (put_simpset ss ctxt)) sss)
end;
\<close>
method_setup word_bitwise_signed =
\<open>Scan.succeed (fn ctxt => Method.SIMPLE_METHOD (bw_tac_signed ctxt 1))\<close>
"decomposer for word equalities and inequalities into bit propositions"
end