This is an old revision of the document!


1.

  • $ f_{111}(M) = TRUE \iff M[111] \rightarrow TRUE$

O să încercăm să arătăm că $ f_{h} \le_m f_{111}$.

Trebuie să găsim o transformare t care primeşte inputul lui Halting Problem şi întoarce un input pentru $ f_{111}$: $ M, w \to t \to M^*$

După ce am găsit asta, mai ramane de demonstrat doar: $ f_{h}(M, w) = TRUE \iff f_{111}(M^*) = TRUE$

$ M^*(x):$

   run M[w]
   return x == 111

Demonstraţii:

  1. $ f_{h}(M, w) = TRUE \Rightarrow M[w] \text{se termină} \Rightarrow \text{vom returna x == 111} \Rightarrow \text{când x este 111}, M^* \text{va tranziţiona în Y} \Rightarrow M^*[111] \rightarrow TRUE \Rightarrow f_{111}(M^*) = TRUE$
  2. $ f_{111}(M^*) = TRUE \Rightarrow M^*[111] \rightarrow TRUE \Rightarrow \text{am ajuns la return} \Rightarrow \text{run M[w] din }M^* \text{nu a ciclat} \Rightarrow \text{M[w] s-a oprit} \Rightarrow f_{h}(M, w) = TRUE$

Din cele 2 direcţii ale demonstraţiei $\Rightarrow f_{h} \le_m f_{111}$.

  • $ f_{p}(M) = TRUE \iff \forall w, M \text{ decide dacă w e palindrom} $

O să încercăm să arătăm că $ f_{h} \le_m f_{p}$.

Trebuie să găsim o transformare t care primeşte inputul lui Halting Problem şi întoarce un input pentru $ f_{p}$: $ M, w \to t \to M^*$

$ M^*(x):$

   run M[w]
   check if x is palindrome

Demonstraţii:

  1. $ f_{h}(M, w) = TRUE \Rightarrow M[w] \text{se termină} \Rightarrow \text{o sa verificăm dacă x este palindrom} \Rightarrow \text{când x este palindrom}, M^* \text{va tranziţiona în Y} \Rightarrow f_{p}(M^*) = TRUE$
  2. $ f_{p}(M^*) = TRUE \Rightarrow M^*[x] \text{decide daca x este palindrom } \forall x \Rightarrow \text{am ajuns la return} \Rightarrow \text{run M[w] din }M^* \text{nu a ciclat} \Rightarrow \text{M[w] s-a oprit} \Rightarrow f_{h}(M, w) = TRUE$

Din cele 2 direcţii ale demonstraţiei $\Rightarrow f_{h} \le_m f_{p}$.

  • $ f_{rev}(M) = TRUE \iff \forall w, M \text{ computează inversul lui w}$

O să încercăm să arătăm că $ f_{h} \le_m f_{rev}$.

Trebuie să găsim o transformare t care primeşte inputul lui Halting Problem şi întoarce un input pentru $ f_{rev}$: $ M, w \to t \to M^*$

$ M^*(x):$

   run M[w]
   return rev(x)

Demonstraţii:

  1. $ f_{h}(M, w) = TRUE \Rightarrow M[w] \text{se termină} \Rightarrow \text{o sa calculeze rev(x) deoarece ajunge la return} \Rightarrow f_{rev}(M^*) = TRUE$
  2. $ f_{rev}(M^*) = TRUE \Rightarrow M^*[x] \text{calculeaza rev(x) } \forall x \forall x \Rightarrow \text{am ajuns la return} \Rightarrow \text{run M[w] din }M^* \text{nu a ciclat} \Rightarrow \text{M[w] s-a oprit} \Rightarrow f_{h}(M, w) = TRUE$

Din cele 2 direcţii ale demonstraţiei $\Rightarrow f_{h} \le_m f_{rev}$.

  • $ f_{own}(M) = TRUE \iff M[enc(M)] \rightarrow TRUE$

O să încercăm să arătăm că $ f_{h} \le_m f_{own}$.

Trebuie să găsim o transformare t care primeşte inputul lui Halting Problem şi întoarce un input pentru $ f_{own}$: $ M, w \to t \to M^*$

$ M^*(x):$

   if x == enc(M*):
     run M[w]
   else:
     nu se termină

Demonstraţii:

  1. $ f_{h}(M, w) = TRUE \Rightarrow M[w] \text{se termină} \Rightarrow M^*[enc(M^*)] \text{se termina} \Rightarrow f_{own}(M^*) = TRUE$
  2. $ f_{own}(M^*) = TRUE \Rightarrow M^*[enc(M^*)] \text{se termina} \Rightarrow \text{run M[w] din }M^* \text{nu a ciclat} \Rightarrow \text{M[w] s-a oprit} \Rightarrow f_{h}(M, w) = TRUE$

Din cele 2 direcţii ale demonstraţiei $\Rightarrow f_{h} \le_m f_{own}$.

  • $ f_{finite}(M) = TRUE \iff M \text{ se oprește pentru un număr finit de cuvinte}$

O să încercăm să arătăm că $ f_{h} \le_m f_{finite}$.

Trebuie să găsim o transformare t care primeşte inputul lui Halting Problem şi întoarce un input pentru $ f_{finite}$: $ M, w \to t \to M^*$

$ M^*(x):$

   run M[w] pentru maxim |x| paşi
    dacă M[w] s-a oprit:
     nu se termina
    else:
     se termina

Demonstraţii:

  1. $ f_{h}(M, w) = TRUE \Rightarrow M[w] \text{ se termină in n paşi} \Rightarrow M^*[w] \text{se opreşte } \forall x \text{, |x| < n}, \text{ciclează } \forall x \text{, |x| >= n} \Rightarrow f_{finite}(M^*) = TRUE$
  2. $ f_{finite}(M^*) = TRUE \Rightarrow M^*[x] \text{ se opreşte după un număr finit de cuvinte }\Rightarrow \text{M[w] s-a oprit după un număr finit de paşi} \Rightarrow f_{h}(M, w) = TRUE$

Din cele 2 direcţii ale demonstraţiei $\Rightarrow f_{h} \le_m f_{finite}$.

  • $ f_{set}(A, M) = TRUE \iff \forall w \in A, M[w] \text{ halts}$

O să încercăm să arătăm că $ f_{h} \le_m f_{set}$.

Trebuie să găsim o transformare t care primeşte inputul lui Halting Problem şi întoarce un input pentru $ f_{set}$: $ M, w \to t \to A, M^*$

A = {101} $ M^*(x):$

   if x is in A:
    run M[w]
   else:
    nu se termină

Demonstraţii:

  1. $ f_{h}(M, w) = TRUE \Rightarrow M[w] \text{se termină} \Rightarrow \text{cum } M^* \text{se poate opri doar pentru x = 101} \Rightarrow f_{set}(A, M^*) = TRUE$
  2. $ f_{set}(M^*) = TRUE \Rightarrow M^*[x] \text{o să se oprească pentru orice x din A} \Rightarrow \text{M[w] s-a oprit} \Rightarrow f_{h}(M, w) = TRUE$

Din cele 2 direcţii ale demonstraţiei $\Rightarrow f_{h} \le_m f_{set}$.

  • $ f_{x}(M) = TRUE \iff \exists w, M[w] \text{ scrie un x pe bandă la un moment dat}$

O să încercăm să arătăm că $ f_{h} \le_m f_{x}$.

Trebuie să găsim o transformare t care primeşte inputul lui Halting Problem şi întoarce un input pentru $ f_{x}$: $ M, w \to t \to M^*$

$ M^*(x):$

   run M[w]
   print x

Demonstraţii:

  1. $ f_{h}(M, w) = TRUE \Rightarrow M[w] \text{se termină} \Rightarrow \text{cum } M^* \text{printează x la final} \Rightarrow f_{x}(M^*) = TRUE$
  2. $ f_{x}(M^*) = TRUE \Rightarrow M^*[x] \text{ajunge să printeze x pe bandă} \Rightarrow \text{M[w] s-a oprit} \Rightarrow f_{h}(M, w) = TRUE$

Din cele 2 direcţii ale demonstraţiei $\Rightarrow f_{h} \le_m f_{x}$.

  • $ f_{eq}(M_1, M_2) = TRUE \iff \forall w, M_1[w] \equiv M_2[w]$; i.e. mașinile au același comportament (fie acceptă, fie resping, fie computează aceeași valoare, fie nu se termină) pentru orice cuvânt.

O să încercăm să arătăm că $ f_{h} \le_m f_{eq}$.

Trebuie să găsim o transformare t care primeşte inputul lui Halting Problem şi întoarce un input pentru $ f_{eq}$: $ M, w \to t \to M_{1}, M_{2}$

$ M_{1}[x]: $

 acceptă

$ M_{2}[x]: $

   run M[w]
   acceptă

Demonstraţii:

  1. $ f_{h}(M, w) = TRUE \Rightarrow M[w] \text{se termină} \Rightarrow M_{2} \text{acceptă orice x, iar } M_{1}[x] \text{deja acceptă orice x din construcţie} \Rightarrow M_1[w] \equiv M_2[w] \Rightarrow f_{eq}(M_{1}, M_{2}) = TRUE$
  2. $ f_{eq}(M_{1}, M_{2}) = TRUE \Rightarrow M_1[w] \equiv M_2[w] \Rightarrow \text{stim din construcţie că} M_{1} \text{acceptă orice x} \Rightarrow M_{2} \text{acceptă orice x} \Rightarrow M[w] \text{se opreşte} \Rightarrow f_{h}(M, w) = TRUE$

Din cele 2 direcţii ale demonstraţiei $\Rightarrow f_{h} \le_m f_{eq}$.