1 Introduction
Computing the size of the largest antichain (set of mutually incomparable elements) is the ‘central’ extremal problem for partially ordered sets (posets) [12]. In addition to some general theory [8], it has attracted study for a variety of specific sets, beginning with Sperner’s Theorem on subsets of ordered by inclusion [11, 2, 9], and for random posets [1]. The size of the largest antichain in a poset is called the width of .
In this work we study languages (regular or context free) over finite partially ordered alphabets, with the lexicographic partial order. Since such languages will in general contain infinite antichains, we study the sets of words of length , and ask how the width of grows with ; we call this the antichain growth rate of .
In addition to its theoretical interest, the motivation for this work is the study of information flow in the context of noninterference for computer security. This raises interesting semantic issues which will be developed in detail in future work, but a simple treatment is given in Section 6, which shows how Theorems 1 and 2 allow for ‘safe’ and ‘dangerous’ information flow to be distinguished.
In Section 2 we set out basic definitions of the lexicographic order, antichains and antichain growth. We then develop some of the attractive theory of antichains in this poset, which will be used later.
In Section 3 we consider the case of regular languages. We draw heavily on and generalise the ideas of [4], which shows a dichotomy theorem for the growth rate of regular and contextfree languages (equivalent to our problem in the special case of the trivial partial order in which all elements are incomparable). We show a dichotomy theorem between polynomial and exponential antichain growth (Theorem 1), and that there is a polynomial time algorithm to distinguish the two cases (Theorem 2).
In Section 4 we move to considering context free languages. We show a similar dichotomy theorem (Theorem 3). However, contrary to both the regular language case and the context free language growth problem, there is no algorithm to distinguish between polynomial and exponential antichain growth (Theorem 4).
In Section 5, we generalise the definition of the lexicographic order to extend to tree languages, and show that there is a trichotomy theorem between polynomial, exponential and doubly exponential antichain growth. This also entails as a corollary that there is a similar trichotomy for language growth rate of regular tree languages, which we believe to be an original result. Finally in Section 6 we discuss the application of Section 3 to information flow.
2 Languages, lexicographic order and antichains
Definition 1.
Let be a finite alphabet equipped with a partial order . Then the lexicographic partial order induced by on is the relation given by

for all (where is the empty word), and

