Preserve variable name z in VAR {z = t}
authornipkow
Sun, 07 Nov 2021 14:26:11 +0100
changeset 75108 f05c73bf5968
parent 75107 15beb1ef5ad1
child 75111 cc54b8812c63
Preserve variable name z in VAR {z = t}
src/HOL/Hoare/Hoare_Logic.thy
src/HOL/Hoare/hoare_syntax.ML
--- a/src/HOL/Hoare/Hoare_Logic.thy	Sun Nov 07 10:07:09 2021 +0100
+++ b/src/HOL/Hoare/Hoare_Logic.thy	Sun Nov 07 14:26:11 2021 +0100
@@ -134,8 +134,8 @@
   assumes "p \<subseteq> i"
       and "\<And>n::nat . ValidTC (i \<inter> b \<inter> {s . v s = n}) c (A n) (i \<inter> {s . v s < n})"
       and "i \<inter> uminus b \<subseteq> q"
-    shows "ValidTC p (While b c) (Awhile i v A) q"
-proof -
+    shows "ValidTC p (While b c) (Awhile i v (\<lambda>n. A n)) q"
+proof -                             
   {
     fix s n
     have "s \<in> i \<and> v s = n \<longrightarrow> (\<exists>t . Sem (While b c) s t \<and> t \<in> q)"
--- a/src/HOL/Hoare/hoare_syntax.ML	Sun Nov 07 10:07:09 2021 +0100
+++ b/src/HOL/Hoare/hoare_syntax.ML	Sun Nov 07 14:26:11 2021 +0100
@@ -99,7 +99,7 @@
           let val (c',a) = tr c xs
               val (v',A) = case v of
                 Const (\<^const_syntax>\<open>HOL.eq\<close>, _) $ z $ t => (t, Syntax_Trans.abs_tr [z, a]) |
-                t => (t, absdummy dummyT a)
+                t => (t, Abs ("n", dummyT, a))
           in (syntax_const ctxt #While $ bexp_tr b xs $ c',
               Syntax.const \<^const_syntax>\<open>Awhile\<close>
                 $ assn_tr i xs $ var_tr v' xs $ A)