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

Update HOME_EXAM.md

parent 74e9932e
No related branches found
No related tags found
No related merge requests found
...@@ -270,7 +270,7 @@ let a:bool = true; ...@@ -270,7 +270,7 @@ let a:bool = true;
### Operands for integer expressions ### Operands for integer expressions
```math ```math
\frac{<e_1,σ> ⇓ i_1 <e_2, σ> ⇓ i_2}{<e_1 + e2, σ> ⇓ i_1 \text{ plus } i_2} \frac{<e_1,σ> ⇓ i_1 <e_2, σ> ⇓ i_2}{<e_1 - e2, σ> ⇓ i_1 \text{ minus } i_2}
``` ```
``` rust ``` rust
...@@ -278,7 +278,7 @@ let a:bool = true; ...@@ -278,7 +278,7 @@ let a:bool = true;
``` ```
The other integer expressions are Above is a minues operation of two integers, following integer expressions can be described in the same way:
- -, minus - -, minus
- *, multiplication - *, multiplication
- /, division - /, division
...@@ -293,12 +293,7 @@ The other integer expressions are ...@@ -293,12 +293,7 @@ The other integer expressions are
```math ```math
\frac{<e_1,σ> ⇓ b_1 <e_2, σ> ⇓ b_2}{<e_1 == e_2, σ> ⇓ b_1 \text{ equal } b_2} \frac{<e_1,σ> ⇓ b_1 <e_2, σ> ⇓ b_2}{<e_1 == e_2, σ> ⇓ b_1 \text{ equal } b_2}
``` ```
Above is an equals operation of two expessions, following boolean expressions can be described in the same way:
```math
\frac{<e_1,σ> ⇓ b_1 <e_2,σ> ⇓ b_2}{<e_1 > e_2,σ> ⇓ b_1 \text{greater than } b_2}
```
Other boolean expressions are
- "==", equal
- "!=", not equal - "!=", not equal
- "&&", and - "&&", and
- "||", or - "||", or
...@@ -337,7 +332,7 @@ Declares the variable $`v`$ with type $`t`$ to current scope. ...@@ -337,7 +332,7 @@ Declares the variable $`v`$ with type $`t`$ to current scope.
### If true/false expression ### If true/false expression
```math ```math
\frac{<e, σ> ⇓ true <c1, σ> ⇓ σ'}{<if \text{ } b \text{ } then \text{ } c1> ⇓ σ} \frac{<e, σ> ⇓ true <c1, σ> ⇓ σ'}{<\text{if } b \text{ then }c1> ⇓ σ}
``` ```
### While expression ### While expression
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment