Mul_Count_def: fixes n :: "nat" shows "Mul_Count n \<equiv> \<lbrace>\<acute>Mul_Proper n \<and> Roots \<subseteq> Blacks \<acute>M \<and> \<acute>obc \<subseteq> Blacks \<acute>Ma \<and> Blacks \<acute>Ma \<subseteq> Blacks \<acute>M \<and> \<acute>bc \<subseteq> Blacks \<acute>M \<and> length \<acute>Ma = length \<acute>M \<and> (\<acute>Safe \<or> \<acute>obc \<subset> Blacks \<acute>Ma \<or> \<acute>l < \<acute>q \<and> (\<acute>q \<le> \<acute>Queue \<or> \<acute>obc \<subset> Blacks \<acute>M)) \<and> \<acute>q < n + 1 \<and> \<acute>bc = {}\<rbrace> \<acute>ind := 0;; \<lbrace>\<acute>Mul_Proper n \<and> Roots \<subseteq> Blacks \<acute>M \<and> \<acute>obc \<subseteq> Blacks \<acute>Ma \<and> Blacks \<acute>Ma \<subseteq> Blacks \<acute>M \<and> \<acute>bc \<subseteq> Blacks \<acute>M \<and> length \<acute>Ma = length \<acute>M \<and> (\<acute>Safe \<or> \<acute>obc \<subset> Blacks \<acute>Ma \<or> \<acute>l < \<acute>q \<and> (\<acute>q \<le> \<acute>Queue \<or> \<acute>obc \<subset> Blacks \<acute>M)) \<and> \<acute>q < n + 1 \<and> \<acute>bc = {} \<and> \<acute>ind = 0\<rbrace>  WHILE \<acute>ind < length \<acute>M INV \<lbrace>\<acute>Mul_Proper n \<and> Roots \<subseteq> Blacks \<acute>M \<and> \<acute>obc \<subseteq> Blacks \<acute>Ma \<and> Blacks \<acute>Ma \<subseteq> Blacks \<acute>M \<and> \<acute>bc \<subseteq> Blacks \<acute>M \<and> length \<acute>Ma = length \<acute>M \<and> \<acute>Mul_CountInv \<acute>ind \<and> (\<acute>Safe \<or> \<acute>obc \<subset> Blacks \<acute>Ma \<or> \<acute>l < \<acute>q \<and> (\<acute>q \<le> \<acute>Queue \<or> \<acute>obc \<subset> Blacks \<acute>M)) \<and> \<acute>q < n + 1 \<and> \<acute>ind \<le> length \<acute>M\<rbrace>  DO \<lbrace>\<acute>Mul_Proper n \<and> Roots \<subseteq> Blacks \<acute>M \<and> \<acute>obc \<subseteq> Blacks \<acute>Ma \<and> Blacks \<acute>Ma \<subseteq> Blacks \<acute>M \<and> \<acute>bc \<subseteq> Blacks \<acute>M \<and> length \<acute>Ma = length \<acute>M \<and> \<acute>Mul_CountInv \<acute>ind \<and> (\<acute>Safe \<or> \<acute>obc \<subset> Blacks \<acute>Ma \<or> \<acute>l < \<acute>q \<and> (\<acute>q \<le> \<acute>Queue \<or> \<acute>obc \<subset> Blacks \<acute>M)) \<and> \<acute>q < n + 1 \<and> \<acute>ind < length \<acute>M\<rbrace>  IF \<acute>M ! \<acute>ind = Black THEN \<lbrace>\<acute>Mul_Proper n \<and> Roots \<subseteq> Blacks \<acute>M \<and> \<acute>obc \<subseteq> Blacks \<acute>Ma \<and> Blacks \<acute>Ma \<subseteq> Blacks \<acute>M \<and> \<acute>bc \<subseteq> Blacks \<acute>M \<and> length \<acute>Ma = length \<acute>M \<and> \<acute>Mul_CountInv \<acute>ind \<and> (\<acute>Safe \<or> \<acute>obc \<subset> Blacks \<acute>Ma \<or> \<acute>l < \<acute>q \<and> (\<acute>q \<le> \<acute>Queue \<or> \<acute>obc \<subset> Blacks \<acute>M)) \<and> \<acute>q < n + 1 \<and> \<acute>ind < length \<acute>M \<and> \<acute>M ! \<acute>ind = Black\<rbrace> \<acute>bc := insert \<acute>ind \<acute>bc FI;; \<lbrace>\<acute>Mul_Proper n \<and> Roots \<subseteq> Blacks \<acute>M \<and> \<acute>obc \<subseteq> Blacks \<acute>Ma \<and> Blacks \<acute>Ma \<subseteq> Blacks \<acute>M \<and> \<acute>bc \<subseteq> Blacks \<acute>M \<and> length \<acute>Ma = length \<acute>M \<and> \<acute>Mul_CountInv (\<acute>ind + 1) \<and> (\<acute>Safe \<or> \<acute>obc \<subset> Blacks \<acute>Ma \<or> \<acute>l < \<acute>q \<and> (\<acute>q \<le> \<acute>Queue \<or> \<acute>obc \<subset> Blacks \<acute>M)) \<and> \<acute>q < n + 1 \<and> \<acute>ind < length \<acute>M\<rbrace> \<acute>ind := \<acute>ind + 1 OD"