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

Generalize lazy memory model using HasMacawLazySimulatorState #358

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

RyanGlScott
Copy link
Contributor

This introduces a HasMacawLazySimulatorState data type, which provides a "classy lens" for accessing a MacawLazySimulatorState within some Crucible personality type. It also generalizes the lazy macaw-symbolic memory model in Data.Macaw.Symbolic.Memory.Lazy to be polymorphic over HasMacawLazySimulatorState instances. The upside is that it is now possible to use the lazy memory model at other personality types besides just MacawLazySimulatorState, making it much easier to extend the memory model.

Because there is a HasMacawLazySimulatorState instance for MacawLazySimulatorState, existing code that uses MacawLazySimulatorState should continue to compile without changes.

Fixes #357.

This introduces a `HasMacawLazySimulatorState` data type, which provides a
"classy lens" for accessing a `MacawLazySimulatorState` within some Crucible
personality type. It also generalizes the lazy `macaw-symbolic` memory model in
`Data.Macaw.Symbolic.Memory.Lazy` to be polymorphic over
`HasMacawLazySimulatorState` instances. The upside is that it is now possible
to use the lazy memory model at other personality types besides just
`MacawLazySimulatorState`, making it much easier to extend the memory model.

Because there is a `HasMacawLazySimulatorState` instance for
`MacawLazySimulatorState`, existing code that uses `MacawLazySimulatorState`
should continue to compile without changes.

Fixes #357.
@RyanGlScott RyanGlScott merged commit aaa5ea1 into master Dec 12, 2023
3 checks passed
@RyanGlScott RyanGlScott deleted the T357-HasMacawLazySimulatorState branch December 12, 2023 20:29
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.

Make the lazy macaw-symbolic memory model more extensible
3 participants