Code Generation from UnParameterised Algebraic Specifications - PowerPoint PPT Presentation

1 / 22
About This Presentation
Title:

Code Generation from UnParameterised Algebraic Specifications

Description:

Consistency in coding style & architecture. More design time ... Prove correctness & consistency. High quality of software: User requirements well defined ... – PowerPoint PPT presentation

Number of Views:66
Avg rating:3.0/5.0
Slides: 23
Provided by: sing2
Category:

less

Transcript and Presenter's Notes

Title: Code Generation from UnParameterised Algebraic Specifications


1
Code Generation from (Un)Parameterised Algebraic
Specifications
  • Master Thesis Defence
  • Sudhanshu Singh
  • Supervisor Dr S. Sadaoui

2
Outline
  • Problem Statement
  • Solution
  • Code Generation Process
  • Code Generator Tool
  • Conclusion Future Work

3
1. Problem Statement
  • Incorrect code
  • Defects during testing phase
  • Knowledge domain
  • From user to programmer
  • Inconsistent code
  • Over budget
  • Poor quality
  • Loss of time, resources human life

4
2. Solution
  • Automatic Code Generation A way to generate
    code directly from specifications

Translation
UML Diagram
C Code
5
2.1 Benefits of Code Generation
  • High productivity, quality
  • Consistency in coding style architecture
  • More design time
  • Agile development
  • No ambiguities
  • Shorter and less error prone software life cycle
  • Easier maintenance

6
2.2 Specifications
  • Contract between clients and developers

Specification
Informal English, French, Dutch
Semi-Formal UML, DFD, ERD
Formal Process, Algebraic
7
2.3 Code Generation Types
  • Informal specifications to code
  • Ambiguities of natural languages
  • Different knowledge domains
  • Semi-formal specifications to code
  • Graphical notations to code
  • Correctness completeness difficult
  • Inappropriate tools
  • Formal specifications to code
  • Unambiguous, correct, consistent code

8
2.4 Formal Specifications
  • Prove correctness consistency
  • High quality of software
  • User requirements well defined
  • Simplified maintenance
  • Easy to obtain correct code from correct
    specifications

9
2.5 Code Generation Strategies
  • Term Rewriting Strategy
  • Specification Interpretation Strategy
  • Interpret specification to code
  • Generate tree structure
  • Abstract concepts to concrete concepts

Syntax Analyzer
Formal Specification
Transformation Engine
Program Code
10
3. Code Generation Process
  • 1. Specification Interpretation Strategy
  • Advantage Incremental approach, complete code
  • 2. Transformation approach
  • Syntactic Transformation Transforms syntactic
    part to skeletal code
  • Semantic Transformation Transforms the equations
    to generate first version of functions

11
3. Code Generation Process
  • 3. Source Language CafeOBJ
  • Parameterized programming, theorem prover
  • New formal specification language
  • An algebraic specification language
  • 4. Target Language Java 1.5
  • Parameterization instantiation
  • Platform Independence, neutral architecture,
    close correspondence

12
3. Code Generation Process

13
3.1 Syntactic Transformation

Module Parameterization Instantiation Record
Class
Sort Sub sorts
Data Type
Operation Predicate Behavioral
Method
Exception handling
Error handling
Inheritance
Inheritance
14
3.2 Semantic Transformation
  • Operations are segregated
  • Constructors determine generic methods
  • Non constructor determine methods
  • Number of equations determine the details

Generic Methods Java Method Details
CafeOBJ Equations
15
4. Code Generator Tool
  • C2J Code Generator prototyping tool
  • Development Environment
  • Windows XP, 2.8 GHZ, 20 GB Hard disk, 1 GB RAM
  • NetBeans 4.1

16
4.1 Compiler Structure
tokens
characters
code
Optimized code
17
4.2 Code Generation Process in C2J

GUI
Module in CafeOBJ
Scanner Parser
Analyzer
Syntactic Transformation
Code Generator
Java Code
Scanner Parser
Analyzer
Semantic Transformation
Code Generator
Improved Java Code
18
4.3 Graphical User Interface

Syntactic Transformation
19
4.3 Graphical User Interface

Semantic Transformation
20
5. Conclusions
  • Specification Interpretation Strategy and
    Compiler
  • Syntactic and Semantic Transformation Algorithms
  • Parameterization and Instantiation
  • Supporting tool C2J
  • Code Generation Process applicable to any
    algebraic specification language

21
6. Future Work
  • Include transition declaration
  • Include optimization algorithms
  • Develop an integrated system including theorem
    prover

22
Questions ?
Write a Comment
User Comments (0)
About PowerShow.com