src/HOL/SPARK/Examples/RIPEMD-160/S_R.thy
author berghofe
Wed, 30 Apr 2014 15:43:44 +0200
changeset 56798 939e88e79724
parent 41561 d1318f3c86ba
child 62390 842917225d56
permissions -rw-r--r--
Discontinued old spark_open; spark_open_siv is now spark_open
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
41561
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
     1
(*  Title:      HOL/SPARK/Examples/RIPEMD-160/S_R.thy
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
     2
    Author:     Fabian Immler, TU Muenchen
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
     3
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
     4
Verification of the RIPEMD-160 hash function
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
     5
*)
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
     6
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
     7
theory S_R
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
     8
imports RMD_Specification RMD_Lemmas
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
     9
begin
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
    10
56798
939e88e79724 Discontinued old spark_open; spark_open_siv is now spark_open
berghofe
parents: 41561
diff changeset
    11
spark_open "rmd/s_r"
41561
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
    12
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
    13
spark_vc function_s_r_2
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
    14
proof -
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
    15
  from `0 \<le> j` `j \<le> 79`
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
    16
  show C: ?C1
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
    17
    by (simp add: s'_def s'_list_def nth_map [symmetric, of _ _ int] del: fun_upd_apply)
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
    18
      (simp add: nth_fun_of_list_eq [of _ _ undefined] del: fun_upd_apply)
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
    19
  from C show ?C2 by simp
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
    20
  have "list_all (\<lambda>n. int n \<le> 15) s'_list"
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
    21
    by (simp add: s'_list_def)
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
    22
  moreover have "length s'_list = 80"
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
    23
    by (simp add: s'_list_def)
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
    24
  ultimately show ?C3 unfolding C using `j \<le> 79`
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
    25
    by (simp add: s'_def list_all_length)
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
    26
qed
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
    27
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
    28
spark_end
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
    29
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
    30
end