Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris [email protected]...

45
Saint-Petersburg State University ITMO Projects in SPb IFMO 1 Yartsev Boris [email protected] Computer Technology Department, Saint-Petersburg State University of Information Technology, Mechanics and Optics. Russia Overview of the projects, developed by the students of SPb IFMO under the supervision of professor A.A.Shalyto

Transcript of Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris [email protected]...

Page 1: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 1

Yartsev [email protected]

Computer Technology Department,

Saint-Petersburg State University ofInformation Technology, Mechanics and Optics.

Russia

Overview of the projects, developed by the students of SPb IFMO under the supervision of professor A.A.Shalyto

Page 2: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 2

Projects in SPb IFMO

• Managed under the supervision of professor A.A.Shalyto

• Developed in the context of automata programming and open project documentation

• Are available from the Informatic Systems dept. site – http://is.ifmo.ru

Page 3: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 3

Project development

• Students work at the projects in the third year of studies

• During the third course students regulary meet their scientific advisor A.A.Shalyto and discuss new ideas and documentation

• There are 45 projects, that have already been developed, they are available from the site

• All the documentation is written in russian language. There is an abstract in english.

Page 4: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 4

Documentation structure

• Introduction• The formulating of the tasks• The description of the approach• Screenshots of the programs• Class diagrams• Automata documents• Conclusion• Source code

Page 5: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 5

Automata documents

For each automata:• Verbal description (declaration of intent)• Scheme of automata connections

(automata interfaces)• State transition diagram• Code, isomorphic to the diagramFor the whole system:• Scheme of automata intercommunication

Page 6: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 6

Overview of several projects

The most interesting and maniford

projects are presented here

Page 7: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 7

Examples of the projects

• Traffic lights controller

• SMTP protocol implementation

• CodeRally project

• Robocode project

• Automata graph designer

• Translator between different Japanese alphabets

Page 8: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 8

Traffic lights controller

• Developed by A. Distel and D. Kobak

• Demonstrates the simple critical object control program

• Handles the malfunctioning – automatically switches to blinking yellow

Page 9: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 9

Traffic lights controller

Page 10: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 10

Traffic lights controller

Page 11: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 11

Traffic lights. Conclusions

• Automata approach can be used in critical objects control

Page 12: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 12

SMTP protocol implementation

• K. Agafonov and D. Poroh implemented the SMTP protocol.

• Windows gui and command line client, Unix command line client and server

• Handles several exceptions – connect termination and server shutdown

Page 13: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 13

SMTP protocol implementation

• The usage of logging• Standartized logging protocol for all the

classes• Three modes – silent, full, only open/close

connection events. Different automata can be logged

• Via logging, one can quickly find the place in the code, where the execution went wrong.

Page 14: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 14

SMTP protocol implementation

Page 15: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 15

SMTP protocol implementation

Page 16: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 16

SMTP procotol implementation. Conclusions

• Automata approach can be used in server side programming

• Debugging of services is quite hard. Logging eases it

Page 17: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 17

CodeRally

• Developed by gold-winner of ACM 2003 finals Eugene Yuzhakov

• The game created by Alphaworks company (IBM)

• Emulates the track for several little cars• Cars acquire points by passing through

checkpoints and shooting• The winner is the car with maximum points

at the end of the round.

Page 18: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 18

Coderally

• In the documentation the author makes global strategy analysis, on which the code of the program is based.

• The analysis is supported by pictures, describing the way of movement as it is shown on the pictures

Page 19: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 19

Screenshot from the game

Page 20: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 20

Coderally

• Automata state transition diagram of the car controller.The states and events are named with short identificators

Page 21: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 21

Events and states

• The explanation is given before the graph in the following form –

• z0 – choosing the optimal checkpoint

• z1 – choosing the optimal trajectory

• z2 – moving towards the refuelling station

• e3 – the car was hit by the bullet

• ... And so on

Page 22: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 22

Coderally. Conclusions

• There was no open documentation available for this game

• The conclusion and the source code go at the end of the documentation.

• In the conclusion the author tells about the accomplishments and drawbacks of the project. The conclusion is created after the documentation has been written and the program has been developed

• The automata diagram for this project is simple, the main attention is paid to the mathematical aspect of the game

Page 23: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 23

Robocode ver. 1 and 2

• The Robocode project is pretty much the same as the CodeRally. But on it’s example the ease of refactoring of the open source code and open documentation can be shown.

• Robocode is the Java game, created by Alphaworks company (IBM). The aim is to program the artificial intelligence of the tank

Page 24: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 24

Robocode ver. 1 and 2

• Several tanks fight on the field

• They can shoot and move

• With radar they can scan the bullets and other tanks

• The winner is the tank, that destroys all other tanks.

Page 25: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 25

Robocode ver. 1 and 2

• Originally it was developed by N. I. Tukkel and A.A. Shalyto

• Then Denis Kuznetcov, the gold-winner of the 2001 ACM finals, modified the original version

• The ease of modification proved the advantages of open project documentation and automata programming

Page 26: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 26

Robocode ver. 1 and 2

Page 27: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 27

The graph model for the ver. 1

Page 28: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 28

The graph model for the ver. 2

Page 29: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 29

Robocode. Conclusions

• To modify the logic of the program there is no need to look through the source codes

• Such approach eases the support of the software in the companies

• The time needed for the adaptation of the new member of the team decreases

Page 30: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 30

Robocode. Conclusions

• Cynical was the best tank at the robocode competition for several weeks

• During the year it still remained in the top list of the tanks

• The authors aim was not the creation of the best tank in the world, they wanted to create the best technology in the world =)

Page 31: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 31

Robocode. Conclusions. Javadoc and OPD

Page 32: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 32

Robocode. Conclusions. Javadoc and OPD

Page 33: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 33

Robocode. Conclusions. Javadoc and OPD

• Javadoc does not provide the enough information for the developer to understand the logic of the program

• However javadoc can be used as the supporting tool

Page 34: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 34

Automata graph designer

• Developed by I. Anichkin

• Designed to work with automata graphs

• Faster and easier to use than Microsoft Visio and Rational software

Page 35: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 35

Automata graph designer

Page 36: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 36

Automata graph designer

Page 37: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 37

Automata graph designer. Conclusions

• GUI applications can be programmed with automata approach

Page 38: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 38

Japanese translator

• Developed by Ekaterina Lysenko and Pavel Skakov

• Four different system of written language in Japan

• The program makes the transliteration between the systems

Page 39: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 39

Japanese translator

• This translator shows, how the automata can deal with the strings and lexemes.

Page 40: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 40

Japanese translator

Page 41: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 41

Japanese translator

Page 42: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 42

Japanese translator. Conclusions

Page 43: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 43

Conclusions

• Simplicity needs projection and good taste. L. Torvalds

• It is a mistake to think that programmers wares are programs. Programmers have to produce trustworthy solutions and present it in the form of cogent arguments. Programs source code is just the accompanying material to which these arguments are to be applied to. E. Dijkstra

Page 44: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 44

Conclusions

• The introducted approach, as we think, satisfies the requirements given before.

Page 45: Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris yartsev@rain.ifmo.ru Computer Technology Department, Saint-Petersburg State.

Saint-PetersburgState University ITMO

Projects in SPb IFMO 45