@@ -471,6 +520,20 @@ Similar SOS goes for the following operand:
true && 5; //Invalid type i32 for operand &&
```
##### Unary operations
```math
\frac{<e0,σ> → i32}{<-e0,σ> → i32}
```
SOS for unary - for one expression.
Similar SOS goes for the following operands:
- "!", not (bool instead of i32)
```rust
-(5+1);
!false;
```
##### Assignment
```math
\frac{<x,σ> → bool <e,σ> → bool}{<x:=e,σ> -> ()}
...
...
@@ -521,6 +584,14 @@ For the if statement to go through the type checker need the expression, e, be a
```
The example above is valid for the type checker due to it only checking that the expression is a boolean. The interpreter will not execute the block statement due to the expression being false.
##### Functioncall
```math
\frac{}{};
```
```rust
```
#### Coverage
The type checker rejects programs where:
...
...
@@ -530,6 +601,7 @@ The type checker rejects programs where:
- If and while statements does not have a boolean as an expression