Skip to content

wip itree semantics control flow - #75

Draft
alexkeizer wants to merge 84 commits into
mainfrom
wip-itree-semantics-control-flow
Draft

wip itree semantics control flow#75
alexkeizer wants to merge 84 commits into
mainfrom
wip-itree-semantics-control-flow

Conversation

@alexkeizer

Copy link
Copy Markdown
Collaborator
  • refactor: replace Effect with a typeclass
  • feat: Reduce notation class
  • refactor: drop dependently typed CFG in favour of plain BlockIds
  • feat: block arguments
  • feat: implement ITree.interpM
  • rename Is{Node,Leaf} and move to separate file
  • Itree: strong bisim
  • ITree.Bisim: simplify definition, golf proof, add scoped notation
  • interp_congr proof 🎉
  • refactor: migrate local ITree modules to use ITreeExtras
  • feat: hasEffect_iter proof
  • refactor: move iter' and hasEffect_iter' proof into ITreeExtras module
  • claude: include instruction to use nix
  • feat: hasEffect_bind_of helper lemmas
  • feat: bind_raise{UB, Error} simp-lemmas
  • refactor: Effect-set aliasses
  • feat: hasEffect_bind
  • refactor: make effect lifting more explicit
  • chore: Subeffect.map normalization
  • chore: MultiContext.denote simp lemmas
  • chore: Subeffect.map_fst_eq_self
  • feat: mayReturn_bind
  • feat: hasEffect_trigger
  • feat: hasEffect/mayReturn_forM
  • chore: hasEffect / mayReturn_lift lemma statements
  • chore: generalize mayReturn_forM
  • chore: Subeffect.map_{inl,inr} lemmas
  • chore: hasEffect_pushVar lemma statement
  • chore: hasEffect_seqRight corollary of hasEffect_bind
  • refactor: more Subeffect.map normalization simp-lemmas
  • feat: finish interpHoles_program proof
  • post-rebase fixups
  • post-rebase fixup: Stub
  • multi-context fix
  • CFG: drop annotations

alexkeizer added 30 commits July 9, 2026 22:34
This PR refactors the Effect structure into a(n empty) typeclass, where the old Effect.I and Effect.O fields are now represented as *parameters* the typeclass (with Effect.O in particular being an outParam).

By doing so, we avoid the headaches that come from, e.g, `Sum` being def-eq to `SumE.I`, yet, certain definitions and rewrites expecting one or the other. By moving to the typeclass, there's no longer any need for a seperate `SumE` definition. The effect is just defined by the actual type, Sum, and the "`O`" output is found via the typeclass instance `Effect (Sum _ _) ...`.

While refactoring, we also take the opportunity to use greek letters for (effect) type variables, over latin capital `E`, to bring the library closer to idiomatic Lean style.
Some sorries left, which look like they should be easy to prove with the right simp-lemmas on ITree.lift
This PR pull `LocalStack` out into its own file, and refactors its definition to be a quotient of a hashmap over `HashMap.Equiv`. We do this, so that we get that two local stacks that assign the same values (or lack thereof) to each variable are considered strictly equal. WIthout this property, refinement is not a proper partial order.
@alexkeizer
alexkeizer force-pushed the wip-itree-semantics-control-flow branch from d822e82 to a993c07 Compare July 17, 2026 10:47
@alexkeizer
alexkeizer force-pushed the wip-itree-semantics-control-flow branch from 851d075 to 554627b Compare July 24, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant