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