Upload
ada-fleming
View
221
Download
0
Tags:
Embed Size (px)
Citation preview
Objectification of Formal SpecificationsObjectification of Formal Specifications
António Miguel Cruz ([email protected])
1st PURe Workshop – 13,14 September 2004
Tel.: +351.22.6053360 ; Fax.: +351.22.6053361; E-Mail: [email protected] ; URL: http://www.sidereus.pt
sidereuswww.sidereus.pt
Rigorous Solutions for Software SystemsCompany Profile
Company ProfileUniv. do Minho & INESC Braga startup company (1997)
Mixed solutions for different kinds of activities, supported by a strong technological know-how in the following domains: Data Quality and Migration, Customer Relationship Management (CRM), Business Intelligence (BI) and Knowledge Management (KM)
Scientific, tecnhological and industry know-how
Offer focused on Microsoft technology
Highly competitive quality/price ratios
Full client partnerhships covering analysis, design, implementation and maintenance phases
R&D activities with both national (Univ. do Minho, Fac. Eng. do Porto) and international (AAlborg University Esbjerg, Dept of Computer Science and Engineering - Dinamarca, Universidade de Bristol - U.K.) universities and leadership of Portuguese participations in European projects co-financed by the Portuguese Government and EU.
Fully engaged with projects associated with the initiative Portugal Digital which includes, among others, all the cidades e regiões digitais projects.
SoftwareReuse (1995)
DataQuality (2001)
KnowledgeManagement (2005)
sidereuswww.sidereus.pt
Rigorous Solutions for Software SystemsCompany Profile
References• CRMCRM
– ANIVEC – Associação Nacional das ANIVEC – Associação Nacional das Indústrias de Vestuário e ConfecçãoIndústrias de Vestuário e Confecção
– LUSAMATEX – Máquinas TexteisLUSAMATEX – Máquinas Texteis• CRM Retail (works with PDA’s and GPRS CRM Retail (works with PDA’s and GPRS
communications)communications)– EXCEDER/FIMA-UNILEVEREXCEDER/FIMA-UNILEVER– EXCEDER/SOGRAPEEXCEDER/SOGRAPE
• CRM, Reclamation Management, Process CRM, Reclamation Management, Process Management and Document ManagementManagement and Document Management
– C. M. Maia (Maia Digital)C. M. Maia (Maia Digital)– C. M. Porto (Porto Digital)C. M. Porto (Porto Digital)
• Temporal DatabasesTemporal Databases– SONAE e OPTIMUSSONAE e OPTIMUS
• CD-ROM da Rev. ConstitucionalCD-ROM da Rev. Constitucional– Ed. Notícias e MicrosoftEd. Notícias e Microsoft
• Healthcare Information Systems, Decision Healthcare Information Systems, Decision Support Systems, Data Quality and Data Support Systems, Data Quality and Data MigrationMigration
– NovabaseNovabase• E-Learning and Knowledge ManagementE-Learning and Knowledge Management
– AEP, GESTLUZAEP, GESTLUZ
sidereuswww.sidereus.pt
Rigorous Solutions for Software SystemsCompany Profile
Partnerships
• IndustryIndustry– E-LearningE-Learning
• AEP - Associação Empresarial PortuguesaAEP - Associação Empresarial Portuguesa• GESTLUZ - Consultores de Gestão, Lda.GESTLUZ - Consultores de Gestão, Lda.
• TechnologyTechnology– Geo-referenciation and mobilityGeo-referenciation and mobility
• ParadigmaXis - Arquitectura e Engenharia de Software S.A. ParadigmaXis - Arquitectura e Engenharia de Software S.A. – Quiosques multimédiaQuiosques multimédia
• Imediata - Sistemas Multimedia S.A. Imediata - Sistemas Multimedia S.A. – System AdministrationSystem Administration
• EuroTux Informática S.A. EuroTux Informática S.A. – MethodsMethods
• Dept. Informatica, Univ. Minho, Formal Methods Group Dept. Informatica, Univ. Minho, Formal Methods Group – TechnologiesTechnologies
• Microsoft (Portugal)Microsoft (Portugal)
• Research & DevelopmentResearch & Development– Methodologies and PrototypingMethodologies and Prototyping
• Departamento de Informática, Universidade do MinhoDepartamento de Informática, Universidade do Minho• University of Bristol (UK) Computer Science DepartementUniversity of Bristol (UK) Computer Science Departement
– Fuzzy SystemsFuzzy Systems• Laboratory for Knowledge Technology, Department of Computer Science and Laboratory for Knowledge Technology, Department of Computer Science and
Engineering, AAlborg University Esbjerg (Denmark) Department of Computer Science Engineering, AAlborg University Esbjerg (Denmark) Department of Computer Science and Engineeringand Engineering
sidereuswww.sidereus.pt
Rigorous Solutions for Software SystemsCompany Profile
Consortia• IKF (Eureka!2235)IKF (Eureka!2235)
– NOMOS SISTEMA S.p.A. (Milano - Italy) NOMOS SISTEMA S.p.A. (Milano - Italy) – O.GROUP TECHNOLOGY S.p.A. (Milano - Italy) O.GROUP TECHNOLOGY S.p.A. (Milano - Italy) – ACSEs.r.l. (Milano - Italy) ACSEs.r.l. (Milano - Italy) – ELSAG BANKLAB S.p.A. (Roma - Italy) ELSAG BANKLAB S.p.A. (Roma - Italy) – SELESTA AUDITING s.r.l. (Milano - Italy) SELESTA AUDITING s.r.l. (Milano - Italy) – LADSEB-CNR (Padova - Italy) LADSEB-CNR (Padova - Italy) – UNIVERSITA' DI MILANO (Milano - Italy) UNIVERSITA' DI MILANO (Milano - Italy) – UNIVERSITA' DEL SANNIO (Benevento - Italy) UNIVERSITA' DEL SANNIO (Benevento - Italy) – SIDEREUS - Sistemas de Informação e Consultoria SIDEREUS - Sistemas de Informação e Consultoria
Informática S.A. (Porto - Portugal)Informática S.A. (Porto - Portugal) – University of Minho (Portugal) Informatics University of Minho (Portugal) Informatics
Departement Departement – ParadigmaXis - Arquitectura e Engenharia de Software ParadigmaXis - Arquitectura e Engenharia de Software
S.A. S.A. – AEP - Associação Empresarial Portuguesa AEP - Associação Empresarial Portuguesa – GESTLUZ - Consultores de Gestão, Lda. GESTLUZ - Consultores de Gestão, Lda. – APPLAI Ltd (Altrincham - Cheshire UK) APPLAI Ltd (Altrincham - Cheshire UK) – XHP Consulting Ltd (Stroud - UK) XHP Consulting Ltd (Stroud - UK) – MATH-TECH Aps (Copenhagen - Denmark) MATH-TECH Aps (Copenhagen - Denmark) – ARTEMA MEC A/S (Albertslund - Denmark) ARTEMA MEC A/S (Albertslund - Denmark) – ADAPTIVE COMPUTER SYSTEMS (Copenhagen - ADAPTIVE COMPUTER SYSTEMS (Copenhagen -
Denmark) Denmark) – ML CONSULTING AND COMPUTING Ltd (Budapest - ML CONSULTING AND COMPUTING Ltd (Budapest -
Hungary) Hungary) – MORPHOLOGIC Ltd (Budapest - Hungary) MORPHOLOGIC Ltd (Budapest - Hungary) – TECHNICAL UNIVERSITY OF BUDAPEST - Dept. of TECHNICAL UNIVERSITY OF BUDAPEST - Dept. of
Meas. and Inf. Systems (Budapest - Hungary) Meas. and Inf. Systems (Budapest - Hungary) – BUDAPEST UNIVERSITY OF ECONOMIC SCIENCE - BUDAPEST UNIVERSITY OF ECONOMIC SCIENCE -
Tech. Transfer Center (Budapest - Hungary) Tech. Transfer Center (Budapest - Hungary) – POLITEHNICA UNIVERSITY OF BUCHAREST - ACPC POLITEHNICA UNIVERSITY OF BUCHAREST - ACPC
(Bucharest - Romania) (Bucharest - Romania) – OLISOFTROM srl (Bucharest - Romania) OLISOFTROM srl (Bucharest - Romania) – A&C INTERNATIONAL S.A. (Bucharest - Romania) A&C INTERNATIONAL S.A. (Bucharest - Romania) – NATIONAL AGENCY FOR COMMUNICATION AND NATIONAL AGENCY FOR COMMUNICATION AND
INFORMATION (Bucharest - Romania) INFORMATION (Bucharest - Romania)
• ForTia (Formal Techniques Industrial ForTia (Formal Techniques Industrial Association)Association)
– Adelard, London, UK Adelard, London, UK – Alstom Transport, Saint Ouen, France Alstom Transport, Saint Ouen, France – ATS, Chennai, India ATS, Chennai, India – ATX Software, Linda-a-Velha, Portugal ATX Software, Linda-a-Velha, Portugal – Banverket, Borlänge, Sweden Banverket, Borlänge, Sweden – Chess, Haarlem, Netherlands Chess, Haarlem, Netherlands – Clearsy, Aix-en-Provence, France Clearsy, Aix-en-Provence, France – Escher Technologies, Aldershot, UK Escher Technologies, Aldershot, UK – Formal Systems, Oxford, UK Formal Systems, Oxford, UK – France Télécom, Lannion, France France Télécom, Lannion, France – IFAD, Odense, Denmark IFAD, Odense, Denmark – Industrilogik L4i, Stockholm, Sweden Industrilogik L4i, Stockholm, Sweden – Institute of System Programming, Russian Academy of Institute of System Programming, Russian Academy of
Sciences, Moscow, Russia Sciences, Moscow, Russia – INTECS, Pisa, Italy INTECS, Pisa, Italy – JFITS, Tokyo, Japan JFITS, Tokyo, Japan – Kestrel Institute, Palo Alto, USA Kestrel Institute, Palo Alto, USA – Luxoft, Moscow, Russia Luxoft, Moscow, Russia – Maconomy, Copenhagen, Denmark Maconomy, Copenhagen, Denmark – Niklas Holsti (new company to be announced), Espoo, Niklas Holsti (new company to be announced), Espoo,
Finland Finland – Nokia, Helsinki, Finland Nokia, Helsinki, Finland – ORA, Ottawa, Canada ORA, Ottawa, Canada – OTE, Pisa, Italy OTE, Pisa, Italy – Praxis Critical Systems plc, Bath, UK Praxis Critical Systems plc, Bath, UK – Qinetiq, Farnborough, UK Qinetiq, Farnborough, UK – Railway Technical Research Institute, Tokyo, Japan Railway Technical Research Institute, Tokyo, Japan – SIDEREUS, Porto, PortugalSIDEREUS, Porto, Portugal – Siemens Research, Munich, Germany Siemens Research, Munich, Germany – SRA, Tokyo, Japan SRA, Tokyo, Japan – Systransis, Luzern, Switerland Systransis, Luzern, Switerland – Terma Space Division, Birkerød, Denmark Terma Space Division, Birkerød, Denmark – TriReme International Ltd., Stockport, UK TriReme International Ltd., Stockport, UK – Trusted Logic, Sophia Antipolis, France Trusted Logic, Sophia Antipolis, France – West Consulting, Delft, NetherlandsWest Consulting, Delft, Netherlands
sidereuswww.sidereus.pt
Rigorous Solutions for Software SystemsCompany Profile
Products and Solutions
BackOffice CRM – Customer Relationship Management
BackOffice SGR – Reclamation and Suggestion Management
BackOffice RTL – CRM for Distribution and Retail
BackOffice DOC – Document and Quality Processes Management
BackOffice IKF – Knowledge Management and E-Learning
Objectification of Formal Specifications
PURe ProjectProgram Understanding and Re-engineering – Calculi and Applications
António Miguel [email protected]
PURe Workshop – 13, 14 September 2004
Universidade do Minho
Objectification of Formal Specifications
• Introduction
• Related Work (reverse engineering / OO reengineering)
• Example
• Objectification Criteria
• The Objectifier
• Conclusions and Future Work
Introduction
• Problems:– Legacy code maintenance (aiding in
Knowledge recovery).
– Legacy code restructuring.
– OO Implementation of a purelly functional specification.
Introduction
Introduction
• Why VDM ?– VDM-SL is a systematic method for formal
specification of software systems (ISO standard since 1996).
– VDM++ is an object oriented extension of VDM-SL.
– Both VDM-SL and VDM++ can be “animated” using the IFAD VDM Tools.
ISO/IEC 13817-1
Related Work
• Methodology for converting conventional code onto object oriented code [GKM95,GK96,BG97,GW98].
Converts procedural code onto object oriented code provided that the target programming language is an extention of the original non-object-oriented language.
The transformation process takes place at source code level and it reuses the original code introducing the minimum alterations possible.
The work is based on an expert knowledge of the system.
Related Work
• Methodology for reverse engineering existing procedural code based on a diagramatic representation of the original system [CA93].
This methodology is based on the diagramatic representation of the system using a reversed object oriented analysis done by experts with knowledge about the original system.
The diagrams are the basis for the formal specification of the system.
Related Work
• Reverse engineering of C code, using Formal Methods [GC93,GC96a,GC96b].
This methodology makes use of predicate logic for creating an abstraction of the system based on its logic properties.
The process was initially based on the weakest precondition [GC93], but was then altered to work with the strongest postcondition [GC96a].
In [GC93], a method for identifying objects within the logic abstraction of the system, is also addressed.
Related Work
• Program Slicing [Ste99].
Program slicing is traditionally used for debugging.
It has the following variants:
• Static Slicing / Dynamic Slicing
• Forward Slicing / Backward Slicing
• Intraprocedural Slicing / Interprocedural Slicing
Related Work
• Program Slicing [Ste99].
Related Work
• Program Slicing [Ste99].
Related Work
• Program Slicing [Ste99].
Related Work
• Program Slicing [BBL93b].
Program slicing is also used for code restructuring towards the object oriented paradigm.
It can be used to transform a program in a given language to an object oriented version of the same language, or it can be used to extract knowledge from the original program.
Related Work
• Specification (using predicate logic) of a compiler/decompiler between a pseudo- high level programming language and assembly code of a simplified virtual machine [Bow93].
• Reverse engineering of code with pointers [GC97].
• Code compilation/decompilation and its reverse engineering to the Z++ notation [BB92a,BB92b,BBL93a,BBL93b,BL91].
Related Work
• Knowledge recovery from ER-diagrams and SQL-DDL scripts to formal supports (Sets and VDM-SL) [OC93,NSO99].
Methodology and tool for abstracting ER-diagrams to the Sets notation.
Methodology and tool for reversing SQL-DDL scripts to VDM-SL, and assisting in the application of abstraction rules.
Example Purelly functional specification of Folder
Elem
Stack
Folder
Example Purelly functional specification of Folder
Stack
Elempush
pop
top
empty
isEmpty
Boolean
Example Purelly functional specification of Folder
Elem
insereFolha
Folder
viraFolhaFrente
viraFolhaTras
retiraFolha
leFolha
novoFolder
Example
class_Stack
class_Folder
Identification of Classes to create.
(Identifying the respectives states)
Example Distribute types and functions definitions over the created classes
Example Infer methods from the existing functions
Example Separate the algebraic purelly functional core from the Object Oriented API
Objectification Phases
• Identify classes (states) to create.
• Distribute types over the classes.
• Distribute functions.
• Infer methods.
• Create the classes separating the functional core from the OO API.
Objectification Criteria
One needs to define criteria to:
• Identify the types that are going to be “promoted” to Class.
• Which types are defined within each class.
• Which functions are created within each class.
• How to create methods...
Objectification Criteria
Direct dependence relation:• When a given data type t is defined in function of a
data type t’, i.e. when a functor F exists, such that t = F(t’), is said that t directly depends from t’, or that t’ participates in the construction of t, and such fact is denoted by
Objectification Criteria
Other definitions:• Sets Pt and Rt:
Objectification Criteria
• promotableToClass(t) predicate:
Promotion criteria:
Objectification Criteria
Criteria to assign datatypes to classes:• Datatypes to be defined in the context of class Ct are:
Objectification Criteria
Criteria to assign functions to classes:• Functions to be defined in the context of class Ct are:
Another examplePurelly functional specification of a simplified integer expressions system
Expr
Term
Expr ◄ Term Term ◄ Expr
Another examplePurelly functional specification of a simplified integer expressions system
Expr
Var ValueevalExpr
compare
wellFormedExpr
Boolean
Value
A
noth
er e
xam
ple
Pur
elly
func
tiona
l spe
cific
atio
n of
a
sim
plifi
ed in
tege
r ex
pres
sion
s sy
stem
Another examplePurelly functional specification of a simplified integer expressions system
Expr
Var ValueevalExpr
compare
wellFormedExpr
Boolean
Value
f
*
Another examplePurelly functional specification of a simplified integer expressions system
Another examplePurelly functional specification of a simplified integer expressions system
S-Alg
Class-Expr-Alg
Class-Expr-Obj
Function Combination
• Each resulting class API produced by the objectification process can be enhanced with operations that combine a state updating function and a state reading function.
• There are two modes of function combination:
– Execute the function that reads the state before the function that updates the state (or the two functions in parallel).
– Execute the function that updates the state before the function that reads the state.
Function Combination
Ex.:
Function Combination
The Objectifier
Development status:
• VDM-SL running prototype.
• It takes a VDM-SL (abstract syntax) expression of a functional specification and produces a list of VDM++ (abstract syntax) expressions of classes.
The Objectifier
VDM-SL
(AS)
VDM++
(AS)
Objectify
The Objectifier
VDM-SL
Definitions
VDM++
Class+
Objectify
The Objectifier
VDM-SL
Definitions
VDM++
Class+
synthesize-vdmpp
Attributes
eval-defs
The Objectifier
VDM-SL
Definitions
VDM++
Class+
Classesattributes
Attributes
conjectureClassesfinalClasses
Type
attributes
Functions
attributesClassFunctions
synAllClasses
The Objectifier - example
The Objectifier - example[
Conclusions
• Existing objectification methods are based on direct code restructuring.
• With a different approach, the method presented here uses, as a base of work, an algebraic purelly functional specification.
Conclusions
• The objectifier works on the functional specification, identifying classes (concepts) that are close to the business process served by the system in question.
Conclusions
• Each class (concept) identified gives origin to two VDM++ classes:
– A purelly functional algebraic class that conserves the datatypes and the functions of the original specification.
– A class that descends from the first one, animating its “services” through the maintenance of an internal state, and adding to it a methods API for a OO usage.
Conclusions
• The objectification criteria used guarantees that:
– There are no stateless classes (concepts, seen as a pair of VDM++ classes, -Alg and –Obj).
– A class has allways a means of updating its state, or descends from one that has.
Future Work
• Further develope the prototype.
• Re-implement the Objectifier using Haskell, SDF and Strafunski [vdBvDH+01,Vis03,LV03].
• Allow the use of modules (or even modules with state) in the original VDM-SL specifications.
• Prototype a Deobjectifier.
References
References
References
Rigorous Solutions forRigorous Solutions forSoftware SystemsSoftware Systems
E-Mail: [email protected] ; URL: http://www.sidereus.pt
Thank you!Thank you!Miguel Cruz Miguel Cruz [email protected]