This instance will be upgraded to Heptapod 0.31.0rc on 2022-05-19 at 11:00 UTC+2 (a few minutes of down time)

Commit 1d3f634a by haftmann

### factored out auxiliary theory

parent b5b8255ae4c4
 ... ... @@ -1101,8 +1101,10 @@ begin fix i obtain q n where RI: "r' (Suc i) = (q,n)" by (cases "r' (Suc i)") have "(n + (num_acc - n mod num_acc)) mod num_acc = 0" by (metis NN0 R' \r' (Suc i) = (q, n)\ add_diff_cancel_left' degen_run_bound less_imp_add_positive mod_self nat_mod_eq' snd_conv) apply (rule dvd_imp_mod_0) apply (metis (mono_tags, lifting) NN0 add_diff_inverse mod_0_imp_dvd mod_add_left_eq mod_less_divisor mod_self nat_diff_split not_gr_zero zero_less_diff) done then obtain ofs where OFS_LESS: "ofs
 ... ... @@ -675,8 +675,7 @@ lemma bool_of_val_impl: "(bool_of_val_impl, bool_of_val) \ val_rel \ uint32 \ uint32" is "(sdiv)" . lift_definition smod_impl :: "uint32 \ uint32 \ uint32" is "(smod)" . ... ... @@ -687,9 +686,7 @@ lemma [code]: "sdiv_impl x y = Abs_uint32' (Rep_uint32' x sdiv Rep_uint32' y)" by simp lemma [code]: "smod_impl a b = a - sdiv_impl a b * b" apply transfer using sdiv_smod_id by (metis add_diff_cancel2) by transfer (simp add: smod_by_div_abs) primrec eval_bin_op_impl_aux :: "bin_op \ uint32 \ uint32 \ uint32" where ... ...
 ... ... @@ -210,7 +210,7 @@ lemma cfg_succ_list_invar: "distinct (cfg_succ_list c)" lemma cfg_succ_list_refine: "set (cfg_succ_list c) = cfg_succ c" apply (induction c) apply (simp_all only: cfg_succ.simps cfg_succ_list.simps if_distrib[of set] if_same_eq set_map) if_distrib[of set] set_map) apply (simp_all) apply (auto, force+) [] done ... ...
 ... ... @@ -3,6 +3,11 @@ imports Main "HOL-Word.Word" begin lemma zdiv_mult_self: \m \ 0 \ (a + m * n) div m = a div m + n\ for a m n :: int by simp section\Helper Lemmas for Low-Level Operations on Machine Words\ text\Needed for IPv4 Syntax\ ... ...
 ... ... @@ -81,9 +81,10 @@ proof (induction xs ys i rule: sublist_at.induct) then show ?rhs by blast next assume ?rhs then obtain xs where "\ys. t#ts = xs@ss@ys \ Suc i = length xs" by blast then obtain xs where "\ys. t#ts = xs@ss@ys \ length xs = Suc i" by (blast dest: sym) then have "\ys. ts = (tl xs)@ss@ys \ i = length (tl xs)" by (metis hd_Cons_tl length_0_conv list.sel(3) nat.simps(3) size_Cons_lem_eq tl_append2) by (auto simp add: length_Suc_conv) then have "\xs ys. ts = xs@ss@ys \ i = length xs" by blast with "2.IH" show ?lhs by simp qed ... ...
 ... ... @@ -696,7 +696,7 @@ next by (rule iarray_cong', insert ii, auto) have d': "(map (?d fs) (rev [0.._small_row_refl[of i fs] have id: "small_fs_state state = map (\ i. fs ! i) (rev [0..
 ... ... @@ -332,7 +332,7 @@ proof - assume jk_i: "j + k < i" have "[i>..j] = rev [j..
 ... ... @@ -13,7 +13,7 @@ section \Implementations of bit operations on \<^typ>\int\ op lemma not_minus_numeral_inc_eq: \NOT (- numeral (Num.inc n)) = (numeral n :: int)\ by (simp add: not_int_def sub_inc_One) by (simp add: not_int_def sub_inc_One_eq) lemma [code_abbrev]: \test_bit = (bit :: int \ nat \ bool)\ ... ... @@ -52,7 +52,7 @@ lemma int_and_code [code]: fixes i j :: int shows "Int.Neg (num.Bit0 n) AND Int.Pos m = Num.sub (bitORN_num (Num.BitM n) m) num.One" "Int.Neg (num.Bit1 n) AND Int.Pos m = Num.sub (bitORN_num (num.Bit0 n) m) num.One" apply (simp_all add: int_numeral_bitAND_num Num.add_One sub_inc_One inc_BitM not_minus_numeral_inc_eq sub_inc_One_eq inc_BitM_eq not_minus_numeral_inc_eq flip: int_not_neg_numeral int_or_not_bitORN_num split: option.split) apply (simp_all add: ac_simps) done ... ...
 ... ... @@ -11,10 +11,11 @@ begin text \More lemmas\ lemma nat_div_eq_Suc_0_iff: "n div m = Suc 0 \ n \ m \ n < 2 * m" apply (auto simp add: sdl) using not_less apply fastforce apply (metis One_nat_def Suc_1 div_eq_0_iff lessI neq0_conv td_gal_lt) lemma nat_div_eq_Suc_0_iff: "n div m = Suc 0 \ m \ n \ n < 2 * m" apply auto using div_greater_zero_iff apply fastforce apply (metis One_nat_def div_greater_zero_iff dividend_less_div_times mult.right_neutral mult_Suc mult_numeral_1 numeral_2_eq_2 zero_less_numeral) apply (simp add: div_nat_eqI) done lemma Suc_0_lt_2p_len_of: "Suc 0 < 2 ^ LENGTH('a :: len)" ... ... @@ -96,7 +97,7 @@ proof - have "2 * (n div 2 div m) * m < 2 ^ LENGTH('a)" using n unfolding div_mult2_eq[symmetric] by(subst (2) mult.commute)(simp add: minus_mod_eq_div_mult [symmetric] diff_mult_distrib minus_mod_eq_mult_div [symmetric] div_mult2_eq) moreover have "2 * (n div 2 div m) * m \ n" by(metis div_mult2_eq div_mult_le mult.assoc mult.commute) by (metis div_mult2_eq dtle mult.assoc mult.left_commute) ultimately have r: "x - ?q * y = of_nat (n - ?q' * m)" and "y \ x - ?q * y \ of_nat (n - ?q' * m) - y = of_nat (n - ?q' * m - m)" ... ... @@ -228,7 +229,7 @@ proof(cases "1 << (LENGTH('a) - 1) \ y") finally have div: "x div of_nat n = 1" using False n by(simp add: word_div_eq_1_iff not_less word_le_nat_alt unat_of_nat) moreover have "x mod y = x - x div y * y" by (metis add_diff_cancel2 word_mod_div_equality) by (simp add: minus_div_mult_eq_mod) with div n have "x mod y = x - y" by simp ultimately show ?thesis using False y n by simp qed ... ...
 ... ... @@ -4,6 +4,11 @@ imports "HOL-ODE-Numerics.ODE_Numerics" Result_File_Coarse begin lemma replicate_numeral [simp]: "replicate (numeral k) x = x # replicate (pred_numeral k) x" by (simp add: numeral_eq_Suc) text \\label{sec:lorenz}\ text \TODO: move to isabelle? \ ... ...
 ... ... @@ -2701,7 +2701,8 @@ lemma isFDERIV_product: "isFDERIV n xs fas vs \ length fas = n \ length xs = n \ list_all (\(x, f). isDERIV x f vs) (List.product xs fas)" apply (auto simp: isFDERIV_def list_all2_iff in_set_zip list_all_length product_nth) apply (metis gt_or_eq_0 less_mult_imp_div_less mod_less_divisor not_less0) by auto apply auto apply (metis gr_implies_not_zero gr_zeroI less_mult_imp_div_less pos_mod_bound) done end
 ... ... @@ -149,9 +149,13 @@ begin lemma lc2aux: "{l. length l=2 \ valid l} = {[B,B]}" by (auto 4 3 intro: valid.intros elim: valid.cases simp: replicate_Cons_eq) lemma valid_3R: \valid [R, R, R]\ using valid.intros(3) [of \[]\ 3] by (simp add: numeral_eq_Suc valid.intros) lemma lc3_aux: "{l. length l=3 \ valid l} = {[B,B,B], [R,R,R]}" by (auto 4 4 intro: valid.intros valid_red[of 3, simplified] elim: valid.cases simp: replicate_Cons_eq) by (auto 4 4 intro: valid.intros valid_3R elim: valid.cases simp: replicate_Cons_eq) lemma lcounts_init: "lcount 0 = 1" "lcount 1 = 1" "lcount 2 = 1" "lcount 3 = 2" using lc0 lc1aux lc2aux lc3_aux unfolding lcount_def by simp_all ... ...
 ... ... @@ -713,10 +713,8 @@ subsubsection \Simulation\ lemma mod_mult_mod_eq[mod_simps]: "x mod (k * N) mod N = x mod N" by (meson dvd_eq_mod_eq_0 mod_mod_cancel mod_mult_self2_is_0) lemma mod_eq_imp_eq_aux: "b mod N = (a::nat) mod N \ a\b \ b b=a" by (metis Groups.add_ac add_0_right le_add_diff_inverse less_diff_conv2 nat_minus_mod nat_minus_mod_plus_right mod_if) lemma mod_eq_imp_eq_aux: "b mod N = (a::nat) mod N \ a\b \ b b=a" using nat_mod_eq_lemma by force lemma mod_eq_imp_eq: "\b \ x; x < b + N; b \ y; y < b + N; x mod N = y mod N \ \ x=y" ... ... @@ -1034,9 +1032,8 @@ subsection \Refinement 3: Using an Array\text_raw \\label{sec apply clarify apply (erule blstep.cases, erule bstep_sng.cases) unfolding invar4_def apply safe apply (metis N_gt0 fun_upd_other fun_upd_same mod_mod_trivial nat_mod_lem has_ticket_simps(2)) apply safe apply (metis N_gt0 fun_upd_apply has_ticket_simps(2) mod_less_divisor) apply (metis fun_upd_triv) apply (metis fun_upd_other fun_upd_same has_ticket_simps(3)) apply (metis fun_upd_other fun_upd_same has_ticket_def has_ticket_simps(4)) ... ...
 ... ... @@ -182,7 +182,7 @@ lemma rbl_word_scast: apply (rule nth_equalityI) apply (simp add: word_size takefill_last_def) apply (clarsimp simp: nth_scast takefill_last_def nth_takefill word_size nth_rev to_bl_nth) nth_takefill word_size rev_nth to_bl_nth) apply (cases "LENGTH('b)") apply simp apply (clarsimp simp: less_Suc_eq_le linorder_not_less ... ... @@ -376,7 +376,7 @@ lemma rev_bin_to_bl_simps: lemma to_bl_upt: "to_bl x = rev (map ((!!) x) [0 ..< size x])" apply (rule nth_equalityI) apply (simp add: word_size) apply (auto simp: to_bl_nth word_size nth_rev) apply (auto simp: to_bl_nth word_size rev_nth) done lemma rev_to_bl_upt: "rev (to_bl x) = map ((!!) x) [0 ..< size x]" ... ...