Visualization of the system map SENSOR_TYPE deployed read LOCATION_TYPE TEMPERATURE_TYPE

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

A system maintains a number of sensors, where each is deployed in a separate location in order to read the location’s temperature. Before the system is deployed, all locations are marked on a map, and each location will be addressed by a sensor. The formal specification of the system introduces the following three types: 
SENSOR_TYPE, 
LOCATION_TYPE, 
TEMPERATURE_TYPE

State schema:

--TempMonitor------------------------------------------
|deployed : P SENSOR_TYPE 
|map : SENSOR_TYPE ↛ LOCATION_TYPE
|read : SENSOR_TYPE ↛ TEMPERATURE_TYPE 
|________________
|deployed = dom map 
|deployed = dom read
|____________________________________________________________

Operation DeploySensorOK:
Operation DeploySensorOK places a new sensor to a unique location. We may assume that some (default) temperature is also passed as an argument.

--DeploySensorOK------------------------------------------
|∆TempMonitor 
|sensor? : SENSOR_TYPE 
|location? : LOCATION_TYPE 
|temperature? : TEMPERATURE_TYPE
|________________
|sensor? ∈/ deployed 
|location? ∈/ ran map 
|deployed′ = deployed ∪ {sensor?} 
|map′ = map ∪ {sensor? 7→ location?} 
|read′ = read ∪ {sensor? 7→ temperature?} 
|_______________________________________________________________

Operation ReadTemperatureOK:
Operation ReadTemperatureOK obtains the temperature reading from a sensor, given the sensor’s location.

--ReadTemperatureOK----------------------------------------
| ΞTempMonitor 
|location? : LOCATION_TYPE 
|temperature! : TEMPERATURE_TYPE 
|______________
|location? ∈ ran map 
|temperature! = read(map^−1 (location?)) 
__________________________________________________________________

Success and error schemata: 
We introduce an enumerated type MESSAGE which will assume values that correspond to success and error messages. 
-Success-------------------------------------------------- 
|ΞTempMonitor 
|response! : MESSAGE 
_____________
|response! = ′ok′ 
_____________________________________________________________

Error schema SensorAlreadyDeployed for DeploySensorOK:
Operation DeploySensorOK places the following precondition: 
sensor? ∈/ deployed
We provide an error schema for the case where this precondition fails:

--SensorAlreadyDeployed---------------------------------------
|ΞTempMonitor 
|sensor? : SENSOR_TYPE
|response! : MESSAGE 
_____________
|sensor? ∈ deployed 
|response! = ′Sensor deployed′ 
____________________________________________________________________

Error schema LocationAlreadyCovered for DeploySensorOK:
Operation DeploySensorOK places the following precondition: 
location? ∈/ ran map 
We provide an error schema for the case where this precondition fails: 

-LocationAlreadyCovered------------------------------------
|ΞTempMonitor 
|location? : LOCATION_TYPE 
|response! : MESSAGE 
_____________
|location? ∈ ran map 
|response! = ′Location already covered′ 
________________________________________________________________

Error schema LocationUnknown for ReadTemperatureOK:
 Operation ReadTemperatureOK places the following precondition: location? ∈ ran map 
We provide an error schema for the case where this precondition fails: 

-LocationUnknown-----------------------------------------------
|ΞTempMonitor 
|location? : LOCATION_TYPE 
|response! : MESSAGE 
____________
|location? ∈/ ran map 
|response! = ′Location not covered′ 
____________________________________________________________________

Defining reliable operations:
DeploySensor ˆ= (DeploySensorOK ∧ Success) ⊕ (SensorAlreadyDeployed ∨ LocationAlreadyCovered) 
ReadTemperature ˆ= (ReadTemperatureOK ∧ Success) ⊕ LocationUnknown

 

QUESTION: Consider the temperature monitoring system. In this part, extend the specification with a new requirement: Operation ReplaceSensor Sensors are physical devices, subjected to deterioration, or
other type of damage. We need to provide the ability of the system to replace a sensor with another. For simplicity, let us not plan to (“fix” and) reuse them, but permanently remove them from the system. 

Visualization of the system
map
SENSOR_TYPE
deployed
read
LOCATION_TYPE
TEMPERATURE_TYPE
Transcribed Image Text:Visualization of the system map SENSOR_TYPE deployed read LOCATION_TYPE TEMPERATURE_TYPE
AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education