1 A QF_ AUFBV encoding of SIMD transpose
2 An SMT encoding of SIMD transpose with additional holes
3 Extra credit
4 Submission instructions

CS294 HW 2

This assignment builds on the material in Lecture 3, which covers the translation of straight-line code into formulas. To learn how to translate programs with control flow, loops, pointers, etc., please read the following paper by next Thursday, September 6:

     

Daniel Kroening, Edmund Clarke and Karen Yorav. Behavioral Consistency of C and Verilog Programs Using Bounded Model Checking. DAC 2003.

     

HW 2 is due on Monday, September 10, 2012, at midnight.

1 A QF_AUFBV encoding of SIMD transpose

Encode xpose3.sk in Z3, using only the theories of arrays and bitvectors. There should be no values of sort Int in your encoding. You can create the encoding manually, but we suggest writing a script to generate it. Here is the Racket script we showed in Lecture 3 for generating the QF_AUFLIA encoding.

The encoding should produce values for the holes in xpose3.sk so that it correctly transposes the following input matrix:

 0  1  2  3

 4  5  6  7

 8  9 10 11

12 13 14 15

Z3 should be able to solve your QF_AUFBV encoding at least 2 times faster than the QF_AUFLIA encoding. On our machines, a bitvector encoding is about 6 times faster.

For this part of the assignment, please submit the following:

2 An SMT encoding of SIMD transpose with additional holes

Encode xpose2.sk in Z3, using any combination of theories you want. The encoding should work on the following input matrix:

 1  2  3  4

 5  6  7  8

 9 10 11 12

13 14 15 16

We’ll hold a contest for the fastest encoding.

For this part of the assignment, please submit the following:

3 Extra credit

Some fun things to try for extra credit:

4 Submission instructions

Create a username.zip archive of all the files specified in Part 1 and Part 2 of the assignment, where username is your Google Groups ID. Email the archive to <emina at eecs dot berkeley dot edu> and <bodik at cs dot berkeley dot edu> by 12:00 a.m. on September 10, 2012.