SEQUENT AUTOMATON - A MODEL FOR LOGICAL CONTROL
ARKADIJ ZAKREVSKIJ 1, BERND STEINBACH2 1
Institute of Engineering Cybernetics NAS, Belarus, e-mail:
[email protected] Freiberg University of Mining and Technology, Germany, e-mail:
[email protected]
2
Abstract. Sequent automaton is an intermediate abstract model used on the way from representation of a desired behavior of some engineering system at the algorithmic level to the detailed description of a logical control device designed to provide this behavior, in terms of logic circuits. In this paper, there are regarded the problems of obtaining a sequent automaton from the preceding model of parallel automaton, its analysis and checking for correctness, the rules of equivalence transformations, finding a corresponding system of Boolean equations and synthesizing a logic circuit which implements the given sequent automaton. Key Words . Logical control, parallel algorithms, parallel automata, partial state assignment, sequent automata, PLA implementation.
1.
SEQUENT AUTOMATON
The classical theory of finite automata considering relations between the sets of input, inner and output states becomes inapplicable when there are regarded digital control systems with many Boolean variables hundreds and more. That is why a new formal model was proposed called sequent automaton [1, 2]. It is a logical dynamic model defined as a set S of sequents si - expressions fi |- k i presenting the "cause-effect" relation between events represented by a Boolean function fi of some variables and an elementary conjunction k i ; |- is the symbol of this relation. The expression fi |- k i is interpreted as follows: if at some moment function fi takes value 1, then immediately after that k i should also become equal to 1 - the values of all variables in k i are defined correspondingly. In such a way a separate sequent can present a definite demand to the behavior of some discrete system, and the set S as a whole - the totality of such demands. The arguments of the regarded functions are decomposed into three classes X, Y and Z, called correspondingly the sets of input, output and inner variables. The variables from X enter only into fi and
can carry information got from some sensors, the variables from Y present control signals and enter only into k i, and the variables from Z are feed-back variables which can enter both into fi and k i. Taken alone, maybe inverted, these variables present basic events (for example, event a occurs when variable a assumes value 1, and event b' when b takes value 0). Events presented by elementary conjunctions are called simple events, (for example, event ab'c occurs when this conjunction equals 1). If some conjunction contains all variables of the automaton, it presents an elementary event. And, at last, events presented by arbitrary Boolean functions are called complicated. Two kinds of behavior interpretation could be used for sequent automata, both of practical interest: synchronous and asynchronous. We shall interpret system S mostly as a synchronous sequent automaton. In this case the behavior of the automaton is regarded in discrete time t - the sequence of moments to , t1 , t2 , ..., tl , tl+1, ... . At a current transition from tl to tl+1 there are executed simultaneously all such sequents si for which fi = 1 and as a result all corresponding conjunctions k i equal 1 (all their factors take value 1). Hence a new state of the sequent automaton (the set of values of inner variables) is defined uniquely, as well as new values of output variables. Suppose that if some of these variables are absent in conjunctions k i of executed
sequents, they preserve their old values. That is why the regarded sequent automata are called inertial [3]. Sometimes the initial state of an automaton is fixed (for moment to), then the automaton is called initialized. The initial state uniquely determines the set R of all reachable states. When computing it, it is supposed that all input variables are free, i. e. by any moment tl they could take arbitrary combinations of values. Let us represent set R by characteristic Boolean function ϕ of inner variables which takes value 1 on the elements from R. In the case of nonitialized automata it is reasonable to consider that ϕ = 1.
2. CORRECTNESS OF SEQUENT AUTOMATA AND ITS CHECKING Evidently, for any sequent si which carries some information inequalities fi ≠ 0 and k i ≠ 1 should hold. Sequents si and sj are called parallel if they could be executed simultaneously. A necessary and sufficient condition of parallelism for non-initialized automaton is relation fi ∧ fj ≠ 0, for initialized - relation fi ∧ fj ∧ ϕ ≠ 0. In order to have a reasonable interpretation for a system S of sequents the latter should be correct, which means that it must have some definite qualities. First of all, it should be consistent, that is very important. That means that for any parallel sequents si and sj relation k i ∧ k j ≠ 0 must hold. Evidently, this condition is necessary, inasmuch as by its violation there exists some variable which should take two different values which is impossible. The second quality is not so necessary for sequent automata as the first one, but is also useful. It is irredundancy. A system S is irredundant if it is impossible to delete from it some sequent or even a literal in a sequent without violating the functional properties of the system. For example, it should not have "non-reachable" sequents, such si for which fi ∧ ϕ = 0. One more useful quality important for asynchronous sequent automata and called persistent, will be regarded in the next section.
3. CANONICAL FORMS Let us say that sequent si realizes sequent sj if the latter is satisfied automatically when the former is satisfied.
Affirmation 1. Sequent si realizes sequent sj if and only if fj ⇒ fi and k i ⇒ k j , where ⇒ is the symbol of formal implication. For instance, sequent ab ∨ c |- uv' realizes sequent abc |- u. If two sequents si and sj realize each other, they are equivalent. In that case fj = fi and k i = k j The relations of realization and equivalence can be extended onto sequent automata S and T. If S includes in some form all demands contained in T, S realizes T. If two automata realize each other, they are equivalent. These relations are easily defined for elementary sequent automata S e and Te which consist of elementary sequents. Left part of such a sequent presents an elementary event, right part presents a basic event (for example, ab'cde' |- q, where it is supposed that X ∪ Z = {a, b, c, d, e}. S e realizes Te if it contains all sequents contained in Te . S e and Te are equivalent if they contain the same sequents. It follows from here that elementary sequent automaton is a canonical form. There exist two basic equivalences formulated as follows. Affirmation 2. Sequent fi ∨ fj |- k is equivalent to the pair of sequents fi |- k and fj |- k. Affirmation 3. Sequent f |- k i k j is equivalent to the pair of sequents f |- k i and f |- k j. According to these affirmations any sequent can be decomposed into a series of elementary sequents (which cannot be decomposed further). That transformation enables to compare any sequent automata checking them for relations of realization and equivalence. Affirmations 2 and 3 can be used for equivalence transformations of sequent automata by elementary operations of two kinds: splitting sequents (changing one sequent for a pair) and merging sequents (changing a pair of sequents for one, if possible). Elementary sequent automaton is useful for theoretical constructions but could turn out quite non-economical when regarding some real control systems. Therefore two more canonical forms are introduced. The point sequent automaton S p consists of sequents in which all left parts represent elementary events (complete states of the automaton) and are different. The corresponding right parts show the responses. This form can be obtained from elementary sequent automaton S e by merging sequents with equal left parts.
The functional sequent automaton S f consists of sequents in which all right parts represent basic events in the space of variables from Z and Y and are different. So the sequents have the form fi1 |- u i or fi0 |- u i' where variables u i ∈ Z ∪ Y, and the corresponding left parts are interpreted as switching functions for them: on-functions fi1 and off-functions fi0. S f can be obtained from S e by merging sequents with equal right parts. This canonical form is convenient for checking asynchronous sequent automata for persistency. The point is that several sequents can be executed simultaneously and if the sequent automaton is asynchronous, these sequents (called parallel) could compete - the so called race could take place. The automaton is persistent if the execution of one of the parallel sequents does not destroy the conditions for executing other ones. Affirmation 4. In a persistent asynchronous sequent automaton for any pair of parallel sequents fi1 |- u i and fj1 |- u j , fi0 |- u i' and fj1 |- u j , fi1 |- u i and fj0 |- u j' , fi0 |- u i' and fj0 |- u j'
4. SIMPLE SEQUENT AUTOMATON Consider now a special but important type of sequent automata - a simple sequent automaton. It is defined formally as a system S of simple sequents expressions k i′ |- k i″ where both k i′ and k i″ are elementary conjunctions representing simple events. This form has an easy matrix representation, inasmuch as every elementary conjunction can be presented as a ternary vector. Let us represent any simple sequent automaton by two ternary matrices: a cause matrix A and an effect matrix B. They have equal number of rows indicating simple sequents, and their columns correspond to Boolean variables - input, output and inner ones. Example 1. The two ternary matrices a 1 − A = 0 − −
b − 0 1 − −
c p q r − −0 − 1 1 − − − − 1 1 , 0 − − 0 0 1 0 −
p q r u v w z − 1 − − 1 − 1 − − 0 1 − 0 − Β = 1 0 − − 1 − 0 0 − − − − 1 − − 1 1 0 − 1 −
represent the following system of simple sequents which is regarded as a simple sequent automaton: aq′ |- qvz , b′ cp |- r′ uw′ , a′bqr |- pq′vz′ ,
the corresponding relation should hold: fi1 fj1 : u i' u j' ⇒ (fi1: u i' u j ) (fj1 : u i u j'), fi0 fj1 : u i u j' ⇒ (fi0: u i u j ) (fj1 : u i' u j'), fi1 fj0 : u i' u j ⇒ (fi1: u i' u j' ) (fj0 : u i u j), fi0 fj0 : u i u j ⇒ (fi0: u i u j' ) (fj0 : u i' u j),
where expression f : k means the result of substitution those variables of function f which enter elementary conjunction k for the values satisfying equation k = 1. The prove of this affirmation can be found in [4]. Note in conclusion that both forms S p and S f can be obtained also from arbitrary sequent automata by disjunctive decomposition of the left parts of the sequents (for the point sequent automaton) or conjunctive decomposition of the right parts (for functional one).
c′ r′ |- p′ w , c′pq′ |- qru′w . It is rather easy to check a simple sequent automaton for consistency. An automaton represented by ternary matrices A and B is consistent if for any orthogonal rows in matrix B the corresponding rows of matrix A are also orthogonal. Note that this condition is satisfied in Example 1. The model of simple sequent automaton is rather close to the well known technique of disjunctive normal forms (DNF) used for hardware implementation of systems of Boolean functions. Indeed, each row of matrix A may be regarded as a conjunctive term (product), and each column in B defines DNFs for two switching functions of the corresponding output or inner variable: 1s indicate terms entering ONfunctions, while 0s indicate terms which enter OFFfunctions. Note, that these DNFs can be easily
obtained by transforming the regarded automaton into S f-form and changing after that expressions fi1|- u i for u i1= fi1 and fi0|- u i' for u i0= fi0.
p 1= a'bqr, r1 = c'pq',
p 0 = c'r',
q 1 = aq' ∨ c'pq',
r0 = b'cp,
u 1 = b'cp,
Expression −k i′ is called waiting operation and is interpreted as "wait until k i′ = 1". Expression →k i″ is called acting operation and is interpreted as "provide term k i″ with value 1". Expression →νi is called transition operation and is explained below.
q 0 = a'bqr, u 0 = c'pq',
v1 = aq' ∨ a'bqr, w1 = c'r' ∨ c'pq', w0 = b'cp, z1 = aq', z0 = a'bqr. It is seen from here that the problem of constructing a simple sequent automaton with minimum number of rows is similar to the minimization of a system of Boolean functions in the class of DNFs known as a hard combinatorial problem. An approach to its solving was suggested in [3]. The considered model turned out to be especially convenient for representation of programmable logic arrays (PLA) with memory on RS-flip-flops. It is used also in methods of automaton implementation of parallel algorithms for logical control described by expressions in PRALU [9].
5. CONVERTING A PARALLEL AUTOMATON INTO A SEQUENT ONE A formal language PRALU has been proposed to describe parallel algorithms of logical control, which is necessary at the initial step of high-level design of logical control devices [9]. Any algorithm is represented in PRALU as a set of chains (linear algorithms composed of waiting and acting operations) that can be executed one by one or in parallel under the control of a mechanism of the Petri net type. A standard form for PRALU-algorithms has been introduced interpreted as the parallel automaton [7]. A parallel automaton can be regarded as an unordered set of restricted chains αi , each having the form µi : −k i′ →k i″ →νi where k i′ and k i″ are elementary conjunctions using some input and output variables from X and Y respectively, µi and νi are initial and terminal labels represented by some subsets of the set M = = {1, 2, …, m} the elements of which are called partial states. Unlike the conventional sequential automaton, the parallel automaton can be placed in several (partial) states at the same time. They constitute a global state N which takes value Nt at the current moment t.
Chain αi is executed if µi ⊆ Nt and k i′ = 1 (if the automaton is in the states listed in label µi (and, perhaps, in some others) and if the variables in conjunction term k i′ assume the values at which k i′ = 1). In that case the variables from term k i″ accept the values at which k i″ = 1, and the partial states forming label µi are substituted by the states from label νi. Thus a transition is made between groups of states rather than between separate states. The states not listed in µi and νi are not affected by this transition: if the automaton finds itself in any of them, it will remain there, otherwise it will not enter this state. Analogously, assume that all variables from k i″ preserve their new values until some other operations change them. An automaton with such a property is called inertial. Note that several chains can be executed simultaneously - they are called parallel. To convert a parallel automaton into a sequent one, we have to represent partial states in terms of Boolean variables, i. e. to solve the task known as the state assignment. For a traditional sequential automaton, when all the states are incompatible, each state may be represented by a Boolean vector. But in the case of a parallel automaton with partial states which could coexist (be parallel) this method is inadequate. That is why it was suggested in early eighties [5, 6] to use for coding partial states ternary vectors, with components taking values from the set {0, 1, -}, where symbol "-" is interpreted as an arbitrary value (0 or 1). Such vectors should be non-orthogonal for parallel states - not to have a component where one vector takes value 1 and the other value 0. To minimize the code, it is reasonable to use orthogonal ternary vectors for non-parallel (incompatible) states. Another good quality of the code could be reached by that, which is called superseding quality. In that case the execution of any transition can be reduced to the automaton displacement into the partial states forming the set νi \ µi ; as to the states from µi \ νi, the automaton leaves them automatically. The code with such a property has been called the superseding ternary code (ST-code). A series of practically efficient methods were suggested for its construction [8, 9, 10]. Suppose that regarding some parallel automaton we have got an ST-code for it. Then we can pass from
every chain αi to a corresponding simple sequent si implementing it, that is to transform µi: −k i′ →k i″ →νi
into
k i* |− k i**.
This can be done in the following way: labels µi and νi are changed for the ternary vectors presenting the result of "intersection" of the vectors coding the labels components; the obtained vectors are interpreted as conjunction terms γi′ and γi″ ; the sequent terms are found by the formulae k i* = γi′ k i′ , k i** = k i″ γi″ . Example 2. Consider the chain
called programmable logic arrays, or PLAs, regarded below. Example 3. Consider the simple sequent automaton shown in Example 1. It is implemented by a PLA represented on Fig. 1. It has three inputs (a , b, c) supplied with invertors (NOT-elements) and four outputs (u, v, w, z) supplied with RS-flip-flops. So its input and output lines are doubled. The six input lines are intersecting with five inner ones, and at some points of intersection transistors are placed. Their disposition can be presented by a Boolean matrix easily obtained from matrix A of Example 1, and determines the ANDstage of the PLA. In a similar way the OR-stage of the PLA is found, on the intersection of inner lines with 14 output ones.
5.6: −ac' →u'vx →4.6.9 . Suppose that the partial states indicated in the chain labels are coded by the ternary vectors with values of coding variables z1, z2, z3, z4, as shown below
− 1 1 − − 1 0 −
− − − 0
1 − − −
b c
z1 z2 z3 z4 4 5 6 9
a
.
Then vector 1 1 − − is assigned to the initial chain label, and vector 0 1 0 1 - to the terminal one. On the whole, the chain is implemented by the simple sequent
p p' q q' r r' p p' q q' r r' u u' v v' w w' z z'
z1 z2 a c' |− u' v x z1' z3' z4 - note that literal z2 was deleted from the right part as unnecessary. In such a way, all chains of the parallel automaton, for which partial states an ST-code was obtained preliminary, are transformed into corresponding simple sequents. The set of these sequents constitutes a simple sequent automaton that implements the regarded algorithm for logical control.
Fig 1. PLA with output RS-flip-flops
6. HARDWARE IMPLEMENTATION OF SEQUENT AUTOMATA Matrix representation of simple sequent automata well matches with technique of constructing programmable logic circuits having the matrix structure [4, 6]. This fact considerably facilitates solving the task of hardware implementation of parallel logic control algorithms. We shall show that on the example of so
ACKNOWLEDGMENT This work was financially supported by ISTC project B-104-98.
REFERENCES 1.
Grigoryev V.S., Zakrevskij A. D., Perchuk V.A. The sequent model of the discrete automaton. Vychislitelnaya tekhnika v mashinostroenii, Mart 1972, Minsk, Institute of Engineering Cybernetics, pp.147-153 (in Russian).
2.
Zakharov V. N. Sequent description of control automata. - Izvestiya AN SSSR, 1972, ? 2 (in Russian).
3.
Zakrevskij A. D. Optimizing sequent automata. Optimization in digital devices design, L., 1976, pp. 42-52 (in Russian).
4.
Zakrevskij A.D. Logical synthesis of cascade networks. - Moscow: Nauka, 1981(in Russian).
5. Zakrevskij A.D. Block coding of partial states in automata implementing parallel logical control algorithms. - Izvestiya AN SSSR, Tekhnicheskaya kibernetika, 1983, No 5, pp.3-11 (in Russian). 6. Zakrevskij A.D. PLA implementation of logical control algorithms. - Avtomatika i telemekhanika, 1983, No 7, pp.116-123 (in Russian). 7. Zakrevskij A.D. Parallel automaton. - Doklady AN BSSR, 1984, v.28, No 8, pp.717-719 (in Russian). 8. Pottosin Yu.V. A method for partial state assignment in a parallel automaton using codes of minimum length. - Avtomatika i vychislitelnaya tekhnika, 1995, No 6, pp. 60-67 (in Russian). 9. Zakrevskij A.D. Parallel algorithms for logical control. - Minsk, Institute of Engineering Cybernetics, 1999 (in Russian). 10. Zakrevskij A.D., Vasilkova I.V. A quick algorithm for state assignment in parallel automata. -– Proceedings of the Third International Conference on Computer-Aided Design of Discrete Devices (CAD DD'99), Minsk, November 10-12, 1999, vol.1, pp.40-44.