For any , we have if and only if either or and .
Notation: If words and are comparable in this partial order we write . If is a prefix of we write . It is important to emphasise that is used to denote the partial order on and the prefix order on , but not the lexicographic order on .
For a language , we will often write to denote the set (with corresponding definitions for , etc.), and for .
The main subject of this work is antichains, that is sets of words which are mutually incomparable. It will sometimes be useful also to consider quasiantichains (not standard terminology), which are sets of words which are incomparable except that the set may include prefixes.
Definition 2.
A language is an antichain if for every with we have . A language is a quasiantichain if for every we have either , or .
It is easy to see that the property of being an antichain is preserved by the operations of prefixing, postfixing and concatenation.
Lemma 1 (Prefixing).
Let be any words. Then if and only if . Hence for any language , is an antichain (respectively quasiantichain) if and only if is an antichain (quasiantichain).
Lemma 2 (Postfixing).
Let be any words. Then if . Hence for any language , is an antichain if is an antichain.
Lemma 3 (Concatenation).
Let be any words such that and . Then if and only if . Hence if and are antichains then is an antichain.
Clearly the property of being an antichain is not preserved by Kleene star, since will contain prefixes for any nonempty . The best we can hope for is that is a quasiantichain.
Lemma 4 (Kleene star).
Let be an antichain. Then is a quasiantichain.
Proof.
Suppose with and with minimal. Say with . By minimality we have , and since is an antichain we also have . Hence by the concatenation lemma , a contradiction.∎
Ultimately we are going to care about the size of antichains inside particular languages. Since these will often be unbounded, we choose to ask about the rate of growth; that is, if are antichains such that consists of words of length , how quickly can grow with ? We will call an antichain family and ask whether it grows exponentially, polynomially, etc.
Definition 3.
A language is an antichain family if for each the set of words in of length is an antichain.
Definition 4.
A language is exponential (or has exponential growth) if there exists some (the order of exponential growth) such that
is polynomial (or has polynomial growth) if there exists some such that
Note that we will sometimes use other characterisations that are clearly equivalent; for instance has exponential growth if and only if there is some such that infinitely often. We will sometimes refer to a language which is not polynomial as ‘superpolynomial’, or as having ‘growth beyond all polynomial orders’. Of course there exist languages whose growth rates are neither polynomial nor exponential; for instance .
Definition 5.
A language has exponential antichain growth if there is an exponential antichain family . has polynomial antichain growth if for every antichain family we have that is polynomial.
Note that we could have chosen to define exponential antichain growth as containing an exponential antichain (rather than an exponential antichain family). We will eventually see (Corollary 1) that for regular languages the two notions are equivalent. However, for general languages they are not; indeed the following lemma shows that the two possible definitions are not equivalent even for context free languages.
Lemma 5.
There exists a context free language such that has exponential antichain growth but all antichains in are finite.
Proof.
Let with . Let
Then each is an antichain of size consisting of words of length , but we have so any antichain is a subset of for some and hence is finite.∎
This example also justifies our choice of definition: a language which contains antichains of unboundedly large (but finite) size should surely be viewed as having ‘large’ antichains rather than ‘small’.
We observed above that Kleene star does not preserve the property of being an antichain. We conclude this section by establishing Lemma 7, which addresses this problem; if our goal is to find a large antichain, it suffices to find a large quasiantichain (where the precise meaning of ‘large’ is having exponential growth).
Lemma 6.
Let be languages, such that has exponential growth of order (respectively superpolynomial growth). Then has exponential growth of order (respectively superpolynomial growth) for some .
Lemma 7.
Let be an exponential quasiantichain. Then there exists an exponential antichain .
Proof.
Suppose that has exponential growth, that is that infinitely often for some . We will construct a prefixfree set such that has exponential growth. We will construct a sequence of sets (and associated integers and reals for fixed ) such that the intersection of the is the desired set . In particular we will maintain the invariant that each has infinitely often.
Let and let . To produce , note that by the invariant we can choose some such that . Now has exponential growth of order , hence so does . Now
which is a finite union. Hence by Lemma 6 we have that has exponential growth of order for some . Thus taking any with we have that infinitely often. Now let
Informally, to form we leave intact the part of consisting of words of length or shorter. To this we add all the words of length in apart from , and all the words of length which have as a prefix. Since we clearly preserve the exponential growth invariant.
We must now show that is prefix free and that it has exponential intersection with . Note that the set of word lengths in is , and also that
So
where the first inequality is by the construction of from (up to a single word of length is removed, namely ), the second is by the definition of and the third is by the definition of . Hence has exponential growth of order at least .
To show that is prefix free, we show that has no pair such that . Indeed, by the definition of we must have on the one hand that but on the other that , and so . Since for all and only contains words of length for some , we have that is prefixfree. ∎
3 Regular languages
The dichotomy between polynomial and exponential language growth for regular languages has been independently discovered at least six times (see citations in [4]), in each case based on the fact that a regular language has polynomial growth if and only if is bounded (that is, for some ); otherwise has exponential growth.
In [4], Gawrychowski, Krieger, Rampersad and Shallit describe a polynomial time algorithm for determining whether a language is bounded. The key idea is to consider the sets of words which can be generated beginning and ending at state . is bounded if and only if for every we have that is commutative (that is, that for some ), and this can be checked in polynomial time.
In this section, we generalise this idea to the problem of antichain growth by showing that has polynomial growth if and only if is a chain for every , and otherwise has exponential growth. This is sufficient to establish the dichotomy theorem (Theorem 1). To give an algorithm for distinguishing the two cases (Theorem 2), we show how to produce an automaton whose language is empty if and only if is a chain (roughly speaking the automaton accepts pairs of incomparable words in ).
Before proving the main theorems, we require a surprisingly tricky general lemma (Lemma 9), that if and have polynomial antichain growth then so does .
Lemma 8.
Let be a language which does not have polynomial antichain growth. Then there exists an antichain family with growth beyond all polynomial orders.
Proof.
Let be antichain families such that has growth of order at least , and let be integers such that . Then construct by (and all other ). ∎
Lemma 9.
Let be languages with polynomial antichain growth. Then has polynomial antichain growth.
Proof.
Supposing the contrary, by Lemma 8 there exists an antichain family with growth beyond all polynomial orders. Build a family of sets (and associated integers ) as follows:
Let . To produce , choose such that . Let . If then there exists some such that , and let and . Note that is a quasiantichain so is an antichain. Also we must have so .
On the other hand if then there exists some such that , and let for this . Then we have that with is an antichain. Let and . By the same argument as before we have .
Now among our family we have that for each either or . Hence there is an infinite set such that either or . Now each is an antichain of words of length and so is an antichain family with growth beyond all polynomial orders, contradicting the hypothesis that and each had polynomial antichain growth. ∎
Definition 6.
A state of an automaton is bireachable if is reachable from and is reachable from .
Definition 7.
Let be an NFA. Then for each , the automaton .
Theorem 1.
Let be an NFA over a partially ordered alphabet. Then

