Skip to content

Assignment 3

Xiao edited this page Sep 25, 2024 · 30 revisions

Assignment-3 folder layout

$tree Assignment-3
|-- Assignment-3.cpp
|-- Assignment-3.h
|-- CMakeLists.txt
|-- Test3.cpp
`-- testcase
    |-- bc
    |   |-- CI-global.ll
    |   `-- CI-local.ll
    `-- src
        |-- CI-global.c
        `-- CI-local.c

1. Get the latest assignment-3 code template

Make sure to switch your program to assign-3 before coding.

2. Assignment 3 task

  1. Implement the solveWorklist method of class AndersenPTA in Assignment-3.cpp
  2. Pass the test without any assertion by Test3.cpp
  3. Submit Assignment-3.cpp to canvas. Your implementation will be evaluated against our 10 internal tests. You will get the full marks if your code can pass them all. Unfortunately, our internal tests are publicly available. Here, we only provided limited test cases in Test3.cpp. You are encouraged to add more test cases by yourself to validate the correctness of your implementation.

*You will be working on Assignment-3.cpp only and there is NO need to modify other files under the Assignment-3 folder

3. Debugging and test cases.

Please follow SVF APIs including worklist operations, points-to sets operations (e.g., union/add operations), retrieving the attributes of ConstraintGraph, ConstraintNode and ConstraintEdge in your Andersen's analysis implementation.

We provide three test cases with their corresponding LLVM bc files.

You are encouraged to write more test cases by writing your own C programs. Similar to our test cases, a C program you write will need to use MAYALIAS or NOALIAS methods to indicate the ground truth or oracle of a correct analysis (see here). Once after executing Andersen's analysis, SVF will automatically check the points-to results from Andersen against the ground truth you provided (via MAYALIAS or NOALIAS).