Hoare logic
Hoare logic is a formal system used in computer science to reason about the correctness of computer programs. It provides a way to specify the behavior of programs using preconditions and postconditions. A precondition is a statement that must be true before a program runs, while a postcondition describes what must be true after the program has executed.
The core of Hoare logic is the Hoare triple, which is written as {P C Q }. Here, P is the precondition, C is the command or program, and Q is the postcondition. If the precondition holds before executing the command, and if the command terminates, then the postcondition will hold afterward.