Re: Recursive language which is not context-sensitive
- From: Derek Holt <mareg@xxxxxxxxxxxxx>
- Date: Thu, 15 May 2008 06:58:09 -0700 (PDT)
On 15 May, 09:58, sanchopanch...@xxxxxx wrote:
On 15 Mai, 10:08, Derek Holt <ma...@xxxxxxxxxxxxx> wrote:
On 14 May, 09:26, sanchopanch...@xxxxxx wrote:
Hello,
i don't understand something in the proof that there is a recursive
language which is not context-sensitive: one uses a diagonal argument.
Therefore one has to consider the ordered set S of turing machines T_i
which accept context sensitive languages oder a given alphabet and
constructs a language over the alphabet which is not accepted by each
T_i of S beacuse it containes exactly the words w_i which are not
accepted by T_i. Hence the language is not context-sensitive.
More precisely the construction of S is as follows: Take a context
sensitive Grammar G and build up a turing machine T which accepts the
language which is defined by G.
Now the argument is that this recursive! But therefore you have to
build a turing machine which constructs the set S!
You can effectively enumerate the context sensitive grammars. So there
is an algorithm, which, given a natural number, like 37, can write
down the 37th context sensitive grammar. There is another algorithm,
which, given a context sensitive grammar, can output a Turing
machine, T_37 say, which accepts the language defined by this
grammar. Of course, each context sensitive language will be defined by
many different grammars, but that does not matter.
Words can also be effectively enumerated, so given a word w, there is
an algorithm that finds its number, say 37, and then constructs T_37,
and checks whether or not T_37 accepts w. (We can assume that the
Turing machines are deterministic.) Our diagonal Turing machine D that
we are constructing will accept w if and only T_37 does not accept w.
Now D is a Turing machine of which the language L(D) cannot be equal
to any of the L(T_i), so L(D) cannot be context sensitive.
How is this
possible? More precisely you have to have a turing machine which
generated all context sensitive grammars. I mean you can encode a
context sensitive grammar over the alphabet but how you can decide
weather a given 'input string' encodes a context sensitive grammar or
is just a garbage string?
You cannot decide that but you do not need to be able to decide that.
(You can't decide the weather either!)
Derek Holt.
Thank you for your answer. I understand everything in the argument but
this
You can effectively enumerate the context sensitive grammars. So there
is an algorithm, which, given a natural number, like 37, can write
down the 37th context sensitive grammar
is still unclear to me. How can this be done more precisely?
A context sensitive grammar can be defined as a list (N, Sigma, S,
P_1, P_2, ..., P_r), where N and Sigma are the numbers of non-
terminals and terminals, S is the start symbol (so 1<=S<=N) and P_i
are the productions. Each production is a pair of words (u_i,v_i) with
1<=|u_i|<=|v_i| over the terminals and non-terminals, so we can think
of u_i and v_i as being strings of integers u_i1,...,u_is with each
integer in the string between 1 and N+S. So, you could, for example,
represent the whole grammar by a string of non-negative integers of
the form
(N, Sigma, S, 0, u_11, u_12, ..., u_1s, 0, v_11, ..., 0, u_21, ... )
Now order all finite sequences of non-negative integers in some
suitable fashion. For example, we could order them first by sum of
entries + length, then lexicographically. i.e.
() < (0) < (0,0) < (1) < (0,0,0) < (0,1) < (1,0) < (2) < (0,0,0,0) <
(0,0,1) < (0,1,0) ...
Of course, most of these sequences do not represent context sensitive
grammars as described above, but for each of them we can easily check
whether it does. So we just write those down in order that do
represent context sensitive grammars, and stop at when we have 37 of
them.
Derek Holt.
.
- References:
- Re: Recursive language which is not context-sensitive
- From: Derek Holt
- Re: Recursive language which is not context-sensitive
- Prev by Date: Re: 4=3 A maths joke
- Next by Date: Re: Turing machine and Zeus machines
- Previous by thread: Re: Recursive language which is not context-sensitive
- Next by thread: Re: Recursive language which is not context-sensitive
- Index(es):
Relevant Pages
|