0

Presently, I'm trying to use Frama-C's slicing capabilities to generate the backwards slice of a particular statement in a given file, and from that particular slice, I would like to acquire the original SIDs of the statements belonging to it. The desired behaviour shouldn't be too dissimilar from the standard behaviour exhibited by the GUI in its highlighting the statements belonging to the slice, except I would like to write a plug-in which returns the SIDs of those statements to me, instead.

Does any know how I should go about interacting with the Slicing module within my script? The structure and documentation for Db.Slicing seems to be heavily geared towards the GUI.

Any help would be much appreciated! :-)

ChrisTimps
  • 101
  • 7
  • 2
    A starting point is that the sliced AST is computed by src/kernel_services/ast_transformations/filter.ml, and Filter.change_sid seems to have this information. But maybe it would be easier to work on the original AST, and the internal representation of a slice with Db.Slicing.Slice.get_mark_from_stmt for instance. – Anne Aug 05 '16 at 07:23
  • Okay, thanks. I've written a little visitor to extract the SIDs of the statements within a given slice, but now I just need to compute the slice itself. Any pointers on where I should look for this functionality in the API, @Anne? – ChrisTimps Aug 11 '16 at 10:27
  • Not sure to understand your question... but if you want to build a new AST, it seems to me that the `Filter` module mentioned above is the answer. – Anne Aug 11 '16 at 14:04

0 Answers0