PDA with Independent Counters

Push-down automata with independent counters (PDACs) combine the power of PDAs and Petri Nets. They were developed in [21, 15], as a tool of recognition of languages generated by Categorial Dependency Grammars (CDGs). CDGs are classical categorial grammars extended by oriented polarized valencies. They express both projective and non-projective dependencies between the words of a sentence. PDAC is a usual PDA equipped with a finite number of counters. The independence of counters means that their state has no effect on the choice of an automaton move. In the first part of the paper we compare some variants of PDACs and prove the equivalence of two variants of PDAs with independent counters: without syntactic and without semantic ε-loops. Some connections between PDAC-languages and Petri Net languages are noticed. Then we show that PDACs are equivalent to stack+bag push-down automata (SBPA) independently introduced by Søgaard and that ε-acyclic SBPAs recognize exactly CDG-languages. Multimodal Categorial Dependency Grammars (mmCDGs) were introduced in [4] as an extension of GDGs that allows control of some intersections of dependencies. The class of mmCDG-languages is rich enough and has good closure properties, that it forms AFL. In the second part of the paper we extend PDACs and introduce push-down automata with stacks of independent counters (PDASC). PDASCs extend PDACs twofold: (i) each counter is a stack of integers and (ii) there is a restriction function which allows to diminish a head of a counter only if the heads of all dependent counters are zeros. Our main result says that these PDASCs accept exactly the class of mmCDG-languages. The article is published in the author’s wording.

Is dedicated to the memory of Alexander Dikovsky (1945Dikovsky ( -2014) ) Push-down automata with independent counters (PDACs) combine the power of PDAs and Petri Nets.They were developed in [21,15], as a tool of recognition of languages generated by Categorial Dependency Grammars (CDGs).CDGs are classical categorial grammars extended by oriented polarized valencies.They express both projective and non-projective dependencies between the words of a sentence.PDAC is a usual PDA equipped with a finite number of counters.The independence of counters means that their state has no effect on the choice of an automaton move.In the first part of the paper we compare some variants of PDACs and prove the equivalence of two variants of PDAs with independent counters: without syntactic and without semantic ε-loops.Some connections between PDAC-languages and Petri Net languages are noticed.Then we show that PDACs are equivalent to stack+bag push-down automata (SBPA) independently introduced by Søgaard and that ε-acyclic SBPAs recognize exactly CDG-languages.
Multimodal Categorial Dependency Grammars (mmCDGs) were introduced in [4] as an extension of GDGs that allows control of some intersections of dependencies.The class of mmCDG-languages is rich enough and has good closure properties, that it forms AFL.In the second part of the paper we extend PDACs and introduce push-down automata with stacks of independent counters (PDASC).PDASCs extend PDACs twofold: (i) each counter is a stack of integers and (ii) there is a restriction function which allows to diminish a head of a counter only if the heads of all dependent counters are zeros.Our main result says that these PDASCs accept exactly the class of mmCDG-languages.
The article is published in the author's wording.

