Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
D7050E_2020
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Wilma Krutrök
D7050E_2020
Commits
d8a7530d
Commit
d8a7530d
authored
4 years ago
by
Wilma Krutrök
Browse files
Options
Downloads
Patches
Plain Diff
Update HOME_EXAM.md
parent
231f014c
Branches
master
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
HOME_EXAM.md
+3
-4
3 additions, 4 deletions
HOME_EXAM.md
with
3 additions
and
4 deletions
HOME_EXAM.md
+
3
−
4
View file @
d8a7530d
...
@@ -93,7 +93,6 @@ Program
...
@@ -93,7 +93,6 @@ Program
```
ebnf
```
ebnf
Function
Function
:"fn" Id "(" (Arg ",")* Arg? ")" "->" Type BlockExpr
:"fn" Id "(" (Arg ",")* Arg? ")" "->" Type BlockExpr
|"fn" Id "()" "->" "()" BlockExpr
;
;
```
```
...
@@ -443,7 +442,7 @@ Let statements works in a similiar way.
...
@@ -443,7 +442,7 @@ Let statements works in a similiar way.
##### Functioncall
##### Functioncall
```
math
```
math
\frac{(<e_1,σ> → n_1 ... <e_i,σ> → n_i) → σ
(
arg1 := n_1, ..., argi := n_i
))
}{<c,σ> → (
x
,σ')}; \text{where
x
is the return value}
\frac{(<e_1,σ> → n_1 ... <e_i,σ> → n_i) → σ
[
arg
_
1 := n_1, ..., arg
_
i := n_i
]
}{<
f.
c,σ> → (
v
,σ')}; \text{where
v
is the return value}
```
```
```
rust
```
rust
...
@@ -561,7 +560,7 @@ fn b() -> bool {
...
@@ -561,7 +560,7 @@ fn b() -> bool {
##### Conditional command
##### Conditional command
```
math
```
math
\frac{<e,σ> → \text{ bool } <c0,σ> → t}{<\text{ if e then } c0 \text{ else } c1,σ> → t}, \text{ where t = type of last statement }
\frac{<e,σ> → \text{ bool } <c0,σ> →
t <c1,σ> →
t}{<\text{ if e then } c0 \text{ else } c1,σ> → t}, \text{ where t = type of last statement }
```
```
For the if statement to go through the type checker need the expression, e, be a boolean.
For the if statement to go through the type checker need the expression, e, be a boolean.
...
@@ -592,7 +591,7 @@ The example above is valid for the type checker due to it only checking that the
...
@@ -592,7 +591,7 @@ The example above is valid for the type checker due to it only checking that the
##### Functioncall
##### Functioncall
```
math
```
math
\frac{<e_1,σ> → t_1 ... <e_i,σ> → t_i}{<c,σ> →
t-res
}, \text{ where }
t-res
= \text{return type of function }
\frac{<e_1,σ> → t_1 ... <e_i,σ> → t_i
σ[arg_1 == t_1, ..., arg_i == t_i]
}{<
f.
c,σ> →
f.t
}, \text{ where }
f.t
= \text{return type of function }
```
```
Each expression evaluating to the same type as the arguments connected to the function.
Each expression evaluating to the same type as the arguments connected to the function.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment