# Deliberative and Conceptual Inference in Service Robots
## 6 Non-Monotonic Knowledge-Base Service
The diagnosis procedure involves extending the believed content of all unseen shelves \(S_{k}\) with the content of \(Missing_{o_{i}}\), avoiding repetitions. The content of the shelves seen in previous observations is already known. There are many possible heuristics to make such an assignment; here, we simply assume that \(s_{j}\) is the closest unseen shelf--in metrical distance--to the current shelf \(s_{i}\) and distribute the remaining objects of \(Missing_{o_{i}}\) in the remaining unseen shelves randomly. The procedure renders the known state of shelf \(s_{i}\), unless there were visual perception errors, and the assumed or hypothetical states of the remaining unseen shelves. The diagnosis is then rendered directly by assuming that the human assistant moved to each shelf and placed on it all the objects in its assumed and known states. There may be more than one known state because the assumption made at a particular inference cycle may have turned out wrong, and the diagnosis may have been invoked with a list of previous observed shelves in which states are already known. ### Decision-Making Inference

In the present model, deciding what to do next depends on the task obligation that invoked the inference cycle in the first place \(TO\), e.g., \(take(object_{i})\), and the current \(Pending\_Task\). Let the set \(Potential\_Decisions=TO\cup Pending\_Task\). Compute the set \(Potential\_Decisions_{subsets}\) consisting of all subsets of \(Potential\_Decisions\) that include \(TO\). The model could also consider other parameters, such as the mood of the customer or whether he or she is in a hurry, which can be thought of as constraints in the decision-making process; here, we state a global parameter \(r_{max}\) that is interpreted as the maximum cost that can be afforded for the completion of the task. We also consider that each action performed by the robot has an associated cost in time, e.g., the parameters associated to the behaviors \(take\) and \(deliver\), and a probability to be achieved successfully, e.g., the parameters associated to a _move_ action. The total cost of an action is computed by a restriction function \(r\). The decision-making module in relation to \(Potential\_Decisions_{subsets}\) proceeds as follows:

1. Compute the cost \(r_{i}\) for all sets in \(Potential\_Decisions_{subsets}\);
2. _Decisions_ is the set with maximal cost \(r_{i}\) such that \(r_{i}\leq r_{max}\). ### Plan Inference

The planning module searches the most efficient way to solve a set of \(CO\) and \(TO\). Each element of \(CO\cup TO\) implies a realignment in the position of the objects in the scenario, either carrying and object to another shelf or delivering it to a client. Each \(TO\) is transformed in a list of basic actions of the form:

\([move(s_{a}),take(o_{k}),move(s_{b}),deliver(o_{k})]\),

and each \(CO\) is transformed in a list of basic actions of the form:

\([move(s_{a}),take(o_{k}),search(client),deliver(o_{k})]\),

where \(s_{a}\) is the shelf containing the object \(o_{k}\) according to the diagnosis module, and \(s_{b}\) is the correct shelf, where \(o_{k}\) should be according to the KB. All the lists are joined in a multiset of basic actions \(B\). The initial state \(5_{0}\) of the search tree contains:

* The current location of the robot (\(l_{k}\)). * The actual state of the right hand (free or carrying the object \(o_{r}\)). * The actual state of the left hand (free or carrying the object \(o_{l}\)). * The list \(R\) of remaining \(CO\cup TO\) to solve. * The multiset \(B\) of basic actions to solve the elements in \(R\). * The list of basic actions of the plan \(P\) (in this moment is still empty). The initial state is put on a list \(F\) of all the not expanded nodes in the frontier of the tree. The search algorithm proceeds as follows:

1. Select one node to expand from \(F\). The selection criteria of the node of \(F\) is DFS. The cost and probability of each action in the current plan P in the node is used to compute a score. 2.