Unrestricted Grammars
[9/44%]Find a grammar such that .
Find a grammar such that .
Find a grammar such that .
Find a grammar such that .
Consider the grammar with nonterminals , terminals , and rules
Show a derivation of string ccbaabcba.
What is ? Give a brief argument for your answer.
Consider the grammar with nonterminals , terminal and rules
Show a derivation of .
What is ? Give a brief argument for your answer.
Construct grammars for each of the following languages. Also show (i) the derivation of the given string and (ii) a proof of why your grammar does not generate any string not in the language.
. [Hint: Following the idea of Exercise 2 above, generate, at the th iteration, a sentential form with copies of and copies of .]
.
.
. [Hint: Similar to part (a) above, generate, at the th iteration, a sentential form with copies of copies of , and copies of .]
.
.
.
cbaabcbaa.
.
Find a grammar such that for all .
Find a grammar such that, for all with , .
We consider a new computational model called Labeled Markov Algorithms (LMA). An LMA is defined as a triple , where is the input alphabet, is a working alphabet with , and is a program, consisting of a finite sequence of instructions. Each instruction in is of the form
where , and is a positive integer ( is called a production rule and is called the next instruction label). An instruction ( : ; goto ;) can be applied to a string if is a substring of . The application of this instruction to produces a new string by replacing the leftmost occurrence of in by .
On an input , the LMA operates as follows: At any time of computation, it maintains a current sentential form and a current instruction label . Initially, is the input string and the current instruction label is . At each step, it finds the least integer , where is the current instruction label, such that instruction is applicable to . Then, it applies to to obtain a new sentential form . It resets to be , and resets the current instruction label to be the the next instruction label of . If no instruction , with , is applicable to the current sentential form , then the machine halts with output . (In particular, if the current instruction label is , with greater than the number of instructions in , then the machine halts.)
For any LMA , we let , We say computes a partial function , if halts on each input with the final sentential form , and does not halt on any .
Design an LMA that computes the function for .
Show that every Turing-computable function is computable by an LMA.
Show that for any LMA is Turing-acceptable.
Show that every partial function computed by an LMA is Turing-computable.