What does it mean to “strengthen the precondition and weaken the postcondition” in Hoare logic?

cs.stackexchange https://cs.stackexchange.com/questions/65440

Having learned a rough summary of Hoare logic (i.e. learning just the basic concept of Hoare triples and a few of the rules) I kept seeing a statement along these lines:

The rule of consquence allows us to strengthen the precondition and weaken the postcondition. (paraphrased)

  1. What does it actually mean to strengthen the precondition and to weaken the postcondition?

  2. Is and used in its strict logical meaning in this sense, i.e. if we apply the rule of consequence we will always do both? Or can it be read as allowing us to choose to strengthen the precondition or weaken the postcondition?

I get the (very basic) idea of the rule, but this statement implies the rule can be applied for a strategic reason that isn't clearly explained.

Thanks.

没有正确的解决方案

许可以下: CC-BY-SA归因
不隶属于 cs.stackexchange
scroll top