Patent Publication Number: US-8121964-B2

Title: State machine method for editing requirements using transition systems, a sub-state mechanism, and a partial behaviors mechanism in order to reduce complexity and the number of states

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     This invention relates generally to a method for providing writing requirements for a structured transition system and, more particularly, to a method for providing writing requirements for a structured transition system that employs sub-state based structuring, abstraction based structuring and partial behavior structuring. 
     2. Discussion of the Related Art 
     Sophisticated digital circuitry, such as circuits and controllers that control various vehicle systems, sub-systems and components, typically employ state machines that provide a certain state or states based on inputs from various sensors and other state machines indicating the operating condition of the vehicle. For example, the various sensors, detectors and components on a vehicle that detect various vehicle parameters, such as pressures, temperatures, steering angle, yaw rate, vehicle speed, wheel slip, etc., are provided to state machines that indicate a particular state of the functional operation of the vehicle. Because a vehicle may at any given point have thousands of states, providing writing requirements that allow such a large number of states to be understood by a person who is designing vehicle circuits and systems is typically a complex challenge. 
     Requirements capture and analysis is one of the most critical stages of the software development life cycle. One known practice is to use natural language as a technique for specifying feature requirements. However, using natural language for specifying feature requirements does not lend itself to automated informal analysis of the requirement. Another known practice is to use graphical state-machine formalisms for specifying feature requirements. This technique employs hierarchical structuring mechanisms for designing state machines. Hierarchical state based structuring helps a user manage complexity of requirements by providing a mechanism for grouping states and transitions. However, using such structuring mechanisms introduces implicit information, making it difficult for a user to comprehend all of the implications of making changes in a specification. Thus, it is sometimes difficult to validate the specification, i.e., figure out whether what has been written down as the writing requirements is what really was intended. 
     SUMMARY OF THE INVENTION 
     In accordance with the teachings of the present invention, a method is disclosed for providing writing requirements for a structured transition system employing state machines. The requirements employ a plurality of structuring mechanisms, namely, sub-state based structuring, abstraction based structuring and partial behavior structuring that uses event sequences. Sub-state based structuring allows users to focus on a sub-set of states of the state machine, and abstraction based structuring allows users to specify requirements by conflating different states, i.e., focusing on a particular aspect of the specifications by ignoring differences between states irrelevant to that aspect. This provides an abstraction of the state machine that reduces the number of states. Partial behavior structuring allows specification of transitions by using scenarios consisting of a sequence of inputs and outputs to partially specify the source and target states of the transition. 
     Additional features of the present invention will become apparent from the following description and appended claims, taken in conjunction with the accompanying drawings. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         FIG. 1  is a block diagram of a state machine; and 
         FIGS. 2   a  and  2   b  show a syntax diagram for a STS specification. 
     
    
    
     DETAILED DESCRIPTION OF THE EMBODIMENTS 
     The following discussion of the embodiments of the invention directed to a method for providing writing requirements in a structured transition system employing state machines is merely exemplary in nature, and is no way intended to limit the invention or its application or uses. 
     The present invention proposes a technique for providing writing or feature requirements in a structured transition system (STS) that employs state machines. A transition is the movement of a state machine from one state to another state. A transition has four components, namely, a starting state, an ending state, an event and an action. Semantics is a procedure for compiling a high level description within the STS. In other words, semantics describe how the compilation is accomplished. 
       FIG. 1  is a representation of a state machine  10  receiving state inputs from other state machines or systems, and providing state outputs based on the state inputs. A state machine has two parts, namely, a set of states and a set of transitions. 
     The proposed STS language provides a formalism that can be used for capturing high-level writing requirements in the form of transition systems. The described method provides structuring mechanisms that include requirements for sub-state based structuring, abstraction based structuring and partial behavior structuring. Sub-state based structuring has to do with the hierarchical requirements of the state machines, abstraction based structuring provides an abstraction of the state machines that reduces the number of states and partial behavior structuring employs scenarios to specify starting and ending states of a transition. Particularly, sub-state based structuring allows users to focus on a sub-set of states of the state machine, and abstraction based structuring allows users to specify requirements by conflating different states, i.e., focusing on a particular aspect of the specifications by ignoring differences between states irrelevant to that aspect. This provides an abstraction of the state machine that reduces the number of states. Partial behavior structuring allows specification of transitions by using scenarios consisting of a sequence of inputs and outputs to partially specify the source and target states of the transition. 
     The method also may employ another structuring mechanism defined as state machine decomposition that refers to reducing the complexity of a large state machine into smaller inter-related state machines so that they can be isolated. 
     The discussion below provides a preliminary design of the syntax and semantics of the STS specification. The STS specification it is expected to evolve to include further structuring mechanisms based on continuing research. The syntax and semantics presented below can be used for designing analysis algorithms for consistency of the STS specifications, completeness of the STS specifications and predicate abstraction of STS specifications. 
     The syntax of the STS specification is first discussed. An STS specification consists of a structured sequence of declarations. There are a number of different kinds of declarations, including type, variable, event, action, invariant, initialization and transition declarations. Of these declaration kinds, the STS specification mainly focuses on structuring the transition declarations. The other declarations are assumed to precede the transition declarations and are visible globally in the STS specification. This is only a temporary restriction on the language. It is possible that all degradations can be freely intermixed, however, certain semantics become more complex if variables and input/output events are not assumed to be global. 
     The transition declarations are organized using one of the following syntax elements. A sub-space specification syntax element that describes transition behavior with respect to a set of states defined using a predicate. This is typical of graphical hierarchical state machines, where the hierarchy represents the behavior within a particular state. An abstraction syntax element specifies the transition behavior of the state-machine after undergoing abstraction. 
     Each transition itself specifies a set of source states and target states, an event on which the transition should be taken and an action that should be performed by the transition. The source and target states can be specified as follows. The keyword init can be used to refer to the set of initial-states of the transition system. A state predicate over the variables of the state-space can be used to specify a set of states. A post image is the set of states reached by a sequence of transitions starting from a given set of states. A pre-image is a set of states starting from which a sequence of transitions will reach a given set of target states. A sequence of transitions are specified as a sequence of events and actions. 
     Table I below shows lines of code that represent the syntax, using grammar specification in Extended Backus-Naur form (EBNF), of the STS specification discussed above using the sub-space specification syntax elements and the over-approximation syntax elements, and the source and target states including the initial states, the state predicate, the post image of a sequence of events and the pre-image of a sequence of events.  FIGS. 2   a  and  2   b  show the lines of code in Table I in a syntax diagram. 
     
       
         
           
               
               
             
               
                   
                 TABLE I 
               
               
                   
                   
               
             
            
               
                   
                 (STS spec)::=   
               
               
                   
                 (Type declaration)*(Variable declaration)* 
               
               
                   
                 (Event declaration)*(Action declaration)* 
               
               
                   
                 (Invariant declaration)*(Initializing) 
               
               
                   
                 (Type declaration)::=   
               
               
                   
                 (type-id)(type-val)* 
               
               
                   
                 (Variable declaration)::=   
               
               
                   
                 (type-id) : (type-id)| 
               
               
                   
                 (var-id) : bool 
               
               
                   
                 (Event declaration)::=   
               
               
                   
                 (event-id) 
               
               
                   
                 (Action declaration)::= 
               
               
                   
                 (action-id) 
               
               
                   
                 (Invariant declaration)::= 
               
               
                   
                 (label) (State predicate) 
               
               
                   
                 (Transition declaration)::= 
               
               
                   
                 (label)(State set)(event-id)(action-id)(State set)| 
               
               
                   
                 sub (State set)(Transition declaration)*| 
               
               
                   
                 abstract (Abstraction)(Transition declaration)* 
               
               
                   
                 (Event sequence)::= 
               
               
                   
                 (event-id)* 
               
               
                   
                 (State set)::= 
               
               
                   
                 init| 
               
               
                   
                 (State predicate)| 
               
               
                   
                 (State predicate)→(Event sequence)| 
               
               
                   
                 (Event sequence)←(State predicate) 
               
               
                   
                 (Abstraction)::=   
               
               
                   
                 ((var-id) : (State predicate))+ 
               
               
                   
                   
               
            
           
         
       
     
     The following discussion gives the semantics of the STS specification presented above. The semantics is presented as axiomatic semantics that sets up relationships between transition systems and STS specifications. This style of presenting the semantics is commonly used for presenting the semantics of logics, such as LTL, CTL, etc. 
     The models of a structured transition system are transition systems. A transition system can be presented by the tuple: 
             〈     S   ,           ∑   Evt     ⁢     ,       ∑   Act     ⁢     ,   Init   ,   δ           〉                       