has polynomial antichain growth if and only if is a chain for every bireachable state , and

if does not have polynomial antichain growth then it contains an exponential antichain (and hence has exponential antichain growth).
Proof.
Suppose that with and bireachable, so and for some and some . Now by the Kleene star Lemma we have that is an exponential quasiantichain and so by Lemma 7 there is an exponential antichain . Then by the Prefixing and Postfixing Lemmas we have that is an exponential antichain.
For the converse, we proceed by induction on . Let and for all . For any , let . Then by the inductive hypothesis we have that has polynomial antichain growth. Also, since is a chain it has polynomial (in particular constant) antichain ‘growth’. Now we have
A trivial restatement of part (ii) of the theorem shows that the two possible definitions of antichain growth are equivalent
Corollary 1.
Let be a regular language. Then has exponential (respectively superpolynomial) antichain growth if and only if contains an exponential (respectively superpolynomial) antichain.
Using Theorem 1 we can produce an algorithm for distinguishing the two cases.
Theorem 2.
There exists a polynomial time algorithm to determine whether the language of a given NFA has exponential antichain growth.
Proof.
First remove all nonbireachable states (trivial flood fill), to give . We will now check for each state whether is a chain.
Let denote the language (that is, a language of fresh letters of the same size as ). Let be the automaton corresponding to over . Let be an NFA, where are fresh and is given by (for all )
and all other sets empty.
Then has two important properties. Firstly every word accepted by is a shuffle of two words and , where such that and is over the primed alphabet (intuitively, the two words are equal for the part where is visited, and then they first differ by two incomparable letters). Secondly, for every we have that the perfect shuffle of and is accepted by (that is, if and WLOG then is accepted by ).
Hence is a chain if and only if is empty, which can be checked in polynomial time (where is the interleaving operator, which can be realised by a product construction). ∎
4 Context free languages
In [6], Ginsburg and Spanier show (Theorem 5.1) that a context free grammar generates a bounded language if and only if the sets and are commutative for all nonterminals , where and are respectively the sets of possible and in productions . They also give an algorithm to decide this (which [4] improves to be polynomial time).
We generalise this to our problem by showing that generates a language with polynomial antichain growth if and only and also the sets of possible for each fixed are chains, and that otherwise has exponential antichain growth. However, we will show that the problem of distinguishing the two cases is undecidable, by reduction from the CFG intersection emptiness problem.
Except where otherwise specified, we will assume all CFGs have starting symbol and that all nonterminals are bireachable: for any nonterminal we have for some and for some .
Definition 8.
Let be a context free grammar (CFG) over . Then for any nonterminal let
Lemma 10.
Let be a CFG over and some nonterminal such that is not a chain. Then contains an exponential antichain.
Proof.
Since is not a chain, we have with such that and . Now is bireachable so also and for some .
Hence
for any . Write for the map (with any ambiguity resolved arbitrarily).
Now is a quasiantichain by Lemma 4, clearly it is exponential and hence by Lemma 7 it contains an exponential antichain . By the Concatenation Lemma we have that is an antichain, and it is exponential because there is a bijection between and such that the length of each word in exceeds the length of the corresponding word in by a factor of at most . By the Prefixing and Postfixing Lemmas we have that is an exponential antichain. ∎
Definition 9.
Let be a CFG over . Then for any nonterminal and any , let
Lemma 11.
Let be a CFG over , some nonterminal and such that is not a chain. Then has exponential antichain growth.
Proof.
We have and such that , , and . Let
Then is an antichain and is an exponential antichain family. ∎
Lemma 12.
Let be a CFG over such that and are chains for all nonterminals and all . Then has polynomial antichain growth.
Proof.
We proceed by induction on the number of nonterminals which appear on the right hand side of productions in . Let be a nonterminal, and let be the CFG obtained from by deleting all productions mentioning on the right hand side and changing the starting state to . Let . Then by the inductive hypothesis has polynomial antichain growth; say any antichain family has for some fixed . Now we have
Let be an antichain family. Now since is a chain and is an antichain, we have
for some with (recall that is defined on as meaning strict prefix).
Since is a chain and is an antichain we cannot have for any and . Hence for each there exists some function and such that
Now since is an antichain we have that is a quasiantichain and in particular an antichain family, and since also we have that . Hence
and so
for sufficiently large . ∎
Combining these three lemmas gives:
Theorem 3.
Let be a context free language. Then either has exponential antichain growth or has polynomial antichain growth.
We now show that the problem distinguishing the two cases is undecidable, by reduction from the CFG intersection emptiness problem. In fact, it is undecidable even to determine whether a given CFG generates a chain.
Definition 10.
CFGIntersection is the problem of determining whether two given CFGs have nonempty intersection. CFGChain is the problem of determining whether the language generated by a given CFG is a chain. CFGExpAntichain is the problem of determining whether the language generated by a given CFG has exponential antichain growth.
Lemma 13.
CFGIntersection is undecidable.
Proof.
[5], Theorem 4.2.1. ∎
Lemma 14.
There is a polynomial time reduction from CFGIntersection to CFGChain.
Proof.
Let be arbitrary CFGs over alphabet . Let , with an arbitrary linear order on , and but and incomparable. Let be a CFG such that
(which can trivially be constructed with polynomial blowup). Then is a chain if and only if . ∎
Lemma 15.
Let be a prefixfree chain. Then is a chain.
Proof.
Let be a minimumlength counterexample with and . By minimality and the Prefixing Lemma we have that . Then by the Concatenation Lemma since is prefixfree we have that , which is a contradiction. ∎
Lemma 16.
There is a polynomial time reduction from CFGChain to CFGExpAntichain.
Proof.
Let be a CFG over a partially ordered alphabet . Let , with . Let be a CFG such that
We claim that has exponential antichain growth if and only if is not a chain.
Indeed, suppose that . Then and so by Lemmas 4 and 7 we have that contains an exponential antichain.
Conversely, suppose that is a chain. Then is a prefixfree chain and so by Lemma 15 we have that is a chain. ∎
Combining these lemmas gives:
Theorem 4.
The problems CFGChain and CFGExpAntichain are undecidable.
5 Tree automata
In this section, we generalise the definition of the lexicographic ordering to tree languages, and prove a trichotomy theorem: regular tree languages have antichain growth which is either polynomial, exponential or doubly exponential.
Notation and definitions (other than for the lexicographic ordering) are taken from [3], to which the reader is referred for a more detailed treatment.
Definition 11.
Let be a finite set of function symbols of arity , and a set of variables. Write for the set of function symbols of arity . Let be the set of terms over and . Let be the set of ground terms over , which is also the set of ranked ordered trees labelled by (with rank given by arity as function symbols).
Note that this generalises the definition of finite words over an alphabet , by taking , giving each arity one and arity zero.
A term is linear if no free variable appears more than once in . A linear term mentioning free variables is a ary context.
Definition 12.
Let be equipped with a partial order . Then the lexicographic partial order induced by on is the relation defined as follows: for any and any and we have if and only if either or and for all .
Note that this generalises Definition 1, by taking for all .
As before we will write if are related by the lexicographic order; the definitions of chain and antichain are as before. To quantify antichain growth we need a notion of the size of a tree. The measure we will use will be height:
Definition 13.
The height function is defined by for all , for all and for all () and . For a language , the set is denoted .
We say that has doubly exponential antichain growth if there is some such that the maximum size antichain in exceeds infinitely often.
Definition 14.
A nondeterministic finite tree automaton (NFTA) over is a tuple where is a set of unary states, is a set of final states, and a set of transition rules of type
for , and . The move relation is defined by applying a transition rule possibly inside a context and possibly with substitutions for the . The symmetric transitive closure of is denoted .
A tree is accepted by if there is some such that . The set of trees accepted by is denoted .
Again this generalises the definition of an NFA: put in transitions for all accepting states , whenever , and set as the initial state.
The critical idea for the proof is to find the appropriate analogue of . This turns out to be the set of binary contexts such that if the free variables are assigned state then the root can also be given state . By analogy to the ‘trousers decomposition’ of differential geometry, we refer to such a context as a pair of trousers.
It turns out that a sufficient condition for to have doubly exponential antichain growth is for to be nonempty for some (note that this does not depend on the particular partial order on ). On the other hand, if is empty for all , then there is in a suitable sense no branching and so we have a similar situation to ordinary languages.
Definition 15.
Let be a NFTA and . A linear term is a pair of trousers with respect to if appear in and . The set of pairs of trousers with respect to is denoted .
Lemma 17.
Let be a reduced NFTA. If there exists some such that is nonempty, then contains a doubly exponential antichain.
Proof.
Let be a pair of trousers with respect to and let be a ground term with . We claim that there exist incomparable ground terms with .
Indeed, we have that and are ground terms with and . Then and are the required .
Then and are pairs of trousers with the property that for all substitutions . It is clear that a doubly exponential antichain can be built from these. ∎
Lemma 18.
Let be a reduced NFTA such that for all . Then has at most exponential growth.
Proof.
Induction on height and number of states appearing on the left of transitions. Without loss of generality we may assume that for some (otherwise consider a finite union of automata). In any accepting run, since the root is labelled with we have that can appear in at most one subtree. Hence where is the maximum arity of symbols in and is with all transitions in which appears on the left removed, which has single exponential growth by the inductive hypothesis. ∎
Definition 16.
Let be a NFTA, and . Define to be the set of unary contexts such that .
Lemma 19.
Let be a reduced NFTA such that for all . Then has polynomial antichain growth if is a chain for all , and otherwise has exponential antichain growth.
Proof.
If is not a chain then clearly we can construct an exponential antichain. On the other hand if is a chain for all then an argument similar to the upper bound in the proof of Theorem 1 shows that has polynomial antichain growth. ∎
Combining these lemmas gives
Theorem 5.
Let be a regular tree language over a partially ordered alphabet. Then has either doubly exponential antichain growth, singly exponential antichain growth, or polynomial antichain growth.
The special case of the trivial partial order (in which elements are only comparable to themselves) yields the fact that the language growth of any regular tree language is either polynomial, exponential or doubly exponential, which we are not aware of having appeared in the literature.
Corollary 2.
Let be a regular tree language. Then has either doubly exponential language growth, singly exponential language growth or polynomial language growth.
6 Information flow
If one party (Alice) is locked in a room with a secret and allowed to communicate with another party (Bob) only in accordance with a specification defined by a finite automaton, how quickly can Alice pass Bob information about the secret?
More precisely, we assume that Alice can pass out messages drawn from some finite set and Bob can pass in messages drawn from a finite set . The specification requires that the final transcript of Alice and Bob’s messages lies in some particular regular language .
This is relevant to computer security because of the problem of information flow between processes operating in a shared environment (given particular importance because of the rise of cloud computing). The approach of formal methods to this problem is via the concept of noninterference [7, 10]: if the actions of the highlevel process (which is in possession of secret information) cannot affect the environment experienced by the lowlevel process (which is untrusted), then there is no way for the lowlevel process to acquire any information about the secret. In some circumstances, however, this may be too much to ask and so we are interested in how much information the lowlevel process can acquire about the secret.
The number of bits of information acquired by Bob after messages is precisely the logarithm of the number of possible transcripts he could have observed, given his strategy for which messages to send. Choosing a strategy is equivalent to choosing a subset of such that no two words which would require different messages from Bob after the same transcript can both be chosen (we assume that Alice has the ability to choose whether to send a message quickly or wait for Bob to send one).
Definition 17.
Words are inconsistent if they do not first differ on an element of (that is, if for some and ); otherwise they are consistent. A set is consistent if for all we have that and are consistent.
The critical observation is that