THE SITUATION CALCULUS
Reasoning about states and Actions
- The reasoning about states and actions is done here by using predicate calculus
- A feature based approach is used to describe the goal condition which has to be achieved by the actions of a user agent.
- A predicate calculus arrangement of states, action and the effect of actions on the states is known as situation calculus.
- Here, the search will be over a space of State description and operators are used to change the state descriptions.
- A disc-world example is taken to explain situation calculus.
Fig. 3.9.1. Configuration of Discs
- The goal here is to plan to get some disc on Q.
- Let the state shown in .Fig. 3.9.1 be so.
On(Q, P) represents that Q is On P.
- Clear(F) represents that any disc can be kept on it. F is floor.
- The state S0 shown in Fig. 3.9.1 can be represented in the first order predicate calculus as follows:
On(Q, P) ∧ On(P, R) ∧ On(R, F) ∧ Clear(Q) ∧ Clear(F)
- Like S0 there may be many states while actions are performed. S0 we include states in .the well formed formula and these are called Fluent's.
On(Q, P, S0) ∧ On(P, R, S0) ∧ On(R, F, S0) ∧ Clear(Q, S0)
- In a general form for example,
(∀x y, s) [On(x, y, s) ∧ ᆨ(y = F) ⊃ ᆨClear(y, s)]
And (∀s) Clear(F, s)
This proposition is true for all states s.
- Steps used to represent the actions and the effects of the actions are as follows,
- Constant symbols, functional expressions or variables are used to represent actions. In the formulation of situation it is considered that an action .is a function which is performed on the entities which are involved in it.
- Example: move(Q, P, F) it is an expression which is used to denote that Q is moved from P to floor.
- If we represent-the action move in a general form like move(x, y, z) it is called as schema and the variables x, y and z are known as schema variables.
- In order to represent a mapping from actions and states into states function ,constants are used.
- Example: do(∝, β) here do is a function constant which maps the action ∝ and state β into a state obtained by performing action ∝ on state β.
- Using wffs (well formed formulas) to denote the effects of actions. There may be two wffs in some cases for every action-fluent pair.
- Example: Consider the pair {on, move}, the wffs for this pair are,
i) [On(x, y, s). ∧ Clear(x, s) ∧ Clear(z, s) ∧ (x ≠ z) ⊃ On(x, z, do(move(x, y, z), s))]
ii) [On(x, y, s) ∧ Clear(x, s) ∧ Clear(z, s) ∧ (x ≠ z) ⊃ ᆨOn(x, y, do(move(x, y, z), s))]
The first case positive effect axiom. The antecedent denotes the conditions must be satisficed to preform the action. Consequent denotes the change is the fluent after the action is applied.
The second case is a negative effect axiom which denotes how the fluent is made false by the action.
- Consider another example of {clear, move} pair, these must be consistent with effect of axioms for.{On, move} pair.
- The {Clear, move} axiom effects are,
[On(x, y, s) ∧ Clear(x, s) ∧ Clear(z, s) ∧ (x ≠ z) ∧ (y ≠ z) ⊃Clear(y, do(move(x, y, z), s))].
Here the antecedent consists of two parts, one part represents the conditions that are needed to perform action. The second part (y ≠ z) is not needed to perform the action since the x can be moved to same position above y. But inorder to have the effect claimed in the consequent it has to be present. This can be shown in the Flg. 3.9.2
Fig. 3.9.2 Effect of {Clear, move} axiom
It can be seen from Fig. 3.9.2(b) that the goal state given by the consequent is not reached if y = z. In Fig. 3.9.2(c) it can be seen that the state where y should be clear is reached if y ≠ z.
[On(x, y, s) ∧ Clear(x, s) ∧ Clear(z, s) ∧ (x ≠ z) ∧ (z ≠ F) ⊃ ᆨClear(z, do(move(x, y, z), s))]
In the negative axiom the second part z ≠ F is taken because in the consequent z is not clear which is not possible if z is floor, as the floor is always clear.
It is to be noted that the formulas before performing action are also true after the application of action.