Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
D7050E
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
Model registry
Operate
Environments
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
Aron Strandberg
D7050E
Commits
65f979a7
Commit
65f979a7
authored
5 years ago
by
Aron Strandberg
Browse files
Options
Downloads
Patches
Plain Diff
started with SOS, bit tricky with symbols..
parent
0bac8ed6
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
HOME_EXAM.md
+31
-2
31 additions, 2 deletions
HOME_EXAM.md
with
31 additions
and
2 deletions
HOME_EXAM.md
+
31
−
2
View file @
65f979a7
...
...
@@ -142,14 +142,14 @@ White_space
Showcase
```
rust
fn
test_i32
(
b
:
i32
)
->
i32
{
fn
test_i32
(
b
:
i32
,
c
:
i32
)
->
i32
{
let
a
:
i32
=
10
+
2
*
3
;
a
=
-
1
-
(
1
-
1
);
return
a
+
b
;
}
fn
test_bool
(
b
:
bool
)
->
bool
{
if
b
&&
true
||
false
{
let
a
:
i32
=
test_i32
(
1
);
let
a
:
i32
=
test_i32
(
1
,
999
);
while
(
a
<
5
)
{
a
=
a
+
1
;
}
...
...
@@ -185,6 +185,35 @@ For furture development
-
Compare your solution to the requirements (as stated in the README.md). What are your contributions to the implementation.
Structural Operational Semantics (SOS)
Symbolx:
-
σ, state
-
σ', derived state
-
⇓, evaluates
-
c, command
-
x, variable
-
e, expression
-
b, boolean expression
Command sequence
$
\f
rac{
<c1
,
σ
>
⇓ σ'
<c2
,
σ
'
>
⇓ σ''}{
<c1
;
c2
,
σ
>
⇓ σ''}$
Arithmetic
$
\f
rac{
<e1
,
σ
>
⇓ n1
<e2
,
σ
>
⇓ n2}{
<e1
+
e2
,
σ
>
⇓ n1 plus n2}$
If true
$
\f
rac{
<b
,
σ
>
⇓ true
<c1
,
σ
>
⇓ σ'}{
<if
b
then
c1
>
⇓ σ}$
If false
$
\f
rac{
<b
,
σ
>
⇓ false
<c1
,
σ
>
⇓ σ'}{
<if
b
then
c1
>
⇓ σ}$
## Your type checker
-
Give an as complete as possible set of Type Checking Rules for your language (those rules look very much like the SOS rules, but over types not values).
...
...
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