Changes between Version 43 and Version 44 of IR2
- Timestamp:
- 04/28/21 18:14:37 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
IR2
v43 v44 23 23 1. **How to you translate between sequences and arrays?** 24 24 1. Can you make types values? (reification) 25 1. `$depends_on`26 25 1. read/write sets: function calls to start, stop monitoring reads/writes? All part of mem library 27 1. function calls for atomic enter/exit28 26 1. a type for $state ? 29 27 1. How do you model `malloc` when the element type is not known? (Create a type `$byte`?) … … 54 52 block: '{' typedef* decl* function-definition* statement* '}' ; 55 53 statement: block | simpleStmt | chooseStmt ; 56 simpleStmt: label? guard? primitiveStmt gotoStmt? ;54 simpleStmt: label? dependency? guard? primitiveStmt gotoStmt? ; 57 55 chooseStmt: label? '$choose' '{' simpleStmt* '}' ; 58 56 label: ID ':' ; 59 guard: '$when' '(' expr ')' ; 57 guard: '$when' '(' expr ')' ; 58 dependency: '$depends_on' '(' expression-list? ')' 59 expression-list: expr (',' expr)* ; 60 60 gotoStmt: 'goto' ID ; 61 61 contract-clause : … … 82 82 * A program must contain a function definition for a function named `main`. 83 83 * `$input` and `$output` can be used only on global variable declarations (not on function definitions, not in block scope). 84 * the `expr` in a guard must have type `$bool` 84 * The `expr` in a guard must have type `$bool`. 85 * The expressions in a dependency clause must have pointer type. This declares that the following transition depends only on the objects pointed to. 85 86 86 87 {{{ … … 145 146 | lvalue '=' expr ';' /* assignment */ 146 147 | expr '(' arg-list? ')' ';' /* function call */ 147 | (lvalue '=')? '$spawn' expr '(' arg-list? ')' ';' /* process creation */148 | (lvalue '=')? '$spawn' expr '(' expression-list? ')' ';' /* process creation */ 148 149 | 'return' expr? ';' /* return from function call */ 149 150 | (lvalue '=')? '$alloc' '(' expr ',' expr ',' type-name ')' ';' /* heap allocation */ 150 arg-list: expr (',' expr)* ; /* actual argument list */151 151 152 152 }}}
