Pushdown Automata

Copyright (C) 2013, Sven Schneider, Anne-Kathrin Schmuck, Stefan Jacobi

The pushdown plug-in synthesizes a minimally restrictive supervisor for a regular plant language (provided by a deterministic finite automaton (DFA)) and a context free specification language (provided by a deterministic pushdown automaton (DPDA)). The algorithm is formally derived by Schneider and Schmuck in [P1], where its soundness is proven.

The algorithm to construct the minimally restrictive supervisor (i.e., the controller) is called by PushdownConstructController taking the automata modeling the plant and specification languages as its input. To handle (various types of) pushdown automata in this algorithm, the PushdownGenerator is introduced. The plugin additionally provides the two functions PushdownNonblock and PushdownAccessible which are also contained as subroutines in PushdownConstructController. PushdownNonblock makes an arbitrary DPDA nonblocking (i.e., life-lock- and dead-lock-free, accessible and co-accessible) while PushdownAccessible is an efficient algorithm to trim an arbitrary DPDA using PushdownNonblock.

PushdownGenerator

The faudes type PushdownGenerator represents an Extended Pushdown Automaton (EPDA, see [P1]), which is a finite automaton enriched with a stack-variable which can be used to remember aspects of a generated word for later use.

A PushdownGenerator is a tuple G = (Q, Sigma, delta, Qo, Qm, Gamma, Box), with

  • the output alphabet Sigma;
  • the state set Q;
  • the set of transitions delta:Q x (Sigma lambda) x  Gamma* x  Gamma* x Q ";"
  • the set of initial states Qo;
  • the set of marking states Qm;
  • the set of stack symbols  Gamma;
  • the end-of-stack marker  Box.

The token-IO format of PushdownGenerator is based on the format of System, but with an additional property to accommodate stack symbols, as explained in [P2].

Note that an EPDA can do silent moves (called lambda-transitions), possibly modifying the stack but not generating an external symbol. Furthermore, transitions can also pop or push the empty word, allowing lambda to be a pop/push attribute. To handle this feature in libfaudes, the string "lambda" (internally handled by the constant FAUDES_PD_LAMBDA) is defined to only be used when intending to insert a lambda transition or pop/push attribute.

An EPDA is a very general pushdown automaton used in intermediate steps of PushdownConstructController. As discussed in [P1], a DPDA is a EPDA that

  • has a unique initial state,
  • has only transitions popping exactly one symbol, and
  • is deterministic, (i.e., distinct transitions starting in the same state and popping the same stack symbol have to generate distinct output symbols).

When calling the functions PushdownConstructController, PushdownNonblock and PushdownAccessible, the input has to be a DPDA, i.e., the input given by a PushdownGenerator has to satisfy the above properties.

Example:

