Changes between Initial Version and Version 1 of CIVLite


Ignore:
Timestamp:
09/21/23 07:30:59 (3 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CIVLite

    v1 v1  
     1
     2CIVLite: is an experimental light-weight model checking language and tool.
     3
     4Types are: ints, proc, and arrays of any type.
     5
     6Identifiers all start with `%`.
     7
     8No boolean type.  Instead, int is used.   0 is false, every other int is true (like C).
     9
     10Parameters have a value that is fixed for the lifetime of the program.  They can be
     11hard coded into the program, or set on command line, like CIVL's $input variables.
     12
     13There is a global scope and a local scope for each function.  That's it.
     14
     15Grammar:
     16
     17{{{
     18
     19constant: INT | 'null' | '{' constant* '}'
     20
     21type: 'int' | 'proc' | type[]
     22
     23typedvar: type ID
     24
     25paramdecl: 'param' typedvar ('=' constant)? ';'
     26
     27vardecl: 'var' typedvar ';'
     28
     29formallist: typedvar (',' typedvar)*
     30
     31function: 'fun' type ID '(' formallist? ')' '{' (typedvar ';')* transition* '}'
     32
     33transition: (ID ':')? ('when' expr)? action ('goto' ID ';')?
     34// if label is missing, location will be created anyway with some ID number
     35// if when is missing, guard is 1 (true)
     36// if goto is missing, goto the next statement
     37
     38action: assignment call spawn noop return wait begin_atomic end_atomic
     39
     40assignment: lval '=' expr ';'
     41
     42invocation: ID '(' exprlist? ')'
     43
     44call: (lval '=')? 'call' invocation ';'
     45
     46spawn: (lval '=')? 'spawn' invocation ';'
     47
     48noop: ';'
     49
     50return: 'return' expr? ';'
     51
     52wait : 'wait' expr ';'
     53
     54begin_atomic: 'begin_atomic' ';'
     55
     56end_atomic: 'end_atomic' ';'
     57
     58exprlist: expr (',' expr)*
     59
     60lval: ID | lval '[' expr ']'
     61
     62expr: lval | constant | '(' expr ')' | expr '+' expr | ...
     63 // operators: + - * / mod  - == != >= > < <= && || !
     64
     65program: paramdecl* vardecl* function*
     66
     67
     68}}}