Introduction
Push-down automata with independent counters (PDAC) are a natural extension of push-down automata (PDA), the class of automata which recognizes context-free languages (see, e.g.[11,20]).They were developed by the second author ( [21,15]) as a tool for recognition of languages generated by Categorial Dependency Grammars (CDGs).Because these automata combine PDAs with Petri Nets, we believe that they are an interesting object of study by themselves.Dependency grammars (DGs) are formal grammars assigning dependency trees (DTs) to well-formed sentences.A DT of a sentence is a labeled arrows tree whose nodes are the words of the sentence.A formal description of DGs and the DG syntax was defined by Tesnière [17].It is well-known that the DTs assigned to constituent structures by context-free (cf-) grammars are always projective: the projections of words fill continuous segments.Meanwhile, discontinuous non-projective dependencies are inevitable in languages.They often mark communicative structure and special constructs encoding complex semantic relations.
The necessity of treating non-projective dependencies in grammars led to many proposals on extending cf-grammars and push-down automata.One of the best known is the class of Tree Adjoining Grammars (TAGs) [13].For this class Embedded Push-Down Automata (EPDA) have been introduced in [18].EPDAs recognize the class of Tree-Adjoining Languages (TALs).EPDAs extend push-down automata (PDA) by replacing the single push-down store used in PDAs with a stack of non-empty push-down stores.TAGs and EPDAs can handle some non-projective dependencies.But their power is not enough to recognize some languages with the intensive cross-serial dependencies.E.g., it was recently shown in [18] that TALs do not include language M IX 3 ⊂ {a, b, c} * containing all the words with equal numbers of the symbols a, b and c.A detailed comparison of TAGs, EPDAs and many others extensions of cf-grammars and PDAs can be found in [18,12].
The Categorial Dependency Grammars (CDGs) were originally introduced by Dikovsky [6].Their mathematical properties were studied by Dekhtyar, Dikovsky and Karlov in [2,3,21].They showed that the family of CDG-languages is closed under all AFL operations, except for iteration2 .Additionally, Karlov defined the class of Push-down Automata with Independent Counters (PDAC) and proved that these automata accept exactly all CDG-languages [21].PDA with independent counters is a usual PDA equipped with a finite number of counters.The independence of counters means that their state has no effect on the choice of an automaton move.An equivalent class of Stack+Bag Push-down Automata was introduced by Søgaard independently [16].
In [7,4] the multimodal extensions of CDGs (mmCDGs) were defined.They add to CDGs cross prohibition functions which prevent from intersections of some dependencies in DTs.It was shown that mmCDG-languages are closed under iteration, and their expressive power and complexity were investigated.
At the same time, the problem of characterizing the mmCDG-languages by appropriately extending push-down automata remained open.In this paper we provide such a characterization by defining Push-down Automata with Stacks of Independent Counters (PDASC), and extension of PDAC.These automata are push-down automata equipped Моделирование и анализ информационных систем Т. 22, № 2 (2015) with finite number of counter stacks.Cells of the stacks contain numbers which can be increased or decreased.At the same time, the contents of the stacks do not influence the selection of the automaton instruction.The automata recognize the words in the language by emptying the stack and zeroing all the counter stacks.Our main result states that PDASC accept exactly all mmCDG-languages.
The rest of this paper is organized as follows: in Section 2 we give definitions of CDGs and mmCDGs and their languages.In Section 3 we consider some variants of PDACs and prove the equivalence of two variants of PDACs with independent counters: without syntactic and without semantic ε-loops.We also notice that PDAC-languages include all intersections of cf-languges and Petri Net languages and that every PDAC-language can be obtained by a homomorphism of the intersection of a cf-language with some special Petri Net language.In Section 4 we show that PDACs are equivalent to stack+bag pushdown automata (SBPA) independently introduced by Søgaard and that ε-acyclic SBPA recognize exactly CDG-languages.In Section 5 we introduce a new class of automata: Push-down Automata with Stacks of Independent Counters (PDASCs) without empty loops.PDASCs are illustrated by an automaton which accepts the language {a n b n c n } + .In Section 6 we prove our main result which says that PDASCs accept exactly the class of languages generated by mmCDGs.