Consider the output alphabet Sigma = {a,b,u}, the stack alphabet Gamma = {bullet,Box}, the state set Q = {q0,q1,q2,q3}, and the set of marking states Qm = {q0,q2,q3}. Then the automaton M in Figure 1 is a DPDA, and the transition (q,sigma,gamma,s,q') is depicted by an edge from q to q' labeled by (sigma,gamma,s), denoting that by taking this transition, sigma  Sigma is generated, gamma  Gamma is popped from the top of the stack, and  Gamma* is pushed onto the stack (with the right-most symbol first).


Figure 1: DPDA M.

PushdownNonblock

Restricts the unmarked language of the input DPDA to the prefix-closure of its marked language. The automaton structure is not preserved during this operation and the stack symbols are changed. By definition, the output DPDA is nonblocking and has the same marked language as the input DPDA.

Signature:

PushdownNonblock(+In+ PushdownGenerator Input, +Out+ PushdownGenerator Result)

Detailed description:

The algorithm implemented in this function consists of 12 steps, as described in detail in [P1], Section 3. The basic idea is to

  1. transform the input DPDA into a context free grammar (GFG),
  2. obtain an LR(1) grammar by restricting the former to establish operational nonblockingsness and absence of lifelocks ,
  3. transform the LR(1) grammar into a DPDA preserving the desired properties, and
  4. remove all inaccessible states and edges.

Due to the outlined transformations, the original automaton structure will not be preserved and the stack symbols will be changed.

This function may take a long time to execute. Further optimizations to reduce the execution time will be implemented soon.

Example:

Consider the DPDA M in Figure 1. It has a blocking situation when arriving in q_1 with a Box on top of the stack. In this case, the nonblocking version can be generated by ensuring that at least two "a" are generated before a "b" can occur. Therefore, the nonblocking version of M needs to be structurally different in a (usually) non-obvious manner. For this simple example, the problem can be solved by inspection, given the (structurally similar) DPDA in Figure 2.


Figure 2: Nonblocking version of DPDA M from Figure 1.

PushdownAccessible

Deletes all unaccessible transitions and unaccessible states in the input DPDA by preserving its structure. By definition, the output DPDA is accessible.

Signature:

PushdownAccessible(+In+ PushdownGenerator Input, +Out+ PushdownGenerator Result)

Detailed description:

To decide whether a state q is accessible, a copy of the original DPDA is generated, having q as it's only marked state. Then, this copy is made nonblocking using PushdownNonblock. Iff the resulting DPDA is empty, q is not accessible and must be deleted.

To decide whether a transition e is accessible, a copy of the original DPDA is generated, having a newly introduced state r as it's only marked state and e is redirected to r. Then, the copy is made nonblocking using PushdownNonblock. Iff the result DPDA is empty, e is not accessible and must be deleted.

As this function depends on PushdownNonblock, it may take a long time to execute.

Example:

Consider the DPDA M in Figure 1. Here the state q_3 and the transition leading to it are not accessible since q_2 can not be reached with a Box on top of the stack. The algorithm would return the automaton depicted in Figure 3.


Figure 3: Accessible version S of DPDA M from Figure 1.

PushdownConstructController

Synthesizes a minimally restrictive supervisor for its input, consisting of a plant modeled by a DFA and a specification modeled by a DPDA. The resulting supervisor is modeled by a DPDA.

Signature:

PushdownConstructController(+In+ PushdownGenerator Spec, +In+ System Plant, +Out+ PushdownGenerator Result)

Detailed description:

PushdownConstructController generates a proper minimally restrictive supervisor (in the sense of [P3]) by calculating a fixed point of an iterator which is decomposed in two functions ensuring controllability and nonblockingness of their inputs, respectively.

After starting the iteration with the nonblocking product of plant and specification, a loop is entered which executes the following steps (see [P1] for details):

  • construct the product automaton of the current input and the plant,

  • make the product automaton accessible,

  • remove controllability problems,

  • if controllability problems were removed, make the resulting DPDA nonblocking,

  • if no controllability problems were removed, the input to the loop is the output of PushdownConstructController.

As this function depends on PushdownNonblock, it may take a long time to execute.

Example:

Consider a plant modeled by the DPDA P depicted in Figure 4 and a specification modeled by the DPDA S in Figure 3 and assume that "u" is the only uncontrollable event.


Figure 4: DFA "P"

Observe that S x P = S and S has a controllability problem when arriving in q_1 with a Box on top of the stack. However, deleting this state falsely deletes controllable words. Therefore, the resulting minimally restrictive controller needs to be structurally different. For this simple example, the problem can be solved by inspection, given the DPDA depicted in Figure 5.


Figure 5: Resulting minimally restrictive controller for the DFA P in Figure 4 and the DPDA S in Figure 3.

Literature

[P1] S. Schneider, A.-K. Schmuck: Supervisory Controller Synthesis for Deterministic Pushdown Automata Specifications, Technische Universität Berlin, Technical Report PDF, 2013.

[P2] S. Jacobi: Controller synthesis for discrete event systems in the setting of a regular plant and a deterministic context-free specification in Libfaudes , Technische Universität Berlin, Master Thesis, Fachgebiet Regelungssysteme, PDF, 2013.

[P3] W. M. Wonham, P. J. Ramadge: On the supremal controllable sublanguage of a given language, Siam Journal Control and Optimization, Vol 25., No. 3, 1987.

libFAUDES 2.23h --- 2014.04.03 --- with "synthesis-observer-observability-diagnosis-hiosys-iosystem-multitasking-coordinationcontrol-pushdown-timed-simulator-iodevice-luabindings"

>>