445 "(-3::int) div 3 = -1" |
448 "(-3::int) div 3 = -1" |
446 "(-5::int) div 3 = -2" |
449 "(-5::int) div 3 = -2" |
447 "(-1::int) div -3 = 0" |
450 "(-1::int) div -3 = 0" |
448 "(-3::int) div -3 = 1" |
451 "(-3::int) div -3 = 1" |
449 "(-5::int) div -3 = 1" |
452 "(-5::int) div -3 = 1" |
|
453 using [[z3_with_extensions]] |
450 by smt+ |
454 by smt+ |
451 |
455 |
452 lemma |
456 lemma |
453 "(0::int) mod 0 = 0" |
457 "(0::int) mod 0 = 0" |
454 "(x::int) mod 0 = x" |
458 "(x::int) mod 0 = x" |
474 "(-1::int) mod -3 = -1" |
478 "(-1::int) mod -3 = -1" |
475 "(-3::int) mod -3 = 0" |
479 "(-3::int) mod -3 = 0" |
476 "(-5::int) mod -3 = -2" |
480 "(-5::int) mod -3 = -2" |
477 "x mod 3 < 3" |
481 "x mod 3 < 3" |
478 "(x mod 3 = x) \<longrightarrow> (x < 3)" |
482 "(x mod 3 = x) \<longrightarrow> (x < 3)" |
|
483 using [[z3_with_extensions]] |
479 by smt+ |
484 by smt+ |
480 |
485 |
481 lemma |
486 lemma |
482 "(x::int) = x div 1 * 1 + x mod 1" |
487 "(x::int) = x div 1 * 1 + x mod 1" |
483 "x = x div 3 * 3 + x mod 3" |
488 "x = x div 3 * 3 + x mod 3" |
|
489 using [[z3_with_extensions]] |
484 by smt+ |
490 by smt+ |
485 |
491 |
486 lemma |
492 lemma |
487 "abs (x::int) \<ge> 0" |
493 "abs (x::int) \<ge> 0" |
488 "(abs x = 0) = (x = 0)" |
494 "(abs x = 0) = (x = 0)" |
583 "(-1::real) / 3 = - 1 / 3" |
589 "(-1::real) / 3 = - 1 / 3" |
584 "(-1::real) / -3 = 1 / 3" |
590 "(-1::real) / -3 = 1 / 3" |
585 "(x::real) / 1 = x" |
591 "(x::real) / 1 = x" |
586 "x > 0 \<longrightarrow> x / 3 < x" |
592 "x > 0 \<longrightarrow> x / 3 < x" |
587 "x < 0 \<longrightarrow> x / 3 > x" |
593 "x < 0 \<longrightarrow> x / 3 > x" |
|
594 using [[z3_with_extensions]] |
588 by smt+ |
595 by smt+ |
589 |
596 |
590 lemma |
597 lemma |
591 "(3::real) * (x / 3) = x" |
598 "(3::real) * (x / 3) = x" |
592 "(x * 3) / 3 = x" |
599 "(x * 3) / 3 = x" |
593 "x > 0 \<longrightarrow> 2 * x / 3 < x" |
600 "x > 0 \<longrightarrow> 2 * x / 3 < x" |
594 "x < 0 \<longrightarrow> 2 * x / 3 > x" |
601 "x < 0 \<longrightarrow> 2 * x / 3 > x" |
|
602 using [[z3_with_extensions]] |
595 by smt+ |
603 by smt+ |
596 |
604 |
597 lemma |
605 lemma |
598 "abs (x::real) \<ge> 0" |
606 "abs (x::real) \<ge> 0" |
599 "(abs x = 0) = (x = 0)" |
607 "(abs x = 0) = (x = 0)" |
791 "(fst (x, y) = snd (x, y)) = (x = y)" |
799 "(fst (x, y) = snd (x, y)) = (x = y)" |
792 "p1 = (x, y) \<and> p2 = (y, x) \<longrightarrow> fst p1 = snd p2" |
800 "p1 = (x, y) \<and> p2 = (y, x) \<longrightarrow> fst p1 = snd p2" |
793 "(fst (x, y) = snd (x, y)) = (x = y)" |
801 "(fst (x, y) = snd (x, y)) = (x = y)" |
794 "(fst p = snd p) = (p = (snd p, fst p))" |
802 "(fst p = snd p) = (p = (snd p, fst p))" |
795 using fst_conv snd_conv pair_collapse |
803 using fst_conv snd_conv pair_collapse |
796 using [[smt_datatypes, smt_oracle]] |
804 using [[smt_datatypes, smt_oracle, z3_with_extensions]] |
797 by smt+ |
805 by smt+ |
798 |
806 |
799 lemma |
807 lemma |
800 "[x] \<noteq> Nil" |
808 "[x] \<noteq> Nil" |
801 "[x, y] \<noteq> Nil" |
809 "[x, y] \<noteq> Nil" |
805 "hd [x, y, z] = x" |
813 "hd [x, y, z] = x" |
806 "tl [x, y, z] = [y, z]" |
814 "tl [x, y, z] = [y, z]" |
807 "hd (tl [x, y, z]) = y" |
815 "hd (tl [x, y, z]) = y" |
808 "tl (tl [x, y, z]) = [z]" |
816 "tl (tl [x, y, z]) = [z]" |
809 using hd.simps tl.simps(2) |
817 using hd.simps tl.simps(2) |
810 using [[smt_datatypes, smt_oracle]] |
818 using [[smt_datatypes, smt_oracle, z3_with_extensions]] |
811 by smt+ |
819 by smt+ |
812 |
820 |
813 lemma |
821 lemma |
814 "fst (hd [(a, b)]) = a" |
822 "fst (hd [(a, b)]) = a" |
815 "snd (hd [(a, b)]) = b" |
823 "snd (hd [(a, b)]) = b" |
816 using fst_conv snd_conv pair_collapse hd.simps tl.simps(2) |
824 using fst_conv snd_conv pair_collapse hd.simps tl.simps(2) |
817 using [[smt_datatypes, smt_oracle]] |
825 using [[smt_datatypes, smt_oracle, z3_with_extensions]] |
818 by smt+ |
826 by smt+ |
819 |
827 |
820 |
828 |
821 subsubsection {* Records *} |
829 subsubsection {* Records *} |
822 |
830 |
824 "p1 = p2 \<longrightarrow> cx p1 = cx p2" |
832 "p1 = p2 \<longrightarrow> cx p1 = cx p2" |
825 "p1 = p2 \<longrightarrow> cy p1 = cy p2" |
833 "p1 = p2 \<longrightarrow> cy p1 = cy p2" |
826 "cx p1 \<noteq> cx p2 \<longrightarrow> p1 \<noteq> p2" |
834 "cx p1 \<noteq> cx p2 \<longrightarrow> p1 \<noteq> p2" |
827 "cy p1 \<noteq> cy p2 \<longrightarrow> p1 \<noteq> p2" |
835 "cy p1 \<noteq> cy p2 \<longrightarrow> p1 \<noteq> p2" |
828 using point.simps |
836 using point.simps |
829 using [[smt_datatypes, smt_oracle]] |
837 using [[smt_datatypes, smt_oracle, z3_with_extensions]] |
830 using [[z3_options="AUTO_CONFIG=false"]] |
838 using [[z3_options="AUTO_CONFIG=false"]] |
831 by smt+ |
839 by smt+ |
832 |
840 |
833 lemma |
841 lemma |
834 "cx \<lparr> cx = 3, cy = 4 \<rparr> = 3" |
842 "cx \<lparr> cx = 3, cy = 4 \<rparr> = 3" |
837 "\<lparr> cx = 3, cy = 4 \<rparr> \<lparr> cx := 5 \<rparr> = \<lparr> cx = 5, cy = 4 \<rparr>" |
845 "\<lparr> cx = 3, cy = 4 \<rparr> \<lparr> cx := 5 \<rparr> = \<lparr> cx = 5, cy = 4 \<rparr>" |
838 "\<lparr> cx = 3, cy = 4 \<rparr> \<lparr> cy := 6 \<rparr> = \<lparr> cx = 3, cy = 6 \<rparr>" |
846 "\<lparr> cx = 3, cy = 4 \<rparr> \<lparr> cy := 6 \<rparr> = \<lparr> cx = 3, cy = 6 \<rparr>" |
839 "p = \<lparr> cx = 3, cy = 4 \<rparr> \<longrightarrow> p \<lparr> cx := 3 \<rparr> \<lparr> cy := 4 \<rparr> = p" |
847 "p = \<lparr> cx = 3, cy = 4 \<rparr> \<longrightarrow> p \<lparr> cx := 3 \<rparr> \<lparr> cy := 4 \<rparr> = p" |
840 "p = \<lparr> cx = 3, cy = 4 \<rparr> \<longrightarrow> p \<lparr> cy := 4 \<rparr> \<lparr> cx := 3 \<rparr> = p" |
848 "p = \<lparr> cx = 3, cy = 4 \<rparr> \<longrightarrow> p \<lparr> cy := 4 \<rparr> \<lparr> cx := 3 \<rparr> = p" |
841 using point.simps |
849 using point.simps |
842 using [[smt_datatypes, smt_oracle]] |
850 using [[smt_datatypes, smt_oracle, z3_with_extensions]] |
843 using [[z3_options="AUTO_CONFIG=false"]] |
851 using [[z3_options="AUTO_CONFIG=false"]] |
844 by smt+ |
852 by smt+ |
845 |
853 |
846 lemma |
854 lemma |
847 "cy (p \<lparr> cx := a \<rparr>) = cy p" |
855 "cy (p \<lparr> cx := a \<rparr>) = cy p" |
848 "cx (p \<lparr> cy := a \<rparr>) = cx p" |
856 "cx (p \<lparr> cy := a \<rparr>) = cx p" |
849 "p \<lparr> cx := 3 \<rparr> \<lparr> cy := 4 \<rparr> = p \<lparr> cy := 4 \<rparr> \<lparr> cx := 3 \<rparr>" |
857 "p \<lparr> cx := 3 \<rparr> \<lparr> cy := 4 \<rparr> = p \<lparr> cy := 4 \<rparr> \<lparr> cx := 3 \<rparr>" |
850 using point.simps |
858 using point.simps |
851 using [[smt_datatypes, smt_oracle]] |
859 using [[smt_datatypes, smt_oracle, z3_with_extensions]] |
852 using [[z3_options="AUTO_CONFIG=false"]] |
860 using [[z3_options="AUTO_CONFIG=false"]] |
853 by smt+ |
861 by smt+ |
854 |
862 |
855 lemma |
863 lemma |
856 "p1 = p2 \<longrightarrow> cx p1 = cx p2" |
864 "p1 = p2 \<longrightarrow> cx p1 = cx p2" |
858 "p1 = p2 \<longrightarrow> black p1 = black p2" |
866 "p1 = p2 \<longrightarrow> black p1 = black p2" |
859 "cx p1 \<noteq> cx p2 \<longrightarrow> p1 \<noteq> p2" |
867 "cx p1 \<noteq> cx p2 \<longrightarrow> p1 \<noteq> p2" |
860 "cy p1 \<noteq> cy p2 \<longrightarrow> p1 \<noteq> p2" |
868 "cy p1 \<noteq> cy p2 \<longrightarrow> p1 \<noteq> p2" |
861 "black p1 \<noteq> black p2 \<longrightarrow> p1 \<noteq> p2" |
869 "black p1 \<noteq> black p2 \<longrightarrow> p1 \<noteq> p2" |
862 using point.simps bw_point.simps |
870 using point.simps bw_point.simps |
863 using [[smt_datatypes, smt_oracle]] |
871 using [[smt_datatypes, smt_oracle, z3_with_extensions]] |
864 by smt+ |
872 by smt+ |
865 |
873 |
866 lemma |
874 lemma |
867 "cx \<lparr> cx = 3, cy = 4, black = b \<rparr> = 3" |
875 "cx \<lparr> cx = 3, cy = 4, black = b \<rparr> = 3" |
868 "cy \<lparr> cx = 3, cy = 4, black = b \<rparr> = 4" |
876 "cy \<lparr> cx = 3, cy = 4, black = b \<rparr> = 4" |
875 "p = \<lparr> cx = 3, cy = 4, black = True \<rparr> \<longrightarrow> |
883 "p = \<lparr> cx = 3, cy = 4, black = True \<rparr> \<longrightarrow> |
876 p \<lparr> cy := 4 \<rparr> \<lparr> black := True \<rparr> \<lparr> cx := 3 \<rparr> = p" |
884 p \<lparr> cy := 4 \<rparr> \<lparr> black := True \<rparr> \<lparr> cx := 3 \<rparr> = p" |
877 "p = \<lparr> cx = 3, cy = 4, black = True \<rparr> \<longrightarrow> |
885 "p = \<lparr> cx = 3, cy = 4, black = True \<rparr> \<longrightarrow> |
878 p \<lparr> black := True \<rparr> \<lparr> cx := 3 \<rparr> \<lparr> cy := 4 \<rparr> = p" |
886 p \<lparr> black := True \<rparr> \<lparr> cx := 3 \<rparr> \<lparr> cy := 4 \<rparr> = p" |
879 using point.simps bw_point.simps |
887 using point.simps bw_point.simps |
880 using [[smt_datatypes, smt_oracle]] |
888 using [[smt_datatypes, smt_oracle, z3_with_extensions]] |
881 using [[z3_options="AUTO_CONFIG=false"]] |
889 using [[z3_options="AUTO_CONFIG=false"]] |
882 by smt+ |
890 by smt+ |
883 |
891 |
884 lemma |
892 lemma |
885 "\<lparr> cx = 3, cy = 4, black = b \<rparr> \<lparr> black := w \<rparr> = \<lparr> cx = 3, cy = 4, black = w \<rparr>" |
893 "\<lparr> cx = 3, cy = 4, black = b \<rparr> \<lparr> black := w \<rparr> = \<lparr> cx = 3, cy = 4, black = w \<rparr>" |
889 |
897 |
890 lemma |
898 lemma |
891 "p \<lparr> cx := 3 \<rparr> \<lparr> cy := 4 \<rparr> \<lparr> black := True \<rparr> = |
899 "p \<lparr> cx := 3 \<rparr> \<lparr> cy := 4 \<rparr> \<lparr> black := True \<rparr> = |
892 p \<lparr> black := True \<rparr> \<lparr> cy := 4 \<rparr> \<lparr> cx := 3 \<rparr>" |
900 p \<lparr> black := True \<rparr> \<lparr> cy := 4 \<rparr> \<lparr> cx := 3 \<rparr>" |
893 using point.simps bw_point.simps |
901 using point.simps bw_point.simps |
894 using [[smt_datatypes, smt_oracle]] |
902 using [[smt_datatypes, smt_oracle, z3_with_extensions]] |
895 using [[z3_options="AUTO_CONFIG=false"]] |
903 using [[z3_options="AUTO_CONFIG=false"]] |
896 by smt |
904 by smt |
897 |
905 |
898 |
906 |
899 subsubsection {* Type definitions *} |
907 subsubsection {* Type definitions *} |