CDG and mmCDG
Similarly to other categorial grammars [1], the categorial dependency grammars (CDG) may be seen as assignments of dependency types to words.Every dependency type assigned to a word w defines its possible local neighborhood in a grammatically correct dependency structure.The neighborhood of w consists of the incoming dependency, i.e. the dependency relation d through which w is subordinate to a word g, its governor, and also of a sequence of outgoing dependencies, i.e. the dependency relations d i through which w governs subordinate words w i .In order to formalize the linguistic notion of the syntactic type, we use the notion of the category.Let C be a nonempty finite set of elementary categories (e.g.subject, predicate, complement).The elementary categories can be iterated: for C ∈ C, C * means a corresponding iterated category.The set of all iterated categories is denoted C * .Elementary and iterated categories are combined in base (local) categories with the constructors \ and /.
In CDGs and mmCDGs, the non-projective dependencies are expressed using so called polarized valencies.Namely, in order that a word G may govern through a discontinuous dependency d a word D that follows the word G somewhere in the sentence CDG assigns to each word in its dictionary a finite set of categories.
Definition 2 A categorial dependency grammar (CDG) is a system G = (W, C, S, λ), where W is a finite set of words, C is a finite set of elementary categories containing the selected name S (an axiom), λ, called lexicon, is a finite substitution on W such that λ(a) ⊂ Cat(C) for each word a ∈ W.
Local dependency rules: Iterated dependency rules: where C ∈ C ∪ {ε} Discontinuous dependency rules: D l .α P 1 ( C)P ( C)P 2 α P 1 P P 2 , where the potential ( C)P ( C) satisfies the following pairing rule FA (first available): Intuitively, the rules L l (L r ) correspond to the classical elimination rules of categorial grammars.Eliminating the argument subtype C they construct the (projective) dependency C in which the governor is the word with the functional type and the subordinate is the word with the argument type.At the same time, they concatenate the potentials of these types (if any).The rules I l , I l 0 (I r , I r 0 ) derive the iterated (projective) dependencies.I l (I r ), analogous to the rule L l (L r ), may derive k > 0 dependencies C and I l 0 (I r 0 ) corresponds to the case k = 0. D l (D r ) creates discontinuous dependencies.It pairs and eliminates dual valencies with name C satisfying the rule FA to create the discontinuous dependency C.
When one of these rules is applied, an edge is added into the dependency structure.This edge goes from the governor to the subordinate word and is labeled with the name of the canceled category.
This calculus defines the immediate provability relation on the strings of categories.Its transitive closure * underlies the following definition of CDG-languages.
The following example shows a simple CDG that generates a non cf-language.
Example 1 Let CDG G abc = ({a, b, c}, {S, A, B, C}, S, λ abc ) where λ abc : This grammar generates language L abc = {a n b n c n | n ≥ 1}.Fig. 1 shows the categories assignment for the word a 3 b 3 c 3 and the dependency structure of the word built by G abc .
A number of properties of CDGs and languages of L(CDG) were established in [2,3,21,15].Specifically, L(CDG) is closed under all Abstract Family of Languages (AFL) [8] operations except iteration 4 .The notion of PDA with independent counters was defined and it was shown that these automata accept exactly CDG-languages.
But it turned out that pairing rule FA can not prevent generation of some unwanted dependencies, e.g.dependencies between two words of different sentences.So, in [4] a new class of multimodal categorial dependency grammars (mmCDG) was introduced.mmCDG extends CDG with a cross prohibition function π of type π : C → 2 C .If D ∈ π(C) and C ∈ π(D) then dependencies C and D should not intersect in the dependency structures.
We adopt the definition of mmCDG from [4].The calculus of dependency types for mmCDG proofs includes rules L l , L r , I l , I r , I l 0 , I r 0 and discontinuous dependency rules of the form where θ 1 ( C)θ( C) satisfies the pairing rule FA C:π(C) : θ has no occurrences of C, C and also of A, A, A, A for all A ∈ π(C).As in the case of CDG rules, D FA l C:π(C) (D FA r C:π(C) ) derive non-projective dependencies.They pair dual valencies C under the negative condition that the resulting discontinuous dependency C does not intersect the discontinuous dependencies in the set π(C).
Let L(mmCDG) be the class of all mmCDG-languages.
In [4] it was shown that L(mmCDG) is closed under all AFL operations including iteration.The following example shows how mmCDG can generated the iteration of the language of Example 1.
G 1 extends G abc of example 1 with a new pair of dual valencies C, C which due to the prohibition function π defends subwords of the form a n b n c n against the penetration of dependencies A and B from the adjacent words.It can be seen on Fig. 2 which presents the dependency structure that G 1 assigns to string w = aabbccabc.Let π be a cross prohibition function, θ be a potential.A potential θ is called balanced with respect to π, if its projection on every pair of dual polarized valencies is a word of well-matched valencies, and there exists an order on the set of the correct pairs such that they can be removed from potential without violating the restrictions of π.
In other words, a potential θ is balanced with respect to π, if there is a proof a θ * a ε which uses the rules D FA l C:π(C) and D FA r C:π(C) only.It is easy to see that if the cross prohibition function of mmCDG G is empty, i.e. π(C) = ∅ for all C ∈ C, then discontinuous dependency rules D FA l C:π(C) are transformed into the First Available (FA-) principle and then G is a CDG.
In [4] we showed also that L(mmCDG) includes some non-semilinear languages and that there is a mmCDG G such that the membership problem for L(G) is NP-complete.At the same time, until this paper, no class of automata for accepting languages from L(mmCDG) has been proposed.

Push-down Automata with Independent Counters
The notion of PDA with independent counters was introduced in [21,15].Informally, the PDA with independent counters is a usual PDA equipped with a finite number of counters.The independence of counters means that their state has no effect on the choice of an automaton move.Let Z be the set of all integers and N be the set of all nonnegative integers.
Definition 7 A push-down automaton with independent counters (PDAC) is a 7-tuple M = Σ, Q, Γ, q 0 , z 0 , P, n , where Σ is an input alphabet, Q is an alphabet of states, Γ is a stack alphabet, q 0 ∈ Q is an initial state, z 0 ∈ Γ is an initial symbol of the stack, P is a set of rules, n is a number of counters.
The rules are of the form q, a, z, q , α, v , where q, q ∈ Q, a Informally speaking, this is a push-down automaton additionally augmented with a finite number of counters.It uses its stack to check the elimination of local categories, and the counters correspond to different types of valencies.
We define a one-step transition: q, w, γ, ū 1 M q , w , γ , ū iff there exists a rule q, a, z, q , α, v ∈ P such that the following three conditions are satisfied: If γ = ε or some component of ū is negative, then the step cannot be made.The relations n M of n-steps derivations of M and * M of derivations of M are defined as usual.
In fact, the numbers in the counters are the numbers of currently unpaired left valencies.The positive numbers in the rules correspond to the left valencies, and the negative numbers correspond to the right valencies.The automaton works like a push-down automaton.Additionally it changes the values of the counters on every step, but the step itself is not influenced by these values, which means that the counters are independent.
The language accepted by the push-down automaton with independent counters M can be defined by emptying the stack and zeroing the counters.
The language L(M ) accepted by PDAC M is the set of all the words accepted by the automaton.
In general, it is possible that the automaton performs ε-instructions in a cycle and changes the counters.In this case it can increase the counters by an unbounded amount without reading new symbols.But all potentials in the CDGs have finite length.One can propose two kinds of restrictions to avoid such empty loops.The first definition is syntactical and was used in [15].
The second one is semantical and follows Søgaard of [16].Definition 11 We say that the PDAC M has a semantic ε-loop if for some q ∈ Q, α, β ∈ Γ * , and vectors ū, v there is a derivation of M q, ε, α, ū + q, ε, β, v that consists only of ε-instructions and at least one of these instructions changes at least one counter.
It is easy to see that if the automaton has no syntactic ε-loops, then it has no semantic ε-loops.The inverse assertion does not hold.E.g. if the automaton has the instructions q, ε, a, q 1 , a, ū , q 1 , ε, b, q, b, v , then they form a syntactic ε-loop, but there are no semantic loops because of different stack symbols.Nevertheless, the following assertion holds.
Theorem 1 For every PDAC without semantic ε-loops there exists an equivalent PDAC without syntactic ε-loops.
Let p 1 , p 2 , . . ., p k be all simple cycles in G.The amount k of such cycles is finite.Let p i = q 1 , ε, z 1 , q 2 , γ 1 , v1 , . . ., q m , ε, z m , q 1 , γ m , vm be one of these cycles.We add m − 1 new states (i, q 2 ), (i, q 3 ), . . ., (i, q m ).These states are different for every cycle.We remove all instructions of the cycle p i from the set of instructions, and we add the following instructions: Besides, for every instruction q j , a, z, q, γ, v , where a ∈ Σ, q j is one of the states from p i , 2 ≤ j ≤ m, we add a new instruction (i, q j ), a, z, q, γ, v .Let us denote the new automaton M .
Obviously, M has no syntactic ε-loops.When M begins to perform a sequence of ε-instructions, it remembers the ε-path in the states.If it reaches the state (i, q m ), it cannot return to q 1 closing the loop, because the last ε-instruction of the cycle was removed.But M could neither move to q 1 due to absence of semantic ε-loops.If M Моделирование и анализ информационных систем Т. 22, № 2 (2015) "chooses" not to perform the loop, but to read a symbol in the state q j , M may "forget" the path which leads it to q j and continue working exactly like M .Thus, L(M ) = L(M ).

2
Let L(P DAC) be the class of languages accepted by push-down automata with independent counters and without (syntactic or semantic) empty loops.
Another way is to define acceptance by final state and final counter states.Let pushdown automaton with independent counters and final states (PDACF) M = Σ, Q, Γ, q 0 , z 0 , P, n, F, C f be PDAC extended with a set of final states F ⊂ Q and a finite set of accepted counter states C f ⊂ N n .

