A new Cryptosystem based on Formal Language Theory

Size: px
Start display at page:

Download "A new Cryptosystem based on Formal Language Theory"

Transcription

1 A new Cryptosystem based on Formal Language Theory by Mircea Andrasiu, Adrian Atanasiu, Gheorghe Paun, Arto Salomaa Abstract. A classical cryptosystem and a public-key cryptosystem are proposed, based on the passing from a string of production labels (embedding in some way the message to be encrypted) to the string generated by the grammar by a (leftmost) derivation with that given control word (thus obtaining the cyphertext). Some problems of formal language theory appearing in this framework are discussed. 1 Introduction The ciphering - deciphering operations are, generally speaking, operations on strings over given alphabets, hence they can be considered to be formal language theory operations. Moreover, certain concrete steps and questions appearing in this framework have precise formal language theory counterparts (letter substitutions in Caesar systems are morphisms, even codings, the Richelieu systems are based on shuffle operations [2], the Cardano systems with an auto-modified key can be simulated by a gsm [1], the system can be context - free or context sensitive, the deciphering can be ambiguous or not, the complexity of cryptanalysis is often related to the membership complexity for given classes of languages and so on). In this context, it is somewhat surprising that the formal language theory is not more involved in this field. Of course, there are probably about a dozen of papers dealing with formal language theory and cryptography, but compared to the huge bibliography of number - theoretic cryptography, for instance, this seems to be unmotivatedly small. In short, we believe that formal language theory has rich unexplored resources, which could be used in cryptography (and conversely, by such applications new problems can appear, offering further developments of the theory). The aim of the present paper is to contribute to the strengthening of the bridge between formal language theory and cryptography, by proposing both a classical system (with secret enciphering - deciphering key and algorithms) and a public - key system. The starting point is the next two remarks: 1

2 1. Given a grammar G, with the rules labelled by symbols in a set Lab, and a given string x Lab, a derivation in G with the control word x is easy to construct (if exists); a string y in L(G) is found in this way, related to x. Conversely, given a string y L(G), to find a control word x associated to a derivation of y in G is a hard operation. 2. The parsing with respect to context - free grammars can be done in polynomial time (in O(n 3 )), but the membership is not decidable for 0 - type grammars and N P - complete for context sensitive grammars. The situation is similar in factorization: it is easy to multiply numbers, but it is hard to factor them. 2 Notations Before implementing the previous remarks in a cryptosystem, we specify some formal language theory notations. V the free monoid generated by the alphabet V ; λ the null element of V (V + = V \ {λ}); x the length of x V ; ( λ = 0); alph(x) the set of symbols appearing in x; G = (V N, V T, S, P ) a Chomsky grammar (V G = V N V T ); Sz(u v) the control word of the leftmost derivation u v; Sz left (G) the set of control words associated to all leftmost derivations in G; G left (x) the string generated by a leftmost derivation in G with control word x, if such derivation exists; undefined otherwise; Shuf(x, y) = {x 1 y 1 x 2 y 2... x n y n n 1, x i, y i V, x = x 1 x 2... x n, y = y 1 y 2... y n }. A context - free grammar G = (V N, V T, S, P ) is reduced if for all A V N there is a derivation S uav uwv, u, v, w VT. All grammars used in this paper are supposed to be reduced. Other notions and notations in formal language theory we shall use are supposed to be known, for instance, from [7]. 3 A classical cryptosystem Assume we have a context - free grammar G = (V N, V T, S, P ), known to be users of a cryptosystem, but kept secret from the illegal users. Let Lab be the set of labels of rules in P Lab = {r 1,..., r n }. The labelling mapping, φ : P Lab, is not necessarily one-to-one. Assume a string x (a phrase in English) is to be encrypted. By a given one-to-one coding (also known to the users of the system), h : V E lab; V E 2

3 the English alphabet (possibly including other symbols, punctuation marks, space, digits) we pass from x to x = h(x) Lab. (Clearly, we must have card(v E ) card(lab)). Construct the string y = G left (x ) if exists. This is the encryption of x; it is transmitted to the receiver. The receiver parses y with respect to G, thus finding a control word z associated to a leftmost derivation in G, then applies h 1 to z and finds z = h 1 (z). If the grammar G is unambiguous, then z = x, hence z = x and the deciphering is uniquely completed. In fact, for x an English phrase, when G is ambiguous, it is highly probable that only one control word x obtained by parsing y in G leads by h 1 to a correct English phrase and this must be the plaintext message x. The main problem in constructing such a system is to have a grammar G such that either, for all x Lab, there is an y L(G), y = G left (x), or at least, for x in a given large enough subset T of Lab, to have this property (all or at least a significantly large set of messages can be encrypted using a given grammar G). We say that such a grammar G is total (T - total respectively). When having such a grammar, the encryption is a very simple operation; it can be done in linear time. Also the deciphering is easy, as it can be done in at most cubic time (we can take G even LL, LR or other type of grammars, in order to make the work of receiver easier). What about the security of the system? The key consist of the grammar G, its labelling φ and the coding h. The coding simple renames symbols, hence is vulnerable to frequency based attacks; also φ, depending on the shape of rules, can be viewed as a somewhat simple substitution; if this is not the case, we can think that we have (card(lab)) card(p ) labelling possibilities. The main part of the key is the grammar G. Knowing the ciphering (type of) algorithm and a (long enough) ciphertext y, the cryptanalyst s intuitive strategy is to build systematically grammars until reaching the right one, G, thus finding the encrypted message. But, what means systematically? For instance, one can generate all grammars with increased cardinality of V N, starting from V N = {S}, with card(v T ) = alph(y), and in the increased order of the total number of symbols used when writing the set of productions (the parameter Symb in [3]). However, before reaching G, one has to check all grammars G, with Symb(G ) < Symb(G), hence at least (card(v G )) Symb(G) 1 grammars. The problem is (intuitively) intractable (in this way). Returning to the question of finding total grammars, as formulated before, the definition seems to be too restrictive (if the labelling is one-to-one, no grammar is total: bb, for b the label of a terminal rule, cannot be in Sz left (G)), but T total grammars are easy to find, for large sets T. For example, take a context - free grammar G = (V N, V T, S, P ) with V N = {S} and infinite L(G). Each string in Lab 1 where Lab 1 is the set of labels of nonterminal rules in P, can be the control word of a (partial) derivation in G; each such a derivation 3

4 can then be finished by using terminal rules in P. Such a separation of nonterminal and terminal rules in a leftmost derivation (we call it an NT - derivation) is, however, a very strong restriction, which, intuitively, decreases the safety of the system. Indeed, given a context - free grammar G, define L NT (G) = {x VT w 1 w 2 = x, where S w 1 is a leftmost derivation using only nonterminal rules, and w 2 uses only terminal rules } w 1 We have Proposition 1 1. L NT (G) L(G) for all context - free G; 2. L NT = L(G) for all linear G; 3. L NT (G) is linear language, for G context - free. Proof: Only (3) needs some arguments. Take G = (V N, V T, S, P ) and construct G = (V N, V T, S, P ), with P = {A x A x is linear rule in P } {A x 1 A 1 x 2 y 2 x 3... x n y n x n+1 A x 1 A 1 x 2 A 2 x 3... x n A n x n+1 P, n 2, A i V N, x VT for all i, and A i y i are terminal rules in P i, 1 i n}. We have L NT (G) = L(G ); indeed, given a nonterminal rule A x 1 A 1 x 2 A 2 x 3... x n A n x n+1, using it in leftmost manner and separated from terminal rules, only the first nonterminal in its right-hand member, A 1 can be rewritten by a nonterminal rule; the other symbols A 2,..., A n will be replaced by terminal strings, using terminal rules in P. On the other hand, this (intuitive) loss of safety when considering only NT - derivation is somewhat compensed by the fact that even for ambiguous context - free grammars G, the strings in L NT (G) can be generated unambiguously (we say that G is NT - unambiguous). Proposition 2 There are ambiguous context - free grammars which are NT - unambiguous. Proof: Consider, for example, the grammar G = ({S}, {a, b}, S, P ), with the rules SS SaS, S bss, S b It is ambiguous, as for the string bbab we have two leftmost derivations: S bss bbs bbsas bbbas bbbab S SaS bssas bbsas bbbas bbbab

