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