Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7671285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:00:55+00:00 2026-05-31T16:00:55+00:00

I want to generate a Program Dependence Graph (PDG) from C source code. I

  • 0

I want to generate a Program Dependence Graph (PDG) from C source code. I found papers that explain how do it, but all used the commercial CodeSurfer tool.

Are there any free tools or open source projects that can do this job?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:00:56+00:00Added an answer on May 31, 2026 at 4:00 pm

    Frama-C is an Open Source static analysis platform with a slicer for C programs based on the computation of a Program Dependence Graph.

    Note that slicing actual programs written in a real programming language such as C involves many special cases and concepts that are skimmed over in scientific publications. Still, I am confident that you won’t find anything simpler than Frama-C’s PDG computation, first because it is the only Open Source one available (that I know of), and second because any other PDG computation that handled C programs would have to solve the same problems and introduce the same concepts.

    Here is one example:

    int a, b, d, *p;
    
    int f (int x) {
      return a + x;
    }
    
    int main (int c, char **v) {
      p = &b;
      a = 1;
      *p = 2;
      d = 3;
      c = f(b);
    }
    

    The command frama-c -pdg -pdg-dot graph -pdg-print t.c generates dot files graph.main.dot and graph.f.dot containing the PDG of main() and f() respectively.

    You can use the dot program to pretty-print one of them thus: dot -Tpdf graph.main.dot > graph.pdf

    The result is below:

    PDG of main()

    Note the edge from the node c = f(b); to the node *p = 2;. A PDG computation claiming to be useful for C programs must handle aliasing.

    On the other hand, a slicer using this PDG to slice on the criterion “inputs of statement c = f(b);” would be able to remove d = 3;, which cannot influence the function call, even through the pointer access *p.
    Frama-C’s slicer uses the dependencies indicated by the PDG to keep only the statements that are useful for the user-specified slicing criterion. For instance, the command frama-c -slice-wr c t.c -then-on 'Slicing export' -print produces the reduced program below, where the assignment to d has been removed:

    /* Generated by Frama-C */
    int a;
    int b;
    int *p;
    int f_slice_1(int x)
    {
      int __retres;
      __retres = a + x;
      return (__retres);
    }
    
    void main(int c)
    {
      p = & b;
      a = 1;
      *p = 2;
      c = f_slice_1(b);
      return;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to generate a choicelist for all specs that inherit from imagekit.specs.ImageSpec .
I want to generate a summary of the files that are in one tree
I want to generate random numbers from -n to n excluding 0. Can someone
I want to generate this SQL statement in LINQ: select * from Foo where
I have a java program and want to generate javadoc for classes/interfaces. However, I
I want to generate all variations with repetitions of a string in C++ and
I want to generate Full and Partially Call Trees from cscope database of c
I'm currently developing a program that will generate reports based upon lead data. My
Using java I want to generate some random values in one program and then
I'm working on a third-party program that aggregates data from a bunch of different,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.