[ Prev ]
2018-10-31

-- Oct 31 In-Class Exercise
 Give an example of a rule involving negation and an arithmetic atom which is safe.
 R(x,y) <- S(x,y), NOT T(x,y), x>y.
 
 Express ordered pairs where 0<x<y<4 as a collection of datalog facts, then express the query which selects pair where y>2.
 Ordered(1,2) <-.
 Ordered(1,3) <-.
 Ordered(2,3) <-.
 Select(x,y) <- Ordered(x,y), y>2
Give an example of a rule involving negation and an arithmetic atom which is safe. R(x,y) <- S(x,y), NOT T(x,y), x>y. Express ordered pairs where 0<x<y<4 as a collection of datalog facts, then express the query which selects pair where y>2. Ordered(1,2) <-. Ordered(1,3) <-. Ordered(2,3) <-. Select(x,y) <- Ordered(x,y), y>2

-- Oct 31 In-Class Exercise
A(x,y) <- B(x,y), NOT y>2
LessThan(1,2) <-. LessThan(2,3) <-.
GreatherThanTwo(x,y) <- LessThan(x,y), y>2.
A(x,y) <- B(x,y), NOT y>2 LessThan(1,2) <-. LessThan(2,3) <-. GreatherThanTwo(x,y) <- LessThan(x,y), y>2.

-- Oct 31 In-Class Exercise
 1. P(x, y) <- Q(x, y), NOT W(x, y), x < y.
 2. P(1, 2) <- .	
     P(1, 3) <- .
     P(2, 3) <- .
     Q(x, y) <- P(x, y), y > 2.
1. P(x, y) <- Q(x, y), NOT W(x, y), x < y. 2. P(1, 2) <- . P(1, 3) <- . P(2, 3) <- . Q(x, y) <- P(x, y), y > 2.
2018-11-04

-- Oct 31 In-Class Exercise
NewFilm(t,y) <- Movies(t,y,_,_,_,_), y >= 1990. OldFilm(t,y) <- Movies(t,y,_,_,_,_), NOT NewFilm(t,y).
Pair(1,2). Pair(2,3). Pair(1,3). Select(x,y) <- Pair(x,y), y > 2.
NewFilm(t,y) <- Movies(t,y,_,_,_,_), y >= 1990. OldFilm(t,y) <- Movies(t,y,_,_,_,_), NOT NewFilm(t,y). Pair(1,2). Pair(2,3). Pair(1,3). Select(x,y) <- Pair(x,y), y > 2.

-- Oct 31 In-Class Exercise
 1. A(x,y) <- B(x,y), NOT y > 2
 2. P(1, 2) <- .	
 P(1, 3) <- .
 P(2, 3) <- .
 Q(x, y) <- P(x, y), y > 2.
1. A(x,y) <- B(x,y), NOT y > 2 2. P(1, 2) <- . P(1, 3) <- . P(2, 3) <- . Q(x, y) <- P(x, y), y > 2.

-- Oct 31 In-Class Exercise
A(x,y) <-- B(x,y), NOT x < y
A(1, 2)
B(2, 3)
C(1, 3)
R(x, y) <-- S(x,y) AND y > 2
A(x,y) <-- B(x,y), NOT x < y <br> A(1, 2) <br> B(2, 3) <br> C(1, 3) <br> R(x, y) <-- S(x,y) AND y > 2

-- Oct 31 In-Class Exercise
 A(x,y) <- B(x,y), NOT x<y
 P(1,2) <-.	
 P(1,3) <-.
 P(2,3) <-.
 Q(x,y) <- P(x,y), y>2
A(x,y) <- B(x,y), NOT x<y P(1,2) <-. P(1,3) <-. P(2,3) <-. Q(x,y) <- P(x,y), y>2

-- Oct 31 In-Class Exercise
P(x, y) <- Q(x, y), NOT W(x, y), x < y.
P(1, 2) <- . P(1, 3) <- . P(2, 3) <- . Q(x, y) <- P(x, y), y > 2.
P(x, y) <- Q(x, y), NOT W(x, y), x < y. P(1, 2) <- . P(1, 3) <- . P(2, 3) <- . Q(x, y) <- P(x, y), y > 2.

-- Oct 31 In-Class Exercise
 A(x,y) <- B(x,y,z), NOT C(x,y,z); x+y<4+z
 
 O(1,2)
 O(2,3)
 O(1,3) 
 P(x,y) <- O(x,y), y>2
A(x,y) <- B(x,y,z), NOT C(x,y,z); x+y<4+z O(1,2) O(2,3) O(1,3) P(x,y) <- O(x,y), y>2
2018-11-05

-- Oct 31 In-Class Exercise
1. P(x, y) <- R(z, x, y), NOT S(z, x, y), x < y
2.
P(1, 2)
P(2, 3)
P(1, 3)

Q(x, y) <-- P(x, y), y > 2
1. P(x, y) <- R(z, x, y), NOT S(z, x, y), x < y 2. P(1, 2) P(2, 3) P(1, 3) ---- Q(x, y) <-- P(x, y), y > 2
[ Next ]
X