Skip to content

Cours de Bachelor : Sémantique des Langages Informatiques

Notifications You must be signed in to change notification settings

cui-unige/semantique

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Cours de Bachelor : Sémantique des Langages Informatiques

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published