# Deliberative and Conceptual Inference in Service Robots
## 6 Non-Monotonic Knowledge-Base Service
Check whether the elements in the list \(Ant\) are part of \(Prop\) or \(Tem_{Prop}\), as explained above. If that is true for all elements in \(Ant\), then add \(Consequent\) to \(Prop\). Finally, the desired property or relation is searched for in the resulting list \(Prop\), and its first occurrence is output. This mechanism is illustrated in our scenario as the user is assumed to be home after a bad day at work and to have requested comestible objects. Therefore, the first conditional default for the individual _user_ implies that he or she is also tired, this consequent is chained to the next implication since being tired and back from work implies that the user is found at the living room; but having requested comestible objects implies that he or she is in a different room. The conditional default concluding that the user is in the living room has lower weight, so that room is the preferred one where the user may be found. ### Updating the KB and Applying Abductive Reasoning

Once the robot reaches the user, it hands over the objects it is carrying. At this point, the robot knows the location from where such objects were taken. For each delivered object \(o_{del}\), if there is an inconsistency between the preferred location to find \(o_{del}\) as stated in the KB, \(loc_{pref}\), and the actual location where \(o_{del}\) was taken, \(loc_{act}\), then the robot informs the user of this situation and asks him to choose the preferred location between \(loc_{pref}\) and \(loc_{act}\). The data for \(o_{del}\) in KB is updated when the user picks \(loc_{act}\) over \(loc_{pref}\). After delivering all requested objects, the robot examines the location of other objects that it may have seen during the execution of the whole task. As described above, for the observed objects the property _last seen_ in the KB is updated with the location where they were last seen. Let \(O^{\prime}=\{o^{\prime}_{1},\ldots,o^{\prime}_{t}\}\) be the set of non-requested objects seen while executing the task. For each \(o^{\prime}_{i}\in O^{\prime}\):

* The robot retrieves from the KB the value of the property _last seen_ for \(o^{\prime}_{i}\), denoted \(loc_{last}\), and the list \([loc_{1},loc_{2},\ldots,loc_{n}]\) of preferred locations where \(o^{\prime}_{i}\) is likely to be found. Now, \(loc_{last}\) and \([loc_{1},loc_{2},\ldots,loc_{n}]\) are examined to determine any inconsistency. In fact, \(loc_{last}=loc_{1}\) since the location where \(o^{\prime}_{i}\) was last seen has the highest preference; \(loc_{2}\) is next as the predefined location where \(o^{\prime}_{i}\) is more likely to be found. If \(loc_{last}\
eq loc_{2}\), then a problem is detected having seen \(o^{\prime}_{i}\) not in its predefined location. Thus, the robot defines the property _misplaced_ for \(o^{\prime}_{i}\) in the KB. * The abductive reasoner is triggered to find out a possible explanation for the misplacement of \(o^{\prime}_{i}\). This reasoner takes the lists \(L_{CD}\) and \(Prop\), as defined previously, and recursively examines the pattern for each conditional default \(Ant\to\)_Consequent_ in \(L_{CD}\) similarly to the inference mechanism described above, but _Consequent_ is checked to belong to \(Prop\) instead of \(Ant\). If this check turns out to be true, then the pair _Consequent_ : \(Ant\) is added to the list of explanations. After all conditional defaults are analyzed, the list of explanations is trimmed by keeping the first occurrence of a pair with a given _Consequent_ and removing all others. This respects the order of preference since the explanation drawn from the conditional default with lowest weight is kept. * The application of the abductive reasoner on the current scenario reveals, by the conditional defaults defined in the class _object_, that \(o^{\prime}_{i}\) is misplaced because it was moved by the user's child or by the user's partner. The weight associated to each conditional default is considered to conclude that \(o^{\prime}_{i}\) is misplaced because the user's child moved it to \(loc_{last}\).