0

I am looking for a forward slicing tool for the C language. When I searched in Google, I didn't find any result.

I would have liked to access the Wisconsin Program-Slicing Tool Version 1.1, but this tool wasn't distributed. Could any other tool provide the functionality of forward slicing C programs?

Pascal Cuoq
  • 79,187
  • 7
  • 161
  • 281
  • 2
    For the record, I do not think that it is fair to close this question as “not a real question”. It concerns forward slicing, a real if obscure program transformation technique, and it is answerable. – Pascal Cuoq Nov 16 '12 at 12:33

1 Answers1

4

The open-source static analysis platform Frama-C has a slicing plug-in with impact analysis functionality.

The OP suggests an example where the impact of the initialization sum = 0; is being computed. The example is like this:

void main() {
    int i = 1;     int sum = 0;
    while (i<11) {
        sum = add(sum, i);
        i = add(i, 1);
    }
    printf("sum = %d\n", sum);
    printf("i = %d\n", i);
}

static int add(int a, int b)
{
    return(a+b);
}

The command-line to use is:

frama-c-gui -val t.c

screenshot of impact analysis

The check-mark in the left-hand side column tells the user that there are selected statements in function add, too. In the bottom right corner, the analyzer points out a few minor issues with this example from an academic article.

Pascal Cuoq
  • 79,187
  • 7
  • 161
  • 281
  • Thank you for your answer, actually I try the Frama-C, but I didn't find this function.The main function I need is: Impact Analysis. See what statements depend on a selected statement. The Frama-C's slicing plug-in can meet my demand? – zhaizhiqiang Nov 16 '12 at 09:28
  • 1
    @zhaizhiqiang Like this? http://frama-c.com/impact.html – Pascal Cuoq Nov 16 '12 at 09:42
  • An hour ago,I found this website.But,in my computer, I install the frama-c, but there wasn't this plug-in, and I can't find the download entry.My operating system is ubuntu, and I install the frama-c with the sudo apt-get install frama-c. Can the plug-in work like this? Figure 2. Forward slice from sum = 0; http://www.grammatech.com/research/papers/slicing/slicingWhitepaper.html – zhaizhiqiang Nov 16 '12 at 09:51
  • Can I use this plug-in freely in acdemic research, and where can I get the plug-in? – zhaizhiqiang Nov 16 '12 at 10:56
  • @zhaizhiqiang The plug-in **is** part of Frama-C. The license file is in the archive at http://frama-c.com/download.html If you mention it in a publication, please cite the article “Frama-C, A Software Analysis Perspective”, not the website. – Pascal Cuoq Nov 16 '12 at 12:00