Skip to content
Snippets Groups Projects
Commit 93e0cbc7 authored by David Söderberg's avatar David Söderberg
Browse files

Update HOME_EXAM.md

parent 661bec09
No related branches found
No related tags found
No related merge requests found
...@@ -232,12 +232,21 @@ illegal stuff; ...@@ -232,12 +232,21 @@ illegal stuff;
- c, command - c, command
- v, variable - v, variable
- e, expression - e, expression
- t, type
##### Expression can be either a ##### Expression can be either a
- b, boolean - b, boolean
- i, integer - i, integer
- f, function - f, function
##### Types are
- i32, integer
- bool, boolean
- (), Unit
- &t, reference to type
- &mut t, mutable reference to type
- *t, dereference to type
### Function sequence ### Function sequence
```math ```math
<f, σ>⇓σ' <f, σ>⇓σ'
...@@ -245,12 +254,12 @@ illegal stuff; ...@@ -245,12 +254,12 @@ illegal stuff;
### Command sequence ### Command sequence
```math ```math
\frac{<c1,σ> ⇓ σ' <c2,σ'> ⇓ σ''}{<c1;c2,σ> ⇓ σ''} \frac{<c_1,σ> ⇓ σ' <c_2,σ'> ⇓ σ''}{<c_1;c_2,σ> ⇓ σ''}
``` ```
### Operands for integer expressions ### Operands for integer expressions
```math ```math
\frac{<e1,σ> ⇓ n1 <e2, σ> ⇓ n2}{<e1 + e2, σ> ⇓ n1 \text{ plus } n2} \frac{<e_1,σ> ⇓ i_1 <e_2, σ> ⇓ i_2}{<e_1 + e2, σ> ⇓ i_1 \text{ plus } i_2}
``` ```
The other integer expressions are The other integer expressions are
- -, minus - -, minus
...@@ -265,7 +274,7 @@ The other integer expressions are ...@@ -265,7 +274,7 @@ The other integer expressions are
### Operands for boolean expressions ### Operands for boolean expressions
```math ```math
\frac{<e1,σ> ⇓ b1 <e2, σ> ⇓ b2}{<e1 == e2, σ> ⇓ b1 \text{ equal } b2} \frac{<e_1,σ> ⇓ b_1 <e_2, σ> ⇓ b_2}{<e_1 == e_2, σ> ⇓ b_1 \text{ equal } b_2}
``` ```
Other boolean expressions are Other boolean expressions are
- "==", equal - "==", equal
...@@ -294,12 +303,15 @@ Other boolean expressions are ...@@ -294,12 +303,15 @@ Other boolean expressions are
``` ```
### Let expression ### Let expression
```math ```math
\frac{<v, σ>⇓<\text{let } v:=e, σ>⇓σ'}{<\text{let } v := e, σ> ⇓ σ[v := e]} \frac{<v, σ>⇓<\text{let } v:=e, σ>⇓σ'}{<\text{let } v := e, σ> ⇓ σ[v := e]}
``` ```
### If expression ### Assign expression
```math
{<v := e, σ> ⇓ σ[v := e]}
```
- Explain (in text) what an interpretation of your example should produce, do that by dry running your given example step by step. Relate back to the SOS rules. You may skip repetitions to avoid cluttering. - Explain (in text) what an interpretation of your example should produce, do that by dry running your given example step by step. Relate back to the SOS rules. You may skip repetitions to avoid cluttering.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment