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

Type-safe global query system #1423

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

Type-safe global query system #1423

wants to merge 27 commits into from

Conversation

sim642
Copy link
Member

@sim642 sim642 commented Apr 22, 2024

Queries like WarnGlobal and InvariantGlobal are only used globally in dummy ctx. Moreover, they have Obj.t arguments which are unsafe.
Every analysis lifter which adds its own global unknowns must have special cases for converting such arguments for WarnGlobal and InvariantGlobal. If that is forgotten, then Goblint simply segfaults.

This PR introduces global queries using a separate global_query "transfer" function and gctx global "context" for the queries, which doesn't require all the dummy data.

TODO

@sim642 sim642 removed their assignment Apr 24, 2024
Copy link
Member

@michael-schwarz michael-schwarz left a comment

Choose a reason for hiding this comment

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

Nice! I think we should add this to the documentation.

Also, why is it necessary to stop recording per loop termination information here? I think such information can be very helpful, e.g., when debugging or potentially in the future, when we may want to slice out a program containing only the part for which we could not show termination.

@sim642 sim642 self-assigned this Apr 29, 2024
@michael-schwarz
Copy link
Member

Could we maybe think of better names for these things? I think ctx and query are things we are overusing already.

Also, WarnGlobal does not really fit into the category query anyway, as it returns unit. Maybe for it, a separate transfer function that does not get a ctx but only an ask and is called per analysis at the end of the analysis would be the more principled thing?

@sim642
Copy link
Member Author

sim642 commented May 8, 2024

Just ask isn't enough for these kinds of things though, they also need global. For example, the deadlock analysis needs to traverse the entire cycle starting from a global.

@michael-schwarz
Copy link
Member

True, maybe give it ask and getg then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants