Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[WIP] Consolidate monad definitions to extlib #270

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

laelath
Copy link

@laelath laelath commented Sep 30, 2024

Removes the monad definitions in theories/Basics/Basics.v, and adapts all uses of stateT and writerT to instead use the ones defined in the extlib.

TODO:

  • update theories/Events/FailFacts.v to use optionT from the extlib.
  • update extra/
  • update tests/
  • update examples/
  • update tutorial/

The changes are currently very not-backwards-compatible. I'm not entirely sure if it is possible to make them backwards compatible without copying every single lemma that uses the monads.

Closes #258

@laelath
Copy link
Author

laelath commented Oct 2, 2024

I had some trouble updating the proof of print_mults_sat_spec in extra/StateIOTrace.v. Either something is getting unfolded too much by the dependent induction earlier, or the monad change requires an extra proof of Proper for the setoid rewrite.

@Lysxia
Copy link
Collaborator

Lysxia commented Oct 2, 2024

This is very helpful, thanks! I'll take a closer look at the proof you mention tomorrow.

@laelath
Copy link
Author

laelath commented Oct 2, 2024

Something about the switch to a record makes controlling unfolding a lot more annoying. I marked interp_state as simpl never as a cludgy fix but it also causes some issues.

@Lysxia
Copy link
Collaborator

Lysxia commented Oct 2, 2024

The root cause of the failure is still mysterious to me but I managed to fix the proof. dependent induction does too much unfolding now. We want to keep interp_state handleIOState folded as long as possible, so I abstract it away with remember then revert the equation into the goal because dependent induction was still trying to use the equation to undo the remember.

@laelath
Copy link
Author

laelath commented Oct 7, 2024

when updating the tutorial, there seems to be a somewhat significant decision to make about whether the interp_asm and interp_imp functions should expose the stateT or produce an interface like the current one that returns a function that takes the state like they currently do.

@Lysxia
Copy link
Collaborator

Lysxia commented Oct 7, 2024

I don't think I rely on the stateT abstraction in the tutorial, so try removing it from the result of interp_asm and interp_imp.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consolidate stateT to extlib?
2 participants