Hoare Triple
The Hoare triple is a fundamental specification form in program logic, written {P} C {Q}, where P is the precondition, C is a command, and Q is the postcondition. It states that if P holds before the command executes, then Q holds after the command terminates. Through composition rules for sequencing, conditionals, and loops, complex program correctness can be decomposed into local condition verification, forming a core basis of formal verification and specification theory.
Timeline (last 90 days)
A Hoare triple has the form {P} C {Q}, where P is the precondition, C is the command, and Q is the postcondition, with the meaning: if P holds before C executes, then Q holds when C terminates (partial correctness), and adding termination gives total correctness.
The specification style in Lean is a modern variant of the Hoare style: preconditions as the theorem's hypothesis parameters, postconditions as the conclusion.
All Facts (2)
A Hoare triple has the form {P} C {Q}, where P is the precondition, C is the command, and Q is the postcondition, with the meaning: if P holds before C executes, then Q holds when C terminates (partial correctness), and adding termination gives total correctness.
50%UnverifiedThe specification style in Lean is a modern variant of the Hoare style: preconditions as the theorem's hypothesis parameters, postconditions as the conclusion.
50%