Changes between Version 28 and Version 29 of Language


Ignore:
Timestamp:
05/20/23 10:11:54 (3 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Language

    v28 v29  
    1313=== The integer type
    1414
    15 There is one integer type, corresponding to the mathematical integers. Currently, all of the C integer types `int`, `long`, `unsigned int`, `short`, etc., are mapped to the CIVL integer type.   [This is expected to change.]
     15There is one integer type, corresponding to the mathematical integers.
     16Currently, all of the C integer types `int`, `long`, `unsigned int`, `short`, etc., are mapped to the CIVL integer type.
     17[This is expected to change.]
    1618
    1719=== The real type
     
    184186}}}
    185187
    186 
    187188=== This scope: the `$here` scope expression
    188189Expression of type `$scope`, evaluating to the dynamic scope in which the evaluation takes place.
     
    194195Constant of type `$scope`, the root dynamic scope.
    195196
    196 === Range literals
     197=== Range literals: `lo .. hi`
    197198
    198199An expression of the form `lo .. hi` where `lo` and `hi` are integer expressions, represents the range consisting of the integers `lo`, `lo` + 1, ..., `hi` (in that order).
     
    242243=== This process: `$self`
    243244
    244 This expression of `$proc` type returns a reference to the process which is evaluating this expression.  It provides a way for code to obtain the identity of the process executing the code.
     245This expression of `$proc` type returns a reference to the process which is evaluating this expression.
     246It provides a way for code to obtain the identity of the process executing the code.
    245247
    246248=== Spawning a new process: `$spawn`
    247249
    248 A spawn expression is an expression with side-effects. It spawns a new process and returns a reference to the new process, i.e., an object of type $proc. The syntax is the same as a procedure invocation with the keyword `$spawn` inserted in front:
     250A spawn expression is an expression with side-effects.
     251It spawns a new process and returns a reference to the new process, i.e., an object of type $proc.
     252The syntax is the same as a procedure invocation with the keyword `$spawn` inserted in front:
    249253{{{
    250254$spawn f(expr1, ..., exprn)
     
    276280The process may not necessarily enter the atomic block as soon as these conditions hold, because some other enabled process may be scheduled first.
    277281In fact, some other process may obtain the atomic lock.
    278 But if the enabling conditions hold and this process is scheduled, it will obtain the atomic lock and begin executing the statements of the atomic block without other processes executing.
     282But if the enabling conditions hold and this process is scheduled, it will obtain the atomic lock and begin executing the statements
     283of the atomic block without other processes executing.
    279284Upon reaching the end of the atomic block, the process releases the atomic lock and exits the block.
    280285
    281286There is an exception to atomicity: if the process inside the atomic block executes a `$yield` statement, it releases the atomic lock.
    282287This allows other processes to execute, and even obtain the lock.
    283 At any point at which the atomic lock is free and the first statement following the `$yield` is enabled, the original process may re-obtain the atomic lock and continue executing its block atomically.
     288At any point at which the atomic lock is free and the first statement following the `$yield` is enabled, the original process may re-obtain
     289the atomic lock and continue executing its block atomically.
    284290
    285291If a statement inside an atomic block blocks, so that the process executing the atomic block has no enabled statement, execution deadlocks.
    286 The exception to this rule is that the first statement in the atomic block, and the first statement after a `$yield`, as described above, may block, without necessarily causing deadlock.
     292The exception to this rule is that the first statement in the atomic block, and the first statement after a `$yield`, as described above,
     293may block, without necessarily causing deadlock.
    287294
    288295Atomic blocks may be nested.
     
    291298Each time it leaves an atomic block, the multiplicity is decremented.
    292299When the multiplicity hits 0, the atomic lock is released.
    293 Execution of a `$yield` does not change the multiplicity; the process releases the lock but maintains the multiplicity, so that when the lock is re-obtained, the original multiplicity is still in place.
     300Execution of a `$yield` does not change the multiplicity; the process releases the lock but maintains the multiplicity,
     301so that when the lock is re-obtained, the original multiplicity is still in place.
    294302
    295303=== Nondeterministic selection statement `$choose`
     
    312320The implicit guard of the `$choose` statement with a default clause is ''true''.
    313321
    314 Example: this shows how to encode a “low-level” guarded transition system:
     322==== Example
     323This shows how to encode a “low-level” guarded transition system:
    315324{{{
    316325l1:
     
    362371
    363372The semantics are as follows: when control reaches the loop, one process is spawned for each element of the domain.
    364 That process has local variables corresponding to the iteration variables, and those local variables are initialized with the components of the tuple for the element of the domain that process is assigned.
     373That process has local variables corresponding to the iteration variables, and those local variables are initialized with the components
     374of the tuple for the element of the domain that process is assigned.
    365375Each process executes the statement ''S'' in this context.
    366376Finally, each of these processes is waited on at the end.
     
    373383$when (expr) stmt;
    374384}}}
    375 All statements have a guard, either implicit or explicit. For most statements, the guard is ''true''. The `$when` statement allows one to attach an explicit guard to a statement.
     385All statements have a guard, either implicit or explicit. For most statements, the guard is ''true''.
     386The `$when` statement allows one to attach an explicit guard to a statement.
    376387
    377388When `expr` is ''true'', the statement is enabled, otherwise it is disabled.
     
    522533In the symbolic semantics, this function assigns a fresh symbolic constant of the appropriate type to the object pointed to by `ptr`.
    523534
    524 ===  Hiding pointers from the reachability analyzer: `$hide`, `$reveal`, and `$hidden`
     535===  Hiding pointers: `$hide`, `$reveal`, and `$hidden`
    525536
    526537The partial order reduction algorithm used by the CIVL Model Checker computes the set of memory locations that a process ''p'' can reach.
     
    530541graph are the reachable objects of ''p''.
    531542
    532 There are times when one wants to modify this directed graph by ignoring some edge.   The purpose of these functions is to provide a way to do this from CIVL-C code.
     543There are times when one wants to modify this directed graph by ignoring some edge.
     544The purpose of these functions is to provide a way to do this from CIVL-C code.
    533545The signatures are:
    534546{{{
     
    537549$system _Bool $hidden(const void* ptr);
    538550}}}
    539 Function `$hide` wraps a pointer object in another object which is opaque to the reachability analyzer, i.e., the analyzer will not look inside this object and therefore will not find the hidden pointer.   Nothing can be done with this hidden pointer until it is "revealed", i.e., extracted from the opaque object.   The function `$hidden` tells whether its argument is a value returned by `$hide`.
    540 
    541 === Checking whether a pointer dereference is safe: `$is_derefable`
     551Function `$hide` wraps a pointer object in another object which is opaque to the reachability analyzer, i.e., the analyzer will not look inside
     552this object and therefore will not find the hidden pointer.
     553Nothing can be done with this hidden pointer until it is "revealed", i.e., extracted from the opaque object.
     554The function `$hidden` tells whether its argument is a value returned by `$hide`.
     555
     556=== Checking pointer safety: `$is_derefable`
    542557
    543558This function has signature
     
    548563This means `ptr` points to a memory location that is capable of and is currently holding a value of type T, where T is the type of `*ptr`.
    549564
    550 === `$is_terminated`
     565=== Checking process termination: `$is_terminated`
    551566
    552567Signature: