1

How can we prove a program in repeat until using Hoare Logic?

I've found a rule like this:

{P} S {R}, {R ^ ~B -> P}, {R ^ B -> Q}

For {P} repeat S until B {Q}

But I still can't find any explanatiom how I can use this rule

For example in this question:

{x > 0 ^ y > 0}
     z:=0; u:=x; REPEAT
        z:=z+y;
        u:=u-1;
     UNTIL u=0;
{z = x * y}

How I can use the rule to prove this program?

Russia Must Remove Putin
  • 374,368
  • 89
  • 403
  • 331

0 Answers0