Changes between Version 1 and Version 2 of Challenge


Ignore:
Timestamp:
03/11/19 15:54:00 (7 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Challenge

    v1 v2  
    2121
    2222 `$spawn stmt`::
    23   create a new process executing stmt.  Returns a $proc.
     23  creates a new process executing the statement.  Returns a value of type `$proc`
     24referencing the new process.
    2425
    2526 `$wait($proc p)`::
    26   block until process p terminates
     27  blocks until process p terminates
    2728
    28 $parfor (int i:a..b) f(.. i ..);
    29   spawns threads calling f, one for each i in a..b,
    30   waits for them to terminate
     29 `$parfor (int i:a..b) stmt`::
     30  spawns threads, one for each i in the range a..b, each executing `stmt`.
     31Waits for them to terminate.
    3132
    32 assertions:
    33   Use either C's assert (include <assert.h>) or CIVL's $assert.
    34   They mean the same thing.
     33 `$assert(expr)`::
     34An assertion.  This is treated exactly the same as C's `assert`, except with
     35the latter you must include `assert.h`.    CIVL-C has a richer assertion
     36language that C---e.g., you can use quantifiers.
    3537
    36 Quantification: $forall and $exists.  Examples:
    37   $forall (double x | x>0) x>1
    38   $forall (int i | a<=i && i<=b) p(i)
    39   $forall (int i:a..b) p(i)
     38`$forall` and `$exists`::
     39Mean what you think.   Here are some examples to show the syntax:
     40 * `$forall (double x | x>1) x>0` -- for all doubles x that are greater than 1, x is greater than 0
     41 * `$forall (int i | a<=i && i<=b) p(i)` -- for all i between a and b (inclusive), p(i) holds
     42 * `$forall (int i:a..b) p(i)`  -- same as above, but more convenient
    4043
    4144