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.
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.
a and 2b show a syntax diagram for a STS specification.
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.
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.
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:
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Θ, S73 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
=xvε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:
Equivalently, the semantics can be expressed as:
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.
Where δ is the relation:
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:
Given a transition relation δ, the set of states represented by:
pre→e0 . . . en
is given as:pre→
e0 . . . en
={s′ε
Inv
|∃s ε
pre
·∃a0 . . . an·δ*(s, e0 . . . en, a0 . . . an, s′)}
Similarly, the set of states represented by e0 . . . en
←post is given as:
e0 . . . en
←post
={s′ε
Inv
|∃s ε
post
·∃a0 . . . an·δ*(s′, e0 . . . en, a0 . . . an, 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:
Θ|=(p1, e, a, p2)∀(s1, evt, act, s2)εδΘ:(s1|=Θp1Λevt=e)
(s2|=Θp2Λ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)T1, T2, . . . , Tn
Θsub
T1, T2, . . . , Tn
Where Θsubp
Λ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 (vl: pl
)}
T1, T2, . . . , Tn
Θπ{right arrow over (
v
)}|=
T1, T2, . . . , Tn
Here Θ#{right arrow over (v
)} 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
is represented as an assignment of truth-values to vi that matches with the satisfiability of predi by the state s.
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 vi: predi, written
is given as:
For the definition of predicate abstraction, given a transition system:
Θ≡S, ΣEvt, ΣAct, Init, δ
And an abstraction specification:
{right arrow over (vl:pl
)}
Consisting of a sequence of predicates pi and (fresh) variables vi the abstraction Θ# is defined as follows:
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.
Number | Name | Date | Kind |
---|---|---|---|
5652714 | Peterson et al. | Jul 1997 | A |
5801687 | Peterson et al. | Sep 1998 | A |
7505951 | Thompson et al. | Mar 2009 | B2 |
7627570 | Bosloy et al. | Dec 2009 | B2 |
Number | Date | Country | |
---|---|---|---|
20100152948 A1 | Jun 2010 | US |