# Foundations of Software Engineering

Course Location
1B 28

Course Time
Tuesday and Thursday
11:00 AM - 12:15 PM

Topics
What's New (Home)
Class Schedule
Lectures
Assignments
Contact Information
Evaluation Criteria

# CSCI 5828 Homework 2: Finite State Machines

In this homework you will specify the state transitions of a home security system using Finite State Machines. From the informal description below, derive a set of states and inputs and then produce a finite state machine that shows the legal state transitions of the system using the graphical notation covered in class.

Be careful to choose an "appropriate" level of detail. It is hard to be specific about what "appropriate" really means, but if you are modeling the exact location of an intruder inside a home, for example, then you have gone too far!

You should turn in your Finite State Machine specification of the system along with a natural language description of the states and inputs you derived from the informal problem description. In addition, describe why you choose the level of detail that you did.

## PROBLEM STATEMENT

A home security system is one line of defense a home can provide against intruders. Such systems can also help protect a home from fire by bringing a home's smoke detectors under its control. Please model a system that exhibits the following behavior. A system can be off, armed while residents are home, and armed while residents are away. The difference between the latter two states is that while residents are away all monitors are active, including window and door monitors and internal motion detectors. While residents are home, the monitors remain active while the motion detectors are deactivated to allow residents free movement within the home.

If a monitor or motion detector detects an intruder, an alarm rings for ninety seconds. This gives residents time to deactivate the system if they were responsible for sounding the alarm. If the alarm is not deactivated then the security system notifies a remote monitoring station of the alarm, and the remote monitoring station informs the local police of the intruder. The alarm will continue to ring until a legal personal identification code (PIN) is entered and the system is commanded to turn off.

A user can enter commands to the system using a keypad. All commands must be prefixed with a user's PIN. If a user arms the security system, they are given a ninety second grace period to leave the house before the armed state goes into effect.

As mentioned above, the security system is linked to a home's smoke detectors. If smoke is detected, the security system rings a fire alarm (distinct from the intruder alarm) and notifies its remote monitoring station. The remote monitoring station will then notify the local fire department. As with an intruder alert, the fire alarm will continue to ring until a legal PIN is entered and the system is commanded to turn off.

## HINT

One extension to FSMs, is the ability to guard input transitions with a condition before that transition can occur. You may use guards in your FSM to handle the notion of time in this assignment. Use the following notation to denote a guard:

(condition):input

In your condition, you may enter any legal boolean phrase. Be sure to define any variables that you use in your informal description of the FSM.

## DUE DATES

In-Class Students: February 15, 2000
CATECS Students: February 22, 2000