Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
aa:lab:sol:7 [2023/12/03 18:23] stefan.sterea created |
aa:lab:sol:7 [2023/12/06 22:43] (current) stefan.sterea |
||
---|---|---|---|
Line 33: | Line 33: | ||
$$ t : ((V, E), s, t) \mapsto \phi = (x_s \lor y) \land (x_s \lor \overline{y}) \land \left(\bigwedge_{(u, v)\in E}(\overline{x_u} \lor x_v)\right) \land (\overline{x_t} \lor y) \land (\overline{x_t} \lor \overline{y})$$ | $$ t : ((V, E), s, t) \mapsto \phi = (x_s \lor y) \land (x_s \lor \overline{y}) \land \left(\bigwedge_{(u, v)\in E}(\overline{x_u} \lor x_v)\right) \land (\overline{x_t} \lor y) \land (\overline{x_t} \lor \overline{y})$$ | ||
$ (\Longrightarrow)$ | $ (\Longrightarrow)$ | ||
- | $$ {\rm GraphUnreachability}(G, s, t) = {\rm TRUE} \Rightarrow \nexists L \text{ drum in } G: L \text{ incepe in } s \text{ si se termina in } t \Rightarrow \\ \forall L_s = [s, \dots, u] \text{ drum in } G, (u, t) \notin E\ (\text{deoarece altfel } L_s \cup [(u, t)] \text{ ar fi un drum care incepe in $ s$ si se termina in $ t$}) \Rightarrow \\ \text{Fie interpretarea } I = \{x_u = 1\ |\ u \text{ este accesibil din } s\} \cup \{x_u = 0\ |\ u \text{ nu este accesibil din } s\} \cup \{y = 0\}. \\ \text{Atunci }, (x_s \lor y) \land (x_s \lor \overline{y}) = 1, (\overline{x_t} \lor y) \land (\overline{x_t} \lor \overline{y}) = 1, \forall (u \text{ accesibil din }s) (v \in V, (u, v) \in E), v \text{ este accesibil din } s, v\ne t,\ (\overline{x_u} \lor x_v) = 1, \\ \forall (u \text{ inaccesibil din }s)(v \in V, (u, v) \in E), (\overline{x_u} \lor x_v) = 1 \Rightarrow I \vdash \phi \Rightarrow {\rm 2SAT}(\phi) = {\rm TRUE}$$ | + | $$ {\rm GraphUnreachability}(G, s, t) = {\rm TRUE} \Rightarrow \nexists L \text{ drum in } G: L \text{ incepe in } s \text{ si se termina in } t \Rightarrow \\ \forall L_s = [s, \dots, u] \text{ drum in } G, (u, t) \notin E\ (\text{deoarece altfel } L_s \cup [(u, t)] \text{ ar fi un drum care incepe in $ s$ si se termina in $ t$}) \Rightarrow \\ \text{Fie interpretarea } I = \{x_u = 1\ |\ u \text{ este accesibil din } s\} \cup \{x_u = 0\ |\ u \text{ nu este accesibil din } s\} \cup \{y = 0\}. \\ \text{Atunci }, (x_s \lor y) \land (x_s \lor \overline{y}) = 1, (\overline{x_t} \lor y) \land (\overline{x_t} \lor \overline{y}) = 1, \forall (u \text{ accesibil din }s) (v \in V, (u, v) \in E), v \text{ este accesibil din } s, v\ne t,\ (\overline{x_u} \lor x_v) = 1, \\ \forall (u \text{ inaccesibil din }s)(v \in V, (u, v) \in E), (\overline{x_u} \lor x_v) = 1 \Rightarrow I \vDash \phi \Rightarrow {\rm 2SAT}(\phi) = {\rm TRUE}$$ |
- | $ (\Longrightarrow)$ | + | $ (\Longleftarrow)$ |
- | $$ {\rm 2SAT}(\phi) = {\rm TRUE} \Rightarrow \exists\text{interpretare }I: I\vdash\phi \Rightarrow (x_s = 1) \in I, (x_t = 0)\in I. \\ \forall (u \in V, u \text{ accesibil din }s), \exists L = [s, w_1, w_2 \dots, w_k, u] \text{ drum in } G \Rightarrow \text{ clauzele } (\overline{s} \lor x_{w_1}) \land (\overline{x_{w_1}} \lor x_{w_2}) \land \dots \land (\overline{x_{w_k}} \lor x_u) \text{ apar in } \phi \Rightarrow (x_u = 1) \in I \\ (x_t = 0) \in I \Rightarrow t \text{ nu este accesibil din } s, \text{ deoarece altfel } (x_t = 1) \in I \Rightarrow {\rm GraphUnreachability}(G, s, t) = {\rm TRUE}$$ | + | $$ {\rm 2SAT}(\phi) = {\rm TRUE} \Rightarrow \exists\text{interpretare }I: I\vDash\phi \Rightarrow (x_s = 1) \in I, (x_t = 0)\in I. \\ \forall (u \in V, u \text{ accesibil din }s), \exists L = [s, w_1, w_2 \dots, w_k, u] \text{ drum in } G \Rightarrow \text{ clauzele } (\overline{x_s} \lor x_{w_1}) \land (\overline{x_{w_1}} \lor x_{w_2}) \land \dots \land (\overline{x_{w_k}} \lor x_u) \text{ apar in } \phi \Rightarrow (x_u = 1) \in I \\ (x_t = 0) \in I \Rightarrow t \text{ nu este accesibil din } s, \text{ deoarece altfel } (x_t = 1) \in I \Rightarrow {\rm GraphUnreachability}(G, s, t) = {\rm TRUE}$$ |
\\ | \\ | ||
\\ | \\ |