Cours de Bachelor : Sémantique des Langages Informatiques
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Sources/semantique Add homework 4. May 23, 2018
Tests
anno Add files via upload Jun 8, 2018
.gitignore
Ch1.pdf Add files via upload Feb 19, 2018
Ch10.pdf Add files via upload Apr 30, 2018
Ch11.pdf Add files via upload May 14, 2018
Ch2.pdf
Ch2bis.pdf Add files via upload Apr 9, 2018
Ch2new.pdf
Ch3 Syntaxe.pdf
Ch4.pdf Add files via upload Feb 26, 2018
Ch5.pdf Add files via upload Mar 6, 2018
Ch6.pdf Add files via upload Mar 15, 2018
Ch7.pdf Add files via upload Mar 26, 2018
Ch8.pdf
Ch9.pdf Add files via upload Apr 16, 2018
Examjune2017.pdf Add files via upload Jun 8, 2018
Package.swift Switch to LogicKit master. Mar 27, 2018
README.md Add homework 4. May 23, 2018
git-basics.pdf Git basics presentation May 9, 2018
install Fix permissions of installed swift. Feb 20, 2018
lang_a4.pdf Add files via upload Feb 19, 2018
resolution.pl Add files via upload Apr 23, 2018
rules.pl Add files via upload Apr 23, 2018
rulesrev.pl Add files via upload Apr 23, 2018
rulesrevtyped.pl
rundocker Indent the rundocker script. Feb 26, 2018
runvm Add docker/vm run scripts. Feb 26, 2018
vm-key Add docker/vm run scripts. Feb 26, 2018
vm-key.pub Add docker/vm run scripts. Feb 26, 2018

README.md

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.

Important Information and Links

Environment

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:

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

Rules

  • 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.

Homework

  • Use the command swift test to test your work.

Homework #1

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

Homework #2

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

Homework #3

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

Homework #4

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