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.
This course requires the following mandatory environment. We have taken great care to make it as simple as possible.
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)
and didierbuchs
(Didier Buchs).
The environment you installed contains:
Make sure that your repository is up-to-date by running frequently:
git fetch upstream
git merge upstream/master
rm -rf .build Package.resolved
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
;Evaluation will be:
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
;Evaluation will be:
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
;Evaluation will be:
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
;Evaluation will be:
Grade |
---|