Changes between Version 50 and Version 51 of Language
- Timestamp:
- 05/23/23 09:35:32 (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Language
v50 v51 33 33 34 34 An object of this type is a reference to a dynamic scope. 35 Several constants, expressions, and functions dealing with the $scopetype are also provided.35 Several constants, expressions, and functions dealing with the `$scope` type are also provided. 36 36 The `$scope` type is like any other object type. 37 37 It may be used as the element type of an array, a field in a structure or union, and so on. … … 99 99 $abstract int f(int x); 100 100 }}} 101 An abstract function must have a non- voidreturn type and take at least one parameter.101 An abstract function must have a non-`void` return type and take at least one parameter. 102 102 An invocation of an abstract function is an expression and can be used anywhere an expression is allowed. 103 103 The interpretation is an "uninterpreted function". … … 129 129 130 130 A system function may have a guard, which is specified in the function contract using a `$executes_when` clause. 131 Unless constrained by its contract or other qualifiers, a system function may modify the sta yin an arbitrary way.131 Unless constrained by its contract or other qualifiers, a system function may modify the state in an arbitrary way. 132 132 133 133 === Pure functions: `$pure` #pure … … 150 150 === Boolean expressions, `=>`, `$forall`, `$exists` #boolean-expressions 151 151 152 CIVL-C provides the boolean constants `$true` and `$false`, which are simply defined as 1 and 0, respectively.152 CIVL-C provides the boolean constants `$true` and `$false`, which are simply defined as 1 and 0, respectively. 153 153 CIVL-C is, after all, an extension of C. 154 154 A program may also include the standard C library header file `stdbool.h`, which defines `true` and `false` in the exact same way. … … 161 161 `$forall` `(` ''variable-decls'' (`;` ''variable-decls'' )* (`|` ''restriction'')? `)` ''expr'' 162 162 163 where ''variable-decls'' has one of the forms164 165 ''type'' ''identifier'' (`,` ''identifier'')*166 167 ''type'' ''identifier'' `:` ''range'' 168 169 where ''type'' is a type name (e.g., `int` or `double`), ''identifier'' is the name of the bound variable,170 ''restriction'' is a formula (boolean expression) which expresses some restriction on the values that the bound variable can take, 171 ''range'' is an expression of `$range` type, and''expr'' is a formula.172 The universally quantified formula holds iff for all values assignable to the bound variable for which the restriction holds, the formula expr holds.173 174 The syntax for existential quantification is the same, with `$exists` in place of `$forall`. 163 where 164 * ''variable-decls'' has one of the forms 165 * ''type'' ''identifier'' (`,` ''identifier'')* 166 * `int` ''identifier'' `:` ''range'' 167 * ''type'' is a type name (e.g., `int` or `double`), 168 * ''identifier'' is the name of a bound variable, 169 * ''range'' is an expression of `$range` type, 170 * ''restriction'' is a formula (boolean expression) which expresses some restriction on the values that the bound variable can take, and 171 * ''expr'' is a formula. 172 The syntax for existential quantification is the same, with `$exists` in place of `$forall`. 173 174 We will call any assignment of values to the bound variables of a quantified expression a "candidate assignment" if it satisfies ''restriction'' and each bound variable with an associated ''range'' is given a value contained in this ''range''. The universally quantified formula holds iff ''expr'' holds under all candidate assignments. Similarly, the existentially quantified formula holds iff there exists a candidate assignment for which ''expr'' holds. 175 175 176 176 Examples: … … 222 222 === Range literals: ''a''`..`''b'' and ''a''`..`''b''`#`''c'' #range-literals 223 223 224 A range literal has form224 A range literal has the form 225 225 ''expr'' `..` ''expr'' ( `#` ''expr'' )? 226 226 The two or three sub-expressions (the third is optional) have integer type and the type of the entire expression is `$range`. … … 361 361 The default clause is optional. 362 362 363 The guards of the statements are evaluated and among those that are true, one is chosen non deterministically and executed.363 The guards of the statements are evaluated and among those that are true, one is chosen non-deterministically and executed. 364 364 If none are true and the default clause is present, it is chosen. 365 365 The default clause will only be selected if all guards are false. … … 397 397 Control iterates over the values of the domain, assigning the integer variables the components of the current tuple in the domain at the start of each iteration. 398 398 The scope of the variables extends to the end of ''S''. 399 The iterations takes place in the order specified by the domain, e.g., dictionary order for a Car etesian domain.399 The iterations takes place in the order specified by the domain, e.g., dictionary order for a Cartesian domain. 400 400 Note that if a range expression can be used as ''dom'' here, it will be automatically converted to a one-dimensional domain. 401 401 For example,
