4
CvberTzetics and Systems Analysis, Vol. 36, No. 3, 2000 SOFWARF~HARDWARE SYSTEMS INTEGRATED TOOLS FOR DESIGN AND SYNTHESIS OF CLASSES OF ALGORITHMS AND PROGRAMS G. E. Tseitlin, A. A. Amons, O. V. Golovin, and A. Yu. Zubtsov UDC 519.8 Tools for supporting design and synthesis of classes of algorithms and programs in the Windows environment are discussed. The tools are based on interrelated descriptions of multilevel projects in graph, analytical and natural linguistic forms. Keywords: computer-aided design and synthesis of algorithms and programs, interrelated graph, analytical, and natural linguistic project representation, algorithm transformations, representation transformations, systems of Glushkov algorithmic algebras (SAA), SAA-schemes, MUL'TIPROTSESIST system. At present, an important direction called "computer sciences" is intensively developed that is based on formalized specifications of algorithms and programs. Among the studies in this direction are, in particular, the investigations performed within the framework of the Kiev algebraic-cybernetic school and dating back to the fundamental works of V. M. Glushkov on automating the design of logical structures of computers and programming [1-3]. Within the framework of the direction considered, the system MUL'TIPROTSESIST was developed [1, 3] that belongs to the category of tools for automated structural synthesis of algorithms and programs. In this system, texts of programs in imperative programming languages (Assembler, C, Pascal, etc.) are generated on the basis of algorithmic projects represented in the language of SAA-schemes. SAA-schemes are natural linguistic algorithmic descriptions based on the apparatus of systems of Glushkov algorithmic algebras (SAA) [1]. The kernel of the MUL'TIPROTSESIST synthesizer contains, in particular, a dialogue constructor of syntactically correct SAA-schemes called a DSC-constructor [3-5]. This article is devoted to tools for design and synthesis of classes of algorithms and programs in the Windows environment. The tools are based on interrelated descriptions of multilevel projects in graph, analytical, and natural linguistic forms [3]. We present the general architecture of the tools with a brief description of its components including the DSC-constructor of projects in the above-mentioned forms, their transformer, and also an algorithmic knowledge base used in the process of design, transformation, and synthesis of classes of algorithms and programs. AN EXAMPLE OF TRANSFORMATION OF AN ALGORITHM In contrast to the prototype MUL'TIPROTSESIST system, the tools discussed in this article are based on interrelated design of schemes of algorithms represented in graph, analytical, and natural linguistic forms. The graph and analytical representations of algorithms are based, respectively, on the apparatus of graph-schemes of L. A. Kaluzhnin and formulas in the corresponding algebras, and the natural linguistic representation is based on SAA-schemes [3]. Using the apparatus of schemes, we will describe the passage from one of adaptive sorting (by alternative insertions) International Solomon University, Kiev, Ukraine. Translated from Kibernetika i Sistemnyi Analiz, No. 3, pp. 165-169, May-June, 2000. Original article submitted August 12, 1999. 1060-039610013603-0455525.00 Kluwer Academic/Plenum Publishers 455

Integrated tools for design and synthesis of classes of algorithms and programs

Embed Size (px)

Citation preview

Page 1: Integrated tools for design and synthesis of classes of algorithms and programs

CvberTzetics and Systems Analysis, Vol. 36, No. 3, 2000

S O F W A R F ~ H A R D W A R E S Y S T E M S

I N T E G R A T E D T O O L S F O R D E S I G N AND S Y N T H E S I S

OF CLASSES OF A L G O R I T H M S AND P R O G R A M S

G. E. Tseitlin, A. A. Amons, O. V. Golovin, and A. Yu. Zubtsov UDC 519.8

Tools for supporting design and synthesis of classes of algorithms and programs in the Windows environment are discussed. The tools are based on interrelated descriptions of multilevel projects in graph, analytical and natural linguistic forms.

Keywords: computer-aided design and synthesis of algorithms and programs, interrelated graph, analytical, and natural linguistic project representation, algorithm transformations, representation transformations, systems of Glushkov algorithmic algebras (SAA), SAA-schemes, MUL'TIPROTSESIST system.

