Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework Georgiy Korneev Computer Technology Department,

Slides:



Advertisements
Similar presentations
Programming Languages and Paradigms
Advertisements

White Box and Black Box Testing Tor Stålhane. What is White Box testing White box testing is testing where we use the info available from the code of.
CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
Chapter 7 User-Defined Methods. Chapter Objectives  Understand how methods are used in Java programming  Learn about standard (predefined) methods and.
Chapter 1 - An Introduction to Computers and Problem Solving
Chapter 2 - Problem Solving
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Chapter 2 - Problem Solving
CS105 INTRODUCTION TO COMPUTER CONCEPTS INTRO TO PROGRAMMING Instructor: Cuong (Charlie) Pham.
Program Development Procedures 1.Program definition clearly define what the problem is. clearly define Input and output data (types, precision, units used)
SKELETON BASED PERFORMANCE PREDICTION ON SHARED NETWORKS Sukhdeep Sodhi Microsoft Corp Jaspal Subhlok University of Houston.
Automata Based Programming Anatoly Shalyto, Fedor Tsarev Saint-Petersburg State University of Information Technologies, Mechanics and Optics.
Linux Summit 2004, Helsinki Foundation for Open Project Documentation Anatoly Shalyto Lev Naumov Computer Technology.
Detailed Design Kenneth M. Anderson Lecture 21
The Programming Discipline Professor Stephen K. Kwan 2010 Things you need to know (learn) for developing large computer programs.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
Programming Fundamentals (750113) Ch1. Problem Solving
Chapter 8: Introduction to High-level Language Programming Invitation to Computer Science, C++ Version, Third Edition.
Automata-Based Programming Anatoly Shalyto Computer Technology Department Saint-Petersburg State University of Information Technology,
Chapter 8: Introduction to High-Level Language Programming Invitation to Computer Science, C++ Version, Fourth Edition.
Problem Solving Chapter 2. What is an algorithm? n A solution to a problem that is: –Precise –Effective –Terminating.
Using Use Case Scenarios and Operational Variables for Generating Test Objectives Javier J. Gutiérrez María José Escalona Manuel Mejías Arturo H. Torres.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
Methods of teaching programming at high schools and universities Vera Dron,
Final Exam Review Instructor : Yuan Long CSC2010 Introduction to Computer Science Apr. 23, 2013.
Introduction 01_intro.ppt
1 Shawlands Academy Higher Computing Software Development Unit.
Implementation Yaodong Bi. Introduction to Implementation Purposes of Implementation – Plan the system integrations required in each iteration – Distribute.
CSC141 Introduction to Computer Programming
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Lucas Bang Lecture 7: One More Loop Problem, Generating “random” values, Midterm Review.
Introduction to Software Design Chapter 1. Chapter Objectives  To become familiar with the software challenge and the software life cycle  To understand.
1 The Software Development Process  Systems analysis  Systems design  Implementation  Testing  Documentation  Evaluation  Maintenance.
Programming Concepts Chapter 3.
CSE 219 Computer Science III Program Design Principles.
Saint-Petersburg State University ITMO 1Projects in SPb IFMO Yartsev Boris Computer Technology Department, Saint-Petersburg State.
1 Introduction to Software Engineering Lecture 1.
Introduction to Software Development. Systems Life Cycle Analysis  Collect and examine data  Analyze current system and data flow Design  Plan your.
UHD::3320::CH121 DESIGN PHASE Chapter 12. UHD::3320::CH122 Design Phase Two Aspects –Actions which operate on data –Data on which actions operate Two.
Chapter 2: General Problem Solving Concepts
Hassen Grati, Houari Sahraoui, Pierre Poulin DIRO, Université de Montréal Extracting Sequence Diagrams from Execution Traces using Interactive Visualization.
The Software Development Process
Holistic Mobile Game Development with Unity 2015 Taylor & Francis. All rights Reserved.
PROGRAM DEVELOPMENT CYCLE. Problem Statement: Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this.
1 Program Planning and Design Important stages before actual program is written.
Theory and Practice of Software Testing
Chapter 2 - VB 2005 by Schneider- modified by S. Jane '081 Chapter 2 - Problem Solving 2.1 Program Development Cycle 2.2 Programming Tools.
ANALYSIS PHASE OF BUSINESS SYSTEM DEVELOPMENT METHODOLOGY.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
Constructs for Data Organization and Program Control, Scope, Binding, and Parameter Passing. Expression Evaluation.
CS Class 04 Topics  Selection statement – IF  Expressions  More practice writing simple C++ programs Announcements  Read pages for next.
CMSC 104, Section 301, Fall Lecture 18, 11/11/02 Functions, Part 1 of 3 Topics Using Predefined Functions Programmer-Defined Functions Using Input.
How Computers Solve Problems Computers also use Algorithms to solve problems, and change data into information Computers can only perform one simple step.
Software Testing.
Unit 3: ALGORITHMS AND FLOWCHARTS
Unified Modeling Language
Engineering and Debugging an App Chapter 15
Summary of lectures Introduction to Algorithm Analysis and Design (Chapter 1-3). Lecture Slides Recurrence and Master Theorem (Chapter 4). Lecture Slides.
Loops CS140: Introduction to Computing 1 Savitch Chapter 4 Flow of Control: Loops 9/18/13 9/23/13.
Design and Analysis of Algorithms (07 Credits / 4 hours per week)
Unit# 9: Computer Program Development
University of Houston-Clear Lake
Programming Fundamentals (750113) Ch1. Problem Solving
Programming Fundamentals (750113) Ch1. Problem Solving
Chapter 7 Writing the Programs Shari L. Pfleeger Joann M. Atlee 4th Edition.
Programming Fundamentals (750113) Ch1. Problem Solving
Programming Fundamentals (750113) Ch1. Problem Solving
Design and Analysis of Algorithms (04 Credits / 4 hours per week)
Chapter 1: Creating a Program.
Presentation transcript:

Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework Georgiy Korneev Computer Technology Department, Saint-Petersburg State University of Information Technology, Mechanics and Optics, Russia

2 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — What is visualizer?

3 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Visualizers advantages Better algorithms understandability Dynamic content User can choose input data Forward and backward tracing Detailed comments

4 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Visualizer requirements Interface simplicity Show all algorithm stages and special cases Clear comments for all stages Hints for every visualizer element Big and small steps Automated execution

5 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Visualizers history in ITMO Sergey Stolyar Initial stage ( ) Matvey Kazakov Transitional stage ( ) Georgiy Korneev Evolution stage ( ) Industrial stage ( )

6 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Initial stage First attempts Visualizers in Borland Delphi Handmade user interface Handmade visualizers logic Less than ten visualizers were made Very slow development Lots of errors

7 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Transitional stage Visualizers in Java (applets) Similar user interfaces First attempts in reversing About 15 visualizers Slow development Less errors

8 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Evolution stage Common user interfaces (BaseApplet library) Common configuration Template-based logic All visualizers are reversible More than 50 visualizers Fast GUI development Difficulties in reversing

9 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Industrial stage Standard user interface Automated code generation Automated program reverse More than 200 visualizers Fast logic development Automated reverse Quick development

10 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Vizi visualization technology Visual representation library Logic definition language Visualizer programming methodology Standard project execution flow Documentation infrastructure Vizi visualization framework binds it together

11 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Standard interface (1) Drawing area Comment area Controls area

12 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Standard interface (2) About Automated execution delay ForwardBackwardAuto execution mode Restart RandomizeNumber of elements Save/load dialog

13 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Logic definition language XML-based Program-like Auto-commented Auto documentation generation

14 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Visualizer programming Methodology Based on Switch-technology Formal program transformation Automated source code generation Model-View-Controller paradigm

15 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Switch-technology in visualization Proposed by Anatoly Shalyto (1991) First application for visualizers Matvey Kazakov (2002) Implementation Block diagrams Automata transition diagram Automata-based visualizer programming Visualization and reversing technology Georgiy Korneev (2003)

16 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Switch-technology in Vizi Correlated automata systems Automata pair for each procedure Automata pair Forward transition graph Backward transition graph Shared automata states

17 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Formal program transformations

18 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Automated source code generation

19 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Model-View-Controller paradigm Model Auto-generated correlated automata system View User interface based on Vizi library Controller Vizi library

20 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Algorithm reversing problem Backward tracing is very useful for education Repeatable forward-backward navigation How get one step back?

