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