At present, an important direction called "computer sciences" is intensively developed that is based on formalized specifications of algorithms and programs. Among the studies in this direction are, in particular, the investigations performed within the framework of the Kiev algebraic-cybernetic school and dating back to the fundamental works of V. M. Glushkov on automating the design of logical structures of computers and programming [1-3].

Within the framework of the direction considered, the system MUL'TIPROTSESIST was developed [1, 3] that belongs to the category of tools for automated structural synthesis of algorithms and programs. In this system, texts of programs in imperative programming languages (Assembler, C, Pascal, etc.) are generated on the basis of algorithmic projects represented in the language of SAA-schemes. SAA-schemes are natural linguistic algorithmic descriptions based on

the apparatus of systems of Glushkov algorithmic algebras (SAA) [1]. The kernel of the MUL'TIPROTSESIST synthesizer contains, in particular, a dialogue constructor of syntactically

correct SAA-schemes called a DSC-constructor [3-5]. This article is devoted to tools for design and synthesis of classes of algorithms and programs in the Windows

environment. The tools are based on interrelated descriptions of multilevel projects in graph, analytical, and natural linguistic forms [3]. We present the general architecture of the tools with a brief description of its components including the DSC-constructor of projects in the above-mentioned forms, their transformer, and also an algorithmic knowledge base used in the process of design, transformation, and synthesis of classes of algorithms and programs.

AN EXAMPLE OF TRANSFORMATION OF AN ALGORITHM

In contrast to the prototype MUL'TIPROTSESIST system, the tools discussed in this article are based on interrelated design of schemes of algorithms represented in graph, analytical, and natural linguistic forms. The graph and analytical representations of algorithms are based, respectively, on the apparatus of graph-schemes of L. A. Kaluzhnin and formulas in the corresponding algebras, and the natural linguistic representation is based on SAA-schemes [3].

Using the apparatus of schemes, we will describe the passage from one of adaptive sorting (by alternative insertions)

International Solomon University, Kiev, Ukraine. Translated from Kibernetika i Sistemnyi Analiz, No. 3, pp. 165-169, May-June, 2000. Original article submitted August 12, 1999.

1060-039610013603-0455525.00 �9 Kluwer Academic/Plenum Publishers 455

Page 2: Integrated tools for design and synthesis of classes of algorithms and programs

[SET (B el)l . . J

' ~ ~ . ~ p t ~ [Dgc(P2 'Pl ) l

- - ~'d(P~,E)v(l>rl -I"

[ R ! P I ) ' ] ..!_ . . . . ~ ~ p , , E ) v(l<rl - -

!

+

2)1

I I

+

Fig. 1

algorithms to the corresponding search algorithm [3]. There exists an array of data to be sorted that is marked with the pointers P1, P2, B, and E, i.e., we have B P1 P2 al a2 " ' a n E. The analytical representation of sorting by alternative inserts is

of the form CAB :: = SET(B P2 P1 ) * {[d(Pl ,E)] {[d(P 1 ,E) v (I > rlP~ )] R(P~) } �9

{[d(P l ,E) v (I < riP l )] ([lIP2 < rlPl ] {[riP 2 > riP 1 ]R(P 2 ),

{[ll P2 < rl el ]L(P2 )}) �9

INSERT rip I accoding to P2 } } * DEL(P2 ,P1).

The graph-scheme of this sorting is presented in Fig. 1, where d(P 1 ,E) is a predicate that is true if the pointer P1 reaches the marker E, SET (B P2, P1) is an operator that places the pointers immediately after the marker B, (1 > riP 1 ) is a predicate that is true if the element to the left of the pointer PI is rarger than the element to the fight of P1, L(P2 ) denotes the shift of the pointer P2 to the left, R(P 2 ) denotes the shift of the pointer P2 to the fight, the DEL( PI ,P2) is the deletion of the pointers P1 and P2 from the array, and (liP 2 < riP 1) is a predicate that is true if the element to the left of P2 is less than the

element to the fight of P1- Abstracting this scheme and then detailing it again, we obtain an alternative search algorithm. A detailed

representation o f the algorithm is based on the following conditions: we have a file of records M that is marked with the

pointers P2, B, and E, i.e., BP 2 a 1 a 2 . . . a n E, and an array of inquiries M 3 marked with the pointers B, PI, and E, i.e., BP l

Zl Z2 . . .ZmE. The analytical representation of the alternative search is of the form

SA::=SET(B P2 P1)*{[d(P1,E)]([r[P2 <rlP~]

456

Page 3: Integrated tools for design and synthesis of classes of algorithms and programs

[ SET tB P,)l

[ L(P2) l]

]Processing of an inquiry t ] Record is not found [ I I

Ie(*P ) [ I

Fig. 2

{[riP 2 >rlP~)v d(P2,E)]R(P2)}, {[riP 2 <rlP~)v d(P2,B)]L(P2)}),

([r]P 2 = r[P 1 ]PROCESSING, NO RECORD)* R(P I )}, DEL(P 2 ,PI ).

