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

Add arg/dot, arg/state, arg/eval and arg/eval-int requests to server mode #1008

Merged
merged 13 commits into from
Mar 21, 2023

Conversation

sim642
Copy link
Member

@sim642 sim642 commented Mar 3, 2023

Changes

  1. Add function fields to cfg/lookup and arg/lookup responses.
  2. Add arg/dot request, which returns the Graphviz string representation of the ARG.
  3. Add arg/state request, which returns the JSON representation of an ARG node local state.
  4. Add arg/eval request, which returns the JSON representation of a C expression evaluated at an ARG node.

The latter two are achieved by introducing a PathQuery query. The PathQuery generalizes the ability of Invariant query to only query a single path from the witness lifter. The DYojson query just returns D.to_yojson but via the query system. It is slightly hacky but allows accessing the local state representation of a particular path without bigger changes to all the Spec lifters.

TODO

  • Rename arg/evalarg/eval-int.

@sim642 sim642 added feature debugging Abstract debugging labels Mar 3, 2023
@sim642 sim642 requested a review from FeldrinH March 3, 2023 09:45
@sim642 sim642 changed the title Add arg/dot and arg/state requests to server mode Add arg/dot, arg/state and arg/eval requests to server mode Mar 7, 2023
@sim642 sim642 self-assigned this Mar 13, 2023
@sim642 sim642 removed their assignment Mar 13, 2023
@sim642 sim642 changed the title Add arg/dot, arg/state and arg/eval requests to server mode Add arg/dot, arg/state and arg/eval-int requests to server mode Mar 14, 2023
@FeldrinH
Copy link
Collaborator

aaa9cad did not resolve the issue with evaluating global variables after reanalysis. Now all global variables evaluate to top after reanalysis.

@sim642
Copy link
Member Author

sim642 commented Mar 20, 2023

aaa9cad did not resolve the issue with evaluating global variables after reanalysis. Now all global variables evaluate to top after reanalysis.

Do you have a specific test case where that happens?

@FeldrinH
Copy link
Collaborator

// repro.c
int global = 32;

int main() {
    int local = 3;
}
// goblint.json
{
  "files": ["repro.c"]
}

After reanalysis arg/eval-int will return top for the expression global.

Note: running analysis with reset=false you need to analyze, comment out global, reanalyze, comment in global and reanalyze again to get the issue to happen. Running analysis with reset=true you just need to analyze twice.

@sim642 sim642 changed the title Add arg/dot, arg/state and arg/eval-int requests to server mode Add arg/dot, arg/state, arg/eval and arg/eval-int requests to server mode Mar 21, 2023
@sim642 sim642 merged commit d6143aa into master Mar 21, 2023
@sim642 sim642 deleted the arg-state branch March 21, 2023 11:34
sim642 added a commit that referenced this pull request Mar 21, 2023
@sim642 sim642 added this to the v2.2.0 milestone Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debugging Abstract debugging feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants