| 1 | CIVL: The Concurrency Intermediate Verification Language
|
|---|
| 2 | v1.17.1
|
|---|
| 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, Pthread, CUDA, and Chapel. CIVL-C also
|
|---|
| 14 | provides 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 | Active Developers:
|
|---|
| 27 | Matthew B. Dwyer
|
|---|
| 28 | Mitchell Gerrard
|
|---|
| 29 | Ziqing Luo
|
|---|
| 30 | Stephen F. Siegel
|
|---|
| 31 | Wenhao Wu
|
|---|
| 32 | Yihao Yan
|
|---|
| 33 |
|
|---|
| 34 | Inactive Developers:
|
|---|
| 35 | John Edenhofner
|
|---|
| 36 | Andre Marianiello
|
|---|
| 37 | Michael Rogers
|
|---|
| 38 | Timothy K. Zirkel
|
|---|
| 39 | Si Li
|
|---|
| 40 | Manchun Zheng
|
|---|
| 41 |
|
|---|
| 42 | ------------------------------- License -------------------------------
|
|---|
| 43 |
|
|---|
| 44 | CIVL is open source software distributed under the GNU
|
|---|
| 45 | General Public License. However, the libraries used by CIVL
|
|---|
| 46 | (and incorporated into the complete distribution) use various
|
|---|
| 47 | licenses. See directory licenses for the license of each component.
|
|---|
| 48 |
|
|---|
| 49 | -------------------------- Updates from v1.17 -------------------------
|
|---|
| 50 | -- fixed some bugs appear during the preparation of VerifyThis 2017 solutions
|
|---|
| 51 | including a fix for the z3 compressed translation bug.
|
|---|
| 52 |
|
|---|
| 53 | -------------------------- Updates from v1.16.1 -------------------------
|
|---|
| 54 | -- CIVL functionalities
|
|---|
| 55 | - support more omp reduction operators besides sum
|
|---|
| 56 | - Svcomp unpreprocess transformer is deleted since it won't be used anymore
|
|---|
| 57 | -- CIVL output
|
|---|
| 58 | - put Why3 script files into CIVLREP when running CIVL
|
|---|
| 59 | - improve the assumptions over datatype sizes
|
|---|
| 60 | - improve the indent of the printed source code and highlight on generated code
|
|---|
| 61 | -- Stability
|
|---|
| 62 | - simplifier improved to verify some loop invariant test cases
|
|---|
| 63 | - fix a bug in Z3 translator when translating TUPLE_READ
|
|---|
| 64 | -- Misc.
|
|---|
| 65 | - clean up some redundant code in class FrontEnd
|
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 | ------------------------- Binary Installation -------------------------
|
|---|
| 69 |
|
|---|
| 70 | For most users, this will be the easiest way to install and
|
|---|
| 71 | use CIVL. Developers should instead follow the instructions for
|
|---|
| 72 | "Source Installation" below.
|
|---|
| 73 |
|
|---|
| 74 | 1. Install at least one of the theorem provers below.
|
|---|
| 75 | The more provers you install, the more precise CIVL analysis will
|
|---|
| 76 | be. Note that CIVL only requires the binary executable
|
|---|
| 77 | version of each prover; you can ignore the libraries, various
|
|---|
| 78 | API bindings, etc. You just need to ensure that
|
|---|
| 79 | each binary executable is in your PATH when you run
|
|---|
| 80 | "civl config". The currently supported provers are:
|
|---|
| 81 |
|
|---|
| 82 | - CVC3, http://www.cs.nyu.edu/acsys/cvc3/download.html
|
|---|
| 83 | download the latest, optimized build with static library
|
|---|
| 84 | and executable for your OS. Place the executable file
|
|---|
| 85 | "cvc3" in your PATH. You can discard everything else.
|
|---|
| 86 | Alternatively, on some linux systems, CVC3 can be installed
|
|---|
| 87 | using the package manager via "sudo apt-get install cvc3".
|
|---|
| 88 | This will place cvc3 in /usr/bin.
|
|---|
| 89 |
|
|---|
| 90 | - CVC4, http://cvc4.cs.nyu.edu/downloads/
|
|---|
| 91 |
|
|---|
| 92 | - Z3, http://z3.codeplex.com/SourceControl/latest
|
|---|
| 93 |
|
|---|
| 94 | 2. Install a Java 8 SDK if you have not already. Go to
|
|---|
| 95 |
|
|---|
| 96 | http://www.oracle.com/technetwork/java/javase/downloads/
|
|---|
| 97 |
|
|---|
| 98 | for the latest from Oracle. On linux, you can instead use
|
|---|
| 99 | the package manager:
|
|---|
| 100 |
|
|---|
| 101 | sudo apt-get install openjdk-8-jdk
|
|---|
| 102 |
|
|---|
| 103 | 3. Download the CIVL distribution from http://vsl.cis.udel.edu/civl.
|
|---|
| 104 |
|
|---|
| 105 | 4. Unzip and untar the CIVL distribution file if this
|
|---|
| 106 | does not happen automatically. This should result in a
|
|---|
| 107 | folder named CIVL-TAG, where TAG is some version ID string.
|
|---|
| 108 | This folder contains the following:
|
|---|
| 109 |
|
|---|
| 110 | - README : this file
|
|---|
| 111 | - bin : containing one executable sh script called "civl"
|
|---|
| 112 | - lib : containing civl-TAG.jar
|
|---|
| 113 | - doc : containing the manual and the tutorial of CIVL
|
|---|
| 114 | - emacs : CIVL-C emacs mode and its installation instructions
|
|---|
| 115 | - licenses : licenses for CIVL and included libraries
|
|---|
| 116 | - examples : some example CIVL programs
|
|---|
| 117 |
|
|---|
| 118 | 5. You can move the CIVL folder wherever you want.
|
|---|
| 119 | The JAR file in the lib directory is all you need to run CIVL.
|
|---|
| 120 | You may also move this jar file wherever you want. You
|
|---|
| 121 | run CIVL by typing a command that begins
|
|---|
| 122 | "java -jar /path/to/civl-TAG.jar ...". For convenience
|
|---|
| 123 | you may instead use the shell script "civl" in bin,
|
|---|
| 124 | which allows you to replace "java -jar /path/to/civl-TAG.jar"
|
|---|
| 125 | with just "civl" on the command line. Simply edit the civl script
|
|---|
| 126 | to reflect the path to civl-TAG.jar and place the script
|
|---|
| 127 | somewhere in your PATH. Alternatively, you can just define
|
|---|
| 128 | an alias in your .profile, .bash_profile, or equivalent, such as
|
|---|
| 129 |
|
|---|
| 130 | alias civl='java -jar /path/to/civl-TAG.jar'
|
|---|
| 131 |
|
|---|
| 132 | In the following, we will assume that you have defined
|
|---|
| 133 | a command "civl" in one these ways.
|
|---|
| 134 |
|
|---|
| 135 | 6. Type "civl config". This should report that it found
|
|---|
| 136 | the theorem provers you installed (and are in your PATH).
|
|---|
| 137 | It should create a file called ".sarl" in your home directory
|
|---|
| 138 | which you can also edit by hand.
|
|---|
| 139 |
|
|---|
| 140 |
|
|---|
| 141 | ------------------------- Source Installation -------------------------
|
|---|
| 142 |
|
|---|
| 143 | We recommend using the Eclipse IDE for Java/EE developers.
|
|---|
| 144 |
|
|---|
| 145 | 0. Install theorem provers following the directions above.
|
|---|
| 146 | Install Eclipse IDE for Java/EE developers if you have not already
|
|---|
| 147 | done so.
|
|---|
| 148 |
|
|---|
| 149 | 1. Install an SVN plugin in Eclipse (such as Subversive) if you have
|
|---|
| 150 | not already.
|
|---|
| 151 |
|
|---|
| 152 | 2. Install prerequisite projects ABC, SARL and GMC.
|
|---|
| 153 | Make sure that the three projects are put in the workspace
|
|---|
| 154 | directory where CIVL will be created. Specifically:
|
|---|
| 155 |
|
|---|
| 156 | a. Install the symbolic algebra and reasoning library SARL.
|
|---|
| 157 | In Eclipse, select New Project...from SVN, use the archive
|
|---|
| 158 | svn://vsl.cis.udel.edu/sarl. After entering that, open it
|
|---|
| 159 | up and select the "trunk". After checking out trunk, name
|
|---|
| 160 | the project "SARL". Then follow the instructions in the INSTALL
|
|---|
| 161 | file for Eclipse installation. Build the sarl.jar from within
|
|---|
| 162 | Eclipse by right-clicking (or ctrl-clicking) on the build.xml
|
|---|
| 163 | file and selecting Run As->Ant Build.
|
|---|
| 164 |
|
|---|
| 165 | b. Install the C front-end ABC. In Eclipse,
|
|---|
| 166 | select New Project...from SVN, use the archive
|
|---|
| 167 | svn://vsl.cis.udel.edu/abc. After entering that, open it
|
|---|
| 168 | up and select the "trunk". After checking out trunk, name
|
|---|
| 169 | the project "ABC". Then follow the instructions in the INSTALL
|
|---|
| 170 | file for Eclipse installation. Build the abc.jar from within
|
|---|
| 171 | Eclipse by right-clicking (or ctrl-clicking on OS X) on the
|
|---|
| 172 | build.xml file and selecting Run As->Ant Build.
|
|---|
| 173 |
|
|---|
| 174 | c. Install the generic model checking utilities package GMC.
|
|---|
| 175 | In Eclipse, select New Project...from SVN, use the archive
|
|---|
| 176 | svn://vsl.cis.udel.edu/gmc. After entering that, open it
|
|---|
| 177 | up and select the "trunk". After checking out trunk, name
|
|---|
| 178 | the project "GMC". Build the gmc.jar from within Eclipse
|
|---|
| 179 | by right-clicking (or ctrl-clicking) on the build.xml file and
|
|---|
| 180 | selecting Run As->Ant Build.
|
|---|
| 181 |
|
|---|
| 182 | 3. From within Eclipse, select New Project...from SVN. The archive is
|
|---|
| 183 | svn://vsl.cis.udel.edu/civl. After entering that, open it up and
|
|---|
| 184 | select the "trunk". (It is simplest to just check out the trunk for
|
|---|
| 185 | the Eclipse project.)
|
|---|
| 186 |
|
|---|
| 187 | 4. Check out the trunk, and create the project using the New Java
|
|---|
| 188 | Project Wizard as usual, naming it "CIVL". The .project, .classpath,
|
|---|
| 189 | and other Eclipse meta-data are already in the SVN archive,
|
|---|
| 190 | saving you a bunch of work.
|
|---|
| 191 |
|
|---|
| 192 | 5. If you already have the VSL dependencies library, you may
|
|---|
| 193 | skip this step. Otherwise, download the tgz archive of VSL
|
|---|
| 194 | dependencies from http://vsl.cis.udel.edu/lib/tools/vsl_depend
|
|---|
| 195 | Unzip the .tgz file and you will have the folder vsl.
|
|---|
| 196 | Move vsl to /opt.
|
|---|
| 197 | Note: you probably will need to use sudo for this.
|
|---|
| 198 | Also, if you don't already have a directory called /opt,
|
|---|
| 199 | you will have to create it with "mkdir /opt". Also, if you
|
|---|
| 200 | don't want to use /opt for some reason, you can use any
|
|---|
| 201 | directory you want; just modify the instructions below
|
|---|
| 202 | accordingly.
|
|---|
| 203 |
|
|---|
| 204 | Suppose that you put the .tgz file (or .tar file if your browser
|
|---|
| 205 | unzipped it automatically to a .tar file) in the directory DOWNLOAD.
|
|---|
| 206 | You can use the following commands:
|
|---|
| 207 |
|
|---|
| 208 | $ cd DOWNLOAD
|
|---|
| 209 | $ tar xzf YourTgzOrTarFile vsl
|
|---|
| 210 | $ sudo mv vsl /opt
|
|---|
| 211 |
|
|---|
| 212 | (Leave out the "x" in the tar command if the file was already
|
|---|
| 213 | unzipped.) Now you can type "ls /opt/vsl", and the output
|
|---|
| 214 | should be
|
|---|
| 215 |
|
|---|
| 216 | README.txt lib licenses src
|
|---|
| 217 |
|
|---|
| 218 | 6. If default_build.properties matches the configuration of your system,
|
|---|
| 219 | then you can skip this step. Otherwise, you may need to create a file
|
|---|
| 220 | build.properties in the directory containing build.xml.
|
|---|
| 221 | Copy and paste the content from any file under properties, edit each
|
|---|
| 222 | entry with the path configured in your system. The newly created file
|
|---|
| 223 | build.properties will automatically be used by ant to to build the
|
|---|
| 224 | .jar file.
|
|---|
| 225 |
|
|---|
| 226 | 7. Navigate to Preferences -> Java -> Build Path -> ClassPath
|
|---|
| 227 | Variables, and then select New to create a classpath variable VSL,
|
|---|
| 228 | and specify its value to be /opt/vsl.
|
|---|
| 229 |
|
|---|
| 230 | 8. Do a clean build. Everything should compile. Generate the civl.jar
|
|---|
| 231 | by right-clicking (or ctrl-click on OS X) the build.xml file and
|
|---|
| 232 | Run As->Ant Build.
|
|---|
| 233 |
|
|---|
| 234 | 9. Shortcuts for running CIVL
|
|---|
| 235 |
|
|---|
| 236 | Somewhere on your system, create a plain text file containing
|
|---|
| 237 | exactly the following two lines:
|
|---|
| 238 |
|
|---|
| 239 | #!/bin/sh
|
|---|
| 240 | java -jar /Path/To/Your/workspace/CIVL/civl.jar $@
|
|---|
| 241 |
|
|---|
| 242 | where "/Path/To/Your/workspace" is replaced with the path
|
|---|
| 243 | to your Eclipse workspace directory. Name this file "civl",
|
|---|
| 244 | put it in your PATH, and make it executable (chmod ugo+x civl).
|
|---|
| 245 |
|
|---|
| 246 | 10. From a terminal window, execute "civl config". This should
|
|---|
| 247 | find the theorem provers in your PATH and create a file
|
|---|
| 248 | .sarl in your home directory.
|
|---|
| 249 |
|
|---|
| 250 | 11. In Eclipse, navigate to "Run->Run Configurations... Create a new
|
|---|
| 251 | JUnit configuration."
|
|---|
| 252 | Name it "CIVL Regression Tests". Select "Run all tests in the
|
|---|
| 253 | selected project..." and navigate to the folder "test/regress"
|
|---|
| 254 | in the CIVL project. The Test runner should be JUnit 4. Under the
|
|---|
| 255 | Arguments tab, type "-ea" (without the quotes) in the VM arguments
|
|---|
| 256 | area (to enable assertion checking).
|
|---|
| 257 |
|
|---|
| 258 | 12. An example of how to set up a single test from within Eclipse:
|
|---|
| 259 | create a new Run Configuration via the Run->Run
|
|---|
| 260 | Configurations... menu. Create a new "Java Application"
|
|---|
| 261 | configuration. Call it "CIVL barrier2". The Project is CIVL. The
|
|---|
| 262 | main class is edu.udel.cis.vsl.civl.CIVL. Under the Arguments tab,
|
|---|
| 263 | set the Program arguments to
|
|---|
| 264 |
|
|---|
| 265 | verify examples/concurrency/barrier2.cvl
|
|---|
| 266 |
|
|---|
| 267 | Modify the VM arguments as in the step above. You should now be
|
|---|
| 268 | able to run the test by clicking "Run".
|
|---|
| 269 |
|
|---|
| 270 |
|
|---|
| 271 | |
|---|