Where S is a finite set of states of the state-machine, Σ Evt  is the set of input events, Σ Act  is the set of output actions Init  ⊂  S is the set of initial states, and δ is a relationship of type S×Σ Evt ×Σ Act ×S, which represents the state transition relation. The notation Θ is used to refer to a transition system. The notations S Θ , Σ Θ   Evt , Σ Θ   Act , Init Θ , S 73   are used to refer to the different components of the transition system.
 
     An STS specification can be separated into two main parts, namely, a static part that consists of the type of declaration, such as variable declarations, initialization of declarations, invariant declarations, event declarations and action declarations, and a dynamic part that consists of the different forms of the transition declarations. The static part of an STS specification identifies the states, events, actions and initial states of a transition system, and the dynamic part of an STS specification identifies the transition relation part of a transition system. The static part of an STS specification is identified as a universe of transition systems that has the identified set of states, events, actions and initial states. The dynamic part of the specification identifies transition systems from this universe based on properties that their transition relation should satisfy. 
     For static semantics, the set of states of the transition system are structured as assignments of values to variables and conditions. It can therefore be represented by an indexed tuple of values, where each index corresponds to a particular state-variable. The index-set of a state is the set of variable declarations in the specification. 
     Given a type ty, the domain dom(ty) of the type ty is the set of valuations for variables of that type. A valuation is a mapping from a variable name to a value. Given a variable v, the type of the variable is given by type(v). Given a set of variables V, the state-space described by this set of variables is given as:
 
   V     =x   vεV  [dom(type( v ))]
 
     The invariant declarations of a specification also contribute towards defining the state-space of the transition system. An invariant is defined by a predicate that has to be satisfied by all of the states of a transition system. Given a set of variables V, the denotation of the predicate expression pred, written  pred v, with respect to this set of variables, is a unitary predicate over the set of states [[V]]. It is noted that the semantics of a predicate expression is parameterized over a set of variables V. 
     Given a set of invariants Inv in the specification, the state-space of the transition-system described by the specification is given as: 
     
       
         
           
             
               
                 〚 
                 Inv 
                 〛 
               
               ⁢ 
               V 
             
             = 
             
               { 
               
                 
                   s 
                   ∈ 
                   
                     〚 
                     V 
                     〛 
                   
                 
                 | 
                 
                   
                     ⩓ 
                     
                       i 
                       ∈ 
                       Inv 
                     
                   
                   ⁢ 
                   
                     
                       〚 
                       ⅈ 
                       〛 
                     
                     ⁢ 
                     
                       V 
                       ⁡ 
                       
                         ( 
                         s 
                         ) 
                       
                     
                   
                 
               
               } 
             
           
         
       
     
     Equivalently, the semantics can be expressed as: 
                 〚   Inv   〛     ⁢   V     =       ⋂     i   ∈   Inv       ⁢       〚   ⅈ   〛     ⁢   V             
