| | 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 | |
| | 60 | A program is a sequence of external definitions. The external definitions are |
| | 61 | |
| | 62 | * Variable declaration |
| | 63 | * Function declaration |
| | 64 | * Function definition |
| | 65 | * $assume |
| | 66 | |
| | 67 | A program must have a function called main which takes no arguments. Execution of the program begins in the body of main. |