Changes between Version 39 and Version 40 of IR2


Ignore:
Timestamp:
04/28/21 17:04:16 (5 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • IR2

    v39 v40  
    1 == CIVL IR ==
     1= CIVL IR =
    22
    3 === Language principles ===
     3== Language principles ==
    44
    55* CIVL-IR is a subset of CIVL-C.  A CIVL-IR program is a CIVL-C program, and has the same semantics.
     
    2828
    2929
    30 === Grammar ===
     30== Grammar ==
    3131
    3232{{{
     
    6666}}}
    6767
    68 Notes
     68=== Notes ===
     69
    6970* A declaration declares a variable to have either an object type or a function type.   (An object type is any type that is not a function type.)
    7071* A variable of function type represents either an abstract or a system function.   The declaration of such a variable must use either the qualifier `$abstract` or `$system`.  Moreover, those two qualifiers can only be used in a declaration of function type.
     
    8788}}}
    8889
    89 === Types ===
     90== Types ==
     91
    9092{{{
    9193type-specifier:
     
    124126}}}
    125127
    126 Notes
     128=== Notes ===
    127129* Sequences, sets, maps, and relations are immutable.   An assignment using objects of this type creates a new copy of the object, just as with primitive types like `int`.
    128130* The main difference between the array type and the sequence type is that elements of an array are addressable, i.e., one can form a pointer such as `&a[i]`.  This is not possible with sequences, sets, maps, or relations---there is no way to have a pointer to any component of such a type.
     
    131133
    132134
    133 === Statements ===
     135== Statements ==
    134136
    135137{{{
     
    146148}}}
    147149
    148 Notes
     150=== Notes ===
     151
    149152* For function calls and spawns, the first expression shall have type pointer-to-function-....  The function pointed to will be the one called or spawned.  That function must be a system or defined function (not an abstract function).
    150153* The 3 expressions in a `$parspawn` are (1) pointer to the first element of the process array, an expression of type `$proc*`, (2) an expression of type `$domain`, and (3) an expression of type pointer-to-function-....  The function must have the type that consumes n `$int`s, where n is the dimension of the domain, and returns `void`.   The function is spawned once for each element of the domain.  References to the new processes are stored in the process array. 
    151154* The first expression following `$alloc` has type `$heap*`.  It is a pointer to the heap that will be modified by allocating the new memory.  The second expression has type `$int` and is the number of elements being allocated.    This is followed by the element type.    The function returns a pointer to the first element of an array, similar to C's malloc.    It is deallocated using function`$free`.
    152155
    153 Built-in functions:
     156
     157== Expressions ==
     158
     159{{{
     160expr:
     161    $new(type-name)  /* returns a new arbitrary value of the given type */
     162  |
     163
     164}}}
     165
     166
     167== Standard CIVL Library ==
     168
     169=== `civlc.cvh` ===
     170
    154171{{{
    155172void $assert( $bool asserted_expr, ... );  /* assertion with optional error message */
     
    161178}}}
    162179
    163 === Expressions ===
     180=== `mem.cvh` ===
    164181
    165 {{{
    166 expr:
    167     $new(type-name)  /* returns a new arbitrary value of the given type */
    168   |
     182=== `seq.cvh` ===
    169183
    170 }}}
     184=== `map.cvh` ===
     185
     186=== `concurrency.cvh` ===
    171187
    172188
    173