Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Remove IORef indirection from TheoremDB #1882

Merged
merged 8 commits into from
Jun 30, 2023
Merged

Remove IORef indirection from TheoremDB #1882

merged 8 commits into from
Jun 30, 2023

Conversation

samcowger
Copy link
Contributor

Previously, TheoremDBs encapsulated mutable state, realized with an IORef. Here, I try to preserve the semantics of this structure while removing its reliance on in-place mutation. The job of replacing an old TheoremDB with a new one is now the duty of clients of SAWScript.Proof, which generally will return a new DB when a theorem may have been added to it. See, e.g., how finishProof's type has changed. SAWScript.Proof maintains its existing ownership/secrecy of TheoremDB's representation.

The motivation for this is to try to centralize state management in SAW's top-level environments (in particular, TopLevelRW, which ought to be responsible for the sort of state management duties that TheoremDB had taken on).

One question I have in particular: does my purification of reachableTheorems have the potential to change the semantics/strictness of potential calls to panic from within the function?

cc @eddywestbrook @m-yac

src/SAWScript/Proof.hs Outdated Show resolved Hide resolved
src/SAWScript/Proof.hs Outdated Show resolved Hide resolved
src/SAWScript/Builtins.hs Outdated Show resolved Hide resolved
src/SAWScript/Builtins.hs Outdated Show resolved Hide resolved
src/SAWScript/Builtins.hs Outdated Show resolved Hide resolved
Copy link
Contributor

@RyanGlScott RyanGlScott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks quite reasonable to me. Thanks!

@samcowger samcowger added the PR: ready to merge Magic flag for pull requests to ask Mergify to merge given an approval and a successful CI run label Jun 29, 2023
@mergify mergify bot merged commit 33b0d87 into master Jun 30, 2023
@mergify mergify bot deleted the purify-theoremdb branch June 30, 2023 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: ready to merge Magic flag for pull requests to ask Mergify to merge given an approval and a successful CI run
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants