so dass $k \in ℕ$ und $x_i, y_i \in \Sigma^{+}$ für $1 \leq i \leq k$}
so dass $k \in ℕ$ und $x_i, y_i \in \Sigma^{+}$ für $1 \leq i \leq k$}
und es gibt $i_1, i_2, \ldots , i_n \in \{1, \ldots , k\}$,
und es gibt $i_1, i_2, \ldots , i_n \in \{1, \ldots , k\}$,
so dass $x_{i_1} x_{i_2} \cdots x_{i_n} = y_{i_1} y_{i_2} \cdots
so dass $x_{i_1} x_{i_2} \cdots x_{i_n} = y_{i_1} y_{i_2} \cdots
y_{i_n}$
y_{i_n}$
$\}$.
$\}$.
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
Diese Maschine modelliert das PCP Problem von Folie 35. Die einzelnen Lösungschritte (hinzufügen eines Indexes $i_j$) werden mit der Operation ```Schritt``` ausgeführt.
Diese Maschine modelliert das PCP Problem von Folie 35. Die einzelnen Lösungschritte (hinzufügen eines Indexes $i_j$) werden mit der Operation ```Schritt``` ausgeführt.
Diese Maschine verhindert offensichtlich nutzlose Schritte, wo niemals eine Lösung gefunden werden kann, da der Anfang von x und y sich unterscheiden.
Diese Maschine verhindert offensichtlich nutzlose Schritte, wo niemals eine Lösung gefunden werden kann, da der Anfang von x und y sich unterscheiden.
Sobald man eine Lösung gefunden hat ist die B Operation ```Lösung``` ausführbar.
Sobald man eine Lösung gefunden hat ist die B Operation ```Lösung``` ausführbar.
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` prob
``` prob
::load
::load
MACHINE PostCorrespondence_MC
MACHINE PostCorrespondence_MC
/* Version wo die Schritt Operation nur sinnvolle Erweiterungen zulässt */
/* Version wo die Schritt Operation nur sinnvolle Erweiterungen zulässt */
CONSTANTS K, Σ
CONSTANTS K, Σ
PROPERTIES
PROPERTIES
Σ = {0,1} ∧
Σ = {0,1} ∧
K = [ [1]↦[1,0], [0,1]↦[1], [0,1,0] ↦ [1,0,0] ] /* Problem von Folie 35 */
K = [ [1]↦[1,0], [0,1]↦[1], [0,1,0] ↦ [1,0,0] ] /* Problem von Folie 35 */
VARIABLES x,y
VARIABLES x,y
INVARIANT
INVARIANT
x ∈ seq(Σ) ∧ y∈seq(Σ)
x ∈ seq(Σ) ∧ y∈seq(Σ)
INITIALISATION x,y := <>,<>
INITIALISATION x,y := <>,<>
OPERATIONS
OPERATIONS
Schritt(i,ix,iy) = PRE i∈dom(K) ∧ K(i)=ix↦iy
Schritt(i,ix,iy) = PRE i∈dom(K) ∧ K(i)=ix↦iy
∧ same_prefix(x^ix,y^iy)
∧ same_prefix(x^ix,y^iy)
/* kann man die beiden neuen Wörter überhaupt noch gleich machen ? */
/* kann man die beiden neuen Wörter überhaupt noch gleich machen ? */
jetzt fehlen nur noch 60 Schritte bis zu der kürzesten Lösung.
Die gesamte Lösung ist:
Schritt(2,[0,1],[0,1,1])
Schritt(4,[1,0],[0,0,1])
Schritt(3,[0,1],[1,0,1])
Schritt(4,[1,0],[0,0,1])
Schritt(4,[1,0],[0,0,1])
Schritt(2,[0,1],[0,1,1])
Schritt(1,[0,0,1],[0])
Schritt(2,[0,1],[0,1,1])
Schritt(4,[1,0],[0,0,1])
Schritt(3,[0,1],[1,0,1])
Schritt(4,[1,0],[0,0,1])
Schritt(3,[0,1],[1,0,1])
Schritt(4,[1,0],[0,0,1])
Schritt(4,[1,0],[0,0,1])
Schritt(3,[0,1],[1,0,1])
Schritt(4,[1,0],[0,0,1])
Schritt(4,[1,0],[0,0,1])
Schritt(2,[0,1],[0,1,1])
Schritt(1,[0,0,1],[0])
Schritt(4,[1,0],[0,0,1])
Schritt(4,[1,0],[0,0,1])
Schritt(2,[0,1],[0,1,1])
Schritt(1,[0,0,1],[0])
Schritt(3,[0,1],[1,0,1])
Schritt(4,[1,0],[0,0,1])
Schritt(1,[0,0,1],[0])
Schritt(1,[0,0,1],[0])
Schritt(3,[0,1],[1,0,1])
Schritt(4,[1,0],[0,0,1])
Schritt(4,[1,0],[0,0,1])
Schritt(4,[1,0],[0,0,1])
Schritt(2,[0,1],[0,1,1])
Schritt(1,[0,0,1],[0])
Schritt(2,[0,1],[0,1,1])
Schritt(1,[0,0,1],[0])
Schritt(1,[0,0,1],[0])
Schritt(1,[0,0,1],[0])
Schritt(3,[0,1],[1,0,1])
Schritt(4,[1,0],[0,0,1])
Schritt(3,[0,1],[1,0,1])
Schritt(4,[1,0],[0,0,1])
Schritt(1,[0,0,1],[0])
Schritt(2,[0,1],[0,1,1])
Schritt(1,[0,0,1],[0])
Schritt(4,[1,0],[0,0,1])
Schritt(4,[1,0],[0,0,1])
Schritt(2,[0,1],[0,1,1])
Schritt(1,[0,0,1],[0])
Schritt(4,[1,0],[0,0,1])
Schritt(1,[0,0,1],[0])
Schritt(1,[0,0,1],[0])
Schritt(3,[0,1],[1,0,1])
Schritt(4,[1,0],[0,0,1])
Schritt(1,[0,0,1],[0])
Schritt(1,[0,0,1],[0])
Schritt(3,[0,1],[1,0,1])
Schritt(1,[0,0,1],[0])
Schritt(1,[0,0,1],[0])
Schritt(3,[0,1],[1,0,1])
Schritt(1,[0,0,1],[0])
Schritt(2,[0,1],[0,1,1])
Schritt(1,[0,0,1],[0])
Schritt(4,[1,0],[0,0,1])
Schritt(1,[0,0,1],[0])
Schritt(1,[0,0,1],[0])
Schritt(3,[0,1],[1,0,1])
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
## Kodierung des Halteproblems als MPCP Problem
## Kodierung des Halteproblems als MPCP Problem
Folgende B Maschine kodiert das Halteproblem einer Turingmaschine als MPCP Problem.
Folgende B Maschine kodiert das Halteproblem einer Turingmaschine als MPCP Problem.
Der erste Schritt zu einer Lösung wird in der Initialisierung kodiert; dort wir erzwungen, dass wir das erste Paar aus dem Skript $(\#,\# z_0 w)$ benutzen.
Der erste Schritt zu einer Lösung wird in der Initialisierung kodiert; dort wir erzwungen, dass wir das erste Paar aus dem Skript $(\#,\# z_0 w)$ benutzen.
Die Turing Maschine hat 3 Zustände: z0,z1,z2.
Die Turing Maschine hat 3 Zustände: z0,z1,z2.
z2 ist der Endzustand.
z2 ist der Endzustand.
z0 akzeptiert a and wechselt bei einem b zu z1, z1 akzeptiert b's und geht zu z2 bei einem Blank.
z0 akzeptiert a and wechselt bei einem b zu z1, z1 akzeptiert b's und geht zu z2 bei einem Blank.
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` prob
``` prob
::load
::load
MACHINE PostCorrespondence_Turing_MC
MACHINE PostCorrespondence_Turing_MC
/* The Turing machine has 3 states: z0,z1,z2; z2 is Final
/* The Turing machine has 3 states: z0,z1,z2; z2 is Final
z0 accepts a and goes to z1 via b; z1 accepts b and goes to z2 via Blank
z0 accepts a and goes to z1 via b; z1 accepts b and goes to z2 via Blank