Hoare triple specifications for select functions #
This module contains Hoare triple specifications for some functions in Core.
Lifting MonadStateOf #
Lifting MonadReaderOf #
Lifting MonadExceptOf #
The type of loop invariants used by the specifications of for ... in ... loops.
A loop invariant maps the iteration cursor and accumulator state to an assertion.
The exception postcondition is specified separately as the spec's epost parameter.
Equations
- Std.Internal.Do.Invariant xs β Pred = (xs.Cursor → β → Pred)
Instances For
An invariant combinator for loops with early return, for the new do elaborator which
uses Prod for the state tuple: onContinue is the invariant while iterating, onReturn
holds once the loop returned early with a value.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The type of loop invariants used by the specifications of for ... in ... loops over strings.
A loop invariant is a function mapping the current position and state to a lattice element.
Equations
- Std.Internal.Do.StringInvariant s β Pred = (s.Pos → β → Pred)
Instances For
An invariant combinator for String loops with early return, for the new do elaborator
which uses Prod for the state tuple: onContinue is the invariant while iterating, onReturn
holds once the loop returned early with a value.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The type of loop invariants used by the specifications of for ... in ... loops over string slices.
A loop invariant is a function mapping the current position and state to a lattice element.
Equations
- Std.Internal.Do.StringSliceInvariant s β Pred = (s.Pos → β → Pred)
Instances For
An invariant combinator for String.Slice loops with early return, for the new do
elaborator which uses Prod for the state tuple: onContinue is the invariant while iterating,
onReturn holds once the loop returned early with a value.
Equations
- One or more equations did not get rendered due to their size.
Instances For
An invariant for a whileM loop, given as a predicate over the α ⊕ β cursor:
.inl a is the continue case at a; .inr b is the break case with result b.
Equations
- Std.Internal.Do.WhileInvariant α β Pred = (α ⊕ β → Pred)
Instances For
A termination measure for a whileM loop.
Equations
- Std.Internal.Do.WhileVariant α = (α → Nat)
Instances For
Specification for whileM. The user supplies a termination measure, an invariant, and a step
Triple whose post either continues with a strictly smaller measure or finishes with the .inr
invariant.
Specification for forIn over a Lean.Loop. The cursor is β ⊕ β: .inl b means
"still iterating with b", .inr b means "finished with result b".