How do architecture patterns and tactics interact? A model and annotation Software architecture designers inevitably work with both architecture patterns and tactics. Architecture patterns describe the high-level structure and behavior of software systems as the solution to multiple system requirements, whereas tactics are design decisions that improve individual quality attribute concerns. Tactics that are implemented in existing architectures can have significant impact on the architecture patterns in the system. Similarly, tactics that are selected during initial architecture design significantly impact the architecture of the system to be designed: which patterns to use, and how they must be changed to accommodate the tactics. However, little is understood about how patterns and tactics interact. In this paper, we develop a model for the interaction of patterns and tactics that enables software architects to annotate architecture diagrams with information about the tactics used and their impact on the overall structure. This model is based on our in-depth analysis of the types of interactions involved, and we show several examples of how the model can be used to annotate different kinds of architecture diagrams. We illustrate the model and annotation by showing examples taken from real systems, and describe how the annotation was used in architecture reviews. Tactics and patterns are known architectural concepts; this work provides more specific and in-depth understanding of how they interact. Its other key contribution is that it explores the larger problem of understanding the relation between strategic decisions and how they need to be tailored in light of more tactical decisions. (N.B. Harrison) , paris@cs.rug.nl (P. Avgeriou). The architecture of a software-intensive system is the foundation upon which the system is implemented to satisfy the system requirements (note that in this paper, references to ""architecture" refer to the architecture of software-intensive systems; see IEEE, 2000) . The requirements include both functional and non-functional requirements. The non-functional requirements, or quality attribute requirements, are extremely important, and can be even more important than the more visible functional requirements (Barbacci et al., 2003) , and even drive software architecture design (O'Brien et al., 2005) . The architecture is designed by making a number of design decisions in order to influence the requirements. Two types of important design decisions are the application of architecture patterns and tactics.. Architecture patterns are common architectural structures which are well understood and documented (Buschmann et al., 1996; Schmidt et al., 2000; Shaw, 1988) . Each pattern describes the high-level structure and behavior of general software systems and aims to satisfy several functional and non-functional requirements. Architecture patterns contain the major components and connectors of the system to be built. Most modern software architectures use one or more architecture patterns (Harrison and Avgeriou, 2008a) . (Note that patterns exist at levels other than architecture, such as design; in this paper, references to patterns refer to architecture patterns.) Architecture patterns are chosen in response to early design decisions, including decisions about how to satisfy functional requirements, non-functional requirements (quality attributes), and physical constraints (such as physical distance between user and service provider.) Thus architecture patterns provide the major structures in which multiple design decisions are realized.. An important class of design decisions is those that concern quality attributes; such decisions are often called tactics (Bass et al., 2003) . A tactic is a design decision that aims to improve one specific design concern of a quality attribute. For example, a design concern concerning the quality attribute "security" is how to prevent attacks on the system; an associated design decision (tactic) is to authenticate users. As with patterns, the structures and behavior of the tactics may also shape the architecture, but usually at a smaller scale; this is natural as tactics concern a single quality attribute while patterns address a number. Tactics usually become part of a pattern alongside other structures. 0164 -1212/$ -see front matter © 2010 Elsevier Inc. All rights reserved. doi:10.1016/j.jss.2010.04.067. Because tactics must be realized within architecture patterns, the relationship between the two needs special study. Architecture patterns and tactics have an influence on each other as their structure and behavior need to co-exist within the architecture. This is a common case of dependencies between design decisions: former decisions constrain subsequent decisions. We need to distinguish between two cases:. • Brownfield development: in the case of evolving legacy systems the patterns are already in place and the architect may need to apply additional tactics to improve the quality attribute requirements. In this case, a tactic may require small or large changes to the patterns in order to fit in the architecture for its implementation. • Greenfield development: in the case of designing systems from scratch, an architect can first select patterns and then fit the tactics (top-down), or first select tactics and then see which patterns can incorporate them (bottom-up) or select both patterns and tactics iteratively (meet-in-the-middle). The second case is the most common as the architect usually starts making minor design choices by selecting tactics and other structures (e.g. for functional requirements and physical constraints of the system), then selects a pattern that can incorporate these choices and subsequently selects more tactics and other structures.. In both cases we need information about how the patternrelated and tactic-related decisions influence one another. The information may be used to modify the pattern, or if one has not selected an initial pattern yet, it can be used to understand the tradeoffs of selecting one pattern versus another. Specifically we need information about how much a pattern must be changed in order to implement certain tactics. Of course, this also reflects how easy or difficult it is to implement the tactics in the pattern.. In practice, for any given tactic, we may not know which parts of the pattern make it easy or difficult to implement that tactic. Furthermore, architects and developers often do not understand why a tactic is easy or difficult to implement in a given pattern. This makes it difficult to make informed choices about alternative tactics, and to assess the costs and benefits of tactics to achieve quality attributes. In short, their ability to effectively satisfy the critical quality attributes for a system is compromised.. Several sources (Cloutier, 2006; Harrison and Avgeriou, 2007a ) have documented that certain architecture patterns have benefits or liabilities for certain quality attributes. However, such descriptions are generally very high level; while they give general guidance, they do not explain the positive or negative consequences in sufficient detail to identify specific parts of the pattern that are impacted by certain quality attribute tactics, and exactly what that impact consists of. In fact, current pattern documents do not even mention tactics at all.. We have studied one quality attribute (reliability) in depth to understand the interaction of its tactics with the most well-known architecture patterns (Harrison and Avgeriou, 2008b) . We found that there are many interactions, and that there are several types of interactions, varying from pattern to pattern. The interactions between patterns and tactics are indeed rich and varied.. Therefore, without detailed knowledge of the architecture patterns used and how they interact with the quality attribute tactics, an architect can easily miss important interactions. Furthermore, without an understanding of the types of interactions, an architect will not even know what to look for. In addition, one will not easily understand how and why a pattern is modified in order to satisfy a quality attribute.. In order to help architects and designers understand the intricate relations between a system's architecture design decisions and its quality attributes, we describe a model of interaction between architecture patterns and tactics. This paper describes and categorizes these interactions, shows how they apply in architectural design, and provides a way to annotate architectural diagrams so that others can easily understand where these interactions take place. By applying this model, an architect can learn the nature of the changes to a software architecture that must be made in order to implement desired quality attributes. This can lead to: -Better ability to assess whether a particular architecture pattern is appropriate for the system being designed. -Better ability to estimate the development effort requiredinstead of guessing at how a quality attribute will be implemented, one can see the architectural components that must be changed or added to implement it. That means less guesswork and fewer surprises later in development. -Ability to evaluate alternative approaches to implementing quality attributes, namely evaluating alternate tactics that accomplish the same thing. You might have considered one, but may pick a different one because it is easier to implement in the architecture. -Reuse of this knowledge through the use of known patterns and tactics. -Better understanding of the architecture; namely why certain structures were put in place or how and why the architecture patterns used were modified.. The structure of the rest of the paper is as follows: Section 2 lays groundwork by describing patterns, quality attributes, and tactics. Section 3 presents a general model of the interaction of patterns and tactics. Section 4 explores how patterns and tactics interact. Section 5 shows how to make the interaction of tactics and patterns visible in architecture documentation, through architecture diagram annotations. Section 6 contains several case studies where the annotation method has been used. Sections 7 and 8 describe related and future work. There are several areas that require further research. These include the following.. Our studies have shown that architects consider the annotation of architecture diagrams with tactic implementation information useful. But longer term, how is it used? How useful is it for maintainers who are learning the system architecture? This is an area for long-term study.. We have used the interaction information to help identify issues during architecture reviews (as noted in the case studies), and have begun using the annotations in the reviews as well. We expect to use them further in order to better understand their benefits as well as limitations in architecture reviews. It may also be beneficial to tie the tactics' implementations to the risk themes of architecture reviews as described by Bass et al. (2006a) .. The interaction of multiple tactics as well as tactics on multiple patterns should have additional study. We are considering how the magnitude of the impact of tactics changes when considered in the context of multiple patterns.. Another issue of multiple tactics is how the annotation method scales. At what point does the annotation become less useful because it clutters the architecture diagram? While we have found it scales up through six tactics, we do not know how it scales to very large systems.. We have concentrated on the run time tactics as described in (Bass et al., 2003) . We find that the other tactics they describe, design time tactics, tend to cut across all design partitions, and are implemented implicitly in the code. Therefore, they are not as good a fit for the model as are the run time tactics, nor do they have as well-defined effects on patterns. The model and the design time tactics should be studied in more detail to determine how the design time tactics can be represented in the model and annotation. Besides refinement of the model and annotation, it will lead to greater insights about the nature of design time tactics versus run time tactics. It has long been known that architecture patterns and quality attributes are not independent, but have significant interaction with each other. We have found that this relationship is very rich, and involves the implementation of quality attributes through tactics.. The interaction among patterns and (runtime) tactics falls into several general categories, based on the type of changes needed to the pattern in order to implement the tactic. The amount of work required to implement a tactic in an architecture that uses a pattern depends on the type of change, as well as the volume of change needed. However, details of these interactions are different for each pattern/tactic pair, and must be investigated and documented.. The interaction of tactics and patterns can easily be shown in architecture diagrams using a simple method of annotation. This annotation method is adaptable to many different types of architecture diagrams and documentation. We have shown its use in various types of structural and behavioral architecture diagrams. We have used it to annotate several real architecture diagrams, both during and after architecture reviews. It has shown itself to be useful for illustrating the changes required. Many architecture pattern descriptions include some explanation or a pattern's compatibility or incompatibility with certain quality attributes (Maranzano et al., 2005) . The interaction has been described across more patterns and quality attributes in (Harrison and Avgeriou, 2007a) , though at a very high level. The interaction is characterized in more detail in (Harrison and Avgeriou, 2008a) . It has been explored in considerable detail for the well-known tactics of reliability interacting with one or two architecture patterns (Harrison and Avgeriou, 2008b) . This paper describes the types of interactions and presents a method of documenting the interactions.. Numerous methods of architecture design have been proposed; several important such methods have been generalized by Hofmeister et al. (2005) . The general model consists of three activities: Architectural analysis identifies the architecturally significant requirements (ASRs) of the system; namely those requirements that influence its architecture. The second activity is architecture synthesis, the creation of candidate architecture solutions to address the ASRs. Architecture evaluation, the third activity validates the candidate solutions against the ASRs. Our model shows how quality attributes are architecturally significant, and provides support for determining tradeoffs during synthesis and evaluation. The model explicitly supports making such decisions in patternbased architecture design (PDAP) (Harrison and Avgeriou, 2007b) , and in quality attribute-based reasoning frameworks as proposed by Bachmann et al. (2005) . The annotation method is also compatible, and can be used in architecture synthesis and evaluation.. Architecture reviews have been identified as an important way to improve the quality of the software architecture (IEEE, 2000; Maranzano et al., 2005; Bianco et al., 2007; Obbink et al., 2002) . We have found that annotating an architecture diagram can be a useful activity during an architecture review.. In ATAM and ADD (Bass et al., 2003) , the analysis of architectural tradeoffs is an important part of the architectural decision making process. In particular, one considers tradeoffs among tactics. Our analysis of the nature of impact of tactics on architecture patterns supplements tradeoff analysis: it helps architects understand and visualize where the impact of a tactic occurs, and how great this impact is likely to be. This information helps provide specific substance to be used in tradeoff analysis.. Several of these architecture methods center on various views of the system. Clements et al. (2002a) describe general viewtypes of module, component and connector, and allocation. The Siemens' 4 Views method (Hofmeister et al., 2005) has four views: conceptual, execution, module and code architecture. The Rational Unified Process 4 + 1 Views (Kruchten, 1995) centers on four views to describe the architecture: logical view, process view, implementation view, and deployment view. As shown, our annotation method is quite flexible, but is most naturally applied to Siemens' code architecture view and to the RUP logical view. It fits well within Clements' component and connector viewtype.. Numerous formal models and architecture description languages (ADLs) have been developed for expressing architecture (Allen and Garlan, 1994; Allen, 1997; Shaw et al., 1995) . They have different levels of support for modeling and representing patterns; however the most popular ADLS have components and connectors as central building blocks of architecture descriptions. As we have shown, our annotations can be applied to components and connectors in architecture diagrams. We have not proposed any extensions to text-based ADLs that provide the annotation information; however the common focus on components and connectors makes it clear that such augmentations are easily made.. Zdun (Zdun, 2007) has proposed design space analysis as a method for the selection of architecture patterns and pattern variants. Quality attribute information is a key part of the design space information. Changes to the patterns to accommodate tactic imple-mentation might result in what Zdun calls "pattern variants." Thus Zdun's work appears to be highly compatible with this work.. The IEEE 1471 standard (IEEE, 2000) describes a meta-model of software architecture that includes, among other things, multiple views of the architecture as well as the satisfaction of stakeholder concerns. Our work focuses on stakeholder concerns of quality attributes, and shows how views of the architecture (particularly component and connector-based views) can be annotated with such information. Thus it is compatible with this meta-model.. An important area of research is the interaction of multiple tactics. Nearly every non-trivial system implements multiple tactics, and they might not be independent of each other. We have seen in Fig. 8 how a tactic can be implemented to take advantage of a previously implemented tactic. Thus it appears that the order of implementing tactics is significant. The Architecture-Driven Design (ADD) method (Bass et al., 2003) acknowledges this. Bass et al. build on this to show how patterns and tactics show rationale and design changes over time (Bass et al., 2006b) . This work captures ordering of tactic implementation. One could also capture a history of architecture snapshots, showing the addition of snapshots over time.

O O O B O B O O O O O B I O O O O O O B O B O B O O O O O O O O O O O O O O O O O B O O O O O O O O O B O O O O O O O O O O O O O B O O O O B O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O B O O O O O O B O B O O O O O O O O O O O O B O B O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O B O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O B O O O O O O O B O O O O O O O O O O O O O O B O O O B O B O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O B I O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O B O O O O O O O O O O O O O O O B O O O O O O B O O O B O O O O O O O O O O O O O O O O O O O O O O O B O O O O O B O O O O O O O O O B O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O B O O O O B O O O O B O O O O O O O B O B O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O B O O B I O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O B O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O B O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O B O O O O O O O O O O O O B O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O B O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O B O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O B B I O B O O O O O O O O O O B O B O O O O B O B O O O O O O O O O O B O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O B O O O B O O B O O O O O O O O O O O O O O B O O O O O O O O B O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O B O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O B O O O O O O B O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O B O O O O O O O B O B I O O O O O O O O O O O O O O O O O O O O O O O O B I O B O O O B O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O B O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O B O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O B O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O


Integrality and Separability of Multitouch Interaction Techniques in 3D Manipulation Tasks Abstract-Multitouch displays represent a promising technology for the display and manipulation of data. While the manipulation of 2D data has been widely explored, 3D manipulation with multitouch displays remains largely unexplored. Based on an analysis of the integration and separation of degrees of freedom, we propose a taxonomy for 3D manipulation techniques with multitouch displays. Using that taxonomy, we introduce Depth-Separated Screen-Space (DS3), a new 3D manipulation technique based on the separation of translation and rotation. In a controlled experiment, we compared DS3 with Sticky Tools and Screen-Space. Results show that separating the control of translation and rotation significantly affects performance for 3D manipulation, with DS3 performing faster than the two other techniques. T HREE-DIMENSIONAL (3D) manipulation is a challenge for 3D interface designers since it involves the control of six Degrees Of Freedom (DOF) : three for position (i.e., translation along x-, y-, and z-axes) and three for orientation (i.e., rotation around x-, y-, and z-axes). Using a mouse with a current desktop interface, rotating 3D objects can take from 10 to 30 seconds [1] , much slower than real object manipulation which takes between 1 and 2 seconds [2] .. Compared to the mouse, multitouch displays provide extra input bandwidth through multiple contact points and enable direct manipulation allowing users to directly touch data [3] . The Rotate-Scale-Translation gesture (RST) for manipulating 2D data is a typical example of this type of interaction paradigm [4] . While 2D manipulation on multitouch displays has been widely explored, 3D manipulation has not. This may be explained by the mapping difficulty of the inherently 2D input contact points to the 3D attributes which need to be controlled.. Jacob et al. [5] studied the impact of the input device control structure and the perceptual structure on task performance, with a focus on whether the structures were integral or separable. They found a strong relationship between the two structures with better performance when both match. While it has been shown that human fingers have separable DOF [6] , 3D manipulation is inherently an integral task [7] . The thumb, index and middle fingers can be moved separately from one another while users perceive the attributes of 3D objects (position and orientation) as a whole. This mismatch between the separable input structure of multitouch devices and integral nature of a 3D manipulation task raises the question of how to optimize the mapping between the two structures.. While techniques like Sticky Tools [8] propose a way to separate the DOF of a 3D manipulation task, other techniques like Screen-Space [9] present a method to integrate them. However, the lack of user study makes it difficult to compare the two approaches.. After presenting the related work on DOF integration and separation, the existing metrics to measure DOF coordination, and the 3D manipulation techniques for multitouch displays, we introduce a taxonomy to compare 3D manipulation techniques for multitouch displays. Then, we introduce a new technique called Depth-Separated ScreenSpace (DS3) based on the clear separation between translation and rotation, and present the results of a controlled experiment comparing this technique with Sticky Tools [8] and Screen-Space [9] . Finally, in the discussion we address the question of controlling a task with integrated DOF using a separable multitouch input device. We have introduced a taxonomy to classify 3D manipulation techniques for multitouch displays. The study of 3D interaction techniques in relation to the structure of multitouch displays led us to introduce DS3, a 3D manipulation technique based on a total separation of the position and orientation control. Results of a controlled experiment show the strength of the new technique for both performance and user preference.. This relationship between the separation of DOF and performance confirms recent results showing that the simultaneous manipulation of all DOF does not necessary lead to the best performance [10] . Our study revealed that the integration of both translation and rotation reduce performance, coordination, and user satisfaction. A conclusion which extends the work of Nacenta et al. [11] , who covered similar issues for 2D manipulation. As future work we wish to explore the design space introduced by the taxonomy presented in this paper. We designed the experiment to compare three different techniques for performing 3D manipulation tasks on multitouch displays. Screen-Space controlled the six DOF of the task in an integral way, whereas Sticky Tools and DS3 separated the DOF of the task using different strategies.

O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O


Semantics of Plan Revision in Intelligent Agents Abstract. In this paper, we give an operational and denotational semantics for a 3APL meta-language, with which various 3APL interpreters can be programmed. We moreover prove equivalence of these two semantics. Furthermore, we relate this 3APL meta-language to object-level 3APL by providing a specific interpreter, the semantics of which will prove to be equivalent to object-level 3APL.

O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O


Random coverage with guaranteed connectivity: joint scheduling for wireless sensor networks Abstract-Sensor scheduling plays a critical role for energy efficiency of wireless sensor networks. Traditional methods for sensor scheduling use either sensing coverage or network connectivity, but rarely both. In this paper, we deal with a challenging task: Without accurate location information, how do we schedule sensor nodes to save energy and meet both constraints of sensing coverage and network connectivity? Our approach utilizes an integrated method that provides statistical sensing coverage and guaranteed network connectivity. We use random scheduling for sensing coverage and then turn on extra sensor nodes, if necessary, for network connectivity. Our method is totally distributed, is able to dynamically adjust sensing coverage with guaranteed network connectivity, and is resilient to time asynchrony. We present analytical results to disclose the relationship among node density, scheduling parameters, coverage quality, detection probability, and detection delay. Analytical and simulation results demonstrate the effectiveness of our joint scheduling method. W IRELESS Sensor Networks (WSNs) consist of a large number of sensor nodes, each of which integrates sensors, processors, memory, and wireless transceivers within the size of several cube millimeters [20] . Through short-range wireless communication, sensor nodes usually form a multihop wireless network to coordinate their behavior, collect and process the measurement data in a distributed fashion [2] . Due to their extremely small dimension, sensor nodes have very limited energy supply. In addition, it is usually hard to recharge the battery after deployment, either because the number of sensor nodes is too large, or because the deployment area is hostile. Once deployed, a sensor network is expected to keep working for several weeks or months. Therefore, energy efficiency becomes the essential requirement in WSNs.. Sensor scheduling plays a critical role for energy efficiency in WSNs. In this paper, we deal with a challenging task: Without accurate location information, how do we schedule sensor nodes to save energy and meet both constraints of sensing coverage and network connectivity? This problem should be solved in a lot of applications with WSNs, such as the detection of chemical attacks or the detection of forest fire. We use the following example to stress the importance of solving this problem:. Example. Imagine that a wireless sensor network is deployed to detect forest fire. The network should be able to detect the outbreaks of wild fire at any location within the monitored region with a high probability and report the outbreaks to the data collection center (also known as the sink node) with a small delay. In this example, sensing coverage, network connectivity, and energy efficiency are equally important: a large sensing coverage is to meet the users' requirement that an event can be detected with a high probability; network connectivity is to meet the users' requirement that the detected event can be delivered to the sink node; energy efficiency is to meet the users' requirement that the network should keep its operation as long as possible after the deployment. A good scheduling scheme should achieve energy efficiency under the constraints of sensing coverage and network connectivity. The difficulty in the above joint scheduling problem is that a sensor's sensing range is totally independent of its radio transmission range. It is generally hard to combine and solve the two problems together. This is the reason that although scheduling based on sensing coverage [1] , [9] , [11] , [12] , [16] , [21] , [24] , [25] and scheduling based on network connectivity [4] , [6] , [22] have been studied extensively, very few work has been devoted to solving the joint problem. Since it is usually costly to obtain and maintain the location information of each sensor node, the joint scheduling problem is even more difficult if the location of each sensor node is unknown.. In this paper, we are motivated to provide a solution to the joint scheduling problem under the constraints of both sensing coverage and network connectivity without the availability of per-node location information. Specifically, we aim at designing a scheduling scheme that has the following features at any given time:. 1. The sensing coverage is above a given requirement. 2. All the active sensor nodes are connected. 3. Each active sensor node knows at least one shortest or nearly shortest route to the sink node. The contributions of this paper are as follows: First, we propose a randomized scheduling algorithm and present the analytical results to illustrate the relationship among achievable coverage quality, event detection probability, event detection delay, energy saving, and node density. We also demonstrate that the randomized algorithm is resilient to time asynchrony if the network is sufficiently dense. Such a feature is indispensable for a practical scheduling algorithm since precise time synchronization is very hard for large sensor networks [5] and requires extra communication and energy consumptions. Second, we propose a rule to turn on extra sensor nodes, with which the network connectivity is guaranteed. The rule permits each sensor node to decide whether and when it should turn on in addition to the time slot scheduled by the randomized scheduling algorithm. Third, with our joint scheduling method, each active node knows at least one path to the sink. In this sense, the routing problem is simultaneously solved with the maintenance of network connectivity and no extra routing protocols are needed. Finally, we carry out performance evaluation and demonstrate that the joint scheduling method can achieve user-specified coverage quality with guaranteed network connectivity.. The rest of paper is organized as follows: In the next section, we introduce the network model. In Section 3, we introduce a randomized scheduling scheme that provides statistical sensing coverage. In Section 4, we propose a joint scheduling scheme that is based on the randomized scheduling algorithm and turns on extra sensors, if necessary, for maintaining network connectivity. In Section 5, we analyze the relationship among coverage quality, detection delay, detection probability, energy saving, and node density. Section 6 presents the performance evaluation of our joint scheduling scheme. We introduce related work in Section 7 and, finally, conclude the paper in Section 8. Sensor scheduling plays an essential role for energy efficiency of wireless sensor networks. Traditional sensor scheduling methods usually use sensing coverage or network connectivity, but rarely both. Some research [14] , [19] , [26] has dealt with the joint problem of sensing coverage as well as network connectivity, but requires specific network topology such as grid or strong constraints on the relationship of sensing range and radio transmission range. In this paper, we take a We use a randomized scheduling method to provide statistical sensing coverage and then switch on extra sensors, if necessary, for network connectivity. Analytical and simulation results demonstrate the effectiveness of our joint scheduling method. More specifically, our joint scheduling method has the following good features:. 1. It can achieve substantial energy saving and meet both constraints of coverage and connectivity without relying on location information or any assumptions on the relationship between the sensing range and the radio range. 2. It is totally distributed and, thus, easy to implement. 3. Each active sensor node knows at least one route with minimum hop count to the sink node. In this sense, our joint scheduling method solves the routing problem and eliminates the system cost incurred by routing protocols. 4. The coverage intensity could be dynamically adjusted by a simple broadcast of the k value. 5. The scheduling method is resilient to time asynchrony. . For more information on this or any other computing topic, please visit our Digital Library at www.computer.org/publications/dlib. With the proposed randomized coverage-based scheduling scheme, the coverage quality can be guaranteed statistically by setting an appropriate subset number k. Yet, there is no guarantee on the network connectivity after scheduling. To operate successfully, a sensor network must be connected so that sensor nodes can report the detected events to the sink node. Therefore, in addition to sensing coverage, the sensor network must remain connected, i.e., the active nodes should not be partitioned in any schedule of node duty cycles. We are, hence, motivated to enhance the above randomized scheduling algorithm such that both coverage quality and network connectivity can be met at any given time. The work in [8] provides the first asymptotic result on the relationship between the power level and the network connectivity. By using percolation theory, it proves that in order to maintain connectivity in a network with randomly placed nodes, the average node degree of the network should be in the order of ðlogn þ cÞ, where n is the total number of nodes and c is a constant. Another similar work could be found in [23] .. In wireless sensor networks, topology management protocols are needed to maintain the network connectivity. To save energy, redundant (in terms of network connectivity) sensor nodes can be turned off to save energy without degrading the network connectivity. The existing topology management protocols for wireless sensor networks include [22] , [4] , [3] , [13] .. With GAF [22] , the area is divided into cells with same size by a set of virtual grids. The size of cell is small enough so that any node can communicate directly with any other nodes within its neighboring cells. Therefore, only one node is required to be active within a virtual cell in order to maintain the network connectivity. SPAN [4] maintains a routing backbone and allows sensor nodes that do not belong to the backbone to sleep. The backbone nodes are also called "coordinators." A coordinator selection process is triggered periodically to balance the energy consumption among different nodes, since compared to a noncoordinator node, a coordinator consumes more energy to relay data for other nodes. ASCENT [3] is similar to SPAN in the sense that it chooses some sensor nodes to be active as routers while allows others to sleep to save energy. However, unlike SPAN, ASCENT selects an active router depending on not only local connectivity, but also the observed data loss rates. Therefore, ASCENT can obtain a strongly connected network with more reliable transmissions. STEM [13] puts sensor nodes into sleep state more aggressively. Sensor nodes wake up only when they have data to transfer or they receive requests from their neighbors to forward the data to the sink node. A separated paging channel is dedicated to the wakeup operation. Therefore, STEM trades latency for further energy saving.. In addition to maintaining network connectivity, maintaining a sufficient sensing coverage is also a critical requirement of sensor networks, since sensing coverage directly determines the monitoring quality provided by sensor networks in a designated region. By turning off redundant (in terms of coverage) sensor nodes, the coverage quality can be maintained and energy efficiency can be achieved at the same time. The existing coverage-preserving scheduling schemes for wireless sensor networks include [1] , [9] , [11] , [12] , [16] , [21] , [24] , [25] .. Unfortunately, most existing work addresses the connectivity problem and the coverage problem in isolation. They only solve one problem without considering the other. However, to operate successfully, a sensor network must ensure network connectivity and coverage quality at the same time. Treating coverage and connectivity in a unified framework for coverage preservation and connectivity maintenance is critical in building up practical sensor network applications.. Recently, in [14] , the joint problem of coverage and connectivity is considered in a network with sensor nodes deployed strictly in grids. Each sensor node can probabilistically fail. The sufficient and necessary conditions for connectivity and coverage in this type of networks are provided.. The joint problem in more general sensor networks where the sensor nodes are deployed at random is also investigated. In [26] , it is proved that to ensure that a full coverage of a convex area also guarantees the connectivity of the active nodes inside the area, the communication range should be at least twice of the sensing range. Therefore, the joint problem is simplified to maintain a complete coverage of a convex region if the communication range is greater than twice of the sensing range. In [17] , the authors enhance the work in [26] by releasing the constraint. They proved that "the communication range is twice of the sensing range" is the sufficient condition and the tight lower bound to ensure that complete coverage implies connectivity, no matter the area is a convex area or not.. In [19] , the authors draw the same conclusion as in paper [26] . In addition, they present a Coverage Configuration Protocol (CCP) that can provide fully coverage of a convex region. In the case where the communication range is greater than twice of the sensing range, the connectivity of networks is guaranteed by the full coverage, so no mechanism for connectivity maintenance is needed. To deal with the situation where the communication range is less than twice of the sensing range, the authors propose to integrate CCP with a topology management protocol SPAN [4] to provide both coverage and connectivity. The main qualitative differences between our method and CCP+SPAN proposed in [19] are summarized in Table 2 .. In [7] , the authors develop the notion of a connected sensor cover, defined as the sensor set that can fully cover the queried area and constitute a connected communication graph at the same time. The authors also demonstrate that the calculation of the smallest connected sensor cover is NPhard, and they propose both centralized and distributed approximate algorithms to solve it and provide the performance bounds as well. However, unlike our approach, the method in [7] requires each individual sensor node to be aware of its precise location, in order to check its local coverage redundancy.. Since our approach to dealing with the joint scheduling problem is unique, we point out that it is impossible to provide a fair, quantitative comparison between our method and any existing solution.

O O O O O O O O B I I O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O


On the Termination of Integer Loops In this article we study the decidability of termination of several variants of simple integer loops, without branching in the loop body and with affine constraints as the loop guard (and possibly a precondition). We show that termination of such loops is undecidable in some cases, in particular, when the body of the loop is expressed by a set of linear inequalities where the coefficients are from Z ∪ {r} with r an arbitrary irrational; when the loop is a sequence of instructions, that compute either linear expressions or the step function; and when the loop body is a piecewise linear deterministic update with two pieces. The undecidability result is proven by a reduction from counter programs, whose termination is known to be undecidable. For the common case of integer linear-constraint loops with rational coefficients we have not succeeded in proving either decidability or undecidability of termination, but we show that a Petri net can be simulated with such a loop; this implies some interesting lower bounds. For example, termination for a partially specified input is at least EXPSPACE-hard. Termination analysis has received considerable attention for at least two decades, and nowadays several powerful tools for the automatic termination analysis of different programming languages and computational models exist [Albert et al. 2007; Cook et al. 2006; Giesl et al. 2004 Giesl et al. , 2011 Spoto et al. 2010] .. Two important aspects of termination analysis tools are their scalability and their ability to handle a large class of programs. The theoretical limits of the underlying techniques, regarding, respectively, complexity and completeness, directly affect these two aspects. Since termination of general programs is undecidable, every attempt at solving it in practice will have at its core certain restricted problems, or classes of programs, that the algorithm designer targets. To understand the theoretical limits of an approach, we are looking for the decidability and complexity properties of these restricted problems. Note that understanding the boundaries set by inherent undecidability or intractability of problems yields more profound information than evaluating the performance of one particular algorithm.. Much of the recent development in termination analysis has benefited from techniques that deal with one simple loop at a time, where a simple loop is specified by (optionally) some initial conditions, a loop guard, and a "loop body" of a very restricted form. Very often, the state of the program during the loop is represented by a finite set of scalar variables (this simplification may be the result of an abstraction, such as size abstraction of structured data [Bruynooghe et al. 2007 ; Lee et al. 2001; Spoto et al. 2010] ).. Regarding the representation of the loop body, the most natural one is, perhaps, a block of straight-line code, namely a sequence of assignment statements, as in the following example. . To define a restricted problem for theoretical study, one just has to state the types of loop conditions and assignments that are admitted. By symbolically evaluating the sequence of assignments, a straight-line loop body may be put into the simple form of a simultaneous deterministic update, namely loops of the form while C do x 1 , . . . , x n := f ( x 1 , . . . , x n ),. where f is a function of some restricted class. For function classes that are sufficiently simple to analyze, one can hope that termination of such loops would be decidable; in fact, the main motivation for this article has been the remarkable results by Tiwari [2004] and Braverman [2006] on the termination of linear loops, a kind of loops where the update function f is linear. The loop conditions in these works are conjunctions of linear inequalities. Specifically, Tiwari proved that the termination problem is decidable for loops of the form. where the arithmetic is done over the reals; thus the variable vector x has values in R n , and the constant matrices in the loop are B ∈ R m×n , A ∈ R n×n , b ∈ R m , and c ∈ R n . Subsequently, Braverman proved decidability of termination of loops of the form. where the constant matrices and vectors are rational, and the variables are of either real or rational type; moreover, in the homogeneous case ( b s , b w , c = 0) he proved decidability when the variables range over Z. This is a significant and nontrivial addition, since algorithmic methods that work for the reals often fail to extend to the integers (a notorious example is finding the roots of polynomials; while decidable over the reals, over the integers, it is the undecidable Hilbert 10th problem 1 ). Regarding the loop form (4), we note that the constant vector c may be assumed to be zero with no loss of generality, since variables can be used instead, and constrained by the loop guard to have the desired (constant) values. Over the integers it is also sufficient to have only ≥ or only > in the loop guard. However, replacing > by ≥ (or vice versa) alters the homogeneous loop to a nonhomogeneous one, which is why including both inequality types is important in the context of Braverman [2006] .. Going back to program analysis, we note that it is typical in this field to assume that some degree of approximation is necessary in order to express the effect of the loop body by linear arithmetics alone. Hence, rather than loops with a linear update as before, one defines the representation of a loop body to be a set of constraints (again, usually linear). The general form of such a loop is. where the loop body is interpreted as expressing a relation between the new values x and the previous values x. Thus, in general, this representation is a nondeterministic kind of program and may overapproximate the semantics of the source program analyzed. But this is a form that lends itself naturally to analysis methods based on linear programming techniques, and there has been a series of publications on proving termination of such loops [Mesnard and Serebrenik 2008; Podelski and Rybalchenko 2004; Sohn and Gelder 1991] , all of which rely on the generation of linear ranking functions. For example, the termination analysis tools Terminator [Cook et al. 2006] , COSTA [Albert et al. 2007] , and Julia [Spoto et al. 2010 ] are based on proving termination of such loops by means of a linear ranking function. It is known that the linear-ranking approach cannot completely resolve the problem [Braverman 2006; Podelski and Rybalchenko 2004] , since not every terminating program has such a ranking function; this is the case, for example, for loop (1) given earlier. Moreover, the linear-programming-based approaches are not sensitive to the assumption that the data are integers. Thus, the problem of decidability of termination for linear-constraint loops, as loop form (5) before, stays open, in its different variants. We feel that the most intriguing problem is the following.. Is the termination of a single linear-constraint loop decidable, when the coefficients are rational numbers and the variables range over the integers?. The problem may be considered for a given initial state, for any initial state, or for a (linearly) constrained initial state.. Our contribution. In this research, we focus on hardness proofs. Our basic tool is a new simulation of counter programs (also known as counter machines) by a simple integer loop. The termination of counter programs is a well-known undecidable problem. While we have not been able to fully answer the major open problem given previously, this technique led to some interesting results that improve our understanding of the simple-loop termination problem. We next summarize our main results. All concern integer variables.. (1) We prove undecidability of termination, either for all inputs or a given input, for simple loops (a variation of loop form (4)) which iterate a straight-line sequence of simple assignment instructions. The right-hand sides are integer linear expressions except for one instruction type, which computes the step function. At first sight it may seem like the inclusion of such an instruction is tantamount to including a branch on zero, which would immediately allow for implementing a counter program. This is not the case, because the result of the function is put into a variable which can only be combined with other variables in a very limited way. We complement this result by pointing out other natural instructions that can be used to simulate the step function. This includes integer division by a constant (with truncation towards zero) and truncated subtraction. (2) Building upon the previous result, we prove undecidability of termination, either for all inputs or for a given input, of linear-constraint loops (a variation of loop form (5)) where one irrational number may appear (more precisely, the coefficients are from Z ∪ {r} for an arbitrary irrational number r). (3) Instead of moving to linear-constraint loops, we can also achieve the undecidability result with loops whose body is a deterministic update of the form "if x > 0 then (one linear update) else (another linear update)." Thus, the update function consists of two linear pieces. This is a nontrivial refinement of the first result, which uses the step function several times in the loop body. (4) We observe that while linear-constraint loops (5) with rational coefficients seem to be insufficient for simulating all counter programs, it is possible to simulate a subclass, namely Petri nets, leading to the conclusion that termination for a given input is at least EXPSPACE-hard. (5) Finally, we review our undecidability results and express the hardness of the corresponding problems in terms of the arithmetic and the analytic hierarchy.. We would like to highlight the relation of our results to a discussion by Braverman [2006, Section 6] , where he notes that linear-constraint loops are nondeterministic and asks:. How much nondeterminism can be introduced in a linear loop with no initial conditions before termination becomes undecidable?. It is interesting that our reduction to linear-constraint loops, when using the irrational coefficient, produces constraints that are deterministic. The role of the constraints is not to create nondeterminism; it is to express complex relationships among variables. We may also point out that some limited forms of linear-constraint loops (that are very nondeterministic since they are weaker constraints) have a decidable termination problem (see Section 8). Braverman also discusses the difficulty of deciding termination for a given input, a problem that he left open. Our results apply to this variant, providing a partial answer to this open problem. The rest of this article is organized as follows. Section 2 presents some preliminaries; Section 3 studies the termination of straight-line while loops with a "built-in" function that represents the step function; Section 4 attempts to apply the technique of Section 3 to the case of linear-constraint loops, and discusses the extension with one irrational coefficient, while Section 5 proves the result on updates with two linear pieces. Section 6 describes how a Petri net can be simulated with linear-constraint loops; Section 7 reviews our undecidability result and expresses the hardness of these problems in terms of the arithmetic and the analytic hierarchy; Section 8 discusses some related work; and Section 9 concludes. Motivated by the increasing interest in the termination of integer loops, we have studied the hardness of termination proofs for several variants of such loops. In particular, we have considered straight-line while loops, and integer linear-constraint loops. The latter are very common in the context of program analysis.. For straight-line while loops, we have proved that if the underlying instruction set allows the implementation of a simple piecewise linear function, namely the step function, the termination problem is undecidable. For integer linear-constraint loops, we have shown that allowing the constraints to include a single arbitrary irrational number makes the termination problem undecidable. For the case of integer constraint loops with rational coefficients only, we could simulate a Petri net. This result provides interesting lower bounds on the complexity of the termination, and other related problems, of ILC loops. For example, since marking equivalence (equality of the sets of reachable states) is undecidable for Petri nets [Esparza and Nielsen 1994; Hack 1976; Jancar 1995] , it follows that equivalence (in terms of the reachable states) of two ILC loops with given initial states is also undecidable, which in turn implies that the reachable states of an ILC loop are not expressible in a logic where equivalence is decidable.. We hope that our results shed some light on the termination problem of simple integer loops and perhaps will inspire further progress on the open problems. Termination of integer loops has received considerable attention recently, both from theoretical (e.g., decidability, complexity), and practical (e.g., developing tools) perspectives. Research has addressed straight-line while loops as well as loops in a constraint setting, possibly with multiple paths.. For straight-line while loops, the most remarkable results are those of Tiwari [2004] and Braverman [2006] . Tiwari proved that the problem is decidable for linear deterministic updates when the domain of the variables is R. Braverman proved that this holds also for Q, and for the homogeneous case it holds for Z (see Section 1). Both considered universal termination, the termination for a given input left open.. Decidability and complexity of termination of single-and multiple-path ILC loops has been intensively studied for different classes of constraints. Lee et al. [2001] proved that termination of a multiple-path ILC loop, when the constraints are restricted to size-change constraints (i.e., constraints of the form X i > X j or X i ≥ X j over N), is PSPACE-complete. Ben-Amram and Lee [2007] and Ben-Amram and Codish [2008] identified subclasses of such loops for which the termination can be decided in, respectively, PTIME and NPTIME. Ben-Amram [2010] extended the types of constraints allowed to monotonicity constraints of the form X i > Y , X i ≥ Y , where Y can be a primed or unprimed variable. Termination for such loops is, again, PSPACE-complete. All the aforesaid results involving size-change or monotonicity constraints apply to an arbitrary well-founded domain, although the hardness results only assume N. Monotonicity constraints over Z were considered by Codish et al. [2005] and by Ben-Amram [2011] , concluding that this termination problem too is PSPACE-complete. Recently, Bozzelli and Pinchinat [2012] proved that it is still PSPACE-complete for gap constraints, which are constraints of the form X − Y ≥ c where c ∈ N. In a similar vein, Ben-Amram [2008] proved that for general difference constraints over the integers, that is, constraints of the form X i − X j ≥ c where c ∈ Z, the termination problem becomes undecidable. However, for a subclass in which each target (primed) variable might be constrained only once (in each path of a multiple-path loop) the problem is PSPACE-complete.. All the preceding work concerns multiple-path loops. Recently, Bozga et al. [2012] showed that (universal) termination of a single ILC loop with octagonal relations is decidable. Petri nets and various extensions, such as reset and transfer nets, can also be seen as multiple-path ILC loops. The termination (for a given input) of place/transition Petri nets and certain extensions is known to be decidable [Dufourd et al. 1999; Rackoff 1978] .. A related topic that received much attention is the synthesis of ranking functions for such loops, as a means of proving termination. Sohn and Gelder [1991] proposed a method for the synthesis of linear ranking functions for (single path) ILC loops over N. Later, their method was extended by Mesnard and Serebrenik [2008] to Q and to multiple-path loops, and completeness has also been proved. The method relies on the duality theorem of linear programming. Podelski and Rybalchenko [2004] also proposed a method for synthesizing linear ranking function for ILC loops. Their method is based on Farkas' lemma, which has been used also by Colón and Sipma [2001] for synthesizing linear ranking functions. It is important to note that these methods are complete with respect to synthesizing linear ranking functions when the variables range over R or Q, but not Z. Recently, Bagnara et al. [2012] proved that the methods of Mesnard and Serebrenik [2008] and Podelski and Rybalchenko [2004] are actually equivalent, in the sense that they compute the same set of ranking functions, and that the method of Podelski and Rybalchenko can, potentially, be more efficient since it requires solving rational constraints systems with fewer variables and constraints. Bradley et al. [2005] presented an algorithm for computing linear ranking functions for straight-line integer while loops with integer division.. Piecewise affine functions have been long used to describe the step of a discretetime dynamical system. Blondel et al. [2001] considered systems of the form x(t + 1) = f (x(t)) where f is a piecewise affine function over R n (defined by rational coefficients). They show that some problems are undecidable for n ≥ 2, in particular, whether all trajectories go through 0 (the mortality problem). This can be seen as termination of the loop while x = 0 do x := f(x).

O O B O B I O O O O O O O O B O O O O O B I O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O B O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O B I O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O B I O O O O O O O O O O B O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O B O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O


Quick Search for Rare Events Abstract-Rare events can potentially occur in many applications. When manifested as opportunities to be exploited, risks to be ameliorated, or certain features to be extracted, such events become of paramount significance. Due to their sporadic nature, the information-bearing signals associated with rare events often lie in a large set of irrelevant signals and are not easily accessible. This paper provides a statistical framework for detecting such events so that an optimal balance between detection reliability and agility, as two opposing performance measures, is established. The core component of this framework is a sampling procedure that adaptively and quickly focuses the information-gathering resources on the segments of the dataset that bear the information pertinent to the rare events. Particular focus is placed on Gaussian signals with the aim of detecting signals with rare mean and variance values. T HE problem of searching for scarce and, at the same time, significant events that have certain statistical behavior in a pool of information streams is a classical one and has attracted attention in a wide variety of fields over the past few decades. Such events can broadly model at least three categories of problems. One concentrates on seeking opportunities in a range of domains including trading in finance [1] - [3] and spectrum sensing in telecommunication [4] , [5] . The second category pertains to minimizing risks and avoiding catastrophes in applications such as risk analysis in econometrics [6] - [11] , blackout cascade avoidance in energy systems [12] , [13] , intrusion identification in network security [14] - [19] , fraud detection [20] , [21] , and seismology. And the third category deals with extracting certain data segments with prespecified probabilistic features with applications in image and video analysis, medical diagnosis, neuroscience, and remote sensing (seismic, sonar, radar, biomedical) [22] - [24] . While detecting the rare events in some of these applications is time insensitive, in some other applications, time is of the essence and it is important to devise timely and reliable decision-making mechanisms. Such time sensitivity can be due to the transient nature of the opportunities that are attractive only A. Tajer is with the Department of Electrical and Computer Engineering, Wayne State University, Detroit, MI 48202 USA (e-mail: tajer@wayne.edu).. H. V. Poor is with the Department of Electrical Engineering, Princeton University, Princeton, NJ 08544 USA (e-mail: poor@princeton.edu).. Communicated by G. V. Moustakides, Associate Editor for Detection and Estimation.. Color versions of one or more of the figures in this paper are available online at http://ieeexplore.ieee.org.. Digital Object Identifier 10.1109/TIT.2013.2253351 when detected quickly, or due to the substantial costs that risks can incur if not detected and managed swiftly. Each of these applications can be modeled as a collection of events that can be broadly categorized into two groups. One group constitutes the majority of the events, which are deemed normal and occur most of the time, and the other group consists of the events that occur rarely but are of extreme significance to the observer. In this paper, we assume that the group of all normal events share the same statistical behavior and the group of rare events also share identical statistical behavior, albeit different from that of the normal events. This dichotomous model is adopted to mainly focus the attention on the discrepancy between the rare and the normal events and can be easily generalized to models that involve multiple statistical behaviors for each group. Hence, we assume that the observer has access to a collection of sequences of random observations , each modeling one event. Each sequence consists of independent and identically distributed (i.i.d.) measurements taking values in the set endowed with a -field of events, obeying one of the two hypotheses: (1) where and denote the cumulative distribution functions (cdfs) of two distinct distributions on . The distribution models the statistical behavior of the normal events and the distribution models the statistical behavior of the rare events. For convenience, we assume that and have probability density functions (pdfs) and , respectively. Each sequence is generated by or independently of the rest of the sequences and we assume that hypothesis (a rare event) occurs with prior probability . In order to incorporate the rareness of the sequences generated by , we assume that as grows.. The goal of quick search is to identify one or more rare events among all given events through 1) designing an information-gathering process for collecting information from the sequences , and 2) delineating optimal decision rules. Designing a quick search process involves a tension between two performance measures, one being the aggregate amount of information accumulated (i.e., the number of observations made) and the other being the reliability (or cost) of the decision. In this paper, we design an optimal information-gathering process that maximizes the decision reliability subject to a hard 1 constraint on the aggregate number of observations we are allowed to make from . In this paper, we have presented an adaptive sampling methodology for quickly searching over finitely many events with the objective of identifying multiple events that occur sparsely and are distributed according to a given distribution of interest. The main idea of the sampling procedure is to successively and gradually adjust the measurement process using information gleaned from the previous measurements. Compared to corresponding nonadaptive procedures, dramatic gains in terms of reliability and agility are achieved. Note that among the three actions, action (observation) concentrates on accumulating further evidence about the statistical behavior of the sequences under observation. Action (refinement) is intended to purify the set of the sequences on which we ultimately perform the detection action. Each iteration of the refinement actions monitors the events retained by the previous iterations and eliminates those deemed least-likely to be rare events. The core idea of the refinement action is that it is relatively easy to identify sequences drawn from with low-quality measurements as the events of interest occur rarely ( is small). After iteratively performing actions and , we will have a more condensed proportion of the desired sequences to the undesired ones. The sequences retained after the last action are further observed and finally fed to the detector in order to identify sequences of interest. Characterizing the detection error rate , as a result, depends on 1) the evolution of the proportion of the number of the normal and rare events throughout the refinement actions, and 2) the quality of the detector. For any time , let us partition the set , which includes the indices of the sequences observed at time , into two disjoint sets and as Also let us define and for all . As will be made clear in the subsequent sections, implementing action (detection) necessitates obtaining the low-order statistics of the sets and with sample sizes and , respectively. Evaluating the dynamics of the refinement action additionally requires analyzing the high-order statistics of the sets and the low-order statistics of the sets for all . Moreover, and are also random variables that change (reduce) after each refinement action. Analyzing the evolution of the set sizes and as well as the necessary order statistics depends on the distributions and . The necessary tools and results from the order statistics literature that will be used frequently throughout the analysis are summarized in Appendix A.

B B O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O B B O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O B B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O


Cored-Based Tree with Forwarding Regions (CBT-FR); A Protocol for Reliable Multicasting in Mobile Ad Hoc Networks In this paper we propose a new protocol for reliable multicast in a multihop mobile radio network. The protocol is reliable, i.e., it guarantees message delivery to all multicast nodes even when the topology of the network changes during multicasting. The proposed protocol uses a corebased shared tree. The multicast tree may get fragmented due to node movements. A notion of forwarding region is introduced which is used to glue together fragments of a multicast trees. The gluing process involves ooding of the forwarding region of only those nodes that witness topology change due to node mobility. Delivery of multicast messages to mobile nodes is expedited through (i) pushing of the message by witness nodes in their forwarding regions and (ii) pulling of messages by a mobile node during (re)joining process. Hence, the protocol conserves network bandwidth by using a combination of the push-pull approach and by restricting ooding only to the essential parts of the network that is a ected by topology change.We develop a theoretical model to compute the probability of packet loss (as a function of the mobility rate) for our proposed scheme compared to the the core-based tree protocol (CBT); we also evaluate the e ectiveness of forwarding regions as compared to traditional ooding. Our analysis shows that the proposed scheme signi cantly outperforms CBT. We have proposed a protocol for reliable multicast in mobile multi-hop radio networks. The protocol supports multicasting to a set of prede ned multicast groups. The protocol uses a shared core based multicast tree and it is independent of the underlying unicast routing protocol. A notion of forwarding region is introduced which is used to limit the ooding of message (if and when needed) only to the vicinity of the nodes which witness topology change due to host mobility. Our protocol has two distinct advantages: (1) it is reliable; it guarantees message delivery in the event of topology change during multicast; the multicast protocol of GCZ99] does not have this property; (2) our protocol is more e cient in conserving network bandwidth especially when the multicast groups are small in size and the multicast group members are localized to a certain region of the network; the implicitly formed forwarding regions can detect the topology changes during multicast and limits ooding only to the part of the network that is a ected by the change. We have shown using analytical modeling that the probability of packet loss, P loss , is considerably reduced by using the proposed push-pull approach. Although we have assumed prede ned multicast groups in this work, we believe the protocol can be easily extended to handle dynamic multicast groups. Recently, it has been shown that the exponentially distributed message arrival may not be the most appropriate for LAN/WAN and the Internet tra c; it would be worthwhile to study the performance of the protocols with bursty and/or self-similar tra c distributions. Failure of node i's link to node j.

O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O