Formalizing of Web-services Specifications Using Temporal Logics

Issues related to improving the design of multiservice SOA networks are discussed. Issue of creation of complex services, their orchestration and choreography are considered. Problem arising when creating an integrated service is discussed. It is shown that the formal description of the service using temporal logics will perform rigorous verification service and eliminate design errors 1. Introduction Web-services are defined as self-describing, self-contained, modular applications which published, placed and interactive online in Internet. Currently, a large number of business applications based on the use of web-services. At the same time widely used approach with combining various Web-services for the creation new services. This approach takes into account SLA and provides required business logic. Reference model of SOA systems is represented by organization OASIS. Formation of complex service is split into two phases. First phase is development of the static model (orchestration). Second phase is description of the service interaction during their performance (choreog-raphy). Formal description of static models is performed using WSBPEL, dynamic models using WS-CDL. Design goals of the static and dynamic models are the integration of the requirements of each component of an integrated service into the overall system. These requirements include format of message exchange , method for transmitting messages, team management , exception handling, etc. Development of such mechanisms requires their strictly check thorough testing and verification. Presentation of specifications using languages WS BPEL and WS-CDL allows only formalizes requirements for integrated service. However, these tools do not allow checking correctness (validation) of the developed service. Temporal logic is one of the most powerful tools for analyzing interaction of components in an environment. Thus, purpose of this paper is developing the method of converting parts of the complex service specifications by means of temporal logics.


Introduction
Web-services are defined as self-describing, selfcontained, modular applications which published, placed and interactive online in Internet.Currently, a large number of business applications based on the use of web-services.At the same time widely used approach with combining various Web-services for the creation new services.This approach takes into account SLA and provides required business logic.
Current technology, implementing web-services based primarily on SOA and its components, SOAP, WSDL, Registry (UDDI), Business Process Languages Layer (WSBPEL), Choreography Description Language, WS-CDL.Reference model of SOA systems is represented by organization OASIS.
Formation of complex service is split into two phases.First phase is development of the static model (orchestration).Second phase is description of the service interaction during their performance (choreography).Formal description of static models is performed using WSBPEL, dynamic models using WS-CDL.
Design goals of the static and dynamic models are the integration of the requirements of each component of an integrated service into the overall system.These requirements include format of message exchange, method for transmitting messages, team management, exception handling, etc.
Development of such mechanisms requires their strictly check thorough testing and verification.Presentation of specifications using languages WS BPEL and WS-CDL allows only formalizes requirements for integrated service.However, these tools do not allow checking correctness (validation) of the developed service.Temporal logic is one of the most powerful tools for analyzing interaction of components in an environment.Thus, purpose of this paper is developing the method of converting parts of the complex service specifications by means of temporal logics.

Literature review
Questions of verification and validation real-time service using temporal logic, such as web-services, touched upon in the researched works of D. Drusinsky (runtime monitoring and Verification of Systems with Hidden Information, Innovations in Systems and Software Engineering), Yde Venema (expressiveness and completeness of an interval tense logic.),Z. Manna and A. Pnuel, D M Gabbay and other.Questions of requirements of specification can be represented discover in [1,2,3].Formal definition of Linear Temporal Logic present in [3].

