-
Notifications
You must be signed in to change notification settings - Fork 108
/
Copy pathXVcg.thy
36 lines (25 loc) · 956 Bytes
/
XVcg.thy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
(*
Author: Norbert Schirmer
Maintainer: Norbert Schirmer, norbert.schirmer at web de
Copyright (C) 2006-2008 Norbert Schirmer
*)
theory XVcg
imports Vcg
begin
text \<open>We introduce a syntactic variant of the let-expression so that we can
safely unfold it during verification condition generation. With the new
theorem attribute \<open>vcg_simp\<close> we can declare equalities to be used
by the verification condition generator, while simplifying assertions.
\<close>
syntax
"_Let'" :: "[letbinds, basicblock] => basicblock" ("(LET (_)/ IN (_))" 23)
translations
"_Let' (_binds b bs) e" == "_Let' b (_Let' bs e)"
"_Let' (_bind x a) e" == "CONST Let' a (%x. e)"
lemma Let'_unfold [vcg_simp]: "Let' x f = f x"
by (simp add: Let'_def Let_def)
lemma Let'_split_conv [vcg_simp]:
"(Let' x (\<lambda>p. (case_prod (f p) (g p)))) =
(Let' x (\<lambda>p. (f p) (fst (g p)) (snd (g p))))"
by (simp add: split_def)
end