Reasoning about actions with loops via Hoare logic