| 144 | | * `=>` |
| | 144 | === Boolean expressions |
| | 145 | |
| | 146 | CIVL-C provides the boolean constants`$true` and `$false`, which are simply defined as 1 and 0, respectively. CIVL-C is, after all, an extension of C. A program may also include the standard C library header file `stdbool.h`, which defines `true` and `false` in the exact same way. |
| | 147 | |
| | 148 | In addition to the standard logical operators `&&`, `||`, and `!`, CIVL-C provides `=>` (implies). `p => q` is equivalent to `!(p) || q` (and has the same short-circuit semantics). |
| | 149 | |
| | 150 | A universally quantified formula has the form |
| | 151 | |
| | 152 | `$forall` `(` ''variable-declarations'' (`;` ''variable-declarations'' )* `|` ''restriction'' `)` ''expr'' |
| | 153 | |
| | 154 | where ''variable-declarations'' declares a list of variables of a given type with an optional domain, and has the form |
| | 155 | |
| | 156 | ''type'' ''identifier'' (, ''identifier'')* (`:` ''domain'')? |
| | 157 | |
| | 158 | where ''type'' is a type name (e.g., `int` or `double`), ''identifier'' is the name of the bound variable. Moreover, ''restriction'' is a boolean expression which expresses some restriction on the values that the bound variable can take, and ''expr'' is a formula. The universally quantified formula holds iff for all values assignable to the bound variable for which the restriction holds, the formula expr holds. |
| | 159 | |
| | 160 | |