Formal Specification and Implementation of Priority Queue with Starvation Handling

Author(s):  
Jin Zhang ◽  
Gongzhu Hu ◽  
Roger Lee
2013 ◽  
Vol 1 (3) ◽  
pp. 66-75 ◽  
Author(s):  
Gongzhu Hu ◽  
Jin Zhang ◽  
Roger Lee

Formal specification of software components, as a core research area in software engineering, has been widely studied for decades. Although quite a few formal models have been proposed for this purpose, specification of concrete software components is still a challenging task due to the complexity of the functionalities of the components. In this paper, the authors use the stream function model to specify the behavior of priority queue, a commonly used software component. This specification formally defines the regular behavior and fault tolerance behavior of priority queue. In particular, a priority-concatenation operator is defined to handle the ordering of data items to ensure the highest-priority item is removed first. A finite state machine is built based on this specification as an implementation of priority queue. In addition, the authors also discuss a priority upgrading approach to handle possible starvation situation of low-priority data items in the priority queue.


Author(s):  
Krishnaprasad Thirunarayan

Attribute grammars are a framework for defining semantics of programming languages in a syntax-directed fashion. In this chapter, we define attribute grammars, and then illustrate their use for language definition, compiler generation, definite clause grammars, design and specification of algorithms, and so forth. Our goal is to emphasize its role as a tool for design, formal specification and implementation of practical systems, so our presentation is example rich.


Sign in / Sign up

Export Citation Format

Share Document