theory gcd_GCD2_lemmas = "/home/hoenicke/jahob/lib/Jahob": lemma GCD_minus [simp]: "((\q. (c::int) * q = a - b) \ (\q. c * q = b)) = ((\q. (c::int) * q = a) \ (\q. c * q = b))" proof assume "(\q. c * q = a) \ (\q. c * q = b)" then obtain q1 q2 where "((c * q1 = a) \ (c * q2 = b))" by auto hence "c * (q1 - q2) = a - b \ c * q2 = b" by (auto simp add:zdiff_zmult_distrib2) thus "(\q. c * q = a - b) \ (\q. c * q = b)" by auto next assume "(\q. c * q = a - b) \ (\q. c * q = b)" then obtain q1 q2 where "((c * q1 = a - b) \ (c * q2 = b))" by auto hence "((c * (q1 + q2) = a) \ (c * q2 = b))" by (auto simp add:zadd_zmult_distrib2) thus "(\q. c * q = a) \ (\q. c * q = b)" by auto qed lemma GCD_minus2 [simp]: "((\q. (c::int) * q = a) \ (\q. c * q = b - a)) = ((\q. (c::int) * q = a) \ (\q. c * q = b))" proof - have "((\q. (c::int) * q = a) \ (\q. c * q = b - a)) = ((\q. c * q = b - a) \ (\q. (c::int) * q = a))" by blast also have "\ = ((\q. c * q = b) \ (\q. (c::int) * q = a))" by simp also have "\ = ((\q. (c::int) * q = a) \ (\q. c * q = b))" by blast finally show "?thesis" . qed lemma GCD2_gcd_InitialPartOfProcedure3: "([|(ALL xObj. (xObj : Object)); ((GCD2 Int Array) = {null}); (null : Object_alloc); (0 <= olda); (0 <= oldb); (0 <= a_18); (0 <= b_16); (ALL c. (((EX q. ((inttimes c q) = olda)) & (EX q. ((inttimes c q) = oldb))) <-> ((EX q. ((inttimes c q) = a_18)) & (EX q. ((inttimes c q) = b_16))))); (a_18 ~= 0); (b_16 ~= 0); (intless b_16 a_18)|] ==> comment ''InvPreservation'' (((EX q. ((inttimes c_bv350 q) = olda)) & (EX q. ((inttimes c_bv350 q) = oldb))) <-> ((EX q. ((inttimes c_bv350 q) = (a_18 - b_16))) & (EX q. ((inttimes c_bv350 q) = b_16)))))" by auto lemma GCD2_gcd_InitialPartOfProcedure5: "([|(ALL xObj. (xObj : Object)); ((GCD2 Int Array) = {null}); (null : Object_alloc); (0 <= olda); (0 <= oldb); (0 <= a_18); (0 <= b_16); (ALL c. (((EX q. ((inttimes c q) = olda)) & (EX q. ((inttimes c q) = oldb))) <-> ((EX q. ((inttimes c q) = a_18)) & (EX q. ((inttimes c q) = b_16))))); (a_18 ~= 0); (b_16 ~= 0); (~(intless b_16 a_18))|] ==> comment ''InvPreservation'' (((EX q. ((inttimes c_bv289 q) = olda)) & (EX q. ((inttimes c_bv289 q) = oldb))) <-> ((EX q. ((inttimes c_bv289 q) = a_18)) & (EX q. ((inttimes c_bv289 q) = (b_16 - a_18))))))" by auto end