src/HOL/SPARK/Examples/RIPEMD-160/S_R.thy
author berghofe
Sat, 15 Jan 2011 12:35:29 +0100
changeset 41561 d1318f3c86ba
child 56798 939e88e79724
permissions -rw-r--r--
Added new SPARK verification environment.
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
d1318f3c86ba Added new SPARK verification environment.
berghofe
parents:
diff changeset
    11
spark_open "rmd/s_r.siv"
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