Repository navigation
Conversation
`WP` carries the predicate transformer only, and `MonadicWP` carries the interpretation of a monad only. The laws are `Prop` classes over `PredTrans`: `PredTrans.IsMonotone` and `PredTrans.IsConjunctive`, with instances for the transformer combinators. `WP.IsMonotone Prog` states monotonicity for every program of type `Prog`. `MonadicWP.IsLaxMonadMorphism` and `MonadicWP.IsMonadMorphism` state the laws of `pure` and `bind` for an interpretation of a monad. `wp` and `Triple` take no orders. `vcgen` synthesizes the orders and laws that a spec needs when it builds the rule for the spec. `WPMonad` becomes `MonadicWP`, `WPConjunctive x` becomes `(WP.trans x).IsConjunctive`, and `Assertion` is deprecated in favour of `CompleteLattice`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D74FF3YMbbk7yvips5ezWi
Member
Author
|
!bench |
|
Benchmark results for 61fe1b8 against 16f65a4 are in. There are significant results. @sgraf812
Large changes (2🟥)
Small changes (17✅, 20🟥)
|
`WP.IsConjunctive x` abbreviates `(WP.trans x).IsConjunctive`, `MonadicWP.IsMonotone m` abbreviates `∀ α, WP.IsMonotone (m α)`, and `MonadicWP.IsConjunctive m` abbreviates `∀ α (x : m α), WP.IsConjunctive x`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D74FF3YMbbk7yvips5ezWi
`vcgen` caches the law instances of spec rules per call, keyed by the law class and its determining argument, and reads `WP.IsMonotone (m α)` off a cached `MonadicWP.IsMonotone m`. The monotonicity lemmas are applied without type checks, as before. `MonadicWP.IsMonotone` has instances for the transformers, and their lax morphism instances have low priority, so instance search derives the lax laws of a monad morphism directly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D74FF3YMbbk7yvips5ezWi
Member
Author
|
!bench |
|
Benchmark results for 8059fce against 16f65a4 are in. There are significant results. @sgraf812
Large changes (7✅, 2🟥)
Medium changes (2✅)
Small changes (71✅, 16🟥)
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR states the laws of
Std.WPasPropclasses over predicate transformers.WPcarries only the transformertrans, andMonadicWP(formerlyWPMonad) carries only the interpretation of a monad. SowpandTripletake no orders, and an interpretation whose assertions form only a partial order, such as quantum effects under the Löwner order (Discovering formally verified quantum programs with AI), works withvcgen.The laws:
PredTrans.IsMonotone tandPredTrans.IsConjunctive tfor a transformert, with instances forpure,>>=,pushArg,pushExceptTandpushOptionT.WP.IsMonotone ProgandWP.IsConjunctive x: abbreviations for the transformer of every program of typeProgbeing monotone, and for the transformer of the programxbeing conjunctive.MonadicWP.IsMonotone mandMonadicWP.IsConjunctive mstate the same for all programs of a monadm.MonadicWP.IsLaxMonadMorphism m:pureandbindof the transformers lie below the transformers ofpureandbind.MonadicWP.IsMonadMorphism m: the transformer commutes withpureandbind.A
WPinstance declares onlytrans. Its monotonicity is a separate instanceWP.IsMonotone Prog, whose proof is the formertrans_monotonefield.WPMonad m Pred EPostsbecomes[MonadicWP m Pred EPosts] [MonadicWP.IsMonotone m] [MonadicWP.IsLaxMonadMorphism m],WPConjunctive xbecomesWP.IsConjunctive x, andStd.WP.Assertionis deprecated in favour ofCompleteLattice.Stacked on #16425.
🤖 Generated with Claude Code