Научная статья на тему 'On one verification problem'

On one verification problem Текст научной статьи по специальности «Компьютерные и информационные науки»

CC BY
31
5
i Надоели баннеры? Вы всегда можете отключить рекламу.
Ключевые слова
THE SYNTAX ANALYZING PROGRAMS / THE FINAL AUTOMATS / GRAMMARS AND LANGUAGES / GRAMMAR FORMAL LANGUAGE / FINITE-STATE MACHINE / ALGORITHMS'' CORRECTNESS / PROGRAMS'' VALIDITY / TESTING OF COMPUTER PROGRAMS / VERIFICATION OF THESE PROGRAMS

Аннотация научной статьи по компьютерным и информационным наукам, автор научной работы — Benidze N.

The paper is devoted to the investigation of a verification problem of algorithms and their respective software. Special attention is given to the analysis of the relationship between finite-state automata, generating grammars and languages. Based on the results of the analysis, the principle of verification of algorithms of syntactic analysis is formulated.

i Надоели баннеры? Вы всегда можете отключить рекламу.
iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.
i Надоели баннеры? Вы всегда можете отключить рекламу.

Текст научной работы на тему «On one verification problem»

PHYSICS AND MATHEMATICS | ФИЗИКО-МАТЕМАТИЧЕСКИЕ НАУКИ

ON ONE VERIFICATION PROBLEM

Benidze N.

Sukhumi State University, 12 Politkovskaya Str.

Tbilisi, Georgia

ABSTRACT

The paper is devoted to the invefligation of a verification problem of algorithms and their respective software. Special attention is given to the analysis of the relationship between finite-flate automata, generating grammars and languages. Based on the results of the analysis, the principle of verification of algorithms of syntactic analysis is formulated.

Keywords: the syntax analyzing programs, the final automats, grammars and languages, grammar formal language, finite-flate machine, algorithms' correctness, programs' validity, tefling of computer programs, verification of these programs.

Introduction

The problem of verifying (eflimating) the correctness of algorithms and their corre-sponding software is one of the mofl fruitful problems from the flandpoint of their im-portance and influence on the technology of programming research areas.

Being an alternative to the tefling of computer programs, the verification of these programs is essentially based on their mathematical specification which frequently does not meet the program accuracy requirements.

Such a specific formalization opens a possibility of proving the flrict conformity of a program to the mathematical specification. However the main difficulty here consifls in the formulation of a mathematically correct version of non-formal requirements for a program.

In this paper an attempt is made to formalize such specific requirements for the com-puter programs which correspond to the algorithms of syntactic analysis.

Basic notions and definitions

1. Grammars and formal languages

Suppose that we are given a finite nonempty set X of terminal symbols (terminals). Also suppose that N is a nonempty finite set of all non-terminal symbols (non-terminals), such that NflX=0

Denote by V the set of all terminal and non-terminal symbols, i.e. V=Xfl N (V is called the vocabulary of a formal

V * = (El J N)*

language) and by v 7 the set of all possible combinations of symbols from the set V, including a chain of zero

length . Using these notations, we define 3 as a set of pairs

3 =

{(£ в) | V *-ex N x V* л веV*-e }.

Each ordered pair

(£ в)

(i)

To define the language L(G) generated by the grammar we

v*

introduce the notation ^ and the definitions of the following relations:

y*

•ь is the set of all sentences of finite length which are obtained from terminals.

^ Yi ^Yi

• The relation G on the set is defined as follows: G

(где Yi,Y2 gV +) if there exisft SgV and a

P ^ в e p generating rule such that

Yi = Si pS2 л Yi = ¿i p S2

(2)

*

^ V *

• The relation G on the set v is defined as follows:

Y'-'Y» GV* (n * 0) and

G if

(i = 1,2,...;,n) G . (3)

Y v y

The ordered sequence u' 1'"'' n is called an output of length .

v*

Definition 1.2. The subset ^

from the set ^ is called a

E ^ B

generating rule and is usually writ-ten in the form .

Definition 1.1. The formal grammar G is the quadruple

G = (N, E, P, S)

L(G) = -\ x | S ^ x л x eE л S e N

G

L(G)

(4)

where P is a nonempty finite subset of the set ° (the set of

syntactic rules) and S G N is a special symbol called an initial symbol of the grammar or the axiom of the lan-guage.

is called the language v ' generated by the grammar G., 2. Finite-flate automata.

