GaloisInc / macaw

Open source binary analysis tools.
BSD 3-Clause "New" or "Revised" License
190 stars 19 forks source link

Generalize lazy memory model using `HasMacawLazySimulatorState` #358

Closed RyanGlScott closed 7 months ago

RyanGlScott commented 7 months ago

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.