5 Only the second derivation is a NT - derivation. In general, for each string in L NT (G) we have only one NT - derivation. Indeed, to each nonterminal leftmost derivation in G corresponds a nonterminal derivation in the associated linear grammar with the rules S Sab, S bsb, S b (see the previous assertion (3)) and this linear grammar is unambiguous (each nonterminal rule applied to some string xsy leads to a different terminal string). Remark 1 Observe that in each case the number of rules in the associated linear grammar equals the number of rules in the original grammar; this is due to the fact that there is only one terminal rule. Sometimes the language L NT (G) in much simpler than L(G). For instance, the Dyck language over two letters, D a,b is generated by the grammar ({S}, {a, b}, S, P ) with the rules S asb, S SS, S λ. The associated grammar G has the rules S asb, S S, S λ. Hence, L NT (G) = {a n b n n 0}. Both grammars are unambiguous if the redundant rule s S is removed. In general, (2) and (3) in Proposition 1 show that the family of languages of the form L NT (G) equals the family of linear languages. In fact, the following stronger result can be obtained: Proposition 3 The family of linear languages is equal to the family of languages L NT (G), for G context - free grammars with L(G) non - linear language. Proof: In view of Proposition 1, we have only one inclusion to prove. For, let G = (V N, V T, S, P ) be a linear grammar; take S 1, S 2 V N, a, b V T and consider the grammar with G = (V N {S 1, S 2 }, V T {a, b}, S 1, P ) P = P {S a SS 2, S 2 as 2 b, S 2 S 2 S 2, S 2 λ) Clearly, L(G ) is not linear (we have L(G ) = L(G)D a,b ) and L NT (G ) = L(G) (we start by S 1 SS 2, but S 2 can only produce the string λ). A useful modification of the previous cryptosystem is the next one. Start as above by the string x VE, encode it by h : V E Lab, but take G and Lab in such a way that card(lab) > card(v E ). For a string x 0 (Lab \ 5

6 h(v E )), consider the set Shuf(h(x), x 0 ), as well the morphism h : Lab Lab, h (r) = r, r h(v E ), h (r) = λ, r Lab \ h(v E ). Clearly, it is enough to find a string x Shuf(h(x), x 0 ) for which y = G left (x ) there exists.the receiver has to parse y, apply h in order to remove the dummy symbols in Lab \ h(v E ) and h 1 in order to find the message x. Now, we have more possibilities to find a derivation in G associated to a given string of labels and, moreover, we can take the dummy string x 0 in such way to increase these possibilities. The binary case Another interesting case, related to previous modification, is to have only binary messages to be encrypted (possibly as a first encoding of a message in a natural language). Starting from such a message x {0, 1}, we associate 0 with some label r 1 and 1 with some label r 2, then shuffle the obtained string with some x 0 (Lab \ {r 1, r 2 }) and proceed as above. (Possibly, 0 and 1 may be both associated to more labels). In this case, the message has no redundance, hence the decryption must be unique, that is the grammar G must be unambiguous (NT - unambiguous, when using only NT - derivations). Increased possibilities to find suitable grammar G are obtained in this case, as we need G to be only (0, 1) - total, that is to have G(Sz left (G)) {0, 1} + for g : Lab {0, 1} a morphism such that g(r 1 ) = 0, g(r 2 ) = 1, g(r) = λ, r Lab \ {r 1, r 2 }, for given r 1, r 2 Lab. Before considering an example, let us remark that the encrypted message is linearly bounded with respect to the plaintext, providing the message is shuffled with a dummy string x 0 of linearly bounded length with respect to x, x 0 c x ; indeed, y c ( x + x 0 ) c ( x + c x ), c = max{ z A z is a rule of G}. Example 1 Consider the grammar G = ({S, A, B}, {a, b, c}, S, P ) with the next rules (we also specify their labels): r 1 : S asb r 3 : A aab r 5 : B AB r 2 : S cab r : A c r 6 : B c This is a (0, 1) - total grammar as we can take g(r 3 ) = 0, g(r 5 ) = 1. Indeed, each string in the next set corresponds to a leftmost derivation in G: T = r1r 2 (r3r (r 5 r ) r 5 ) r3r r 6 and g(t ) = {0, 1} ; in fact, Sz left (G) = T, as the reader can verify, and L(G) = {a j ca i 1 cb i 1 a i 2 cb i 2... a i k cb i k j 0, k 1, i s 0 (1 s k)} 6

7 Consider now a message to be encrypted, say x = We choose a string x T such that g(x ) = x for g(r 1 0 = g(r 2 ) = g(r ) = g(r 6 ) = λ, g(r 3 ) = 0, g(r 5 ) = 1, for example x = r1r 3 2 r r 5 r 3 r 3 r r 2 r 5 r r 5 r 3 r r 5 r r 5 r r 6 (we have x Shuf(r 5 r 3 r 3 r 5 r 5 r 3 r 5 r 5, r1r 3 2 rr 6 6 )). According to x, we have the next derivation in G: S r 1 asb r 1 a 2 Sb 2 r 1 a 3 Sb 3 r 2 a 3 cabb 3 r a 3 ccbb 3 r 5 a 3 ccabb 3 r 3 a 3 ccaabbb 3 r 3 a 3 cca 2 Ab 2 Bb 3 r a 3 cca 2 cb 2 Bb 3 r 5 a 3 cca 2 cb 2 ABb 3 r a 3 cca 2 cb 2 cbb 3 r 5 a 3 cca 2 cb 2 cabb 3 r 3 a 3 cca 2 cb 2 caabbb 3 r a 3 cca 2 cb 2 cacbbb 3 r 5 a 3 cca 2 cb 2 cacbabb 3 r a 3 cca 2 cb 2 cacbcbb 3 r 5 a 3 cca 2 cb 2 cacbcabb 3 r a 3 cca 2 cb 2 cacbccbb 3 r 6 a 3 cca 2 cb 2 cacbcccb 3 = a 3 c 2 a 2 cb 2 cacbc 3 b 3 = y This string y is transmitted to the receiver. The receiver parses y according to G and, as G is unambiguous (easy to verify), recovers the string x ; applying g to x, one finds x, the message. More problems seem to be both practically and theoretically important in this framework: (Q 1 ) : It is decidable whether an arbitrary context - free grammar G (with labelled rules) is (0, 1) - total? (Q 2 ) : It is decidable whether for arbitrary x {0, 1} and arbitrary (not necessarily (0, 1) - total) context - free grammar G we have x g(sz left (G)), for some g : Lab {0, 1} as above? (Q 3 ) : Is there an algorithm such that, for given x {0, 1} and a (0, 1) - total grammar G, produces a string x Sz left (G) such that x = g(x )? We solve here these problems (the first one only partially). For (Q 1 ), we ave to decide whether g(sz left (G)) \ {λ} = {0, 1} + ; the equivalence of a context - free grammar with a regular grammar is undecidable for arbitrary grammars, but in our case we have: Proposition It is decidable whether a context - free grammar with one - to - one labelling of rules is (0, 1) - total. Proof: Let G = (V N, V T, S, P ) be a reduced context - free grammar with rules labelled in a one-to-one manner by symbols in a set Lab, let c 1, c 2 V T be two symbols and let r 1 : A 1 x 1, r 2 : A 2 x 2 be two rules in P. Consider the grammar (depending on r 1, r 2 ) G = (V N, V T, S, P ) with P = P {c 1, c 2 }, P = (P \ {A 1 x 1, A 2 x 2 }) {A 1 c 1 x 1, A 2 c 2 x 2 } We assume A 1 c 1 x 1, A 2 c 2 x 2 are also labelled by r 1, r 2 respectively. For given X V N define also the grammar G X = (V N, V T, X, P ). 7

8 We consider now the next six properties (predicates): P 1. L(G ) VT {c 1 }VT = P 2. L(G ) VT {c 2 }VT = P 3. L(G A 1 ) {c 1 }VT {c 1 }VT = P. L(G A 1 ) {c 1 }VT {c 2 }VT = P 5. L(G A 2 ) {c 2 }VT {c 2 }VT = P 6. L(G A 2 ) {c 2 }VT {c 1 }VT = All these properties are decidable (the emptiness is decidable for context - free languages). Take the morphism g : Lab {0, 1} defined by g(r 1 ) = 0, g(r 2 ) = 1, g(r) = λ, r Lab \ {r 1, r 2 }. Assertion: g(sz left (G)) {0, 1} + if and only if all predicates P 1 P 6 are false. Indeed, if P 1 is true, then 0 g(sz left (G)) (there is no derivation using one time r 1 and never using r 2 ); similarly, 1, 00, 01, 11, 10 are not in g(sz left (G)) when P 2, P 3, P, P 5 and P 6 are true, respectively. Conversely, assume all P 1 P 6 are false (hence the corresponding intersections are non-empty). Observe that Sz left (G) = Sz left (G ). We shall prove that g(sz left (G)) {0, 1} + The inclusion is obtained by induction. From P 1, P 2 being false, it follows that 0, 1 g(sz left (G)). Assume all z {0, 1} +, z k, k > 1 are in g(sz left (G)) and take z {0, 1} +, z = k + 1. Assume z = z 0; the case z = z 1 is analogous. From the induction hypothesis we have z g(sz left (G)). Case 1: z = z 0. There is a leftmost derivation in G of the form S u 1 A 1 u 2 u 1 c 1 x 1 u 2 u 1 c 1 wu 2 with u 1, w, u 2 V T, u 2 VG, g(sz(s u 1 A 1 u 2 )) = x, and g(sz(u 1 c 1 u 2 u 1 c 1 wu 2)) = λ. From P 3 being false, it follows that a derivation A 1 c 1 v 1 A 1 v 2 c 1 v 1 c 1 v 3 v 2 is possible in G, v 1, v 3, v 2 VT, v 2 VG, A 1 c 1 v 3, v 2 v 2. Thus we can construct the derivation S u 1 A 1 u 2 u 1 c 1 v 1 A 1 v 2 u 2 u 1 c 1 v 1 c 1 x 1 v 2 u 2 u 1 c 1 v 1 c 1 wv 2u 2 Clearly, the g - image of the control word of this derivation is z 00 = z 0 = z, hence z g(sz left (G)). 8

9 Case 2: z = z 1. There is a leftmost derivation in G of the form S u 1 A 2 u 2 u 1 c 2 x 2 u 2 u 1 c 2 wu 2 with u 1, w, u 2 V T, u 2 VG, g(sz(s u 1 A 2 u 2 )) = z, and g(sz(u 1 c 2 x 2 u 2 u 1 c 2 wu 2))λ. From P 6 being false, there is a derivation A 2 c 2 v 1 A 1 v 2 c 2 v 1 c 1 v 3 v 2 with v 1, v 3, v 2 VT, v 2 VG, A 1 c 1 v 3, v 2 v 2. Thus we can construct the derivation S u 1 A 2 u 2 u 1 c 2 v 1 A 1 v 3 v 2 u 1 c 2 v 1 c 1 v 3 v 2u 2 with the g - image of the control word z 10 = z 0 = z. Therefore, z g(sz left (G)). In conclusion, the grammar G is (0, 1) - total if and only if there are two rules r 1 : A 1 x 1, r 2 : A 2 x 2 in P, g(r 1 ) = 0, g(r 2) = 1, g(r) = λ, r Lab \ {r 1, r 2 }, for which all properties P 1 P 6 are false. The set P of rules in G is finite, hence the proposition follows. The case of arbitrary labelling remains open. Proposition 5 The answer to problem (Q 2 ) is affirmative. Proof: The language Sz left (G) is context - free (and a grammar to it can be effectively constructed starting from a context - free grammar G). Given a context - free grammar G, there are finitely many morphisms g : Lab {0, 1} with g(r 1 ) = 0, g(r 2 ) = 1, g(r) = λ for all r Lab \ {r 1, r 2 } (we have (card(lab)(card(lab) 1) such morphisms). For each morphism g of this type, consider the language g(sz left (G)). It is context - free, hence it is decidable whether a given x {0, 1} is in g(sz left (G)) or not (and this can be done in polynomial time). Proposition 6 The answer to problem Q 3 is affirmative. Proof: Let Lab be a set of labels for the rules in G = (V N, V T, S, P ) and let g : Lab {0, 1} be a given morphism associating 0, 1 with the rules in G. The language L 1 = g 1 ({x}) is regular and a finite automaton A 1 for L 1 can be effectively constructed. For the grammar G we can construct G = (V N, Lab, S, P ), with P = {B rh(x) r : B x P, B V N, x V G} 9

10 where h : V G V N is defined by h(x) = X X V N, h(a) = λ, a V T. We have L(G ) = Sz left (G) A grammar G for the intersection L 1 Sz left (G) can be effectively constructed starting from the automaton A and the grammar G (the classical triple construction). Having G, to find a derivation in G producing a non-empty string y is algorithmically possible (explore the finite set of non-recurrent derivations, for example); for the string y we have x = g(y), hence the construction works. Some further remarks about (0, 1) - totalness question are worth mentioning, taking into account the importance of this notion for the above type of cryptosystems. Proposition 7 For each infinite context - free language L there is a (0, 1) - total grammar G generating L. Proof: Take a grammar G = (V N, V T, S, P ) generating L. As L is infinite, there is A V N such that a (not necessarily leftmost) derivation A uav uwv is possible in G, u, v, w V T, uv λ. We construct the grammar G = (V N {B}, V T, S, P ) with P = P {A uav ubv w, B uav ubv w}. Clearly L(G) = L(G ) = L and G is (0, 1) - total taking r 1 : A uav, r 2 : B ubv, g(r 1 ) = 0, ; g(r 2 ) = 1, g(r) = λ for all r {r 1, r 2 }. Unfortunately, the previous construction leads to an ambiguous grammar G (for example A uav uwv and A ubv uwv). This drawback can be avoided if we modify the generated language too. Proposition 8 Let G be an unambiguous context - free grammar generating an infinite language. There is an unambiguous (0, 1) - total context - free grammar G generating a language L(G) Shuf(L(G ), {c, d} ) such that L(G ) = h(l(g)), with h the morphism erasing c, d (c, d are new symbols). Proof: Take G = (V N, V T, S, P ). As L(G ) is infinite, there are derivations A + uav, a + w, u, v, w VT, uv λ, as in previous proof. We construct G = (V N {B}, V T {c, d}, S, P ) P = P {A ucbcv, B udbdv, B db, B w}, the new rules being labelled by r 1, r 2, r 3, r respectively. Taking g(r 2 ) = 0, g(r 3 ) = 1, g(r) = λ, r {r 2, r 3 }, one can easily see that G is (0, 1) - total. The 10

11 grammar G is unambiguous. Indeed, G is unambiguous; no different derivation using rules r 1 r can generate the same string (assume, without loss of generality, that u λ; in a string generated by rules r 1 r, starting from A or from B, the occurrence of uc identifies the use of r 1, each occurrence of ud identifies the use of r 2, whereas a substring dd points to a use of r 3 ). No two different derivations using both rules in P and rules r 1 r can generate the same string (each pair of occurrences of the symbol c identifies a symbol A rewritten by r 1 ; a string in (V N V T ) has an unique derivation in G ; from each A we generate a string bounded by parentheses uc, cv etc). In conclusion, G is unambiguous (hence it can be incorporated in a cryptosystem as above). Remark 2 Before closing this section, let us remark that the previous cryptosystem is similar in some extent to that consider in [9], [10] and investigated in [], [5]: here we deal with a Chomsky grammar G with labelled rules, in [9], [10] one takes a T OL (or a DT OL) system which is used in a similar way, assuming its tables labelled (the tables are total by definition, hence the T OL/DT OL system is total, the backward determinism corresponds to unambiguity and so on). 5 A public - key cryptosystem How to design a public - key cryptosystem based on the previous enciphering algorithm? The problem is to publicize the grammar G and its labelling without compromising the secretness of the message. An idea could be to take G non-context - free grammar. Then the cryptanalysis will be either non-algorithmic or at least N P - complete. But it is similarly complex for the legal receiver too. We need a trapdoor, which could allow the receiver to parse easier the encrypted string (for example, at the context - free level). Thus the problem becomes: how to have a grammar of an arbitrary type of encrypting and a context - free one for decrypting? The arbitrary grammar will be publicized, the context - free one will be kept secret, as a trapdoor. The idea is the same as for systems based on hiding regular languages [6],[3], but the implementation is different, namely it is based on the existence of nice pairs of grammars, considered below (moreover, the enciphering is done by passing from a control word to the word generated by the associated leftmost derivation, not as in [6],[3]. Two grammars G i = (V N,i, V T,i, S i, P i ), i = 1, 2 with labelled rules φ i : P i Lab i, i = 1, 2 constitute a nice pair if there are morphisms h : V V T,2, h : Lab 1 Lab 2 with h (r) Lab 2 {λ} for each r Lab 1 and 1. h(l(g 1 )) L(G 2 ); 2. for each x Sz left (G 1 ) we have h(g 1,left (x)) = G 2,left (h (x)). T,1 11

12 A nice pair of grammars as above is called useful if: 3. G 1 is non-context - free, whereas G 2 is context - free and unambiguous;. both G 1 and G 2 are (0, 1) - total and r 1, r 2 Lab 1 are associated to symbols 0, 1 in G 2 (G 1, G 2 are (0, 1) - total with this assignment of 0, 1 to labels of their rules). Having a useful nice pair of grammars, G 1, G 2, with labelling mappings φ 1, φ 2, the morphisms h, h and the assignment mapping g : Lab 1 Lab 2 {0, 1, λ}, the public - key is constituted by G 1, φ 1, g Lab1 and the secret trapdoor by G 2, φ 2, h, h, g Lab2. To encrypt a message x {0, 1} we first encode it by g 1, shuffle it by a string in (Lab 1 \ g 1 ({0, 1})), construct a leftmost derivation in G 1 and consider the obtained string y as the ciphertext. The illegal cryptanalyst has to parse y with respect to G 1, a hard problem. The legal receiver takes the string h(y) and parses it with respect to the context - free grammar G 2 ; to the obtained control string one applies g and the message x is found. Surprisingly enough, there exist useful nice pairs of grammars. Example 2 Let be G 1 = ({S, B}, {a, b, c, d}, S, P 1 ) with the rules r 1 : S asbc r 3 : S ab r 5 : db Bd r 2 : S asbd r : cb Bc r 6 : bb bb whereas G 2 = ({S}, {a, c, d}, S, P 2 ) contains the rules r 1 : S asc r 2 : S asd r 3 : S a (we have also specified the labelling). Consider also defined by and h : {a, b, c, d} {a, c, d} h(a) = a, h(b) = λ h(c) = c, h(d) = d h : {r 1, r 2, r 3, r, r 5, r 6 } {r 1, r 2r 3} defined by h (r 1 ) = r 1, h (r 2 ) = r 2, h (r 3 ) = λ, (i =, 5, 6) Associate 0 to r 1 in G 1 and to r 1 in G 2 and 1 to r 2 in G 1 and to r 2 in G 2. Clearly, G 1 is context sensitive, G 2 is unambiguous context - free and L(G 1 ) = {a n b n x x {c, d}, x = n 1, n 1} L(G 2 ) = {a n x x {c, d}, x = n 1, n 1} hence h(l(g 1 )) = L(G 2 ). 12

13 0, 1 are associated to r 1, r 2 in G 1 and to h (r 1 ), h (r 2 ) in G 2 and if in a leftmost derivation in G 1 we ignore the rules r, r 5, r 6 then a derivation with a control word in {r 1, r 2, r 3 } is found corresponding to a derivation in G 2 producing a string obtained by applying h to the string obtained in G 1 (that is h(sz left (x)) = G 2,left (h (x))). Unfortunately, the above nice pair of grammars is not good for a real cryptosystem, as the parsing with respect to G 1 is similarly easy as that with respect to G 2 (the string x in the above writing of strings in G 1 and G 2, a n b n x, a n x respectively precisely identifies the rules used, r 1, r 2, r 1, r 2 respectively). It is a significant problem to find useful nice pairs of grammars with the parsing with respect to G 1 significantly harder than the parsing with respect to G 2. This example shows also that our definition of usefulness does not capture all the essential requirements. We hope to return to this issue in a forthcoming contribution. References [1] M. Andrasiu, Gh. Paun - A cryptosystem based on gsm mappings, manuscript, [2] M. Andrasiu, J. Dassow, Gh. Paun, A. Salomaa - Language - theoretic problems arising from Richelieu cryptosystems, Th. Computer Sci. [3] J. Gruska - Descriptional complexity of context - free languages, Proc. 2nd MFCS Symp, High Tatra, 1973, [] J. Kari - A cryptanalitic observation concerning systems based on language theory, Discr. Appl. Math., 21 (1988), [5] J. Kari - Observation concerning a public - key cryptosystem based on iterated homomorphisms, Th. Computer Sci., 66 (1989), [6] V. Niemi - Hiding regular language public - key cryptosystems, RAIRO/Th. Informatics, submitted [7] A. Salomaa - Formal languages, Academic Press, New York, [8] A. Salomaa - public - key cryptography, Springer - Verlag, Berlin, Heidelberg, [9] A. Salomaa, E. Welzi - A cryptographic trapdoor based on iterated morphisms, manuscript [10] A. Salomaa, S. Yu - On a public - key cryptosystem based on iterated morphisms and substitutions, Th. Computer Sci., 8 (1986),

Insertion operations: closure properties

Insertion operations: closure properties Insertion operations: closure properties Lila Kari Academy of Finland and Mathematics Department 1 Turku University 20 500 Turku, Finland 1 Introduction The basic notions used for specifying languages

More information

ON MINIMAL CONTEXT-FREE INSERTION-DELETION SYSTEMS

ON MINIMAL CONTEXT-FREE INSERTION-DELETION SYSTEMS ON MINIMAL CONTEXT-FREE INSERTION-DELETION SYSTEMS Sergey Verlan LACL, University of Paris XII 61, av. Général de Gaulle, 94010, Créteil, France e-mail: verlan@univ-paris12.fr ABSTRACT We investigate the

More information

Parikh s theorem. Håkan Lindqvist

Parikh s theorem. Håkan Lindqvist Parikh s theorem Håkan Lindqvist Abstract This chapter will discuss Parikh s theorem and provide a proof for it. The proof is done by induction over a set of derivation trees, and using the Parikh mappings

More information

Computational Models - Lecture 4 1

Computational Models - Lecture 4 1 Computational Models - Lecture 4 1 Handout Mode Iftach Haitner and Yishay Mansour. Tel Aviv University. April 3/8, 2013 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice

More information

Left-Forbidding Cooperating Distributed Grammar Systems

Left-Forbidding Cooperating Distributed Grammar Systems Left-Forbidding Cooperating Distributed Grammar Systems Filip Goldefus a, Tomáš Masopust b,, Alexander Meduna a a Faculty of Information Technology, Brno University of Technology Božetěchova 2, Brno 61266,

More information

Restricted ambiguity of erasing morphisms

Restricted ambiguity of erasing morphisms Loughborough University Institutional Repository Restricted ambiguity of erasing morphisms This item was submitted to Loughborough University's Institutional Repository by the/an author. Citation: REIDENBACH,

More information

Power of controlled insertion and deletion

Power of controlled insertion and deletion Power of controlled insertion and deletion Lila Kari Academy of Finland and Department of Mathematics 1 University of Turku 20500 Turku Finland Abstract The paper investigates classes of languages obtained

More information

Note On Parikh slender context-free languages

Note On Parikh slender context-free languages Theoretical Computer Science 255 (2001) 667 677 www.elsevier.com/locate/tcs Note On Parikh slender context-free languages a; b; ; 1 Juha Honkala a Department of Mathematics, University of Turku, FIN-20014

More information

Context-free grammars and languages

Context-free grammars and languages Context-free grammars and languages The next class of languages we will study in the course is the class of context-free languages. They are defined by the notion of a context-free grammar, or a CFG for

More information

Computational Models - Lecture 4 1

Computational Models - Lecture 4 1 Computational Models - Lecture 4 1 Handout Mode Iftach Haitner. Tel Aviv University. November 21, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice Herlihy, Brown University.

More information

This lecture covers Chapter 7 of HMU: Properties of CFLs

This lecture covers Chapter 7 of HMU: Properties of CFLs This lecture covers Chapter 7 of HMU: Properties of CFLs Chomsky Normal Form Pumping Lemma for CFs Closure Properties of CFLs Decision Properties of CFLs Additional Reading: Chapter 7 of HMU. Chomsky Normal

More information

CS5371 Theory of Computation. Lecture 7: Automata Theory V (CFG, CFL, CNF)

CS5371 Theory of Computation. Lecture 7: Automata Theory V (CFG, CFL, CNF) CS5371 Theory of Computation Lecture 7: Automata Theory V (CFG, CFL, CNF) Announcement Homework 2 will be given soon (before Tue) Due date: Oct 31 (Tue), before class Midterm: Nov 3, (Fri), first hour

More information

1. (a) Explain the procedure to convert Context Free Grammar to Push Down Automata.

1. (a) Explain the procedure to convert Context Free Grammar to Push Down Automata. Code No: R09220504 R09 Set No. 2 II B.Tech II Semester Examinations,December-January, 2011-2012 FORMAL LANGUAGES AND AUTOMATA THEORY Computer Science And Engineering Time: 3 hours Max Marks: 75 Answer

More information

Cook-Levin Theorem. SAT is NP-complete

Cook-Levin Theorem. SAT is NP-complete Cook-Levin Theorem SAT is NP-complete In other words SAT NP A NP A P SAT 1 Consider any A NP NTM N that decides A in polytime n k For any input w Σ * valid tableau of configurations 2 Properties of an

More information

Final exam study sheet for CS3719 Turing machines and decidability.

Final exam study sheet for CS3719 Turing machines and decidability. Final exam study sheet for CS3719 Turing machines and decidability. A Turing machine is a finite automaton with an infinite memory (tape). Formally, a Turing machine is a 6-tuple M = (Q, Σ, Γ, δ, q 0,

More information

Automata Theory CS F-08 Context-Free Grammars

Automata Theory CS F-08 Context-Free Grammars Automata Theory CS411-2015F-08 Context-Free Grammars David Galles Department of Computer Science University of San Francisco 08-0: Context-Free Grammars Set of Terminals (Σ) Set of Non-Terminals Set of

More information

Definition: A grammar G = (V, T, P,S) is a context free grammar (cfg) if all productions in P have the form A x where

Definition: A grammar G = (V, T, P,S) is a context free grammar (cfg) if all productions in P have the form A x where Recitation 11 Notes Context Free Grammars Definition: A grammar G = (V, T, P,S) is a context free grammar (cfg) if all productions in P have the form A x A V, and x (V T)*. Examples Problem 1. Given the

More information

The View Over The Horizon

The View Over The Horizon The View Over The Horizon enumerable decidable context free regular Context-Free Grammars An example of a context free grammar, G 1 : A 0A1 A B B # Terminology: Each line is a substitution rule or production.

More information

Computational Models - Lecture 3

Computational Models - Lecture 3 Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. p. 1 Computational Models - Lecture 3 Equivalence of regular expressions and regular languages (lukewarm leftover

More information

Lecture Notes on Inductive Definitions

Lecture Notes on Inductive Definitions Lecture Notes on Inductive Definitions 15-312: Foundations of Programming Languages Frank Pfenning Lecture 2 August 28, 2003 These supplementary notes review the notion of an inductive definition and give

More information

Pitfalls in public key cryptosystems based on free partially commutative monoids and groups

Pitfalls in public key cryptosystems based on free partially commutative monoids and groups Pitfalls in public key cryptosystems based on free partially commutative monoids and groups María Isabel González Vasco 1 and Rainer Steinwandt 2 1 Área de Matemática Aplicada, Universidad Rey Juan Carlos

More information

CS481F01 Prelim 2 Solutions

CS481F01 Prelim 2 Solutions CS481F01 Prelim 2 Solutions A. Demers 7 Nov 2001 1 (30 pts = 4 pts each part + 2 free points). For this question we use the following notation: x y means x is a prefix of y m k n means m n k For each of

More information

Insertion and Deletion of Words: Determinism and Reversibility

Insertion and Deletion of Words: Determinism and Reversibility Insertion and Deletion of Words: Determinism and Reversibility Lila Kari Academy of Finland and Department of Mathematics University of Turku 20500 Turku Finland Abstract. The paper addresses two problems

More information

Finite Automata Theory and Formal Languages TMV026/TMV027/DIT321 Responsible: Ana Bove

Finite Automata Theory and Formal Languages TMV026/TMV027/DIT321 Responsible: Ana Bove Finite Automata Theory and Formal Languages TMV026/TMV027/DIT321 Responsible: Ana Bove Tuesday 28 of May 2013 Total: 60 points TMV027/DIT321 registration VT13 TMV026/DIT321 registration before VT13 Exam

More information

Theory of Computation

Theory of Computation Thomas Zeugmann Hokkaido University Laboratory for Algorithmics http://www-alg.ist.hokudai.ac.jp/ thomas/toc/ Lecture 3: Finite State Automata Motivation In the previous lecture we learned how to formalize

More information

On P Systems with Active Membranes

On P Systems with Active Membranes On P Systems with Active Membranes Andrei Păun Department of Computer Science, University of Western Ontario London, Ontario, Canada N6A 5B7 E-mail: apaun@csd.uwo.ca Abstract. The paper deals with the

More information

Solution. S ABc Ab c Bc Ac b A ABa Ba Aa a B Bbc bc.

Solution. S ABc Ab c Bc Ac b A ABa Ba Aa a B Bbc bc. Section 12.4 Context-Free Language Topics Algorithm. Remove Λ-productions from grammars for langauges without Λ. 1. Find nonterminals that derive Λ. 2. For each production A w construct all productions

More information

6.8 The Post Correspondence Problem

6.8 The Post Correspondence Problem 6.8. THE POST CORRESPONDENCE PROBLEM 423 6.8 The Post Correspondence Problem The Post correspondence problem (due to Emil Post) is another undecidable problem that turns out to be a very helpful tool for

More information

Automata Theory and Formal Grammars: Lecture 1

Automata Theory and Formal Grammars: Lecture 1 Automata Theory and Formal Grammars: Lecture 1 Sets, Languages, Logic Automata Theory and Formal Grammars: Lecture 1 p.1/72 Sets, Languages, Logic Today Course Overview Administrivia Sets Theory (Review?)

More information

Concordia University Department of Computer Science & Software Engineering

Concordia University Department of Computer Science & Software Engineering Concordia University Department of Computer Science & Software Engineering COMP 335/4 Theoretical Computer Science Winter 2015 Assignment 3 1. In each case, what language is generated by CFG s below. Justify

More information

Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Module No. # 01 Lecture No. # 08 Shannon s Theory (Contd.)

More information

FLAC Context-Free Grammars

FLAC Context-Free Grammars FLAC Context-Free Grammars Klaus Sutner Carnegie Mellon Universality Fall 2017 1 Generating Languages Properties of CFLs Generation vs. Recognition 3 Turing machines can be used to check membership in

More information

HENNING FERNAU Fachbereich IV, Abteilung Informatik, Universität Trier, D Trier, Germany

HENNING FERNAU Fachbereich IV, Abteilung Informatik, Universität Trier, D Trier, Germany International Journal of Foundations of Computer Science c World Scientific Publishing Company PROGRAMMMED GRAMMARS WITH RULE QUEUES HENNING FERNAU Fachbereich IV, Abteilung Informatik, Universität Trier,

More information

Chapter 5: Context-Free Languages

Chapter 5: Context-Free Languages Chapter 5: Context-Free Languages Peter Cappello Department of Computer Science University of California, Santa Barbara Santa Barbara, CA 93106 cappello@cs.ucsb.edu Please read the corresponding chapter

More information

Computational Models - Lecture 5 1

Computational Models - Lecture 5 1 Computational Models - Lecture 5 1 Handout Mode Iftach Haitner. Tel Aviv University. November 28, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice Herlihy, Brown University.

More information

MODULAR ARITHMETIC KEITH CONRAD

MODULAR ARITHMETIC KEITH CONRAD MODULAR ARITHMETIC KEITH CONRAD. Introduction We will define the notion of congruent integers (with respect to a modulus) and develop some basic ideas of modular arithmetic. Applications of modular arithmetic

More information

60-354, Theory of Computation Fall Asish Mukhopadhyay School of Computer Science University of Windsor

60-354, Theory of Computation Fall Asish Mukhopadhyay School of Computer Science University of Windsor 60-354, Theory of Computation Fall 2013 Asish Mukhopadhyay School of Computer Science University of Windsor Pushdown Automata (PDA) PDA = ε-nfa + stack Acceptance ε-nfa enters a final state or Stack is

More information

a (b + c) = a b + a c

a (b + c) = a b + a c Chapter 1 Vector spaces In the Linear Algebra I module, we encountered two kinds of vector space, namely real and complex. The real numbers and the complex numbers are both examples of an algebraic structure

More information

Foundations of Informatics: a Bridging Course

Foundations of Informatics: a Bridging Course Foundations of Informatics: a Bridging Course Week 3: Formal Languages and Semantics Thomas Noll Lehrstuhl für Informatik 2 RWTH Aachen University noll@cs.rwth-aachen.de http://www.b-it-center.de/wob/en/view/class211_id948.html

More information

Context Free Grammars

Context Free Grammars Automata and Formal Languages Context Free Grammars Sipser pages 101-111 Lecture 11 Tim Sheard 1 Formal Languages 1. Context free languages provide a convenient notation for recursive description of languages.

More information

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET Regular Languages and FA A language is a set of strings over a finite alphabet Σ. All languages are finite or countably infinite. The set of all languages

More information

Miscellaneous. Closure Properties Decision Properties

Miscellaneous. Closure Properties Decision Properties Miscellaneous Closure Properties Decision Properties 1 Closure Properties of CFL s CFL s are closed under union, concatenation, and Kleene closure. Also, under reversal, homomorphisms and inverse homomorphisms.

More information

CS632 Notes on Relational Query Languages I

CS632 Notes on Relational Query Languages I CS632 Notes on Relational Query Languages I A. Demers 6 Feb 2003 1 Introduction Here we define relations, and introduce our notational conventions, which are taken almost directly from [AD93]. We begin

More information

Data and information security: 2. Classical cryptography

Data and information security: 2. Classical cryptography ICS 423: s Data and information security: 2. Classical cryptography UHM ICS 423 Fall 2014 Outline ICS 423: s s and crypto systems ciphers ciphers Breaking ciphers What did we learn? Outline ICS 423: s

More information

Fundamentele Informatica II

Fundamentele Informatica II Fundamentele Informatica II Answer to selected exercises 5 John C Martin: Introduction to Languages and the Theory of Computation M.M. Bonsangue (and J. Kleijn) Fall 2011 5.1.a (q 0, ab, Z 0 ) (q 1, b,

More information

Substitutions, Trajectories and Noisy Channels

Substitutions, Trajectories and Noisy Channels Substitutions, Trajectories and Noisy Channels Lila Kari 1, Stavros Konstantinidis 2, and Petr Sosík 1,3, 1 Department of Computer Science, The University of Western Ontario, London, ON, Canada, N6A 5B7

More information

Week 7 An Application to Cryptography

Week 7 An Application to Cryptography SECTION 9. EULER S GENERALIZATION OF FERMAT S THEOREM 55 Week 7 An Application to Cryptography Cryptography the study of the design and analysis of mathematical techniques that ensure secure communications

More information

MODULAR ARITHMETIC. Suppose I told you it was 10:00 a.m. What time is it 6 hours from now?

MODULAR ARITHMETIC. Suppose I told you it was 10:00 a.m. What time is it 6 hours from now? MODULAR ARITHMETIC. Suppose I told you it was 10:00 a.m. What time is it 6 hours from now? The time you use everyday is a cycle of 12 hours, divided up into a cycle of 60 minutes. For every time you pass

More information

Introduction to Automata

Introduction to Automata Introduction to Automata Seungjin Choi Department of Computer Science and Engineering Pohang University of Science and Technology 77 Cheongam-ro, Nam-gu, Pohang 37673, Korea seungjin@postech.ac.kr 1 /

More information

Public-Key Encryption: ElGamal, RSA, Rabin

Public-Key Encryption: ElGamal, RSA, Rabin Public-Key Encryption: ElGamal, RSA, Rabin Introduction to Modern Cryptography Benny Applebaum Tel-Aviv University Fall Semester, 2011 12 Public-Key Encryption Syntax Encryption algorithm: E. Decryption

More information

CISC4090: Theory of Computation

CISC4090: Theory of Computation CISC4090: Theory of Computation Chapter 2 Context-Free Languages Courtesy of Prof. Arthur G. Werschulz Fordham University Department of Computer and Information Sciences Spring, 2014 Overview In Chapter

More information

Computers and Mathematics with Applications

Computers and Mathematics with Applications Computers and Mathematics with Applications 61 (2011) 1261 1265 Contents lists available at ScienceDirect Computers and Mathematics with Applications journal homepage: wwwelseviercom/locate/camwa Cryptanalysis

More information

Invertible insertion and deletion operations

Invertible insertion and deletion operations Invertible insertion and deletion operations Lila Kari Academy of Finland and Department of Mathematics 1 University of Turku 20500 Turku Finland Abstract The paper investigates the way in which the property

More information

3F1: Signals and Systems INFORMATION THEORY Examples Paper Solutions

3F1: Signals and Systems INFORMATION THEORY Examples Paper Solutions Engineering Tripos Part IIA THIRD YEAR 3F: Signals and Systems INFORMATION THEORY Examples Paper Solutions. Let the joint probability mass function of two binary random variables X and Y be given in the

More information

Chapter 4: Context-Free Grammars

Chapter 4: Context-Free Grammars Chapter 4: Context-Free Grammars 4.1 Basics of Context-Free Grammars Definition A context-free grammars, or CFG, G is specified by a quadruple (N, Σ, P, S), where N is the nonterminal or variable alphabet;

More information

Efficient Cryptanalysis of Homophonic Substitution Ciphers

Efficient Cryptanalysis of Homophonic Substitution Ciphers Efficient Cryptanalysis of Homophonic Substitution Ciphers Amrapali Dhavare Richard M. Low Mark Stamp Abstract Substitution ciphers are among the earliest methods of encryption. Examples of classic substitution

More information

Lecture 9 Julie Staub Avi Dalal Abheek Anand Gelareh Taban. 1 Introduction. 2 Background. CMSC 858K Advanced Topics in Cryptography February 24, 2004

Lecture 9 Julie Staub Avi Dalal Abheek Anand Gelareh Taban. 1 Introduction. 2 Background. CMSC 858K Advanced Topics in Cryptography February 24, 2004 CMSC 858K Advanced Topics in Cryptography February 24, 2004 Lecturer: Jonathan Katz Lecture 9 Scribe(s): Julie Staub Avi Dalal Abheek Anand Gelareh Taban 1 Introduction In previous lectures, we constructed

More information

Languages, regular languages, finite automata

Languages, regular languages, finite automata Notes on Computer Theory Last updated: January, 2018 Languages, regular languages, finite automata Content largely taken from Richards [1] and Sipser [2] 1 Languages An alphabet is a finite set of characters,

More information

Computational Models - Lecture 4

Computational Models - Lecture 4 Computational Models - Lecture 4 Regular languages: The Myhill-Nerode Theorem Context-free Grammars Chomsky Normal Form Pumping Lemma for context free languages Non context-free languages: Examples Push

More information

Context-Free Grammars (and Languages) Lecture 7

Context-Free Grammars (and Languages) Lecture 7 Context-Free Grammars (and Languages) Lecture 7 1 Today Beyond regular expressions: Context-Free Grammars (CFGs) What is a CFG? What is the language associated with a CFG? Creating CFGs. Reasoning about

More information

Computability Theory

Computability Theory CS:4330 Theory of Computation Spring 2018 Computability Theory Decidable Problems of CFLs and beyond Haniel Barbosa Readings for this lecture Chapter 4 of [Sipser 1996], 3rd edition. Section 4.1. Decidable

More information

Deletion operations: closure properties

Deletion operations: closure properties Deletion operations: closure properties Lila Kari Academy of Finland and Department of Mathematics 1 University of Turku 20500 Turku Finland June 3, 2010 KEY WORDS: right/left quotient, sequential deletion,

More information

CS500 Homework #2 Solutions

CS500 Homework #2 Solutions CS500 Homework #2 Solutions 1. Consider the two languages Show that L 1 is context-free but L 2 is not. L 1 = {a i b j c k d l i = j k = l} L 2 = {a i b j c k d l i = k j = l} Answer. L 1 is the concatenation

More information

CS375: Logic and Theory of Computing

CS375: Logic and Theory of Computing CS375: Logic and Theory of Computing Fuhua (Frank) Cheng Department of Computer Science University of Kentucky 1 Table of Contents: Week 1: Preliminaries (set algebra, relations, functions) (read Chapters

More information

Solutions to Problem Set 3

Solutions to Problem Set 3 V22.0453-001 Theory of Computation October 8, 2003 TA: Nelly Fazio Solutions to Problem Set 3 Problem 1 We have seen that a grammar where all productions are of the form: A ab, A c (where A, B non-terminals,

More information

Section 1 (closed-book) Total points 30

Section 1 (closed-book) Total points 30 CS 454 Theory of Computation Fall 2011 Section 1 (closed-book) Total points 30 1. Which of the following are true? (a) a PDA can always be converted to an equivalent PDA that at each step pops or pushes

More information

Theory Bridge Exam Example Questions

Theory Bridge Exam Example Questions Theory Bridge Exam Example Questions Annotated version with some (sometimes rather sketchy) answers and notes. This is a collection of sample theory bridge exam questions. This is just to get some idea

More information

of poly-slenderness coincides with the one of boundedness. Once more, the result was proved again by Raz [17]. In the case of regular languages, Szila

of poly-slenderness coincides with the one of boundedness. Once more, the result was proved again by Raz [17]. In the case of regular languages, Szila A characterization of poly-slender context-free languages 1 Lucian Ilie 2;3 Grzegorz Rozenberg 4 Arto Salomaa 2 March 30, 2000 Abstract For a non-negative integer k, we say that a language L is k-poly-slender

More information

Introduction to Theory of Computing

Introduction to Theory of Computing CSCI 2670, Fall 2012 Introduction to Theory of Computing Department of Computer Science University of Georgia Athens, GA 30602 Instructor: Liming Cai www.cs.uga.edu/ cai 0 Lecture Note 3 Context-Free Languages

More information

Context-Free Grammars and Languages. Reading: Chapter 5

Context-Free Grammars and Languages. Reading: Chapter 5 Context-Free Grammars and Languages Reading: Chapter 5 1 Context-Free Languages The class of context-free languages generalizes the class of regular languages, i.e., every regular language is a context-free

More information

Chaos and Cryptography

Chaos and Cryptography Chaos and Cryptography Vishaal Kapoor December 4, 2003 In his paper on chaos and cryptography, Baptista says It is possible to encrypt a message (a text composed by some alphabet) using the ergodic property

More information

Lecture Notes on Inductive Definitions

Lecture Notes on Inductive Definitions Lecture Notes on Inductive Definitions 15-312: Foundations of Programming Languages Frank Pfenning Lecture 2 September 2, 2004 These supplementary notes review the notion of an inductive definition and

More information

Generating All Circular Shifts by Context-Free Grammars in Chomsky Normal Form

Generating All Circular Shifts by Context-Free Grammars in Chomsky Normal Form Generating All Circular Shifts by Context-Free Grammars in Chomsky Normal Form Peter R.J. Asveld Department of Computer Science, Twente University of Technology P.O. Box 217, 7500 AE Enschede, the Netherlands

More information

Tree Adjoining Grammars

Tree Adjoining Grammars Tree Adjoining Grammars TAG: Parsing and formal properties Laura Kallmeyer & Benjamin Burkhardt HHU Düsseldorf WS 2017/2018 1 / 36 Outline 1 Parsing as deduction 2 CYK for TAG 3 Closure properties of TALs

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Chomsky Normal Form and TURING MACHINES TUESDAY Feb 4 CHOMSKY NORMAL FORM A context-free grammar is in Chomsky normal form if every rule is of the form:

More information

Notes on Alekhnovich s cryptosystems

Notes on Alekhnovich s cryptosystems Notes on Alekhnovich s cryptosystems Gilles Zémor November 2016 Decisional Decoding Hypothesis with parameter t. Let 0 < R 1 < R 2 < 1. There is no polynomial-time decoding algorithm A such that: Given

More information

Accepting H-Array Splicing Systems and Their Properties

Accepting H-Array Splicing Systems and Their Properties ROMANIAN JOURNAL OF INFORMATION SCIENCE AND TECHNOLOGY Volume 21 Number 3 2018 298 309 Accepting H-Array Splicing Systems and Their Properties D. K. SHEENA CHRISTY 1 V.MASILAMANI 2 D. G. THOMAS 3 Atulya

More information

Supplementary Notes on Inductive Definitions

Supplementary Notes on Inductive Definitions Supplementary Notes on Inductive Definitions 15-312: Foundations of Programming Languages Frank Pfenning Lecture 2 August 29, 2002 These supplementary notes review the notion of an inductive definition

More information

A q-matrix Encoding Extending the Parikh Matrix Mapping

A q-matrix Encoding Extending the Parikh Matrix Mapping Proceedings of ICCC 2004, Băile Felix Spa-Oradea, Romania pp 147-153, 2004 A q-matrix Encoding Extending the Parikh Matrix Mapping Ömer Eğecioğlu Abstract: We introduce a generalization of the Parikh mapping

More information

Math-Net.Ru All Russian mathematical portal

Math-Net.Ru All Russian mathematical portal Math-Net.Ru All Russian mathematical portal G. P. Agibalov, I. A. Pankratova, Asymmetric cryptosystems on Boolean functions, Prikl. Diskr. Mat., 2018, Number 40, 23 33 DOI: https://doi.org/10.17223/20710410/40/3

More information

CS 373: Theory of Computation. Fall 2010

CS 373: Theory of Computation. Fall 2010 CS 373: Theory of Computation Gul Agha Mahesh Viswanathan Fall 2010 1 1 Normal Forms for CFG Normal Forms for Grammars It is typically easier to work with a context free language if given a CFG in a normal

More information

Finite Presentations of Pregroups and the Identity Problem

Finite Presentations of Pregroups and the Identity Problem 6 Finite Presentations of Pregroups and the Identity Problem Alexa H. Mater and James D. Fix Abstract We consider finitely generated pregroups, and describe how an appropriately defined rewrite relation

More information

On Strong Alt-Induced Codes

On Strong Alt-Induced Codes Applied Mathematical Sciences, Vol. 12, 2018, no. 7, 327-336 HIKARI Ltd, www.m-hikari.com https://doi.org/10.12988/ams.2018.8113 On Strong Alt-Induced Codes Ngo Thi Hien Hanoi University of Science and

More information

CPSC 421: Tutorial #1

CPSC 421: Tutorial #1 CPSC 421: Tutorial #1 October 14, 2016 Set Theory. 1. Let A be an arbitrary set, and let B = {x A : x / x}. That is, B contains all sets in A that do not contain themselves: For all y, ( ) y B if and only

More information

Notes for Comp 497 (Comp 454) Week 10 4/5/05

Notes for Comp 497 (Comp 454) Week 10 4/5/05 Notes for Comp 497 (Comp 454) Week 10 4/5/05 Today look at the last two chapters in Part II. Cohen presents some results concerning context-free languages (CFL) and regular languages (RL) also some decidability

More information

Grammars (part II) Prof. Dan A. Simovici UMB

Grammars (part II) Prof. Dan A. Simovici UMB rammars (part II) Prof. Dan A. Simovici UMB 1 / 1 Outline 2 / 1 Length-Increasing vs. Context-Sensitive rammars Theorem The class L 1 equals the class of length-increasing languages. 3 / 1 Length-Increasing

More information

Languages. Languages. An Example Grammar. Grammars. Suppose we have an alphabet V. Then we can write:

Languages. Languages. An Example Grammar. Grammars. Suppose we have an alphabet V. Then we can write: Languages A language is a set (usually infinite) of strings, also known as sentences Each string consists of a sequence of symbols taken from some alphabet An alphabet, V, is a finite set of symbols, e.g.

More information

From Constructibility and Absoluteness to Computability and Domain Independence

From Constructibility and Absoluteness to Computability and Domain Independence From Constructibility and Absoluteness to Computability and Domain Independence Arnon Avron School of Computer Science Tel Aviv University, Tel Aviv 69978, Israel aa@math.tau.ac.il Abstract. Gödel s main

More information

CS 282A/MATH 209A: Foundations of Cryptography Prof. Rafail Ostrosky. Lecture 4

CS 282A/MATH 209A: Foundations of Cryptography Prof. Rafail Ostrosky. Lecture 4 CS 282A/MATH 209A: Foundations of Cryptography Prof. Rafail Ostrosky Lecture 4 Lecture date: January 26, 2005 Scribe: Paul Ray, Mike Welch, Fernando Pereira 1 Private Key Encryption Consider a game between

More information

Context-Free Grammars and Languages

Context-Free Grammars and Languages Context-Free Grammars and Languages Seungjin Choi Department of Computer Science and Engineering Pohang University of Science and Technology 77 Cheongam-ro, Nam-gu, Pohang 37673, Korea seungjin@postech.ac.kr

More information

P systems based on tag operations

P systems based on tag operations Computer Science Journal of Moldova, vol.20, no.3(60), 2012 P systems based on tag operations Yurii Rogozhin Sergey Verlan Abstract In this article we introduce P systems using Post s tag operation on

More information

MA/CSSE 474 Theory of Computation

MA/CSSE 474 Theory of Computation MA/CSSE 474 Theory of Computation CFL Hierarchy CFL Decision Problems Your Questions? Previous class days' material Reading Assignments HW 12 or 13 problems Anything else I have included some slides online

More information

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4 Chomsky Normal Form and TURING MACHINES TUESDAY Feb 4 CHOMSKY NORMAL FORM A context-free grammar is in Chomsky normal form if every rule is of the form: A BC A a S ε B and C aren t start variables a is

More information

Nondeterministic Finite Automata

Nondeterministic Finite Automata Nondeterministic Finite Automata Mahesh Viswanathan Introducing Nondeterminism Consider the machine shown in Figure. Like a DFA it has finitely many states and transitions labeled by symbols from an input

More information

Theory of Computation (II) Yijia Chen Fudan University

Theory of Computation (II) Yijia Chen Fudan University Theory of Computation (II) Yijia Chen Fudan University Review A language L is a subset of strings over an alphabet Σ. Our goal is to identify those languages that can be recognized by one of the simplest

More information

TAFL 1 (ECS-403) Unit- III. 3.1 Definition of CFG (Context Free Grammar) and problems. 3.2 Derivation. 3.3 Ambiguity in Grammar

TAFL 1 (ECS-403) Unit- III. 3.1 Definition of CFG (Context Free Grammar) and problems. 3.2 Derivation. 3.3 Ambiguity in Grammar TAFL 1 (ECS-403) Unit- III 3.1 Definition of CFG (Context Free Grammar) and problems 3.2 Derivation 3.3 Ambiguity in Grammar 3.3.1 Inherent Ambiguity 3.3.2 Ambiguous to Unambiguous CFG 3.4 Simplification

More information

Fully Lexicalized Pregroup Grammars

Fully Lexicalized Pregroup Grammars Fully Lexicalized Pregroup Grammars Annie Foret joint work with Denis Béchet Denis.Bechet@lina.univ-nantes.fr and foret@irisa.fr http://www.irisa.fr/prive/foret LINA Nantes University, FRANCE IRISA University

More information

Cryptography. pieces from work by Gordon Royle

Cryptography. pieces from work by Gordon Royle Cryptography pieces from work by Gordon Royle The set-up Cryptography is the mathematics of devising secure communication systems, whereas cryptanalysis is the mathematics of breaking such systems. We

More information

Parsing. Context-Free Grammars (CFG) Laura Kallmeyer. Winter 2017/18. Heinrich-Heine-Universität Düsseldorf 1 / 26

Parsing. Context-Free Grammars (CFG) Laura Kallmeyer. Winter 2017/18. Heinrich-Heine-Universität Düsseldorf 1 / 26 Parsing Context-Free Grammars (CFG) Laura Kallmeyer Heinrich-Heine-Universität Düsseldorf Winter 2017/18 1 / 26 Table of contents 1 Context-Free Grammars 2 Simplifying CFGs Removing useless symbols Eliminating

More information

9 Knapsack Cryptography

9 Knapsack Cryptography 9 Knapsack Cryptography In the past four weeks, we ve discussed public-key encryption systems that depend on various problems that we believe to be hard: prime factorization, the discrete logarithm, and

More information