```1)   ForAll x red(x) & flower(x) -> beautiful(x)
ForAll x flower(x) -> red(x) v yellow(x) v blue(x)
ForAll x peterLikes(x) -> beautiful(x)
ForAll x blue(x) -> ~beautiful(x)
ForAll x yellow(x) -> ~peterLikes(x)

(1) ~red(x) v ~flower(x) v beautiful(x)
(2) ~flower(x) v red(x) v yellow(x) v blue(x)
(3) ~peterLikes(x) v beautiful(x)
(4) ~blue(x) v ~beautiful(x)
(5) ~yellow(x) v ~peterLikes(x)

Assume ~(ForAll x peterLikes(x) & flower(x) -> red(x))
(6) peterLikes(S)
(7) flower(S)
(8) ~red(S)

(9)  ~peterLikes(x) v ~blue(x) (3) + (4)
(10) ~peterLikes(x) v ~flower(x) v red(x) v yellow(x) (2) + (9)
(11) ~peterLikes(x) v ~flower(x) v red(x) (5) + (10)
(12) ~flower(S) v red(S) (6) + (11)
(13) red(S) (7) + (12)

2)  (defun foo (x y)
(cond ((null x) nil)
(t (cons (car x)
(cons (second x)
(cons (car y)
(foo (cdr (cdr x))
(cdr y))))))))

3)                         A(1)
/  |  \
/    |    \
B(3)   C(2)    D
8+13   12+8    6+18
/   \     |  \
/     \    |    \
D     E(4)  D    F(5)
14+18   16+5  6+18  16+6
-----    /  \ ---- /   \
/    \    /     \
D     G    D      G
22+18   24  26+8    22
-----   --  ----

We can't be certain that we have found the shortest path, because the
estimated distance from D is not optimistic. Actually the shortest
path is A - D - C - F - G or A - D - E - G.

4)  eval[(foo (quote (a b)))]
eval[(quote (a b))]
(a b)
apply[foo, ((a b))]
apply[(lambda (x) (fie (cdr x) x)), ((a b))]
eval[ (fie (cdr x) x)), ((x (a b)))]
eval[(cdr x), ((x (a b)))]
eval[x, ((x (a b)))] = (a b)
apply[cdr, ((a b))] = (b)
eval[x, ((x (a b)))] = (a b)
apply[fie, ((b)(a b))]
apply[(lambda (x y) (cons x y)), ((b)(a b))]
eval[(cons x y)), ((x (b))(y (a b)))]
eval[x, ((x (b))(y (a b)))] = (b)
eval[y, ((x (b))(y (a b)))] = (a b)
apply[cons, ((b) (a b))]
((b) a b)

5)
P(E|T)*P(T)
P(T|E) = --------------------------------------------------------
P(E|O)*P(O) +  P(E|T)*P(T) +  P(E|K)*P(K) +  P(E|S)*P(S)

0.2*0.4
= -------------------------------------
0.5*0.2 + 0.2*0.4 + 0.4*0.1 + 0.1*0.3

= 0.32 (or 32%)

6)  Auxiliary output:

1) After specialization.
2) When generel models which are specializations of another
generel model are removed.
3) When generel models which are not a generalization of some
specific model are removed.

Give first pos. ex:
(t b g e r)
Is next pos or neg? n
Give next training instance:(s u g c w)

(1 (P NIL NIL NIL NIL) (T NIL NIL NIL NIL) (NIL B NIL NIL NIL)
(NIL NIL F NIL NIL) (NIL NIL D NIL NIL) (NIL NIL NIL E NIL)
(NIL NIL NIL NIL R) (NIL NIL NIL NIL Y))
(2 (NIL NIL NIL NIL Y) (NIL NIL NIL NIL R) (NIL NIL NIL E NIL)
(NIL NIL D NIL NIL) (NIL NIL F NIL NIL) (NIL B NIL NIL NIL)
(T NIL NIL NIL NIL) (P NIL NIL NIL NIL))
(3 (NIL NIL NIL NIL R) (NIL NIL NIL E NIL) (NIL B NIL NIL NIL)
(T NIL NIL NIL NIL))
G =
((NIL NIL NIL NIL R) (NIL NIL NIL E NIL) (NIL B NIL NIL NIL)
(T NIL NIL NIL NIL))
S = ((T B G E R))
Is next pos or neg? p
Give next training instance:(t u g e r)
G = ((NIL NIL NIL NIL R) (NIL NIL NIL E NIL) (T NIL NIL NIL NIL))
S = ((T NIL G E R))
Is next pos or neg? n
Give next training instance:(t b f e y)

(1 (NIL NIL NIL NIL R) (P NIL NIL E NIL) (S NIL NIL E NIL) (NIL U NIL E NIL)
(NIL NIL G E NIL) (NIL NIL D E NIL) (NIL NIL NIL E W) (NIL NIL NIL E R)
(T U NIL NIL NIL) (T NIL G NIL NIL) (T NIL D NIL NIL) (T NIL NIL C NIL)
(T NIL NIL NIL W) (T NIL NIL NIL R))
(2 (T NIL NIL NIL W) (T NIL NIL C NIL) (T NIL D NIL NIL) (T NIL G NIL NIL)
(T U NIL NIL NIL) (NIL NIL NIL E W) (NIL NIL D E NIL) (NIL NIL G E NIL)
(NIL U NIL E NIL) (S NIL NIL E NIL) (P NIL NIL E NIL) (NIL NIL NIL NIL R))
(3 (T NIL G NIL NIL) (NIL NIL G E NIL) (NIL NIL NIL NIL R))
G = ((T NIL G NIL NIL) (NIL NIL G E NIL) (NIL NIL NIL NIL R))
S = ((T NIL G E R))
Is next pos or neg? p
Give next training instance:(t b g e y)
G = ((T NIL G NIL NIL) (NIL NIL G E NIL))
S = ((T NIL G E NIL))
Is next pos or neg? n
Give next training instance:(p u g e r)

(1 (T NIL G NIL NIL) (T NIL G E NIL) (S NIL G E NIL) (NIL B G E NIL)
(NIL NIL G E W) (NIL NIL G E Y))
(2 (NIL NIL G E Y) (NIL NIL G E W) (NIL B G E NIL) (S NIL G E NIL)
(T NIL G NIL NIL))
(3 (T NIL G NIL NIL))
G = ((T NIL G NIL NIL))
S = ((T NIL G E NIL))
Is next pos or neg? p
Give next training instance:(t b g c r)
G = ((T NIL G NIL NIL))
S = ((T NIL G NIL NIL))
((T NIL G NIL NIL))