| 1 | CIVL: The Concurrency Intermediate Verification Language
|
|---|
| 2 | v 0.12
|
|---|
| 3 |
|
|---|
| 4 | ------------------------------ Overview -------------------------------
|
|---|
| 5 |
|
|---|
| 6 | CIVL is a framework encompassing...
|
|---|
| 7 |
|
|---|
| 8 | * a programming language, CIVL-C, which adds to C a number of
|
|---|
| 9 | concurrency primitives, as well as the ability to define
|
|---|
| 10 | functions in any scope. Together, these features make for
|
|---|
| 11 | a very expressive concurrent language that can faithfully
|
|---|
| 12 | represent programs using various APIs and parallel languages,
|
|---|
| 13 | such as MPI, OpenMP, CUDA, and Chapel. CIVL-C also provides
|
|---|
| 14 | a number of primitives supporting verification.
|
|---|
| 15 | * a model checker which uses symbolic execution to verify a
|
|---|
| 16 | number of safety properties of CIVL-C programs. The model
|
|---|
| 17 | checker can also be used to verify that two CIVL-C programs
|
|---|
| 18 | are functionally equivalent.
|
|---|
| 19 | * a number of translators from various commonly-used languages
|
|---|
| 20 | and APIs to CIVL-C. (This part is still a work in progress.)
|
|---|
| 21 |
|
|---|
| 22 | CIVL is developed by the Verified Software Laboratory at the
|
|---|
| 23 | University of Delaware Department of Computer Science.
|
|---|
| 24 | For more information, visit http://vsl.cis.udel.edu/civl
|
|---|
| 25 |
|
|---|
| 26 | Developers:
|
|---|
| 27 |
|
|---|
| 28 | Stephen F. Siegel
|
|---|
| 29 | Timothy K. Zirkel
|
|---|
| 30 | Manchun Zheng
|
|---|
| 31 | Ziqing Luo
|
|---|
| 32 |
|
|---|
| 33 | ------------------------------- License -------------------------------
|
|---|
| 34 |
|
|---|
| 35 | CIVL is open source software distributed under the GNU
|
|---|
| 36 | General Public License. However, the libraries used by CIVL
|
|---|
| 37 | (and incorporated into the complete distribution) use various
|
|---|
| 38 | licenses. See directory licenses for the license of each component.
|
|---|
| 39 |
|
|---|
| 40 | -------------------------- Updates from v 0.11 -------------------------
|
|---|
| 41 |
|
|---|
| 42 | 1. Bugs fixed:
|
|---|
| 43 | better handling for the return value of the main function;
|
|---|
| 44 | error handling for $malloc statements that are casted to void*;
|
|---|
| 45 | correct translation of pointer subtraction;
|
|---|
| 46 | better handling for implicit array-to-pointer conversion;
|
|---|
| 47 | various bugs of the side-effect remover;
|
|---|
| 48 | supporting boolean/int conversion and comparison;
|
|---|
| 49 | supporting the implicit initialization of static variables;
|
|---|
| 50 | improvement of the clarity of error messages for various circumstances;
|
|---|
| 51 | improvement of the format analysis of printf/fprintf;
|
|---|
| 52 | improvement of the $bundle_pack function to allow non-concrete indexes;
|
|---|
| 53 | etc.
|
|---|
| 54 |
|
|---|
| 55 | 2. New types and language constructs: $range, $domain, $for, $parfor, etc.
|
|---|
| 56 | Refer to CIVL manual for details: Section 6.1.4 for $range and $domain,
|
|---|
| 57 | Section 6.3.3 for $for, and Section 7.3 for $parfor.
|
|---|
| 58 |
|
|---|
| 59 | 3. Enhancement:
|
|---|
| 60 | supports $gcomm/$gbarrier objects with a non-concrete number of processes;
|
|---|
| 61 | improves pointer addition to support multi-dimension arrays;
|
|---|
| 62 | considers special situations for $free/free and reports error when there is
|
|---|
| 63 | undefined behavior;
|
|---|
| 64 |
|
|---|
| 65 | 4. New system functions:
|
|---|
| 66 | _Bool $equals(void *x, void *y);
|
|---|
| 67 | _Bool $contains(void *ptr1, void *ptr2);
|
|---|
| 68 | void $array_init(void *array, int length, void *elementValue);
|
|---|
| 69 | Refer to Section 6.4.2 of CIVL manual for details.
|
|---|
| 70 |
|
|---|
| 71 | 5. New features:
|
|---|
| 72 | GUI mode for replay a trace. Just type "civl replay *.cvl -gui" and hit enter.
|
|---|
| 73 |
|
|---|
| 74 | ------------------------- Binary Installation -------------------------
|
|---|
| 75 |
|
|---|
| 76 | For most users, this will be the easiest way to install and use CIVL.
|
|---|
| 77 |
|
|---|
| 78 | 1. Install a Java 7 SDK if you have not already. Go to
|
|---|
| 79 | http://www.oracle.com/technetwork/java/javase/downloads/ for the
|
|---|
| 80 | latest from Oracle. On linux, you can optionally sudo apt-get install
|
|---|
| 81 | openjdk-7-jdk.
|
|---|
| 82 |
|
|---|
| 83 | 2. If you already have the VSL dependencies library, you may
|
|---|
| 84 | skip this step. Otherwise, download the archive of VSL
|
|---|
| 85 | dependencies from http://vsl.cis.udel.edu/tools/vsl_depend,
|
|---|
| 86 | choosing the version for your OS type (32-bit linux,
|
|---|
| 87 | 64-bit linux, or 64-bit OS X). Unzip and untar the
|
|---|
| 88 | downloaded .tgz file and you will have a folder named "vsl".
|
|---|
| 89 | If you do not already have a directory /opt, create one with
|
|---|
| 90 | "mkdir /opt". Move vsl into /opt. Use sudo as needed.
|
|---|
| 91 |
|
|---|
| 92 | 3. Download the CIVL distribution from http://vsl.cis.udel.edu/civl.
|
|---|
| 93 |
|
|---|
| 94 | 4. Unzip and untar the downloaded file if this does not happen
|
|---|
| 95 | automatically. This should result in a folder named
|
|---|
| 96 | CIVL-TAG, where TAG is some version id string. This folder
|
|---|
| 97 | contains the following:
|
|---|
| 98 |
|
|---|
| 99 | - README : this file
|
|---|
| 100 | - bin : containing one executable sh script called "civl"
|
|---|
| 101 | - lib : containing civl-TAG.jar
|
|---|
| 102 | - doc : containing the manual and the tutorial of CIVL
|
|---|
| 103 | - emacs : CIVL-C emacs mode and its installation guideline
|
|---|
| 104 | - licenses : licenses for CIVL and included libraries
|
|---|
| 105 | - examples : some example CIVL programs
|
|---|
| 106 |
|
|---|
| 107 | 5. Move CIVL-TAG into /opt.
|
|---|
| 108 |
|
|---|
| 109 | 6. Put the civl script in your path however you like to put things
|
|---|
| 110 | in your path. Either move it to a directory in your path,
|
|---|
| 111 | or create a symlink to it, or edit your .profile or equivalent
|
|---|
| 112 | to put it in your path.
|
|---|
| 113 |
|
|---|
| 114 | ------------------------- Source Installation -------------------------
|
|---|
| 115 |
|
|---|
| 116 | We recommend using the Eclipse IDE for Java/EE developers.
|
|---|
| 117 |
|
|---|
| 118 | 1. Install an SVN plugin in Eclipse (such as Subversive) if you have
|
|---|
| 119 | not already.
|
|---|
| 120 |
|
|---|
| 121 | 2. Install prerequisite projects ABC, SARL and GMC.
|
|---|
| 122 | Make sure that the three projects are put in the workspace
|
|---|
| 123 | directory where CIVL will be put.
|
|---|
| 124 |
|
|---|
| 125 | a. Install the symbolic algebra and reasoning library SARL.
|
|---|
| 126 | In Eclipse, select New Project...from SVN, use the archive
|
|---|
| 127 | svn://vsl.cis.udel.edu/sarl. After entering that, open it
|
|---|
| 128 | up and select the "trunk". After checking out trunk, name
|
|---|
| 129 | the project "SARL". Then follow the instructions in the INSTALL
|
|---|
| 130 | file for Eclipse installation. Build the sarl.jar from within
|
|---|
| 131 | Eclipse by right-clicking (or ctrl-clicking) on the build.xml
|
|---|
| 132 | file and selecting Run As->Ant Build.
|
|---|
| 133 |
|
|---|
| 134 | b. Install the C front-end ABC. In Eclipse,
|
|---|
| 135 | select New Project...from SVN, use the archive
|
|---|
| 136 | svn://vsl.cis.udel.edu/abc. After entering that, open it
|
|---|
| 137 | up and select the "trunk". After checking out trunk, name
|
|---|
| 138 | the project "ABC". Then follow the instructions in the INSTALL
|
|---|
| 139 | file for Eclipse installation. Build the abc.jar from within
|
|---|
| 140 | Eclipse by right-clicking (or ctrl-clicking on OS X) on the
|
|---|
| 141 | build.xml file and selecting Run As->Ant Build.
|
|---|
| 142 |
|
|---|
| 143 | c. Install the generic model checking utilities package GMC.
|
|---|
| 144 | In Eclipse, select New Project...from SVN, use the archive
|
|---|
| 145 | svn://vsl.cis.udel.edu/gmc. After entering that, open it
|
|---|
| 146 | up and select the "trunk". After checking out trunk, name
|
|---|
| 147 | the project "GMC". Build the gmc.jar from within Eclipse
|
|---|
| 148 | by right-clicking (or ctrl-clicking) on the build.xml file and
|
|---|
| 149 | selecting Run As->Ant Build.
|
|---|
| 150 |
|
|---|
| 151 | 3. From within Eclipse, select New Project...from SVN. The archive is
|
|---|
| 152 | svn://vsl.cis.udel.edu/civl. After entering that, open it up and
|
|---|
| 153 | select the "trunk". (It is simplest to just check out the trunk for
|
|---|
| 154 | the Eclipse project.)
|
|---|
| 155 |
|
|---|
| 156 | 4. Check out the trunk, and create the project using the New Java
|
|---|
| 157 | Project Wizard as usual, naming it "CIVL". The .project, .classpath,
|
|---|
| 158 | and other Eclipse meta-data are already in the SVN archive, saving you
|
|---|
| 159 | a bunch of work.
|
|---|
| 160 |
|
|---|
| 161 | 5. If you already have the VSL dependencies library, you may
|
|---|
| 162 | skip this step. Download the tgz archive of VSL dependencies from
|
|---|
| 163 | http://vsl.cis.udel.edu/tools/vsl_depend, choosing the right .tgz
|
|---|
| 164 | according to your platform:
|
|---|
| 165 |
|
|---|
| 166 | vsl_linux32-1.0.tgz - 32-bit linux
|
|---|
| 167 | vsl_linux64-1.0.tgz - 64-bit linux
|
|---|
| 168 | vsl_osx64-1.0.tgz - 64-bit osx
|
|---|
| 169 |
|
|---|
| 170 | Unzip the .tgz file and you will have the folder vsl.
|
|---|
| 171 | Move vsl to /opt (you might need to use sudo for this.
|
|---|
| 172 | Also, if you don't already have a directory called /opt,
|
|---|
| 173 | you will have to create it with mkdir /opt).
|
|---|
| 174 |
|
|---|
| 175 | Suppose that you put the .tgz file (or .tar file if your browser
|
|---|
| 176 | unzipped it automatically to a .tar file) in the directory $Download.
|
|---|
| 177 | You can use the following commands:
|
|---|
| 178 |
|
|---|
| 179 | $ cd $Download
|
|---|
| 180 | $ tar xzf YourTgzOrTarFile vsl
|
|---|
| 181 | $ sudo mv vsl /opt
|
|---|
| 182 |
|
|---|
| 183 | Now you can type "ls /opt/vsl", and the output should be
|
|---|
| 184 |
|
|---|
| 185 | README.txt lib licenses src
|
|---|
| 186 |
|
|---|
| 187 | 6. If default_build.properties matches the configuration of your system,
|
|---|
| 188 | then you can skip this step. Otherwise, you may need to create a file
|
|---|
| 189 | build.properties in the directory where build.xml is in.
|
|---|
| 190 | Copy and paste the content from any file under properties, edit each
|
|---|
| 191 | entry with the path configured in your system. The newly created file
|
|---|
| 192 | build.properties will automatically be used by ant to to build the .jar file.
|
|---|
| 193 |
|
|---|
| 194 | 7. Navigate to Preferences -> Java -> Build Path -> ClassPath
|
|---|
| 195 | Variables, and then select New to create a classpath variable VSL,
|
|---|
| 196 | and specify its value to be /opt/vsl. Navigate to Preferences -> Run/Debug
|
|---|
| 197 | -> String Substitution -> New, and then define an entry vsl_lib and
|
|---|
| 198 | set its value to be /opt/vsl/lib.
|
|---|
| 199 |
|
|---|
| 200 | 8. Do a clean build. Everything should compile. Generate the civl.jar
|
|---|
| 201 | by right-clicking (or ctrl-click on OS X) the build.xml file and
|
|---|
| 202 | Run As->Ant Build.
|
|---|
| 203 |
|
|---|
| 204 | 9. Go to Run->Run Configurations... Create a new JUnit configuration.
|
|---|
| 205 | Name it CIVL Tests. Select "Run all tests in the selected project..."
|
|---|
| 206 | and navigate to the folder "test" in the CIVL project.
|
|---|
| 207 | The Test runner should be JUnit 4. Under the Arguments tab, type
|
|---|
| 208 | "-ea" (without the quotes) in the VM arguments area (to enable assertion
|
|---|
| 209 | checking). Under the Environment tab, create an entry
|
|---|
| 210 | DYLD_LIBRARY_PATH (OS X) or LD_LIBRARY_PATH (linux),
|
|---|
| 211 | specify its value by clicking Variables and choose vsl_lib from the list,
|
|---|
| 212 | or you may type ${vsl_lib} in the value entry.
|
|---|
| 213 |
|
|---|
| 214 | 10. An example of how to set up a single test from within Eclipse:
|
|---|
| 215 | create a new Run Configuration via the Run->Run
|
|---|
| 216 | Configurations... menu. Create a new "Java Application"
|
|---|
| 217 | configuration. Call it "CIVL barrier2". The Project is CIVL. The
|
|---|
| 218 | main class is edu.udel.cis.vsl.civl.CIVL. Under the Arguments tab,
|
|---|
| 219 | set the Program arguments to "examples/barrier2.cvl" (without the
|
|---|
| 220 | quotes). Modify the VM arguments and the Environment as in the step
|
|---|
| 221 | above. You should now be able to run the test by clicking "Run".
|
|---|