(apx:c.8)=
# Reasoning with incomplete information #
````{solution} ex:8.1
Give the models of the program
```Prolog
bird(tweety).
ostrich(tweety).
flies(X):-bird(X),not abnormal(X).
abnormal(X):-ostrich(X).
```
(interpreting the general clause as the corresponding indefinite clause). Which one is the intended model (see {numref}`sec:2.4`)?
````
The models are
```Prolog
{ bird(tweety), ostrich(tweety), abnormal(tweety) }
{ bird(tweety), ostrich(tweety), abnormal(tweety), flies(tweety) }
```
i.e. Tweety, being an ostrich, is an abnormal bird which may or may not fly. The intended model is the first one, since we have no reason to assume that ostriches fly.
+++
````{solution} ex:8.2
Give the models of the program
```Prolog
likes(peter,S):-student_of(S,peter).
student_of(paul,peter).
```
````
The Herbrand base of this program is
```Prolog
{ likes(peter,peter), likes(peter,paul),
likes(paul,peter), likes(paul,paul),
student_of(peter,peter), student_of(peter,paul),
student_of(paul,peter), student_of(paul,paul) }
```
The atoms `student_of(paul,peter)` and `likes(peter,paul)` are **true** in every model. If the atom `student_of(peter,peter)` is **true**, then so is the atom `likes(peter,peter)` (three possibilities). Disregarding the other four atoms, we obtain the following models:
```Prolog
{ student_of(paul,peter), likes(peter,paul) }
{ student_of(paul,peter), likes(peter,paul), likes(peter,peter) }
{ student_of(paul,peter), student_of(peter,peter), likes(peter,paul), likes(peter,peter) }
```
Taking the four remaining atoms into account, we obtain $3*2^4=48$ models. (See also {numref}`ex:2.6`.)
+++
````{solution} ex:8.3
Apply Predicate Completion to the program
```Prolog
wise(X):-not teacher(X).
teacher(peter):-wise(peter).
```
````
The completion of this program is
\begin{align*}
\forall \texttt{X} : \texttt{wise(X)} & \leftrightarrow \neg \texttt{teacher(X)} \newline
\forall \texttt{X} : \texttt{teacher(X)} & \leftrightarrow \texttt{(X=peter} \land \texttt{wise(peter))}
\end{align*}
The first formula states that somebody is wise if and only if he is not a teacher; the second formula says that Peter is wise if and only if he is a teacher. Together, these two statements are inconsistent.