Formalizing specifications of web-services
Formalizing of web-service specifications by means of temporal logics is the sequence of state changes using predicates and temporal operators.A distinctive feature of temporal logics is that they allow formalizing web-service behavior, given parallelism, as well as the temporal order of state changes.
Formalizing process consists of converting the set of claims submitted by the web-services specification of a set of atomic propositional (AP) of temporal logics (set P ).Requirements of specification can be represented by two kinds of formulas [1][2][3]: path formula The example of using path formula is statement -In the channel cannot be more than k messages‖ [4]: The example of using state formula is statement -Serverwaits for an incoming request‖ [4]: |:  p S ready .
(2) Fig. 1.The diagram of SIP server transaction of stateful processing Fig. 1 shows fragment of client initialization and local search in SIP [4].SDL diagrams formalizing by means of temporal logics is accomplished by defining the true statements for each state [1] Accounting sequence of states is taken into account the chronological order of the events in the operation of web-service.There exist two different ways of taking into account the sequence of offensive states web-service by temporal logics tools [2,3]: -Linear Temporal Logic (LTL) allows describing the unique sequence of state changes in web-service; -Computational Tree Logic (CTL) allows considering several sequences of state changes in webservice simultaneously, which depend on different parameters.
For linear temporal logic generates its own formula for each path scenario of web-service behavior (Fig. 2).The time is linear: at each moment is considered only one chain of events.Linear temporal logic separates each scenario of protocols behavior.On Figure 2 it is presented four scenarios of existence session for SIP web-service: а) Server opens a new connection when a new user was detected.Server receives a user request and generates a response to user.For this scenario is characterized by a response of the final class (2хх, 3хх, 4хх, 5хх, 6хх).Request is considered to be completed after receiving a response.
b) Server opens a new connection when a new user was detected.Server user receives a request and generates a response to it, for this scenario is characterized by the use of the redirect server «Open Stream», which participates in the formation of user response.The state «Completed» indicates that the final response generated class and request processing is completed.c) Server opens a new connection when a new user was detected.Server receives a user request and generates a response to user, for this scenario is characterized by the absence of the redirect server and the response of the Information (1хх).The state «Complited» indicates that the final response generated class and request processing is completed.d) Server opens a new connection when a new user was detected.Server receives a user request and generates a response to user, for this scenario is characterized by the use of the redirect server that participates in the formation of user response information.
Computational Tree Logic allows describing behavior of several different scenarios of web-service in a single model.In this case, the path formula allows considering several scenarios of web-service behavior (Fig. 3).
To formalize the specification of web-services appropriate to use Linear Temporal Logic, this allows unambiguously formalizing every possible scenario of web-service behavior.
Application of Linear Temporal Logic as a specification formalism will also solve the problem of test specification for the presence of inconsistencies.Building LTL formulas is performed in accordance with the syntactic and semantic rules.Subsequent analysis and transformation of LTL performed on the basis of equivalent transformations of LTL.The following definitions are established the set of base formulas that can be expressed in a Linear Temporal Logic [3].
Formally, temporal logic is defined as: where A -temporal logic alphabet; O -temporal op- erators set; C -logical connectives.Alphabet is the basic concept of Linear Temporal Logic.Atomic statements form elements of the alphabet.Atomic propositional are assertion is true in the specification of web-service.Set of atomic propositional includes the basic elements of web-service, such as a server () S , client () C , message () M and statements about them, such as server availability ( : ) S ready , cli- ent activity ( : ) C active , message sending ( : ) M send etc.They form the alphabet of temporal logic P , (  AP P ).
Temporal operators are [1, 2, 5]: operators X («next moment»): condition must be executed in the next step.For example, the statement «after sending a message SYN should be generated ACK» can be represented as follows: ( : operators F («for the future»): condition must be executed in one of the futures steps.For example, the statement «if the channel is open, it will be obviously closed» can be represented as follows (( : operators G («always», «globally»): condition must be executed at each step.For example, the statement « TCP server port must be open» [6] can be represented as follows: ( : ) G D Enable .
operators U («until»): condition  must be per- formed continuously, or until the first condition ψ is met.For example, the statement «message will be discarded until the buffer is full» [2] can be represented as follows: ( : operators R («release»): the condition ψ should be performed at a certain way until the condition  .For example, the statement «connection (H) will be in state connection until not come message Bue» can be represented as follows: ( : Logical operators are conjunction, disjunction, implication, negation and compliance operators.
Logical link between linear temporal logic formulas are defined by the following set of rules [2, 3]: 1. p is a formula for all  p AP .2. If  -formula, then  -formulas; 3. if  and  -formula, то   and   - formulas; 4. If  -formula, then However, the state of web-services can be defined not only binary conditions, but also the natural numbers (for example package time to live, TTL, round retransmit time, retry count, number of source synchronization and other) [2,6,7].A number of extensions introduced to account such conditions of temporal logic.The extension has the following notations: x x number -atomic proposi- tional ( p ) takes a value higher or less than proposed in specification ( number ).This extension is not contrary to the basic axioms and theorems of temporal logics.

Construction of temporal logic for webservices.
Using a set of rules, described in the above, could be formulating the following sequence of steps for constructing LTL, describing the behavior of webservice.
1. Formed temporal logic alphabet: -Select of all elements of web-service (for example, the message sender, receiver, etc.); -Select of the main state (message: sent, session: set, etc.).
2. Defined connections between the elements of alphabet.
It is noted that the temporal operators have higher precedence than the logical connectives, thus for formalizing requirement of «sending a message INVITE affords confirmation confirmation» formulated statement: ( ( ))  G send F confirmation .In order to improve the formalization of specifications based on temporal logics are encouraged to apply commonly used formalisms as templates.For example, the lack of blocking («reachable from each state there exists the possibility of functioning web-service») represented as follows: GFtrue .
For secure communication a channel following assertion is true: X send receive if executed send, then the next state in the future will receive, and send until this moment will not run.
The following formula actual for mutual exclusion: 12 ( ( : : ))  G S crit S crit -two processes cannot be in the critical section simultaneously.

Semantics definition of linear temporal logic
The main task of temporal logic is an algebraic description of the web-service behavior.Behavior represented by the set of temporal logic formulas describing the sequence of state changes.Linear temporal logic formulas should be formed in accordance with the semantic rules [2,3,5].
To solve the problem of constructing a semantically correct structures of linear temporal logic formula to be determined in terms of the model: where S -non-empty finite set of states For example, temporal logic formula.
( ( ) ( : ) This formula describes a scenario of deleting messages in accordance with the specification of webmail service POP3 [8] presented in the following graph states (Fig. 4).
Constructing semantically true formulas of linear temporal logic for the specification defined on a subset of natural language are performed as follows: 1. Within the specification released temporal logic alphabet.
2. Specifies the logical link between the elements of temporal logic alphabet.
3. Determined by the presence of parallel execution of multiple logical connectives.In constructing formulas of temporal logic for the specification of protocols specified as SDL (UML) diagrams are the following steps: 1. Alphabet of temporal logic, each element of which corresponds to the SDL (UML) state, is generated.
2. Features of forward and reverse the incidence diagram are considered.The logical links between the elements of the alphabet of temporal logic are determined.
3. Presence of parallel processes is determined.4. Chronological sequence between logical connectives is built.
For example, the statement «the request must be confirmed» can be visually represented as follows (Fig. 5 The sequence of events corresponding to the statement « the connection is established after receiving confirmation » is presented at Fig. 6

A consistency check
As shows above, the development and modification of protocols possible emergence like a series of defects in contradiction specification is requirements [9].Specifications be presented a set of every temporal logic formula in terms of satisfaction relation ( | ) for solving the problem of testing the con- sistency of [2].
Definition 1.The formula is given between a state s and an element of the formula  , which must be true in this state ( | ' The next step allocated state and formulas corresponding to each state and is determined by the type of formula (path formula or states formula).Consistency check executed after this [3,10].
Definition 2. Two formulas of temporal logic are consistent if there are no such states for which formulas are mutually exclusive.
For example, the two statements: «reserved channel cannot be blocked» active .Consistency relations are verified path formulas and state formulas.Before checking the consistency holds the equivalent transformation formulas for the purpose of simplification.Equivalent transformation rules are divided into three categories [3]. Duality:  FGF GF  .

Example
For example, it is considered a communication channel between two users: sender (S) and receiver (R).The equipment equipped an output buffer of the sender (out), and receiverinput (in).Both buffers have unlimited capacity.
If S sends a message m to R, then it puts the message in your output buffer out.The receiver receives the message by removing them from their input buffer in [3].Thus, the alphabet consists of a temporal logic, atomic propositions set: message is in the buffer in the message is in the buffer out: m -mes- sage (Fig. 7).Fig. 7. Example of interaction between two network elements (sender and receiver), unidirectional communication channel The following requirements for a communication channel using formulas of temporal logic are formalized [11,12]: «Message cannot be in both buffers simultaneously»: «Channel does not lose messages»: ( : «After receiving confirmation that the message has been delivered to the recipient, is its removal from the buffer .out»: «Channel preserves the order»: ( : ' : ( ' : ) For consistency checks in accordance with the formulas 7 were made following the rules in the process of true web-service: Thus, the application of temporal logics allows detecting the contradictions in the original specification.

Conclusion
An algorithm formalization of web-services is constructed on the basis of temporal logics.The algorithm is based on the theory of formal grammars that allows you to formally introduce the execution of processes in the system model, to establish a cause-andeffect relationships, as well as to evaluate the correctness of the system as a whole and its individual components.Proposed method has different computational power.It allows using a particular type of language depending on the objectives of the study.