Glossary · Term

Hoare logic

← all terms

Definition

Plain language

A way of checking a program step by step by writing down what must be true before each step and what it promises to be true afterward.

As stated in the literature

A formal system for reasoning about program correctness via preconditions and postconditions on each statement; in Lean4Agent, used to annotate workflow steps so a verifier can prove each step's promised outputs cover the next step's required inputs.

Why it matters: It lets a checker prove that each step of a program or workflow honors its promises and that one step's output truly satisfies what the next step needs.

For example, before a step that divides two numbers, you write down that the bottom number must not be zero, and afterward you write down what the result is guaranteed to be.

Heard on the show

“This is where they borrow an old idea from program verification called Hoare logic — contracts.”
Episode 122 — When Your Coding Agent Lies About the Fix: Verifying the Plan Before the Model Runs

Mentioned in 1 episode

  1. 122
    When Your Coding Agent Lies About the Fix: Verifying the Plan Before the Model Runs

Related terms