Changes between Version 1 and Version 2 of LanguageSubset


Ignore:
Timestamp:
07/17/13 20:08:54 (13 years ago)
Author:
zirkel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • LanguageSubset

    v1 v2  
    2121* if-then-else statements : Same syntax as C.
    2222* while, for loops
     23* { <blockItem>* } : A blockItem can be a variable declaration, function definition, or statement.
    2324* $assert <expr> : Check that <expr> holds.
    2425* $assume <expr> : Add <expr> to the path condition.
     
    4445The implicit guard of the $choose statement with a default clause
    4546is "true".
     47
     48== Declarations ==
     49* Variable : Can optionally be specified as an input or output of the program.  Have optional initialization.
     50{{{ [$input | $output] <type> v [= <expr>] }}}
     51* Typedef : Assign an alternate name to a type.
     52{{{ typedef <type> <name> }}}
     53* Function : Gives the name, return type, and parameters.  Each function may have 0 or more declarations.
     54{{{ <type> f(<type> e1, ..., <type> e_n) }}}
     55* Function definition: Gives the name, return type, parameters, and body.  Each function must have exactly one definition.
     56{{{ <type> f(<type> e1, ..., <type> e_n) {...} }}}
     57
     58== Program ==
     59
     60A program is a sequence of external definitions.  The external definitions are
     61
     62* Variable declaration
     63* Function declaration
     64* Function definition
     65* $assume
     66
     67A program must have a function called main which takes no arguments.  Execution of the program begins in the body of main.