Where  i v, which is an unitary predicate over  V  interpreted as a subset of  V .
 
     Similarly, the initialization clause of the specification is described by a state-predicate, and the set of states described by the initialization predicate init is given by  init V. 
     The set of event and action declarations define two sets Σ Evt  and Σ Act  of events and actions, respectively. 
     Given a specification Spec with variables V, invariants Inv, initialization predicate init, events Evt and actions Act, the static-semantics specifies a set (the universe) of transition systems  Spec  as follows. 
               〚   Spec   〛     =     〈       Inv   V     ,       ∑   Evt     ⁢     ,       ∑   Act     ⁢     ,       〚   init   〛     V     ,   δ             〉           
Where δ is the relation:
 
     
       
         
           
             δ 
             ⊆ 
             
               
                 
                   〚 
                   Inv 
                   〛 
                 
                 V 
               
               × 
               
                 
                   ∑ 
                   Evt 
                 
                 ⁢ 
                 
                   × 
                   
                     
                       ∑ 
                       Act 
                     
                     ⁢ 
                     
                       × 
                       
                         
                           〚 
                           Inv 
                           〛 
                         
                         V 
                       
                     
                   
                 
               
             
           
         
       
     
     Event sequences are an important abstraction for specifying the behavior of a feature. Behavior is often specified in terms of sequences of events. In these cases, sequences of events implicitly represent sets of states. For example, a common idiom for specifying requirements is from a state satisfying condition  1 , after event  1 , event  2 , event  3  has occurred, if event  4  occurs, then perform action  1 . In this case, a sequence of events is a convenient representation of the set of states reachable by processing the sequence of events from some initial set of states. 
     The STS language allows a specification of state-sets using event-sequences. A set of states can be specified as the states reachable from an initial set of states by processing a given event sequence as:
 