The alternative search algorithm obtained is presented in Fig. 2 in graph form.

TOOL ARCHITECTURE

The integrated tools proposed consist of the components presented in Fig. 3.

One of the principal components of the tools is the DSC-constructor. It is based on the dialogue mode of operation with a menu and queue-type memory. The menu includes operator and logical constructions whose superposition allows one to create algorithms in the above-mentioned forms. Operator and logical variables are stored in a queue and then are refined in detail. Depending on the type of variable taken from the queue, the system proposes a corresponding component menu or places the archive of basic notions from the knowledge base at the user's disposal. The knowledge base also contains processing strategies, i.e., schemes of algorithms with variables. The DSC-constructor can be used in designing new schemes and also for detailing already existing strategies. The process of design is multilevel in character, and syntactic errors can appear in each form.

The transformer converts schemes of algorithms with the use of identical relations that are stored in one of the sections of the knowledge base and characterize the properties of constructions, i.e., the operations of the corresponding algebra of algorithms [3]. In the dialogue mode, an identity is chosen that should be used in the course of a transformation. The destination of this component is the improvement of a scheme according to some criteria (memory, operation speed, etc.).

The algorithmic knowledge base consist of the following sections:

457

Page 4: Integrated tools for design and synthesis of classes of algorithms and programs

Algorithmic Knowledge Base

Schemes of Algorithms

Strategies of Processing

Metarules of Folding, Unfolding, and Transformation

Basic Notions and Their Supporting Programs

DSC-Constructor

I Interface

Transformer

Fig. 3

�9 schemes of algorithms (developed algorithms from different object domains), �9 strategies of processing (schemes that describe classes of algorithms and need further detailing), �9 metarules of folding, unfolding, and transformation (that provide abstraction, detailing, and reinterpretation of

schemes and contain identifies for scheme transformation), �9 basic notions and their program realization (oriented towards design of algorithms and synthesis of programs in a

given object domain and in the target language chosen). The interrelation between the above-mentioned components is depicted in Fig. 3. At present, the system considered is at the stage of complex debugging. It is developed in the programming language

Visual C++ and is destined for a wide circle of users, including programmers. The system is tested in the course of solving a number of problems of symbolic processing such as sorting and search ones [6]. In the future, we suppose to use the system in other object fields, thereby increasing the level of their intellectualization. (The system is being realized by lecturers and students of the faculty of computer sciences of the International Solomon University in Kiev.)

REFERENCES

1. V.M. Glushkov, G. E. Tseitlin, and E. L. Yushchenko, Algebra, Languages, and Programming [in Russian], 3d ed., Naukova Dumka, Kiev (1989).

2. A.A. Letichevsky and Yu. V. Kapitonova, "Algebraic programming in the APS system," in: Proc. ISSAC'90 (Tokyo, 1990), ASM Press, New York (1990), pp. 68-75.

3. G .E . Tseitlin, An Introduction to Algorithmics [in Russian], Sfera, Kiev (1998). 4. G .E . Tseitlin, "Design of symbolic-processing algorithms," Kibern. Sist. Anal., No. 2, 17-29 (1993). 5. L . I . Nagornaya, "Syntactically correct multilevel structural program design," Kibern. Sist. Anal., No. 5, 110-117

(1991). 6. D .E . Knuth, The Art of Computer Programming [Russian translation], Vol. 3, Mir, Moscow (1978).

458