CSE-4/562 Spring 2019 - Provenance

### Provenance

#### CSE-4/562 Spring 2019

April 26, 2019

##### Textbook: Readings Only

Think of the relation as a function from potential facts to their truth value.

RAB
112→ T
213→ T
323→ T
424→ T
511→ F
6...→ F

Every row not explicitly listed is mapped to False

$Q(A) :-~~ R(A, B), S(B, C)$

$Q(1) :-~~ R(1, B), S(B, C)$

$Q(1) \equiv R(1, 1) \wedge S(1, 1)$

$~~~~~~~~ \vee ~~ R(1, 2) \wedge S(2, 1)$

$~~~~~~~~ \vee ~~ R(1, 3) \wedge S(3, 1)$

...

$~~~~~~~~ \vee ~~ R(1, 1) \wedge S(1, 2)$

$~~~~~~~~ \vee ~~ R(1, 2) \wedge S(2, 2)$

$~~~~~~~~ \vee ~~ R(1, 3) \wedge S(3, 2)$

...

RAB
112
213
323
424
SBC
121
222
333

$Q(1) \equiv R(1, 1) \wedge S(1, 1)$

$~~~~~~~~ \vee ~~ R(1, 2) \wedge S(2, 1)$

$~~~~~~~~ \vee ~~ R(1, 3) \wedge S(3, 1)$

...

$~~~~~~~~ \vee ~~ R(1, 1) \wedge S(1, 2)$

$~~~~~~~~ \vee ~~ R(1, 2) \wedge S(2, 2)$

$~~~~~~~~ \vee ~~ R(1, 3) \wedge S(3, 2)$

...

RAB
112
213
323
424
SBC
121
222
333

$Q(1) \equiv R(1, 1) \wedge S(1, 1)$

$~~~~~~~~ \vee ~~ ~~~~~T~~~~ \wedge S(2, 1)$

$~~~~~~~~ \vee ~~ ~~~~~T~~~~ \wedge S(3, 1)$

...

$~~~~~~~~ \vee ~~ R(1, 1) \wedge S(1, 2)$

$~~~~~~~~ \vee ~~ ~~~~~T~~~~ \wedge S(2, 2)$

$~~~~~~~~ \vee ~~ ~~~~~T~~~~ \wedge S(3, 2)$

...

RAB
112
213
323
424
SBC
121
222
333

$Q(1) \equiv ~~~~~F~~~~ \wedge S(1, 1)$

$~~~~~~~~ \vee ~~ ~~~~~T~~~~ \wedge S(2, 1)$

$~~~~~~~~ \vee ~~ ~~~~~T~~~~ \wedge S(3, 1)$

...

$~~~~~~~~ \vee ~~ ~~~~~F~~~~ \wedge S(1, 2)$

$~~~~~~~~ \vee ~~ ~~~~~T~~~~ \wedge S(2, 2)$

$~~~~~~~~ \vee ~~ ~~~~~T~~~~ \wedge S(3, 2)$

...

RAB
112
213
323
424
SBC
121
222
333

$Q(1) \equiv ~~~~~F~~~~ \wedge ~~~~F~~~~~$

$~~~~~~~~ \vee ~~ ~~~~~T~~~~ \wedge ~~~~T~~~~~$

$~~~~~~~~ \vee ~~ ~~~~~T~~~~ \wedge ~~~~F~~~~~$

...

$~~~~~~~~ \vee ~~ ~~~~~F~~~~ \wedge ~~~~F~~~~~$

$~~~~~~~~ \vee ~~ ~~~~~T~~~~ \wedge ~~~~T~~~~~$

$~~~~~~~~ \vee ~~ ~~~~~T~~~~ \wedge ~~~~F~~~~~$

...

RAB
112
213
323
424
SBC
121
222
333

$Q(1) \equiv$$~~~~~~F~~~~ \wedge ~~~~F~~~~~ ~~~~~~~~ \vee ~~ ~~~~~T~~~~ \wedge ~~~~T~~~~~ ~~~~~~~~ \vee ~~ ~~~~~T~~~~ \wedge ~~~~F~~~~~ ... ~~~~~~~~ \vee ~~ ~~~~~F~~~~ \wedge ~~~~F~~~~~ ~~~~~~~~ \vee ~~ ~~~~~T~~~~ \wedge ~~~~T~~~~~ ~~~~~~~~ \vee ~~ ~~~~~T~~~~ \wedge ~~~~F~~~~~ ... RAB 112 213 323 424 SBC 121 222 333 Q(1) \equiv$$~R(1, 1) \wedge S(1, 1)$

$~~~~~~~~ \vee ~~ R(1, 2) \wedge S(2, 1)$

$~~~~~~~~ \vee ~~ R(1, 3) \wedge S(3, 1)$

...

$~~~~~~~~ \vee ~~ R(1, 1) \wedge S(1, 2)$

$~~~~~~~~ \vee ~~ R(1, 2) \wedge S(2, 2)$

$~~~~~~~~ \vee ~~ R(1, 3) \wedge S(3, 2)$

...

RAB
112
212
312
413
523
623
724
RAB
112→ 3
213→ 1
323→ 2
424→ 1
RAB
112→ 3
213→ 1
323→ 2
424→ 1
SBC
121→ 1
222→ 2
333→ 3

$Q(1) =~?$

RAB
112→ 3
213→ 1
323→ 2
424→ 1
SBC
121→ 1
222→ 2
333→ 3

$Q(1) = 3\times 1 + 3 \times 2 + 1 \times 3 = 12$

$Q(1) \equiv R(1, 1) \wedge S(1, 1)$

$~~~~~~~~ \vee ~~ R(1, 2) \wedge S(2, 1)$

$~~~~~~~~ \vee ~~ R(1, 3) \wedge S(3, 1)$

...

$~~~~~~~~ \vee ~~ R(1, 1) \wedge S(1, 2)$

$~~~~~~~~ \vee ~~ R(1, 2) \wedge S(2, 2)$

$~~~~~~~~ \vee ~~ R(1, 3) \wedge S(3, 2)$

...

RAB
112→ 3
213→ 1
323→ 2
424→ 1
SBC
121→ 1
222→ 2
333→ 3

$Q(1) \equiv R(1, 1) \times S(1, 1)$

$~~~~~~~~ + ~~ R(1, 2) \times S(2, 1)$

$~~~~~~~~ + ~~ R(1, 3) \times S(3, 1)$

...

$~~~~~~~~ + ~~ R(1, 1) \times S(1, 2)$

$~~~~~~~~ + ~~ R(1, 2) \times S(2, 2)$

$~~~~~~~~ + ~~ R(1, 3) \times S(3, 2)$

...

RAB
112→ 3
213→ 1
323→ 2
424→ 1
SBC
121→ 1
222→ 2
333→ 3

$Q(1) \equiv 0 \times 0$

$~~~~~~~~ + ~~ 3 \times 1$

$~~~~~~~~ + ~~ 1 \times 0$

...

$~~~~~~~~ + ~~ 0 \times 0$

$~~~~~~~~ + ~~ 3 \times 2$

$~~~~~~~~ + ~~ 1 \times 0$

...

RAB
112→ 3
213→ 1
323→ 2
424→ 1
SBC
121→ 1
222→ 2
333→ 3