pre→ seq 
 
     This basically represents the post—image of the given sequence with respect to a transition relation and a set of states. 
     Given a transition relationship δ, the relation δ* is defined as the natural extension of the transition relationship δ to sequences of events as: 
     
       
         
           
             
               δ 
               * 
             
             = 
             
               { 
               
                 
                   ( 
                   
                     s 
                     , 
                     
                       
                         e 
                         0 
                       
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       … 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       
                         e 
                         n 
                       
                     
                     , 
                     
                       
                         a 
                         0 
                       
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       … 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       
                         a 
                         n 
                       
                     
                     , 
                     
                       s 
                       ′ 
                     
                   
                   ) 
                 
                 | 
                 
                   
                     
                       ∃ 
                       
                         0 
                         ≤ 
                         i 
                         ≤ 
                         n 
                       
                     
                     ⁢ 
                     
                       
                         s 
                         i 
                         ′ 
                       
                       · 
                       
                         ( 
                         
                           s 
                           = 
                           
                             s 
                             0 
                             ′ 
                           
                         
                         ) 
                       
                     
                   
                   ⩓ 
                   
                     ( 
                     
                       
                         s 
                         
                           n 
                           + 
                           1 
                         
                         ′ 
                       
                       = 
                       
                         s 
                         ′ 
                       
                     
                     ) 
                   
                   ⩓ 
                   
                     ⩓ 
                     
                       0 
                       ≤ 
                       i 
                       ≤ 
                       n 
                     
                   
                   ⁢ 
                   
                     
                       ( 
                       
                         
                           s 
                           i 
                           ′ 
                         
                         , 
                         
                           e 
                           i 
                         
                         , 
                         
                           a 
                           i 
                         
                         , 
                         
                           s 
                           
                             i 
                             + 
                             1 
                           
                           ′ 
                         
                       
                       ) 
                     
                     ∈ 
                     δ 
                   
                 
               
               } 
             
           
         
       
     
     Given a transition relation δ, the set of states represented by:
 
pre→ e 0  . . . e n   
 
is given as:
 
 pre→   e   0    . . . e   n       ={s ′ε Inv |∃ s  ε pre ·∃ a   0    . . . a   n ·δ*( s, e   0    . . . e   n   , a   0    . . . a   n   , s ′)}
 
     Similarly, the set of states represented by  e 0  . . . e n   ←post is given as:
 
     e   0    . . . e   n   ←post ={ s ′ε Inv |∃ s  ε  post ·∃ a   0    . . . a   n ·δ*( s′, e   0    . . . e   n   , a   0    . . . a   n   , s)} 
 
Note the transposition of s and s′ in the above two definitions, which otherwise have identical form. Note also that the semantics of these construct is parameterized on a transition function δ in addition to the set of variables V declared in the specification.
 
     The dynamic semantics of a STS specification Spec is given by defining a satisfaction relation |=between the universe of transition systems  Spec  and transition declarations of the STS specification. 
     In the sequel, the static-semantics described above are used. For the sake of readability, the subscripts in the bracket notation are dropped where it can be understood by context. An auxiliary |= Θ  relation is defined on state components that will be used in the semantic definitions of an STS. 
     For the definition of |= Θ  for states, a state s ε S Θ  satisfies a predicate pred is given as:
 
s|= Θ  pred  s ε  pred 
 
     The semantics of a transition declaration in an STS specification is now presented. These declarations form the dynamic component of the STS language, and specify constraints on the transition relation of transition systems. As discussed above, the dynamic semantics is given by a relation |=between transition systems and transition declarations in the STS as:
 
Θ|= Transition Declaration 
 
The notation |=is defined inductively over the structure of transition declarations in the STS.
 
     For simple transitions:
 
Θ|=( p   1   , e, a, p   2 ) ∀( s   1 , evt, act,  s   2 )εδ Θ :( s   1   |=Θp   1 Λevt= e ) ( s   2   |=Θp   2 Λact= a )
 
     The value Θ satisfies a sub-space transition declaration if the restricted transition system, such that all of its states satisfy the declared state predicate, satisfies the transition declaration.
 
Θ|=sun( p )   T   1   , T   2   , . . . , T   n     Θ sub     p     |=     T   1   , T   2   , . . . , T   n   
 