Definition 12
The word w is accepted by PDACF M by means of the terminal states if q 0 , w, z 0 , (0, . . ., 0) * M q , ε, γ, ū for some state q ∈ F , counters states ū ∈ C f and any stack string γ.The language LF (M ) accepted by PDACF M is the set of all the words accepted by the automaton.
Let L F (P DACF ) be the class of languages accepted by PDACF without empty loops.As in the case of PDAs, it can be shown that definitions 9 and 12 are equivalent.
In [15] it was proved that the classes L(CDG) and L(P DAC) are "almost" equal.
Now we list some properties of L(P DAC) which follows from theorem 2 and the results obtained in the papers [2,3,21,15]: • L(P DAC) includes all cf-languages and some non cf-and non TAG-languages; • the parsing problem for L(P DAC) in the general case is NP-complete; • for languages accepted by PDACs with bounded numbers of counters there is a parsing algorithm that has polynomial complexity; • L(P DAC) is closed under union, concatenation, intersection with regular languages, ε-free homomorphisms, and inverses of homomorphisms.
If PDAC does not use its stack, then it turns into a counter automaton without ε-loops.A direct comparison shows that this class of counter automata is equivalent to the class of prompt Weak Counter Automata (WCA) defined by Hack in the well-known report [10].Theorem 9.12 of the report says that the languages generated by prompt WCA are the family of Petri Net languages L 05 completed by ε.Therefore, L(P DAC) includes all cf-languages as well as all Petri Net languages from L 0 .It can be shown that L(P DAC) also includes the intersection of these classes.
Proposition 2 Let L 1 be a cf-language and L 2 be a Petri Net language from L 0 .Then L = L 1 ∩ L 2 ∈ L(P DAC).
On the other hand, it follows from the results of [21] that for every L ∈ L(P DAC) there exist a cf-language L 1 , a Petri Net language P ∈ L 0 and a homomorphism φ such that L = φ(L 1 ∩ P ).
In fact, for some n P is the language P n of words in the alphabet of n pairs of parentheses, whose projections on any single pair of parentheses are well-matched.It is easy to see that P n can be recognized by our counter automaton with n counters.

PDAC and stack+bag push-down automata
In the paper [16] A. Søgaard introduced a stack+bag push-down automaton (SBPA) as a 6-tuple P = Σ, Q, Γ, q 0 , F, δ where Σ is an input alphabet, Q is an alphabet of states, Γ is a stack alphabet, q 0 ∈ Q is the initial state, F ⊆ Q is the set of the terminal states, and is a finite set of transitions, where {. ..}M is a bag or a multiset, i.e. {{γ 1 , . . ., γ n } M | γ 1 , . . ., γ n ∈ Γ, n ≥ 0} is the set of multisets over elements of Γ.
When comparing the definitions of SBPA and PDAC, one cannot help but notice their similarity.In Theorems 3 and 4 we show that these classes of automata are equivalent.
Theorem 3 For every SBPA one can effectively construct an equivalent PDAC.
Proof.Let S = Σ, Q, Γ, q 0 , F, δ be a SBPA.Let Γ = { z 1 , . . ., z k } and z 0 ∈ Γ be a new stack symbol.We build a PDAC M = Σ, Q , Γ ∪ { z 0 }, q 0 , P, k .Here Q is a new set of Моделирование и анализ информационных систем Т. 22, № 2 (2015) states.It contains Q and some new states which will be defined later.The number of counters k is |Γ|. 1) Let (q , α, ∅ M ) ∈ δ(q, x, z i ).This instruction can be performed in two ways.The automaton may replace the top of stack z i by the word α, or it may remove z from the bag and push α into the stack.We add the following instruction in P .q, x, z i , q , α, 0 q, x, u, q , αu, (0, . . ., 0, −1, 0, . . ., 0) for every u ∈ Γ ∪ { z 0 } (here −1 is on i-th place) The first instruction corresponds to the point 1 of definition of derivability relation for SBPA, and the second one corresponds to the point 3.
2) Let (q , ε, α ) ∈ δ(q, x, z i ).The first way to perform the instruction is to pop z i from the stack and add α to the bag, the second way is to remove z i from the bag and add α there.Let v be a vector such that v j is the number of elements z j in the bag α (j = 1, . . ., |Γ|).We add the following instructions to P .q, x, z i , q , ε, v q, x, u, q , u, (0, . . ., 0, −1, 0, . . ., 0) for every u ∈ Γ ∪ { z 0 } (−1 is on i-th place) q , ε, u, q , u, v for every u ∈ Γ ∪ { z 0 } Here q is a new state, different for every instruction.
For every state q ∈ F we add the instruction q, ε, z 0 , q, ε, 0 . 2 Theorem 4 For every PDAC one can effectively construct an equivalent SBPA.
Proof.Let M = Σ, Q, Γ, q 0 , z 0 , P, k be a PDAC with k counters.Let T = { t 1 , . . ., t k } be a set of new stack symbols, a and z 0 be new stack symbols, q 0 and q f be new states.We build a SBPA S = Σ, Q , Z ∪ T ∪ { a, z 0 }, q 0 , { q f }, δ .Here Q contains Q, q 0 , q f , and some other states which are described later.
These instructions model correctly one instruction of the automaton S, because the symbols from Γ ∪ { a } never appear in the bag, and the symbols from T never appear in the stack.Besides, we add several additional instructions: δ(q 0 , ε, ε) = (q 0 , z 0 z 0 , ∅ M ) (put the symbols z 0 z 0 on the bottom of the stack and prepare for modelling), δ(q, ε, z 0 ) = (q f , ε, ∅ M ) for every q ∈ Q (the automaton M emptied the stack; empty the stack, move to q f ). 2 In [16] the following class of SPBAs without semantical ε-cycles is considered.
Definition 13 A SBPA S is called ε-acyclic if it is impossible to apply a transition of the form δ(q, ε, . ..) more than once without reading an element from the input string first.
So, if S is a ε-acyclic SBPA then it has not the cycles of ε-derivations of the form q, ε, α, A + q, ε, β, B .Let L(SBP A) be the class of languages accepted by ε-acyclic stack+bag push-down automata.It is not difficult to see that the constructions of the theorems 3 and 4 transform ε-acyclic SBPA into PDA with independent counters without ε-loops, and vice versa.Then from theorem 4 we obtain the following corollary.
Corollary 1 For every language L ∈ Σ * the following equivalences hold:

Push-down Automata with Stacks of Independent Counters
In this section we introduce Push-down Automata with Stacks of Independent Counters (PDASCs) without empty loops and prove that they accept exactly the class L(mmCDG) of languages generated by mmCDGs.PDASCs extend PDACs twofold: each counter is a stack of integers and there is a restriction function which allows to diminish a head of a counter only if the heads of all dependent counters are zeros.
Definition 14 A Push-down Automaton with Stacks of independent Counters (PDASC) is an octuple M = W, Q, q 0 , Z, z 0 , n, π, P , where • Z is a finite set of stack symbols, and z 0 ∈ Z is the initial stack symbol, • n ∈ N is the number of counter stacks, • π : { 1, . . ., n } → 2 { 1,...,n } is a restriction function, it should be symmetrical, i.e. if y ∈ π(x), then x ∈ π(y) for all x and y, • P is a set of instructions of the form q, a, z, q , α, (i, j) , where q, q ∈ Q, a ∈ W ∪ { ε }, z ∈ Z, α ∈ Z * , i is a natural number from 1 to n (a current counter stack), j ∈ { −1, 0, 1 } defines an execution mode.
Моделирование и анализ информационных систем Т. 22, № 2 (2015) If y ∈ π(x), then we call the counters x and y independent.The configuration of the PDASC M is the quadruple q, w, γ, v , where q ∈ Q is the current state, w ∈ W * is the part of input which is yet to be recognized, γ ∈ Z is the top of the stack, v is a vector of length n whose components are stacks of natural numbers, i.e. v ∈ (N + ) n .
Definition 15 Let M = W, Q, q 0 , Z, z 0 , n, π, P be a PDASC.The transition relation on the set of all configurations of M is defined as follows : q, w, γ, v q , w , γ , v iff there exists an instruction q, a, z, q , α, (i, j) ∈ P such that w = aw (a ∈ W ∪ {ε}), γ = zβ, γ = αβ for some β, and v is defined in the following way.
2) If j = 1, then σ i is obtained from σ i by increasing the top element of σ i by one, and for k = i σ k = σ k if the counters i and k are independent, otherwise σ k is obtained form σ k by pushing zero into σ k .
3) If j = −1, then the top elements of all counters dependent on the i-th counter must be equal to zero, and the top element of the i-th counter must be positive.If at least one of these conditions does not hold, then the instruction cannot be applied.If both conditions hold, then σ i is obtained from σ i by subtracting one from the top element of σ i , for every k = i such that the counters i and k are independent σ k = σ k , and for every k = i such that the counters i and k are dependent σ k is obtained from σ k by popping its top zero element.
Let * be the reflexive transitive closure of .
Note that empty transitions, i.e. transitions that do not read an input symbol, are allowed (a ∈ W ∪ {ε}).However, we forbid empty loops.
Let M = W, Q, q 0 , Z, z 0 , n, π, P be a PDASC.We call it a PDASC without empty loops if there are no states q 1 , . . ., q l ∈ Q such that P contains the instructions q i , ε, z i , q i+1 , α i , (j i , k i ) for i < l and an instruction q l , ε, z l , q 1 , α l , (j l , k l ) .In what follows we consider only PDASC without empty loops.
We call the vector of the form (N + ) n , whose components are stacks of natural numbers, a configuration of counter stacks.Let v 0 = (0; 0; . . .; 0) denote the configuration of the counter stacks whose components are n stacks containing one zero each.

Definition 16
The PDASC M accepts the word w iff q 0 , w, z 0 , v 0 * q , ε, ε, v 0 for some state q ∈ Q.Let L(M ) be the set of all words accepted by the PDASC M .
The following example shows how the restriction function of PDASC helps accept the iteration of non cf-languages.

PDASCs and mmCDGs
We are now ready to establish the relationships between push-down automata with stacks of independent counters and mmCDG languages.It is not hard to see that for every mmCDG G one can efficiently construct an equivalent mmCDG G whose categories do not contain polarized valencies with the left polarities and .Therefore we assume that all the grammars which we consider below do not have such polarities.
We associate with a potential θ some counter stacks configuration c(θ) as follows.
In fact, c(θ) is the counter configuration which is obtained from θ if we treat every valency A i as a command to increase the i-th counter, and every valency A i as a command to decrease the i-th counter.
Lemma 1 i) c(θ) is defined iff there exists a potential θ such that θθ is balanced.
ii) The potential θ is balanced iff c(θ) = v 0 .This lemma is proved by the straight induction on the length of θ.
The following definition proposes a transformation of mmCDGs into cf-grammars with the similar derivations.
Definition 18 Let G = W, C, S, λ, π be a mmCDG.We denote the cf-grammar G = Σ, N, S, R as CF (G), where: Σ = { w θ | w → [α] θ ∈ δ for some α } ; N is the set of all local subcategories from δ ; R is defined in the following way: ii) Induction on the number j of steps of the automaton M .Base case.j = 0.There are no steps.By definition S ⇒ 0 G S. Inductive step.Let q, a 1 . . .a j a j+1 w, S, v 0 * M q, a j+1 w, Z 1 . . .Z s , c(θ) , then by the inductive hypothesis S ⇒ * G a θ 1 1 . . .a θ j j Z 1 . . .Z s and θ 1 . . .θ j is a prefix of a balanced potential.First, let us assume that after this the automaton uses an ε-instruction q, ε, Z 1 , q ρ 1 , Z 1 , (i 1 , j 1 ) .Then the sequence of ε-instructions that follow the first one is unambiguously defined, since the new states are different for every rule of the grammar G .When the automaton reaches a state q ρ l , it uses an instruction of the form q ρ l , a, Z 1 , q, B 1 . . .B t , (i, 0) .This sequence of instructions was obtained from the rule ρ : Z 1 → a θ j+1 j+1 B 1 . . .B t .By construction the change of the stacks of counters corresponds to the potential θ j+1 .Thus, we get the configuration q, w, B 1 . . .B t Z 2 . . .Z s , c(θθ j+1 ) .Since the automaton was able to perform the instructions, the potential θ 1 . . .θ j+1 is a prefix of some balanced potential.Also S ⇒ * G a θ Now we prove the converse.
The following definition presents a transformation of cf-grammars into mmCDGs with the similar derivations.
Definition 19 Let G = Σ, N, S, R be a cf-grammar in Greibach normal form, where the elements of Σ are of the form w θ .We denote by mmCDG(G , π) the mmCDG G = W, N, S, λ, π , where W = { w | w θ ∈ Σ for some θ } and δ is defined in the following way: If G has no potentials, then mmCDG(G) is simply a categorial grammar equivalent to G [1].
The following assertion relates the derivations of G and CF (G).
These two assertions are proved along the lines of Lemma 2 and Corollary 2 in [15].Theorem 6 For every PDASC without empty loops M one can effectively construct a mmCDG G such that L for some θ 1 , . . ., θ n , q 1 , . . ., q t , and c(θ be the left derivation in G 1 .Suppose that c(θ 1 . . .θ n ) is defined and there are not ε-instructions starting with q, i.e. instructions of the form q, ε, z, . . . .Then q 0 , a 1 . . .a n , z 0 , v 0 * M 2 q, ε, z 1 . . .z t , c(θ 1 . . .θ n ) .Proof.First of all let us notice that without the potentials these two assertions are the same as for standard transformation of a push-down automaton into an equivalent cf-grammar.Therefore it is enough to prove only the part of the assertions considering the counters and the potentials.i) Induction on n.Base case.Let n = 1.Then the automaton performs ε-instructions of some complete ε-path r beginning with q 0 and ending with q 1 , then it performs an instruction q 1 , a 1 , z, q 2 , α, (i, j) , and finally it performs ε-instructions of some complete ε-path r beginning with q 2 and ending with q.The rules of G 1 corresponding to ε-instructions have empty potentials, and the rule for a 1 has by construction a potential θ = θ(r)θ(i, j)θ(r ).We see that c(θ) = v.Inductive step.Suppose that there is a derivation of M : q 0 , a 1 . . .a n a n+1 , z 0 , v 0 * M q 1 , a n+1 , β, v 1 * M q, ε, z 1 . . .z t , v .After reaching state q 1 the automaton performs an instruction q 1 , a n+1 , z 1 , q 2 , α, (i, j) , and then it performs the ε-instructions of some complete ε-path r beginning with q 2 and ending with q.By construction the rule corresponding to the first instruction has the symbol a n+1 with the potential θ(i, j)θ(r), and the rules corresponding to ε-instructions have no potentials.Then the total potential is θ = θ 1 . . .θ n θ(i, j)θ(r), and c(θ ii) Induction on n.Base case.If n = 1, then the derivation begins with rules without terminal symbols corresponding to some complete ε-path r, then it contains a rule of the form [pzq t ] → a θ 1 1 [qz 1 q 1 ][q 1 z 2 q 2 ] . . .[q t−1 z t q t ], and then it ends with the rules corresponding to some complete ε-path r .Let p, a 1 , z 1 , q, α, (i, j) be an instruction.Then by construction θ = θ(r)θ(i, j)θ(r ).Therefore, c(θ) = v.Inductive step.Let [pzq t ] ⇒ * G 1 a θ 1 1 . . .a θn n ξ ⇒ * G 1 a θ 1 1 . . .a θn n a θ n+1 n+1 ξ , where ξ, ξ ∈ N + .After obtaining a θ 1 1 . . .a θn n some rule of the form A → a θ n+1 n+1 η is applied, where η ∈ N * , and then the derivation uses rules without terminal symbols corresponding to some complete ε-path r.The first rule corresponds to some instruction q , a n+1 , z 1 , q , α, (i, j) .Then by construction θ n+1 = θ(i, j)θ(r).Having read the symbols a 1 , . . ., a n , the automaton gets the counter stacks configuration v 1 = c(θ 1 . . .θ n ) (by induction hypothesis).After reading a n+1 the automaton gets the counter stacks configuration c(θ 1 . . .θ n+1 ). 2 Lemma 6 i) Let q 0 , a 1 . . .a n , z 0 , v 0 * M 2 q, ε, ε, v and no ε-step can be made from state q.Then [q 0 z 0 q] ⇒ * G 1 a θ 1 1 . . .a θn n for some θ 1 , . . ., θ n , q 1 , . . .q t , and c(θ 1 . . .θ n ) = v. ii) Let [q 0 z 0 q] ⇒ * G 1 a θ 1 1 . . .a θn n be the left derivation in G 1 .Suppose that c(θ 1 . . .θ n ) is defined and there are not ε-instructions starting with q, i.e. instructions of the form q, ε, z, . . . .Then q 0 , a 1 . . .a n , z 0 , v 0 * M 2 q, ε, ε, c(θ 1 . . .θ n ) .Like in previous lemma, the assertion without stacks is proved in standard way.In order to get the statements concerning potentials and counters, one should use the proof similar to the one in the previous lemma, but consider the final step of derivation.

Definition 5 A
multimodal categorial dependency grammar (mmCDG) is a system G = (W, C, S, λ, π), where W, C, S and λ are as in CDGs, and π : C → 2 C is a cross prohibition function.The function π should be symmetrical, i.e. if C ∈ π(D), then D ∈ π(C) for all C and D from C.

Fig. 2 .
Fig. 2. Dependency structure for w = aabbccabc Each elementary category or ε is base.If a category C is base and a category α is elementary or iterated, then the categories [α\C] and [C/α] are also base.There are no other base categories.The set of base categories over C is denoted bCat(C).The set of polarized valencies over C is denoted V (C).Strings θ ∈ P ot(C) = V (C) * are called potentials.A (general) category is either base category or has the form C θ , where θ is a potential and C is a base category.The set of general categories over C is denoted Cat(C).