src/HOL/IMP/Natural.thy
changeset 20503 503ac4c5ef91
parent 19796 d86e7b1fc472
child 23746 a455e69c31cc
equal deleted inserted replaced
20502:08d227db6c74 20503:503ac4c5ef91
   198 *}
   198 *}
   199 theorem com_det:
   199 theorem com_det:
   200   assumes "\<langle>c,s\<rangle> \<longrightarrow>\<^sub>c t" and "\<langle>c,s\<rangle> \<longrightarrow>\<^sub>c u"
   200   assumes "\<langle>c,s\<rangle> \<longrightarrow>\<^sub>c t" and "\<langle>c,s\<rangle> \<longrightarrow>\<^sub>c u"
   201   shows "u = t"
   201   shows "u = t"
   202   using prems
   202   using prems
   203 proof (induct fixing: u set: evalc)
   203 proof (induct arbitrary: u set: evalc)
   204   fix s u assume "\<langle>\<SKIP>,s\<rangle> \<longrightarrow>\<^sub>c u"
   204   fix s u assume "\<langle>\<SKIP>,s\<rangle> \<longrightarrow>\<^sub>c u"
   205   thus "u = s" by simp
   205   thus "u = s" by simp
   206 next
   206 next
   207   fix a s x u assume "\<langle>x :== a,s\<rangle> \<longrightarrow>\<^sub>c u"
   207   fix a s x u assume "\<langle>x :== a,s\<rangle> \<longrightarrow>\<^sub>c u"
   208   thus "u = s[x \<mapsto> a s]" by simp
   208   thus "u = s[x \<mapsto> a s]" by simp
   259 *}
   259 *}
   260 theorem
   260 theorem
   261   assumes "\<langle>c,s\<rangle> \<longrightarrow>\<^sub>c t" and "\<langle>c,s\<rangle> \<longrightarrow>\<^sub>c u"
   261   assumes "\<langle>c,s\<rangle> \<longrightarrow>\<^sub>c t" and "\<langle>c,s\<rangle> \<longrightarrow>\<^sub>c u"
   262   shows "u = t"
   262   shows "u = t"
   263   using prems
   263   using prems
   264 proof (induct fixing: u)
   264 proof (induct arbitrary: u)
   265   -- "the simple @{text \<SKIP>} case for demonstration:"
   265   -- "the simple @{text \<SKIP>} case for demonstration:"
   266   fix s u assume "\<langle>\<SKIP>,s\<rangle> \<longrightarrow>\<^sub>c u"
   266   fix s u assume "\<langle>\<SKIP>,s\<rangle> \<longrightarrow>\<^sub>c u"
   267   thus "u = s" by simp
   267   thus "u = s" by simp
   268 next
   268 next
   269   -- "and the only really interesting case, @{text \<WHILE>}:"
   269   -- "and the only really interesting case, @{text \<WHILE>}:"