Changes between Version 10 and Version 11 of Language


Ignore:
Timestamp:
05/18/23 11:07:44 (3 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Language

    v10 v11  
    427427=== `$assert`
    428428
     429The system function `$assert` has the signature
     430{{{
     431void $assert(_Bool expr, ...);
     432}}}
     433It consumes a boolean expression and any number of optional expressions which are used to construct an error message.
     434Note that CIVL-C boolean expressions have a richer syntax than C expressions, and may include universal or existential quantifiers.
     435During verification, the assertion is checked.
     436If it cannot be proved that it must hold, a violation is reported, and, if additional arguments are present, a specific message is printed.
     437These additional arguments are similar in form to those used in C’s `printf` statement:
     438a format string, followed by some number of arguments which are evaluated and substituted for successive codes in the format string.
     439For example,
     440{{{
     441$assert(x<=B, "x-coordinate %f exceeds bound %f", x, B);
     442}}}
     443If x=3 and B=2, the assertion is violated and CIVL prints the error message ā€œx-coordinate 3 exceeds bound 2ā€.
     444
    429445=== `$assume`
    430446