We shall consider finite-flate automata having a finite number of flates of the "inter-nal" memory and a finite number of input symbols. As soon as an input symbol is entered in the automatic machine, the latter transits from one flate to another flate, this transition being determined. Besides, in the set of flates, an

initial Sate and a set of concluding Sates are chosen. A chain (a finite sequence of input symbols) is admitted by the automatic machine if after Parting to work in the initial Sate and reading the entire chain the automatic machine transits to one of the concluding Sates. Thus, each finite-Sate automatic machine functions as a device that discerns the so-called regular set of chains (it admits only the chains which belong to this set).

Below we give the formal definitions of the notions we have juS discussed.

Definition 2.1. A finite-Sate automatic machine is the

ordered quintuple A (0, ^ 8, , F) where

Q is a finite set of non-Sructured Sates;

G 0 is an initial Sate; F e O

— ^ is a nonempty set of concluding Sates;

X is a nonempty finite set of input symbols;

5 is a transition function,

8 : O

Definition 2.2. A set of chains admitted by a finite automatic machine A is called a regular set; it is denoted by T(A) and given as follows

T(A) = { X | X eZ+ a 8(q0, X) R F = 0

where 8 is a function defined recursively as

8(q,ala2...an) = U8(p,an), n > 2

p

P (q,aia2...an-i) and 8(q,ax) = 8(q,ax) .

3. Connection between finite-Sate automata, formal grammars and languages.

The following two theorems are proved in [1].

Theorem 1. If A (0, ^,8, q°, F) is a finite Sate automatic machine, then there exiSs a right-linear grammar

G = (N,I" p,5), such that L(G) = T(A>

Theorem 2. If G = (N, P, 5) is a right-linear grammar, then there exiSs a finite-Sate automatic machine

A = (Q,E',8, qo,F), such that T (A) = LG

The proof of the next theorem is based on the above two theorems.

Theorem 3. For any algorithm of syntactic analysis of the grammar G = (N, Z, P, 5) there exiSs a finite-Sate automatic machine A (0,^ ,8,qo,F) .

Proof. Since P ^, the algorithm of syntactic analysis of the grammar G is the pro-gram realization of

the syntax of the formal language L(G), i.e. of the set

3={(£ p) | V + x N x V* a pG V+ }. By virtue of Theorem 2, for the right-linear grammar

G = (N, ^ 5) there exiSs a fi-nite-Sate automatic machine A = (Q,Z',8, qo,F), such that

N=0 ^^ 5=qo h l(G)=t(A)

By definitions (2) - (4), the set of rules of the output of the language coincides with the set , i. e.

P = T (A) Q.E.D.

4. The verification principle of algorithms of syntactic analysis.

Denote by Ag an algorithm of syntactic analysis of the

grammar G which generates the language L(G^. Thus

G ^ L(G) and G ^ * .

This notation can conveniently be represented as a diagram of relations G ^ Ag

4

L(G)

The results of Theorems 1, 2 and 3 can be represented analogously as G ^ A

4 ^ 4 Ag^A

L(G) T(A)

Theorems 1 and 2 Theorem 3

iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.

A formal combination of the above three diagrams leads to the diagram

The combined diagram of relations makes it possible to formulate the principle of verification of algorithms of syntactic analysis as follows:

An algorithm Ag of syntactic analysis of the grammar is correct if it is written in the language of regular expressions. 5. Software verification for cryptological sySems Though the aim of this paper is not to inveSigate problems of cryptosySems and cryp-toanalysis, all the same it should be said that in order that a cryptosySem operate properly it is necessary that the corresponding algorithms be realized correctly. Therefore the queSion of correctness of the corresponding programs is important juS like for any other program.

The proof that coding and decoding algorithms are correct does not guarantee a proper operation of the software of the entire sySem. Therefore the following Satement is quite logical and juSified:

If D is the program of block coding and A is the set of initial data, then the program D is correct if and only if there exiSs a

decoding program G , such that G(B)=A , where B=D(A) . The contrary flatement is also true.

References

1. Ollongren, Definition of programming languages by interpreting automata. Mir, Mos-cow, 1977 (Russian translation).

2. A. Aho, J. Ullman, Theory of syntactic analysis, translation and compilation. Vol. 1, Mir, Moscow, 1978 (Russian translation)

3. N. Benidze, To the queflion of correctness of programs. In: "Internet Education Sci-ence" IES-2008. New Informational and Computer Technologies in Education and Science. Ukraine, Vinnytsa VNTU, October 7-11, 2008 ,vol. 2, Section H, pp. 545550.

4. N. Benidze, On the verification of computer programs. Proceedings of the Interna-tional Conference "Informational and Computational Technologies", Tbilisi, Georgia, May 2-6, 2010.

MODEL SYNTHESIS AND MODEL-ORIENTED PROGRAMMING: SIMULATION TECHNOLOGY FOCUSED ON DISTRIBUTED AND HIGH

PERFORMANCE COMPUTING

Brodsky Yu.I.

Federal Research Centre Computer 5cience and Control of the Russian Academy of5ciences, Leading Research 5cholar

Moscow

ABSTRACT

A new approach proposed to the description, design and implementation for computer simulations of complex multi-component syflems, - the model synthesis and model-oriented programming. The central concept of this approach is the concept of the model-component. The models-components family is closed under uniting components into the complex, and the simulation computations organization is an invariant for any member of the family. This fact allows solving the synthesis problem for a simulation model of any complexity. A special declarative language LCCD (language of components and complexes descriptions) proposed for describing the models-components and building models-complexes from them. The model-oriented programming syflem proposed is focused on parallel and diflributed computing.

Keywords: simulation, complex syflems, model synthesis, diflributed computing, model-oriented programming, high performance computing.

Introduction

This work is devoted to problems of simulation modelling of rather wide class of complex syflems, which are characterized by the atomiflic and fractal arrangements of the representatives. Such underflanding of complex syflem is reflected, for example, in article of N.P. Buslenko in the Big Soviet Encyclopaedia [14]: «Complex syflem - a compound object which parts can be considered as the syflems naturally united in a whole in accordance with certain principles or defined set of relations» - i.e., components of complex syflem can be complex syflems themselves. Thus, it is considered that the arrangements of syflem «atoms», their behaviour, and also the rules of their interactions are well known. The problem of simulation modelling in this case is to reproduce the behaviour of the syflem as a whole, for the purpose of clarification of its features, opportunities; after that some control and/or optimizing tasks may be set, basing upon the simulation model.

This task is not trivial. Even the task of the description of all we knew about a complex syflem is rather difficult. It was supposed above about exigence of the knowledge of the syflem «atoms» arrangements and their interrelations. However the problem is that such a knowledge is usually badly flructured: we seldom know about a component of the syflem modelled so much exactly, as it is necessary and enough for the simulation model creation. If we know less - it would be good to underfland what else is necessary to learn, or from what features of the future model it is possible to refuse. If on the contrary, we know something over, concerning some components of the syflem, -it would be good to exclude such knowledge from the model description, as there may be thousands of such components, and their excess descriptions, mofl likely, will complicate further design of the simulation model.

A computer realization of a complex syflem simulation model is especially difficult. It would be desirable that the design

and realization of the model were carried out mofl automated, on the basis of the formal description of the complex syflem available. It is desirable to exclude from the model realization project the mofl labour-consuming imperative programming as much as possible.

At present the diflributed and parallel computing are important directions of modern informatics development. In this regard it would be desirable to receive the simulation models of complex syflems focused on the diflributed and highperformance computing syflems.

The review of solutions

The review of some of the exiting solutions in the field of the description, design and programming realization of complex multicomponent syflems simulation models was given in the work [9]. We will lifl them briefly in their origination order.

The GPSS syflem (General Purpose Simulation Syflem [20], 1961, J. Gordon, IBM) solves mofl of the tasks set in the introduction. This fact allows it to keep followers for more than half a century. However its object domain is significantly narrower, than declared in the introduction - only syflems which may be lodged into processes of mass service paradigm.

The idea flated in N. P. Buslenko's work [13], is an essence of the multicomponent syflem synthesis: to let to each of the components to prove itself as much as possible, considering all the inter-components communications. It caused emergence from the middle of the 70th ideas of agent programming and modelling (C. Hewitt [17], Y. Shoham [21]), and then, since the end of the 90th, ABMS (Agent-Based Modelling and Simulation) syflems. However a certain mark of an anthropomorphism lies on these agents - it is told about their behaviour in terms of «beliefs», «commitments», «capabilities», "choices", etc. There a queflion arises - what the universal agent and its behaviour has to be, to be sufficient for modelling of complex multicomponent syflems,

i Надоели баннеры? Вы всегда можете отключить рекламу.