2

Currently I'm executing:

frama-c -wp -wp-rte -report-rules test_rules.json -wp-split -wp-fct max -wp-status-maybe -wp-status-invalid -wp-timeout 10 -wp-prover alt-ergo -wp-par 12 -warn-signed-overflow -warn-unsigned-overflow -warn-special-float non-finite test.c -then -report-csv test.csv

I read documentation, but didn't find a good explanation how this JSON file works. I found some code at GitHub. But still it's not trivial for Frama-C novice.

I would like to have a CSV that has only rows with status different than Valid and only in test.c file (without dependencies). Is it possible this to be done from JSON config or I have to write custom parser?

The_Ghost
  • 2,070
  • 15
  • 26

1 Answers1

1

I think there is some misunderstanding there: the -report-rules option is meant to be used in conjunction with -report-json. It has no effect on -report-csv, which will always output the whole list of properties. In fact, the very point of -report-csv is to import the resulting file into another tool in order to perform whatever operation you're interested in. For instance, you can simply open the file in your favorite spreadsheet editor and its built-in filters. But there are a lot of programming options as well. Building upon the script written here, here is an example using the interpreter with the library

>>> import pandas
>>> df = pandas.read_csv("test.csv",sep="\t")
>>> print('There are ' + str(len(df)) + ' properties.')
There are 77 properties.
>>> df = df[df['function']=='merge']
>>> print('There are ' + str(len(df)) + ' properties.')
There are 39 properties.
>>> df = df[df['status']=='Unknown']
>> print('There are ' + str(len(df)) + ' properties.')
There are 3 properties.
>>> print('There are ' + str(len(df)) + ' properties.')
>>> df.to_csv(path_or_buf='res.txt',sep='\t')

This gives me the 3 Unknown properties related to function merge in file res.csv (I hadn't a multi-file example available right away, but of course you would just have to use the file field in your first query). Just keep in mind that the "csv" file is in fact tabular-separated and not comma-separated (since commas tend to appear in ACSL formulas the latter would not be very practical).

Virgile
  • 9,724
  • 18
  • 42