



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Optional Partners. You may optionally work with exactly one partner of your choice. If you do work with exactly one partner, the two of you together must complete 150% as much as a single person. The assignment details explain how much is required for one person. If you work with a partner, do half again as much (which is defined formally below in the assignment description and often involves picking some other aspect). Choose one of the following:
The course staff cannot be responsible for partners that disappear or drop the course at the last minute. If your partner becomes unavailable, you can fall back on submitting the standard singleton 100% of the assignment.
Logistics. The previous homework assignment was largely theoretical. This homework assignment is largely practical. There is no peer review component for this homework as- signment. In class we have covered operational semantics (large- and small-step), axiomatic seman- tics (including verification condition generation) and some abstract interpretation. You are now qualified to pull ideas from many of those techniques together and create a non-trivial program analysis. This analysis will target off-the-shelf C programs. We will use the CIL library to parse and process C programs into an IMP-like OCaml representation. We will use the Z3 automated theorem prover of de Moura and Bjorner to reason about infeasible paths or otherwise decide questions of logic. Our analysis will automatically generate test inputs that will force the subject program to cover all of its branches. This is undecidable in general (by direct reduction with the halting problem). Automated test input (and test case) generation is a research problem that is receiving quite a bit of attention; see the papers on the course webpage for more
information. This problem is also known as program reachability, the same issue we discussed in the context of software model checking. I have provided an introductory analysis. It performs flow-sensitive, path-sensitive, context-insensitive, intraprocedural path enumeration, symbolic execution, and constraint generation to create test inputs. Unlike previous assignments, for this assignment you may change anything in the main file you like. Initial steps:
array-1.i.c : reached 0 / 4 array-2.i.c : reached 8 / 8 array-3.i.c : reached 0 / 10 array-4.i.c : reached 1 / 4 balanced.i.c : reached 4 / 8 bsearch-1.i.c : reached 4 / 8 bsearch-2.i.c : reached 6 / 8 bubblesort.i.c : reached 5 / 6 conway.i.c : reached 6 / 6 dotprod.i.c : reached 2 / 2 eq-index.i.c : reached 6 / 6 fibo.i.c : reached 6 / 6 float-1.i.c : reached 2 / 6 float-2.i.c : reached 7 / 8 float-3.i.c : reached 5 / 8 float-4.i.c : reached 4 / 14 float-5.i.c : reached 1 / 4 gcd.i.c : reached 4 / 4 hailstone.i.c : reached 5 / 6 leven.i.c : reached 7 / 10 many-features.i.c : reached 0 / 8 matmul.i.c : reached 3 / 6 matrix-path.i.c : reached 0 / 8 mymin-1.i.c : reached 7 / 8 roman.i.c : reached 21 / 28 selsort.i.c : reached 6 / 6
If you work with a partner, the two of you must do 150% of the code changing described above. This may involve fully completing one big task and also completing one small task. This may instead involve fully completing one big task and partially completing another big task.
Exercise 6C. Coding. Submit your modified tigen.ml file. In addition, submit two new subject programs in the style of the subject programs already included. Your homework should perform well on those new subject programs. If you work with a partner, the two of you must do 150% of the work described above for 6C.
Exercise 6F-1. Bookkeeping [4 points].
If you work with a partner, the two of should either answer separately or give a longer joint answer for 6F-1.
Exercise 6F-2. Report [22 points]. Provide a multi-paragraph report describing your changes (as above) as well as any other compelling figures or charts relevant to supporting your case. Recall that you should demonstrate that you did something useful with respect to this homework’s goals of using program analysis techniques either (1) in your research or (2) to understand programs or (3) to find bugs or (4) to verify properties of programs or (5) to make related tools more usable. If you work with a partner, the two should do 150% of the work described above (which necessitates a commensurately longer report, etc.).
Exercise 6F-3. Research Communication [4 points]. Compose a brief (one- or two- paragraph) email to one of the authors of the tools or papers you used in this homework and include the text of it in your submission. In addition, indicate whether you are willing to use your name or whether you would like to be portrayed as an anonymous student in my class. I will check off the fact that you wrote something and potentially forward it along. You can comment on any aspect of your experience with their work — your comments need not be positive. For example, you might ask Bjorner why Z3 doesn’t handle multiplication, complain to Kodumal or Das that OLF isn’t precise enough for C programs, or tell Necula or McPeak that you find CIL’s memory lvalue semantics unintuitive. You might even write to Lakhotia and ask him how he managed to scale to large programs given all the difficulties you observed when wrestling with C. If you do offer criticism, strive to make it constructive by commenting on what you would have liked to have seen instead or how you might like to see things improved if the time were available. If you absolutely cannot think of anything to say, thank them for making their tools available and let them know that you used them with success. Even minor comments about documentation or a fresh-eyed perspective on usability can be helpful.