Semantics of Programming Languages @ University of Geneva
This repository contains important information about this course. Do not forget to watch it as it will allow us to send notifications for events, such as new exercises, homework, slides or fixes.
- Page on Moodle
- Page on GitHub
- The Anzen Programming Language
- The LogicKit Library
- Courses are Monday 16:00 - 18:00
- Exercises are Tuesday 10:00 - 12:00
This course requires the following mandatory environment. We have taken great care to make it as simple as possible.
- Moodle Check that you are registered in the "Sémantique" classroom; we will not use it afterwards.
- GitHub: a source code hosting platform that we will for the exercises and homework. Create an account, and do not forget to fill your profile with your full name and your University email address. Ask GitHub for a Student Pack to obtain free private repositories.
- MacOS High Sierra or Ubuntu 16.04 LTS 64bits, in a virtual machine, using for instance VirtualBox, or directly with a dual boot.
You also have to:
-
Watch the course page to get notifications about the course.
-
Create a private repository named
semantique
(exactly). -
git clone https://github.com/cui-unige/semantique.git
-
Duplicate the course repository into your private one
cd semantique git push --mirror https://github.com/yourusername/semantique.git
-
Update the repository information
atom .git/config
And replace
cui-unige
by your GitHub username. -
Set the upstream repository:
git remote add upstream https://github.com/cui-unige/semantique.git
-
Run the following script to install dependencies:
./install
-
Add as collaborators the users:
saucisson
(Alban Linard) anddidierbuchs
(Didier Buchs).
The environment you installed contains:
- Git: the tool for source code management;
- Swift: the programming language that we will use;
- Atom: the editor we will use. On the first launch, Atom may ask to install some missing modules. Do not forget to accept, or your environment will be broken.
Make sure that your repository is up-to-date by running frequently:
git fetch upstream
git merge upstream/master
rm -rf .build Package.resolved
- You must do your homework in your private fork of the course repository.
- You must fill your full name in your GitHub profile.
- If for any reason you have trouble with the deadline, contact your teacher as soon as possible.
- We must have access to your source code, that must be private.
- You code must compile without any error or warning.
- Use the command
swift test
to test your work.
The goal of this homework is to implement the propagation of constant expressions within Anzen module declarations. You have to perform propagation by updating the abstract syntax tree directly, using a visitor.
You have to handle the following constructions in the abstract syntax tree:
ModuleDecl
;Literal<Bool>
;Literal<Int>
;Literal<String>
;PropDecl
;BindingStmt
;IfExpr
;BinExpr
;UnExpr
;FunDecl
;CallExpr
;- and of course the other classes that are used by the ones listed above.
Evaluation will be:
- have you done anything at the deadline?
(yes: 1 point, no: 0 point)
- Done anything
- have you correctly written your code?
(yes: 1 point, no: 0 point)
- Coding standards
- have you understood and implemented all the required notions?
(all: 4 points, none: 0 point)
- Update of module
- Knowledge base
Grade |
---|
The goal of this homework is to implement the checking of type correctness within Anzen module declarations. You have to perform the check by creating a logic program using LogicKit within a visitor. The logic program must return at least one answer if the typing is correct, and no answer if the typing is incorrect.
You have to handle the following constructions in the abstract syntax tree:
ModuleDecl
;Literal<Bool>
;Literal<Int>
;Literal<String>
;PropDecl
;BindingStmt
;IfExpr
;BinExpr
;UnExpr
;FunDecl
;CallExpr
;- and of course the other classes that are used by the ones listed above.
Evaluation will be:
- have you done anything at the deadline?
(yes: 1 point, no: 0 point)
- Done anything
- have you correctly written your code?
(yes: 1 point, no: 0 point)
- Coding standards
- have you understood and implemented all the required notions?
(all: 4 points, none: 0 point)
- Knowledge base
Grade |
---|
The goal of this homework is to implement an interpreter of the Anzen programming language. You have to perform interpretation in Swift (not LogicKit) within a visitor.
You have to handle the following constructions in the abstract syntax tree:
ModuleDecl
;Literal<Bool>
;Literal<Int>
;Literal<String>
;PropDecl
;BindingStmt
;IfExpr
;BinExpr
;UnExpr
;FunDecl
;CallExpr
;- and of course the other classes that are used by the ones listed above.
Evaluation will be:
- have you done anything at the deadline?
(yes: 1 point, no: 0 point)
- Done anything
- have you correctly written your code?
(yes: 1 point, no: 0 point)
- Coding standards
- have you understood and implemented all the required notions?
(all: 4 points, none: 0 point)
- Answers
Grade |
---|
The goal of this homework is to implement a check of accesses to references
for the Anzen programming language.
You have to perform interpretation in Swift (not LogicKit) within a visitor.
Remember that Anzen has three operators: =
for copy, &-
for reference,
and <-
for ownership.
You have to handle the following constructions in the abstract syntax tree:
ModuleDecl
;Literal<Bool>
;Literal<Int>
;Literal<String>
;PropDecl
;BindingStmt
;IfExpr
;BinExpr
;UnExpr
;FunDecl
;CallExpr
;- and of course the other classes that are used by the ones listed above.
Evaluation will be:
- have you done anything at the deadline?
(yes: 1 point, no: 0 point)
- Done anything
- have you correctly written your code?
(yes: 1 point, no: 0 point)
- Coding standards
- have you understood and implemented all the required notions?
(all: 4 points, none: 0 point)
- Answers
Grade |
---|