Assignment 2 - SVF-tools/Teaching-Software-Verification GitHub Wiki

Assignment-2 folder layout

$tree Assignment-2
├── Assignment-2.cpp
├── Assignment-2.h
├── CMakeLists.txt
├── Test2.cpp
└── testcase
    ├── bc
    │   ├── test1.ll
    │   ├── test2.ll
    │   └── test3.ll
    ├── dot
    │   ├── icfg_test1.dot
    │   ├── icfg_test2.dot
    │   └── icfg_test3.dot
    └── src
        ├── test1.c
        ├── test2.c
        └── test3.c
$tree python
├── Assignment-2
   |-- Assignment-2.py
   └── testcase
       ├── bc
       │   ├── test1.ll
       │   ├── test2.ll
       │   └── test3.ll
       ├── dot
       │   ├── icfg_test1.dot
       │   ├── icfg_test2.dot
       │   └── icfg_test3.dot
       └── src
           ├── test1.c
           ├── test2.c
           └── test3.c

For C++ users, make sure to switch your program to assign-2 before coding.

For Python users, you can [switch your program to python/Assignment-2/Assignment-2.py] before coding.

1. Assignment 2 task

  1. For C++ users, Implement dfs, printICFGPath methods of class ICFGTraversal in Assignment-2.cpp

For Python users, implement dfs and print_path methods in python/Assignment-2/Assignment-2.py

  1. For C++ users, pass the test without any assertion by Test2.cpp.

For Python users, pass the test without any assertion by Assignment-2.py.

  1. Submit Assignment-2.cpp or Assignment-2.py to canvas. Your implementation will be evaluated against our 10 internal tests. You will get full marks if your code can pass them all. Unfortunately, our internal tests are publicly unavailable. Here, we only provided limited test cases in Test2.cpp or Assignment-2.py. You are encouraged to add more test cases by yourself to validate the correctness of your implementation. Only one of Assignment-2.cpp or Assignment-2.py is required.

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

SVF APIs to help with your implementation SVF CPP API.

Python API: SVF Python API

2. Debug and visualize ICFG

Visualize ICFG by following here

We have also provided two test cases testcase/src/test1.c and testcase/src/test2.c and their corresponding LLVM bc files. You are encouraged to add more test cases by yourself to validate the correctness of your implementation.