Skip to content

hfscheid/DCC888

 
 

Repository files navigation

Introduction to Static Program Analyses

This repository holds some of the project assignments used in DCC888 - Introduction to Program Analysis, a course offered by the Department of Computer Science of the Federal University of Minas Gerais, as part of the courses of UFMG's Compilers Lab. For the course material, check its website. A full list of the topics covered is available in the syllabus.

Building and Running

This webpage contains a few labs: short project assignments. In practice, these assignments are automatically graded using UFMG's Moodle. However, the labs can be used independently. They are all implemented in Python. Each program contains lots of doctests. Thus, to test, say, your implementation of dataflow.py, just do:

python3 -m doctest dataflow.py

Additionally, most of the labs contain a folder called tests, with some text files that you can run using the main routine, in driver.py, e.g.:

python3 driver.py < tests/fib.txt

Table of Contents

The following labs are available:

Control-Flow Graphs

In this lab, the student will create simple control-flow graphs using a toy, assembly-like, programming language.

Parsing

In this lab, the student will create a small parser that will convert text files into control-flow graphs.

Data-Flow Analysis

In this lab, the student will implement liveness analysis and run this implementation onto our toy language.

Worklist Algorithms

In this lab, the student will implement a worklist-based solver for dataflow analyses.

Dominators

In this lab, the student will implement a data-flow analysis to compute the dominance tree of a program.

Semantics of Phi-Functions

In this lab, the student will add phi-functions to our toy three-address code language, so that we can write programs in Static Single-Assignment Form.

Constant Propagation

In this lab, the student will implement the sparse data-flow equations for constant propagation, which will be used reduce the number of instructions in a program.

Alias Analysis

In this lab, the student will implement a version of Andersen-style Alias Analysis, following the lecture notes seen in class.

Type Checking

In this lab, the student will implement Type-Checking to verify if programs are Safe, as seen in class

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%