I came across this hoare logic for factorials but I don't quite understand it. We multiply F and X but we're not adding up all values of F so how do we get the sum/factorial at the end?
Precondition: $\{ X > 0 \land X = x \}$
- $F := 1$
- while $X > 0$ do
- $\quad F := F \cdot X$
- $\quad X := X - 1$
- od
Postcondition: $\{F = x!\}$