| 1 | # CIVL: The Concurrency Intermediate Verification Language
|
|---|
| 2 |
|
|---|
| 3 | v1.22
|
|---|
| 4 |
|
|---|
| 5 | ## Overview
|
|---|
| 6 |
|
|---|
| 7 | CIVL is a framework encompassing...
|
|---|
| 8 |
|
|---|
| 9 | * a programming language, CIVL-C, which adds to C a number of
|
|---|
| 10 | concurrency primitives, as well as the ability to define
|
|---|
| 11 | functions in any scope. Together, these features make for
|
|---|
| 12 | a very expressive concurrent language that can faithfully
|
|---|
| 13 | represent programs using various APIs and parallel languages,
|
|---|
| 14 | such as MPI, OpenMP, Pthread, CUDA, and Chapel. CIVL-C also
|
|---|
| 15 | provides a number of primitives supporting verification.
|
|---|
| 16 | * a model checker which uses symbolic execution to verify a
|
|---|
| 17 | number of safety properties of CIVL-C programs. The model
|
|---|
| 18 | checker can also be used to verify that two CIVL-C programs
|
|---|
| 19 | are functionally equivalent.
|
|---|
| 20 | * a number of translators from various commonly-used languages
|
|---|
| 21 | and APIs to CIVL-C. (This part is still a work in progress.)
|
|---|
| 22 |
|
|---|
| 23 | CIVL is developed by the Verified Software Laboratory at the
|
|---|
| 24 | University of Delaware Department of Computer Science.
|
|---|
| 25 | For more information, visit <https://civl.dev>
|
|---|
| 26 |
|
|---|
| 27 | **Active Developers:**
|
|---|
| 28 |
|
|---|
| 29 | - Stephen F. Siegel
|
|---|
| 30 | - Alexander Wilton
|
|---|
| 31 |
|
|---|
| 32 | **Previous Developers:**
|
|---|
| 33 |
|
|---|
| 34 | - John Edenhofner
|
|---|
| 35 | - Andre Marianiello
|
|---|
| 36 | - Michael Rogers
|
|---|
| 37 | - Timothy K. Zirkel
|
|---|
| 38 | - Manchun Zheng
|
|---|
| 39 | - Yihao Yan
|
|---|
| 40 | - Matthew B. Dwyer
|
|---|
| 41 | - Mitchell Gerrard
|
|---|
| 42 | - Wenhao Wu
|
|---|
| 43 | - Ziqing Luo
|
|---|
| 44 |
|
|---|
| 45 | ## License
|
|---|
| 46 |
|
|---|
| 47 | CIVL is open source software distributed under the GNU
|
|---|
| 48 | General Public License. However, the libraries used by CIVL
|
|---|
| 49 | (and incorporated into the complete distribution) use various
|
|---|
| 50 | licenses. See directory licenses for the license of each component.
|
|---|
| 51 |
|
|---|
| 52 | ## Updates from v1.21
|
|---|
| 53 |
|
|---|
| 54 | 1. Upgraded to Java 17
|
|---|
| 55 | 2. Overhauled repository structure by moving ABC, SARL, and GMC
|
|---|
| 56 | repositories into this one.
|
|---|
| 57 | 3. Core language changes
|
|---|
| 58 | 1. Only the first statement in an `$atomic` block is allowed to block.
|
|---|
| 59 | 2. `$yield` can be used to release the lock of the atomic block
|
|---|
| 60 | 3. Removed `$atom`
|
|---|
| 61 | 4. Total overhaul to OpenMP transformations. Now includes a robust data
|
|---|
| 62 | race detection feature as described in CAV 2023 paper 'Model Checking
|
|---|
| 63 | Race-freedom When "Sequential Consistency for Data-race-free Programs"
|
|---|
| 64 | is Guaranteed'
|
|---|
| 65 | 5. A large number of bug fixes and small improvements.
|
|---|
| 66 |
|
|---|
| 67 | ## Updates from v1.20
|
|---|
| 68 |
|
|---|
| 69 | 1. refine the Fortran extension for paper submitted to TACAS 2022
|
|---|
| 70 | 1. Complete Fortran Array Descriptor for tracking changes made on
|
|---|
| 71 | index ranges by array section and reshape operations.
|
|---|
| 72 | Any declared array type is transformed into a Fortran array
|
|---|
| 73 | descriptor by Fortran to CIVL-C AST transformer.
|
|---|
| 74 | 2. Introduce four basic CIVL verification primitives Fortran bindings
|
|---|
| 75 | 1. Type qualifiers:
|
|---|
| 76 | - `!$CVL $input`: indicates that all variables declared immediately
|
|---|
| 77 | in the next line are symbolic and read-only.
|
|---|
| 78 | - `!$CVL $output`: indicates that all variables declared immediately
|
|---|
| 79 | in the next line are write-only and used for
|
|---|
| 80 | verifying functional output equivalence.
|
|---|
| 81 |
|
|---|
| 82 | A type declaration statement is required to be used immediately
|
|---|
| 83 | after any CIVL type qualifier and variables qualified shall follow
|
|---|
| 84 | read/write constraints mentioned above.
|
|---|
| 85 | CIVL assumption primitives can be used for limiting the value range
|
|---|
| 86 | of variables qualified by `!$CVL $input`.
|
|---|
| 87 | e.g.,
|
|---|
| 88 |
|
|---|
| 89 | ```fortran
|
|---|
| 90 | !$CVL $input
|
|---|
| 91 | integer :: n, a(n)
|
|---|
| 92 | !! both 'n' and elements of 'a' are symbolic and read-only
|
|---|
| 93 | !$CVL $output
|
|---|
| 94 | integer :: sum
|
|---|
| 95 | !! sum is write-only and can be used for comparing with another
|
|---|
| 96 | !! program, which also has 'sum' with a same type and qualified
|
|---|
| 97 | !! by '!$CVL $output'
|
|---|
| 98 | ```
|
|---|
| 99 |
|
|---|
| 100 | 2. Verification
|
|---|
| 101 | - `!$CVL $assume(logic_expr)`;
|
|---|
| 102 | Make CIVL only explores paths, whose path conditions shall
|
|---|
| 103 | make `logic_expr` to be true.
|
|---|
| 104 | Set the value range for variables qualified by `!$CVL $input`
|
|---|
| 105 | - `!$CVL $assert(logic_expr)`;
|
|---|
| 106 | Checks predicates representing specific correctness properties
|
|---|
| 107 | that users expect to verify.
|
|---|
| 108 | If any CIVL assertion primitive is evaluated as false, then
|
|---|
| 109 | CIVL shall report an assertion violation.
|
|---|
| 110 | 3. Add supports for additional Fortran features include:
|
|---|
| 111 | 1. `inout` and `out` attributes declared by `intent` statement
|
|---|
| 112 | 2. compound types with fields having scalar types.
|
|---|
| 113 | 3. pointer types to scalar types.
|
|---|
| 114 | 4. logic expression evaluation without short-circuits
|
|---|
| 115 | 5. line truncation for fixed and free forms
|
|---|
| 116 | 6. other features are shown here:
|
|---|
| 117 | <https://vsl.cis.udel.edu/trac/civl/wiki/FortranTransformations>
|
|---|
| 118 | 4. Add test cases imported from SMACK verification suite
|
|---|
| 119 | <https://github.com/soarlab/gandalv/>
|
|---|
| 120 | 2. CUDA Support Improvement
|
|---|
| 121 | 1. Fixed CUDA bug in which CUDA kernel declarations were not being
|
|---|
| 122 | transformed properly
|
|---|
| 123 | 2. Fixed source info bug (`completeSources` wasn't being called
|
|---|
| 124 | everywhere that it should)
|
|---|
| 125 | 3. Fixed short circuit bug described in ticket #943
|
|---|
| 126 | 4. Added small optimization to short circuit transformer to allow
|
|---|
| 127 | for finer granularity of its transformation
|
|---|
| 128 | 3. Other Improvement and Fixed Bugs
|
|---|
| 129 | 1. `MPI_Comm` types can be compared by equality operator (`==`).
|
|---|
| 130 | 2. Java-Doc improvements
|
|---|
| 131 |
|
|---|
| 132 | ## Updates from v1.19
|
|---|
| 133 |
|
|---|
| 134 | 1. added new language primitives:
|
|---|
| 135 | 1. `$local_start()` and `$local_end()`
|
|---|
| 136 | An execution of the statements in between of this pair, including this pair themselves,
|
|---|
| 137 | is NOT ONLY uninterruptable BUT ALSO purely local to the view of the verifier.
|
|---|
| 138 | 2. `$read_set_push()` and `$read_set_pop()` (the correspondence for write set has already been supported)
|
|---|
| 139 | This pair of primitives can be used to turn on/off the capturing of read set during execution.
|
|---|
| 140 | 2. added Fortran support for translating basic Fortran features into CIVL-AST
|
|---|
| 141 | (see: <https://vsl.cis.udel.edu/trac/civl/wiki/FortranTransformations>)
|
|---|
| 142 | 3. added simple Fortran verification examples (edited)
|
|---|
| 143 |
|
|---|
| 144 | ## Binary Installation
|
|---|
| 145 |
|
|---|
| 146 | For most users, this will be the easiest way to install and
|
|---|
| 147 | use CIVL. Developers should instead follow the instructions for
|
|---|
| 148 | "Source Installation" below.
|
|---|
| 149 |
|
|---|
| 150 | 1. Install at least one of the theorem provers below.
|
|---|
| 151 | The more provers you install, the more precise CIVL analysis will
|
|---|
| 152 | be. Note that CIVL only requires the binary executable
|
|---|
| 153 | version of each prover; you can ignore the libraries, various
|
|---|
| 154 | API bindings, etc. You just need to ensure that
|
|---|
| 155 | each binary executable is in your PATH when you run
|
|---|
| 156 | `civl config`. The currently supported provers are:
|
|---|
| 157 |
|
|---|
| 158 | - CVC4, <http://cvc4.cs.nyu.edu/downloads/>
|
|---|
| 159 | - Z3, <http://z3.codeplex.com/SourceControl/latest>
|
|---|
| 160 |
|
|---|
| 161 | 2. Install a Java 17 SDK if you have not already. Go to
|
|---|
| 162 |
|
|---|
| 163 | <http://www.oracle.com/technetwork/java/javase/downloads/>
|
|---|
| 164 |
|
|---|
| 165 | for the latest from Oracle. On linux, you can instead use
|
|---|
| 166 | the package manager:
|
|---|
| 167 |
|
|---|
| 168 | ```sh
|
|---|
| 169 | sudo apt install openjdk-17-jdk
|
|---|
| 170 | ```
|
|---|
| 171 |
|
|---|
| 172 | 3. Download the CIVL distribution from <http://vsl.cis.udel.edu/civl>.
|
|---|
| 173 |
|
|---|
| 174 | 4. Unzip and untar the CIVL distribution file if this
|
|---|
| 175 | does not happen automatically. This should result in a
|
|---|
| 176 | folder named CIVL-TAG, where TAG is some version ID string.
|
|---|
| 177 | This folder contains the following:
|
|---|
| 178 |
|
|---|
| 179 | - README : this file
|
|---|
| 180 | - bin : containing one executable sh script called `civl`
|
|---|
| 181 | - lib : containing `civl-TAG.jar`
|
|---|
| 182 | - doc : containing the manual and the tutorial of CIVL
|
|---|
| 183 | - emacs : CIVL-C emacs mode and its installation instructions
|
|---|
| 184 | - licenses : licenses for CIVL and included libraries
|
|---|
| 185 | - examples : some example CIVL programs
|
|---|
| 186 |
|
|---|
| 187 | 5. You can move the CIVL folder wherever you want.
|
|---|
| 188 | The JAR file in the lib directory is all you need to run CIVL.
|
|---|
| 189 | You may also move this jar file wherever you want. You
|
|---|
| 190 | run CIVL by typing a command that begins
|
|---|
| 191 | `java -jar /path/to/civl-TAG.jar ...`. For convenience
|
|---|
| 192 | you may instead use the shell script `civl` in bin,
|
|---|
| 193 | which allows you to replace `java -jar /path/to/civl-TAG.jar`
|
|---|
| 194 | with just `civl` on the command line. Simply edit the `civl` script
|
|---|
| 195 | to reflect the path to `civl-TAG.jar` and place the script
|
|---|
| 196 | somewhere in your `PATH`. Alternatively, you can just define
|
|---|
| 197 | an alias in your `.profile`, `.bash_profile`, or equivalent, such as
|
|---|
| 198 |
|
|---|
| 199 | ```sh
|
|---|
| 200 | alias civl='java -jar /path/to/civl-TAG.jar'
|
|---|
| 201 | ```
|
|---|
| 202 |
|
|---|
| 203 | In the following, we will assume that you have defined
|
|---|
| 204 | a command `civl` in one these ways.
|
|---|
| 205 |
|
|---|
| 206 | 6. Type `civl config`. This should report that it found
|
|---|
| 207 | the theorem provers you installed (and are in your `PATH`).
|
|---|
| 208 | It should create a file called `.sarl` in your home directory
|
|---|
| 209 | which you can also edit by hand.
|
|---|
| 210 |
|
|---|
| 211 | ## Source Installation
|
|---|
| 212 |
|
|---|
| 213 | Instructions found here:
|
|---|
| 214 | <https://vsl.cis.udel.edu/trac/civl/wiki/Be%20a%20CIVL%20developer>
|
|---|