21 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Algorithm reversing problem solutions Per-step save/load technique High memory requirements Program re-execution Low execution speed Program reverse Average memory requirements High execution speed

22 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Program reversing difficulties Two versions of program for forward tracing for backward tracing Algorithm development for backward tracing Programs must be synchronized Complex modification Hard debugging

23 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Automated program reversing One version of program (XML-source) One-way debugging :TODO:

24 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Project execution flow Algorithm implementation Program structure simplification Data model extraction Transformation to correlated automata system Code generation

25 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Algorithm implementation Algorithm is implemented using structural language Implementation source code is an input for other stages

26 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Program structure simplification Most of programming languages are too complicated for automated transformations Program should use only simple programming structures Structuring theorem Formal structure simplification for Java

27 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Allowed structures Statements sequence Assignment statement Short conditional statement Full conditional statement “While” loop Procedure call

28 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Data model extraction Data model contains all variables Data model fully represents algorithm state All data flows going through data model Formal data model extraction

29 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Transformation into correlated automata system Correlated automata systems Pairwise automatas Formal and automated program transformation More information available at

30 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Project documentation (1) Annotation Short project description Introduction Brief algorithm description Algorithm applications Usage examples Chapter 1. Literature analysis References and comments

31 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Project documentation (2) Chapter 2. Algorithm description Complete algorithm descriptions Special cases analysis Chapter 3. Algorithm implementation Implementation comments Decision ground Chapter 4. Implementation simplification Simplified implementation

32 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Project documentation (3) Chapter 5. Data model definition Descriptions of data model variables Chapter 6. “Interesting” stages definition Implementation is divided into “interesting” stages Comments for “interesting” stages Chapter 7. User Interface Description Pictures for each “interesting” stage Controls descriptions

33 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Project documentation (4) Chapter 8. Configuration Description Complete configuration description Initial configuration Conclusions Visualizer properties References

34 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Project documentation (5) Appendixes Algorithm Implementations Source Code Transformed Implementation Visualizer XML-description Generated Source Codes User Interfaces Source Codes

35 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Simple algorithm example “FindMaximum” algorithm

36 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — FindMaximum Algorithm implementation int max = 0; for (int i = 0; i < a.length; i++) { if (max < a[i]) { max = a[i]; }

37 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — FindMaximum Simplified implementation max = 0; i = 0; while (i < a.length) { if (max < a[i]) { max = a[i]; } i++; }

38 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — FindMaximum Data model public final static class Data { public int max; public int i; public int a[]; }

39 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — FindMaximum Transformed implementation d.max = 0; d.i = 0; while (d.i < d.a.length) { if (d.max < d.a[d.i]) { d.max = d.a[d.i]; } d.i++; }

40 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — FindMaximum Transformation to automata (1) Initialization

41 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — FindMaximum Transformation to automata (2) If statement

42 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — FindMaximum Transformation to automata (3) Full automata

43 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — FindMaximum Reversed automata

44 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — @i + 1;

45 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — FindMaximum Generated sources extract switch (state) {... case 1: { // Initialization state = 2; // Loop init break; } case 2: { // Loop init state = 3; // Loop break; } case 3: { // Loop if (Main_i < a.length) { state = 4; // If } else { state = END_STATE; } break; } case 4: { // if if (max < a[Main_i]) { state = 6; // Update } else { state = 5; // End if } break; } case 5: { // End if state = 7; // Increment break; } case 6: { // Update max = a[Main_i] state = 5; // End if break; } case 7: { // Increment Main_i++; state = 3; // Loop break; }

46 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Find maximum Statistics Automata2 States9 Automata implementation326 lines

47 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Complex algorithm example Malhotra, Kumar, Maheshwari maximal flow algorithm

48 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Malhotra, Kumar, Maheshwari Statistics Automata18 States107 Automata implementation4069 lines

49 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — More examples Dinic’s network flow algorithm Hopcroft-Karp Bipartite Matching algorithm Chu-Liu shortest arborescence of a directed graph Algorithms on 2-3 threes Bitonic salesman problem Ukkonen suffix tree construction algorithm Prim minimum spanning tree algorithm Simple strings and deBruin cycles construction algorithms …

50 Saint-Petersburg State University ITMO Automata-based Algorithms Visualization Framework — Links Vizi project homepage Old visualizers examples Visualizer-related switch-technology information