| 9 | | Do variables have initial values?:: No, a declared variable must be initialized before it is used. |
| 10 | | How do you initialize a variable?:: By assigning a value to it. For example `n=$new($int);` will assign `n` an arbitrary integer, while `n=0;` will assign the integer `0` to `n. |
| 11 | | How is an array allocated?:: An array variable `a` is declared with a decl such as `T a[];`, and then a statement such as `a=$new(T[n]);` will assign to `a` a new arbitrary array value for an array of length `n` of elements of type `T`. For heap-allocation, a pointer is declared with a decl such as `T * p;`, and a heap variable is also declared somewhere with a decl such as `$heap heap;` and then a statement such as `p = $alloc(&heap, n, T);` will add a new object to the heap and return a pointer to the first element. An `$alloc`-ed object can be deallocated with `$free(p);`. |
| 12 | | |
| 13 | | * how to go between sequences and arrays |
| 14 | | * can you make types values? (reification) |
| 15 | | * pure functions? A pure function is a mathematical function of its arguments. It cannot modify the state. |
| 16 | | * state functions? A state function is a function of the current state (including arguments, global variables, ...). It cannot modify the state. Every pure function is a state function. |
| 17 | | * `$depends_on` |
| 18 | | * read/write sets: function calls to start, stop monitoring reads/writes? All part of mem library |
| 19 | | * function calls for atomic enter/exit |
| 20 | | * a type for $state ? |
| | 9 | 1. **Do variables have initial values?** |
| | 10 | * No, a declared variable must be initialized before it is used. |
| | 11 | 1. **How do you initialize a variable?** |
| | 12 | * By assigning a value to it. For example `n=$new($int);` will assign `n` an arbitrary integer, while `n=0;` will assign the integer `0` to `n. |
| | 13 | 1. **How is an array allocated?** |
| | 14 | * An array variable `a` is declared with a decl such as `T a[];`, and then a statement such as `a=$new(T[n]);` will assign to `a` a new arbitrary array value for an array of length `n` of elements of type `T`. For heap-allocation, a pointer is declared with a decl such as `T * p;`, and a heap variable is also declared somewhere with a decl such as `$heap heap;` and then a statement such as `p = $alloc(&heap, n, T);` will add a new object to the heap and return a pointer to the first element. An `$alloc`-ed object can be deallocated with `$free(p);`. |
| | 15 | 1. **How to you translate between sequences and arrays?** |
| | 16 | 1. Can you make types values? (reification) |
| | 17 | 1. pure functions? A pure function is a mathematical function of its arguments. It cannot modify the state. |
| | 18 | 1. state functions? A state function is a function of the current state (including arguments, global variables, ...). It cannot modify the state. Every pure function is a state function. |
| | 19 | 1. `$depends_on` |
| | 20 | 1. read/write sets: function calls to start, stop monitoring reads/writes? All part of mem library |
| | 21 | 1. function calls for atomic enter/exit |
| | 22 | 1. a type for $state ? |