Skip to content

Include property information in json output #6651

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

Closed
zhassan-aws opened this issue Feb 8, 2022 · 0 comments · Fixed by #6696
Closed

Include property information in json output #6651

zhassan-aws opened this issue Feb 8, 2022 · 0 comments · Fixed by #6696
Labels
aws Bugs or features of importance to AWS CBMC users pending merge

Comments

@zhassan-aws
Copy link
Collaborator

CBMC version: 5.48.0
Operating system: Ubuntu 20.04.2

This is a feature request. Currently, CBMC's json output (--json-ui) does not include some of the information on the properties (file, line, and function). For example, for:

#include "assert.h"

void foo(int x, int y) {
  assert(x == y);
}

void bar(int x, int y) {
  assert(x != y);
}

int main() {
  foo(5, 5);
  bar(3, 7);
  return 0;
}

The "result" section of the json output is as follows:

$ cbmc multi.c --json-ui
.
.
.
    "result": [
      {
        "description": "assertion x == y",
        "property": "foo.assertion.1",
        "status": "SUCCESS"
      },
      {
        "description": "assertion x != y",
        "property": "bar.assertion.1",
        "status": "SUCCESS"
      }
    ]
  },

and the property information is not included anywhere in the json. The only way to get the property information is to rerun CBMC with --show-properties. This requires merging the json output from the two CBMC runs though.

Since the non-json output includes the property information:

$ cbmc multi.c 
CBMC version 5.48.0 (cbmc-5.48.0) 64-bit x86_64 linux
.
.
.

** Results:
multi.c function bar
[bar.assertion.1] line 8 assertion x != y: SUCCESS

multi.c function foo
[foo.assertion.1] line 4 assertion x == y: SUCCESS

** 0 of 2 failed (1 iterations)
VERIFICATION SUCCESSFUL

would it be possible to include it in the json output as well?

@danielsn danielsn added the aws Bugs or features of importance to AWS CBMC users label Feb 9, 2022
@tautschnig tautschnig self-assigned this Feb 9, 2022
tautschnig added a commit to tautschnig/cbmc that referenced this issue Feb 24, 2022
Unlike the plain-text variant, neither JSON nor XML included source
locations for each of the properties being reported upon by a
goto-checker.

Fixes: diffblue#6651
@tautschnig tautschnig removed their assignment Feb 24, 2022
tautschnig added a commit to tautschnig/cbmc that referenced this issue Feb 24, 2022
Unlike the plain-text variant, neither JSON nor XML included source
locations for each of the properties being reported upon by a
goto-checker.

Fixes: diffblue#6651
tautschnig added a commit to tautschnig/cbmc that referenced this issue Feb 24, 2022
Unlike the plain-text variant, neither JSON nor XML included source
locations for each of the properties being reported upon by a
goto-checker.

Fixes: diffblue#6651
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws Bugs or features of importance to AWS CBMC users pending merge
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants