Calculabilité - LIX - Ecole polytechnique

Transcription

Calculabilité - LIX - Ecole polytechnique
Ecole Polytechnique
INF 542 - Majeure 1 - Année 2006
Logic and Computability: Petite Classe 2
Calculabilité
Exercice 1 Énumérabilité et énumération:
1. Montrer que tout ensemble récursif peut être énuméré en ordre croissant.
2. Ceci peut-il être fait sur tout ensemble r.e. ?
3. Montrer que toute fonction a forcément une innité de programmes dans tout langage de
programmation.
Exercice 2 Indécidabilité
Prouver que les problèmes suivants sont indécidables
1. Avec comme données un programme
pas sur
X
soit
P
P
et une valeur
X,
déterminer si soit
P
ne termine
termine et produit 8 comme résultat. (On veut montrer qu'il n'existe pas
de programme qui, avec comme données
P, X ,
réponde oui si on est dans un de ces deux
cas et réponde non sinon.)
2. Avec comme données deux programmes
s'arrêtent tous les deux sur la donnée
3. Soit un programme
Y
P
et deux valeurs
X
P
et
Q,
et une valeur
X,
P
et
Q
s'arrête avec
X
et
déterminer si
ou si aucun des deux ne s'arrête.
X, Y
distinctes, déterminer si
P
comme données.
Il faudra dans chaque cas trouver une réduction au problème de l'arrêt.
Exercice 3 On considère le langage
de Turing. Le mot
M
L
suivant. Un mot
est dans le langage
au moins deux éléments. Montrer que
L
L
M
est interprété comme une machine
si et seulement si le langage reconnu par
M
contient
est récursivement énumérable mais pas récursif.
Exercice 4 Virus detection software. Usually, reductions of the Halting problem to other
problems seem articial since they involve doing things like computing on code, writing one's own
code, etc. Unfortunately, we have all witnessed just such behavior on modern computers. The
following problem is based on the article: William Dowling, "Computer Viruses: Diagonalization
and Fixed Points," Notices of the American Mathematical Society, 37.858, pp. 858-861.
A computer virus is a program that, when run on some input, alters the code of the host
operating system. The altered operating system may spread the virus by inserting the code for
the virus into other programs, as well as perform other actions not ordinarily intended by the
user. Available antivirus utilities look for viruses that have already been spread or for unusual
activity in the computer's operations. The ideal program would detect all possible viruses. Prove
that this ideal checking program does not exist.
1. Use the method of contradictions. Assume that there is an ideal virus-detection program
Safe that can determine for any program
P
whether
mean that it does not modify the operating system).
1
P
is safe on input
I
(by safe, we shall
2. Now we write a program Deceptive that involves Safe and a diagonal construction.
3. Complete the proof that we must now have a contradiction.
Exercice 5 Problème des correspondances de Post.
Le but de l'exercice est de rééchir à un algorithme qui résolve la question suivante :
k mots sur un alphabet Σ, u1 , ..., uk et v1 , ..., vk
n et 1 ≤ i1 , ..., in ≤ k tels que les mots ui1 ...uin et vi1 ...vin
Entrée : 2 séquences de
Sortie : oui si il existe
sont identiques;
et non sinon.
1. Vérier que :
la réponse est oui pour
et qu'elle est non pour
abb, a, bab, baba, aba et bbab, aa, ab, aa, a ;
bb, a, bab, baba, aba et bab, aa, ab, aa, a.
2. Dans certains cas il est possible de prédire algorithmiquement le comportement du système.
Montrer que :
n < 106 , de ce problème est décidable ;
décidable si Σ contient une seule lettre, Σ = {a}.
la version bornée, e.g., pour
que le problème est
3. Dans le cas général, montrer que l'on peut transformer le problème de l'arrêt d'une machine
de Turing en celui de l'existence d'une solution pour un système de Post. (Très dicile.)
Exercice 6 Undecidability of the Post Correspondence Problem: Reduce the Halting
Problem to the PCP. The following might be useful in this reduction.
1. First introduce the notion of a modied PCP as a PCP with a distinguished pair that
hP, hx, yii such that P is a PCP
hx, yi ∈ P . A match for this modied PCP is a sequence hu1 , v1 i, . . . , huj , vj i in P
such that xu1 · · · uj = yv1 · · · vj . Show that the problem of nding a match for a modied
must be used rst. That is: a modied PCP problem is
and
PCP can be reduced to nding a match for a PCP.
2. The conguration of a Turing machine can be coded as a string
the tape,
q
is the current state of the machine, and
rst character of
conguration
c0
g
is
g
f qg
where
f
is the front of
is the remaining part of the tape (the
is the character being read by the machine). For example, the initial
qs x1 . . . xn ,
$,
h$c0 $, $i.
3. Introduce a new symbols, say
PCP must be the pair
where
qs
is the start state and the input word is
x1 . . . xn .
to delimit congurations. The rst step of the modied
Design additional pairs of strings so that when one tries
to build a matching string, one is forced to build the pair of strings
$c0 $c1 $ · · · $ci $ci+1 $
$c0 $c1 $ · · · $ci $
4. If the halting state is reached in a conguration, we need the modied PCP to arrange to
stop with a successful match. This can be done by having a phase of deletions of the nal
conguration. Once the last conguration is emptied, having a nal match should be easy.
2