Where Θ sub     p   (S Θ   sub     p   , ΣEvt Θ   sub     p   , ΣAct Θ   sub     p   , δ Θ   sub      p   ) gives a restricted transition of Θ with respect to predicate p such that Θ sub     p   |=p, ΣEvt  Θ   sub     p   =Θ Σ Evt, ΣAct Θ   sub     p   =Θ Σ     Act    and δ θ   sub     p   ={(s,e,a,s′)εδ Θ |s ε p Λs′ ε p }.
 
     The notation Θ satisfies an abstract transition declaration if the abstraction Θ with respect to the predicates given in the declaration satisfies transition declaration.
 
Θ|=abtsract{right arrow over (   v   l   : p   l   )}   T   1   , T   2   , . . . , T   n     Θπ{right arrow over (   v     1     : p     1     )}|=   T   1   , T   2   , . . . , T   n   
 
Here Θ#{right arrow over (   v     l     :p     l     )} is the standard abstraction of the transition system Θ. A couple of auxiliary definitions are provided before defining the abstraction of a transition system.
 
     For the definition of abstraction, given a transition system Θ and a concrete state s ε S Θ , the abstraction of the state 
             s   ⁢     #     pred   i             
is represented as an assignment of truth-values to v i  that matches with the satisfiability of pred i  by the state s.
 
     
       
         
           
             
               s 
               ⁢ 
               
                 # 
                 
                   
                     v 
                     i 
                   
                   ⁢ 
                   
                     : 
                   
                   ⁢ 
                   
                     pred 
                     i 
                   
                 
               
             
             = 
             
               〈 
               
                 
                   
                     
                       v 
                       i 
                     
                     ↦ 
                     true 
                     ↔ 
                     s 
                   
                   | 
                 
                 ⁢ 
                 
                   = 
                   Θ 
                 
                 ⁢ 
                 
                   pred 
                   i 
                 
               
               〉 
             
           
         
       
     
     In the sequel, the canonical extension of this definition can be used for sets of states. 
     For the definition of abstraction of transition relation given a concrete transition relation, δ, the abstraction of δ with respect to the abstraction v i : pred i , written 
             s   ⁢     #       v   i     ⁢     :     ⁢     pred   i               
is given as:
 
     
       
         
           
             
               s 
               ⁢ 
               
                 # 
                 
                   
                     v 
                     i 
                   
                   ⁢ 
                   
                     : 
                   
                   ⁢ 
                   
                     pred 
                     i 
                   
                 
               
             
             = 
             
               { 
               
                 
                   ( 
                   
                     
                       s 
                       ⁢ 
                       
                         # 
                         
                           
                             v 
                             i 
                           
                           ⁢ 
                           
                             : 
                           
                           ⁢ 
                           
                             pred 
                             i 
                           
                         
                       
                     
                     , 
                     ⅇ 
                     , 
                     a 
                     , 
                     
                       
                         s 
                         ′ 
                       
                       ⁢ 
                       
                         # 
                         
                           
                             v 
                             i 
                           
                           ⁢ 
                           
                             : 
                           
                           ⁢ 
                           
                             pred 
                             i 
                           
                         
                       
                     
                   
                   ) 
                 
                 | 
                 
                   
                     ( 
                     
                       s 
                       , 
                       ⅇ 
                       , 
                       a 
                       , 
                       
                         s 
                         ′ 
                       
                     
                     ) 
                   
                   ∈ 
                   δ 
                 
               
               } 
             
           
         
       
     
     For the definition of predicate abstraction, given a transition system:
 
Θ≡ S, Σ Evt , Σ Act , Init, δ 
 
And an abstraction specification:
 
{right arrow over ( v l :p l   )}
 
Consisting of a sequence of predicates p i  and (fresh) variables v i  the abstraction Θ #  is defined as follows:
 
     
       
         
           
             
               Θ 
               # 
             
             ≡ 
             
               〈 
               
                 
                   S 
                   # 
                 
                 , 
                 
                   
                     ∑ 
                     Evt 
                   
                   ⁢ 
                   
                     , 
                     
                       
                         ∑ 
                         Act 
                       
                       ⁢ 
                       
                         , 
                         
                           Init 
                           # 
                         
                         , 
                         
                           δ 
                           # 
                         
                       
                     
                   
                 
               
               〉 
             
           
         
       
     
     The foregoing discussion discloses and describes merely exemplary embodiments of the present invention. One skilled in the art will readily recognize from such discussion and from the accompanying drawings and claims that various changes, modifications and variations can be made therein without departing from the spirit and scope of the invention as defined in the following claims.