
Next we produce a second refinement of the DFD:

The structured systems analysis will require several more iterations of DFD refinement. As you can see, the DFD will become quite large, so it is not shown here.
The next steps are to define the logic of the processes, define the data stores, define the physical resources, determine the I/O specifications, perform sizing of the system, and determine hardware requirements.
We start by identifying the entities in the Robo-Butler scenarios:

Then we identify the relationships among the entities:

Next, we identify the attributes of the entities. A person, for example has a name, a location (X and Y coordinates), a direction he is facing (angle), an attitude (standing, walking, sitting, or lying down), and a reference image.
The entity-relationship model will be further developed into an object model by adding inheritance and methods (object oriented analysis), which is the subject of chapter 9.
Let Scanning(glass, ashtray) be the state where Robo-Butler is otherwise unoccupied, but is alert for abandoned drink containers and ashtrays in need of emptying.
Let g be a subset of the set of invited guests G and let p be a set of people outside the door of the house, a subset of the set of all people P. Note that G is also a subset of P.
Let AtDoor(p) denote the state in which a group of people has arrived at the door. Let AtDoor(g) denote the state in which Robo-Butler has determined that the group is made up entirely of invited guests, and let AtDoor(p, g) denote the state in which one or more of the people at the door is not recognized as an invited guest.
Let Door(open) denote the state in which the front door is open, and let InHouse(g) denote the state in which the front door is closed with the newly-arrived guests inside.
Let Store(possessions) denote the state in which Robo-Butler is storing the guests' possessions, and let Escort(g) denote the state in which Robo-Butler is escorting the guests to the owner.
Let Fetch(drink) denote the state in which Robo-Butler is fetching drinks for the guests, let Bus(glasses) denote the state in which Robo-Butler is carrying glasses to the kitchen, and let Empty(ashtray) denote the state in which Robo-Butler is emptying an ashtray.
Let Summon(owner) denote the state in which the Robo-Butler is summoning the owner. Then the high level state-transition diagram for the Robo-Butler software is:

The finite state machine can also be used to solve the cannibals and missionaries problem, stated:
Three missionaries are traveling with three cannibals. They come to a river where there is a boat that holds only two people. If the number of cannibals is ever greater than the number of missionaries on either shore, the missionaries get eaten. How do they cross the river without the missionaries getting eaten?
To solve this problem, draw the start and goal states:


The three Xs in the elipses symbolize the cannibals, the three Os symbolize the missionaries, the vertical line symbolizes the river, and the boat symbol symbolizes the boat. The positions of the symbols (left or right of the river) denote the states.
Then starting with the start state, draw allowed states and connect them with arrows to denote the crossings of the river in the boat as transitions. Continue until the goal state is reached.
