id
stringlengths 40
40
| text
stringlengths 9
86.7k
| metadata
stringlengths 3k
16.2k
| source
stringclasses 1
value | added
stringdate 2024-11-21 00:00:00
2024-12-12 00:00:00
| created
stringdate 2024-11-21 00:00:00
2024-12-12 00:00:00
|
|---|---|---|---|---|---|
433260c77fc5a7b42d7c5adcf204dafa5eac48f1
|
MOBILE COMMUNICATORS FOR DISABLED PEOPLE
Miguel A. Laguna and Bruno González-Baixauli
University of Valladolid, Spain
Keywords: Software Product Line, Feature Model, Mobile System, Communicator.
Abstract: Software product lines are a proven development paradigm in industrial environments. However, its application in small organizations is not easy. Our approach uses the package merge mechanism of the UML 2 meta-model as representation of the variability in the product line. The structure of the variability models is directly reflected in the relationships between packages in the architectural models, so that the traceability of configuration decisions is straightforward. A similar strategy is applied at the implementation level, using packages of partial classes. The combination of these techniques and the conventional IDE tools make the developments of product lines in small organizations easier as it removes the need for specialized tools and personnel. This article reports a successful experience with a communicator product line case study, representative of the mobile systems domain. People with certain communication problems can use these systems as a low-cost help in their everyday life. As problems vary from a person to another, a communicator product line is the indicated solution, allowing the adequate personalization of the final application to the disability of each concrete person.
1 INTRODUCTION
Software product lines (SPL) are a proven reuse approach in industrial environments, due to the combination of a systematic development and the reuse of coarse-grained components that include the common and variable parts of the product line (Bosch, 2000). However, this approach is complex and requires a great effort by the companies that take it on. The research we carry out in the GIRO research group aims to simplify the change from a conventional development process into one that benefits from the product line advantages in small and medium enterprises (SME) or organizations. For this reason, we have proposed, among other initiatives, an adaptation of the Unified Process to include specific techniques of Product Line Engineering in a process parallel to Application Engineering (Laguna et al., 2003).
As specific SPL development techniques, we must pay special attention to the variability and traceability aspects at each abstraction level. We need models that represent the product line and a mechanism to obtain the configuration of features that represent the best combination of variants for a specific application. Additionally, we must connect the optional features with the related variation points of the architectural models that implement the product line through traceability links. There is wide agreement about using a model that shows, in an explicit and hierarchical way, the variability by means of a feature model in some of their multiple versions like FODA (Kang et al., 1990) or FORM (Kang et al., 1998). FODA features are nodes of a tree, related by various types of edges (Figure 1). The tree root is called the root feature, or concept. The edges are used to decompose this concept into more detailed features. There are AND, X-OR and optional decompositions. Several extensions have been proposed, using directed acyclic graphs instead of simple trees or changing the visual syntax.

We have also proposed the use of the goal and soft-goal concepts (van Lamsweerde, 2001) for the analysis and definition of the variability in product lines. In fact, we have built an initial prototype that permits the optimum set of features to be selected with respect to the desires of the users, expressed as a set of goals and soft-goals with different priorities (González-Baixauli et al., 2004).
The second aspect of the problem focuses on the connection of the feature model with the design of the solution or product line architecture, usually implemented by an object-oriented framework. This explicit connection allows the automatic instantiation of the domain framework in each specific application. In a previous work (Laguna et al., 2007), we proposed the UML 2 package merge mechanism to orthogonally represent the SPL architectural variations, their relationship with the optional features and finally, using partial class packages, with the structure of the implementation code.
We planned, as a continuation of this work, to test the proposal in realistic situations. Our group has agreements with associations of handicapped people with the aim of developing useful tools for people with several types of disabilities. This background has guided the selection of the application domains. This article is a report of the practical experiences with these techniques in the development of a product line of personalized communicators for people with disabilities, based on mobile devices, typically personal digital assistants (PDA).
A distinctive characteristic is the use of conventional CASE and IDE tools. This is a prerequisite imposed by the general objective of our approach: to simplify the adoption of the product line paradigm by SMEs. In particular, we have used .NET and MS Visual Studio as development platforms. The personnel involved vary from granted undergraduates finishing their term projects, but they are not specialists in SPL development.
The rest of the article is organized as follows: Section 2 briefly presents the proposed techniques, based on the package merge relationship of UML 2 and the partial class mechanism. Section 3 is devoted to the description of the case study. In Section 4, the related work is analyzed and, finally, Section 5 concludes the article, states some lessons learned and outlines future work.
2 SEAMLESS SPL DEVELOPMENT
Each concrete system in a product line is derived from a complete architecture, selecting or not the optional parts, with respect to the particular functional and non-functional user requirements. This activity is basically a selection process that yields a feature sub-model. This sub-model, through traceability relationships, guides the composition of the code modules. The key aspect of the process is the traceability from features to design and from design to implementation. This traceability is not easily managed for several reasons (Sochos et al., 2004). On the one hand, an optional feature can be related to several elements in a UML model and vice versa. We must therefore assign the traceability relationship between elements of the two levels with a "many-to-many" multiplicity. This fact quickly complicates the global model, making it poorly scalable. The second problem is summarized in the fact that the same basic modeling mechanisms of variability (the specialization in class diagrams or the <<extend>> relationship of the use cases diagrams) are used to express two variability levels: the design of the product line architecture and the design of a specific application that also has variations (for example two valid and alternative payment forms within a sales system).
The solution to this problem has been achieved by modifying or adapting the UML structural and behavioral models, moving from the standard (see the references of the related work Section). In our approach, one of the initial restrictions imposed was to maintain unchanged the UML meta-model, in order to use conventional CASE tools to model the product line. Other obligations were:
a) The technique must allow the location, at one point on the model, of all the variations associated to each optional feature to facilitate the management of the traceability.
b) The technique must separate the SPL from the intrinsic variability of the specific applications.
c) The selected mechanism must have continuity with the implementation models ("seamless development").
To achieve these objectives, we express the variability of UML models using the package merge mechanism, defined in the UML 2 infrastructure meta-model and used in an exhaustive way in the definition of UML 2 (Object Management Group, 2003).
The package merge mechanism adds details to the models in an incremental way. The <<merge>> dependence is defined as a relationship between two packages that indicates that the contents of both are combined. It is very similar to generalization and is used when elements in different packages have the same name and represent the same concept, beginning with a common base. Selecting the desired packages, it is possible to obtain a tailored definition from among all the possible ones. Even though, in this work, we focus on class diagrams, the mechanism can be extended to any UML model, in particular use cases and sequence diagrams (Object Management Group, 2003).
This mechanism permits a clear traceability between feature and UML models to be established. The application to our problem consists in associating a package to each optional feature, so that all the necessary changes in the model remain located (maintaining the UML meta-model unchanged and separating both variability levels).
The package model is hierarchical, reflecting the feature model structure. Considering each pair of related packages recursively, the base package can be included or not in each specific product, but the dependent package can only be included if the base package is also selected. This is exactly how experts decide which features are included or not during the configuration process, and is directly reflected in the final product configuration of packages. Therefore, the application to SPL consists of building the architectural model (including structural –class diagrams-, behavioral -use cases-, and dynamic –interaction diagram- models) starting from a base package that gathers the common SPL aspects. Then, each variability point detected in the feature model originates a package, connected through a <<merge>> relationship with its parent package. These packages will be combined or not, when each product is derived, according to the selected feature configuration. Figure 2 shows an example of application in the e-commerce domain.
Additionally, using partial classes organized in packages, a direct correspondence between design and code can be established. The use of partial classes is a way of managing variability. The aim is to maintain a one-to-one correspondence from features to design and from design to implementation. As an added value, the package structure of the code for each final product of the SPL can be obtained automatically (and passed to the compiler) from the features configuration (Laguna et al., 2007).
Table 1: Comparison of different writing methods.
<table>
<thead>
<tr>
<th>Writing method</th>
<th>Speed required</th>
<th>Capacity</th>
<th>Learning</th>
</tr>
</thead>
<tbody>
<tr>
<td>Swept</td>
<td>Very slow</td>
<td>Very little</td>
<td>Very little</td>
</tr>
<tr>
<td>Sweep (with sound)</td>
<td>Very slow</td>
<td>Very little</td>
<td>Very little</td>
</tr>
<tr>
<td>Sweep (groups)</td>
<td>Slow</td>
<td>Very little</td>
<td>Little</td>
</tr>
<tr>
<td>Diagonals</td>
<td>Middle</td>
<td>Little</td>
<td>Middle</td>
</tr>
<tr>
<td>Repeated pulsations</td>
<td>Middle</td>
<td>Middle</td>
<td>Middle</td>
</tr>
<tr>
<td>Databases</td>
<td>Rapid</td>
<td>Middle</td>
<td>Middle</td>
</tr>
<tr>
<td>Traits</td>
<td>Very rapide</td>
<td>High</td>
<td>High</td>
</tr>
<tr>
<td>Grouped characters</td>
<td>Rapid</td>
<td>Middle</td>
<td>Middle</td>
</tr>
<tr>
<td>Vowels</td>
<td>Rapid</td>
<td>Middle</td>
<td>High</td>
</tr>
</tbody>
</table>
3 CASE STUDY: COMMUNICATORS FOR PEOPLE WITH DISABILITIES
The case study is not very ambitious if we judge it by the number of considered variations but presents interesting problems, due to the constraints imposed by the specificity of mobile device development. The domain analysis has been accomplished starting from the experience with several PDA systems developed in our laboratory. Each one of these originally solved the particular problem of a concrete person with some degree of disability. These systems have been built in collaboration with Asprona, a Spanish association that maintains several schools specialized in children with medium/severe disabilities of several types. The main utility of these communicators is that people with different degrees of disability can compose messages using text (selecting the different characters as in a keyboard) or images (that represent different concepts) in a suitable (and usually mobile) device. The suitable methods are compared in Table 1. Once composed, the device can reproduce the message using a text-to-speech conversion (or send it to another device). The product line approach has a clear intention: separate the common parts of these systems from the specialized ones, developing these parts as optional packages. As an immediate result, we have multiplied the number of different available variants.
3.1 Feature Analysis
All the final applications must reproduce the text composed by the user. But, due to the different abilities of the users, it is necessary to consider different writing methods, adapted to each type of disability. For example, if the user is not capable of clicking a button, it is necessary to use a sweeping method. We have considered several (textual and image based) writing methods. Some of them are the...
Figure 4: Feature model tool and the communicator product line, solution, configuration and model views.
- Grouped characters method: the main screen shows several groups of characters (AÁBCDE, ÉFGHIÍ, etc.). Selecting a group enables another screen, where the characters of this group appear redistributed, one per cell. The selection of one of them results in that character being added to the text.
- Vowels method: similar to the previous method, but the vowels are represented in independent cells on the main screen, generally reducing the number of pulsations.
- Categories method: the categories of characters (consonants, vowels and numbers) are shown in the initial screen.
Each of the evaluated methods has advantages and inconveniences for people with different degrees and types of disabilities, as shown in Table 1. Using the table as a guide, and adding some complementary aspects such as color management, phrases persistence, etc., the feature model of Figure 3 has been defined.
The feature model has been defined with the Feature Modeling Tool (FMT, available at GIRO site), developed in our group with Microsoft DSL tools as an add-in of Visual Studio. The modeling tool is completed with the package generation and configuration utilities, as explained in the previous Section. For legibility reasons, the original graphical tree format is depicted in a compact alternative representation (the model explorer, bottom right panel of Figure 4 view of FMT). According to this, each final product can incorporate several writing methods, but all the systems will have at least the grouped characters method. For this reason, the right structure of the feature model has two main alternative branches. If more than a writing method is selected, the exchange...
3.2 Product Line Design
In Figure 4, some of the packages and classes that make up the product line can be appreciated inside the original Visual Studio solution explorer (upper right panel of the image). Each package contains internally a set of partial classes that the compiler will integrate if the package is selected (i.e., if the optional feature is selected in the bottom left configuration panel of Figure 4).
In this type of applications the need for persistence is limited (only preferences and customer phrases are saved), but interface design requires a greater effort, due to the limitations of the visualization screen. To deal with these limitations, XML and XSD files that define the elements of the interface are used. The variable parts are included in the different packages. In Figure 5, the design of the user interface is shown in a diagrammatical way. The size and number of buttons are variable and the selected configuration indicates the number of buttons on each screen, as well as size, position, functionality and appearance. For example, if the Textual package is selected, the principal_cat.xml file defines the welcome screen and creates the communicator according to the selected writing method.
3.3 Product Line Implementation
At implementation level, partial classes and conditional compilation have been used. The strategy consists of using the same code structure in all the cases, as a template. The Base package contains a main class Program.cs, where the code that loads the common part of the product line is included. The optional packages contain a class Program.cs with the methods that add the package, executed from the source code through conditional compilation. For example, the package CompleteOptions has a class with the methods that add color details and the management of predefined phrases, updating the menu with the new options.
One of the components that the product line must include is the text-to-speech utility. In spite of the available commercial and open-source applications,
the limitations of the mobile platforms have forced to an ad-hoc solution, developing a simple syllabic synthesizer, with the collaboration of the students who lend their voices.
The product line includes eight thoroughly functional applications, compiled from different package combinations (some examples can be appreciated in Figure 6). Pending integration is an optional feature already implemented that will allow wireless and SMS based communication with a desktop computer.
A first working prototype has been delivered to the Asprona association specially configured for a person with speech problems and good manual coordination, as a result of a traffic accident. In this case, the grouped characters method is a good election. The use of the system, fixed to his wheel chair, is helping him to get a greater level of autonomy.
Figure 7: A final prototype, configured using the grouped characters method.
4 RELATED WORK
Though there are many projects that describe variability management mechanisms in terms of requirements and designs, few of them include implementation details. Different authors have proposed explicitly representing the variation points adding annotations or changing the essence of UML. For example, Von der Maßen et al. proposed using new relationships ("option" and "alternative") and the consequent extension of the UML meta-model (Massen & Lichter, 2003). John & Muthig suggest the application of use case templates to represent the variability in product lines, using stereotypes (John & Muthig, 2002), though they do not distinguish between optional variants, alternative or obligatory. On the other hand, Halman and Pohl defend the modification of use case models to orthogonally represent the variation points (using a triangle symbol with different annotations) (Halman & Pohl, 2003). As for structural models, either the mechanisms of UML are used directly (through the specialization relationship, the association multiplicity, etc.) or the models are explicitly annotated using stereotypes. The work of Gomaa is an example of this approach, since it uses the stereotypes <<kernel>>, <<optional>> and <<variant>> (corresponding to obligatory, optional, and variant classes) (Gomaa, 2000). Similarly, Clauß proposes a set of stereotypes to express the variability in the architecture models: <<optional>>, <<variationPoint>> and <<variant>> stereotypes designate, respectively, optional, variation points (and its sub-classes), and variant classes (Clauß, 2001). Though this type of approximations permits the evolution of the variability to be traced at the different levels, they do not solve the requirement of a one-to-one correspondence between the different models.
Another solution proposed by Czarnecki in (Czarnecki & Antkiewicz, 2005), consists of annotating the UML models with presence conditions, so that each optional feature is reflected in one or, more realistically, several parts of a diagram (perhaps a class, an association, an attribute, etc. or a combination of elements). This technique does not artificially limit the representation of a variant with a unique element and even the color code helps to emphasize the implications of choosing a certain option. However, this visual help is not scalable when more than a dozen variants are handled. In all these approaches, the modification of the UML meta-model (or at least the use of stereotypes) is required.
A completely different approach, focused on implementation instead of requirements or design, is the Feature Oriented Programming (FOP) paradigm (Batory et al., 2004). The optional features are implemented as increments (refinements) in a java-like language. Starting from a base class, these increments are combined using a set of tools, provided with the AHEAD tool suite. Other commercial tools, such as Big-Lever Gears or Pure-Variants offer functionalities. Though these solutions are valid, the learning of new modeling or implementation techniques and the need of specialized CASE and IDE tools represent barriers for the adoption of the approach of product lines in
many organizations; we therefore believe that the solution presented here improves the abovementioned proposals.
5 CONCLUSIONS
In this work the viability of a product line development approach, based on the package merge and partial class mechanisms, has been shown. The use of the proposed mechanisms enables the automated generation of each product from the features configuration. Furthermore, the use of conventional CASE and IDE tools can simplify the adoption of this paradigm, avoiding the necessity of specific tools and techniques as in previous alternatives.
The approach has been successfully applied to the design and implementation of a product line in the domain of communicators for people with disabilities, and implemented with mobile devices.
Current work includes the development of other product lines with industrial or social interest, and the enrichment of the communicator study. In this case, the objective is to evaluate the scalability of the proposal as the optional features increase (which implies an exponential increase in the number of final products). On the other hand, the experience with this type of mobile platform is being used in other domains that combine information capture through PDAs and smart phones with delivery to a central system, configured as a set of Web services. An example of this is a recently launched product line project for monitoring health parameters (such as heart rate, temperature, etc.) in the context of a senior citizen residence, using a combination of wireless sensors and mobile devices. The utility of the product line approach in these domains is evident, as the variety of sensors, parameters, alarm signals, and visualization aspects in the central computer is potentially unlimited.
ACKNOWLEDGEMENTS
This work has been founded by the Junta de Castilla y León (VA-018A07 project) and Spanish MICIINN (TIN2008-05675). We also recognize the collaboration of the ASPRONA association, and the students involved in the development of these product lines.
REFERENCES
|
{"Source-Url": "http://www.scitepress.org/Papers/2009/22461/22461.pdf", "len_cl100k_base": 4629, "olmocr-version": "0.1.42", "pdf-total-pages": 8, "total-fallback-pages": 0, "total-input-tokens": 23814, "total-output-tokens": 5708, "length": "2e12", "weborganizer": {"__label__adult": 0.00023424625396728516, "__label__art_design": 0.0003674030303955078, "__label__crime_law": 0.00019633769989013672, "__label__education_jobs": 0.0008411407470703125, "__label__entertainment": 3.62396240234375e-05, "__label__fashion_beauty": 0.0001145005226135254, "__label__finance_business": 0.00017762184143066406, "__label__food_dining": 0.00022172927856445312, "__label__games": 0.0002682209014892578, "__label__hardware": 0.0006127357482910156, "__label__health": 0.0003314018249511719, "__label__history": 0.0001379251480102539, "__label__home_hobbies": 5.340576171875e-05, "__label__industrial": 0.00026607513427734375, "__label__literature": 0.00014162063598632812, "__label__politics": 0.00014007091522216797, "__label__religion": 0.000286102294921875, "__label__science_tech": 0.00583648681640625, "__label__social_life": 5.567073822021485e-05, "__label__software": 0.005462646484375, "__label__software_dev": 0.9833984375, "__label__sports_fitness": 0.00017213821411132812, "__label__transportation": 0.0002846717834472656, "__label__travel": 0.00012886524200439453}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 25811, 0.02135]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 25811, 0.11503]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 25811, 0.90169]], "google_gemma-3-12b-it_contains_pii": [[0, 3415, false], [3415, 8116, null], [8116, 10662, null], [10662, 13223, null], [13223, 15005, null], [15005, 17052, null], [17052, 21157, null], [21157, 25811, null]], "google_gemma-3-12b-it_is_public_document": [[0, 3415, true], [3415, 8116, null], [8116, 10662, null], [10662, 13223, null], [13223, 15005, null], [15005, 17052, null], [17052, 21157, null], [21157, 25811, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 25811, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 25811, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 25811, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 25811, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 25811, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 25811, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 25811, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 25811, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 25811, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 25811, null]], "pdf_page_numbers": [[0, 3415, 1], [3415, 8116, 2], [8116, 10662, 3], [10662, 13223, 4], [13223, 15005, 5], [15005, 17052, 6], [17052, 21157, 7], [21157, 25811, 8]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 25811, 0.12941]]}
|
olmocr_science_pdfs
|
2024-11-22
|
2024-11-22
|
5047c87f9cc6192ba855ee51d7a655585167ba84
|
4. Web Services
Vilmos Bilicki PhD
University of Szeged
Department of Software Engineering
Different approaches
- Web Service
- REST
- RMI, ....
Conceptual Overview
Requirements
- Requirements supported by REST-enabled systems stem from the requirements addressed by any system following Web architecture:\(^1\):
- Simplicity
- Low barrier of entry, fast adoption of Web APIs.
- Extensibility
- Allowing growth and flexibility.
- Distributed hypermedia
- Relying on the established concepts of hyperlinked content.
- Scalability at the Web level
- Should rely on technologies/protocols supporting scalable solutions.
- Independent deployment
- Coexistence of old and new
WWW
Program systems development
Conceptual Overview
Requirements - Simplicity
- Participation in the creation of information is voluntary
- Low entry-barrier is necessary
- Hypermedia has simple and general user interface
- The same interface is used for all information sources
- Hypermedia relationships are flexible – unlimited structuring
- Users can be guided through reading by manipulating links
- Simple queries are incorporated for searching purposes
- Partial availability of the overall system doesn’t prevent the authoring of the content
- Hypermedia authoring language is simple and capable of using existing tools
- Unavailability of referenced information allows further authoring
- References to the content are easily exchanged
- Communication can be viewed and interactively tested by developers
Conceptual Overview
Requirements - Extensibility
- User requirements change over time just as society does
- The system must avoid locking to the deployed solutions
- The limitations must be easily resolvable
- A system with the goal to be long-lived as the Web must be prepared for change.
Conceptual Overview
Requirements – Distributed Hypermedia
- Hypermedia includes application control information embedded within the presentation of information.
- Distributed hypermedia allows the content and control information to be stored at remote locations.
- Transfer of large amounts of data is needed while a user interacts with content.
- Users are quite sensitive to perceived latency
- Time between link selection and information rendering
- Information is distributed across the global network
- Network interactions must be minimized.
Conceptual Overview
Requirements – Internet Scale
- The Web is Internet-scale distributed hypermedia system
- The Web must answer to the problem of anarchic scalability
- The constituent systems are not centrally managed neither have a common goal
- Parts must continue to operate even under unanticipated load, or when given malformed or maliciously constructed data.
- Security becomes a significant concern
- Multiple trust boundaries may be present in any communication
- Additional authentication must be in place before trust can be given
- Authentication may degrade scalability
Conceptual Overview
Requirements – Independent Deployment
- Systems must be prepared for gradual and fragmented change
- Old and new implementations may co-exist without preventing the new implementations to achieve their full potential.
- Existing design decisions must acknowledge future extensions.
- Old systems must be easily identifiable
- Legacy behavior can be encapsulated without impacting newly deployed subsystems
- The architecture must allow deployment of new elements in a partial and iterative fashion
- Not possible to enforce deployment order.
Conceptual Overview
Representational State Transfer (REST)
- Representational State Transfer (REST)
- A style of software architecture for distributed hypermedia systems such as the World Wide Web.
- REST is basically client/server architectural style
- Requests and responses are built around the transfer of "representations" of "resources".
- Architectural style means
- Set of architectural constraints.
- Not a concrete architecture.
- An architecture may adopt REST constraints.
- HTTP is the main and the best example of a REST style implementation
- But it should not be confused with REST
Conceptual Overview
Major REST principles
- Information is organized in the form of resources
- Sources of specific information,
- Referenced with a global identifier (e.g., a URI in HTTP).
- Components of the network (user agents and origin servers) communicate via a standardized interface (e.g., HTTP)
- exchange representations of these resources (the actual documents conveying the information).
- Any number of connectors (e.g., clients, servers, caches, tunnels, etc.) can mediate the request, but each does so without being concerned about anything but its own request
- an application can interact with a resource by knowing two things: the identifier of the resource and the action required
- no need to know whether there are caches, proxies, gateways, firewalls, tunnels, or anything else between it and resource
- The application needs to understand the format of the information (representation) returned.
Conceptual Overview
REST Architectural Constrains (1)
- **Client-server**
- Separation of concerns
- Clients are separated from servers by a uniform interface.
- Networking
- Clients are not concerned with data storage, which remains internal to each server, so that the portability of client code is improved. Servers are not concerned with the user interface or user state, so that servers can be simpler and more scalable.
- Independent evolution
- Servers and clients may also be replaced and developed independently, as long as the interface is not altered.
Conceptual Overview
REST Architectural Constrains (2)
- Stateless communication
- Scalability, reliability
- No client context being stored on the server between requests. Each request from any client contains all of the information necessary to service the request.
- Resources are conversationally stateless
- Any conversational state is held in the client.
- Uniform Interface
- Simplicity (vs. efficiency)
- Large-grained hypermedia data transfer
- Example: Create, Retrieve, Update, Delete
Conceptual Overview
REST Architectural Constrains (3)
- Caching
- Efficiency, scalability
- Well-managed caching partially or completely eliminates some client-server interactions, further improving scalability and performance.
- Consistency issues
- As on the World Wide Web, clients are able to cache responses. Responses must therefore, implicitly or explicitly, define themselves as cacheable or not, to prevent clients reusing stale or inappropriate data in response to further requests.
- Code-on-demand
- Extending client functionality
- Servers are able to temporarily extend or customize the functionality of a client by transferring to it logic that it can execute. Examples of this may include compiled components such as Java applets and client-side scripts such as JavaScript.
Conceptual Overview
RESTful Web Service definition
A RESTful Web service is:
- A set of Web resources.
- Interlinked.
- Data-centric, not functionality-centric.
- Machine-oriented.
Like Web applications, but for machines.
Like WS-*, but with more Web resources.
WS-* stands for a variety of specifications related to SOAP-based Web Services.
Conceptual Overview
WS-★ vs REST: A quick comparison
WS-★
- listEntries()
- addEntry()
- getEntry()
- deleteEntry()
- updateEntry()
RESTful
- listEntries()
- addEntry()
- getEntry()
- deleteEntry()
- updateEntry()
A SOAP service (WS-★) has a single endpoint that handles all the operations – therefore it has to have an application-specific interface.
A RESTful service has a number of resources (the collection, each entry), so the operations can be distributed onto the resources and mapped to a small uniform set of operations.
Technologies
- Today’s set of technologies, protocols and languages used to apply RESTful paradigm:
- HTTP as the basis
- XML and JSON for data exchange
- AJAX for client-side programming (e.g. browser)
- There exists an attempt to develop WSDL-like definition language for describing RESTful services
- Web Application Description Language (WADL)
HTTP
Overview
- Hypertext Transfer Protocol (HTTP)
- A protocol for distributed, collaborative, hypermedia information systems.
- A request/response standard typical of client-server computing.
- Currently dominant version is HTTP/1.1.
- Massively used to deliver content over the Web
- Web browsers and spiders are relying on HTTP.
- The protocol is not constrained to TPC/IP
- It only presumes a reliable transport.
- Resources accessed by HTTP are identified by URIs (more specifically URLs), using the http URI schemes.
HTTP
Request-response format
Request consists of
- Request line, such as `GET /images/logo.gif HTTP/1.1`, which requests a resource called `/images/logo.gif` from server.
- Headers, such as `Accept-Language: en`
- An empty line
- An optional message body
Response consists of
- Status line which includes numeric status code and textual reason phrase
- Response headers
- An empty line
- The requested content
HTTP
Request methods
HTTP request methods indicate the desired action to be performed on the identified resource:
- **GET**
- Requests a representation of the specified resource. GET should not be used for operations that cause side-effects (problematic with robots and crawlers). Those operations are called safe operations.
- **POST**
- Submits data to be processed (e.g., from an HTML form) to the identified resource. The data is included in the body of the request.
- **PUT**
- Uploads a representation of the specified resource.
- **DELETE**
- Deletes the specified resource.
XML
Overview
- eXtensible Markup Language (XML)
- A set of rules for encoding documents electronically.
- De-facto standard (W3C Recommendation).
- Ubiquitous presence on the Web and the Semantic Web
- Storage and transportation of data (RDF/XML and SOAP),
- Visualization of data (XHTML),
- Application configuration (XML configuration files), etc.
- As such it can not be avoided as a possible data format for Web 2.0 Web Services.
XML
Characteristics
As opposed to JSON XML can be verified against a schema expressed in a number of languages such as Document Type Definition (DTD), and XML Schema:
- the vocabulary (element and attribute names),
- the content model (relationships and structure), and
- the data types.
Founded on the standards laying in the core of Web
- Uniform Resource Identifiers (URI)
- Unicode
Well-formedness an XML document
- Properly encoded legal Unicode characters,
- Special syntax characters such as < and & are used only as markup delineation,
- Element tags are correctly nested,
- Element tags are case sensitive,
- There exists a single “root” element.
XML
Example
```xml
<?xml version="1.0" encoding="UTF-8"?>
<Person>
<firstName>John</firstName>
<lastName>Smith</lastName>
<age>25</age>
<address>
<streetAddress>21 2nd Street</streetAddress>
<city>New York</city>
<state>NY</state>
<postalCode>10021</postalCode>
</address>
<phoneNumber type="home">212 555-1234</phoneNumber>
<phoneNumber type="fax">646 555-4567</phoneNumber>
<newSubscription>false</newSubscription>
</Person>
```
Program systems development
JSON
Overview
- JavaScript Object Notation (JSON)
- A lightweight computer data interchange format.
- Specified in Request For Comment (RFC) 4627.
- Represents a simple alternative to XML
- A text-based, human-readable format for representing simple data structures and associative arrays (called objects).
- Used by a growing number of services
- JavaScript-friendly notation
- Its main application is in Ajax Web application programming.
- A serialized object or array
- No namespaces, attributes etc.
- No schema language (for description, verification)
JSON
Data types
- Number (integer, real, or floating point)
- String (double-quoted Unicode with backslash escaping)
- Boolean (true and false)
- Array (an ordered sequence of values, comma-separated and enclosed in square brackets)
- Object (collection of key:value pairs, comma-separated and enclosed in curly braces)
- null
JSON
Example
```
"firstName": "John",
"lastName": "Smith",
"age": 25,
"address": {
"streetAddress": "21 2nd Street",
"city": "New York",
"state": "NY",
"postalCode": "10021"
},
"phoneNumbers": [
{ "type": "home", "number": "212 555-1234" },
{ "type": "fax", "number": "646 555-4567" }
],
"newSubscription": false,
"companyName": null
```
Elements of SOA
- XML
- SOAP
- WSDL
- WSIL
- UDDI
Web Services
Notation:
- Early work
- Specification in progress
- Reaching maturity
- Approved specification
Program systems development
WSDL Parts
- Types
- Used to define custom message types
- Messages
- Abstraction of request and response messages that my client and service need to communicate.
- PortTypes
- Contains a set of operations.
- Operations organize WSDL messages.
- Operation->method name, portType->java interface
- Bindings
- Binds the portType to a specific protocol (typically SOAP over http).
- You can bind one portType to several different protocols by using more than one port.
- Services
- Gives you one or more URLs for the service.
- Go here to execute “echo”.
Namespaces
- The WSDL document begins with several XML namespace definitions.
- Namespaces allow you to compose a single XML document from several XML schemas.
- Namespaces allow you to identify which schema an XML tag comes from.
- Avoids name conflicts.
WSDL Messages
- The “message” section specifies communications that will go on between endpoints.
- Gives each message a name (to be used later for reference).
- Specifies the type of message
- Can be primitive types, like strings
- Can be defined types, as we saw previously.
The `echoServiceInterface` messages
```xml
<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions>
<wsdl:types />
<wsdl:message name="echoResponse">
<wsdl:part name="echoReturn" type="xsd:string" />
</wsdl:message>
<wsdl:message name="echoRequest">
<wsdl:part name="in0" type="xsd:string" />
</wsdl:message>
<wsdl:portType name="Echo">
<wsdl:operation name="echo" parameterOrder="in0">
<wsdl:input message="impl:echoRequest" name="echoRequest" />
<wsdl:output message="impl:echoResponse" name="echoResponse" />
</wsdl:operation>
</wsdl:portType>
...
</wsdl:definitions>
```
Structure of a Message
- WSDL `<message>` elements have name attributes and one or more `parts`.
- The message name should be unique for the document.
- `<operation>` elements will refer to messages by name.
- I need one `<part>` for each piece of data I need to send in that message.
- Each `<part>` is given a name and specifies its type.
- `<part>` types can point to `<wsdl:type>` definitions if necessary.
WSDL portTypes
- WSDL messages are only abstract messages.
- We bind them to operations within the portType.
- The structure of the portType specifies (still abstractly) how the messages are to be used.
- Think of operations->java methods and portTypes->java interfaces.
The echoServiceInterface portType
```xml
<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions>
<wsdl:types />
<wsdl:message name="echoResponse">
<wsdl:part name="echoReturn" type="xsd:string" />
</wsdl:message>
<wsdl:message name="echoRequest">
<wsdl:part name="in0" type="xsd:string" />
</wsdl:message>
<wsdl:portType name="Echo">
<wsdl:operation name="echo" parameterOrder="in0">
<wsdl:input message="impl:echoRequest" name="echoRequest" />
<wsdl:output message="impl:echoResponse" name="echoResponse" />
</wsdl:operation>
</wsdl:portType>
...
</wsdl:definitions>
```
EchoService portType
<wSDL:portType name="Echo">
<wSDL:operation name="echo" parameterOrder="in0">
<wSDL:input
message="impl:echoRequest" name="echoRequest" />
<wSDL:output
message="impl:echoResponse" name="echoResponse" />
</wSDL:operation>
</wSDL:portType>
portType Message Patterns
- PortTypes support four types of messaging:
- One way: Client send a message to the service and doesn’t want a response.
- <input> only.
- Request-Response: Client sends a message and waits for a response.
- <input>, then <output>
- Solicit-Response: Service sends a message to the client first, then the client responds.
- <output>, then <input>
- Notification: <output> only.
- These still are abstract. We must implement them using some message protocol.
- HTTP units of transmission are request and response, so mapping Solicit-Response to HTTP will take some work.
portType for EchoService
- The echo service has one method, echo.
- It takes one string argument and returns one string.
- In WSDL, the portType is “Echo”, the operation is “echo”.
- The messages are organized into input and output.
- Messages are placed here as appropriate.
- That is, <input> takes the <echoRequest> message.
Parameter Order
- This attribute of operation is used to specify zero or more space-separated values.
- The values give the order that the input messages must be sent.
The Picture So Far...
Input Message
- Part
Output Message
- Part
portType
- Operation
- Input
- Output
hasInput
hasOutput
Binding tags
Binding tags are meant to bind the parts of portTypes to sections of specific protocols.
- SOAP, HTTP GET/POST, and MIME are provided in the WSDL specification.
Bindings refer back to portTypes by name, just as operations point to messages.
- They are mirror images of the portTypes.
- Each part is extended by schema elements for a particular binding protocol (i.e. SOAP).
In WSDL bindings messages:
- Each corresponds to SOAP body sections, described later.
- Additionally, we specify that the body should be encoded.
- That is, RPC encoded.
- Alternatively, could also be “literal” (or “document”).
WSDL Internal References
Program systems development
Structure of the Binding
- `<binding>` tags are really just placeholders.
- They are meant to be extended at specific places by wsdl protocol bindings.
- These protocol binding rules are defined in supplemental schemas.
- The following box figure summarizes these things
- Green boxes are part of WSDL
- From the wsdl namespace, that is.
- Red boxes are parts of the document from other schemas
- From wsdlsoap namespace in the echo example.
Binding Structure
binding
Non-wsdl extension
operation
Non-wsdl extension
input
Non-wsdl extension
output
Non-wsdl extension
Program systems development
A little more on encoding...
- We specify SOAP encoding
- SOAP is a message format and needs a transport protocol, so we specify HTTP.
- Operation styles may be either “RPC” or “Document”.
- SOAP Body elements will be used to actually convey message payloads.
- **RPC** requires “encoded” payloads.
- Each value (echo strings) is wrapped in an element named after the operation.
- Useful RPC processing on the server side.
- **Documents** are literal (unencoded)
- Use to just send a payload of XML inside SOAP.
Binding Associations to SOAP
WSDL
SOAP
Binding
Operation
Input
Output
SOAP RPC
SOAP Action
SOAP Body
SOAP Body
Binding Restrictions
- Binding elements point by name to portTypes.
- WSDL allows more than one binding element to point to the same port type.
- Why?
- Because a service may support multiple, alternative protocol bindings.
Port and Service Tags
- The service element is a collection of ports.
- That’s all it is for.
- Ports are intended to point to actual Web service locations
- The location depends on the binding.
- For SOAP bindings, this is a URL.
Port Associations to Bindings
- Binding
- Operation
- Input
- Output
- Port #1
- URL #1
- Port #2
- URL #2
- Service
Program systems development
Summary of WSDL
́ WSDL decouples remote service operations.
- Types=custom message definitions.
- Any data types not in the XML schema.
- Message=name the messages that must be exchanged and their data types, possibly defined by <type>.
- PortTypes=service interfaces
- Operations=remote method signatures.
- Bindings=mappings of portType operations to real message formats
- Ports=locations (URLs) of real services.
SOAP and Web Services
WSDL
- Defines the interfaces for remote services.
- Provides guidelines for constructing clients to the service.
- Tells the client how to communicate with the service.
- The actual communications are encoded with SOAP.
- Transported by HTTP
SOAP in One Slide
SOAP is just a message format.
- Must transport with HTTP, TCP, etc.
SOAP is independent of but can be connected to WSDL.
SOAP provides rules for processing the message as it passes through multiple steps.
SOAP payloads
- SOAP carries arbitrary XML payloads as a body.
- SOAP headers contain any additional information
- These are encoded using optional conventions
SOAP Basics
- SOAP is often thought of as a protocol extension for doing **Remote Procedure Calls** (RPC) over HTTP.
- This is how it is often used.
- This is not accurate: **SOAP is an XML message format** for exchanging structured, typed data.
- It may be used for RPC in client-server applications
- May be used to send XML documents
- Also suitable for messaging systems (like JMS) that follow one-to-many (or publish-subscribe) models.
- **SOAP is not a transport protocol.** You must attach your message to a transport mechanism like HTTP.
SOAP Request
```xml
<?xml version='1.0' ?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns1:echo
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://.../axis/services/EchoService">
<in0 xsi:type="xsd:string">Hollow World</in0>
</ns1:echo>
</soapenv:Body>
</soapenv:Envelope>
```
SOAP Response
```xml
<?xml version='1.0' ?>
<soapenv:Envelope
xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/
xmlns:xsd=http://www.w3.org/2001/XMLSchema
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:echoResponse
soapenv:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/
xmlns:ns1="http://../axis/services/echoService">
<echoReturn xsi:type="String"
Hollow World
</echoReturn>
</ns1:echoResponse>
</soapenv:Body>
</soapenv:Envelope>
```
SOAP Structure
- SOAP structure is very simple.
- 0 or 1 header elements
- 1 body element
- Envelop that wraps it all.
- Body contains XML payload.
- Headers are structured the same way.
- Can contain additional payloads of “metadata”
- Security information, quality of service, etc.
SOAP Envelop
- The envelop is the root container of the SOAP message.
- Things to put in the envelop:
- Namespaces you will need.
- [http://schemas.xmlsoap.org/soap/envelope](http://schemas.xmlsoap.org/soap/envelope) is required, so that the recipient knows it has gotten a SOAP message.
- Others as necessary
- Encoding rules (optional)
- Specific rules for deserializing the encoded SOAP data.
- More later on this.
- Header and body elements.
- Headers are optional, body is mandatory.
- Headers come first in the message, but we will look at the body first.
SOAP Headers
- SOAP Body elements contain the primary message contents.
- Headers are really just **extension points** where you can include elements from other namespaces.
- i.e., headers can contain arbitrary XML.
- Headers may be processed independently of the body.
- Headers may optionally define **encodingStyle**.
- Headers may optionally have a “**role**” attribute.
- Header entries may optionally have a “**mustUnderstand**” attribute.
- mustUnderstand=1 means the message recipient must process the header element.
- If mustUnderstand=0 or is missing, the header element is optional.
- Headers may also have a “**relay**” attribute.
Example Uses of Headers
- **Security**: WS-Security and SAML place additional security information (like digital signatures and public keys) in the header.
- **Quality of Service**: SOAP headers can be used if we want to negotiate particular qualities of service such as reliable message delivery and transactions.
- **Session State Support**: Many services require several steps and so will require maintenance of session state.
- Equivalent to cookies in HTTP.
- Put session identifier in the header.
Example Header from SOAP Primer
```xml
<?xml version='1.0' ?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<m:reservation xmlns:m="http://my.example.com/">
<env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
env:mustUnderstand="true">
<m:reference>uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d</m:reference>
<m:dateAndTime>2001-11-29T13:20:00.000-05:00</m:dateAndTime>
</m:reservation>
</m:reservation>
<n:passenger xmlns:n="…"
env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
env:mustUnderstand="true">
<n:name>Åke Jógvåń Øyvind</n:name>
</n:passenger>
</env:Header>
</env:Envelope>
```
Header Processing
- SOAP messages are allowed to pass through many intermediaries before reaching their destination.
- Intermediary = some unspecified routing application.
- Imagine SOAP messages being passed through many distinct nodes.
- The final destination processes the body of the message.
- Headers are allowed to be processed independently of the body.
- May be processed by intermediaries.
- This allows an intermediary application to determine if it can process the body, provide the required security, session, or reliability requirements, etc.
Roles, Understanding, and Relays
- **Role?**
- Yes: **must Understand**
- Yes: **Process Header**
- No: **Forward Header**
- No: **No**
- **Relay?**
- Yes: **Remove Header**
- No: **No**
Header Roles
- SOAP nodes may be assigned role designations.
- SOAP headers then specify which role or roles should process.
- Standard SOAP roles:
- **None**: SOAP nodes MUST NOT act in this role.
- **Next**: Each SOAP intermediary and the ultimate SOAP receiver MUST act in this role.
- **UltimateReceiver**: The ultimate receiver MUST act in this role.
- In our example, all nodes must process the header entries.
SOAP Body
- Body entries are really just placeholders for XML from some other namespace.
- The body contains the XML message that you are transmitting.
- It may also define encodingStyle, just as the envelop.
- The message format is not specified by SOAP.
- The <Body></Body> tag pairs are just a way to notify the recipient that the actual XML message is contained therein.
- The recipient decides what to do with the message.
SOAP Body Element Definition
```xml
<xs:element name="Body" type="tns:Body" />
<xs:complexType name="Body">
<xs:sequence>
<xs:any namespace="##any"
processContents="lax" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:anyAttribute namespace="##other"
processContents="lax" />
</xs:complexType>
```
SOAP Body Example
<soapenv:Body>
<ns1:echo soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://.../axis/services/EchoService">
<in0 xsi:type="xsd:string">Hollow World</in0>
</ns1:echo>
</soapenv:Body>
WS architecture
- External Service Requesters
- Internal Service Requesters
- Business Service Choreography
- ESB Gateway
- Enterprise Service Bus
- Routing, transformation, mediations, security, etc.
- External Service Providers
- Internal Service Providers
- Business Service Directory
- ESB Namespace Directory
Infrastructure components for service-oriented architecture
|
{"Source-Url": "http://eta.bibl.u-szeged.hu/2379/2/4.%20Web%20Services.pdf", "len_cl100k_base": 6490, "olmocr-version": "0.1.49", "pdf-total-pages": 70, "total-fallback-pages": 0, "total-input-tokens": 102306, "total-output-tokens": 9342, "length": "2e12", "weborganizer": {"__label__adult": 0.00028324127197265625, "__label__art_design": 0.0003561973571777344, "__label__crime_law": 0.0002167224884033203, "__label__education_jobs": 0.0008034706115722656, "__label__entertainment": 5.0961971282958984e-05, "__label__fashion_beauty": 0.00011289119720458984, "__label__finance_business": 0.0001354217529296875, "__label__food_dining": 0.0002791881561279297, "__label__games": 0.0003104209899902344, "__label__hardware": 0.0007109642028808594, "__label__health": 0.0002579689025878906, "__label__history": 0.00020110607147216797, "__label__home_hobbies": 5.40614128112793e-05, "__label__industrial": 0.00025272369384765625, "__label__literature": 0.0001964569091796875, "__label__politics": 0.00014495849609375, "__label__religion": 0.0003566741943359375, "__label__science_tech": 0.007568359375, "__label__social_life": 6.365776062011719e-05, "__label__software": 0.0053558349609375, "__label__software_dev": 0.9814453125, "__label__sports_fitness": 0.00020885467529296875, "__label__transportation": 0.0003886222839355469, "__label__travel": 0.0001862049102783203}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 28028, 0.00686]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 28028, 0.52733]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 28028, 0.79607]], "google_gemma-3-12b-it_contains_pii": [[0, 92, false], [92, 147, null], [147, 705, null], [705, 738, null], [738, 1540, null], [1540, 1837, null], [1837, 2397, null], [2397, 2997, null], [2997, 3570, null], [3570, 4185, null], [4185, 5121, null], [5121, 5704, null], [5704, 6220, null], [6220, 7031, null], [7031, 7377, null], [7377, 7594, null], [7594, 7912, null], [7912, 8270, null], [8270, 8809, null], [8809, 9224, null], [9224, 9820, null], [9820, 10268, null], [10268, 10931, null], [10931, 11425, null], [11425, 11992, null], [11992, 12321, null], [12321, 12685, null], [12685, 12736, null], [12736, 12875, null], [12875, 12875, null], [12875, 13450, null], [13450, 13709, null], [13709, 13709, null], [13709, 13999, null], [13999, 14621, null], [14621, 15039, null], [15039, 15316, null], [15316, 15936, null], [15936, 16220, null], [16220, 16840, null], [16840, 17173, null], [17173, 17342, null], [17342, 17472, null], [17472, 18097, null], [18097, 18151, null], [18151, 18608, null], [18608, 18770, null], [18770, 19299, null], [19299, 19420, null], [19420, 19649, null], [19649, 19887, null], [19887, 20057, null], [20057, 20493, null], [20493, 20759, null], [20759, 21147, null], [21147, 21702, null], [21702, 22094, null], [22094, 22629, null], [22629, 22926, null], [22926, 23513, null], [23513, 24164, null], [24164, 24674, null], [24674, 25425, null], [25425, 25993, null], [25993, 26198, null], [26198, 26622, null], [26622, 27052, null], [27052, 27401, null], [27401, 27647, null], [27647, 28028, null]], "google_gemma-3-12b-it_is_public_document": [[0, 92, true], [92, 147, null], [147, 705, null], [705, 738, null], [738, 1540, null], [1540, 1837, null], [1837, 2397, null], [2397, 2997, null], [2997, 3570, null], [3570, 4185, null], [4185, 5121, null], [5121, 5704, null], [5704, 6220, null], [6220, 7031, null], [7031, 7377, null], [7377, 7594, null], [7594, 7912, null], [7912, 8270, null], [8270, 8809, null], [8809, 9224, null], [9224, 9820, null], [9820, 10268, null], [10268, 10931, null], [10931, 11425, null], [11425, 11992, null], [11992, 12321, null], [12321, 12685, null], [12685, 12736, null], [12736, 12875, null], [12875, 12875, null], [12875, 13450, null], [13450, 13709, null], [13709, 13709, null], [13709, 13999, null], [13999, 14621, null], [14621, 15039, null], [15039, 15316, null], [15316, 15936, null], [15936, 16220, null], [16220, 16840, null], [16840, 17173, null], [17173, 17342, null], [17342, 17472, null], [17472, 18097, null], [18097, 18151, null], [18151, 18608, null], [18608, 18770, null], [18770, 19299, null], [19299, 19420, null], [19420, 19649, null], [19649, 19887, null], [19887, 20057, null], [20057, 20493, null], [20493, 20759, null], [20759, 21147, null], [21147, 21702, null], [21702, 22094, null], [22094, 22629, null], [22629, 22926, null], [22926, 23513, null], [23513, 24164, null], [24164, 24674, null], [24674, 25425, null], [25425, 25993, null], [25993, 26198, null], [26198, 26622, null], [26622, 27052, null], [27052, 27401, null], [27401, 27647, null], [27647, 28028, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 28028, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 28028, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 28028, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 28028, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 28028, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 28028, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 28028, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 28028, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 28028, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 28028, null]], "pdf_page_numbers": [[0, 92, 1], [92, 147, 2], [147, 705, 3], [705, 738, 4], [738, 1540, 5], [1540, 1837, 6], [1837, 2397, 7], [2397, 2997, 8], [2997, 3570, 9], [3570, 4185, 10], [4185, 5121, 11], [5121, 5704, 12], [5704, 6220, 13], [6220, 7031, 14], [7031, 7377, 15], [7377, 7594, 16], [7594, 7912, 17], [7912, 8270, 18], [8270, 8809, 19], [8809, 9224, 20], [9224, 9820, 21], [9820, 10268, 22], [10268, 10931, 23], [10931, 11425, 24], [11425, 11992, 25], [11992, 12321, 26], [12321, 12685, 27], [12685, 12736, 28], [12736, 12875, 29], [12875, 12875, 30], [12875, 13450, 31], [13450, 13709, 32], [13709, 13709, 33], [13709, 13999, 34], [13999, 14621, 35], [14621, 15039, 36], [15039, 15316, 37], [15316, 15936, 38], [15936, 16220, 39], [16220, 16840, 40], [16840, 17173, 41], [17173, 17342, 42], [17342, 17472, 43], [17472, 18097, 44], [18097, 18151, 45], [18151, 18608, 46], [18608, 18770, 47], [18770, 19299, 48], [19299, 19420, 49], [19420, 19649, 50], [19649, 19887, 51], [19887, 20057, 52], [20057, 20493, 53], [20493, 20759, 54], [20759, 21147, 55], [21147, 21702, 56], [21702, 22094, 57], [22094, 22629, 58], [22629, 22926, 59], [22926, 23513, 60], [23513, 24164, 61], [24164, 24674, 62], [24674, 25425, 63], [25425, 25993, 64], [25993, 26198, 65], [26198, 26622, 66], [26622, 27052, 67], [27052, 27401, 68], [27401, 27647, 69], [27647, 28028, 70]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 28028, 0.0]]}
|
olmocr_science_pdfs
|
2024-11-28
|
2024-11-28
|
7e9e946729122b9ed2c8d7c0a5d084b8f297675b
|
Heterogeneous Indexing Register for Object Database
Michał Chromiak
Institute of Computer Science
Maria Curie-Skłodowska University
Lublin, Poland
e-mail: mchromiak@umcs.pl
Abstract—Even though the object oriented persistent stores has not gained large commercial adaptation rate, it still is an interesting research field in many aspects including the data integration. Persistent data integration is a very challenging goal in modern computer systems. This paper presents a proposal for application of effective indexing integration scheme for distributed and heterogeneous data environment using an object database as the central store.
Keywords—database; data integration; data; object database
I. INTRODUCTION
The problem of integrating data form distributed data sources has forced the need for flexible and sound architecture that could cover all of the integration issues. While such an architecture could be implemented in numerous flavours and ways, currently the predominant programming paradigm is the object-oriented approach. While the object model is not dominating in the world of persistent data stores, there are some interesting prototypes that can be potentially interesting in aspect of applying them towards integration solutions. In case of central integration register based on idea of Qboid [1,2] such an object-oriented store seems a natural and effective choice. This paper discusses advantages of using the object store model (AS) originated form ODRA prototypical database for implementing central integrating register. It also presents a possible adaptation and exemplary implementation of the Qboid-based integration data model using object store model.
II. THE INTEGRATION
The need for integration of resources forces, along many others, a consideration of the heterogeneity problem. First the heterogeneous term must be explained for the needs and scope of this paper.
Let us assume we have an environment of multiple (remote) heterogeneous (many vendor origin) database servers. There are two different areas that need to be covered. The location transparency and the distribution details. In other words this can be referred to as an answer to questions “how the data can be obtained and where from?”.
While considering integration in such conditions there is a strong need for separation of global access interface from local implementation of a data source. The first – “how”- issue requires an approach that would make the access to piece of a data possible in a common way regardless of its location. This problem could be solved by building a broker mechanism that would cover all the particularities regarding requirements for remote access. A broker would hide the location of a resource and the location specific access method from a client. Such client request might be remote, out on the network somewhere, but it also might be local, in the same process as the calling client. Therefore this could be the solution to heterogeneous access for numerous local data models.
Second issue can be addressed by dint of a resource integrator. The integrator would have to be a storage area supplying each request within environment containing an unambiguous information about address of every piece of requested resource form within the environment.
By dint of the distribution details from the resource integrator the entire requested data portion can be assembled into one resource map and then accessed separately, respectively to their data model, thanks to the interfaces provided by the broker mechanism. A resource map would mean here a lookup table that “maps” an ID of the piece of information to a value representing it unambiguously. The model for this storage would have to cope with complex details and behaviors required by the nature of integration metadata. In the following section this kind of mechanism for object store has been proposed.
III. MOTIVATION FOR OBJECT MODEL
The integration always requires means to persist the integrated data or its metadata in some way. An object database seems a good choice. This is not only to its flexibility, but mainly due to lack of impedance mismatch issues. The object nature presented by the ODMG standard [3] for object databases or database-related Java technologies [4, 5, 6], despite significant role of object-oriented solutions in the remaining areas of software development, have not become greatly important in the industry. However, an interesting approach has been developed aside the general standards. The Stack Based Approach (SBA), has introduced existing object-oriented mechanisms (classes, encapsulation, inheritance, polymorphism, objects) for database programming. Moreover by applying the SBA, some additional mechanisms have been
introduced, like the dynamic object roles [8, 9] or interfaces on the database views [10, 11].
Regarding the complex nature of integration metadata, its retrieval and modification requires sound tools. The answer to this need is a query language. It is the second argument for utilizing the SBA, meaning its powerful query language extended to a programming language i.e. SBQL (Stack Based Query Language). As the most important feature of the ODRA (Object Database for Rapid Application development) prototype SBA implementation, SBQL alone makes it possible to create fully fledged database-oriented applications. In the case of such solution the development of database application tasks with just one, very high level language, can greatly improve programmers’ efficiency and software stability along the development life cycle and supports complex queries.
Object itself is an abstract entity representing or describing some idea existing in a real world. Object is distinguishable from other objects with its unique name and distinct limits.
Important aspect of an object is that it do not assume a need for determining an attribute (or a set of attributes) that identifies the object in an unambiguous way (so called “primary key”) as it takes place in case of relational model. The object has its identity – OID – unrelated to object’s state, content nor other objects. However OID is unique across entire system.
Apart from unique OID object has name that is a handle to this object. The name of an object does not have to be unique (we can create multiple objects named Entity, Schema, Row, Cell etc.).
According to ODMG model, this property name is a collection of objects, where the name is the name of entire collection not just the single element. In the discussed model we will assume that each and every object has its name e.g. Row, but there will be possibility to group entire collection as one object named Schema.
In aspect of Qboid-based integration it is very important that object might constitute multiple states that depends on current values combination due to dynamic nature of integrated sources which change their state continuously. Those changes must be reflected in the integration architecture in a sound, robust and elastic manner. It is required for the integration perspective to be an up-to-date view of the integrated resource grid.
Every object has state represented as a combination of its components, mainly values of all attributes and references to other objects. The state of an object can change in time. In our approach to represent the integration characteristics and nature of dynamically changed environment, we will discuss below some of the attributes that can be utilized to make the standards describing each course fit the store model.
- Atomic attribute: such as the integration pattern symbolic name. It includes exactly one value, which is indivisible from the point of view of a user byt states a role of e.g. unique discriminator for integration model entities
- Complex attribute: such as each record/row. It includes many atomic values. It has hierarchic structure where each branch of the hierarchy has its name (e.g. data source address, database name id, schema of origin)
- Pointer attribute: contains a value pointing to the adequate OID of referenced object which in integration domain can be a replica of an object or a different fragmentation pattern, still representing the same information value of the pointing object
- Repetitive attribute: it include a variable in time number of values. Those values can be of atomic, complex or pointer type (e.g. list of replicas that state the same semantic value)
- Optional attribute: in a particular instance of an object it can have a value but it is not mandatory this is when a potential replica for e.g. record can be replicated but the replication is not required along the integrated grid
- Derivative attribute: value that derives from other attributes; such as back-referencing, whe an object refers back to the object that points it but is on the other hand, higher In object hierarchy
- Class attribute: value that is common to a set of objects belonging to the same class e.g. representing the same data schema
This list is not complete. However the rule of object relativity mentions that every object can be composed out of unlimited number of sub-objects. This way every attribute is an object. Moreover, each attribute has its type. Therefore, the combination of attributes’ types is the type of an object
A. Abstract Store Model
To introduce the integration data information to object-oriented manner store, working with the SBA prototype implementation there is a need for adopting at least the simplest store model i.e. AS0 [5]. In contrast to relational model, object model require to use far more concepts. There is also different understanding for many terms. Therefore, it is hard to introduce a model that can be simple and at the same time applicable for all cases equally. The SBA includes the whole hierarchical family of store models each responsible for extending the possibilities of the predecessor but all basing on the same semantic base. For the purpose of this paper we mention only the most basic but sufficient for this appliance model – AS0.
The AS0 can cover arbitrarily connected hierarchical data structures. However, it does not include the aspects of the class, inheritance or interface. It was originally designed to express the semantics of relational query languages. What is the essential part of it, is the possibility of representing semistructural data in general and the XML data structures in particular.
Regarding this store model we will assume the object relativity rule and related to it rule for the inner identification. First one has already been mentioned in previous section. Second rule states that every object that can be a component of different object has to include its own unique inner identifier.
Let us explain some basic terms:
- **Inner identifier of an object.** It is given automatically by the system and cannot be used in the semantics of the outer manipulation of the objects. Its purpose is to identify objects stored in memory.
- **Outer object name.** In contrast to inner identifier this name is created by the system designer, administrator or a programmer. It is linked to conceptual model of The application working with AS0 based store. Moreover, it involves the use of informal semantics for the outer processes e.g. The name can be Row or Tuple. The outer object name such as Row does not have to be unique.
- **Atomic value.** It is a kind of object value that is indivisible from the point of view of the creator. Hence not including any parts.
Identifiers are marked as $i$, the names as $n$ and the atomic values with the letter $v$.
In AS0 every object contains unique inner identifier, outer name and the value that can be atomic, pointer or complex. We will the objects by the following definition. The object is a triple:
- $<i, n, v>$ - when the object is going to be atomic
- $<i_1, n, i_2>$ - when the object is going to be a pointer or a reference object. This object is identified thanks to $i_1$ where the $i_2$ is the pointer value of the object being a reference to other object.
- $<i, n, T>$ where the $T$ is a set of any type of objects. This object we will call a complex object. This rule is recursive, therefore enabling building objects with unlimited complexity and number of hierarchy levels
In AS0 the data store is defined as pair $<S, R>$ where the $S$ is a set of objects and the $R$ is a set of object ids also named as the staring identifiers.
The $R$ set sets the starting points for the data store i.e. those objects that can be a starting point for the navigation in the entire set of objects. Most often those objects would be just simply the ones that are in the main level of the object hierarchy i.e. those that are not included as part of the other objects
There are few rules regarding the data store that has to be complied:
- each and every object, sub-object, etc. in data store has its unique identifier
- if there is a pointer object $<i_p, n, i_2>$, then the pointed object $i_2$ has to exist.
IV. THE ARCHITECTURE
Integration is a very complex and multilevel challenge. It requires an effective and elastic approach that must conform some unified workflows and strict rules. Thus, mechanism needed for managing this infrastructure needs a creation of a dedicated architecture.
There are a couple of issues that has been considered to satisfy such a challenging requirements to provide the solution of the problem.
- Server-based integration, is something that would involve centralized management, based on some kind of broker, and at the same time an integrator, while dedicating the server for the purpose of routing requests from clients to data resource
- The initial integration scheme must be applicable and elastic to fit more than one dedicated data source server
- The central instance of integration should be able to become decomposed into a multi-node infrastructure, possibly a cloud, or a microservice based central instance
- The architecture involving integrator and broker in each location node though seems the most challenging since the reduction of flaws regarding the centralized or only partially distributed environment (e.g. low fault tolerance and traffic overhead). In this case the architecture would have to be multiclient/multi-server like, so that each machine could be a client and a server relatively to the status of a request i.e. sending or receiving.
While focusing on database area, the problem can still be considered valid regarding integration of BigData unstructured sources. The goal is to enable easy access to such a heterogeneous environment’s data from within ODRA-based integration server using its object-oriented query language – SBQL– indistinguishably of the data model and location. Therefore, let us start from centralized, ODRA side management of the distributed databases.
A. The solution
At first, let us presume, we have a simple communication scheme i.e. an ODRA server and one legacy database to represent its data in integration view. We have to face the problem of data model of a legacy DB. This problem can be handled by object-relational wrapper. Nevertheless, while the number of legacy databases increases, the communication scheme becomes more complex. Therefore, there is a need for a integration mechanism. In this case, the ODRA is assumed to be a client i.e. a process that makes calls to objects located on a remote, legacy DB server or within the ODRA client.
B. General Idea
In this section the general architecture components and their role is explained and motivated. Let us introduce the basic facilities utilized in distributed, heterogeneous environment (see Fig.1.):
- **Object Location Integrator (OLI)** – is a component that is responsible for collecting and storing information about data fragmentation and replication across the integrated legacy data sources. Moreover, it enables access to the Broker and would also be responsible for storing unified index representation
- **Broker** - facility storing the fast, native access methods for each grid integrated data source objects
- **Client** – is the party sending requests to OLI for integrated data entities form within the index present in OLI. The part of the client responsible for sending those requests would be a module compatible with OLI.
- In this case the client could be any human or software party calling the integration REST API available at ODRA-based integration facility. However, any DBMS could be plugged in the OLI as long as they contain dedicated compatibility module. As the OLI would store the universal index representation, dedicated module would have to be responsible for transforming this representation into a native ODRA index. One should be aware that ODRA is an example of an object-oriented database which on specification change can freely be swapped with other database engine with different paradigm. Obviously in such case, the new paradigm particularities must be considered for a well designed index to work.
- The transformation into ODRA index would have to face two problems:
- how to transform the structure of the universal index into the native client manageable form (utilize the native ODRA index structure)
- provide the facility for interpreting and sending the grid integrated legacy DB access methods for reaching the specific data source objects and then receiving the results. This results would be composed into native client index form, according to the index scheme, build out of the universal OLI index.
- **Legacy data source** – the grid node providing partial data for the global OLI data integration scheme. It would have to include the data source specific access wrapper and the mediator capable of maintain communication between the grid node and the OLI.
- **Wrapper** – data source dedicated software process combining the legacy data model and interface of the integrated data source to the mediator level of integration
- **Mediator** - responsible for integrating multiple data source wrappers per each machine. Mediators would be responsible for sending the registration information of the underlying data sources, monitoring their up/down state. Moreover, the mediator take part in passing client requests for particular data records from each of its underlying data sources. Those requests would be partial client requests for distributed and indexed data
What requires explanation is the description of this process along its lifecycle:
1. OLI/Broker initialization - could be considered as ODRA heterogeneous index (H-Index) module(s) or as standalone processes.
2. Each network data source that is to be integrated into grid, continues with the process of registration:
- a. Each machine needs to start the mediator infrastructure i.e. equip the Mediator with the underlying data schemata and its fast access methods.
- b. (Fig. 1. pos.1) In the beginning, establishing connection between OLI and Mediator takes place. Next the Mediator sends the underlying data sources schemes and fast access methods (FAMs) for accessing each data scheme part.
- c. (Fig. 1. pos.2) The received schemes are stored at OLI and the database object reference (DORs) (including the native fast access method – FAM) are moved to Broker which is treated as a DOR1 store. OLI would store only DOR reference to broker named rDOR.
3. (Fig. 1 pos. 3-5.) Along the registration, at a time when a data entity (e.g. DB table) in OLI occurs to be a complete snapshot of its present state in the grid2 (i.e. all its records has been registered within the OLI), the indexing towards this snapshot can be evaluated.
---
1 Database Object Reference a structure for introducing distributed data access method
2 This information is available thanks to administrative configuration (horizontal fragmentation; administrator could point the grid nodes to participate in the data entity horizontal integration) and data definition scheme (vertical fragmentation) present in the Qboids. When vertical fragmentation matches the data definitions and all the of the pointed nodes are involved then the index creation can be conducted.
4. The index creation selects the right parts of the integrated data scheme i.e. those that carry the index information and forms a table consisting of the indexed values, their unique record’s ids (i.e. best record ids – BRIs) and access methods. Transformation of such sequence of triplets, yields the list of records with their access methods combined with BRIs, grouped together per each indexed value/range. As already mentioned in 2c) OLI would have store only rDORs. However, for the purpose of forming universal index and reaching for actual values, they would have to be replaced by DORs (storing the detailed data) from the broker. In this phase we acquire an universal index structure for a client requested type of index i.e. dense, range etc.
5. (Fig. 1. pos.6.) At this stage, the clients’ heterogeneous index (or, H-Index) module can use the universal index to incorporate its information into native index. The process however, is not over yet, because the client will only possess the information about the index’s grid details and DORs, but it will still not include the indexed records explicitly (pos.7.).
Storing the grid details of the data distribution in the native index will force the native index, while reaching for a record, to call for a procedure that can return the explicit values presented in such record (pos. 8.). Therefore, before making the native index available for use in native client requests, all of the DORs found in such index would have to be send to a remote process able to transform each record and hand it over to native index in form of a complete and explicit database record, that can be further utilized by regular index mechanisms. This is the responsibility of the H-Index module. It would send (pos. 9.) the access queries to the appropriate grid nodes mediators. Next, according to the possessed implicit index structure scheme, the received results (pos. 10.) would have been utilized to build each record. In case of ODRA it would have been a regular ODRA database object. Fig.1. General schema of heterogeneous index creation and utilization. This object can be incorporated into ODRA index as a part of the ultimate native index, composed out of the H-Index received results.
V. OBJECTS FOR INTEGRATION
The general goal of integration must conform some way of unification for integrated resources’ data. To use the AS0 model for the purpose of storing integration data let us adopt the schema proposed in [2] for AS0 model.
A. Distributed Data Structure Map
Each legacy data source intuition and general schema would have to be devised. In [2] the distributed resource universal map has been introduced to represent three basic issues of integration – namely replication, vertical and horizontal fragmentation. Basing on some technical best row id (BRI) each record that is to be considered information equivalent in terms of semantic meaning along integration view assumptions shares the same BRI.
Conceptually each data source might get its own representation of record while still sharing BRI. This way one BRI might reflect multiple replications, and as the record might be arbitrary composed, also vertical fragmentations. The horizontal fragmentation in considered in record groups as the higher orders of composition within the Qboid concept.
B. Example
Let us assume that the object-oriented model AS0 is going to store information on users. The general schema contains name, email address and age. Now this information is expected to be scattered across multiple data sources. In Listing 1. an exemplary schema for integrating such information is being exemplified:
```
<e1, entity, {
<u1, users, {
<recGr1, recGr, rDOR_lto10_DB1 > # ID_lto10
<recGr2, recGr, { # ID_13
<n13, name, rDOR_DB2_13_name>
<em13, emailAddress, {
<l13, login, rDOR_DB20_13_login>
<d13, domain, rDOR_DB21_13_domain>
```
The u2 and u3 represent the same, or almost the same set of information on the users. However, the nature of replication is somewhat different. While in case of u2 object it is a complex object representing the same data as u1, however the u2 has different data source (DB100) for users with id 1-10 while the recGr2 becomes a reference object (recGr4) pointing to the recGr2, meaning that there is the same algorithm to combine its content. This design enable future proofing towards enabling future load balancing while accessing users with id 1-10 which in this case can be retrieved from two different sources automatically and transparently.
The object u3 is a complex object with reference types towards u1 components. The u3 object here provides the u1 functionality and at the same time without replicating nor disclosing the u1 details.
On the other hand the case of u4 is quite different. In this case we can see that while it enables referring to the users, however it provides only data only for one user with id 13. Additionally the details of this user access methods are not disclosed towards the requesting party. This specific behavior provides two benefits. Firstly the entity designer might decide to disclose only the u4 limited user database access, secondly due to reference object the contact details for the actual object are not disclosed and are only available for the party with privileges sufficient to disclose the recGr2 user details originating in u1.
VI. CONCLUSIONS
The goal for this paper was to enable a prototype object oriented integration scheme based on AS0 object model originating from prototypical object-oriented database. It has been proven that even relatively simple object model can be adapted and successfully used for representing integration metadata for Qboid based integration architecture. However, one can easily proceed with extending the AS0, which covers relational, nested-relational and XML-oriented databases. AS0 assumes hierarchical objects with no limitations concerning the nesting of objects and collections, pointer links (relationships) between objects. Moreover, in case the AS0 if model is to be considered insufficient additional research can be done to provide all of the goodness of the complete object-oriented
```xml
<recGr3, recGr, rDOR_1to10_DB100 >
<recGr4, recGr, recGr2 >
Listing 1. Exemplary AS0 utilization to represent the integrated data
```
model including classes and static inheritance, object roles and dynamic inheritance, or encapsulation. The SBA assumes just right store models in form of AS1, AS2 and AS3 to provide this complete set of object related features. Additionally, such an extension would give not only all of the possibilities of an object oriented approach, but also gains that a database engine provide towards data storing, such as persistence, durability, high availability, reliability with transactions.
REFERENCES
|
{"Source-Url": "http://journals.umcs.pl/ai/article/download/6249/pdf", "len_cl100k_base": 5419, "olmocr-version": "0.1.50", "pdf-total-pages": 7, "total-fallback-pages": 0, "total-input-tokens": 23948, "total-output-tokens": 6510, "length": "2e12", "weborganizer": {"__label__adult": 0.00030541419982910156, "__label__art_design": 0.0004224777221679687, "__label__crime_law": 0.0003192424774169922, "__label__education_jobs": 0.0008001327514648438, "__label__entertainment": 6.157159805297852e-05, "__label__fashion_beauty": 0.00014090538024902344, "__label__finance_business": 0.0002989768981933594, "__label__food_dining": 0.00029969215393066406, "__label__games": 0.0003876686096191406, "__label__hardware": 0.0009584426879882812, "__label__health": 0.0005617141723632812, "__label__history": 0.00029397010803222656, "__label__home_hobbies": 8.982419967651367e-05, "__label__industrial": 0.00043582916259765625, "__label__literature": 0.0002608299255371094, "__label__politics": 0.00020205974578857425, "__label__religion": 0.0004341602325439453, "__label__science_tech": 0.05596923828125, "__label__social_life": 8.565187454223633e-05, "__label__software": 0.0122222900390625, "__label__software_dev": 0.9248046875, "__label__sports_fitness": 0.0002188682556152344, "__label__transportation": 0.00045108795166015625, "__label__travel": 0.0001952648162841797}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 29012, 0.019]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 29012, 0.62271]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 29012, 0.90472]], "google_gemma-3-12b-it_contains_pii": [[0, 4763, false], [4763, 10446, null], [10446, 15472, null], [15472, 20180, null], [20180, 24142, null], [24142, 26573, null], [26573, 29012, null]], "google_gemma-3-12b-it_is_public_document": [[0, 4763, true], [4763, 10446, null], [10446, 15472, null], [15472, 20180, null], [20180, 24142, null], [24142, 26573, null], [26573, 29012, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 29012, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 29012, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 29012, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 29012, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 29012, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 29012, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 29012, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 29012, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 29012, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 29012, null]], "pdf_page_numbers": [[0, 4763, 1], [4763, 10446, 2], [10446, 15472, 3], [15472, 20180, 4], [20180, 24142, 5], [24142, 26573, 6], [26573, 29012, 7]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 29012, 0.0]]}
|
olmocr_science_pdfs
|
2024-11-29
|
2024-11-29
|
6b161f40dd0b2ab454bd801254c95018642945c6
|
Reminder
- Only a very small fraction of AI is about making computers play games intelligently.
- Recall: computer vision, natural language, robotics, machine learning, computational biology, etc.
- That being said: games tend to provide relatively simple example settings which are great to illustrate concepts and learn about algorithms which underlie many areas of AI.
Reflex Agent
- Choose action based on current percept (and maybe memory)
- May have memory or a model of the world’s current state
- Do not consider the future consequences of their actions
- Act on how the world IS
- Can a reflex agent be rational?
A reflex agent for pacman
- While(food left)
- Sort the possible directions to move according to the amount of food in each direction
- Go in the direction with the largest amount of food
A reflex agent for pacman (2)
- While(food left)
- Sort the possible directions to move according to the amount of food in each direction
- Go in the direction with the largest amount of food
A reflex agent for pacman (3)
- While(food left)
- Sort the possible directions to move according to the amount of food in each direction
- Go in the direction with the largest amount of food
- But, if other options are available, exclude the direction we just came from
A reflex agent for pacman (4)
- While (food left)
- If can keep going in the current direction, do so
- Otherwise:
- Sort directions according to the amount of food
- Go in the direction with the largest amount of food
- But, if other options are available, exclude the direction we just came from
---
A reflex agent for pacman (5)
- While (food left)
- If can keep going in the current direction, do so
- Otherwise:
- Sort directions according to the amount of food
- Go in the direction with the largest amount of food
- But, if other options are available, exclude the direction we just came from
---
Reflex Agent
- Choose action based on current percept (and maybe memory)
- May have memory or a model of the world’s current state
- Do not consider the future consequences of their actions
- Act on how the world IS
- Can a reflex agent be rational?
Goal-based Agents
- Plan ahead
- Ask “what if”
- Decisions based on (hypothesized) consequences of actions
- Must have a model of how the world evolves in response to actions
- Act on how the world WOULD BE
---
Search Problems
- A search problem consists of:
- A state space
- A successor function
- A start state and a goal test
- A solution is a sequence of actions (a plan) which transforms the start state to a goal state
---
Example: Romania
- State space:
- Cities
- Successor function:
- Go to adj city with cost = dist
- Start state:
- Goal test:
- Is state == Bucharest?
- Solution?
---
What’s in a State Space?
- Problem: Pathing
- States: (x,y) location
- Actions: NSEW
- Successor: update location only
- Goal test: is (x,y) = END
- Problem: Eat-All-Dots
- States: (x,y), dot booleans
- Actions: NSEW
- Successor: update location and possibly a dot boolean
- Goal test: dots all false
State Space Graphs
- **State space graph:** A mathematical representation of a search problem
- For every search problem, there’s a corresponding state space graph
- The successor function is represented by arcs
- We can rarely build this graph in memory (so we don’t)
Ridiculously tiny state space graph for a tiny search problem
State Space Sizes?
- **Search Problem:** Eat all of the food
- Pacman positions: 10 x 12 = 120
- Food count: 30
Search Trees
- **A search tree:**
- This is a "what if" tree of plans and outcomes
- Start state at the root node
- Children correspond to successors
- Nodes contain states, correspond to PLANS to those states
- For most problems, we can never actually build the whole tree
Another Search Tree
- **Search:**
- Expand out possible plans
- Maintain a fringe of unexpanded plans
- Try to expand as few tree nodes as possible
General Tree Search
- **Important ideas:**
- Fringe
- Expansion
- Exploration strategy
- **Main question:** which fringe nodes to explore?
Example: Tree Search
Detailed pseudocode is in the book!
We construct both on demand – and we construct as little as possible.
Each NODE in the search tree is an entire PATH in the problem graph.
Strategy: expand deepest node first
Implementation: Fringe is a LIFO stack
Search Algorithm Properties
- Complete? Guaranteed to find a solution if one exists?
- Optimal? Guaranteed to find the least cost path?
- Time complexity?
- Space complexity?
Variables:
<table>
<thead>
<tr>
<th>Variable</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>$n$</td>
<td>Number of states in the problem</td>
</tr>
<tr>
<td>$b$</td>
<td>The average branching factor $B$ (the average number of successors)</td>
</tr>
<tr>
<td>$C^*$</td>
<td>Cost of least cost solution</td>
</tr>
<tr>
<td>$s$</td>
<td>Depth of the shallowest solution</td>
</tr>
<tr>
<td>$m$</td>
<td>Max depth of the search tree</td>
</tr>
</tbody>
</table>
DFS
- Infinite paths make DFS incomplete…
- How can we fix this?
DFS w/ Path Checking
- When is DFS optimal?
DFS
- With cycle checking, DFS is complete.*
Algorithm Complete Optimal Time Space
DFS w/ Path Checking Y N O(b^m) O(bm)
DFS
* Or graph search – next lecture.
**BFS**
When is BFS optimal?
<table>
<thead>
<tr>
<th>Algorithm</th>
<th>Complete</th>
<th>Optimal</th>
<th>Time</th>
<th>Space</th>
</tr>
</thead>
<tbody>
<tr>
<td>DFS w/ Path Checking</td>
<td>Y</td>
<td>N</td>
<td>O(b^m)</td>
<td>O(bm)</td>
</tr>
<tr>
<td>BFS</td>
<td>Y</td>
<td>N*</td>
<td>O(b^m)</td>
<td>O(bm)</td>
</tr>
</tbody>
</table>
### Iterative Deepening
Iterative deepening uses DFS as a subroutine:
1. Do a DFS which only searches for paths of length 1 or less.
2. If "1" failed, do a DFS which only searches paths of length 2 or less.
3. If "2" failed, do a DFS which only searches paths of length 3 or less.
4. ... and so on.
<table>
<thead>
<tr>
<th>Algorithm</th>
<th>Complete</th>
<th>Optimal</th>
<th>Time</th>
<th>Space</th>
</tr>
</thead>
<tbody>
<tr>
<td>DFS w/ Path Checking</td>
<td>Y</td>
<td>N</td>
<td>O(b^m)</td>
<td>O(bm)</td>
</tr>
<tr>
<td>BFS</td>
<td>Y</td>
<td>N*</td>
<td>O(b^m)</td>
<td>O(bm)</td>
</tr>
<tr>
<td>ID</td>
<td>Y</td>
<td>N*</td>
<td>O(b^m)</td>
<td>O(bm)</td>
</tr>
</tbody>
</table>
### Costs on Actions
Notice that BFS finds the shortest path in terms of number of transitions. It does not find the least-cost path.
We will quickly cover an algorithm which does find the least-cost path.
**Uniform Cost (Tree) Search**
Expand cheapest node first:
Fringe is a priority queue
Cost contours
**Priority Queue Refresher**
- A priority queue is a data structure in which you can insert and retrieve (key, value) pairs with the following operations:
- `pq.push(key, value)`: inserts (key, value) into the queue.
- `pq.pop()`: returns the key with the lowest value, and removes it from the queue.
- You can decrease a key’s priority by pushing it again
- Unlike a regular queue, insertions aren’t constant time, usually $O(\log n)$
- We’ll need priority queues for cost-sensitive search methods
**Comparisons**
- When will BFS outperform DFS?
- When will DFS outperform BFS?
Uniform Cost (Tree) Search
<table>
<thead>
<tr>
<th>Algorithm</th>
<th>Complete</th>
<th>Optimal</th>
<th>Time (in nodes)</th>
<th>Space</th>
</tr>
</thead>
<tbody>
<tr>
<td>DFS</td>
<td>Y</td>
<td>N</td>
<td>O(b^m)</td>
<td>O(hw)</td>
</tr>
<tr>
<td>BFS</td>
<td>Y</td>
<td>N</td>
<td>O(b^m+1)</td>
<td>O(b^m+1)</td>
</tr>
<tr>
<td>UCS</td>
<td>Y*</td>
<td>Y</td>
<td>O(b^c*)</td>
<td>O(b^c*)</td>
</tr>
</tbody>
</table>
* UCS can fail if actions can get arbitrarily cheap
Uniform Cost Issues
- Remember: explores increasing cost contours
- The good: UCS is complete and optimal!
- The bad:
- Explores options in every direction
- No information about goal location
Uniform Cost Search Example
Search Heuristics
- Any estimate of how close a state is to a goal
- Designed for a particular search problem
- Examples: Manhattan distance, Euclidean distance
Example: Heuristic Function
Best First / Greedy Search
- Expand the node that seems closest...
- What can go wrong?
**Best First / Greedy Search**
- **A common case:**
- Best-first takes you straight to the (wrong) goal.
- **Worst-case:** like a badly-guided DFS in the worst case.
- Can explore everything.
- Can get stuck in loops if no cycle checking.
- **Like DFS in completeness (finite states w/ cycle checking)**
**Combining UCS and Greedy**
- **Uniform-cost** orders by path cost, or backward cost, $g(n)$.
- **Best-first** orders by goal proximity, or forward cost, $h(n)$.
- **A* Search** orders by the sum: $f(n) = g(n) + h(n)$.
**When should A* terminate?**
- Should we stop when we enqueue a goal?
- No: only stop when we dequeue a goal.
**Admissible Heuristics**
- A heuristic $h$ is admissible (optimistic) if:
\[ h(n) \leq h^*(n) \]
where $h^*(n)$ is the true cost to a nearest goal.
- Examples:
- Coming up with admissible heuristics is most of what’s involved in using A* in practice.
Optimality of A*: Blocking
Proof:
- What could go wrong?
- We’d have to have to pop a suboptimal goal G off the fringe before G*
- This can’t happen:
- Imagine a suboptimal goal G is on the queue
- Some node n which is a subpath of G* must also be on the fringe (why?)
- n will be popped before G
Properties of A*
Uniform-Cost vs A*
UCS vs A* Contours
- Uniform-cost expanded in all directions
- A* expands mainly toward the goal, but does hedge its bets to ensure optimality
Example: Explored States with A*
Heuristic: manhattan distance ignoring walls
Comparison
Greedy
Uniform Cost
A star
Creating Admissible Heuristics
- Most of the work in solving hard search problems optimally is in coming up with admissible heuristics
- Often, admissible heuristics are solutions to relaxed problems, with new actions (“some cheating”) available
- Inadmissible heuristics are often useful too (why?)
Example: 8 Puzzle
- What are the states?
- How many states?
- What are the actions?
- What states can I reach from the start state?
- What should the costs be?
8 Puzzle I
- Heuristic: Number of tiles misplaced
- Why is it admissible?
- $h(\text{start}) = 8$
<table>
<thead>
<tr>
<th>Average nodes expanded when optimal path has length...</th>
</tr>
</thead>
<tbody>
<tr>
<td>4 steps</td>
</tr>
<tr>
<td>8 steps</td>
</tr>
<tr>
<td>12 steps</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>Heuristic: relaxed-problem heuristic</th>
</tr>
</thead>
<tbody>
<tr>
<td>UCS</td>
</tr>
<tr>
<td>TILES</td>
</tr>
</tbody>
</table>
8 Puzzle II
- What if we had an easier 8-puzzle where any tile could slide any direction at any time, ignoring other tiles?
- Total Manhattan distance
- Why admissible?
- $h(\text{start}) = 3 + 1 + 2 + ... = 18$
8 Puzzle III
- How about using the actual cost as a heuristic?
- Would it be admissible?
- Would we save on nodes expanded?
- What’s wrong with it?
- With A*: a trade-off between quality of estimate and work per node!
Trivial Heuristics, Dominance
- Dominance: $h_a(n) \geq h_b(n)$, if
$\forall n : h_a(n) \geq h_b(n)$
- Heuristics form a semi-lattice:
- Max of admissible heuristics is admissible
- $h(n) = \max(h_a(n), h_b(n))$
- Trivial heuristics
- Bottom of lattice is the zero heuristic (what does this give us?)
- Top of lattice is the exact heuristic
Other A* Applications
- Pathing / routing problems
- Resource planning problems
- Robot motion planning
- Language analysis
- Machine translation
- Speech recognition
- …
Tree Search: Extra Work!
- Failure to detect repeated states can cause exponentially more work. Why?
Graph Search
- In BFS, for example, we shouldn’t bother expanding the circled nodes (why?)
Graph Search
- Idea: never expand a state twice
- How to implement:
- Tree search + list of expanded states (closed list)
- Expand the search tree node-by-node, but...
- Before expanding a node, check to make sure its state is new
- Python trick: store the closed list as a set, not a list
- Can graph search wreck completeness? Why/why not?
- How about optimality?
Graph Search
- Very simple fix: never expand a state twice
Optimality of A* Graph Search
Proof:
- New possible problem: nodes on path to G* that would have been in queue aren’t, because some worse n’ for the same state as some n was dequeued and expanded first (disaster!)
- Take the highest such n in tree
- Let p be the ancestor which was on the queue when n’ was expanded
- Assume f(p) < f(n)
- f(n) = f(n’), because n’ is suboptimal
- p would have been expanded before n’
- So n would have been expanded before n’, too
- Contradiction!
Consistency
- Wait, how do we know parents have better f-values than their successors?
- Couldn’t we pop some node n, and find its child n’ to have lower f-value?
- YES:
- What can we require to prevent these inversions?
- Consistency: c(n, a, n’) ≥ h(n) – h(n’)
- Real cost must always exceed reduction in heuristic
A* Graph Search Gone Wrong
State space graph
Search tree
C is already in the closed-list, hence not placed in the priority queue
Consistency
The story on Consistency:
- Definition: \( \text{cost}(A \text{ to } C) + h(C) \geq h(A) \)
- Consequence in search tree:
Two nodes along a path: \( N, N' \)
\( g(N') = g(N) + \text{cost}(A \text{ to } C) \)
\( g(N') + h(C) \geq g(N) + h(A) \)
- The f value along a path never decreases
- Non-decreasing f means you’re optimal to every state (not just goals)
Optimality Summary
- Tree search:
- \( A^* \) optimal if heuristic is admissible (and non-negative)
- Uniform Cost Search is a special case (\( h = 0 \))
- Graph search:
- \( A^* \) optimal if heuristic is consistent
- UCS optimal (\( h = 0 \) is consistent)
- Consistency implies admissibility
- Challenge: Try to prove this.
- Hint: try to prove the equivalent statement not admissible implies not consistent
- In general, natural admissible heuristics tend to be consistent
- Remember, costs are always positive in search!
Summary: A*
- \( A^* \) uses both backward costs and (estimates of) forward costs
- \( A^* \) is optimal with admissible heuristics
- Heuristic design is key: often use relaxed problems
A* Memory Issues \( \rightarrow \) IDA*
- IDA* (Iterative Deepening A*)
1. set \( f_{\max} = 1 \) (or some other small value)
2. Execute DFS that does not expand states with \( f > f_{\max} \)
3. If DFS returns a path to the goal, return it
4. Otherwise \( f_{\max} = f_{\max} + 1 \) (or larger increment) and go to step 2
- Complete and optimal
- Memory: \( O(b^s) \), where \( b \) – max. branching factor, \( s \) – search depth of optimal path
- Complexity: \( O(kb^s) \), where \( k \) is the number of times DFS is called
Recap Search I
- Agents that plan ahead \( \rightarrow \) formalization: Search
- Search problem:
- States (configurations of the world)
- Successor function: a function from states to lists of (state, action, cost) triples; drawn as a graph
- Start state and goal test
- Search tree:
- Nodes: represent plans for reaching states
- Plans have costs (sum of action costs)
- Search Algorithm:
- Systematically builds a search tree
- Chooses an ordering of the fringe (unexplored nodes)
Recap Search II
- Tree Search vs. Graph Search
- Priority queue to store fringe: different priority functions \(\rightarrow\) different search method
- Uninformed Search Methods
- Depth-First Search
- Breadth-First Search
- Uniform-Cost Search
- Heuristic Search Methods
- Greedy Search
- A* Search --- heuristic design
- Admissibility: \(h(n) \leq c(n)\) cost of cheapest path to a goal state. Ensures when goal node is expanded, no other partial plans on fringe could be extended into a cheaper path to a goal state.
- Consistency: \(c(n\rightarrow n') \geq h(n) – h(n')\). Ensures when any node \(n\) is expanded during graph search the partial plan that ended in it is the cheapest way to reach it.
- Time and space complexity, completeness, optimality
- Iterative Deepening: enables to retain optimality with little computational overhead and better space complexity
|
{"Source-Url": "http://inst.eecs.berkeley.edu:80/~cs188/sp12/slides/cs188%20lecture%202%20and%203%20--%20search%206PP.pdf", "len_cl100k_base": 4472, "olmocr-version": "0.1.53", "pdf-total-pages": 12, "total-fallback-pages": 0, "total-input-tokens": 35194, "total-output-tokens": 4870, "length": "2e12", "weborganizer": {"__label__adult": 0.000499725341796875, "__label__art_design": 0.0005140304565429688, "__label__crime_law": 0.0007128715515136719, "__label__education_jobs": 0.0016870498657226562, "__label__entertainment": 0.00014960765838623047, "__label__fashion_beauty": 0.0002505779266357422, "__label__finance_business": 0.0003190040588378906, "__label__food_dining": 0.0004668235778808594, "__label__games": 0.002628326416015625, "__label__hardware": 0.0017070770263671875, "__label__health": 0.0006351470947265625, "__label__history": 0.00049591064453125, "__label__home_hobbies": 0.0001908540725708008, "__label__industrial": 0.0008549690246582031, "__label__literature": 0.0005497932434082031, "__label__politics": 0.00042819976806640625, "__label__religion": 0.0006437301635742188, "__label__science_tech": 0.10321044921875, "__label__social_life": 0.00014710426330566406, "__label__software": 0.00794219970703125, "__label__software_dev": 0.8740234375, "__label__sports_fitness": 0.0006670951843261719, "__label__transportation": 0.0009813308715820312, "__label__travel": 0.00024306774139404297}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 15895, 0.0052]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 15895, 0.70614]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 15895, 0.85788]], "google_gemma-3-12b-it_contains_pii": [[0, 1296, false], [1296, 3130, null], [3130, 4229, null], [4229, 5231, null], [5231, 6864, null], [6864, 7765, null], [7765, 8678, null], [8678, 9587, null], [9587, 11281, null], [11281, 12714, null], [12714, 14991, null], [14991, 15895, null]], "google_gemma-3-12b-it_is_public_document": [[0, 1296, true], [1296, 3130, null], [3130, 4229, null], [4229, 5231, null], [5231, 6864, null], [6864, 7765, null], [7765, 8678, null], [8678, 9587, null], [9587, 11281, null], [11281, 12714, null], [12714, 14991, null], [14991, 15895, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 15895, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 15895, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 15895, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 15895, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, true], [5000, 15895, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 15895, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 15895, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 15895, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 15895, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 15895, null]], "pdf_page_numbers": [[0, 1296, 1], [1296, 3130, 2], [3130, 4229, 3], [4229, 5231, 4], [5231, 6864, 5], [6864, 7765, 6], [7765, 8678, 7], [8678, 9587, 8], [9587, 11281, 9], [11281, 12714, 10], [12714, 14991, 11], [14991, 15895, 12]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 15895, 0.07895]]}
|
olmocr_science_pdfs
|
2024-12-09
|
2024-12-09
|
ecf8313123a677bb1b2f2f14e4a6789b692e1cc5
|
Function Point Analysis FPA on A Team Planning Website Based on PHP and MYSQL
Lassen, Anders
Published in:
Journal of Information Technology and Software Engineering
DOI:
10.4172/2165-7866.1000237
Publication date:
2018
Document version
Publisher's PDF, also known as Version of record
Document license:
Unspecified
Citation for published version (APA):
Function Point Analysis FPA on A Team Planning Website Based on PHP and MYSQL
Lassen A*
Department of Computer Science, University of Copenhagen, Copenhagen, Denmark
Abstract
A function point analysis (FPA) has been carried out on a custom team planning website based on PHP and MYSQL. The FPA was done after the development was finished (retrospective) and a constructive cost model analysis (COCOMO) was carried out to assess source lines of code (SLOC). In the present study the function point analysis is based on entities of the relational database evaluated as internal logical files, and evaluation of PHP source code with dynamic SQL as either external input files or external inquiry files. The complexity for a custom team planning website was found to be 510 total adjusted function points (TAFP) (UAF=580 FP, TDI=23, VAF=0, 88, TAFP=510FP). The function point estimate was classified as an organic project in a COCOMO analysis, and it was concluded that the complexity corresponds to 27742 LOC (or 27, 4 KDSI). The estimate of 66-82 person-months project would correspond to a 4 crew team in 16-21 months. The estimate was compared to the actual source code count of 22300 LOC.
Keywords: Function point analysis; Dynamic SQL
Introduction
Function point analysis (FPA) is one way to determine the overall complexity of a system. In the current study a custom website is analyzed for complexity. Function point analysis is attributed to Allan Albright in 1979 [1] and JE Gaffney [2] and further developed in the MK2 report [3]. More recent work on function point analysis, a software tool (Unified code count (UCC)) [4,5]. Function point analysis can be evaluated using UML [6,7]. Made a literature review based on reported keywords identifying improvements to the accuracy of function point analysis [8]. They included 18 primary studies. The improvements were categorized into three categories: 1) "weights and complexities"; 2) 'technological in-dependence" of the method; and 3) calculating the 'adjusted functional size'. Literature review for productivity [9]. A study of Henderson and coworkers study perception of function point analysis from a manger viewpoint and a developer viewpoint based on entities with 3 key findings: SLOC-count is less complicated than FP; developers better perceive the benefits of FP than Managers; the difference in views between managers and developers inhibit communication necessary to reach informed decisions [10].
The FPA Allows for quantifying different properties of the system, in LOW, AVERAGE or HIGH complexity, totally the unadjusted function points (UAF). Use SIMPLE, AVERAGE and COMPLEX, where SIMPLE and COMPLEX are well defined; and use an AVERAGE, MEDIAN, RANGE(LOW, HIGH) classification for complexity [2]. The unadjusted function points can then be adjusted for technical complexity as the total adjusted function points (TAFP). It is this measure that can be converted to project size in terms of man years based on lines of code (LOC) for the used programming language [11]. A function point measure for a list of languages. To assess PHP we use the LOC per function point for java and C++ [12].
The system examined is custom build website supporting planning tasks and in-site-postings for Danish yachtracing crews participating in international match race. The website domain myteam.dk was built and in operation in the years 2008-2014 by Hans Jacob Simonsen [13]. The system supports in-site blogging, planning, logging comments to training and events, handling expenses, sending out reminders by SMS.
The result of the function point analysis is further analyzed using constructive cost model (COCOMO) analysis by Boehm BW [14]. Bearing in mind that the COCOMO measure is the total lines of code delivered by the development team. Finally the result of the COCOMO-analysis is compared to a simple source code count of delivered source code. Comparing the Total Adjusted Function Points to Delivered Source Lines of Code (SLOC), similar to the two step work effort validation [2] (Figure 1).
Method
Persistent store
The website database was a relational database of type MYSQL version 5.3 (or lower). The tables were defined with primary keys, unique index and auto-increment. No foreign keys constraints, triggers or stored procedures. Web-tier. Most of the source files were PHP files with HTML, CSS, files and some libraries in java Script. PHP class definitions were part of the code so both structured programming and object-oriented programming was present. The model-layer was object-oriented.
The system is evaluated using function point analysis [12]. The metric is evaluated for: internal logical files (ILF), external interface files (EIF), external Input (EI), external output (EO) and external inquiry (EIQ).
Internal logical files (ILF): Entity (Table 1) count in the relational database schema. The complexity of the entities graded initially as: below 8 attributes - (LOW), 8-16 attributes - (AVERAGE) and above 16 attributes (HIGH).
External interface files (EIF): Was not initially found relevant, but library calls could be considered. For example, the calendar functions.
External input (EI): PHP-files including DML-statements INSERT, UPDATE and DELETE executed as dynamic SQL. The search was a done by 'search in files' with notepad++, and visual inspection (Notepad++ 2007-2018). Server side code was considered and no stored procedures
Keywords: Function point analysis; Dynamic SQL
Academic Journal of Informatics: Vol. 8, No. 3, 2018
DOI: 10.4172/2165-7866.1000237
Received March 27, 2018; Accepted May 10, 2018; Published May 18, 2018
Citation: Lassen A (2018) Function Point Analysis FPA on A Team Planning Website Based on PHP and MYSQL. J Inform Tech Softw Eng 8: 237. doi:10.4172/2165-7866.1000237
Copyright: © 2018 Lassen A. This is an open-access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
or triggers found to include. The complexity was assessed by counting
and weighing the DML statements found in each file.
**External inquiry (EQ):** PHP files with SELECT statements as Dynamics SQL. Files with INSERT, UPDATE and DELETE statements are not counted but treated as external input files.
**External output (EO):** These are reports, screens, messages. SMS messaging is an example of external output considered from these weighted measures according to unadjusted function points (UAF) was calculated [1]. General system characteristics (GSC) were evaluated for their degree of influence (DOI) summing to the total degrees of influence (TDI): data communication; distributed data processing; performance; heavily used configuration; transaction rate; on-line data entry; end-user efficiency; online update; complex processing; reusability; installation ease; operational ease; multiple sites; and facilitate change. Each GSC was rated for degree of influence (DOI) on a scale from 0 to 5: not present or no influence (0); incidental influence (1); moderate influence (2); average influence (3); significant influence (4); and strong influence (5). The value adjustment factor (V AF) was calculated as 0.01 times TDI + 0.65. The total adjusted function points (TAFP) was calculated as the unadjusted function points (UAF) times the value adjustment factor (V AF):
\[
VAF = (TDI \times 0.01) + 0.65
\]
\[
FP = UAF \times VAF
\]
Once calculated, the adjusted function points (FP) was used to assess the project size using the constructive cost model (COCOMO). The function point conversion table was examined and initially PHP was compared to java or C++ [1]. The conversion rate for java or C++ are the same. Average source LOC per function point is 53, and average source LOC for a 210 FP application is 11130 LOC. Since we have the source code [13], the actual LOC can be counted and compared to the estimated project size.
**Results**
The evaluation of the database relations was done in one pass. The evaluation of the PHP-files was done in several passes.
**Count-1:** Simple file count.
**Count-2:** Inspection of files for SELECT statements. Presence of Select in comments was disregarded and file Complexity was based on the number of SELECT-statements.
**Count-3:** Same evaluation based on inspection for INSERT-statements.
**Count-4:** Same evaluation based on inspection for UPDATE- and DELETE-statements.
**Internal logical files (ILF)**
Every relation in the database was considered. Some of the relations have media files. Media are implemented as attributes of type LONGBLOB or BLOB. All these relations are AVERAGE candidates.
**External measures**
**External Interface files (EIF):** No external interface files are determined at this point, unless the website configuration is to be considered. An external interface file must be generated or maintained by another system [1]. This measure is initially set to count 10 and weight AVERAGE (Table 1).
**External Input (EI):** These are input screen. Here the PHP code is inspected to determine user input. The initial file count done in Notepad++ by simple keyword search is tagged count-1 in Table 2. The result of the first count was 30 files with INSERT-statements, 49 files with UPDATE statements and 38 files with DELETE statements. Initially set to complexity AVERAGE.
Further passes are done with code inspection carefully. Keywords in comments and variable are discarded from counts. Files with several DML statements are judged for complexity and account for recurring files in the first count. A file with SELECT and DML modification statements (INSERT, UPDATE, DELETE) should only be classified as an external input file. EI should be reduced.
After the final pass, assessment of complexity is complete. Many overlaps of data manipulation statements are present in the same files and the total number of files included is 29. Files in the ‘classes’ folder are model-classes for the major relational entities and implement SELECT, INSERT, UPDATE and DELETE statements in various member functions. The final count is given in Table 2 (11 LOW, 7 AVERAGE, 11 HIGH).
**External output (EO):** These are reports, screens, messages. Here we know the SMS service is very important, but how many places are the SMS services called? Likewise we account for an email service. We estimate is 10 files, average complexity.
**External Inquiry (EQ):** Enquiry forms are listings; screens that are informational; SELECT statements. All files with keyword ‘SELECT’ were inspected using ‘find in files’ in notepad++ (Notepad++ 2007-2018). The initial file count was 86. In the most cases SELECT’s would be simple, say 80%, so 86 files are divided into 16 files of AVERAGE complexity and 70 files with LOW complexity.
SELECT-statements and dropdown html are the vast candidates. Select is used in a HTML-tag for one option in a dropdown box. Select also is found in comments. Upload is a library used that is not included, even though some coding efforts must be done to facilitate upload (40 LOW, 13 AVERAGE, 5 HIGH).
Two further passes were done to inspect for data modifications statements. After inspection for INSERT, UPDATE and DELETE statements files initially classified External Inquiry (EQ) are classified as External input files and the EQ count reduced accordingly. In the last pass several UPDATE and DELETE-statements found and moved several EQ-AVERAGE and EQ-HIGH file to EI-files. The final assessment of complexity for External inquiry files (EQ) are
Table 1: Relations and their complexity. LOW 0-7. AVERAGE 6-15. HIGH 23-30 plus binary objects. SQL-DML reference in PHP code with table name. Cardinality is the number of tuples in each relation.
Table 2: DML modification statements (INSERT, UPDATE, DELETE). After the final pass many overlaps in files have been identified. The total number of files included is 29.
Table 3: The complexity external inquiry, after four passes. summarized in Table 3 (31 LOW, 5 AVERAGE, 1 HIGH).
Computing the unadjusted function points
The unadjusted function points in Table 4 are calculated using the weights [12]. The ILF complexity is taken from Table 1. The EIF Complexity is not determined and set ad hoc to (10 files and AVERAGE complexity). EI is set to the file count with INSERT, UPDATE and DELETE, corrected for recurrence, comments and variable- and function names. EO is set to the SMS estimate (10 AVERAGE). Further inspection will change this. EQ is adjusted for recurrence of SELECT’s and conflicting data manipulation statements. Total unadjusted function point = 580.
The external UAF count is higher than the internal UAF count. Initially we found that the external UAF counts out performed the internal UAF count, but final inspection has reduced this concern.
The PHP-source code is less than twice as complex that the MYSQL data model of the two measures of complexity set EIF and EO, EO is to some extent reasonable. Of the two output modalities have been identified and styles emails can add to complexity. Taken together they are probably overestimated.
GSC and total adjusted function points
The unadjusted function points can now be weighted with a set of general system characteristics (GSC). The 14 system characteristics and the degrees of influence of each of the General system characteristics [10] are listed in Table 5 column “Degree of influence [1]”.
Add hoc setting for general system characteristics for this application was done. The unadjusted function point (UAF) of Table 5 was used to calculate the total adjusted function points. Generally the degree of influence have been reduced to a total of 23 degrees of influence. Only
one system characteristic (Multiple Sites) was set to average influence (3) as the application could be refurbished to several platforms, and the site give rise to 2 code bases. Seven system characteristics were set to moderate influence (2): Data Communication, On-line Data Entry, End User Efficiency, Online Update, Reusability, Installation Ease, and Operational Ease. Five system characteristics were set to incidental influence (1): Performance, Heavily Used Configuration, Transaction Rate, Complex Processing, and Facilitate Change. One system characteristic was set to not present or no influence (0): Distributed data processing.
The value adjustment factor for this study was found to be 0.88. A lower degree of influence than presented by Jack TM [12]. The total adjusted functions points (TAFP) for this project was 510 FP.
**COCOMO (Constructive cost model)**
The COCOMO analysis takes the total adjusted function point measure and converts to a measure of lines of delivered source code (LOC). In our case PHP and java script are taken as the java and C++ measure of 53 LOC per function point and 11130 average source LOC for a 210 FP application [12] (equation 4). My expectation for the current 510 FP measure for TAFP would be 2.4 * 11130 lines of code = 27442 LOC (when UAF = 580 and TAFP = 510), see equation 5. Which I hope will be found to be an over estimation for the original PHP site [13]. The estimated number of lines of code can then be converted to 27,4 KDSI (1000 delivered source instructions = 1000 LOC) by dividing by 1000 (equation 6).
<table>
<thead>
<tr>
<th>General System Characteristic</th>
<th>Degree of influence</th>
<th>Degree of influence</th>
</tr>
</thead>
<tbody>
<tr>
<td>Data Communication</td>
<td>3</td>
<td>2</td>
</tr>
<tr>
<td>Distributed data processing</td>
<td>2</td>
<td>0</td>
</tr>
<tr>
<td>Performance</td>
<td>4</td>
<td>1</td>
</tr>
<tr>
<td>Heavily Used Configuration</td>
<td>3</td>
<td>1</td>
</tr>
<tr>
<td>Transaction Rate</td>
<td>3</td>
<td>1</td>
</tr>
<tr>
<td>On-line Data Entry</td>
<td>4</td>
<td>2</td>
</tr>
<tr>
<td>End User Efficiency</td>
<td>4</td>
<td>2</td>
</tr>
<tr>
<td>Online Update</td>
<td>3</td>
<td>2</td>
</tr>
<tr>
<td>Complex Processing</td>
<td>3</td>
<td>1</td>
</tr>
<tr>
<td>Reusability</td>
<td>2</td>
<td>2</td>
</tr>
<tr>
<td>Installation Ease</td>
<td>3</td>
<td>2</td>
</tr>
<tr>
<td>Operational Ease</td>
<td>3</td>
<td>2</td>
</tr>
<tr>
<td>Multiple Sites</td>
<td>1</td>
<td>3</td>
</tr>
<tr>
<td>Facilitate Change</td>
<td>2</td>
<td>1</td>
</tr>
<tr>
<td>Total degrees of influence (TDI)</td>
<td>40</td>
<td>23</td>
</tr>
</tbody>
</table>
\[
\text{VALUE ADJUSTMENT FACTOR (VAF)} = (40 \times 0.01) + 0.65 = 1.05 \\
\text{VAF} = (TDI \times 0.01) + 0.65
\]
1.05 \quad 0.88
| Total adjusted function points (TAFP) | 210 \times 1.05 = 210 |
| TAFP = UAF \times VAF | 510 |
Table 5: Calculation of the value adjustment factor (VAF) and the total adjusted function point (TAFP) or just function points (FP).
The actual lines of code counted is about 43000 LOC including 20700 LOC for 3-party code. The KDSI measure of COCOMO is a measure of delivered source code instructions. This amounts to 43000-20700= 22300 lines of delivered source code (22.3 KDSI). Compared to the result of the constructive cost model estimate of 27.4 KDSI, this is an overestimation by 23%.
**Discussion**
The first key question here is training. The subjective measure of complexity in a smaller custom website, compared to corporate wide systems. Does this lead to overestimation? Yes. In this function point analysis only the relational tables an their complexity was held against the PHP code as an external application. The function point analysis was calculated from a database standpoint. There are other factors that have only been touched.
It was surprising that function point analysis of a custom website developed by one programmer and operational over a period of 6 years had the estimation of 510 function points (FP) converting to an expected 27000 lines of code. I had expected less complexity. Experience with FPA will give more precise estimates for each parameter and even bring the FPA closer to the source code count. In this study the boundary elements considered were primarily entity- and transactional complexity. They seemed a tangible constraint on metrics explored. Other metrics could be considered. A metric for algorithmic complexity (AT) that also is an interesting metric, but may be more academic than operational even in systems of modest size [4].
The Java code calibration is a candidate for debate. In this study it worked out well, but I must also note some complex PHP and Java script-files were not included. This would only increase the measure. And training would cater for this. In the COCOMO analysis overestimation could also be biased by my ad hoc setting of the various degrees of influence.
A reason to retrospective make a function point analysis in this case was the author's lack of luck to debug and support the site after the creator passed away and the vendor upgraded the PHP-version, rendering the site down. This lack of skills can be attributed in some part to Fredric Brooks – ‘The mythical man month’ [5] but also the teachings of Peter Naur, 'Computing a human activity' and ‘Programming as theory building' [15-17]. In the section 'program life, death and revival' they dwell into the problem not having access to programmers with working knowledge [16]. Barry Boehm [5]and others list issues with project estimation, also covers unfamiliarity with existing source code [3,5,15]. This is a real obstacle or spike if you will, in reviewing and debugging existing code. It is the author's view that more frequently
<table>
<thead>
<tr>
<th>Project type</th>
<th>Person-months</th>
<th>KDSI</th>
<th>Person-months</th>
<th>Team4-months</th>
</tr>
</thead>
<tbody>
<tr>
<td>Organic</td>
<td>Person-months= 2.4 \times \text{KDSI}^{1.05}</td>
<td>27.4</td>
<td>77</td>
<td>19</td>
</tr>
<tr>
<td>Semi-detached</td>
<td>Person-months= 3.0 \times \text{KDSI}^{1.12}</td>
<td>27.4</td>
<td>122</td>
<td>30</td>
</tr>
<tr>
<td>Embedded</td>
<td>Person-months= 3.6 \times \text{KDSI}^{2.20}</td>
<td>27.4</td>
<td>191</td>
<td>48</td>
</tr>
</tbody>
</table>
Table 6: Calculating person months and team months for a four person team (person-month divided by 4) based on KDSI=27.4
than admitted; it is the wiser choice to re implement the code in face
of rejection of the initial strategy. Support for this argument can also
be in comparing computing as text production to theory building [16].
In this case the following observations contribute to understand the
current system down: Broken links. Possible missing URL resolutions;
Application state could not be debugged and restored; Vendor upgrade
coincided with mourning period.
Conclusion
The Internal Logical File complexity holds for the number of
files/entities, but the complexity (LOW; AVERAGE; HIGH) could be
overestimated for a smaller custom website.
Using DML (Data Manipulation Language) as a marker for EI
an EQ in a website seems operational in a retrospective study (where
the coding has been done). The initial keyword search identifies key
participating potential relevant external files. A code inspection is
necessary to assess complexity and relevance.
It was found that the “myteam” custom website consist UAF=580
FP unadjusted function points, TDI=23 Total degrees of influence,
Value adjustment factor, VAF=0,88; Total adjusted function points
TAFP=510FP.
The COCOMO analysis showed an estimated project size of
27,4 KDSI or 27442 LOC. Based on 27,4 KDSI the project type was
classified as organic to semi-detached, and project estimate of 66-
82 person-months or 16-21 team-months for a four person team.
An overestimation of 23% is found compared to the current count
of the actual lines of code. The function point analysis explained the
complexity quite well.
References
Proceedings of SHARE7GUIDE IBM Applications Development Symposium,
2. Albrecht AJ, Gaffney JE (1983) Software function, source lines of code and
devlopment effort prediction: A software science validation. IEEE Transaction
4. Henderson GS (1992) The application of function points to predict source lines
of code for software development. Thesis.
ISESEM.
developers' performance evaluation. 4th int. conf. on wireless communications,
networking and mobile computing pp:1-4.
point analysis method: A systematic literature review. IEEE Trans Engineering
management 62: 495-506.
development teams. Serbian journal of management 7: 65-75.
10. Sheetz SD, Henderson D, Wallace L (2012) Understanding developer and
manager perceptions of function points and source lines of code. The Journal
of systems and software 82: 1540-1549.
Danish yachtracing crews participating in national and international match race.
Domain www.myteam.dk.
5th Edition. Person prentice Hall.
engineering Addison-Wesley.
microprogramming 15: 253-281.
|
{"Source-Url": "https://static-curis.ku.dk/portal/files/216974914/Function_point_analysis_fpa_on_a_team_planning_website_based_on_php_and_mysql_2165_7866_1000237.pdf", "len_cl100k_base": 5470, "olmocr-version": "0.1.49", "pdf-total-pages": 6, "total-fallback-pages": 0, "total-input-tokens": 17877, "total-output-tokens": 6311, "length": "2e12", "weborganizer": {"__label__adult": 0.0003190040588378906, "__label__art_design": 0.00025010108947753906, "__label__crime_law": 0.00024139881134033203, "__label__education_jobs": 0.0011768341064453125, "__label__entertainment": 4.8160552978515625e-05, "__label__fashion_beauty": 0.00012195110321044922, "__label__finance_business": 0.0004184246063232422, "__label__food_dining": 0.0002703666687011719, "__label__games": 0.00038361549377441406, "__label__hardware": 0.0006761550903320312, "__label__health": 0.0004603862762451172, "__label__history": 0.00018334388732910156, "__label__home_hobbies": 9.41753387451172e-05, "__label__industrial": 0.00025010108947753906, "__label__literature": 0.00024962425231933594, "__label__politics": 0.00012600421905517578, "__label__religion": 0.0002593994140625, "__label__science_tech": 0.00994110107421875, "__label__social_life": 0.00010669231414794922, "__label__software": 0.006778717041015625, "__label__software_dev": 0.97705078125, "__label__sports_fitness": 0.00021922588348388672, "__label__transportation": 0.0003807544708251953, "__label__travel": 0.00017178058624267578}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 24935, 0.05222]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 24935, 0.29231]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 24935, 0.89768]], "google_gemma-3-12b-it_contains_pii": [[0, 574, false], [574, 6659, null], [6659, 12217, null], [12217, 14381, null], [14381, 21004, null], [21004, 24935, null]], "google_gemma-3-12b-it_is_public_document": [[0, 574, true], [574, 6659, null], [6659, 12217, null], [12217, 14381, null], [14381, 21004, null], [21004, 24935, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 24935, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 24935, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 24935, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 24935, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 24935, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 24935, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 24935, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 24935, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 24935, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 24935, null]], "pdf_page_numbers": [[0, 574, 1], [574, 6659, 2], [6659, 12217, 3], [12217, 14381, 4], [14381, 21004, 5], [21004, 24935, 6]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 24935, 0.13043]]}
|
olmocr_science_pdfs
|
2024-11-27
|
2024-11-27
|
40efd2b8f6ee70a66061f3155dcff9ce0e528937
|
The Role of RDF in the IMS Family of Specifications
Mikael Nilsson∗
Center for User-Oriented IT-design,
Royal Institute of Technology, Stockholm
27th September 2001
1 Background
In May 2001, the IMS 1.2 meta-data specification was released. This specification represented an important step in the maturization of the IMS meta-data standard, and in the underlying IEEE LOM standard, combining many lessons that have been learned since the meta-data specification was first published. But it also contained a new element, included as an appendix to the XML binding document: an IMS meta-data RDF binding. The inclusion of an RDF binding in a draft version has spawned discussion and raised questions as to the role RDF plays, and should play, in the whole family of IMS specifications.
This document is an attempt at answering some of those questions; more precisely: What is RDF anyway, and what is the vision underlying it? What advantages and disadvantages does RDF have over a pure XML approach? Specifically for IMS, what advantages does using RDF provide? What could/should be the relative roles of XML and RDF in the IMS family of specifications? Naturally, the discussion is relevant for all meta-data efforts related to IMS, such as IEEE LOM and SCORM.
Sections 2 to 5 discuss the general features of RDF as compared to XML, and can be skipped by readers more interested in the consequences for the meta-data specification work. Sections 6 to 8 more specifically discuss RDF in relation to the whole family of IMS specifications and related efforts.
2 RDF origins: The Semantic Web vision
The Semantic Web is the name of a long-term project recently started by W3C with the stated purpose of realizing
the idea of having data on the Web defined and linked in a way that it can be used by machines not just for display purposes, but for automation, integration and reuse of data across various applications.1
---
∗mini@nada.kth.se
It was motivated by the very same problems that motivates the development of meta-data standards\(^2\) – the fact that raw media, in the form of text, HTML, images or video streams, contains meta-information that may be readily deducible from the context for the human consumer (the name of the author, the kind of material contained within, etc.), but is mostly inaccessible to computers. Making this information available to computers in order to enhance their usefulness, was the driving vision that created the Semantic Web project.
Most traditional meta-data approaches take the view of meta-data as being mostly a digital indexing scheme to use in cataloging and digital libraries. What distinguishes the Semantic Web from these approaches to meta-data are two important things:
- The Semantic Web is designed to allow reasoning and inference capabilities to be added to the pure descriptions. In its simplest form, this includes stating facts such as “a hex-head bolt is a type of machine bolt”\(^3\), but extends to the deduction of complicated relationships. This is an important feature to allow intelligent agents and other software to not only passively swallow descriptions, but to act on them as well.
- The Semantic Web is a web-technology that lives on top of the existing web, by adding machine-readable information without modifying the existing Web. It is designed to be globally distributed with all this means in terms of scalability and flexibility.
The Semantic Web is a layered structure. XML forms the basis, being the transport syntax. RDF provides the information representation framework, and on top of this layer, schemas and ontologies provide the logical apparatus necessary for the expression of vocabularies, enabling intelligent processing of information.
### 3 Essential RDF
While the current Web allows you to **link** to anything from anything in a machine-understandable way, the Semantic Web will allow you to **say** anything about anything in a machine-readable way. Seen this way, RDF is the language in which Semantic Web meta-data statements are expressed. In fact, RDF can be said to consist purely of so-called **statements**. An RDF statement consists of three elements: a **subject**, a **predicate**, and an **object**. Statements are about Web resources, so subjects and objects are URIs, machine-readable identifiers. Objects can also be plain text strings. Saying “The document http://www.w3c.org/2001/sw/ was created by W3C” is represented by the triple (“http://www.w3c.org/2001/sw/”, **created by**, “W3C”). To disambiguate the different predicates that can be used, every predicate must be given a URI. In this case, there is a standard predicate available in the Dublin Core vocabulary, namely “http://purl.org/dc/elements/creator”, which we can use. The triple then becomes
\(^2\)The Semantic Web activity is, as a matter of fact, the successor of the W3C Metadata activity. Thus, the Semantic Web is the W3C meta-data architecture.
This demonstrates that URIs can be used to name not only concrete digital documents on the web, but abstract entities as well. In order to talk about non-digital resources, we must give them URIs. For example, to talk about the organization W3C (i.e., use it the subject of a statement), we must give it a URI. Let's give it the URI "http://www.w3c.org/organization". We can now say things such as "http://www.w3c.org/2001/sw/ was created by http://www.w3c.org/organization, which is an organization with the name ‘W3C’", which is, in fact, three separate statements. More complicated RDF expressions like this are usually represented as graphs, where the subjects and objects are nodes, and the predicates are edges.\footnote{Uses of RDF for Resource Description}
This is all there is to basic RDF – nodes-and-arcs diagrams interpreted as statements about concepts or digital resources represented by URIs.\footnote{RDF also contains an important mechanism called reification, that allows you to state something about another RDF statement, such as who said it, whether it is true or false, etc.\footnote{Defined in http://www.w3.org/TR/rdf-schema}}
However, the need for standardized vocabularies for things like "organization" and the predicate "is a" etc. is evident. The basis for such vocabularies in RDF is RDF Schema.\footnote{For a more detailed explanation of these concepts, see e.g. An Introduction of RDF by Eric Miller (http://www.dlib.org/dlib/may98/miller/05miller.html) or the RDF syntax and model specification http://www.w3.org/TR/REC-rdf-syntax.} This specification provides the basic vocabulary to express relationships between terms: resources being instances of terms ("http://www.w3c.org/organization is an organization"), terms being subterms of other terms ("a hex-head bolt is a type of machine bolt") and so on. It also provides means to restrict the usage of predicates: "is a parent of" only applies to persons, etc. The terms instance, subterm, applies to are the kind of terms defined by the RDF Schema specification.
Using the vocabulary provided by RDF Schema, it is easy to create your own semantically rich vocabularies.
\section{Uses of RDF for Resource Description}
It is not immediately obvious that the simple statement model of RDF can be used to make the Semantic Web a reality. The most fundamental benefit of RDF compared to other meta-data approaches is that using RDF, you can say anything about anything. Anyone can make RDF statements about any identifiable resource. Using RDF, the problems of extending meta-data and combining meta-data of different formats, from different schemas disappear, as RDF does not use closed documents. Important uses of RDF to encode information for any resource you can name with a URI include:
\begin{description}
\item[describe] Since a resource can have uses outside the domain foreseen by the author, any given description (meta-data instance) is bound to be incomplete. Because of the distributed nature of RDF, a description can be expanded, or new descriptions, following new formats (schemas), can be added. This allows for new creative uses of content in unforeseen ways. This is one of the important features of the current Web, where anyone can link to anything, that has been carried over into RDF.
\item[certify] There is no reason why only big organizations should be able to certify content – individuals such as teachers may want to certify a
\end{description}
certain content as a quality learning resource that is well suited for specific learning tasks. How to handle this kind of certification will be an important part of the Semantic Web.
**annotate** Everything that has an identifier can be annotated. There are already attempts in this direction: Annotea\(^7\) is a project where annotations are created locally or on a server in RDF format. The annotations apply to HTML or XML documents and are automatically fetched and incorporated into web pages via a special feature in the experimental browser Amaya\(^8\).
**extend** Structured content (typically in XML format) will become common. Successive editing can be done via special RDF-schemas allowing private, group consensus or author-specific versions of a common base document. The versioning history will be a tree with known and unknown branches which can be traversed with the help of the next generation versioning tools.
**reuse** RDF is application independent. As the meta-data is expressed in a standard format independent of more advanced schemas that are used, even simplistic applications can understand parts of large RDF descriptions. If more advanced processing software is available (such as logic engines), more advanced treatment of the RDF descriptions is possible.
## 5 RDF and XML: Model, Syntax, Semantics
So far nothing has been said about XML. The reason is that the RDF Model can be defined completely without reference to XML. XML can, however, be used as a syntax for RDF statements. The RDF specification defines the standard syntax to encode RDF statements in XML.
But one question remains: why can’t XML and XML Schema be used to represent the same kind of information that RDF expresses? XML Schemas are, after all, powerful tools to express complex requirements on XML elements. This is true, and XML and XML Schemas can be used to do some of what RDF does, but not without much trouble. The reasons are several:
- **The RDF model and the XML model are fundamentally different.** The XML data model is a text-markup oriented labeled tree. RDF, by contrast, has a very simple model consisting of labeled arcs. Of course, any specific set of RDF statements forms a graph that can be serialized in XML. But as XML and XML Schema are designed primarily for fixed, tree-like documents, they are significantly less flexible for expressing meta-data, which by its very nature is subjective, distributed and expressed in diverse forms. The RDF model, while simpler, is flexible enough to support these principles.
- **The resources used in RDF and XML Schemas are fundamentally different.** The nodes that XML Schemas talk about are nodes in an XML document, at specific places in a document structure. In RDF, the nodes are not nodes in the document itself, but rather any resources
\(^7\)http://www.w3.org/2001/Annotea/
\(^8\)http://www.w3.org/Amaya/
that have URIs, and more often than not live outside the RDF document itself. Thus, RDF is designed to be a meta-data language.
- **The semantics of XML Schemas and RDF are fundamentally different.** XML Schemas have a primarily syntactic interpretation, restricting the set of XML documents that can be produced. RDF, on the other hand, has a primarily semantic interpretation. While XML Schemas are used for modeling XML documents, RDF is used to model knowledge, where tree-based representations are not enough.
The difference can be formulated in this way⁹: XML/XML Schema is a data modeling language, and RDF is a meta-data modeling language. When meta-data needs to be encoded as data, an XML syntax is very useful. However, modeling meta-data in pure XML severely restricts its flexibility.
### 6 Lessons from Using RDF in the IMS Specifications
From the discussion thus far, the consequences for IMS are still unclear. This unclarity was one of the most important reasons behind the construction of the RDF binding of the IMS 1.2 meta-data specification, and subsequent efforts to produce an RDF binding for IMS Content Packaging. Some important positive lessons learned in this effort were:
- **Interoperability with other, separate, standards is greatly increased.** The reason is simple: RDF allows a single storage model for very different types of data and schemas. For example, storing meta-data from different specifications in the same database is straightforward. To implement searching that includes dependencies between meta-data expressed in different schemas is simplified. An example of this is the Edutella¹⁰ effort to build a peer-to-peer educational meta-data exchange network, which would meet severe difficulties in using, searching in, and translating between the different formats used for VCard, Dublin Core, Dublin Core Qualifiers, IEEE LOM, SCORM etc., which are meta-data standards without the common RDF format.
- **Reuse of existing meta-data standards is greatly simplified.** For example, there has been much discussion on whether to incorporate the VCard XML syntax in the XML binding. While desirable, this creates namespace and XML DTD problems. In the RDF binding, the VCard RDF binding can be transparently included with no extra effort.
- **Some terms do not have exact equivalents in other meta-data standards, but relate to some existing terms by, for example, being more narrow, more broad etc.** As the whole IMS RDF binding was designed as an extension to Dublin Core meta-data¹¹, the relationship between IMS meta-data elements and Dublin Core elements are formalized in a machine-readable manner. Thus, no conversion to/from Dublin Core meta-data is needed, and Dublin Core aware tools can understand the Dublin Core-parts of an IMS meta-data description.
---
⁹See also [http://www.w3.org/DesignIssues/RDF-XML.html](http://www.w3.org/DesignIssues/RDF-XML.html) or in more detail: [www.ontoknowledge.org/oil/downl/IEEE00.pdf](http://www.ontoknowledge.org/oil/downl/IEEE00.pdf)
¹¹See [http://dublincore.org/](http://dublincore.org/)
There has also been much discussion on the topic of vocabularies. While these are essential for the use and extension of IEEE LOM meta-data, there does not exist a standard way to encode and distribute them. In RDF, this problem completely disappears, as vocabularies, as we have seen, are a fundamental part of the RDF Schema specification. Not only is there a standard way to list vocabulary items, but their interdependencies can be modeled in a standard way. And as if that was not enough, efforts such as DAML\textsuperscript{12} and OIL\textsuperscript{13} provide means to model vocabularies as full-fledged ontologies\textsuperscript{14} expressed in RDF, if that is desired, while still maintaining compatibility with less-capable software.
While extending the XML binding is certainly possible using XML Schemas, the process easily creates interoperability problems. In RDF, several independent means of meaningful extensions are available, none of which cause interoperability problems:
- **Refinement** of the semantics of existing properties and terms by creating subterms etc. This cannot be done in a standard way using XML.
- **Introduction of new properties** and terms describing resources. This is the kind of extension one can usually do in XML.
- **Adding new properties** to a resource in other documents, which is possible since RDF does not work with meta-data instances as closed documents. For example, the RDF binding is designed so that translations of titles and description etc., can be managed separately. In the same way, different kinds of meta-data can be managed separately, and merged when needed\textsuperscript{15}. This *modularity* is impossible to achieve in a clean and standard way using XML.
These possibilities are not only nice properties of RDF, but are completely indispensable in many cases.
- RDF already contains means for describing *meta-meta-data* (in any number of meta-steps)\textsuperscript{16}, that can be as rich as ordinary meta-data.
- For meta-data that contain very complex interdependencies, such as IMS Content Packaging, the graph representation and modularity of RDF effectively *cleans up the format* and semantics of the specification.
- RDF allows for a clean integration of the different specifications in a layered way. Currently, the work on IMS Content Packaging in RDF is built on top of the IMS Meta-data RDF binding, which is built on top of the VCard RDF binding and the Dublin Core Qualifiers RDF binding, that extends the core Dublin Core RDF binding. Continuing
\textsuperscript{12}See http://www.daml.org/
\textsuperscript{13}See http://www.ontoknowledge.org/oil/
\textsuperscript{14}See e.g. http://www.ontology.org/main/papers/faq.html for a definition of the word “ontology” in this context. The paper *Combining Ontologies and Terminologies in Information Systems* by Johann Gamper, Wolfgang Nejdl and Martin Wolpers (http://www.kbs.uni-hannover.de/Arbeiten/Publikationen/1999/teke99/) is also of interest.
\textsuperscript{15}For an important example of this, see the UNIVERSAL project http://nm.wu-wien.ac.at/universal/, and http://www.ist-universal.org/.
\textsuperscript{16}Via reification, mentioned above.
upwards in this fashion, I see a very concrete potential for a complete unification of all IMS meta-data related specifications. This is no light-minded suggestion, and the benefits, as seen in this list, are many.
These lessons are in no way coincidences. While XML was designed as a data interchange format, RDF was designed from the ground up to fulfil the role of an Internet architecture for meta-data. “Resource Description Framework (RDF) is a foundation for processing metadata; it provides interoperability between applications that exchange machine-understandable information on the Web”\(^\text{18}\). This is very clearly reflected in the findings above.
On another note, RDF presents several drawbacks, as has been made clear during the work on the RDF bindings.
- The underlying standards, notably the RDF Schema specification, but also the Dublin Core Qualifiers RDF binding, are still young, intensively discussed and possibly subject to change. The specifications underlying the XML binding are much more stable (even if the XML Schema specifications have changed recently). This is, of course, a temporary problem.
- Tool support for RDF is very immature at this point, and integration of Semantic Web technologies into the current Web is still only starting. XML support can be said to be mature in most respects. However, with the current pace of RDF adoption, tool support is rapidly increasing.
- Designing an RDF binding makes it necessary to revisit many of the assumptions in the underlying information model, which often is designed with an XML binding in mind. As the semantics of XML elements is not explicitly stated, much of the work in designing an RDF binding goes into defining the semantics of the elements. This has caused minor interoperability problems between the XML binding and the RDF binding, problems that can only be remedied by designing the information model with the RDF binding in mind.
From another perspective, this is a very positive side effect, as it significantly helps sharpen the information model. This has already been observed in the design of the IMS meta-data RDF binding, but from preliminary studies seems to be even more evident in the work on an RDF binding of IMS Content Packaging.
7 Possibilities on the Semantic Web
From a more strategic point of view, the emerging Semantic Web presents exciting new possibilities for uses of the IMS specifications. While XML standards are very good tools for enabling interoperability by specifying import and export formats for LMSs\(^\text{19}\), they tend to favor large, centrally managed, monolithic systems.
\(^{17}\)Something similar has already been done in the UNIVERSAL project, where e.g. learner and contributor information is added on top of low-level meta-data.
\(^{18}\)RDF specification: http://www.w3.org/TR/REC-rdf-syntax
\(^{19}\)Learning Management Systems – a software system for managing an interactive learning environment.
By enabling the use of IMS specifications in Semantic Web technologies, a much wider range of applications are imaginable:
- Intelligent software agents can be implemented, helping the learner to find and use globally distributed learning resources.
- Personal annotations of any learning resource becomes a feasible technology, as demonstrated by Annotea\(^\text{20}\).
- Collaborative and distributed authoring and course construction becomes much simpler thanks to the modularity of the information.
- Reuse of learning material by cross-fertilization suddenly becomes a reality, creating important synergy effects.
The Semantic Web promises to create a web-based eco-system for learning resources, freeing the material from being trapped in closed systems. One important example of this kind of technology is Edutella\(^\text{21}\), an RDF-based peer-to-peer system under development, being designed to allow distributed access to learning resource meta-data expressed in many different schemas. By combining meta-data from many sources in a controlled but distributed way, cross-annotation and mutual reuse of material becomes a reality.
In short, the vision of the Semantic Web is an important vision for online learning as well.
8 Suggestions for IMS on the use of RDF
We now turn to a proposal for the possible future role of RDF within IMS. It is not intended as a final proposal, but only to ignite discussion on this important topic.
What status should an RDF binding have? The first problem is what status an RDF binding should have in a single IMS specification. From the experience with the IMS 1.2 Meta-data binding, it has become clear that an RDF binding is a complete reimplementation of the information model. Thus, the only natural role for an RDF binding is to be interpreted as a separate binding, to live alongside any XML binding.
Should all IMS specifications have RDF bindings? In light of the analysis above, it should be clear that many of the IMS specifications would benefit from an RDF binding. Any specification that would be useful in a Semantic Web scenario is a candidate for having an RDF binding, and this certainly includes most specifications.
What about the XML bindings? There is definitely a need for XML bindings. In many scenarios, exchange of meta-data instances is the main concern, and XML is a very good technology for that – especially in the case of light-weight, unintelligent clients.
\(^{20}\)http://www.w3.org/2001/Annotea/
\(^{21}\)http://edutella.jxta.org/
What about compatibility between the RDF and the XML bindings?
This has been highlighted as being problematic in some aspects in the IMS 1.2 Meta-data RDF binding. Some sorts of interoperability problems are inevitable, especially the ones resulting from the fact that RDF does not use closed meta-data instances in the same way as XML. Other kinds of problems, such as which tokens to use for vocabulary items, can be rectified by early cooperation between RDF and XML binding designers – for example, using URIs to denote vocabulary items in XML, making them addressable in RDF as well. In any case, automatic conversion to/from XML is an important aspect of the design of an RDF binding.
How should development of RDF specifications within IMS take place?
As has been pointed out above, the specifications produced by the different parties in the meta-data community (Dublin Core, VCard, LOM, SCORM) all have complex interdependencies, and increasingly so. It has become evident that the reuse of specifications within IMS is not at the desired level. This has to do with the closed nature of XML bindings. RDF bindings, on the other hand, are much more intensely interdependent as a consequence of the heavy reuse of vocabularies. A coordinated effort within the IMS project to produce a coherent set of RDF bindings would be necessary. This effort will return important feedback to the information model designers, so that in the end, producing an RDF binding will be much less work than formulating the information models and the initial XML binding.
Such an effort will also greatly reduce the difficulties involved in adding another IMS specification to an existing software system – it would only involve adding a new RDF Schema, which has been designed to interoperate with the existing schemas. This has important consequences for the adoption of IMS specifications.
9 Conclusion
The future for RDF within IMS is bright, and the possibilities opened up by RDF and Semantic Web technologies promise to take the IMS project to a new level of applications. But some effort from IMS to produce the necessary specifications will be needed. In particular:
- Each IMS specification needs an RDF binding.
- The RDF efforts within IMS need to be coordinated to produce a coherent set of RDF-based specifications.
- Interoperability discussions with other standards groups such as Dublin Core and IEEE LOM need to be intense in order to maximize interoperability.
RDF provides an important technological platform to handle the interoperability demands of the emerging specification and vocabulary jungle, inside and outside of IMS.
|
{"Source-Url": "http://kmr.nada.kth.se/papers/SemanticWeb/IMS-RDF-Whitepaper.pdf", "len_cl100k_base": 5355, "olmocr-version": "0.1.53", "pdf-total-pages": 9, "total-fallback-pages": 0, "total-input-tokens": 21029, "total-output-tokens": 5954, "length": "2e12", "weborganizer": {"__label__adult": 0.00032448768615722656, "__label__art_design": 0.0009150505065917968, "__label__crime_law": 0.0005297660827636719, "__label__education_jobs": 0.00484466552734375, "__label__entertainment": 0.00018668174743652344, "__label__fashion_beauty": 0.0002294778823852539, "__label__finance_business": 0.00084686279296875, "__label__food_dining": 0.0003578662872314453, "__label__games": 0.0005435943603515625, "__label__hardware": 0.0010595321655273438, "__label__health": 0.0006351470947265625, "__label__history": 0.0006155967712402344, "__label__home_hobbies": 0.0001418590545654297, "__label__industrial": 0.0007333755493164062, "__label__literature": 0.001132965087890625, "__label__politics": 0.0004901885986328125, "__label__religion": 0.0007524490356445312, "__label__science_tech": 0.315673828125, "__label__social_life": 0.0002505779266357422, "__label__software": 0.0836181640625, "__label__software_dev": 0.5849609375, "__label__sports_fitness": 0.0002446174621582031, "__label__transportation": 0.0006966590881347656, "__label__travel": 0.0002906322479248047}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 26113, 0.01683]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 26113, 0.64949]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 26113, 0.91812]], "google_gemma-3-12b-it_contains_pii": [[0, 2089, false], [2089, 5286, null], [5286, 8749, null], [8749, 11638, null], [11638, 14787, null], [14787, 17991, null], [17991, 20954, null], [20954, 23476, null], [23476, 26113, null]], "google_gemma-3-12b-it_is_public_document": [[0, 2089, true], [2089, 5286, null], [5286, 8749, null], [8749, 11638, null], [11638, 14787, null], [14787, 17991, null], [17991, 20954, null], [20954, 23476, null], [23476, 26113, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 26113, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 26113, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 26113, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 26113, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 26113, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 26113, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 26113, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 26113, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 26113, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 26113, null]], "pdf_page_numbers": [[0, 2089, 1], [2089, 5286, 2], [5286, 8749, 3], [8749, 11638, 4], [11638, 14787, 5], [14787, 17991, 6], [17991, 20954, 7], [20954, 23476, 8], [23476, 26113, 9]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 26113, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-08
|
2024-12-08
|
65fcdc3d079d75a1916c300bc568f716f34df7c2
|
Operations Practice
The present-focused, future-ready R&D organization
There’s no one right way to organize R&D. But a set of core design principles can provide the flexibility R&D organizations need to outpace competitors.
by Anne Hidma, Sebastian Küchler, and Vendla Sandström
Across engineered industries, the explosion in software has increased product complexity by an order of magnitude. Along with rapidly evolving technologies, fast-changing consumer preferences, accelerated product cycles, and the practical realities of globalized operations and markets, R&D departments are under unprecedented strain. As product variation grows and product portfolios expand, updating existing products compounds the already heavy load R&D organizations bear.
Yet amid these 21st-century challenges, R&D units are still following 20th-century models of organization—models not designed for today’s need for speed and the expanding web of interdependencies among all of the moving parts. The traditional component-based approach to R&D is no longer sensible in an era when digital and electronic systems are so thoroughly integrated with hardware. Still many companies struggle to shift toward an approach that focuses more on the function the customer wants, rather than the components that make the desired function work.
There is no one right way to organize R&D. But there are certain fundamentals that can help R&D organizations in advanced industries act more responsively and meet the burgeoning challenges they face today. From our work with clients and our extensive research, we’ve distilled a set of core design principles for R&D organizations and identified the important ones. By following these principles, companies can help their R&D organization serve as engines of innovation for outpacing competitors. And they can foster the agility organizations need in supporting collaboration among remote, distributed teams—as has become more important than ever in response to unpredictable external events.
A growing mismatch between design and function
Determining the right structure for the R&D organization has never been easy. The division of responsibility is a balancing act between the project-management organization and the R&D line organization, with inevitable trade-offs. Today’s R&D teams don’t have the luxury of following a sequential, piece-by-piece approach in which finished, designed components are handed off to testing at the end. Moreover, the teams need to be appropriately protected from the external and internal disruptions that the broader organization experiences, which today come with greater frequency.
As they’ve grown organically, many R&D organizations continue to operate with the same structures and processes they’ve used for years. Despite (or perhaps because of) the increasing inadequacy of those structures and processes, organizations don’t follow them consistently. Pet projects are often hard to kill, even long after their diminished promise becomes apparent. And because research effectiveness is hard to measure—and companies often don’t understand R&D costs or ways of working—the black-box image persists without challenge.
Thus, adhering to an existing structure isn’t enough: the shifting demands, the sheer volume of work and the growing complexity (much of it the result of software integration) make it incumbent on R&D organizations to reappraise their design. Instead, they can create new mechanisms to provide the coordination, transparency, governance, and risk protection R&D needs in the digital era.
A set of winning design principles
In the ideal R&D organization, responsibilities are clearly established, and interfaces between and among teams (internal and external) are seamless and transparent. These requirements, although not new, have become even more important of late, particularly when more teams are working remotely. R&D organizations that fulfill them can better meet further requirements—managing complexity actively and efficiently while staying focused on the future, and also maintaining the tools and capabilities for adapting to change.
Clearly delineate responsibilities for systems and end-to-end work
Historically, the R&D function has been organized according to field of expertise, components, or location which has the effect of creating silos. Product properties are defined at the start of the development process, without being analyzed according to larger internal systems or user functions. Little attention is given to thinking in terms of the overarching goals customers want to achieve, or to the growing interdependencies as software and digital functions have pervaded almost every engineered product.
Many of the complications R&D organizations encounter today are the result of organizational interfaces that don’t match the product, along with a lack of transparency between groups. Take, for example, a feature such as lane assistance for vehicles. Developing further advances in this function depends on a high level of coordination among teams developing steering systems, brake systems, and electrical systems. But too often coordination occurs only late in design, perhaps even at the final testing phase, by which point addressing problems becomes expensive and time-consuming. R&D organizations are more effective when they shift their orientation from components to user function, while keeping platform development stable to ensure a core of commonly used modules.
With such a shift, assigning end-to-end responsibility for functionality has become imperative. Companies can assign responsibility for the complete product, as well as for the individual system layers, under the “V” model shown in Exhibit 1, which imposes oversight as ideas progress from concept through to market release, series development, and finally upgrades.
The process moves from left to right. Under “Conception,” individual systems and their associated software are defined to fit customer demands and budget. Through early testing in the development process, issues and challenges that coordination occurs only late in design, perhaps even the final testing phase, by which point addressing problems becomes expensive and time-consuming. R&D organizations are more effective when they shift their orientation from components to user function, while keeping platform development stable to ensure a core of commonly used modules.
With such a shift, assigning end-to-end responsibility for functionality has become imperative. Companies can assign responsibility for the complete product, as well as for the individual system layers, under the “V” model shown in Exhibit 1, which imposes oversight as ideas progress from concept through to market release, series development, and finally upgrades.
The process moves from left to right. Under “Conception,” individual systems and their associated software are defined to fit customer demands and budget. Through early testing in the development process, issues and challenges
become apparent early on. The right side of the V comprises testing and integration, which are conducted along the system layers. By breaking a product’s properties into requirements for systems and functions, the activities become transparent to everyone involved in development.
This approach enables iterative handshakes—more frequent interactions between concept owners and developers. Teams work together to translate properties into functional requirements. The approach also establishes dedicated responsibilities for complex functions and keeps the development process transparent. To coordinate and manage the interaction points, automotive companies tend to introduce central units that manage the whole integration process along the different development steps. These departments can be seen as a “stable backbone” within a dynamic development process, which helps improve planning for milestones and facilitates early failure detection. One machinery company, for example, set up quarterly integration meetings to align on priorities; the one to two days team members spend planning together gets them aligned for the next quarter’s work.
Perhaps the biggest benefit to assigning end-to-end responsibility is that it enables R&D to manage the interfaces and different development cycles between hardware and software development. Functionality owners coordinate the development of complex and interdependent components and features, creating technical guidelines and specifications that support consistency. They effectively safeguard the implementation and validate that the solution fulfills its requirements over its entire lifecycle.
**Keep functional interfaces across work sites to a minimum**
Companies can most effectively conceive of interfaces in terms of R&D’s geographic footprint—a balance taking into account which activities are performed where, and how the locations must interact. Minimizing functional interfaces across multiple sites and avoiding duplication of similar work are both important as well. Furthermore, to be cost-effective, location design can identify best-cost country sourcing for repetitive tasks, keeping in mind end-to-end responsibilities.
Dividing projects up among sites is usually less ideal, as people who work together in the same place tend to work more efficiently; earlier research found that with each additional development site for a given software product, productivity fell by about 14 percent (Exhibit 2.) Just the difference between one site and three sites amounts to a 37 percent decline in productivity.
Minimizing the number of handovers between sites—and making those that remain as smooth as possible—also helps. Distance between sites is not what matters; without the right management practices, a site across the city can seem as distant to employees as one clear across the country. But virtual teams can be as efficient as co-located teams, as long as the tools supporting the virtual work are utilized properly, communication is adapted accordingly, and everyone can participate on an equal basis.
R&D leaders can consider future roles and competencies when thinking about the physical design of the department. Where should the development of next-generation products start? How could a transition to new products be built for sites currently focused on legacy products? How will cost and availability figure into the overall network structure? The answers form a long-term site strategy that can help avert a talent crunch.
The right footprint model also builds in a detailed understanding of local requirements, such as interactions with suppliers, local regulations, and internally, the interdependencies with other departments or components. The sophistication of the design work, and the degree of conceptual work that will be done in a particular location, will inform the kind of competencies and technologies that will be needed. For example, one white-goods manufacturer carried out almost all development in its home market, later building a few local
development centers in key markets to help adjust the products for local preferences, such as for refrigerator and freezer sizes, configurations, and color schemes.
**Synchronize software and hardware development**
Complexity in all its forms has increased markedly—product variations alone have exploded over the past two to three decades, driven largely by the rise of embedded software and digital capabilities.
But R&D protocols often fail to account for the unique challenges of managing the development of integrated software and hardware. Software and hardware development follow different development cycles and require different approaches to project steering. And when digital features or components aren’t explicitly considered in milestone planning, integration problems and delays are almost inevitable.
As essential as synchronizing development may be, it isn’t easy. In automotive, for example, map software generally takes about a year to develop, with frequent updates, while apps or innovative vehicle-control features (such as autopilot) may be updated monthly, with ongoing development and improvement. Contrast these cycle times with the hardware that runs navigation systems (which take two to three years to design and build), vehicle platforms (about seven years in the making) and basic vehicle components, such as heating systems and airbags—mature components that typically have a 10-year lifespan.
With such wide disparities in cycle times, transparency becomes crucial. The lack of it is a problem not only in concept development, but in
---
**Exhibit 2:**
Fewer development sites means higher productivity.
Productivity decreases by ~14% per extra development site added
Complexity units per person-week, indexed
<table>
<thead>
<tr>
<th>1 site</th>
<th>2 sites</th>
<th>3 sites</th>
<th>4 sites</th>
<th>5 sites</th>
<th>6 sites</th>
</tr>
</thead>
<tbody>
<tr>
<td>100</td>
<td>76</td>
<td>63</td>
<td>57</td>
<td>52</td>
<td>48</td>
</tr>
</tbody>
</table>
1Based on McKinsey Numetrics database
delaying product launches as well. For complex functions, such as lane assistance, R&D units may have limited ability to measure how mature the product really is. When changes are made, teams may therefore fail to assess the implications on other features currently in development. Beyond cost overruns, delays, and risks to product integrity, poorly managed complexity invariably leads to finger-pointing among system teams as well as conflict between R&D and the project-management team.
R&D organizations have two options for managing the complexities of synching software and hardware development.
— Embedding software development within existing departments. This approach promotes integrated development—but in practice, processes are often designed from a hardware point of view, and software complexity is not managed effectively.
— Keeping development separate but coordinated. With this arrangement, individual technology components don’t get short shrift. The onus is on leaders to establish synchronization points to identify potential conflicts that would require escalation to senior management.
The approach to take is generally determined by the nature of the product, as well as the organization’s experience with software—bearing in mind that complexity will likely grow. Increasingly, services are developed not only within the engineering department but also within IT, creating still more interfaces and responsibilities, with implications for organization design.
**Strike a balance between old and new technologies**
When it comes to developing new technologies, R&D managers have three choices: segregate them completely in a separate unit; include them in the R&D organization, but keep them separate; or integrate them fully into the core R&D organization (Exhibit 3).
Segregating the current and new technologies has its advantages. Unfettered by standard processes, separated units are free to realize their full potential. The R&D organization keeps budgets separate and shields the new technology from the noise of existing projects.
But this option can be a hard sell to management, as creating a new unit can be costly, labor-intensive, and harder to absorb into the existing structure. Beyond the break-in time to adapt to existing products and processes, segregation also limits the broader organization’s ability to transfer capabilities and knowledge, particularly given that cutting-edge technologies call for special (at times rare) expertise and training time for employees.
Short of total separation, there are essentially two ways to include new technology development within the R&D organization. Integrating new technologies fully into the existing organization helps transfer knowledge, and lets the new part of the organization tap into existing capabilities and processes, all of which helps in reaching scale faster. However, in this arrangement, there are risks—new technologies could be prematurely quashed by senior management, or if developed according to current methodologies, could yield less-than-optimal results.
Most often, the best bet is a happy medium, in which new technologies are assigned to a separate team but explored within the current R&D organization (see sidebar, “An R&D makeover to sustain market leadership”).
The right approach is also a function of the situation and the culture. Consider the electric powertrain in the automotive industry—the different manufacturers offer a sample of all of the archetypes.
Exhibit 3: R&D departments can choose among three organizational archetypes for new-technology integration.
Classic R&D organization
- Ring-fence new technologies in separate unit (with separate budgets)
- Separation allows for full focus on new-technology development
- Easier to segregate because the new technologies are nearly independent of the current ones
Segregate the new
- Nucleus for new technologies is located within existing R&D organization
- New technologies are already linked to existing processes and systems because they're in the same organization
- Facilitates early knowledge transfer
Integrated new and old
- Development of existing and new technologies is fully integrated
- Existing processes and tools can be fully leveraged
- The new technologies must be important or have high potential in order to be relevant in existing organization
An R&D makeover to sustain market leadership
A global production-equipment manufacturer had long viewed its R&D organization as a crucial source of competitive advantage. But the company’s rapid growth and increasingly complex product portfolio meant that more products were being developed in parallel. That led to even greater specialization among engineers and more technical interdependencies across modules. As the number of engineers and management layers grew, so did the number and complexity of interfaces, threatening the company’s rapid growth.
Historically, R&D groups had been organized in two types of departments.
- System functions, which handled the functionalities that met system specs and customer requirements, such as for productivity and machine precision.
- Engineering functions, encompassing specialties such as electronics, mechanics, software, and environmental controls. These functions were required for developing the system modules and the system architecture needed for the integrity of the assembled machine.
Cutting complexity
As a first step in redesigning the R&D organization, R&D leaders made system function leaders responsible for tangible and testable machine modules. System leaders’ reports were given responsibility for the respective submodules. In that way, every production module and submodule would have a clear owner with end-to-end responsibility, from new-product introduction to third-line field-service support. Whereas before, each engineer worked on multiple products, under the new system each now works on only one business line and handles only one submodule at a time (Exhibit).
Exhibit:
Redesigning R&D clarifies ownership, enhances transparency, and reduces interfaces.
System-function departments are now primarily business-line dedicated. Each system function has a central architecture team that promotes commonality in the system modules’ roadmaps and the maximum reuse of module elements among business lines.
Engineering-function teams (such as software teams) are largely dedicated to modules or submodules. Leaders have the authority to deliver their technical roadmap with more stable, focused, and experienced people. Within each engineering function is a central architecture department that’s responsible for system design and standards (the left side of the V in Exhibit 1 in the main text) and for setting guardrails for module design and development. This structure also ensures integrity in the final product.
Responsive and future-ready
To maintain system integrity, shared platforms, and innovation- and knowledge-sharing across business lines, the company established several central teams. To manage competence (and continue building needed skills), the organization developed a taxonomy of critical competencies, assigned to VPs and managers and governed through an annual planning cycle.
The stable, multidisciplinary teams that characterize the new design have created a solid foundation for piloting and scaling agile ways of working in the product development teams. Since the launch of the new organization, more than 2,000 engineers have migrated to agile methods. But engineers aren’t the only ones working in new ways. By forging and executing the redesign as a team, R&D leaders have developed adaptive muscle, with the ability to adjust their organization to fast-changing requirements and environments.
To be future-ready, adopt new ways of working
The traditional waterfall development model that some organizations still follow is so protracted that products can be obsolete by the time they are released. Long development times become impracticable when businesses factor in the out-of-sync cycle times of software and hardware components. In addition, a siloed and fragmented organizational structure makes it hard to respond nimbly to new process requirements.
Fast-changing customer demands and rapidly evolving technologies have increased the premium for enterprises and their R&D organizations to be adaptable, flexible, and future-oriented. And the coordination, integration, and speed needed in R&D today call for new ways of working. These include agile methods that enable fast iterations and cross-functional, flexible teams that ensure that the concerns of all relevant stakeholders—people from different functional units, as well as the different engineering teams, project managers, and customer representatives—are addressed. For example, a team working on autonomous driving would include not only software engineers but also hardware engineers from the steering, brake-system, and overall car-design teams, as well as those working on user interface design.
To foster a future orientation within the R&D function, companies can adopt certain design features and practices, in particular those structures that promote agility:
- A flat organization in which teams are granted full responsibility to design solutions. This creates a strong sense of ownership among individuals
- End-to-end, cross-functional teams whose talent is drawn from all the relevant and traditional R&D functions. Often, teams are supported by individuals outside of R&D, such as marketing managers or customer representatives. Team membership is stable and changes only when projects are finished or strategic priorities change
The present-focused, future-ready R&D organization
— Pools of experts (both internal and external) that support projects with the talent they need
— Resource allocation that is flexible, shifting as needs change
— More co-location time for teams, wherever possible
— Role descriptions and rewards that align with the new organizational structure and targets
These practices usually suggest that the company might consider changing certain roles in the organization—particularly in light of the widespread need for more architects, as leaders are charged with empowering teams to foster innovation more than ever before. In fact, an automotive manufacturer saw its leadership transformation as a driving force for putting in place its new R&D organization.
A further question we are hearing is: how does all of this work in a remote working environment? The bulk of these practices can be implemented in a digitally enabled organization if co-location is not an option, with priority for practical matters such ensuring teams have sufficient bandwidth to connect as often as needed. Clear roles and targets will be especially important as well, as will an emphasis on empowering teams and individuals.
With ever-expanding product portfolios—from more product variation to additional software embedded in engineered products—R&D organizations tell us they are struggling to keep up pace. That makes the shift from a traditional, component-based approach to a functional all the more essential.
Change isn’t easy for this traditionally black-box area of the organization. Engineers themselves struggle with how to reengineer their own work processes, often not knowing where to start. To determine the right blueprint, it helps to step back and reflect on current performance and future needs by asking a few central questions:
— Do we have a clear way of addressing the complexity that comes from interfaces?
— How are we handling interdependencies between systems? Is complexity increasing, and if so, are we well set up for the future demands?
— Do we have what it takes to adapt to a larger proportion of software development in our R&D?
— Are we sufficiently agile and flexible to adjust our focus based on changing demand? Could we handle more frequent changes in demand?
— How prepared are we for future technologies? Do we have the right structure in place to acquire and scale them?
— Do we have sufficiently clear roles, interfaces, and end-to-end responsibilities within R&D between teams and sites and to other departments?
There is no master formula for making this shift—nor could there be, given the differences across industries and from organization to organization—but certain principles prevail. Abiding by the principles outlined here can provide a blueprint needed for integration at the right points, and the much-needed transparency across R&D. If R&D is the company’s engine of innovation, its own transformation is more than a matter of securing market share, it’s about being built for a fast-changing present in order to secure the future.
Anne Hidma is an associate partner in McKinsey’s Amsterdam office, where Vendla Sandström is a consultant, and Sebastian Küchler is a partner in the Munich office.
|
{"Source-Url": "https://www.mckinsey.com/~/media/McKinsey/Business%20Functions/Operations/Our%20Insights/The%20present%20focused%20future%20ready%20RD%20organization/the-present-focused-future-ready-rnd-organization.pdf", "len_cl100k_base": 4723, "olmocr-version": "0.1.53", "pdf-total-pages": 10, "total-fallback-pages": 0, "total-input-tokens": 22652, "total-output-tokens": 5111, "length": "2e12", "weborganizer": {"__label__adult": 0.000911235809326172, "__label__art_design": 0.0021457672119140625, "__label__crime_law": 0.0007081031799316406, "__label__education_jobs": 0.006549835205078125, "__label__entertainment": 0.00016689300537109375, "__label__fashion_beauty": 0.0004935264587402344, "__label__finance_business": 0.07537841796875, "__label__food_dining": 0.000957965850830078, "__label__games": 0.0012159347534179688, "__label__hardware": 0.003633499145507813, "__label__health": 0.00124359130859375, "__label__history": 0.0006098747253417969, "__label__home_hobbies": 0.0004684925079345703, "__label__industrial": 0.01161956787109375, "__label__literature": 0.0005679130554199219, "__label__politics": 0.0005540847778320312, "__label__religion": 0.0008268356323242188, "__label__science_tech": 0.0836181640625, "__label__social_life": 0.00020647048950195312, "__label__software": 0.0236358642578125, "__label__software_dev": 0.78076171875, "__label__sports_fitness": 0.0006241798400878906, "__label__transportation": 0.0023899078369140625, "__label__travel": 0.0004973411560058594}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 25988, 0.00489]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 25988, 0.14439]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 25988, 0.95485]], "google_gemma-3-12b-it_contains_pii": [[0, 282, false], [282, 4135, null], [4135, 7032, null], [7032, 11080, null], [11080, 13046, null], [13046, 16541, null], [16541, 17424, null], [17424, 19162, null], [19162, 22805, null], [22805, 25988, null]], "google_gemma-3-12b-it_is_public_document": [[0, 282, true], [282, 4135, null], [4135, 7032, null], [7032, 11080, null], [11080, 13046, null], [13046, 16541, null], [16541, 17424, null], [17424, 19162, null], [19162, 22805, null], [22805, 25988, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, false], [5000, 25988, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 25988, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 25988, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 25988, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 25988, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, true], [5000, 25988, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 25988, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 25988, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 25988, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 25988, null]], "pdf_page_numbers": [[0, 282, 1], [282, 4135, 2], [4135, 7032, 3], [7032, 11080, 4], [11080, 13046, 5], [13046, 16541, 6], [16541, 17424, 7], [17424, 19162, 8], [19162, 22805, 9], [22805, 25988, 10]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 25988, 0.0283]]}
|
olmocr_science_pdfs
|
2024-12-11
|
2024-12-11
|
8cb4287320b6857c0e6909d90e0418392db56874
|
Pointer Machines and Pointer Algorithms: an Annotated Bibliography
Amir M. Ben-Amram
September 4, 1995
Abstract
The term pointer machine has been used ambiguously in Computer Science literature. In this report we give precise definitions of several models that have been referred to as “pointer machines” and list references for each of these models under the appropriate heading.
1 Introduction
In a 1992 paper by Galil and the author we referred to a “pointer machine” model of computation. A subsequent survey of related literature has produced over thirty references to papers having to do with “pointer machines”, naturally containing a large number of cross-references. These papers address a range of subjects that range from the model considered in the above paper to some other ones which are barely comparable. The fact that such different notions have been discussed under the heading of “pointer machines” has produced the regrettable effect that cross references are sometimes found to be misleading. Clearly, it is easy for a reader who does not follow a paper carefully to misinterpret its claims when a term that is so ill-defined is used.
This report is an attempt to rectify the situation. It includes a presentation of the different notions that have appeared under the heading of “pointer machines,” meant to help in creating a common terminology which allows the necessary distinctions. Related references are listed following the presentation of each subject considered. We use the following conventions: within each of these lists, alphabetical order is used. The names of the authors are underlined for emphasis in some publications, which survey and discuss a collection of results about a subject, and thus may be of particular interest to the reader.
2 Abstract Machines: Atomistic Models
Abstract machines were introduced to Computer Science, at the first place, as a means of formalizing the notion of “algorithm”. The main example is the Turing Machine; another model introduced with this goal in mind is the Kolmogorov-Uspenskii machine, to be described in more detail below. Such machines have “input/output media,” conventionally described as tapes on which symbols from some finite alphabet are written: thus algorithms in this class compute functions from $\Sigma^*$, where $\Sigma$ is a finite alphabet, into $\Sigma^*$. The fact that this is common to all models has the following important consequences. First, it is possible to prove that all of them compute the same class of functions, thus giving supportive evidence to Church’s Thesis. Secondly, it is possible to compare the power of different models by studying the relationship between the complexity of problems on the different models, or the complexity of simulating one model by another.
The differences between the models are expressed in their internals, which are typically specified by a storage structure and a set of operations that can be put together to form a program. These operations include input/output operations, operations that modify or inspect the internal storage etc.
Much as the input/output language of these machines is the language of strings over a finite alphabet, so is it often desired that the internal operations of the machines have a “discrete” nature, since this seems to support the claim that they represent effective algorithms: this has been argued by Kolmogorov and Uspenskii (1958) as follows.
The mathematical notion of Algorithm has to preserve two properties...
1. The computational operations are carried out in discrete steps, where every step only uses a bounded part of the results of all preceding operations.
2. The unboundedness of memory is only quantitative: i.e., we allow an unbounded number of elements to be accumulated, but they are drawn from a finite set of types, and the relations that connect them have limited complexity.
Schönhage (1980) referred to abstract machines that have these properties as atomistic.
The form of storage suggested by Kolmogorov and Uspenskii as well as by Schönhage is a collection of nodes that are interconnected by pointers (these are Schönhage’s terms, which agree with programming practice). All machine models that have this type of storage structure can be described as atomistic pointer machines.
2.1 Kolmogorov-Uspenskii Machines
The Kolmogorov-Uspenskii model represents storage as an undirected finite graph, in which every edge is has one of a finite set of labels, and edges incident to the same node must have different labels. This naturally implies a finite bound on the degree of the graph. At any moment, one specific node is designated as the active node. The neighborhood of the active node of some fixed radius is called the active zone. In the original formulation, each step of the machine consists of applying a fixed transformation that maps every possible form of the active zone into a (generally different) subgraph that has the same “boundary” (so the rest of the storage graph remains accessible). For example, the active zone can be contracted, with the effect that nodes that were previously too far are pulled inside for inspection.
A more conventional programming formulation, which serves to bring this model under the common framework described above, defines a program to be a sequence of instructions that include the following types: unconditional branch, input, output, conditional branch and storage modification. The conditional branch instruction specifies two strings of labels, not longer than the radius of the active zone; the destination of the branch is determined by whether the two paths starting at the active node, and specified by the given labels, lead to the same node. A storage modification instruction can add a node, remove one, add or remove an edge.
The following papers introduce the model:
The following publications address the KUM specifically. Publications which address both the KUM and another model are listed later in this section.
2.2 Storage Modification Machines
The SMM model, introduced by Schönhage, differs from the KUM by representing storage as a directed finite graph; apart from that the description in the last paragraph applies. Schönhage did not include the requirement of a fixed radius for the active zone, but mentioned that this change may give a “more precise and realistic” measure of running time.
In contrast with KUMs, here the finite size of the set of labels only restricts the out-degree of nodes; an unbounded number of pointers may lead to a single node.
Observe that using a set of two distinct labels, i.e., nodes of out-degree two, any algorithm using a larger out-degree can be simulated with at most a constant factor loss in running time as well as in the number of nodes in storage. This is true for both the SMM and the KUM.
The following papers introduce the model:
The following publications address the SMM specifically.
The following publications address both the KUM and the SMM.
Y. Gurevich and S. Shelah, ”Nearly-linear time,” Proceedings, Logic at Botik ’89, Lecture Notes
See also Section 2.4.
### 2.3 Knuth’s Linking Automaton
The Linking Automaton was defined by Knuth (1968) as a model that may help to understand better the capabilities of algorithms that operate on linked structures. It is defined the same as the SMM except that every node has, in addition to the fixed number of outgoing pointers, also a fixed number of *value fields*. Each value field stores one symbol out of a given alphabet. The program has the capabilities of moving symbols around and of comparing value fields for equality of contents.
### 2.4 General Atomistic Pointer Machines
Shvachko (1991) suggested to study machines which operate on graphs, under different specifications of the class of allowable graphs. He mentions the KUM and SMM as particular examples, where the former is obtained by selecting undirected graphs of bounded degree and the latter by selecting directed graphs of bounded out-degree. In addition to these models, he considers “tree pointer machines.” These are naturally obtained by restricting the graphs to be bounded-degree trees. We remark that Shvachko applies the original programming style of Kolmogorov and Uspenskii for all the models he considers.
### 2.5 Jones’ I Language
An interesting observation on the “abstract machine” way of formalizing algorithms, is that once a programming language is defined, with proper semantics and cost functions
(to evaluate complexity), a computational model has been fully specified. In a model thus obtained, the notion of *algorithm* is identified with that of a *program*, and not of *machine*.
Jones (1993) took this approach, and presented two programming languages, $\mathcal{I}$ and $\mathcal{I}^{*u}$, that can be used as general computational models. He used denotational semantics; however, the natural choice of a model for operational semantics is, in the case of $\mathcal{I}^{*u}$, an SMM of out-degree two. This makes the $\mathcal{I}^{*u}$ model a programming-oriented alternative to the SMM. It only differs by the restriction of the out-degree (which could be easily relaxed), and the fact that the $\mathcal{I}^{*u}$ language is structured, while the SMM is programmed using *gotos*.
The $\mathcal{I}$ language is a restricted version of $\mathcal{I}^{*u}$: in this language, the destination of a pointer may only be set when the node it emanates from is created. In programming terms, it has a `cons` instruction but not a `setcar` or `rplaca` instruction (according to your favourite LISP dialect). This results in the memory graph being always acyclic. It is widely believed, that this makes the model weaker in an asymptotic sense, a conjecture that has not yet been proved.
### 3 Abstract Machines: High-Level Models
Recall that machines described in the last section only manipulate a single type of “values,” namely symbols from the chosen alphabet; sometimes only pointers are manipulated internally by the program, but in the case of atomistic machines, this does not make a substantial difference. Let us extend the framework by replacing the finite alphabet by an arbitrary set of data (e.g., the integers) which is furthermore structured (i.e., is the domain of some algebraic structure). Let us call this set our *domain* and further equip the model by a set of instructions for effecting various operations that are defined on elements of the domain (e.g., addition and subtraction of integers). All instructions will count as a single step in the calculation of time complexity. Consider the input and output operations too as transporting an arbitrary element of the domain in one step instead of a symbol from a finite set. In accordance with programming-language practice, we refer to the algebraic structure (domain + operations) as a *data type*.
We refer to a computational model thus obtained as a *high-level* machine: clearly, it does not belong to the atomistic class of Section 2, and thus the rich theory of computation developed for these models does not always apply. Moreover, models of different domains
compute functions out of different function spaces. It is thus not possible in general to compare such models for efficiency. However, it is quite possible if the models share the data type and only differ on “intrinsic” features such as the style of programming or the structure of memory. In this case, the comparison may tell us something about the role of the features involved.
The main justification for high-level models is that they are closer to the way computer algorithms are described and analyzed in practice. This position was advocated by Ben-Amram and Galil (1992). They also claimed that, to get closer to this goal, it is worthwhile to use models that reflect the capabilities of useful programming languages. In this vein they introduced two computational models called the $\mathcal{T}$-FLM (Full LISP Machine) and $\mathcal{T}$-PLM (Pure LISP Machine). In both cases, $\mathcal{T}$ stands for the data type. The $\mathcal{T}$-FLM is similar to the SMM, with the extensions that pointers point either to storage nodes (which have an out-degree of two, as in LISP structures) or to domain elements, called atoms. The $\mathcal{T}$-PLM is a restricted version of the $\mathcal{T}$-FLM. In the PLM, nodes are created by a cons instruction, that pairs to given pointers; these pointers cannot be redirected at any later time. This restriction originates from the subset of the LISP language known as pure LISP; it has advantages in terms of simple semantics and efficient implementation. However, it is widely conjectured to be weaker than the full model. The name LISP Machine (LM) is used in that paper when the distinction between the two models may be neglected.
Some additional results on the relationship of LISP machines to random access machines are reported in
4 Parallel Pointer Machines
As in the case of sequential models, there are different models of parallel computation that have been described as parallel pointer machines. On the other hand, it also happened that different names were used for models which are essentially the same. As in the preceding sections, we use, for each model, a unique name, avoiding the ambiguous “parallel pointer machine.”
4.1 Atomistic Models
4.1.1 Pulsing Automata
This model can be described as a network of synchronous concurrent automata, that constitutes a directed graph of bounded degree. In every time step, every node \( \nu \) modifies the destinations of its outgoing pointers, as well as its internal state, according to the states of the automata in its \( l \)-neighborhood, i.e., nodes reachable from \( \nu \) by a chain of at most \( l \) pointers. The radius of the neighborhood as well as the number of states of every automaton are parameters of the particular network. Note that the network does not change its size: automata cannot be created and do not disappear during computation.
The following publications address this model.
4.1.2 Growing Pulsing Automata
This model differs from the previous in that an automaton has the capability of forking, i.e., creating a new node, at each step. Thus the network may grow over time.
The following publications all address this model (using three different names: the above, HMM and PPM).
4.1.3 Associative Storage Modification Machines
This model is based on the SMM. It only has one thread of control, that is, one active node, and incorporates parallelism by supporting instructions that affect many nodes in parallel. The idea is that of an associative content-addressable memory (hence the name). In such a memory system, it is possible to perform certain operations, in parallel, on all memory cells that contain a certain value. In the ASMM, this is achieved by using reverse directions. Recall that in SMM instructions, nodes are specified by a sequence of labels that describes a path from the active node. In the ASMM, certain instructions allow part of the label sequence to be marked “reverse,” and this allows us to perform operations such as: “for all nodes $C$ that point to $A$, set a certain pointer from $C$ to $B$” or “for all such $C$, create a new node connected to $C$.” This way an exponential amount of nodes can be created in linear time, and various operations can be implemented in an efficient parallel way. Tromp and van Emde Boas (1993) proved that this model belongs to the so-called second machine class, consisting of those models that accept in (deterministic or non-deterministic) polynomial time precisely the languages of the Turing machine class PSPACE.
4.2 High-Level Models
I know of only one parallel model that manipulates linked structures with non-atomic contents. This model is analogous to the PRAM model, except that the shared storage is a directed graph, as in the high-level LISP machines. Processors can access this graph via pointers and perform the standard manipulations. As for the PRAM, variants of the model are obtained by allowing or disallowing common access to a node for changing its contents or just for reading it. Goodrich and Kosaraju give an algorithm for sorting on such a machine. This is a comparison sort, and so their requirements on the data type are rather humble; it has only to admit a comparison operation.
5 Pointer Algorithms
5.1 Definition
When a class of problems is too hard to analyse in the most general fashion, one often chooses to concentrate on a particular means of solution that is natural for the problems at hand, and study the capabilities of this means in isolation. A well-known example is the study of comparison algorithms. In this area, we ask for the number of comparison operations that are necessary for solving certain order-related problems (e.g., sorting). We thus assume that the data are amenable to pairwise comparisons, and that the algorithm only uses information gained by such comparisons. We ignore any other work that a program, implementing this algorithm, might have to perform.
The study of pointer algorithms falls into the same framework. Here the problems we are interested at may be generally described as data-structure problems. A primary example, and the one first considered in this framework, is the maintenance of disjoint sets. In this problem, the data structure represents a collection of disjoint, named subsets of some universe $U$. Operations include the query: given an element of $U$, what set contains it (known as find) and various update operations, such as merging two sets into one (known as union).
A common representation for such structures is a directed graph, including a node for every element and set name, such that it is possible to go from an element to its set name by following directed arcs\(^1\). This graph could be implemented as a network of records in memory with the arcs represented by pointers from one record to another; however, we are not interested in implementation details. Instead, let us assume that our data structure is a graph of the above kind; we can then ask for the complexity of performing data-structure operations as measured by the number of modifications, or accesses, to the graph.
We thus define the class of pointer algorithms as algorithms for performing some given data structure operations on a graph representation of the structure. Clearly, the concrete relationship of the graph to the represented structure has to be defined specifically for each problem; in the example of disjoint-set maintenance problems, we require each element as well as set-name to be represented by a node. In general this relationship should be of such nature that the data-structure operations accept pointers to nodes in the graph as input and deliver their output in form of such pointers. For instance, the find operation accepts a pointer to a node that represents an element and has to deliver a pointer to the node that represents the appropriate set name. Note that sometimes there is more than
---
\(^1\)We use the term arc for a directed graph while edge is used for undirected graphs.
one input pointer (e.g., two pointers are input for a union); and sometimes there is more than one output (as in a query that reports all elements satisfying some condition). To measure the time complexity of a pointer algorithm we consider the number of arcs followed by the algorithm, i.e., the length of the shortest (possibly branching) paths leading from the set of input nodes up to every member of the set of output nodes. To this we add the number of arcs added to or removed from the graph during the operation. Note that, while a particular algorithm may traverse the same arc more than once, we only count the number of arcs used for the cost of the algorithm. This may underestimate the cost of an algorithm, but such underestimation is inherent in the use of this kind of model, and it turns out that tight lower bounds are nonetheless obtained for various problems. Space complexity is sometimes measured by the number of nodes in the graph.
An even more precise way of defining this model is as an implementation of a given abstract data structure (e.g., a union-find structure) by means of the abstract data structure directed graph. We impose the restriction that the abstract data types “element” and “set name” must be implemented as the data type “pointer to node”. The abstract data structure graph provides a well-defined set of operations: add node, add pointer, get pointer and delete pointer. The time complexity of the implementation is defined by the number of these operations, and the space by the number of add node operations.
Let us compare the pointer-algorithm model (or more generally, the isolated-means-of-solution approach) with the abstract machine approach to computational complexity of problems. An essential characteristic of the abstract machine approach is the machine-independent representation of the problem, as a function over strings, integers etc. This machine-independence allows us to ask for the complexity of the same problem on different models and in fact to compare different models for their power.
To contrast, in the pointer-algorithm model the problem definition is all but machine independent: in fact, it makes use of pointers, an entity which has no external representation. The fact that input and output are given as pointers is essential to the model; for instance, consider a union-find structure representing \( n \) singleton sets, so that there are \( n \) nodes that represent set names. If a node’s name had to be given to the find procedure in an external representation, say a string or a number, and the procedure only maintains a finite number of pointer variables, then \( \Omega(\log n) \) arcs would have to be followed in most cases just to locate the desired set-name node.
Thus such algorithms are a natural model only for data-structure problems, where we may assume that the procedures we consider are intended for use by a “client” program: this program may obtain a pointer from one procedure call and at a later time pass it to the next. In fact, this “client” may even be the one that supplies the pointers in the first place: think of a program that manages a set of records which, among other uses, have to
be organized in a union-find structure. The requirements of this user naturally call for a pointer algorithm.
We finally remark that, except as noted below, it is assumed that the out-degree of the graph is bounded by a constant independent of the problem instance (for example, it cannot be a function of the number of elements). We call this the fixed degree requirement.
5.2 Separable Pointer Algorithms
In the context of the disjoint set maintenance problem a special type of pointer algorithms has been considered, known as separable pointer algorithms. This class of algorithms is defined by imposing the separability condition: after every operation is completed, the graph can be partitioned into disjoint subgraphs that correspond to the current disjoint sets. The subgraph corresponding to a given set contains the node for its name. No edge leads from one subgraph to another.
It turns out that for such algorithms tight lower bounds may be obtained even if the fixed degree requirement is omitted. Therefore, the class of separable pointer algorithms is defined without this requirement.
We remark that it is in this framework that pointer algorithms have been first studied (Tarjan, 1979).
5.3 References
5.3.1 References Involving Disjoint Set Union Problems
Many of the publications on pointer algorithms have to do with the set-union problem in various variations. We group all of these in the following list. In this list, we mark publications with the acronyms PA or SPA to indicate whether they apply to (degree bounded) pointer algorithms or to separable pointer algorithms. A. Apostolico, G. Gambosi, G. F. Italiano and M. Talamo, “The set union problem with unlimited backtracking,” SIAM J. Comput. 23:1 (1994), 50–70. (SPA)
N. Blum and H. Rochow, “A lower bound on the single-operation worst-case time complexity of the union-find problem on intervals,” manuscript. (SPA)
H. Mannila and E. Ukkonen, “Time parameter and arbitrary reunions in the set union problem,” Proc. 1st Scandinavian Workshop on Algorithm Theory (SWAT) 1988, LNCS 318, Springer, Berlin, 34–42. (PA & SPA; remark — Section 2 of this paper applies to PA, although the other term is used).
5.3.2 Other References
The following papers consider (non-separable) pointer algorithms in conjunction with other data-structure problems.
Acknowledgement
The following people have contributed references for this bibliography: Stavros Kolliopoulos, Michael C. Loui.
|
{"Source-Url": "http://repository.readscheme.org/ftp/papers/topps/D-252.pdf", "len_cl100k_base": 5181, "olmocr-version": "0.1.50", "pdf-total-pages": 13, "total-fallback-pages": 0, "total-input-tokens": 59942, "total-output-tokens": 7642, "length": "2e12", "weborganizer": {"__label__adult": 0.0005660057067871094, "__label__art_design": 0.0005555152893066406, "__label__crime_law": 0.0005478858947753906, "__label__education_jobs": 0.0016164779663085938, "__label__entertainment": 0.0001885890960693359, "__label__fashion_beauty": 0.0003123283386230469, "__label__finance_business": 0.0003750324249267578, "__label__food_dining": 0.0006742477416992188, "__label__games": 0.0009312629699707032, "__label__hardware": 0.0019664764404296875, "__label__health": 0.0016317367553710938, "__label__history": 0.0006146430969238281, "__label__home_hobbies": 0.0002007484436035156, "__label__industrial": 0.0008311271667480469, "__label__literature": 0.0013475418090820312, "__label__politics": 0.0005049705505371094, "__label__religion": 0.001140594482421875, "__label__science_tech": 0.3017578125, "__label__social_life": 0.00017344951629638672, "__label__software": 0.007175445556640625, "__label__software_dev": 0.6748046875, "__label__sports_fitness": 0.0004608631134033203, "__label__transportation": 0.0011119842529296875, "__label__travel": 0.0002503395080566406}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 29870, 0.04471]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 29870, 0.59367]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 29870, 0.91826]], "google_gemma-3-12b-it_contains_pii": [[0, 1785, false], [1785, 4308, null], [4308, 6653, null], [6653, 8630, null], [8630, 10565, null], [10565, 13333, null], [13333, 15709, null], [15709, 17697, null], [17697, 20052, null], [20052, 22837, null], [22837, 26040, null], [26040, 28088, null], [28088, 29870, null]], "google_gemma-3-12b-it_is_public_document": [[0, 1785, true], [1785, 4308, null], [4308, 6653, null], [6653, 8630, null], [8630, 10565, null], [10565, 13333, null], [13333, 15709, null], [15709, 17697, null], [17697, 20052, null], [20052, 22837, null], [22837, 26040, null], [26040, 28088, null], [28088, 29870, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 29870, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 29870, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 29870, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 29870, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 29870, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 29870, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 29870, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 29870, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 29870, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 29870, null]], "pdf_page_numbers": [[0, 1785, 1], [1785, 4308, 2], [4308, 6653, 3], [6653, 8630, 4], [8630, 10565, 5], [10565, 13333, 6], [13333, 15709, 7], [15709, 17697, 8], [17697, 20052, 9], [20052, 22837, 10], [22837, 26040, 11], [26040, 28088, 12], [28088, 29870, 13]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 29870, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-02
|
2024-12-02
|
bfe579ab0fb5bfb261399aa35af1cbd5af3e96c7
|
CSCI-GA.3033-004
Graphics Processing Units (GPUs): Architecture and Programming
CUDA
Advanced Techniques 3
Mohamed Zahran (aka Z)
mzahran@cs.nyu.edu
http://www.mzahran.com
Some slides are used and slightly modified from:
NVIDIA teaching kit
In This Lecture …
• Error Handling
• More about performance
• A common parallel pattern
• Atomic instructions in CUDA
• Memory Fencing
• Computational thinking 101
• A Full Example
Error Handling in CUDA
__global__ void foo(int *ptr)
{
*ptr = 7;
}
int main(void)
{
foo<<<1,1>>>(0);
return 0;
}
Error Handling
• In a CUDA program, if we suspect an error has occurred during a kernel launch, then we must explicitly check for it after the kernel has executed.
• CUDA runtime will respond to questions... But won’t talk without asked!
cudaError_t cudaGetLastError(void);
• Called by the host
• returns a value encoding the kind of the last error it has encountered
• check for the error only after we're sure a kernel has finished executing → don't forget kernel calls are async!
– What will you do?
```c
#include <stdio.h>
#include <stdlib.h>
__global__ void foo(int *ptr)
{
*ptr = 7;
}
int main(void)
{
foo<<<1,1>>>(0);
// make the host block until the device is finished with foo
cudaDeviceSynchronize();
// check for error
cudaError_t error = cudaGetLastError();
if(error != cudaSuccess)
{
// print the CUDA error message and exit
printf("CUDA error: %s\n", cudaGetErrorString(error));
exit(-1);
}
return 0;
}
```
Same Technique with Synchronous Calls
cudaError_t error = cudaMalloc((void**)&ptr, 100000000000);
if(error != cudaSuccess)
{
// print the CUDA error message and exit
printf("CUDA error: %s\n", cudaGetErrorString(error));
exit(-1);
}
The output will be:
CUDA error: out of memory
Rules of Thumb
• Do not use `cudaDeviceSynchronize()` a lot in your code because it has a large performance penalty.
• You can enable it during debugging and disable it otherwise.
```c
#ifdef DEBUG
cudaThreadSynchronize();
cudaError_t error = cudaGetLastError();
if(error != cudaSuccess)
{
printf("CUDA error at %s:%i: %s\n", filename, line_number, cudaGetErrorString(error));
exit(-1);
}
#endif
```
If debugging, compile with:
```
$ nvcc -DDEBUG mycode.cu
```
More About Performance
Hardware configuration can be safely ignored when designing a software for correctness but must be considered in the code structure when designing for peak performance.
Some Insights About Performance
Throughput
Latency
Occupancy
Utilization
It is a common belief that ...
• More threads is better
– because it needs more threads to hide latency
But is it always true?
CUDA Basic Linear Algebra Subroutines
### Multiplication of two large matrices, single precision (SGEMM):
<table>
<thead>
<tr>
<th></th>
<th>CUBLAS 1.1</th>
<th>CUBLAS 2.0</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>Threads per block</td>
<td>512</td>
<td>64</td>
<td>8x smaller thread blocks</td>
</tr>
<tr>
<td>Occupancy (G80)</td>
<td>67%</td>
<td>33%</td>
<td>2x lower occupancy</td>
</tr>
<tr>
<td>Performance (G80)</td>
<td>128 Gflop/s</td>
<td>204 Gflop/s</td>
<td>1.6x higher performance</td>
</tr>
</tbody>
</table>
### Batch of 1024-point complex-to-complex FFTs, single precision:
<table>
<thead>
<tr>
<th></th>
<th>CUFFT 2.2</th>
<th>CUFFT 2.3</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>Threads per block</td>
<td>256</td>
<td>64</td>
<td>4x smaller thread blocks</td>
</tr>
<tr>
<td>Occupancy (G80)</td>
<td>33%</td>
<td>17%</td>
<td>2x lower occupancy</td>
</tr>
<tr>
<td>Performance (G80)</td>
<td>45 Gflop/s</td>
<td>93 Gflop/s</td>
<td>2x higher performance</td>
</tr>
</tbody>
</table>
Latency Vs Throughput
• Latency (how much time) is time
– instruction takes 4 cycles per warp
– memory takes 400 cycles
• Throughput (how many operations per cycle or second) is rate
– Arithmetic: $1.3 \text{Tflop/s} = 480 \text{ ops/cycle}$ (op=multiply-add)
– Memory: $177 \text{ GB/s} \approx 32 \text{ ops/cycle}$ (op=32-bit load)
Hiding Latency is ...
- Doing other operations while waiting
- This will make the kernel runs faster
- **But** not at the peak performance
What can we do??
Little's Law
Needed parallelism = Latency x Throughput
### Examples from GPU
<table>
<thead>
<tr>
<th>GPU model</th>
<th>Latency (cycles)</th>
<th>Throughput (cores/SM)</th>
<th>Parallelism (operations/SM)</th>
</tr>
</thead>
<tbody>
<tr>
<td>G80-GT200</td>
<td>≈24</td>
<td>8</td>
<td>≈192</td>
</tr>
<tr>
<td>GF100</td>
<td>≈18</td>
<td>32</td>
<td>≈576</td>
</tr>
<tr>
<td>GF104</td>
<td>≈18</td>
<td>48</td>
<td>≈864</td>
</tr>
</tbody>
</table>
- **Average latency of a computational operation**
- **Less operations means idle cycle**
So …
• Higher performance does not mean more threads but higher utilization
• Utilization is related to parallelism
• We can increase utilization by
– increasing throughput
• Instruction level parallelism
• Thread level parallelism
– decreasing latency
Occupancy is not utilization, but one of the contributing factors.
__global__ void MyKernel(int *d, int *a, int *b) {
int idx = threadIdx.x + blockIdx.x * blockDim.x;
d[idx] = a[idx] * b[idx];
}
int main() {
int numBlocks;
int blockSize = 32;
int device;
cudaDeviceProp prop;
int activeWarps;
int maxWarps;
cudaGetDevice(&device);
cudaGetDeviceProperties(&prop, device);
cudaOccupancyMaxActiveBlocksPerMultiprocessor(
&numBlocks,
MyKernel,
blockSize,
0);
activeWarps = numBlocks * blockSize / prop.warpSize;
maxWarps = prop.maxThreadsPerMultiProcessor / prop.warpSize;
}
CUDA Occupancy and MAX Active Blocks Per Multiprocessor
- From CUDA 6.5
- Produces an occupancy prediction based on:
- the block size
- shared memory usage of a kernel
- Reports occupancy in terms of the number of concurrent thread blocks per multiprocessor
- Don’t forget: it is just a prediction!
- Arguments:
1. pointer to an integer (where #blocks will be reported)
2. kernel
3. block size
4. dynamic shared memory per block in bytes
How about memory?
maximizing overall memory throughput for the application
= minimize data transfers with low bandwidth
host $\leftrightarrow$ device
Global mem access
This means ... Typically
1. Load data from device memory to shared memory.
2. Synchronize with all the other threads of the block so that each thread can safely read shared memory locations that were populated by different threads.
3. Process the data in shared memory.
4. Synchronize again if necessary to make sure that shared memory has been updated with the results.
5. Write the results back to device memory.
But accessing global memory is a necessary evil ... So:
- Can we apply the same technique (i.e. Little’s law) to memory?
Needed parallelism = \textbf{Latency} \times \textbf{Throughput}
<table>
<thead>
<tr>
<th>Latency</th>
<th>Throughput</th>
<th>Parallelism</th>
</tr>
</thead>
<tbody>
<tr>
<td>Arithmetic</td>
<td>\approx 18 cycles</td>
<td>32 ops/SM/cycle</td>
</tr>
<tr>
<td>Memory</td>
<td>< 800 cycles (?)</td>
<td>< 177 GB/s</td>
</tr>
</tbody>
</table>
This means that to hide memory latency you need to keep 100KB in flight. But less if the kernel is compute bound!
How Can You Get 100KB From Threads?
• Use more threads
• Use more instructions per thread
• Use more data per thread
A Common Parallel Pattern
Histogram
In a Nutshell
• **Important and very useful computation:**
- For each element in the data set, use the value to identify a “bin counter” to increment.
• **A good example for understanding output interference in parallel computation**
Example
- Define the bins as four-letter sections of the alphabet: a-d, e-h, i-l, n-p, ...
- For each character in an input string, increment the appropriate bin counter.
- In the phrase “Programming Massively Parallel Processors” the output histogram is shown below:
Implementation 1
• Partition the input into sections
• Have each thread to take a section of the input
• Each thread iterates through its section.
• For each letter, increment the appropriate bin counter
Implementation 1
programming
massively
parallel processors
Thread 0
Thread 1
Thread 2
Thread 3
0 0 0 3 0 0 0 0
a-d e-h i-l m-p q-t u-x y-z
Evaluation of Implementation 1
- Possible collision
- Poor memory access efficiency:
- Adjacent threads do not access adjacent memory locations
- Accesses are not coalesced
- DRAM bandwidth is poorly utilized
Implementation 2
• Interleaved partitioning:
– All threads process a contiguous section of elements
– They all move to the next section and repeat
Implementation 2
programming massively parallel
Thread 0 Thread 1 Thread 2 Thread 3
0 1 0 2 1 0 0
a-d e-h i-l m-p q-t u-x y-z
Evaluation of Implementation 2
+ Better memory access patterns
- Still possibility of collision due to data races
Implementation 3
- We need to deal with data races:
- read-modify-write operations
\[
\begin{align*}
\text{thread 1: } & \quad \text{Old} \leftarrow \text{Mem}[x] \\
& \quad \text{New} \leftarrow \text{Old} + 1 \\
& \quad \text{Mem}[x] \leftarrow \text{New}
\end{align*}
\]
\[
\begin{align*}
\text{thread 2: } & \quad \text{Old} \leftarrow \text{Mem}[x] \\
& \quad \text{New} \leftarrow \text{Old} + 1 \\
& \quad \text{Mem}[x] \leftarrow \text{New}
\end{align*}
\]
Implementation 3
• We need atomic operation for read-modify-write.
• A read-modify-write operation performed by a single hardware instruction on a memory location address
– Read the old value, calculate a new value, and write the new value to the location
• The hardware ensures that no other threads can perform another read-modify-write operation on the same location until the current atomic operation is complete
– Any other threads that attempt to perform an atomic operation on the same location will typically be held in a queue
– All threads perform their atomic operations serially on the same location
Implementation 3
• Atomic operations in CUDA
– Atomic add, sub, inc, dec, min, max, exch (exchange)
– CAS (compare and swap)
• 3 args: address, compare, val
• reads a value from address (old value)
• compute: Old = compare ? val : old
• Example:
– int atomicAdd(int* address, int val);
– unsigned int atomicAdd(unsigned int* address, unsigned int val);
– atomicSub, atomicExch, atomicMin, ... atomicAnd, AtomicOr, ...
• atomicAdd for double precision floating-point numbers requires CC 6.0 or higher
__global__ void histo_kernel(unsigned char *buffer, long size, unsigned int *histo)
{
int i = threadIdx.x + blockIdx.x * blockDim.x;
// stride is total number of threads
int stride = blockDim.x * gridDim.x;
// All threads handle blockDim.x * gridDim.x
// consecutive elements
while (i < size) {
int alphabet_position = buffer[i] - "a";
if (alphabet_position >= 0 && alphabet_position < 26)
atomicAdd(&histo[alphabet_position/4]), 1);
i += stride;
}
}
Evaluation of Implementation 3
+ No data race
+ Coalesced memory access
- Performance loss due to serialization
Implementation 4
Privatization
Heavy contention and serialization
Much less contention and serialization
Copy 0 Copy 1 ... Copy N
Final Copy
Atomic Updates
Final Copy
Much less contention and serialization
Implementation 4
- Privatization: a very important use case for shared memory
- Cost
- Overhead for creating and initializing private copies
- Overhead for accumulating the contents of private copies into the final copy
- Benefit
- Much less contention and serialization in accessing both the private copies and the final copy
- The overall performance can often be improved more than 10x
• Create private copies of the histo[] array for each thread block
__global__ void histo_kernel(unsigned char *buffer,
long size, unsigned int *histo)
{
__shared__ unsigned int histo_private[7];
if (threadIdx.x < 7) histo_private[threadIdx.x] = 0;
__syncthreads();
Initialize the bin counters in the private copies of histo[]
int i = threadIdx.x + blockIdx.x * blockDim.x;
// stride is total number of threads
int stride = blockDim.x * blockDim.x;
while (i < size) {
atomicAdd( &(private_histo[buffer[i]/4]), 1);
i += stride;
}
Build the private histogram
Implementation 4
// wait for all other threads in the block to finish
__syncthreads();
if (threadIdx.x < 7) {
atomicAdd(&histo[threadIdx.x],
private_histo[threadIdx.x]);
}
Build the final histogram
About Privatization
- Privatization is a powerful and frequently used technique for parallelizing applications.
- The operation needs to be associative and commutative.
- The private histogram size needs to be small:
- Fits into shared memory.
- What if the histogram is too large to privatize?
- Sometimes one can partially privatize an output histogram and use range testing to go to either global memory or shared memory.
What we learned from the histogram example
• **Atomic operations** may be needed → sacrificing some performance for correctness
• **Privatization** can sometimes reduce the performance loss due to serialization caused by atomic operations.
Atomic Operations in CUDA
Definition
An atomic function performs a read-modify-write atomic operation on one 32-bit or 64-bit word residing in global or shared memory.
**Atomic** = guaranteed to be performed without interference from other threads = no other thread can access this address until the operation is complete
Atomic functions can only be used in device functions.
Atomic Operations Do not Imply:
- synchronization
- ordering constraints for memory operations
Be Careful
• **Before CC < 6.x**
– Atomic operations done from the GPU are atomic only with respect to that GPU.
– *GPU*'s atomic operation to a peer *GPU*'s memory appears as a regular read followed by a write to the peer GPU, and the two operations are not done as one single atomic operation.
– Atomic operations from the GPU to CPU memory will not be atomic with respect to the CPU.
Be Careful
- From CC 6.x:
- New type of atomics which allows developers to **widen or narrow the scope** of an atomic operation
- Example “widen”: `atomicAdd_system` guarantees that the instruction is atomic with respect to other CPUs and GPUs in the system.
- Example “narrow”: `atomicAdd_block` implies that the instruction is atomic only with respect to atomics from other threads in the same thread block.
atomicCAS(int *p, int cmp, int y)
Compare And Swap
atomic
{
if (*p == cmp)
*p = y;
return *p;
}
Instead of int, you can use unsigned, long, long long, float, double, ... .
int atomicOP(int *p, int v)
atomic
{
int old = *p;
*p = old OP v;
return old;
}
OP can be:
• Add
• Sub
• Min
• Max
• Inc \[*p = (old \geq v) ? 0 : (old+1)]\]
• Dec \[*p = (old \geq v) ? 0 : (old-1)]\]
• And
• Or
• Xor
Instead of int, you can use unsigned, long, long long, float, double, ... .
int atomicExch(int *p, int v)
atomic
{
int old = *p;
*p = v;
return old;
}
Instead of int, you can use unsigned, long, long long, float, double, ... .
Memory Fencing
Suppose that:
Thread 1 executes this
And
Thread 2 executes this
Q: What are the possible values that A and B can take?
A: In strongly-ordered memory model we have 3 possibilities:
• A = 1 B = 2
• A = 10 B = 2
• A = 10 B = 20
But in a weakly-ordered memory model, beside the above possibilities thread 2 can see:
• A = 1 B = 20
CUDA Memory Model
- The CUDA programming model assumes a device with a weakly-ordered memory model.
**Definition**: the order in which a CUDA thread writes data to shared memory, global memory, page-locked host memory, or the memory of a peer device is not necessarily the order in which the data is observed being written by another CUDA or host thread.
How to deal with this situation?
Executed by a thread
A = ....
B = ....
C = ...
Memory fence
X = ....
Y = ....
Z = ....
Ensures that:
1) All writes to all memory made by the calling thread before the fence are observed by all threads as occurring before all writes to all memory made by the calling thread after the fence.
2) All reads from all memory made by the calling thread before the fence are ordered before all reads from all memory made by the calling thread after the fence.
Three Flavors of Fencing
void __threadfence_block();
Ensures 1) and 2) for threads in the same block.
void __threadfence();
Ensures 1) and 2) for all threads in the block and ordered writes (before/after fence) for all threads in the device.
void __threadfence_system();
For all peer devices and CPUs.
Computational Thinking 101
Computational Thinking is arguably the most important aspect of parallel Application development!
J. Wing Communications of the ACM, 49(3), 2006
What is it?
Decomposing a domain problem into well-defined, coordinated work units that can Each be realized with different numerical methods and well-known algorithms.
Why Do We Need Parallel Computing in the First place?
To solve a given problem in less time
To solve bigger problems
To achieve better solutions for a given problem and a given amount of time
Applications that are good candidates for parallel computing:
• Involve large problem sizes
• Involve high modeling complexity
Formulating the problem is crucial!!
The problem must be formulated in a such a way that it can be decomposed into subproblems that can be executed in parallel.
The Process of Parallel Programming
1. Problem decomposition
2. Algorithm selection
3. Implementation in a language
4. Performance tuning
This is what we have been doing till now!
Problem Decomposition
Identify the work to be performed by each unit of parallel execution \rightarrow thread in CUDA
Problem Decomposition: Thread Arrangement
Example: Electrostatic Map Problem
Atom-centric: each thread responsible for calculating the effect of one atom on all grid points → Scatter
Grid-centric: each thread calculates the effect of all atoms on a grid point → Gather
Which is better?
- Gather is desirable
- Threads can accumulate their results in their private registers.
- Multiple threads share input atom values.
Problem Decomposition
• Picking the best thread arrangement requires the understanding of the underlying hardware.
• A real application consists of several modules that work together
– Amount of work per module can vary dramatically
– You need to decide if a module is worth implementing in CUDA
• Amdahl’s law
Algorithm Selection
• An algorithm must exhibit three essential properties:
– definiteness = no ambiguity
– effective computability = each step can be carried by a computer
– finiteness = guaranteed to terminate
• When comparing several algorithms, take the following factors into account:
– Steps of computation
– Degree of parallel execution
– Numerical stability
– Memory bandwidth
Skills needed to go from: Parallel Programmer to: Computational Thinker
- Computer Architecture
- Programming models and compilers
- Algorithmic techniques: (e.g. tiling)
- Domain knowledge
So
- Computational thinking is an art but a very crucial one.
- Jumping from problem definition to coding right away is the worst thing you can do!
A Full Example
What will we do?
We will pick a problem, **analyze** it, and see how it can be **written** and **optimized** for **GPU**.
- Minimize memory access
- Minimize thread divergence
- Fully parallelized
An N-body simulation numerically approximates the evolution of a system of bodies in which each body continuously interacts with every other body.
Frames from an Interactive 3D Rendering of a 16,384-Body System
N-Body Problem
• Manifests itself in many domains: physics, astronomy, electromagnetics, molecules, etc.
• N points
• The answer at each point depends on data at all the other points
• $O(n^2)$
• To reduce complexity: compress data of groups of nearby points
– A well-known algorithm to do this: Barnes Hut
Challenges of CUDA Implementation of Barnes Hut
• Repeatedly builds and traverse an irregular tree-based data structure.
• Performs a lot of pointer-chasing memory operations.
• Typically expressed recursively.
• Results in thread divergence
• Many slow uncoalesced accesses
• Must use iterations
Barnes Hut n-Body Algorithm
Divided into 3 steps
1. Building the tree - $O(n \times \log n)$
2. Computing cell centers of mass - $O(n)$
3. Computing Forces - $O(n \times \log n)$
Barnes Hut n-Body Algorithm
0. Read input data and transfer to GPU
for each timestep do {
1. Compute bounding box around all bodies
2. Build hierarchical decomposition by inserting each body into octree
3. Summarize body information in each internal octree node
4. Approximately sort the bodies by spatial distance
5. Compute forces acting on each body with help of octree
6. Update body positions and velocities
}
7. Transfer result to CPU and output
Barnes Hut n-Body Algorithm
0. Read input data and transfer to GPU
for each timestep do {
1. Compute bounding box around all bodies
2. Build hierarchical decomposition by inserting each body into octree
3. Summarize body information in each internal octree node
4. Approximately sort the bodies by spatial distance
5. Compute forces acting on each body with help of octree
6. Update body positions and velocities
}
7. Transfer result to CPU and output
Barnes Hut n-Body Algorithm
0. Read input data and transfer to GPU
for each timestep do {
1. Compute bounding box around all bodies
2. Build hierarchical decomposition by inserting each body into octree
3. Summarize body information in each internal octree node
4. Approximately sort the bodies by spatial distance
5. Compute forces acting on each body with help of octree
6. Update body positions and velocity
}
7. Transfer result to CPU and output
Barnes Hut n-Body Algorithm
0. Read input data and transfer to GPU
for each timestep do {
1. Compute bounding box around all bodies
2. Build hierarchical decomposition by inserting each body into octree
3. Summarize body information in each internal octree node
4. Approximately sort the bodies by spatial distance
5. Compute forces acting on each body with help of octree
6. Update body positions and velocities
}
7. Transfer result to CPU and output
Calculate for each cell:
• Center of gravity
• Cumulative mass
Barnes Hut n-Body Algorithm
0. Read input data and transfer to GPU
for each timestep do {
1. Compute bounding box around all bodies
2. Build hierarchical decomposition by inserting each body into octree
3. Summarize body information in each internal octree node
4. Approximately sort the bodies by spatial distance
5. Compute forces acting on each body with help of octree
6. Update body positions and velocities
}
7. Transfer result to CPU and output
Kernel 4 is not needed for correctness but for optimization.
• It is done by in-order traversal of the tree.
• Typically places spatially close bodies close together.
First Step: Data Structure
• Dynamic data structures like trees are usually built using heap objects.
• Is it the best way to go?
• Drawbacks:
– Access to heap objects is slow
– Very hard to coalesce objects with multiple fields
How do we deal with this?
First Step: Data Structure
• Use an array-based data structure
• To be able to coalesce:
– use several aligned scalar arrays, one per field
• Array indices instead of pointers makes a faster code
First Step: Data Structure
• Allocate bodies at the beginning and the cells at the end of the arrays
• Use an index of -1 as a “null pointer.”
• Advantages.
– A simple comparison of the array index with the number of bodies determines whether the index points to a cell or a body.
– In some code sections, we need to find out whether an index refers to a body or to null. Because -1 is also smaller than the number of bodies, a single integer comparison suffices to test both conditions.
First Step: Data Structure
A: b0 b1 b2 b3 b4 b5 b6 b7
B: c4 c3 c2 c1 c0
AB: b0 b1 b2 b3 b4 b5 b6 b7 c4 c3 c2 c1 c0
b: body c: cell t: array length
Threads, Blocks, and Kernels
- The thread count per block is maximized and rounded down to the nearest multiple of the warp size for each kernel.
- All kernels use at least as many blocks as there are streaming multiprocessors in the GPU, which is automatically detected.
- Because all parameters passed to the kernels, such as the starting addresses of the various arrays, stay the same throughout the time step loop, we copy them once into the GPU’s constant memory.
- This is much faster than passing them with every kernel invocation.
- Data transferred from CPU to GPU only at the beginning of the program and at the end.
- code operates on octrees in which nodes can have up to eight children.
- It contains many loops.
- Loop unrolling is very handy here.
Kernel 1
- computes a bounding box around all bodies
- The root of the octree
- has to find the minimum and maximum coordinates in the three spatial dimensions
- Implementation:
- break up the data into equal sized chunks and assigns one chunk to each block
- Each block then performs a reduction operation
- The last block combine the results to generate the root node
- reduction is performed in shared memory in a way that avoids bank conflicts and minimizes thread divergence
Kernel 2
- Implements an iterative tree-building algorithm that uses lightweight locks
- Bodies are assigned to the blocks and threads within a block in round-robin fashion.
- Each thread inserts its bodies one after the other by:
- traversing the tree from the root to the desired last-level cell
- attempting to lock the appropriate child pointer (an array index) by writing an otherwise unused value to it using an atomic operation
- If the lock succeeds, the thread inserts the new body and release the lock
A handy group of functions to use are \texttt{atomicxxx} (must use \texttt{-arch sm\_11} with \texttt{nvcc})
- Definition: An atomic function performs a read-modify-write atomic operation on one 32-bit or 64-bit word residing in global or shared memory.
Synopsis of atomic function $\text{atomicOP}(a,b)$ is typically
\begin{verbatim}
t1 = *a; // read
t2 = t1 OP b; // modify
*a = t2; // write
return t;
\end{verbatim}
Kernel 2
• If a body is already stored at this location, the thread:
– creates a new cell by atomically requesting the next unused array index
– inserts the original and the new body into this new cell
– executes a memory fence (__threadfence) to ensure the new subtree is visible to the rest of the cores
– attaches the new cell to the tree
– releases the lock.
// initialize
cell = find_insertion_point(body); // nothing is locked, cell cached for retries
child = get_insertion_index(cell, body);
if (child != locked) {
if (child == atomicCAS(&cell[child], child, lock)) {
if (child == null) {
cell[child] = body; // insert body and release lock
} else {
new_cell =...; // atomically get the next unused cell
// insert the existing and new body into new_cell
_threadfence(); // make sure new_cell subtree is visible
cell[child] = new_cell; // insert new_cell and release lock
}
success = true; // flag indicating that insertion succeeded
}
}
_syncthreads(); // wait for other warps to finish insertion
Kernel 3
- traverses the unbalanced octree from the bottom up to compute the center of gravity and the sum of the masses of each cell's children
Kernel 3
• Cells are assigned to blocks and threads in a round-robin fashion.
– Ensure load-balance
– Start from leaves so avoid deadlocks
– Allow some coalescing
Kernel 5
- Requires the vast majority of the runtime
- For each body, the corresponding thread traverses some prefix of the octree to compute the force acting upon this body.
Kernel 5
• Optimization: whenever a warp traverses part of the tree that some of the threads do not need, those threads are disabled due to thread divergence.
– Make the union of the prefixes in a warp as small as possible
• group spatially nearby bodies together → kernel 4!
• Little computation to hide memory access
– Optimization: Allow only one thread in a warp to read the pertinent data and cache them in shared memory.
Summary of Optimizations
MAIN MEMORY
Minimize Accesses
- Let one thread read common data and distribute data to other threads via shared memory
- When waiting for multiple data items to be computed, record which items are ready and only poll the missing items
- Cache data in registers or shared memory
- Use thread throttling
Maximize Coalescing
- Use multiple aligned arrays, one per field, instead of arrays of structs or structs on heap
- Use a good allocation order for data items in arrays
Reduce Data Size
- Share arrays or elements that are known not to be used at the same time
Minimize CPU/GPU Data Transfer
- Keep data on GPU between kernel calls
- Pass kernel parameters through constant memory
Summary of Optimizations
CONTROL FLOW
Minimize Thread Divergence
- Group similar work together in the same warp
Combine Operations
- Perform as much work as possible per traversal, i.e., fuse similar traversals
Throttle Threads
- Insert barriers to prevent threads from executing likely useless work
Minimize Control Flow
- Use compiler pragma to unroll loops
LOCKING
Minimize Locks
- Lock as little as possible (e.g., only a child pointer instead of entire node, only last node instead of entire path to node)
Use Lightweight Locks
- Use flags (barrier/store and load) where possible
- Use atomic operation to lock but barrier/store or just store to unlock
Reuse Fields
- Use existing data field instead of separate lock field
Summary of Optimizations
**HARDWARE**
*Avoid Bank Conflicts*
- Control the accesses to shared memory to avoid bank conflicts
*Use All Multiprocessors*
- Parallelize code across blocks
- Make the block count at least as large as the number of streaming multiprocessors
*Maximize Thread Count*
- Parallelize code across threads
- Limit shared memory and register usage to maximize thread count
Results
CPU: 2.53GHz Xeon E5540 CPU
GPU: 1.3 GHz Quadro FX 5800
Conclusions
• Performance is related to how you keep the GPU and its memory busy → does not necessarily mean higher occupancy.
• We looked at some of the common parallel patterns used in many GPU kernels. These are tools that you can use in your own kernels.
|
{"Source-Url": "https://cs.nyu.edu/courses/fall18/CSCI-GA.3033-004/cuda-advanced-3.pdf", "len_cl100k_base": 7646, "olmocr-version": "0.1.53", "pdf-total-pages": 102, "total-fallback-pages": 0, "total-input-tokens": 130687, "total-output-tokens": 11303, "length": "2e12", "weborganizer": {"__label__adult": 0.0004429817199707031, "__label__art_design": 0.0007748603820800781, "__label__crime_law": 0.0004062652587890625, "__label__education_jobs": 0.0013265609741210938, "__label__entertainment": 0.00010472536087036131, "__label__fashion_beauty": 0.0002455711364746094, "__label__finance_business": 0.00021719932556152344, "__label__food_dining": 0.0004711151123046875, "__label__games": 0.0010623931884765625, "__label__hardware": 0.00830078125, "__label__health": 0.0005307197570800781, "__label__history": 0.0004162788391113281, "__label__home_hobbies": 0.00022602081298828125, "__label__industrial": 0.00121307373046875, "__label__literature": 0.00023317337036132812, "__label__politics": 0.00037789344787597656, "__label__religion": 0.0009632110595703124, "__label__science_tech": 0.1121826171875, "__label__social_life": 9.876489639282228e-05, "__label__software": 0.0066986083984375, "__label__software_dev": 0.86181640625, "__label__sports_fitness": 0.0005588531494140625, "__label__transportation": 0.0010166168212890625, "__label__travel": 0.00027632713317871094}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 30670, 0.01669]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 30670, 0.6224]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 30670, 0.83421]], "google_gemma-3-12b-it_contains_pii": [[0, 243, false], [243, 425, null], [425, 448, null], [448, 551, null], [551, 791, null], [791, 1059, null], [1059, 1546, null], [1546, 1840, null], [1840, 2340, null], [2340, 2533, null], [2533, 2610, null], [2610, 2741, null], [2741, 3652, null], [3652, 3997, null], [3997, 4155, null], [4155, 4211, null], [4211, 4764, null], [4764, 5098, null], [5098, 5690, null], [5690, 6141, null], [6141, 6313, null], [6313, 6729, null], [6729, 7288, null], [7288, 7406, null], [7406, 7432, null], [7432, 7442, null], [7442, 7680, null], [7680, 7949, null], [7949, 8154, null], [8154, 8296, null], [8296, 8513, null], [8513, 8665, null], [8665, 8803, null], [8803, 8918, null], [8918, 9388, null], [9388, 10007, null], [10007, 10532, null], [10532, 11049, null], [11049, 11162, null], [11162, 11379, null], [11379, 11779, null], [11779, 12129, null], [12129, 12368, null], [12368, 12587, null], [12587, 13017, null], [13017, 13259, null], [13259, 13285, null], [13285, 13639, null], [13639, 13735, null], [13735, 14138, null], [14138, 14555, null], [14555, 14746, null], [14746, 15056, null], [15056, 15222, null], [15222, 15237, null], [15237, 15588, null], [15588, 15945, null], [15945, 16435, null], [16435, 16740, null], [16740, 16767, null], [16767, 17082, null], [17082, 17277, null], [17277, 17568, null], [17568, 17750, null], [17750, 17869, null], [17869, 18141, null], [18141, 18296, null], [18296, 18614, null], [18614, 19015, null], [19015, 19206, null], [19206, 19355, null], [19355, 19370, null], [19370, 19569, null], [19569, 19716, null], [19716, 19780, null], [19780, 20090, null], [20090, 20388, null], [20388, 20569, null], [20569, 21022, null], [21022, 21487, null], [21487, 21962, null], [21962, 22503, null], [22503, 23136, null], [23136, 23397, null], [23397, 23596, null], [23596, 24089, null], [24089, 24240, null], [24240, 25010, null], [25010, 25504, null], [25504, 26023, null], [26023, 26457, null], [26457, 26831, null], [26831, 27572, null], [27572, 27718, null], [27718, 27888, null], [27888, 28064, null], [28064, 28500, null], [28500, 29212, null], [29212, 29949, null], [29949, 30345, null], [30345, 30410, null], [30410, 30670, null]], "google_gemma-3-12b-it_is_public_document": [[0, 243, true], [243, 425, null], [425, 448, null], [448, 551, null], [551, 791, null], [791, 1059, null], [1059, 1546, null], [1546, 1840, null], [1840, 2340, null], [2340, 2533, null], [2533, 2610, null], [2610, 2741, null], [2741, 3652, null], [3652, 3997, null], [3997, 4155, null], [4155, 4211, null], [4211, 4764, null], [4764, 5098, null], [5098, 5690, null], [5690, 6141, null], [6141, 6313, null], [6313, 6729, null], [6729, 7288, null], [7288, 7406, null], [7406, 7432, null], [7432, 7442, null], [7442, 7680, null], [7680, 7949, null], [7949, 8154, null], [8154, 8296, null], [8296, 8513, null], [8513, 8665, null], [8665, 8803, null], [8803, 8918, null], [8918, 9388, null], [9388, 10007, null], [10007, 10532, null], [10532, 11049, null], [11049, 11162, null], [11162, 11379, null], [11379, 11779, null], [11779, 12129, null], [12129, 12368, null], [12368, 12587, null], [12587, 13017, null], [13017, 13259, null], [13259, 13285, null], [13285, 13639, null], [13639, 13735, null], [13735, 14138, null], [14138, 14555, null], [14555, 14746, null], [14746, 15056, null], [15056, 15222, null], [15222, 15237, null], [15237, 15588, null], [15588, 15945, null], [15945, 16435, null], [16435, 16740, null], [16740, 16767, null], [16767, 17082, null], [17082, 17277, null], [17277, 17568, null], [17568, 17750, null], [17750, 17869, null], [17869, 18141, null], [18141, 18296, null], [18296, 18614, null], [18614, 19015, null], [19015, 19206, null], [19206, 19355, null], [19355, 19370, null], [19370, 19569, null], [19569, 19716, null], [19716, 19780, null], [19780, 20090, null], [20090, 20388, null], [20388, 20569, null], [20569, 21022, null], [21022, 21487, null], [21487, 21962, null], [21962, 22503, null], [22503, 23136, null], [23136, 23397, null], [23397, 23596, null], [23596, 24089, null], [24089, 24240, null], [24240, 25010, null], [25010, 25504, null], [25504, 26023, null], [26023, 26457, null], [26457, 26831, null], [26831, 27572, null], [27572, 27718, null], [27718, 27888, null], [27888, 28064, null], [28064, 28500, null], [28500, 29212, null], [29212, 29949, null], [29949, 30345, null], [30345, 30410, null], [30410, 30670, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 30670, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 30670, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 30670, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 30670, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, true], [5000, 30670, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 30670, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 30670, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 30670, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 30670, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 30670, null]], "pdf_page_numbers": [[0, 243, 1], [243, 425, 2], [425, 448, 3], [448, 551, 4], [551, 791, 5], [791, 1059, 6], [1059, 1546, 7], [1546, 1840, 8], [1840, 2340, 9], [2340, 2533, 10], [2533, 2610, 11], [2610, 2741, 12], [2741, 3652, 13], [3652, 3997, 14], [3997, 4155, 15], [4155, 4211, 16], [4211, 4764, 17], [4764, 5098, 18], [5098, 5690, 19], [5690, 6141, 20], [6141, 6313, 21], [6313, 6729, 22], [6729, 7288, 23], [7288, 7406, 24], [7406, 7432, 25], [7432, 7442, 26], [7442, 7680, 27], [7680, 7949, 28], [7949, 8154, 29], [8154, 8296, 30], [8296, 8513, 31], [8513, 8665, 32], [8665, 8803, 33], [8803, 8918, 34], [8918, 9388, 35], [9388, 10007, 36], [10007, 10532, 37], [10532, 11049, 38], [11049, 11162, 39], [11162, 11379, 40], [11379, 11779, 41], [11779, 12129, 42], [12129, 12368, 43], [12368, 12587, 44], [12587, 13017, 45], [13017, 13259, 46], [13259, 13285, 47], [13285, 13639, 48], [13639, 13735, 49], [13735, 14138, 50], [14138, 14555, 51], [14555, 14746, 52], [14746, 15056, 53], [15056, 15222, 54], [15222, 15237, 55], [15237, 15588, 56], [15588, 15945, 57], [15945, 16435, 58], [16435, 16740, 59], [16740, 16767, 60], [16767, 17082, 61], [17082, 17277, 62], [17277, 17568, 63], [17568, 17750, 64], [17750, 17869, 65], [17869, 18141, 66], [18141, 18296, 67], [18296, 18614, 68], [18614, 19015, 69], [19015, 19206, 70], [19206, 19355, 71], [19355, 19370, 72], [19370, 19569, 73], [19569, 19716, 74], [19716, 19780, 75], [19780, 20090, 76], [20090, 20388, 77], [20388, 20569, 78], [20569, 21022, 79], [21022, 21487, 80], [21487, 21962, 81], [21962, 22503, 82], [22503, 23136, 83], [23136, 23397, 84], [23397, 23596, 85], [23596, 24089, 86], [24089, 24240, 87], [24240, 25010, 88], [25010, 25504, 89], [25504, 26023, 90], [26023, 26457, 91], [26457, 26831, 92], [26831, 27572, 93], [27572, 27718, 94], [27718, 27888, 95], [27888, 28064, 96], [28064, 28500, 97], [28500, 29212, 98], [29212, 29949, 99], [29949, 30345, 100], [30345, 30410, 101], [30410, 30670, 102]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 30670, 0.02639]]}
|
olmocr_science_pdfs
|
2024-12-07
|
2024-12-07
|
e88fa8aee60c8a5c949c6962272b7d05dd67f620
|
Detection, Localization And Prevention Of Spoofing Attacks In Wireless Network
Arjunsingh Sushil Yadav, Deshana Manoj Sethia, Amruta Balaji Mundkar, Pooja Milind Natu
Pimpri Chinchwad College of Engineering, Pune, Maharashtra, India
Email: arjun.yadav015@gmail.com
Abstract — The performance of networks can be severely damaging by the use of wireless spoofing networks. Since they can be easily established, the attacker doesn’t find much hassles in destroying these networks. Although the identity of a node can be verified through cryptographic authentication, conventional security approaches are not always desirable because of their overhead requirements. We will use this spatial information, a physical property associated with each node, hard to falsify, and not reliant on cryptography, as the basis for 1) detecting spoofing attacks 2) determining the number of attackers when multiple adversaries masquerading as the same node identity 3) localizing multiple adversaries. 4) Preventing the attacks. We propose to use the spatial correlation of received signal strength (RSS) inherited from wireless nodes to detect the spoofing attacks. We then formulate the problem of determining the number of attackers as a multi-class detection problem. Cluster-based mechanisms are developed to determine the number of attackers.
In existing systems, the attacker is detected after it has attacked so in order to prevent the attack, we will consider what the attacker is requesting from the server. There will be an intermediate node between server and the attacker so as to prevent the traffic on server and based on the analyzed data from the intermediate node we will decide whether the requester is an attacker or a trusted user.
I. INTRODUCTION
The problem of determining the number of attackers as a multi-class detection problem. Cluster-based mechanisms are developed to determine the number of attackers. Wireless spoofing attacks are easy to launch and can significantly impact the performance of networks. Although the identity of a node can be verified through cryptographic authentication, conventional security approaches are not always desirable because of their overhead requirements. Due to the limitations of most MANET routing protocols, nodes in MANETs assume that other nodes always cooperate with each other to relay data. This assumption leaves the attackers with the opportunities to achieve significant impact on the network with just one or two compromised nodes.
II. LITERATURE SURVEY
A. Detection and Localization of Multiple Spoofing Attackers in Wireless Networks
Wireless spoofing attacks are easy to launch and can significantly impact the performance of networks. They propose to use the spatial correlation of received signal strength (RSS) inherited from wireless nodes to detect the spoofing attacks. They then formulate the problem of determining the number of attackers as a multiclass detection problem. When the training data are available, they explore using the Support Vector Machines (SVM) method to further improve the accuracy of determining the number of attackers. In addition, they developed an integrated detection and localization system that can localize the positions of multiple attackers. They evaluated their techniques through two test beds using both an 802.11 (Wi-Fi) network and an 802.15.4 (ZigBee) network in two real office buildings. The experimental results show that the proposed methods can achieve over 90 percent Hit Rate and Precision when determining the number of attackers. The localization results using a representative set of algorithms provide strong evidence of high accuracy of localizing multiple adversaries. [1].
B. Detecting Spoofing Attacks in Mobile Wireless Environments
The flexibility and openness of wireless networks enables an adversary to masquerade as other devices easily. Identity-based spoofing attacks are serious network threats as they can facilitate a variety of advanced attacks to determine the normal operation of networks. However, the existing mechanisms can only detect spoofing attacks when the victim node and the spoofing node are static. There is a proposal of a method for detecting spoofing attacks in the mobile wireless environment that is when wireless devices, such as the victim node and/or the spoofing node are moving. The DEMOTE system, which exploits Received Signal Strength (RSS) traces collected over
ISSN (Online): 2347-2820, Volume -2, Issue-8.9 2014
time and achieves an optimal threshold to partition the
RSS traces into classes for attack detection. Further, the
novel algorithm alignment prediction (ALP), when
without the knowledge of spatial constraint of the
wireless nodes, utilizes temporal constraints to predict
the best RSS alignment of partitioned RSS classes for
RSS trace reconstruction over time. Through
experiments from an office building environment, the
mentioned paper shows that DEMOTE achieves accurate
attack detection both in signal space as well as in
physical space using localization and is generic across
different technologies including IEEE 802.11 b/g and
IEEE 802.15.4.[2].
C. Detecting and Localizing Wireless spoofing Attacks
Wireless networks are vulnerable to spoofing attacks,
which allows for many other forms of attacks on the
networks. Although the identity of a node can be
verified through cryptographic authentication,
authentication is not always possible because it requires
key management and additional infrastructural
overhead. They have proposed that there is method for
both detecting spoofing attacks, as well as locating the
positions of adversaries performing the attacks. Next,
they described how they integrated their attack detector
into a real-time indoor localization system, which is also
capable of localizing the positions of the attackers. It
then shows that the positions of the attackers can be
localized using either area-based or point-based
localization algorithms with the same relative errors as
in the normal case. They have evaluated their methods
through experimentation using both an 802.11 (Wi-Fi)
network as well as an 802.15.4 (ZigBee) network. The
results show that it is possible to detect wireless
spoofing with both a high detection rate and a low false
positive rate, thereby providing strong evidence of the
effectiveness of the K-means spoofing detector as well
as the attack localizer. [3]
D. Detecting Identity-Based Attacks in Wireless
Networks Using Signal prints
Wireless networks are vulnerable to many identity-based
attacks in which a malicious device uses forged MAC
addresses to masquerade as a septic client or to create
multiple illegitimate identities. For example, several
link-layer services in IEEE 802.11 networks have been
shown to be vulnerable to such attacks. They have
shown that a transmitting device can be robustly
indented by its signal print, a topple of signal strength
values reported by access points acting as sensors. They
show that, different from MAC addresses or other
packet contents, attackers do not have as much control
regarding the signal prints they produce. Moreover,
using measurements in a tested network, they
demonstrated that signal prints are strongly correlated
with the physical location of clients, with similar values
found mostly in close proximity. By tagging suspicious
packets with their corresponding signal prints, the
network is able to robustly identify each transmitter
independently of packet contents, allowing detection of
large class of identity-based attacks with high
probability. [4]
E. Secure and Efficient Key Management in Mobile Ad
Hoc Networks.
In mobile ad hoc networks, due to unreliable wireless
media, host mobility and lack of infrastructure, providing
secure communications is a big challenge. Usually,
cryptographic techniques are used for secure
communications in wired and wireless networks.
Symmetric and asymmetric cryptography have their
advantages and disadvantages. In fact, any
cryptographic means is ineffective if its key
management is weak. Key management is also a central
aspect for security in mobile ad hoc networks. In mobile
ad hoc networks, the computational load and complexity
for key management are strongly subject to restriction
by the nodes available resources and the dynamic nature
of network topology. They proposed that a secure and
efficient key management (SEKM) framework for
mobile ad hoc networks. SEKM builds a public key
infrastructure (PKI) by applying a secret sharing scheme
and using an underlying multi-cast server groups. [5]
F. Access Points Vulnerabilities to Dos Attacks in
802.11 Networks.
There are various possible denial of service attacks to
infrastructure wireless 802.11 networks. To carry out
such attacks only commodity hardware and software
components are required. The results mentioned in this
paper show that serious vulnerabilities exist in different
access points and that a single malicious station can
easily hinder any legitimate communication within a
basic service set. [6]
III. SOFTWARE REQUIREMENTS
SPECIFICATION
A. Introduction
Wireless spoofing attacks are easy to launch and can
significantly impact the performance of networks.
Although the identity of a node can be verified through
cryptographic authentication, conventional security
approaches are not always desirable
because of their overhead requirements. In this paper,
we propose to use spatial information, a physical
property associated with each node, hard to falsify, and
not reliant on cryptography, as the basis for 1) detecting
spoofing attacks; 2) determining the number of attackers
when multiple adversaries masquerading as the same
node identity; and 3) localizing multiple adversaries.
4) Preventing the attacks. We propose to use the spatial
correlation of received signal strength (RSS) inherited
from wireless nodes to detect the spoofing attacks. We
then formulate the problem of determining the number of attackers as a multiclass detection problem. Cluster-based mechanisms are developed to determine the number of attackers. Our localization results using a representative set of algorithms provide strong evidence of high accuracy of localizing multiple adversaries.
In general, MANETs are vulnerable based on the basic characteristics such as open medium, changing topology, absence of infrastructure, restricted power supply, and scalability. In such case, Intrusion detection can be defined as a process of monitoring activities in a system which can be a computer or a network. The mechanism that performs this task is called an Intrusion Detection System. In addition to that, in case of wireless and sensor networks, they will increasingly become tempting targets for malicious attacks. Due to the openness of wireless and sensor networks, they are especially vulnerable to spoofing attacks where an attacker forges its identity to masquerade as another device, or even creates multiple illegitimate identities. Spoofing attacks are a serious threat as they represent a form of identity compromise and can facilitate a variety of traffic injection attacks, such as evil twin access point attacks. It is thus desirable to detect the presence of spoofing and eliminate them from the network. The traditional approach to address spoofing attacks is to apply cryptographic authentication. However, authentication requires additional infrastructural overhead and computational power associated with distributing, and maintaining cryptographic keys. Due to the limited resources available to the wireless devices and sensor nodes, it is not always possible to deploy authentication. In addition, key management often incurs significant human management costs on the network.
There are different approach by using the physical properties associated with wireless transmissions to detect spoofing. Specifically, we propose a scheme for both detecting spoofing attacks, as well as localizing the positions of the adversaries performing the attacks. Our approach utilizes the Received Signal Strength (RSS) measured across a set of access points to perform spoofing detection and localization. Our scheme does not add any overhead to the wireless devices and sensor nodes. By analyzing the RSS from each MAC address; we have found that the distance between the centroids in signal space is a good test statistic for effective attack detection. We then describe how we integrated our K-means spoofing detector into real-time indoor localization system. Our K-means approach is general in that it can be applied to almost all RSS-based localization algorithms.
1: Project Scope
This project can be used to detect various attacks occurred across the MANET or wireless network using RSS mechanism we can judge our attack detection and localization with high efficiency rather than Cryptographic mechanism.
2: User Classes and Characteristics
Users in Application are:
Network Admin: Root user for the entire infrastructure.
Scope: Access to all cloud instances within the service provider domain, access to all tenants.
End user: Regular user without any administration privileges can use resources, see utilization reports, but cannot select reports outside privilege scope.
Scope: Very limited scope down to the virtual machine level access.
Intermediate Node: Acts like a filter, segregating the necessary requests to avoid congestion from the repeated data.
Scope: Prevent DR attack.
3: Operating Environment
This product is web-based and will be hosted by a web server. It can be viewed by any web browsers and will be compliant with Internet Explorer, Mozilla, Netscape Navigator and Opera. It will work on Microsoft Environment only supported by .net framework and Java.
4: Design and Implementation Constraints
It is limited to work on Microsoft Windows Environment only. System must have .Net framework or Java.
System requires SQL Server or Higher installed on the server system which is very vital to maintain integrity of database.
5: Assumptions and dependencies
The users must be aware of computer hardware and their different attributes.
The user must have basic knowledge of computer and operating system.
Application development requires a good knowledge of operating systems and WMI architecture of windows.
For application, the users should be aware of JAVA language and basic database operations.
The computer in which this application is to be installed should be compatible with Eclipse (IDE) Framework.
B. Functional Requirements:
1: User Interfaces
The user can use the system through software installed in all the systems in organization premises. This software can run on any machine that supports Java Virtual Environment or a Dot Net Framework.
2: Hardware Interfaces
- RAM: 512 MB - 1 GB
- HDD: 40 GB
- Processor: Pentium IV
- Keyboard: Standard Windows Keyboard
- Mouse: Two or Three Button Mouse
- Monitor: LCD/LED
3: Software Interfaces
- Operating System: Windows XP Service Pack 2 or Higher
- Coding Language: JAVA
- Database: SQL Server 2005/2008 R2
- Tool: Eclipse JUNO
C. Non-Functional Requirements
1: Performance Requirements
- Time/Space Bounds:
- Response time, throughput and available storage space should be reasonable under normal operational circumstances.
- Reliability:
- Integrity of information maintained and supplied to the system and availability of components.
- Capacity:
- Workloads should be handled for example the system must handle 1000 transactions per second.
2: Safety Requirements
- Power Failure:
- In case of power failure system resume for current operation is there by maintaining a log file and backup of the data is provided in encrypted form.
- Data Loss:
- If any file is accessed mentioned in the database but deleted from the system then it is removed from the database and appropriate message is displayed.
- Survivability:
- System will need to survive fire, natural catastrophes etc.
3: Security Requirements
- Access Rights:
- Different levels of access rights are given to different user by authenticating with pass-words.
- Encryption/Decryption:
- Data is encrypted as soon as it is given for storage. Encryption and decryption is provided by different service providers so as to minimize the risk of data leakage.
4: Software Quality Attributes
- Availability:
- The system shall be available as long as operations are performed on application.
- Updateability:
- The system shall allow addition and deletion of files based on access rights provided.
- Reliability:
- Integrity of information maintained and supplied to the system and availability of components.
- Testability:
- New modules designed to be added to system must be tested to check whether they are integrated properly and compatible with input-output format of the system.
- Usability:
- The system does not need much learning. Knowledge of basic computer its hardware and C# language is necessary to operate the system. Documentation provided for the system will include user manuals, developer reference and common FAQ.
D. Other Requirements
1: Database Requirements
- MS SQL Server 2008:
- Microsoft SQL Server is a relational database management system developed by Microsoft. As a database, it is a software product whose primary function is to store and retrieve data as requested by other software applications, be it those on the same computer or those running on another computer across a
network (including the Internet). There are at least a dozen different editions of Microsoft SQL Server aimed at different audiences and for different workloads (ranging from small applications that store and retrieve data on the same computer, to millions of users and computers that access huge amounts of data from the Internet at the same time).
SQL Server 2008 (formerly codenamed "Katmai") was released on August 6, 2008 and aims to make data management self-tuning, self-organizing, and self-maintaining with the development of SQL Server Always on technologies, to provide near-zero downtime. SQL Server 2008 also includes support for structured and semi-structured data, including digital media formats for pictures, audio, video and other multimedia data. In current versions, such multimedia data can be stored as BLOBs (binary large objects), but they are generic bit-streams. Intrinsic awareness of multimedia data will allow specialized functions to be performed on them. According to Paul Flessner, SQL Server 2008 can be a data storage backend for different varieties of data: XML, email, time/calendar, file, document, spatial, etc. as well as perform search, query, analysis, sharing, and synchronization across all data types. Other new data types include specialized date and time types and a spatial data type for location-dependent data. Better support for unstructured and semi-structured data is provided using the new FILESTREAM data type, which can be used to reference any file stored on the file system. Structured Data and metadata about the file is stored in SQL Server database, whereas the unstructured component is stored in the file system. Such files can be accessed both via Win32 file handling APIs as well as via SQL Server using T-SQL.
SQL Server includes better compression features, which also helps in improving scalability. It enhanced the indexing algorithms and introduced the notion of filtered indexes. It also includes Resource Governor that allows reserving resources for certain users or workflows. It also includes capabilities for transparent encryption of data (TDE) as well as compression of backups. SQL Server 2008 supports the Eclipse Framework and the reporting tools, replication, and data definition will be built around the Entity Data Model. The version of SQL Server Management Studio included with SQL Server 2008 supports IntelliSense for SQL queries against a SQL Server 2008 Database Engine. SQL Server 2008 also makes the databases available via Windows PowerShell providers and management functionality available as Cmdlets, so that the server and all the running instances can be managed from Windows PowerShell.
2. Internalization Requirements
Physical constraints (size and weight)
Personal availability and skill level
Accessibility for maintenance
Environmental conditions
3. Legal Requirements
Applications Software development tools should be legally Approved.
Database storage should not violate government rules and regulations (Whatsapp banned in few countries).
E. Analysis Models
1: Data Flow Diagram



2. State Chart Diagram:

Figure 4: State Chart Diagram
3. ER Diagram

Figure 5: ER Diagram
IV. SYSTEM DESIGN
F. UML Diagrams
1. Sequence Diagram
A sequence diagram in a UML is a kind of interaction diagram. It is a construct of a Message Chart. A sequence diagram shows object interactions arranged in time sequence. It depicts the objects and classes involved in the scenario and the sequence of messages exchanged between the objects needed to carry out the functionality of the scenario. Sequence diagrams typically are associated with use case realizations in the Logical View of the system under development. Sequence diagrams are sometimes called event diagrams, event scenarios, and timing diagrams. A sequence diagram shows, as parallel vertical lines (lifelines), different processes or objects that live simultaneously, and, as horizontal arrows, the messages exchanged between them, in the order in which they occur. Figure 5 represents the sequence diagram of the system.

Figure 6: Sequence Diagram 1

Figure 7: Sequence Diagram 2
2: Use Case Diagram
Use Case diagram shows the overall functionalities of the system. Use case diagrams overview the usage requirements for a system. They are useful for presentations to manage and/or project stakeholders, but for actual development you will find that use cases provide significantly more value because they describe "the meat" of the actual requirements. Use case diagrams are behavior diagrams used to describe a set of actions (use cases) that some system or systems (subject) should or can perform in collaboration with one or more external users of the system (actors).

3: Class Diagram
In software engineering, a class diagram in the Unified Modeling Language (UML) is a type of static structure diagram that describes the structure of a system by showing the system’s classes, their attributes, operations (or methods) and the relationships among the classes. The class diagram is the main building block of object oriented modeling. It is used both for general conceptual modeling of the systematic of the application, and for detailed modeling translating the models into programming code. Class diagrams can also be used for data modeling. The classes in a class diagram represent both the main objects and or interactions in the application and the objects to be programmed. In the class diagram these classes are represented with boxes which contain three parts: The upper part holds the name of the class. The middle part contains the attributes of the class. The bottom part gives the methods or operations the class can take or undertake.

4: Deployment Diagram

5: Collaboration Diagram

II. TECHNICAL SPECIFICATION
A. Advantages
Low or no startup cost
Great flexibility in relationship to fast up and down scaling of resources needs.
Easier access to new version.
Other common outsourcing advantages like security for uptime, availability, contingency arrangements, reduced cost of investment in organization infrastructure
B. Disadvantages
As it is web based it is dependent on network traffic.
Vulnerability in relation to the solution being delivered and operated by suppliers.
C. Applications
Many web application, such as meta querying, data integration and comparison shopping, need the data from multiple web database. For these application to further utilize the data embedded in HTML pages, automatic data extraction is necessary. Only when the data are extracted and organized in a structured manner, such as tables, can they be compared and aggregated. Hence, accurate data extraction is vital for these application is vital for these applications to perform correctly.
ACKNOWLEDGEMENT
We express our sincere thanks to our Guide Prof. S. SAMBARE, for his constant encouragement and support throughout our project, especially for the useful suggestions given during the course of project and having laid down the foundation for the success of this work.
We would also like to thank our Project Coordinator Mrs. Reena Kharat, for her assistance, genuine support and guidance from early stages of the project. We would like to thank Prof. Dr. J. S Umale, Head of Computer Department for his unwavering support during the entire course of this project work. We are very grateful to our Principal Dr. A. M. Fulambarkar for providing us with an environment to complete our project successfully. We also thank all the staff members of our college and technicians for their help in making this project a success. We also thank all the web committees for enriching us with their immense knowledge. Finally, we take this opportunity to extend our deep appreciation to our family and friends, for all that they meant to us during the crucial times of the completion of our project.
REFERENCES
[1]. Jie Yang, Student Member, IEEE, Yingying (Jennifer) Chen, Senior Member, IEEE, Wade Trappe, Member, IEEE, and Jerry Cheng “Detection and Localization of Multiple Spoofing Attackers in Wireless Networks”, 2013
|
{"Source-Url": "http://www.irdindia.in/journal_ijeecs/pdf/vol2_iss8/1.pdf", "len_cl100k_base": 5093, "olmocr-version": "0.1.51", "pdf-total-pages": 9, "total-fallback-pages": 0, "total-input-tokens": 27045, "total-output-tokens": 5831, "length": "2e12", "weborganizer": {"__label__adult": 0.0005583763122558594, "__label__art_design": 0.0004954338073730469, "__label__crime_law": 0.002338409423828125, "__label__education_jobs": 0.001839637756347656, "__label__entertainment": 0.0001494884490966797, "__label__fashion_beauty": 0.0002465248107910156, "__label__finance_business": 0.0003376007080078125, "__label__food_dining": 0.0004301071166992187, "__label__games": 0.0012264251708984375, "__label__hardware": 0.00833892822265625, "__label__health": 0.0009927749633789062, "__label__history": 0.00047206878662109375, "__label__home_hobbies": 0.00015306472778320312, "__label__industrial": 0.0009813308715820312, "__label__literature": 0.0003609657287597656, "__label__politics": 0.00036454200744628906, "__label__religion": 0.0005412101745605469, "__label__science_tech": 0.43115234375, "__label__social_life": 0.00016820430755615234, "__label__software": 0.025390625, "__label__software_dev": 0.52197265625, "__label__sports_fitness": 0.0005140304565429688, "__label__transportation": 0.0009102821350097656, "__label__travel": 0.00020897388458251953}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 26655, 0.01741]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 26655, 0.61165]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 26655, 0.9209]], "google_gemma-3-12b-it_contains_pii": [[0, 4490, false], [4490, 9909, null], [9909, 14504, null], [14504, 17471, null], [17471, 20678, null], [20678, 21848, null], [21848, 23587, null], [23587, 25922, null], [25922, 26655, null]], "google_gemma-3-12b-it_is_public_document": [[0, 4490, true], [4490, 9909, null], [9909, 14504, null], [14504, 17471, null], [17471, 20678, null], [20678, 21848, null], [21848, 23587, null], [23587, 25922, null], [25922, 26655, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 26655, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 26655, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 26655, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 26655, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 26655, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 26655, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 26655, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 26655, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 26655, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 26655, null]], "pdf_page_numbers": [[0, 4490, 1], [4490, 9909, 2], [9909, 14504, 3], [14504, 17471, 4], [17471, 20678, 5], [20678, 21848, 6], [21848, 23587, 7], [23587, 25922, 8], [25922, 26655, 9]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 26655, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-03
|
2024-12-03
|
0d0043abb1e6ab195e2cf3ce32f0bf5e0e61d6f8
|
Ordered Multicast and Distributed Swap
preliminary report
Maurice Herlihy* Srikanta Tirthapura*
Roger Wattenhofer†
March 30, 2000
Abstract
A multicast protocol is ordered (or totally ordered) if it ensures that messages multicast to a group of nodes are delivered in the same order at each destination node, even when those messages are generated concurrently from several sources. Ordered multicast is a natural foundation for push-based cache coherence and certain kinds of middleware.
This paper shows how to reduce the complex problem of enforcing multicast ordering to a simpler distributed coordination problem we call distributed swap. Any distributed swap protocol can transform an unordered reliable multicast into an ordered multicast in a modular way.
We introduce two novel distributed swap protocols, and discuss their corresponding ordered multicast protocols. These protocols have lower latency than more obvious approaches based on distributed counting.
Submitted on 29 March 2000 to the Middleware Symposium. Contact author: herlihy@cs.brown.edu. Intended for regular proceedings. Word count: below 4,000.
*Computer Science Department, Brown University, Providence, RI 02912; {herlihy, snt}@cs.brown.edu.
†Microsoft Research, roger@cs.brown.edu
1 Introduction
The ordered multicast problem is the problem of ensuring that messages multicast to a group of nodes are delivered in the same order everywhere, even when these messages are generated concurrently at several sources. (This kind of multicast is sometimes called totally ordered.) We are interested in scalable multicast protocols that allow nodes to enter or leave the multicast group without the need for global reconfiguration.
To understand why ordered multicast can be useful, consider a distributed object cached at multiple nodes in a network, where each node multicasts updates to the cached copies, a technique called push-based cache coherence. If several nodes issue concurrent updates, each of the cached copies must apply those updates in the same order. More generally, ordered multicast is useful in any kind of middleware where the order of events originating at different nodes in a distributed system must be reflected consistently among the nodes “listening” to such events.
The contribution of this paper is to point out a simple reduction from the ordered multicast problem to a much simpler distributed coordination problem, called distributed swap, and to explore the consequences of this reduction. Our intent is to draw the attention of the community to this approach, and to encourage others to work on this problem and related problems. We have found this reduction helpful in designing two novel ordered multicast protocols, the arrow multicast and the combining multicast, both described below.
The reduction works as follows. A distributed swap protocol can be combined with any reliable multicast protocol from the literature (such as SRM [5] or RMTP [9]), to yield a reliable ordered protocol. This reduction is of interest because distributed swap has not been widely studied, and there is some evidence that ordered multicast protocols based on distributed swap may be more efficient than more obvious approaches based on distributed counting.
We believe that any truly scalable multicast protocol must be anonymous, in the sense that a node performing a multicast may not be aware of the identities of the recipients. IP multicast [12], SRM [5], and RMTP [9] are all anonymous in this sense. If all nodes (or even some nodes) must know every group member, then entering or leaving the group requires a global reconfiguration, which is clearly not scalable beyond local area networks. Our approach to ordered multicast thus differs in fundamental ways from
that employed by systems based on notions of *virtual synchrony* [1, 3, 11, 14], in which each node knows the exact group membership. In these systems, each node entering or leaving the group provokes a global reconfiguration (called a “view change”). These systems trade fault-tolerance for scalability, while we do the opposite.
2 Model
We now describe our assumptions about the underlying system and the services it provides. Formally, a distributed system is a connected undirected graph $G$, where processors correspond to graph nodes, and edges to direct communication links. We assume that there is
- a reliable FIFO unicast service (such as TCP), and
- a reliable single source FIFO\(^1\) (but otherwise unordered) multicast service (such as SRM [5] or RMTP [9]).
Our goal is to provide a layer on top of these services that forces a total order on message delivery.
We believe that a layered approach, in which we focus exclusively on ordering, reflects a sensible separation of concerns. Many existing proposals for reliable multicast [5, 9, 10] stack a repair layer on top of an unreliable multicast layer. In the same spirit, we stack an ordering layer on top of reliable multicast so we can focus on ordering independently of repair and retransmission.
As usual, we distinguish between *receiving* a message at a node, which typically involves placing the message in a buffer, and *delivering* the message to the application running at the node. Ordered multicast requires only that message deliveries be totally ordered.
We do not consider fault tolerance for now. We assume here that nodes do not crash, and that with sufficient retransmission, any message can eventually cross any link. Fault-tolerance is discussed briefly in the conclusions.
\(^1\)“Single-source FIFO” means that messages sent by any single processor are delivered in the order sent.
3 The Reduction
In the distributed swap problem, a collection of processes have to implement
a distributed swap object, which encapsulates a value, initially the distin-
guished value ⊥. The object provides a single operation, \( \text{swap}(v) \), which
changes the object’s value to \( v \) and returns the previous value.
It is straightforward to use a distributed swap to impose a total order on
reliable multicasts. Each multicast group has an associated swap object. For
each message \( m \), the source node \( u \) generates a unique id \( \text{id}(m) \). Node \( u \) then
calls \( \text{swap}(\text{id}(m)) \), which returns \( \text{id}(m') \), the identifier of \( m' \), the immediate
predecessor to \( m \). Node \( u \) then calls the reliable multicast service to send
the pair \( \langle \text{id}(m'), m \rangle \) to each member of the multicast group. A node that
receives \( \langle \text{id}(m'), m \rangle \) delivers \( m \) only after delivering \( m' \). (A message with
predecessor id \( ⊥ \) is delivered immediately.)
To see why it may be advantageous to focus on swap, let us consider
another, perhaps more obvious reduction. The distributed counting problem
requires issuing successive integers to requesting processes. One could imple-
ment ordered multicast simply by using any distributed counting protocol\[2,
13, 15\] to assign a sequence number to each message, and delivering a message
only after all lower-numbered messages have been delivered.
Nevertheless, it may sometimes be faster to identify a message’s immedi-
ate predecessor than to discover the number of predecessors of that message.
Both distributed swap protocols examined in this paper are actually “trunc-
cated” versions of counting protocols, in which each participant quits early,
after discovering its immediate predecessor, but without waiting to count its
other predecessors. In these swap-based protocols, the task of finding order-
ing information imposes less latency than the corresponding counting-based
protocols.
We present two techniques for ordered multicast based on distinct dis-
tributed swap protocols. The first protocol, the arrow multicast, is based
on the arrow distributed directory protocol \[4, 8\]. The arrow protocol was
originally developed as a scalable way for tracking the location of mobile
objects. It uses a simple path-reversal technique to construct a distributed
queue of access requests. The corresponding distributed swap protocol is a
“truncated” version of the directory protocol, in which a message is multicast
as soon as it chooses a position in the distributed queue.
The second protocol, the combining multicast, is based on a combining
tree structure. The combining multicast protocol is a “truncated” version of a
distributed counting protocol. In the basic combining-tree protocol, messages
move from leaves to the root, combining wherever possible. In the counting
protocol, each message is assigned a value only after a round trip to the root
and back. The swap protocol is a truncated version of the counting protocol:
when two messages are combined, one becomes the other’s predecessor and
can be broadcast immediately.
4 Arrow Multicast
The arrow directory protocol [4] ensures mutually exclusive access to mobile
objects. This protocol is designed to avoid scalability problems inherent in
many directory services currently used in distributed shared object systems.
We now show how to adapt this protocol to support distributed swap, and
hence ordered multicast.
Recall that the network is modeled as a graph $G$. The protocol maintains
a tree $T$, a subgraph of $G$, spanning the nodes in the multicast group. Each
node $v$ in the tree has two attributes: $\text{link}(v)$ is a node, either $v$ itself, or a
neighbor of $v$ in $T$, and $\text{value}(v)$ is a value. A node $v$ is a sink if $\text{link}(v) = v$.
The component $\text{value}(v)$ is meaningful only if $v$ is a sink. The directory tree
is initialized so that following the the $\text{link}()$ variables from any node leads
to a unique sink $v$ such that $\text{value}(v) = \bot$. Informally, except for the unique
sink node, a node knows only in which “direction” the sink lies.
When a node $v$ initiates a $\text{swap}(a)$, where $a$ is a value, it sends a $\text{swap}(a)$
message to $u_i = \text{link}(v)$ and sets $\text{link}(v)$ to $v$ and $\text{value}(v)$ to $a$. When
node $u_i$ receives a $\text{swap}(a)$ message from node $u_{i-1}$, where $u_{i+1} = \text{link}(u_i)$,
it immediately “flips” $\text{link}(u_i)$ to $u_{i-1}$. If $u_{i+1} \neq u_i$, then $u_i$ forwards the
message to $u_{i+1}$. Otherwise, $u_i$ is a sink, and it returns $\text{value}(u_i)$ to the
originating node $v$.
Ordered multicast is performed in a similar way. When a node $u$ multi-
casts $m$, it initiates $\text{swap}(\text{id}(m))$, sending $m$ along with the swap message.
When this message reaches a sink $u_i$, instead of returning $\text{value}(u_i)$ to $u$, $u_i$
immediately performs an unordered multicast of $\langle \text{value}(u_i), m \rangle$, indicating
that the message with id $\text{value}(u_i)$ is the immediate predecessor of $m$ in the
total order. This protocol is illustrated in Figures 1 through 5.
It is not hard to show that every message eventually finds a sink, and
that the maximal number of links traversed from source to sink is at most
the diameter of the tree $T$. Moreover, the protocol never waits between the
time a message is multicast and the time it is received at the destination nodes. (Once a message \( m \) is received, however, a node may need to wait for earlier messages to catch up before it can deliver \( m \).)
Note that this protocol can be considered as a truncated version of a distributed counting based protocol. Interpret \( \text{value}(v) \) as a mobile sequence number, initially 0. Each sink either has the sequence number, or is waiting to receive it. When a message arrives at a sink, it waits for the sequence number to arrive, increments it, and then performs an unordered multicast.
If requests occur sequentially, the counting-based and swap-based multicast protocols are the same, but in the presence of concurrency, the swap-based multicast will always have lower latency because messages do not need to wait to count their predecessors.
Figure 3: Arrow multicast. \( w \) sends \( m_2 \), now on its way to \( x \).
Figure 4: Arrow multicast. \( m_1 \) and \( m_2 \) follow the arrows, flipping them back on the way. Note that \( m_2 \) has been “deflected” towards \( v \).
Figure 5: Arrow multicast. Both \( m_1 \) and \( m_2 \) find their predecessors concurrently and are multicast along with that information. Note that \( value(v) \) and \( value(u) \) are no longer valid.
5 The Combining Multicast
Combining trees [6, 7] are a well-known technique for distributed counting in which concurrent requests are combined. We now show how a distributed counting protocol based on combining trees can also be truncated to yield a distributed swap.
The directory maintains a tree $T$, a subgraph of $G$, spanning the members of the multicast group. The tree includes a fixed root $r$, and edges of the tree are oriented toward $r$. The root stores a value $\text{value}(r)$, initially $\bot$.
To execute $\text{swap}(a)$, where $a$ is a value, a node $v$ sends a $\text{swap}(v, a, a)$ message to its parent in $T$. If two messages $\text{swap}(u, a, b)$ and $\text{swap}(w, c, d)$ meet at a non-root node $y$, $b$ is designated to be the result of $w$’s swap, the messages are combined into a single message $\text{swap}(u, a, d)$, and the combined message is sent to $y$’s parent. (Multiple messages can be combined in this way.) When a $\text{swap}(u, a, b)$ message arrives at the root, the root’s value $\text{value}(r)$ is designated to be the result of $u$’s swap, and $\text{value}(r)$ is set to $b$.
An ordered multicast is performed in the same way, except that message ids replace values, and a node performs an unordered multicast as soon as it identifies a message’s predecessor.
This swap protocol can also be viewed as a truncated counting protocol. If we were to use the combining tree to generate sequence numbers, then a message would be assigned a sequence number only after it had completed a round trip to the root (possibly combined with other messages). Moreover, counting requires that messages lock nodes on the way up the tree, and unlock them on the way down, and a message that fails to combine with another concurrent message might have to wait for the latter to unlock a node. Finally, nodes need to maintain additional state information, for counting.
6 Discussion
In this section, we compare the two ordered multicast protocols and suggest a hybrid scheme which uses ideas from both. We also discuss how to enter and leave multicast groups and fault tolerance.
Figure 6: Combining multicast. Messages $m_1$, $m_2$ and $m_3$ start their journey towards the root.
Figure 7: Combining multicast. $m_1$ and $m_2$ combine. $m_2$ is multicast as $m_1$’s successor. $m_1m_2$ is shorthand for the message $\text{swap}(m_1, \text{id}(m_1), \text{id}(m_2))$
Figure 8: Combining multicast. $m_1m_2$ and $m_3$ combine. $m_1$ is multicast as $m_3$’s successor. $m_3m_1m_2$ continues towards the root.
Figure 9: Combining multicast. $m_3m_1m_2$ reaches the root. $m_3$ is multicast as the successor of $\bot$ (i.e. the first message in the total order). The value $id(m_2)$ is swapped into $value(r)$.
### 6.1 Comparison
It is possible to combine both swap protocols to construct a *hybrid* protocol. The arrow multicast has a nice *locality* property: swap-related message traffic occurs only on links between multicasting nodes, so if there is only one multicasting node, there is no swap-related traffic. In the combining tree, however, all swap-related message traffic passes through the root, even if there is only one multicaster.
The combining tree root node is thus a potential bottleneck. In the arrow multicast, there is no distinguished root, but any node might become a bottleneck under certain circumstances. If $u$ splits the directory tree into subtrees $T_0$ and $T_1$, and nodes in $T_0$ and $T_1$ take turns multicasting, then all message traffic passes through $u$.
Here is one way to alleviate possible bottlenecks. Consider a combining tree protocol in which the root node has been replaced by a sufficiently large collection of nodes running the arrow protocol. Such a “virtual root” could have a large in-degree, and still provide high throughput. Nodes lower in the combining tree could be represented by smaller arrow groups.
There are a variety of ways to combine distributed swap protocols to yield new protocols, and we think the area deserves further attention.
6.2 Entering and Leaving
We now briefly discuss how a node might enter or leave a multicast group. Both the arrow and the combining protocols use spanning trees for connecting the member nodes. Either way, joining the group is straightforward: a node $u$ just links itself as a leaf adjacent to any node $v$ already in the tree, and informs $v$ that it has done so. In the arrow protocol, $u$’s arrow points to $v$, while in the combining protocol, $v$ is $u$’s parent in the tree.
Leaving a group is similar. In the arrow protocol, node $u$ first “locks” its immediate neighbors in the tree, ensuring that message traffic between $u$ and the neighbors has quiesced. If $u$ is a sink, it chooses a neighbor $v$ and makes $v$ a sink in its place, setting $\text{link}(u) = v$, $\text{value}(v) = \text{value}(u)$ and $\text{link}(u) = u$. For each neighbor $w$ such that $\text{link}(w) = v$, it sets $\text{link}(w) = \text{link}(u)$. Node $u$ then unlocks its neighbors and leaves the group. The combining protocol is similar, except that the sink issue does not arise.
There are others ways of entering and leaving groups, but the important point is that group membership changes are local operations whose complexity depends on the degree of the node, not the size of the group.
6.3 Fault Tolerance
Fault tolerance is the subject of current research. It is straightforward to incorporate redundant links in either the arrow or combining tree protocols, permitting messages to circumnavigate some failed nodes. In the arrow protocol, however, it is more difficult to tolerate a sink node crash, and in the combining tree protocol, a root node crash.
We think that the challenge here is to define a sensible failure semantics, specifying the kind of behavior that can occur in the presence of node and link failures. We favor the following variation of the “total order with gaps” guarantee. If $m_0$ and $m_1$ are both delivered at nodes $u$ and $v$, then they are of course delivered in the same order at both. If $m_0$, $m_1$ and $m_2$ are delivered at $u$, but only $m_0$, and $m_2$ at $v$, then the application at $v$ is notified that there may be one or more missing messages between $m_0$ and $m_2$. This kind of fault-tolerance is consistent in spirit with that currently provided by modern reliable multicast protocols. It is relatively easy to implement, it is consistent with scalability (no global searches or transactions), and yet it leaves the application free to undertake more heroic recovery and repair methods if needed.
6.4 Conclusions
We have found the notion of distributed swap to be helpful in designing and analyzing scalable ordered multicast protocols. We think this approach merits more attention from the research community, and we hope to convince others to explore this approach.
References
|
{"Source-Url": "http://www.tik.ee.ethz.ch/file/e95e7f60aa50c37a3d6cecbaa11b5ad2/PODCMW00.pdf", "len_cl100k_base": 4442, "olmocr-version": "0.1.45", "pdf-total-pages": 13, "total-fallback-pages": 0, "total-input-tokens": 56986, "total-output-tokens": 5849, "length": "2e12", "weborganizer": {"__label__adult": 0.0003371238708496094, "__label__art_design": 0.0003120899200439453, "__label__crime_law": 0.00035500526428222656, "__label__education_jobs": 0.0006556510925292969, "__label__entertainment": 0.00014495849609375, "__label__fashion_beauty": 0.00014960765838623047, "__label__finance_business": 0.0003685951232910156, "__label__food_dining": 0.0004324913024902344, "__label__games": 0.0006504058837890625, "__label__hardware": 0.0022563934326171875, "__label__health": 0.000690460205078125, "__label__history": 0.0003659725189208984, "__label__home_hobbies": 0.00010782480239868164, "__label__industrial": 0.0005984306335449219, "__label__literature": 0.0003387928009033203, "__label__politics": 0.00029468536376953125, "__label__religion": 0.0005335807800292969, "__label__science_tech": 0.2132568359375, "__label__social_life": 0.00013148784637451172, "__label__software": 0.0234222412109375, "__label__software_dev": 0.75341796875, "__label__sports_fitness": 0.00033211708068847656, "__label__transportation": 0.000659942626953125, "__label__travel": 0.0002598762512207031}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 21723, 0.02057]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 21723, 0.398]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 21723, 0.88064]], "google_gemma-3-12b-it_contains_pii": [[0, 1269, false], [1269, 3778, null], [3778, 5656, null], [5656, 8430, null], [8430, 11128, null], [11128, 11992, null], [11992, 12437, null], [12437, 14556, null], [14556, 14985, null], [14985, 16479, null], [16479, 19026, null], [19026, 20646, null], [20646, 21723, null]], "google_gemma-3-12b-it_is_public_document": [[0, 1269, true], [1269, 3778, null], [3778, 5656, null], [5656, 8430, null], [8430, 11128, null], [11128, 11992, null], [11992, 12437, null], [12437, 14556, null], [14556, 14985, null], [14985, 16479, null], [16479, 19026, null], [19026, 20646, null], [20646, 21723, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 21723, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 21723, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 21723, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 21723, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 21723, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 21723, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 21723, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 21723, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 21723, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 21723, null]], "pdf_page_numbers": [[0, 1269, 1], [1269, 3778, 2], [3778, 5656, 3], [5656, 8430, 4], [8430, 11128, 5], [11128, 11992, 6], [11992, 12437, 7], [12437, 14556, 8], [14556, 14985, 9], [14985, 16479, 10], [16479, 19026, 11], [19026, 20646, 12], [20646, 21723, 13]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 21723, 0.0]]}
|
olmocr_science_pdfs
|
2024-11-23
|
2024-11-23
|
14e9cec961bcb5aa831c948bf957e3b801e3e303
|
Software Carry-Save for Fast Multiple-Precision Algorithms
David Defour, Florent de Dinechin
To cite this version:
David Defour, Florent de Dinechin. Software Carry-Save for Fast Multiple-Precision Algorithms. [Research Report] LIP RR-2002-08, Laboratoire de l'informatique du parallélisme. 2002, 2+10p. hal-02102038
HAL Id: hal-02102038
https://hal-lara.archives-ouvertes.fr/hal-02102038
Submitted on 17 Apr 2019
HAL is a multi-disciplinary open access archive for the deposit and dissemination of scientific research documents, whether they are published or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.
L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.
Software Carry-Save for Fast Multiple-Precision Algorithms
David Defour, Florent de Dinechin
Février 2002
Research Report N° 2002-08
Software Carry-Save
for Fast Multiple-Precision Algorithms
David Defour,
Florent de Dinechin
Février 2002
Abstract
This paper introduces a new machine representations of multiple-precision (MP) numbers, geared toward simple and fast implementations. We observe, in the usual high-radix representations, that carry management accounts for a lot of the complexity of the core multiple-precision algorithms (addition and multiplication). Our representation therefore trades space for simplicity: the digits of the multiple-precision numbers are coded on less bits than the machine numbers can offer. The reserved bits are used during MP addition and multiplication to guarantee that no overflow or rounding can occur in any internal computations. This leads to simple and therefore fast algorithms. In other words, all the carries generated in these internal computations are saved in these reserved bits, to be managed as late as possible. In addition to simplicity, this software carry-save representation allows to expose parallelism just like its hardware counterpart. An initial implementation of this representation is shown to compare favorably to other multiple-precision libraries.
Keywords: Multiple precision, representation, addition, multiplication.
Résumé
Cet article présente une nouvelle représentation machine des nombres multipréci-
sion, permettant des implementations simples et rapides. Nous observons que, dans les représentations usuelles en grande base, la propagation des retenues constitue une part importante de la complexité des algorithmes d’addition et multiplication. Nous proposons donc de coder les chiffres en grande base sur moins de précision que ce que la machine peut traiter. Les bits mis de côté sont utilisés, lors des additions et multiplications multiprecision, comme retenue conservée pour garantir qu’aucun dépassement de capacité n’a lieu pendant un calcul interne. Ceci conduit à des algorithmes plus simples, donc plus rapides même s’ils ont plus de chiffres à traiter pour une même précision. En outre, cette retenue conservée logicielle permet comme sa version matérielle des al-
gorithmes parallèles au niveau du chiffre. Les tests réalisés montrent que les processeurs superscalaires récents peuvent en tirer parti.
Mots-clés: Précision multiple, représentation, addition, multiplication.
1 Introduction
Most modern computers obey the IEEE-754 standard for floating-point (FP) arithmetic, which defines the well-known single and double precision FP formats, along with the behavior of the usual arithmetic operators in several rounding modes. For some applications, however, the precision provided by this standard (53 bits in double precision) is not enough. These applications include large-scale numerical simulations, but also very small computations where precision is paramount. For instance, previous research has shown that an internal precision of around 200 bits is needed to provide correctly rounded elementary functions in double precision [9].
1.1 An overview of multiple-precision formats
In addition to scientific computing packages such as Maple or Mathematica, many multiple-precision libraries exist, such as Briggs' double-double [2], Bailey's quad-double [8], the floating-point expansions of Daumas et al [7], or the GNU Multi Precision (GMP) library [3] – on top of which several other libraries are built (see MPFR [4] or Arithmos [6]). These libraries are widely used for numerical analysis, cryptography or computational geometry. Some offer arbitrary precision with static or dynamic precision control, other simply offer a fixed precision which is higher than that of the IEEE-754 standard.
All of these libraries internally represent MP numbers as arrays of digits, which are themselves machine numbers, i.e numbers in one of the native format on which the microprocessor can directly compute: integer, or IEEE-754 floating-point numbers. According to the type of machine numbers used, there are thus two classes of multiple-precision libraries:
Integer-based libraries This is the case of commercial packages like Maple or Mathematica. It is also the case of the GNU Multi Precision (GMP) library, in which the digits are integers of the native machine word size (currently 32 or 64 bits). In GMP, the core loops of both addition and multiplication are written in assembly language for most existing architectures, and are thus very efficient (all algorithms for the division use additions and/or multiplications, and we will usually not mention them in this paper). Conversions between integer-based MP format and IEEE-754 FP format, however, are sometimes fairly expensive.
FP-based libraries Briggs [2] double-double, Bailey's quad doubles [8] and Daumas' floating-point expansions [7] consist of the unevaluated sum of several double-precision FP numbers. Arithmetic operations on this format use only FP operations. The motivation here is that the floating-point units (FPUs) in modern processors are highly optimized: for example, in recent 64-bit architectures like UltraSparc and Itanium, floating-point multiplications are faster than their integer counterpart. Besides, superscalar processors have several such units, and the trend is towards having more FPUs than integer units.
Another advantage of FP based multiple precision is that conversion from IEEE-754 floating point to such a format is trivial, and conversion back is relatively easy. Addition and multiplication, however, are more complicated: When adding or multiplying two FP number, some precision can
be lost to rounding, and has to be recovered. This requires sophisticated
algorithms which have to be carefully proven, sometimes even requiring
the assistance of automatic theorem provers [5].
The purpose of this article is to propose an alternative internal format for
multiple precision which will address this last problem.
1.2 A new multiple-precision format for faster algorithms
Our format codes a MP number as a sum of integers or FP numbers, which
we will also call digits. However, to ensure that no precision is lost in the FP
multiplication of two digits, these digits don’t use all the precision available in
the machine format. They use sufficiently little precision to ensure that all the
internal computation performed in a MP addition or multiplication are exact. A
similar idea seems to be used by Abraham Ziv et al in their IBM mathematical
library with correct rounding [1], although we couldn’t find any article on the
subject.
Knowing that all the internal operations will be exact greatly simplifies the
algorithms for MP addition and multiplication. The format of course wastes
space, as it stores many zeroes instead of useful information. It also wastes
time, as it uses the machine operators to less than their full power. In the
sequel, we discuss this tradeoff, and demonstrate some tests which show that
the advantage of simpler algorithms prevails.
1.3 A carry-save representation expresses parallelism
Another very important aspect of the proposed format is that it allows to add
several MP numbers with only one carry propagation in the end. In this respect,
it is very similar to the carry-save representation commonly used in hardware
multipliers: Our format can be thought of as a software, high radix carry-save
representation, the carry being saved in the unused bits of each digit.
A parallel algorithm may seen a luxury in a software context. Indeed, as
our tests will show, recent super-scalar processors, with their many functional
units, can take advantage of it.
1.4 Outline of this paper
Section 2 presents in details the proposed representation, along with its main
motivation in a MP multiplication. Section 3 details the algorithms used to per-
form MP additions/subtractions and multiplications. Section 5 presents some
results of our initial implementation, comments and compares them to other
available multiple-precision libraries. Section 6 concludes the paper.
2 A format for fast multiple-precision multiplication
2.1 Overview of the standard MP multiplication algorithm
There are several multiple-precision multiplication algorithms. The simplest
one is similar to the multiplication algorithm learnt in elementary school, and
is depicted on Fig. 1. It should be pointed out that algorithms exist with a better asymptotic complexity (for instance the Karatsuba algorithm), however they become interesting for precisions much larger than those considered here.

The figure represents the two input numbers $X$ and $Y$, decomposed into their $n$ digits $x_i$ and $y_j$ (with $n = 4$ on the figure). Each digit is itself coded in $m$ bits of precision: These digits will be machine integers in GMP ($m = 32$ or 64), or IEEE-754 double-precision numbers in Bailey’s library ($m = 53$).
The algorithm (depicted on the figure) proceeds as follows:
- The first step is to produce an array of partial products $x_i y_j$. Each partial product is a $2m$-bit number.
- These partial products have then to be summed. There are at most $n$ of them in a column, which means that the sum $c_i$ in each column is a number of up to $2m + \lceil \log_2 n \rceil$ bits.
- Finally the column sums $c_i$ are decomposed into numbers of only $m$ bits.
This is done in an iterative manner by summing from right to left the numbers of equivalent weight, storing the lower $m$ bits as a digit of the result, and keeping the higher bits for the next iteration.
The exact product of two $n$-digit numbers is a $2n$-digit number. We consider here that we want the result as an $n$-digit number, therefore some rounding has to be done. In the sequel, we will simply not compute all the lower partial products, and give a bound on the error made. This choice has no influence on the validity of what follows. For example it is well known that correct rounding needs the computation of all the partial products, and an implementation of our format with correct rounding is possible.
With the previous description in mind, it should be clear that any implementation using, as digits, full machine numbers (be it integer or floating-point)
can not represent in one machine number the partial products, neither the column sums. Algorithmic tricks are therefore needed to get these values coded on two or more digits. In Bailey's FP based library, these tricks involve elaborate considerations on the rounding of the operations. In the case of GMP, specific assembly language instructions are used, exploiting at their best the facilities offered by each specific processor.
These various tricks imply in turn strong dependencies on the operations. In GMP, for instance, computing each line of partial product involves a carry propagation (each line is converted to a standard MP number). For a small \( n \), this may lead to poorer performance than the processor can offer. In Bailey's library, the dependencies are not even regular.
2.2 The proposed format
The idea behind our format is therefore to sacrifice enough machine precision in coding the digits of \( X \) and \( Y \) to ensure that each column sum \( c_i \) can fit on a machine number. If we note \( m_f \) the precision offered by the machine format, then each digit in our representation will only use \( m_r \) bits of this precision, and this condition can be expressed as:
\[
m_f > \log_2(n_r) + 2m_r
\]
This ensures that all the intermediate computations in the multiplication algorithms are exact, in the sense that their results fits in a machine number without any rounding error. This guarantee that the same holds for additions and subtractions.
Of course, we will need to compute a little bit more than four times the number of partial products computed in the dense implementations. But we observe that in these dense representation, computing and summing exactly these partial products ends up being more than four times more expensive than our simple, exact operations.
Equation (1) is a relation between the number \( m_r \) of bits stored on each machine number and the number of digits manipulated \( n_r \). The overall precision is the product \( n_r \times m_r \). Table 2 gives some values of these parameters for various machine word formats, using sensible values of \( m_r \).
<table>
<thead>
<tr>
<th>Machine word</th>
<th>( m_f )</th>
<th>( m_r )</th>
<th>( n_r )</th>
<th>max. precision</th>
</tr>
</thead>
<tbody>
<tr>
<td>IEEE double precision</td>
<td>52 \pm 1 bits</td>
<td>26 Bits</td>
<td>15 terms</td>
<td>300 Bits</td>
</tr>
<tr>
<td>IEEE double precision</td>
<td>52 \pm 1 bits</td>
<td>25 Bits</td>
<td>63 terms</td>
<td>1575 Bits</td>
</tr>
<tr>
<td>Double-extended (x86)</td>
<td>64 bits</td>
<td>30 Bits</td>
<td>31 terms</td>
<td>930 Bits</td>
</tr>
<tr>
<td>Double-extended (x86)</td>
<td>64 bits</td>
<td>29 Bits</td>
<td>127 terms</td>
<td>36883 Bits</td>
</tr>
<tr>
<td>64-bit integer</td>
<td>64 bits</td>
<td>30 Bits</td>
<td>15 terms</td>
<td>450 Bits</td>
</tr>
<tr>
<td>64-bit integer</td>
<td>64 bits</td>
<td>29 Bits</td>
<td>63 terms</td>
<td>1827 Bits</td>
</tr>
</tbody>
</table>
Figure 2: Some examples of precisions that can be reached with the proposed format.
We believe that our format is interesting only for moderate precisions (a few hundred bits), because the waste of space and time increases as \( m_r \) decreases for a given \( m_f \). However a detailed study of this tradeoff remains to be done.
2.3 Machine implementation
A MP number is represented in the proposed format as a structure $R$, as shown on Figure 3. The Software Carry Save Structure (SCSS) $R$ is composed of the following fields:
$R.digits[n_r]$ A table of $n_r$ digits with $m_r$ bits of precision, using either integer or FP machine numbers (we will chose the most efficient for a given machine);
$R.index$ An integer storing the index of the first digit in the range of representable numbers, as depicted on Figure 3;
$R.sign$ A sign information.
A SCSS number $R$ is said to be normal when each of its digit store information only on the least $m_r$ significant bits. The other bits from $m_i$ to $m_r$ of $R.digits$ field correspond to the carry field. If $R$ have a digit with a carry field different from 0 then $R$ is said to be unnormal.
In other words, the value $x$ of a representation $R$ is:
$$x = R.sign \times \sum_{j=1}^{n_r} R.digits[j] \times 2^{m_r \times (R.index-j)}$$
A MP number is defined as

In the case when FP machine numbers are used, their exponent field is unused. However, a trick allows to exploit their sign bit, along with the well-defined rounding properties of the IEEE-754 standard, to increase the precision of each word by one bit, which explains some values of Table 2. Due to lack of space we do not detail this trick here.
3 Arithmetic operations
In this section we present algorithms used to perform basic arithmetic operations. For easier comprehension, we adopt a syntax very similar to the C language syntax.
3.1 Conversion from double to SCSS
There are two ways to convert a double precision floating point number \( d \) into an SCSS representation. The first solution is to extract the exponent \( d_{\text{exp}} \) from \( d \) and then determine the corresponding \( R \_index \). This can be done by taking the integer part of \( \frac{d_{\text{exp}}}{m_r} \).
The second solution, described below, just uses some multiplications by \( 2^{-m_r} \). As we don’t have to extract the exponent from \( d \), it is faster than the first when the exponent of the input number is close to 0.
Algorithm 1 (double2SCSS)
\[ \text{Input:}\ A \text{ double precision floating point number } d. \]
\[ \text{Output:}\ A \text{ multi-precision number } R. \]
\[ \text{Method:}\ R \_index = 0; \]
\[ \text{if } d \text{ is a Nan, } +/ - \infty \text{ then} \]
\[ R = d; \quad \text{return}; \]
\[ \text{if } d > 0 \quad R \_sign = 1; \]
\[ \text{if } d < 0 \quad R \_sign = -1; \quad d = -d; \]
\[ \text{while } d > 2^{m_r} \text{ do} \quad R \_index++; \quad d = d \times 2^{-m_r}; \quad \text{for}(i = 1 \quad ; \quad i \leq n_r \quad ; \quad i++) \]
\[ R \_digits[i] = \lfloor d \rfloor; \]
\[ d = (d - R \_digits[i]) \times 2^{m_r}; \]
3.2 Renormalisation (carry propagation)
This step is used at the end of additions or multiplications to propagate the saved carries. It may be executed only once after several consecutive SCSS additions.
Working from low order to high order digits, each digit is split into two parts. The low \( m_r \) bits are a digit of the normalized result, and the upper part is the carry that has to be added to the next digit. To take high part from a floating point digit, we use a well-known trick consisting of adding and then subtracting a constant. When working with integer, the split can be done by using an integer mask.
Algorithm 2 (Carry propagation)
\[ \text{Input:}\ A \text{ multi-precision number } A \text{ where each digit are less than } 2^{m_r-1}. \]
\[ \text{Output:}\ A \text{ multi-precision number } R \text{ with carry information set to 0.} \]
\[ \text{Method:}\ C[n_k + 1] = 0; \]
\[ R \_index = A \_index; \]
\[ \text{for}(k = n_r \quad ; \quad k \geq 0 \quad ; \quad k-- ) \]
\[ \text{High} = (A[k] + (2^{m_r} + 2^{m_r+1} - 1)) \]
\[ - (2^{m_r} + 2^{m_r+1} - 1); \]
\[ C[k+1] = A[k] - \text{High}; \]
\[ C[k] = \text{High} \times 2^{-m_r}; \]
David Defour, Florent de Dinechin
\[ k = 1; \]
\[ \text{While } C[k] = 0 \text{ do } \quad k++; \quad R.index--; \]
\[ \text{for } (j = 1; j \leq n_r; j++, k++) \quad R.digits[j] = C[k]; \]
**Theorem 1** This algorithm normalizes a SCSS number with a relative error less than \(2^{m_r \times (n_r - 1) + 1}\)
**Proof** The worst case happens when there is a carry-out from \(C.digits[1]\). In this case we have to perform a translation of digits that leads to the loss of the last digit. Then the result is composed of \((n_r - 1)\) digits with \(m_r\) bits of precision. The first digit has at least one bit of precision. Therefore the final relative error is then less than \(2^{m_r \times (n_r - 1) + 1}\)
### 3.3 Addition and subtraction
The addition of two numbers SCSS is done by adding in parallel the digits of same order. These additions will be exact as long as each digit is less than \(2^{m_i - 2}\). The advantage of this representation is therefore that we can sum-up a huge amount of SCSS numbers avoiding the time-expensive carry propagate step.
**Example 1** Let us consider integer arithmetic with \(m_i = 64\) and \(m_r = 30\) (see Table 2). Then we can add approximately \(8 \times 10^9\) normal SCSS numbers.
If the user wants to perform another operation different than addition, as for example a multiplication it is recommended to perform a “renormalisation” that set all the carry field to 0. This necessity of the renormalisation depends on the maximum value for each digits and on the value chosen for \(m_r, m_i\) and \(n_r\).
The subtraction is very similar to the addition algorithm, although more depending on the choice of integer or FP format. It may also classically lead to a cancellation, which may need an update of the index of the result.
### 3.4 Multiplication
In the multiplication of two multiple precision numbers, we only perform the operations significant to the result. Contrary to the addition algorithm no dramatic cancellation of digits can appears. The SCSS multiplication is done in three steps, depicted on the figure (1):
1. Compute the partial products. These partial products correspond to digit per digit multiplications, and can be done in parallel.
2. Sum up the partial products of same order. Each column can be summed in parallel, as for the addition algorithm.
3. Call the renormalisation/carry-propagation procedure.
The last step may even be skipped in some contexts (typically, a multiplication followed by one or several additions as in polynomial evaluations, if the values of \(m_r, m_i, n_r\) allow). This may allow for further optimization.
4 Conversion from SCSS to floating-point
In applications where conversion from the multi-precision format to the working precision are done very often, this step needs to be done very fast. With SCSS representation, this conversion is composed of a few multiplications and additions. Note that no renormalisation of the input SCSS number is needed for this algorithm.
Algorithm 3 (Conversion to floating-point)
Input: A SCSS number $A$.
Output: A double precision floating-point number $d$.
Method:
$d = A\cdot \text{sign} \times 2^{A\cdot \text{index} \times m_r} \times (\text{A.digits}[0]+2^{-m_r} \times \text{A.digits}[1]+2^{-2m_r} \times \text{A.digits}[2]+2^{-3m_r} \times \text{A.digits}[3]);$
The number of digits of a SCSS number to add in this algorithm depends on the parameters of the representation. In this algorithm we used 4 digits corresponding to the worst case for $m_i = 53$ and $m_r = 26$.
5 Results and timing
It is quite difficult to compare the performances of MP libraries. The cost of a multiplication or addition is very different from one machine to another one, and also depends on the context of this operation in today's sophisticated processors with deep pipelines and out-of-order execution. Even the definition of an operation is machine-dependent (32- or 64-bit, availability or not of a fused multiply-and-add).
We have written (in C) and refined several implementations of this library, with various machine formats and instruction ordering. In our tests, we use the same code, compiled with the same compiler (gcc 2.95.4), the only change being the machine format which can be floating-point or integer (we chose the best). In both cases we ensure 200 bits of precision.
We compare our code with the reference multiple-precision library GMP[3] (more precisely it floating representation MPF), with Bailey's quad-double library [8], and also with Ziv's library[1]. Each result is obtain by measuring the execution times on $10^6$ random values (the same values are used for all the libraries). For clarity we normalized results to SCSS library.
Each additions and multiplications performed with SCSS algorithms include a call to the renormalisation procedure (carry propagate). So the following results don't show all the potentiality of our methods.
The multiplication times on Celeron and Itanium seem contradictory. An interpretation could be that we get the best results on the Itanium architecture, whose instruction set was designed with parallelism in mind, and therefore makes better use of our more parallel algorithms. However this hypothesis has to be taken with caution. A deeper investigation is needed to see what is the
influence of the compiler and coding style on these results. It should also be mentioned that the quad-double library is written in C++ language, which may affect its performances.
6 Conclusion and future work
We have presented the software carry-save representation for multiple-precision numbers that allows simpler, more parallel, and therefore faster MP additions and multiplications. This representation can provide very high precision, however is probably most suited for limited precisions of up to a few hundred bits.
The main idea developed in this method is to avoid overflows/rounding/carry in the machine operations internal to a MP operation. Being parallel, the code is suited to modern highly super-scalar processors. Being simple, it is also fairly compact.
After our first tests, the most obvious limitation of this method is its high dependence to the architecture. We will try to investigate the interaction between code, compiler, and processor architecture to write code which performs well on most architectures. Using IEEE-754 normalized arithmetic should allow us to avoid GMP-like machine-specific assembly optimizations.
Future work also include real-world tests of this library, in particular to compute transcendental functions such as cosine, sine, exponential.
References
http://www-epidem.plantsci.cam.ac.uk/~kbriggs/doubledouble.html
<table>
<thead>
<tr>
<th>Description</th>
<th>SCSS lib</th>
<th>Ziv lib</th>
<th>Bailey lib</th>
<th>GMP lib</th>
</tr>
</thead>
<tbody>
<tr>
<td>Itanium 733 Mhz</td>
<td>1</td>
<td>7.84</td>
<td>37.71</td>
<td>1.23</td>
</tr>
<tr>
<td>x86 Celeron 566 Mhz</td>
<td>1</td>
<td>0.81</td>
<td>8.45</td>
<td>0.32</td>
</tr>
<tr>
<td>Sun Ultra-5 400 Mhz</td>
<td>1</td>
<td>3.28</td>
<td>38.41</td>
<td>1.47</td>
</tr>
</tbody>
</table>
Figure 6: Comparisons of MP multiplication times
<table>
<thead>
<tr>
<th>Description</th>
<th>SCSS lib</th>
<th>Ziv lib</th>
<th>Bailey lib</th>
<th>GMP lib</th>
</tr>
</thead>
<tbody>
<tr>
<td>Itanium 733 Mhz</td>
<td>1</td>
<td>7.15</td>
<td>0.66</td>
<td>1.57</td>
</tr>
<tr>
<td>x86 Celeron 566 Mhz</td>
<td>1</td>
<td>6.0</td>
<td>0.19</td>
<td>2.37</td>
</tr>
<tr>
<td>Sun Ultra-5 400 Mhz</td>
<td>1</td>
<td>8.64</td>
<td>0.46</td>
<td>4.36</td>
</tr>
</tbody>
</table>
Figure 7: Comparisons of conversion times from MP to double-precision
Acknowledgements
The support of Intel and HP through the donation of an Itanium based machine is gratefully acknowledged.
|
{"Source-Url": "https://hal-lara.archives-ouvertes.fr/hal-02102038/file/RR2002-08.pdf", "len_cl100k_base": 6433, "olmocr-version": "0.1.53", "pdf-total-pages": 13, "total-fallback-pages": 0, "total-input-tokens": 59152, "total-output-tokens": 7322, "length": "2e12", "weborganizer": {"__label__adult": 0.00034499168395996094, "__label__art_design": 0.0004754066467285156, "__label__crime_law": 0.00039076805114746094, "__label__education_jobs": 0.0007987022399902344, "__label__entertainment": 0.0001246929168701172, "__label__fashion_beauty": 0.00017964839935302734, "__label__finance_business": 0.0003273487091064453, "__label__food_dining": 0.0004627704620361328, "__label__games": 0.000598907470703125, "__label__hardware": 0.00313568115234375, "__label__health": 0.0006742477416992188, "__label__history": 0.0004253387451171875, "__label__home_hobbies": 0.00014030933380126953, "__label__industrial": 0.0011463165283203125, "__label__literature": 0.0003037452697753906, "__label__politics": 0.0003752708435058594, "__label__religion": 0.000789642333984375, "__label__science_tech": 0.37353515625, "__label__social_life": 0.00011330842971801758, "__label__software": 0.01520538330078125, "__label__software_dev": 0.59912109375, "__label__sports_fitness": 0.0003509521484375, "__label__transportation": 0.0007076263427734375, "__label__travel": 0.00021064281463623047}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 27203, 0.03246]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 27203, 0.72849]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 27203, 0.83316]], "google_gemma-3-12b-it_contains_pii": [[0, 964, false], [964, 1100, null], [1100, 3444, null], [3444, 6669, null], [6669, 9360, null], [9360, 11299, null], [11299, 14359, null], [14359, 15936, null], [15936, 18379, null], [18379, 20967, null], [20967, 23654, null], [23654, 25219, null], [25219, 27203, null]], "google_gemma-3-12b-it_is_public_document": [[0, 964, true], [964, 1100, null], [1100, 3444, null], [3444, 6669, null], [6669, 9360, null], [9360, 11299, null], [11299, 14359, null], [14359, 15936, null], [15936, 18379, null], [18379, 20967, null], [20967, 23654, null], [23654, 25219, null], [25219, 27203, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 27203, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 27203, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 27203, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 27203, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 27203, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 27203, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 27203, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 27203, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 27203, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 27203, null]], "pdf_page_numbers": [[0, 964, 1], [964, 1100, 2], [1100, 3444, 3], [3444, 6669, 4], [6669, 9360, 5], [9360, 11299, 6], [11299, 14359, 7], [14359, 15936, 8], [15936, 18379, 9], [18379, 20967, 10], [20967, 23654, 11], [23654, 25219, 12], [25219, 27203, 13]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 27203, 0.08738]]}
|
olmocr_science_pdfs
|
2024-12-10
|
2024-12-10
|
00b986d016af2015648ae7158b21653e5be728cd
|
Package ‘rcorpora’
July 17, 2018
**Title** A Collection of Small Text Corpora of Interesting Data
**Version** 2.0.0
**Maintainer** Gábor Csárdi <csardi.gabor@gmail.com>
**Description** A collection of small text corpora of interesting data. It contains all data sets from ‘dariusk/corpora’. Some examples: names of animals: birds, dinosaurs, dogs; foods: beer categories, pizza toppings; geography: English towns, rivers, oceans; humans: authors, US presidents, occupations; science: elements, planets; words: adjectives, verbs, proverbs, US president quotes.
**License** CC0
**categories**
List data set categories in the corpora package
**corpora**
Load a data set from the corpora package
---
**Description**
List data set categories in the corpora package
**Usage**
categories()
**Value**
Character vector of category names.
**Description**
corpora is a collection of small corpora of interesting data for the creation of bots and similar stuff.
**Usage**
corpora(which, category)
**Arguments**
- `which`: The data set to load, a string. If not given, then all data sets in the package are listed.
- `category`: If given, which must be missing, and the data sets in the given category are listed.
Details
This project is a collection of static corpora (plural of "corpus") that are potentially useful in the creation of weird internet stuff. I’ve found that, as a creator, sometimes I am making something that needs access to a lot of adjectives, but not necessarily every adjective in the English language. So for the last year I’ve been copy/pasting an adjs.json file from project to project. This is kind of awful, so I’m hoping that this project will at least help me keep everything in one place.
I would like this to help with rapid prototyping of projects. For example: you might use nouns.json to start with, just to see if an idea you had was any good. Once you’ve built the project quickly around the nouns collection, you can then rip it out and replace it with a more complex or exhaustive data source.
I’m also hoping that this can be used as a teaching tool: maybe someone has three hours to teach how to make Twitter bots. That doesn’t give the student much time to find/scrape/clean/parse interesting data. My hope is that students can be pointed to this project and they can pick and choose different interesting data sources to meld together for the creation of prototypes.
See https://github.com/dariusk/corpora
Value
A data frame containing the data set (if which is given), or a character vector of data set names.
Data set categories
- animals
- archetypes
- architecture
- art
- colors
- corporations
- divination
- film-tv
- foods
- games
- games/bannedGames
- games/bannedGames/argentina
- games/bannedGames/brazil
- games/bannedGames/china
- games/bannedGames/denmark
- geography
- governments
- humans
- instructions
- materials
- mathematics
- medicine
- music
• mythology
• objects
• plants
• religion
• science
• societies_and_groups
• societies_and_groups/designated_terrorist_groups
• societies_and_groups/fraternities
• sports
• sports/football
• technology
• transportation
• travel
• words
• words/emoji
• words/literature
• words/stopwords
• words/word_clues
Data sets
animals/birds_antarctica Birds of Antarctica, grouped by family Source: https://en.wikipedia.org/wiki/List_of_birds_of_Antarctica
animals/birds_north_america Birds of North America, grouped by family Source: http://listing.aba.org/aba-checklist/
animals/cats
animals/collateral_adjectives Collateral adjectives for animals.
animals/common
animals/dinosaurs A list of dinosaurs.
animals/dog_names 1000 popular dog names from the New York City Department of Health’s dog licensing data. Names are roughly in order, but that may not be totally reliable.
animals/dogs A list of dog breeds.
animals/donkeys
animals/horses
animals/ponies
archetypes/artifact Artifact archetypes.
archetypes/character Common character archetypes.
archetypes/event Archetypal events.
archetypes/setting Setting and location archetypes.
architecture/passages Ways to enter or exit a place.
architecture/rooms Different kinds of rooms
art/isms A list of modernist art isms.
colors/crayola List of Crayola crayon standard colors
corpora
colors/dulux
colors/google_material_colors
colors/paints List of assorted paint colors from various brands.
colors/palettes The top 200 most popular palettes on colourlovers.com
colors/web_colors List of named HTML colors
colors/xkcd The 954 most common RGB monitor colors, as defined by several hundred thousand participants in the xkcd color name survey.
corporations/cars A list of car manufacturers.
corporations/djia Corporations of the Dow Jones Industrial Average
corporations/fortune500 The 2014 Fortune 500 list
corporations/industries A list of all industries on LinkedIn, as of May 21, 2013 Source: http://robertwdempsey.com/industries
corporations/nasdaq Corporations of the NASDAQ 100
corporations/newspapers A list of newspapers scraped in early 2013.
divination/tarot_interpretations Tarot card interpretations, from Mark McElroy’s _A Guide to Tarot Meanings_ (http://www.madebymark.com/a-guide-to-tarot-card-meanings/)
divination/zodiac Zodiac signs and associated information, both Western and Eastern. Source: https://en.wikipedia.org/wiki/Astrological_sign
film-tv/game-of-thrones-houses Game of Thrones Houses
film-tv/iab_categories
film-tv/netflix_categories Netflix Movie Categories.
film-tv/popular-movies A bunch of movies, mostly Best Picture winners or nominees, scraped from the web.
film-tv/tv_shows 1000 entries from the list of TV shows at http://en.wikipedia.org/wiki/List_of_television_programs_by_name
foods/apple_cultivars The 1000 most popular apple cultivars in the USDA’s Pomological Watercolor collection.
foods/bad_beers Beers with the 100 lowest scores on BeerAdvocate, adapted from https://www.beeradvocate.com/lists/bottom/
foods/beer_categories A list of beer categories.
foods/beer_styles A list of beer styles.
foods/breads_and_pastries A list of classic breads and sweet pastries.
foods/combine A list of recipe instructions.
foods/condiments A list of condiments
foods/curds A list of curds, cheeses, and other fermented dairy products
foods/fruit A list of fruits.
foods/herbs_n_spices A list of herbs and spices, and mixtures of the two.
foods/hot_peppers Capsicum cultivars (hot peppers)
foods/iba_cocktails Cocktails recognized by the International Bartenders Association for use in the World Cocktail Competition.
foods/menuItems A list of the top 1000 most appearing menu items from the 1850s to today from the New York Public Library’s “What’s on the menu?” project. Please credit The New York Public Library as source on any applications or publications. http://menus.nypl.org/data
foods/pizzaToppings A list of pizza toppings.
foods/sandwiches A list of sandwiches.
corpora
foods/sausages A list of sausages
foods/scotch_whiskey A list of scotch whiskies
foods/tea types of tea
foods/vegetable_cooking_times Approximate cooking times for various vegetables Source: http://recipes.howstuffworks.com/food-techniques/how-to-cook-vegetables24.htm
foods/vegetables A list of vegetables.
foods/wine_descriptions A list of words commonly used to describe wine.
games/bannedGames/argentina/bannedList A list of video games banned in Argentina
games/bannedGames/brazil/bannedList A list of video games banned in Brazil
games/bannedGames/china/bannedList A list of video games banned in China.
games/bannedGames/denmark/bannedList A list of video games banned in Denmark
games/cluedo Characters, rooms and weapons from the board game Cluedo / Clue.
games/dark_souls_iii_messages Organized components from the Dark Souls III message system
games/jeopardy_questions A sampling of 1000 Jeopardy questions and metadata. For the full dataset, see http://www.reddit.com/r/datasets/comments/1uyd0t/200000_jeopardy_questions_in_a_json_file/
games/pokemon Source: https://github.com/UberGames/iPokedex-DB
games/scrabble Tile distribution and points for the English-language edition of Scrabble
games/street Fighter_ii Street Fighter II fighting moves
games/trivial_pursuit Pie categories and colors from Trivial Pursuit
games/wrestling_moves A list of professional wrestling moves
games/zelda
geography/canada_provinces_and_territories A list of Canadian provinces and territories.
geography/canadian_municipalities Top 100 Canadian municipalities by 2011 population Source: https://en.wikipedia.org/wiki/List_of_the_100_largest_municipalities_in_Canada_by_population
geography/countries A list of countries.
geography/countries_with_capitals A list of countries and its respective capitals.
geography/english_towns_cities Two lists: one for English towns, one for English cities.
geography/japanese_prefectures Japanese regions and prefectures.
geography/nationalities A list of nationalities. Source: https://www.gov.uk/government/publications/nationalities/list-of-nationalities
geography/nyc_neighborhood_zips Neighborhoods of New York City and their corresponding ZIP codes. Normal ZIP code caveats apply. Source: Compiled by United Health Fund and distributed by the New York State Department of Health: https://www.health.ny.gov/statistics/cancer/registry/appendix
geography/sf_neighborhoods San Francisco neighborhoods and their locations
geography/us_airport_codes IATA and ICAO airport codes for the primary commercial airports in each state.
geography/us_cities Top 1000 U.S. cities by population (2016 estimates) Source: US Census American Community Survey 2016 5-year Data
governments/mass-surveillance-project-names This is a list of government surveillance projects and related databases throughout the world. Source: Data found here: https://en.wikipedia.org/wiki/List_of_government_mass_surveillance_projects
governments/nsa_projects A list of NSA project code names. Source: All data here is from https://docs.google.com/spreadsheets/d/1Uc1hrGqIweF0rgJ1HCbmT_0w9CYCCwZTWBGOWydsqE/htmlview?
governments/uk_political_parties A list of uk political parties. Source: http://www.electoralcommission.org.uk/export on 8th May 2015
governments/us_federal_agencies A list of federal agencies. Source: This data was sourced from the GSA's list of .gov domains https://github.com/GSA/data/blob/gh-pages/dotgov-domains/2014-12-01-federal.csv
humans/2016_us_presidential_candidates All individuals who filed a Statement of Candidacy with the FEC to register as a presidential candidate in the 2016 United States election.
humans/atus_activities Activity category codes used by the US Bureau of Labor Statistics in its American Time Use Survey. Categories either come with a set of example activities, or are standalone ’miscellaneous’ categories denoted ’not elsewhere classified’. Source: https://www.bls.gov/tus/lexicons.
humans/authors
humans/bodyParts A list of common human body parts.
humans/britishActors A bunch of British actors.
humans/celebrities Celebrities
humans/descriptions A list of adjectives for describing people, taken from www.enchantedlearning.com/wordlist/adjectivesforpeople.shtml
humans/englishHonorifics English honorifics.
humans/famousDuos Famous duos
humans/firstNames First names of men and women, pulled from the US Census for the 2000s.
humans/lastNames Last names of people, pulled from the US Census for the 2000s.
humans/moods A list of words that naturally complete the phrase ’They were feeling...’.
humans/norwayFirstNamesBoys First names of boys, pulled from Statistics Norway 2015. Sorted from high to low distribution.
humans/norwayFirstNamesGirls First names of girls, pulled from Statistics Norway 2015. Sorted from high to low distribution.
humans/norwayLastNames Last names of people, pulled from Statistics Norway 2015. Sorted from high to low distribution.
humans/occupations A list of occupations (jobs that people might have).
humans/prefixes Prefixes taken from a form on an airline website.
humans/richpeople A bunch of rich people from a Forbes listicle, including the source article, img, and name
humans/scientists List of particularly famous scientists
humans/spanishFirstNames A list of common Spanish first names of men and women. Source: https://github.com/olea/lemarios
humans/spanishLastNames A list of common Spanish last names. Source: https://github.com/olea/lemarios
humans/spinalTapDrummers Deceased drummers from the fictional rock band Spinal Tap, taken from Wikipedia.
humans/suffixes Suffixes taken from a form on an airline website.
humans/thirdPersonPronouns Third person personal pronouns with case
humans/tolkienCharacterNames Character names from Tolkien’s Middle Earth, from https://en.wikipedia.org/wiki/List_of_Middle-earth_characters
humans/us_presidents Copy of JSON retrieved from https://www.govtrack.us/api/v2/role?role_type=president. The ID here matches the one in the corpora/data/words/us_president_quotes.json file
humans/wrestlers A bunch of WWE wrestlers nicknames
instructions/laundry_care A list of laundry care instructions
materials/abridged-body-fluids abridged body fluids
materials/building-materials building materials
materials/carbon-allotropes carbon allotropes
materials/decorative-stones decorative stones
materials/fabrics fabrics
materials/fibers fibers
materials/gemstones A list of the names of materials commonly used as gemstones Source: https://en.wikipedia.org/wiki/List_of_gemstone_species
materials/layperson-metals layperson metals
materials/metal metals
materials/natural-materials natural materials
materials/packaging packaging
materials/plastic-brands plastic brands
materials/sculpture-materials sculpture materials
materials/technical-fabrics technical fabrics
mathematics/fibonnaciSequence The first 1000 numbers in the Fibonacci Sequence
mathematics/primes The first 1000 prime numbers.
mathematics/primes_binary The first 1000 prime numbers in binary.
mathematics/trigonometry A list of trigonometric functions, formulas, equations, etc..
medicine/diagnoses International Statistical Classification of Diseases and Related Health Problems, 10th revision Source: http://www.cdc.gov/nchs/icd/icd10cm.htm
medicine/drugNameStems A list of generic pharmaceutical drug name stems. Hyphens indicate whether a stem appears at the beginning, middle, or end of the name. Source: http://druginfo.nlm.nih.gov/drugportal
**music/a_list_of_guitar_manufacturers** A list of guitar manufacturers. Source: https://en.wikipedia.org/wiki/List_of_guitar_manufacturers
**music/bands_that_have_opened_for_tool** Bands that have opened for Tool. You must be really dedicated to your music if you are willing to play before Tool fans.
**music/female_classical_guitarists** A list of women classical guitarists. Source: https://en.wikipedia.org/wiki/List_of_women_classical_guitarists
**music/genres** A list of musical genres taken from Wikipedia article titles.
**music/hamilton_musical_obcrecording_actors_characters** Actors and the named characters played by them in the Original Broadway Cast recording of Hamilton: An American Musical. Actors who played multiple characters are listed multiple times. Source: https://en.wikipedia.org/wiki/Hamilton_(musical)
**music/instruments** Musical Instruments
**music/mtv_day_one** Music videos broadcast on MTV’s first day. Source: https://en.wikipedia.org/wiki/First_music_videos_aired_on_MTV
**music/rock_hall_of_fame** Artists who have been added to the Rock N’ Roll Hall of Fame along with their year of induction. Source: https://en.wikipedia.org/wiki/List_of_Rock_and_Roll_Hall_of_Fame_inductees
**music/xxl_freshman** Every rapper that’s ever made the XXL Annual Freshman Cover
**mythology/greek_gods** Gods and goddesses from Greek myth
**mythology/greek_monsters** Monsters from Greek myth
**mythology/greek_myths_master**
**mythology/greek_titans** Titans from Greek myth
**mythology/hebrew_god** Hebrew names of God used in the Old Testament Bible
**mythology/lovecraft** Deities and supernatural creatures from the works of Lovecraft and the Cthulhu mythos.
**mythology/monters** A list of monsters and other mythic creatures
**mythology/norse_gods** Gods and goddesses of Norse and Germanic myth
**objects/clothing** List of clothing types
**objects/corpora_winners** Winners in the Corpora Brackets, from https://twitter.com/corporabrackets
**objects/objects** List of household objects
**plants/cannabis** 420 popular strains of cannabis
**plants/flowers**
**plants/plants** List of plants by common name. Source: https://en.wikipedia.org/wiki/List_of_plants_by_common_name
**religion/christian_saints**
**religion/fictional_religions**
**religion/parody_religions**
**religion/religions**
**science/elements**
**science/hail_size** Analogous objects for various hail sizes, adapted from http://www.spc.noaa.gov/misc/tables/hailsize.htm
**science/minor_planets** List of names of the first 1000 numbered minor planets
**science/planets** Planets (including dwarf planets as recognized by the IAU) that orbit the Sun, with their natural satellites.
**science/pregnancy**
**science/toxic_chemicals**
**science/weather_conditions** A list of phrases describing weather conditions. This list includes all possible phrases that may be provided by the US National Weather Service’s feeds of current weather conditions. Source: http://w1.weather.gov/xml/current_obs/weather.php
societies_and_groups/animal_welfare
societies_and_groups/designated_terrorist_groups/australia
societies_and_groups/designated_terrorist_groups/canada
societies_and_groups/designated_terrorist_groups/china
societies_and_groups/designated_terrorist_groups/egypt
societies_and_groups/designated_terrorist_groups/european_union
societies_and_groups/designated_terrorist_groups/india
societies_and_groups/designated_terrorist_groups/iran
societies_and_groups/designated_terrorist_groups/israel
societies_and_groups/designated_terrorist_groups/kazakhstan
societies_and_groups/designated_terrorist_groups/russia
societies_and_groups/designated_terrorist_groups/saudi_arabia
societies_and_groups/designated_terrorist_groups/tunisia
societies_and_groups/designated_terrorist_groups/turkey
societies_and_groups/designated_terrorist_groups/uae
societies_and_groups/designated_terrorist_groups/ukraine
societies_and_groups/designated_terrorist_groups/united_kingdom
societies_and_groups/designated_terrorist_groups/united_nations
societies_and_groups/designated_terrorist_groups/united_states
societies_and_groups/fraternities/coeducational_fraternities
societies_and_groups/fraternities/defunct
societies_and_groups/fraternities/fraternities
societies_and_groups/fraternities/professional
societies_and_groups/fraternities/service
societies_and_groups/fraternities/sororities
societies_and_groups/semi_secret
sports/football/epl_teams Current (as of November 2016) teams in the EPL (English Premier League) and where they play
sports/football/laliga_teams Teams in the Spanish Primera División, La Liga(2017-18) with their details
sports/football/serieA Teams in the Italian First División, Serie A(2017-18) with their details
sports/mlb_teams Current (as of 2016) Major League Baseball teams and where they play
sports/nba_mvp NBA MVP award winners 1956-2017
sports/nba_teams Current (as of 2016) teams in the NBA and where they play
sports/nfl_teams Current (as of 2016) teams in the NFL and where they play
sports/nhl_teams Current (as of 2016) teams in the NHL and where they play
sports/olympics Olympic Games with host city, host nation, olympiad number (different for winter and summer), year, start date, end date, countries participating, athletes participating, and number of events. Source: Compiled from information on Olympics.org
technology/appliances A list of home appliances
technology/computer_science names of technologies related to computer science
corpora
technology/fireworks A list (ooh!) of firework effects (aah!)
technology/guns_n_rifles weapons used in mass shootings in the U.S.A.
technology/knots A list of knot names.
technology/lisp a list of LISP dialects
technology/new_technologies new or emerging technologies
technology/photo_sharing_websites Photo sharing websites
technology/programming_languages
technology/social_networking_websites Social networking websites
technology/video_hosting_websites Video hosting websites
transportation/commercial-aircraft
travel/lcc
words/adjs A list of English adjectives.
words/adverbs
words/closed_pairs closed pairs in English i.e both words rhyme with each other and only with each other. from https://en.wikipedia.org/wiki/List_of_closed_pairs_of_English_rhyming_words
words/common Common English words.
words/compound A partial list of English compound words.
words/crash_blossoms confusing or misleading headlines
words/eggcorns Commonly mistaken English phrases most likely caused by hearing them rather than reading them (eggcorns) Source: Most of the examples come from http://eggcorns.lascribe.net/
words/emoji/cute_kaomoji A general corpus of cute kaomoji.
words/emoji/emoji All the Unicode emoji.
words/encouraging_words a list of encouraging words to tell someone about something they created
words/ergative_verbs 'Ergative' verbs in English can be used both transitively and intransitively. Source: Curated from https://en.wiktionary.org/wiki/Category:English_ergative_verbs
words/expletives Common expletives and spelling variants used in internet comments.
words/harvard_sentences The Harvard sentences are a collection of sample phrases that are used for standardized testing of Voice over IP, cellular, and other telephone systems. They are phonetically balanced sentences that use specific phonemes at the same frequency they appear in English. (description from https://en.wikipedia.org/wiki/Harvard_sentences). The data represents a version with minor typos removed.
words/infinitive_verbs
words/interjections a list of exclamatory words and expressions from http://www.enchantedlearning.com/wordlist/interjections.shtml
words/literature/infinitejest List of names from the novel Infinite Jest by David Foster Wallace
words/literature/lovecraft_words H.P Lovecraft favorite words, from http://arkhamarchivist.com/wordcount-lovecraft-favorite-words/
words/literature/mr_men_little_miss Mr Men and Little Miss characters Source: http://www.mrmens.com
words/literature/shakespeare_sonnets Shakespeare’s sonnets.
words/literature/shakespeare_words Words coined by Shakespeare, from http://www.pathguy.com/shakeswo.htm
words/literature/technology_quotes
words/nouns A list of English nouns.
words/oprah_quotes Words of wisdom by Oprah Winfrey
words/personal_nouns List of personal nouns in the 1890 Webster’s Unabridged Dictionary. Assembled by Cory Taylor from Project Gutenberg’s HTML edition of the dictionary: http://www.gutenberg.org/ebooks/673
Source: https://github.com/coryandrewtaylor/Personal-Nouns
words/personal_pronouns
words/prepositions A list of English prepositions, sourced from Wikipedia.
words/proverbs A list of proverbs sourced from http://tww.id.au/proverbs/proverbs.html
words/resume_action_words Resume action words Source: http://careercenter.umich.edu/article/resume-action-words
words/rhymeless_words English words for which there is no perfect rhyme, taken from https://en.wikipedia.org/wiki/List_of_English_words_without_rhymes
words/spells A list of Harry Potter spells and descriptions
words/state_verbs
words/states_of_drunkenness A list of states of drunkenness.
words/stopwords/ar Arabic stop words
words/stopwords/bg Arabic stop words
words/stopwords/cs Czech stop words
words/stopwords/da Danish stop words
words/stopwords/de German stop words
words/stopwords/en English stop words
words/stopwords/es Spanish stop words
words/stopwords/fi Finnish stop words
words/stopwords/fr French stop words
words/stopwords/gr Greek stop words
words/stopwords/it Italian stop words
words/stopwords/jp Japanese stop words
words/stopwords/lv Latvian stop words
words/stopwords/nl Dutch stop words
words/stopwords/no Norwegian stop words
words/stopwords/pl Polish stop words
words/stopwords/pt Portuguese stop words
words/stopwords/ru Russian stop words
words/stopwords/sk Slovak stop words
words/stopwords/sv Swedish stop words
words/stopwords/tr Turkish stop words
words/strange_words Do you know the feeling when you repeat some word many times and it starts to sound weird? Below is the list of some of the strangest sounding words that people submitted during my Intro to Computational Media Class at ITP, NYU.
words/units_of_time A list of units of time ordered by magnitude, both formal and colloquial.
**corpora**
**words/verbs** A list of English verbs.
**words/verbs_with_conjugations**
**words/word_clues/clues_five** a list of common 5-letter words followed by crossword/thesaurus-style hints for that word
**words/word_clues/clues_four** a list of common 4-letter words followed by crossword/thesaurus-style hints for that word
**words/word_clues/clues_six** a list of common 6-letter words followed by crossword/thesaurus-style hints for that word
**Examples**
```r
corpora()
corpora(category = "animals")
corpora("foods/pizzaToppings")
```
Index
categories, 2
corpora, 2
|
{"Source-Url": "https://cran.r-project.org/web/packages/rcorpora/rcorpora.pdf", "len_cl100k_base": 6247, "olmocr-version": "0.1.53", "pdf-total-pages": 14, "total-fallback-pages": 0, "total-input-tokens": 29498, "total-output-tokens": 7948, "length": "2e12", "weborganizer": {"__label__adult": 0.0008111000061035156, "__label__art_design": 0.003948211669921875, "__label__crime_law": 0.001300811767578125, "__label__education_jobs": 0.0833740234375, "__label__entertainment": 0.0016307830810546875, "__label__fashion_beauty": 0.0005154609680175781, "__label__finance_business": 0.0021991729736328125, "__label__food_dining": 0.0008597373962402344, "__label__games": 0.005069732666015625, "__label__hardware": 0.0013685226440429688, "__label__health": 0.0011682510375976562, "__label__history": 0.0026836395263671875, "__label__home_hobbies": 0.0014171600341796875, "__label__industrial": 0.0007200241088867188, "__label__literature": 0.01934814453125, "__label__politics": 0.0010442733764648438, "__label__religion": 0.0010509490966796875, "__label__science_tech": 0.2171630859375, "__label__social_life": 0.002178192138671875, "__label__software": 0.314697265625, "__label__software_dev": 0.336181640625, "__label__sports_fitness": 0.00033092498779296875, "__label__transportation": 0.00047087669372558594, "__label__travel": 0.00047969818115234375}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 28670, 0.008]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 28670, 0.61788]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 28670, 0.79023]], "google_gemma-3-12b-it_contains_pii": [[0, 2363, false], [2363, 3004, null], [3004, 4704, null], [4704, 6037, null], [6037, 8668, null], [8668, 11883, null], [11883, 14591, null], [14591, 17393, null], [17393, 20452, null], [20452, 22934, null], [22934, 25745, null], [25745, 27887, null], [27887, 28639, null], [28639, 28670, null]], "google_gemma-3-12b-it_is_public_document": [[0, 2363, true], [2363, 3004, null], [3004, 4704, null], [4704, 6037, null], [6037, 8668, null], [8668, 11883, null], [11883, 14591, null], [14591, 17393, null], [17393, 20452, null], [20452, 22934, null], [22934, 25745, null], [25745, 27887, null], [27887, 28639, null], [28639, 28670, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, false], [5000, 28670, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 28670, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 28670, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 28670, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 28670, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 28670, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 28670, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 28670, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 28670, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 28670, null]], "pdf_page_numbers": [[0, 2363, 1], [2363, 3004, 2], [3004, 4704, 3], [4704, 6037, 4], [6037, 8668, 5], [8668, 11883, 6], [11883, 14591, 7], [14591, 17393, 8], [17393, 20452, 9], [20452, 22934, 10], [22934, 25745, 11], [25745, 27887, 12], [27887, 28639, 13], [28639, 28670, 14]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 28670, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-07
|
2024-12-07
|
73a2f051005c9c0621eaaf471566f1b62a72c1d6
|
Principles of Software Construction: Objects, Design, and Concurrency
IDEs, Build system, Continuous Integration, Libraries
Christian Kästner Vincent Hellendoorn
Outline
- On Homework 1
- Abstraction, Reuse, and Programming Tools
- For each in {IDE, Build systems, libraries, CI}:
- What is it today?
- What is under the hood?
- What is next?
Homework 1
Welcome to the deep end!
- Java/TS + IDE + Maven/Npm + GitHub + Travis + linter!?
Homework 1
Welcome to the deep end!
- Java/TS + IDE + Maven/Npm + GitHub + Travis + linter!?
- We’re here to help:
- Recitation tomorrow, walks through all this setup
- Find some clarifications on Piazza
- E.g., only implement what is asked for; all other functionality (repeating, flipping question/answer) is already there.
- Use office hours (see course calendar)
Homework 1
Welcome to the deep end!
- **Java/TS + IDE + Maven/Npm + GitHub + Travis + linter!?**
- **We’re here to help:**
- Recitation tomorrow, walks through all this setup
- Find some clarifications on Piazza
- E.g., only implement what is asked for; all other functionality (repeating, flipping question/answer) is already there.
- Use office hours (see course calendar)
- **Actual coding effort is small -- reading & setting up is the point**
- **Small typo detected on Piazza in `mostmistakes.ts`; fixed now. Not essential to your HW.**
Mini-quiz
https://forms.gle/9tnB5BszVz9KTY7r5
Outline
● On Homework 1
● **Abstraction, Reuse, and Programming Tools**
● For each in {IDE, Build systems, libraries, CI}:
○ What is it today?
○ What is under the hood?
○ What is next?
Automation Requires Abstraction
Automation Requires Abstraction
Automation Requires Abstraction
We all treat familiar levels of abstraction as normal/natural
● That’s fine if you only drive your car
○ Not so much if you are a mechanic
○ How to debug a broken transmission?
● Also slow to evolve
○ Conf. people adamantly refusing to use an automatic
● Engineers seek out abstractions that simplify their work, help focus on the hard parts
○ They also know what is beneath the abstractions
Automation Requires Abstraction
Today’s “normal”:
- Integrated-development environments (IDEs) galore
- Web-based too! Press “.” on a GitHub (file) page 😐
- Frequent build, test, release
- In some companies, every commit is a “release”
- Never write code for which there is a useful library
- Define “useful” (we will)
- All of the above, entangled
Outline
- On Homework 1
- Abstraction, Reuse, and Programming Tools
- For each in {IDE, Build systems, libraries, CI}:
- What is it today?
- What is under the hood?
- What is next?
Today’s toolchain: a quick overview
IDEs:
● Integrated Development Environments, bundle development workflows in a single UI
○ Editing, refactoring, running & debugging, adding dependencies, compiling, deploying, plugins, you name it
○ They often try to be everything, with mixed results
○ Leverage them to the fullest extent, to automate and check your work
Today’s toolchain: a quick overview
IDEs:
- Eclipse was the dominant player in Java for 20-odd years, owing to its powerful backbone and plugin architecture
Today’s toolchain: a quick overview
IDEs:
- Recently, IntelliJ has been more dominant
- Packs a lot of “recipes” to create certain types of projects (e.g., web-app with Spring & Maven)
Today’s toolchain: a quick overview
IDEs:
● Recently, IntelliJ has been more dominant
○ Packs a lot of “recipes” to create certain types of projects (e.g., web-app with Spring & Maven)
● VSCode is surging in popularity
○ Local & web, lightweight but with a massive plugin ecosystem
■ Quick tangent: if you can build either a large product or a platform, build a platform
Today’s toolchain: a quick overview
IDEs:
- Recently, IntelliJ has been more dominant
- Packs a lot of “recipes” to create certain types of projects (e.g., web-app with Spring & Maven)
- VSCode is surging in popularity
- Local & web, lightweight but with a massive plugin ecosystem
- Quick tangent: if you can build either a large product or a platform, build a platform
- But choose based on need!
- You can relearn key-bindings; “killer features” are rare and temporary
- E.g., Android: might want Android Studio (itself built on IntelliJ) since Google supports it
- For this homework, choose what you’d like. We suggest IntelliJ for Java, VSCode for TS
Today’s toolchain: a quick overview
Build Systems:
- How does this happen?
Today’s toolchain: a quick overview
Build Systems:
- Compiling is “easy” when all your source code is here
- (Please don’t tell a compiler expert I said that)
- Nowadays, your code is not “here”
- Even libraries that you use in the IDE!
- Interfaces make that possible
Today's toolchain: a quick overview
Build Systems:
- **Compiling is “easy” when all your source code is here**
- (Please don’t tell a compiler expert I said that)
- **Nowadays, your code is not “here”**
- Even libraries that you use in the IDE!
- Interfaces make that possible
- **Study the Travis log:**
- What is it doing?
- Downloading, compiling, running checks
- Most of this is “building”, using Maven
- More on Travis later
Today’s toolchain: a quick overview
Build Systems:
- Has a few basic tasks:
- Compiling & linking, to produce an executable
- Creating secondary *artifacts*, e.g. documentation-pages, linter reports, test suite reports
- Different levels of “depth” may be appropriate, for large code bases (e.g. Google)
Today’s toolchain: a quick overview
Build Systems:
- Has a few basic tasks:
- Compiling & linking, to produce an executable
- Creating secondary *artifacts*, e.g. documentation-pages, linter reports, test suite reports
- Different levels of “depth” may be appropriate, for large code bases (e.g. Google)
- Popular options:
- For Java: Maven and Gradle -- historically Ant.
- You could do any homework in either; we’re not attached to one
- For JS/TS: Node(JS)
- Generally coupled with the Node Package Manager (NPM)
- Often built into IDEs, as plugins
Today’s toolchain: a quick overview
Libraries:
- Myriad. Publicly hosted on various package managers
- Often tied, but not inextricably linked, to build tools, and languages
- Maven/Gradle for Java, NPM for JS/TS, Nuget for C#, ...
- Registries of managers, e.g., GitHub Packages
Today’s toolchain: a quick overview
Libraries:
- **Myriad. Publicly hosted on various managers**
- Often tied, but not inextricably linked, to build tools, and languages
- Maven, Gradle, NPM, Nuget, Docker, …
- Registries of managers, e.g., GitHub Packages
- **Releases are generally fast-paced or frigid**
- Almost all volunteer-based, so support waivers, as does documentation quality
- Often open-source, so you can check out the status & details on GitHub
- Beware of vulnerabilities and bugs, esp. with minor-releases and nightly’s, old packages
Today’s toolchain: a quick overview
Libraries:
● A Case-Study:
○ ‘pac-resolver’ (3M weekly downloads) has a major security vulnerability
■ Uses ‘degenerator’ (same author), which misuses a Node module
■ “The vm module is not a security mechanism. Do not use it to run untrusted code.”
■ (a mistake that’s been made before: people rarely read disclaimers)
○ ‘pac-proxy-agent’ (2M weekly downloads, same author) uses the above
■ Is widely popular, the main reason people use ‘degenerator’
■ Most people using this package have never heard of the latter -- many never will
Today’s toolchain: a quick overview
Continuous Integration:
- Automates standard build, test, deploy pipelines
- Technically, the latter is “CD”
- Typically builds from scratch in a clean container
- Often tied to code-review; triggers on new commits, pull requests
- Ideally, official releases pass the build
- Produces (long) logs with debugging outputs
Today’s toolchain: a quick overview
Not mentioned:
- Docker: containerize applications for coarse-grained reuse
- Cloud: deploy and scale rapidly, release seamlessly
- Bug/Issue trackers, often integrated with reviews
Outline
- On Homework 1
- **Abstraction, Reuse, and Programming Tools**
- For each in \{IDE, Build systems, libraries, CI\}:
- What is it today?
- What is under the hood?
- What is next?
Behind the Abstraction
First, a bit of nuance:
- Automation vs. Reuse
- We tend to automate common chains of actions
- Gear-up := \{Press clutch, switch gear, release clutch while accelerating\}
- To facilitate reusing such “subroutines”, we introduce abstractions
- Accelerate in ‘D’ => Gear-up when needed
Behind the Abstraction
First, a bit of nuance:
- **Automation vs. Reuse**
- We tend to automate common chains of actions
- Gear-up := {Press clutch, switch gear, release clutch while accelerating}
- To facilitate reusing such “subroutines”, we introduce abstractions
- Accelerate in ‘D’ => Gear-up when needed
- **Reuse vs. Interfaces**
- Interfaces facilitate reuse through abstraction
- Allow upgrading implementation without breaking things
- Provide explicit & transparent contract
Behind the Abstraction
First, a bit of nuance:
● Most tools are abstractions of common commands
○ Typically operated via GUI and/or a DSL
○ Obvious for Travis: just read the Yaml
■ Script-like languages are common
■ Involving a vocabulary of “targets”
■ E.g., `mvn site`
Behind the Abstraction
First, a bit of nuance:
- Most tools are abstractions of common commands
- Typically operated via GUI and/or a DSL
- Obvious for Travis: just read the Yaml
- Script-like languages are common
- Involving a vocabulary of “targets”
- E.g., `mvn site`
- Abstraction can also “trap” us
- When/how do we leave the abstraction?
- Command-line comes built into IDEs for a reason
- Non-trivial in general! May require switching/“patching” libraries
- E.g., Maven → Gradle for more unusual build routines
Outline
- On Homework 1
- Abstraction, Reuse, and Programming Tools
- For each in {IDE, Build systems, libraries, CI}:
- What is it today?
- What is under the hood?
- What is next?
IDEs
Automate common programming actions:
- Handy refactorings, suggestions
- E.g., just press `alt+enter` in IntelliJ while highlighting nearly any code
- Keyboard shortcuts are super useful: explore your IDE!
- These can make you a better programmer: encode a lot of best-practices
- Though, don’t read into them too much
IDEs
- The engine: continuous parsing, building
- Key feature: most partial programs don’t parse, but IDEs make sense of them
- That allows quickly relaying compile warnings/errors and useful suggestions
- Same with API resolution
- Powered by rapid incremental compilation
- Only build what has been updated
- Virtually every edit you make triggers a compilation, re-linking
- Of just the changed code and its dependencies
- Works because very little of the code changes most of the time
- But no free lunch: tends to drop optimizations (mostly fine), may struggle with big projects
- Just try it: call an API with the wrong parameters & see how fast it triggers an alert; contrast with running a full Maven build (e.g., with `mvn install`)
IDEs
Automate common programming actions:
- Debugging
- Often the default mode when you run in the IDE
IDEs
Automate common programming actions:
- **Debugging**
- Often the default mode when you run in the IDE
- Allows setting breakpoints
- Which give you rich insight into execution
IDEs
Automate common programming actions:
- Debugging
- Often the default mode when you run in the IDE
- Allows setting breakpoints
- Which give you rich insight into execution
IDEs
- IDE designers spend a lot of time automating common development tasks
- Sometimes they get a little too helpful (modifying pom's)
- Many plugins provide customized experience
- Mostly evolve with new tools, prioritizing emerging routines
- Useful to know how these actions work
- Often not much more than invoking commands for you
- VSCode, IntelliJ are very explicit about this in the terminal -- great for customization
```
"C:\Program Files\Java\jdk-16.0.1\bin\java.exe" -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2019.3\lib\idea-agent.jar"
```
Process finished with exit code 0
Build Systems
- These days: intricately tied with IDEs, package managers
- Projects often come with a build config file or two
- ‘pom.xml’ for Maven
- ‘tsconfig.json’ + ‘package.json’ for TypeScript+NPM -- the second deals with packages
- These can be nested, one per (sub-)directory, to compose larger systems
- On GitHub, you can create links across repositories
Build Systems
- These days: intricately tied with IDEs, package managers
- Projects often come with a build config file or two
- ‘pom.xml’ for Maven
- ‘tsconfig.json’ + ‘package.json’ for TypeScript+NPM -- the second deals with packages
- These can be nested, one per (sub-)directory, to compose larger systems
- On GitHub, you can create links across repositories
- Specifies:
- Compilation source and target version
- High-level configuration options
- Targets for various phases in development
- "lifecycle" in Maven; e.g. ‘compile’, ‘test’, ‘deploy’
- Often involving plugins
- Dependencies with versions
- Not shown: in package.json
```json
1 {
2 "compilerOptions": {
3 "target": "es2016",
4 "module": "commonjs",
5 "sourceMap": true,
6 "strict": true,
7 "esModuleInterop": true,
8 "moduleResolution": "node",
9 "outDir": "dist"
10 }
11 }
```
Libraries & Frameworks
Packages can be either:
- Libraries:
- A set of classes and methods that provide reusable functionality
- Typically: programmer calls, library returns data, that’s it.
Libraries & Frameworks
Packages can be either:
- **Libraries:**
- A set of classes and methods that provide reusable functionality
- Typically: programmer calls, library returns data, that’s it.
- **Frameworks:**
- Reusable skeleton code that can be customized into an application
- Framework calls back into client code
- The Hollywood principle: “Don’t call us. We’ll call you.”
- E.g., Android development: you declare your UI elements, activities to be composed
Libraries & Frameworks
Packages can be either:
● **Libraries:**
○ A set of classes and methods that provide reusable functionality
○ Typically: programmer calls, library returns data, that's it.
● **Frameworks:**
○ Reusable skeleton code that can be customized into an application
○ Framework calls back into client code
■ The Hollywood principle: “Don’t call us. We’ll call you.”
○ E.g., Android development: you declare your UI elements, activities to be composed
○ Principle: inversion of control
● **You typically use zero/one framework and many libraries**
○ Frameworks might be especially constraining, but for good reason.
○ Some tools are a bit of both, and not all frameworks quite invert control
Libraries & Frameworks
Which kind is a command-line parsing package?
http://tom.lokhorst.eu/2010/09/why-libraries-are-better-than-frameworks`
Libraries & Frameworks
Which kind is a command-line parsing package?
How about a tool that runs tests based on annotations you add in your code?
- More on Thursday
http://tom.lokhorst.eu/2010/09/why-libraries-are-better-than-frameworks`
Libraries
Look into:
● **Stated Goal:**
○ A simple interface (“get started in one line!”) also means lots of abstraction
○ That’s neither good nor bad; know what you need
○ Docs with “advanced use cases” are always neat
● **Maintenance:**
○ Active release cycle, recent updates to documentation
○ GitHub build status, issue tracker (filled with unmerged ‘dependabot’ PRs?)
○ Lots of companies deliberately lag by one minor (or even major) version
● **Recursive dependencies**
○ Myriad, beyond inspection. Using OSS in corporate environments is a headache
Frameworks
Whitebox:
- Extension via subclassing and overriding methods
- Common design pattern(s):
- Template method
- Subclass has main method but gives control to framework
Blackbox:
- Extension via implementing a plugin interface
- Common design pattern(s):
- Command
- Observer
- Plugin-loading mechanism loads plugins and gives control to the framework
Continuous Integration
Defines a series of actions to be run in a clean build:
- Actions start from the very top:
- Clone repository, checkout branch
- Download & install Java/Node
- Invoke commands with timeouts
- Travis allocates a new (Docker) container for each build
- Think of this like a fresh, temporary computer
- Usually with a few default libraries present (i.e., based on an image)
- That means: fully replicable builds
163 Installing SSH key from: default repository key
164 Using /home/travis/.netrc to clone repository.
167 $ git clone --depth=50 --branch=TypeScript https://github.com/CMU-17-214/template-21f-hw1.git CMU-17-214/template-21f-hw1
168 Cloning into 'CMU-17-214/template-21f-hw1'...
169 remote: Enumerating objects: 117, done.
170 remote: Counting objects: 100% (117/117), done.
171 remote: Compressing objects: 100% (73/73), done.
172 remote: Total 117 (delta 58), reused 184 (delta 37), pack-reused 0
173 Receiving objects: 100% (117/117), 69.89 KiB | 2.25 MiB/s, done.
174 Resolving deltas: 100% (58/58), done.
175 $ cd CMU-17-214/template-21f-hw1
176 $ git checkout -qf 8d657225c8cbdd52751c2f88527f937f4099b041e
179 $ nvm install 16
180 Downloading and installing node v16.8.0...
181 Downloading https://nodejs.org/dist/v16.8.0/node-v16.8.0-linux-x64.tar.xz...
182 Computing checksum with sha256sum
183 Checksums matched!
184 Nvm using node v16.8.0 (npm v7.21.0)
186 Setting up build cache
193 $ node --version
194 v16.8.0
197 $ npm --version
198 7.21.0
199 $ nvm --version
200 0.38.0
281 $ npm ci
292 $ timeout 5m npm run compile
210 > hw1-flashcards@1.0.0 compile
213 > tsc
Continuous integration – Travis CI
Automatically builds, tests, and displays the result
Continuous integration – Travis CI
You can see the results of builds over time.
Outline
- On Homework 1
- Abstraction, Reuse, and Programming Tools
- For each in {IDE, Build systems, libraries, CI}:
- What is it today?
- What is under the hood?
- What is next?
What’s Next
Anyone care to guess?
• Can be based on something you’ve seen, but think will boom
What’s Next
AI Powered Programming
● Easier in Web IDEs
○ Which are themselves “next”
What’s Next
Collaborative online coding
- Think: Google Docs for code
- E.g. VS Life Share
- How will this change “commits”?
What’s Next
Tighter IDE-to-cloud integration
- Google Cloud is pushing on this with VSCode
- We will (lightly) touch on Containers & Clouds in this course
Summary
- Programming Tools are abundant, and rapidly evolving
- Learn multiple; you will have to inevitably
- They rely on abstractions through interfaces to facilitate reuse
- Which come in many shapes: GUI, API, DSL
- And can be a limitation -- choose wisely
- Your HW1 toolchain sets you up for all homeworks
- With modest variations (frameworks, new build targets)
- Self-discovery is a big asset
- Tomorrow’s recitation offers help
|
{"Source-Url": "https://cmu-17-214.github.io/f2021/slides/20210907-IDEs-build-systems-CI-libraries.pdf", "len_cl100k_base": 4968, "olmocr-version": "0.1.53", "pdf-total-pages": 58, "total-fallback-pages": 0, "total-input-tokens": 63724, "total-output-tokens": 7242, "length": "2e12", "weborganizer": {"__label__adult": 0.0005693435668945312, "__label__art_design": 0.00042724609375, "__label__crime_law": 0.00030922889709472656, "__label__education_jobs": 0.010009765625, "__label__entertainment": 0.00010466575622558594, "__label__fashion_beauty": 0.0002275705337524414, "__label__finance_business": 0.0003151893615722656, "__label__food_dining": 0.0005712509155273438, "__label__games": 0.0008330345153808594, "__label__hardware": 0.0006499290466308594, "__label__health": 0.0003113746643066406, "__label__history": 0.00024700164794921875, "__label__home_hobbies": 0.00018608570098876953, "__label__industrial": 0.0004379749298095703, "__label__literature": 0.00042819976806640625, "__label__politics": 0.0002703666687011719, "__label__religion": 0.0006952285766601562, "__label__science_tech": 0.0013685226440429688, "__label__social_life": 0.00028395652770996094, "__label__software": 0.005908966064453125, "__label__software_dev": 0.974609375, "__label__sports_fitness": 0.0004634857177734375, "__label__transportation": 0.0007085800170898438, "__label__travel": 0.00030517578125}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 19500, 0.02245]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 19500, 0.21864]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 19500, 0.84784]], "google_gemma-3-12b-it_contains_pii": [[0, 169, false], [169, 357, null], [357, 452, null], [452, 831, null], [831, 1386, null], [1386, 1433, null], [1433, 1625, null], [1625, 1657, null], [1657, 1689, null], [1689, 2125, null], [2125, 2482, null], [2482, 2670, null], [2670, 3037, null], [3037, 3196, null], [3196, 3385, null], [3385, 3766, null], [3766, 4438, null], [4438, 4515, null], [4515, 4793, null], [4793, 5242, null], [5242, 5554, null], [5554, 6129, null], [6129, 6417, null], [6417, 6983, null], [6983, 7579, null], [7579, 7949, null], [7949, 8169, null], [8169, 8363, null], [8363, 8685, null], [8685, 9196, null], [9196, 9485, null], [9485, 10031, null], [10031, 10219, null], [10219, 10557, null], [10557, 11325, null], [11325, 11432, null], [11432, 11623, null], [11623, 11810, null], [11810, 12467, null], [12467, 12843, null], [12843, 13769, null], [13769, 13966, null], [13966, 14539, null], [14539, 15269, null], [15269, 15413, null], [15413, 15654, null], [15654, 16227, null], [16227, 16596, null], [16596, 17042, null], [17042, 18221, null], [18221, 18310, null], [18310, 18391, null], [18391, 18579, null], [18579, 18676, null], [18676, 18766, null], [18766, 18893, null], [18893, 19050, null], [19050, 19500, null]], "google_gemma-3-12b-it_is_public_document": [[0, 169, true], [169, 357, null], [357, 452, null], [452, 831, null], [831, 1386, null], [1386, 1433, null], [1433, 1625, null], [1625, 1657, null], [1657, 1689, null], [1689, 2125, null], [2125, 2482, null], [2482, 2670, null], [2670, 3037, null], [3037, 3196, null], [3196, 3385, null], [3385, 3766, null], [3766, 4438, null], [4438, 4515, null], [4515, 4793, null], [4793, 5242, null], [5242, 5554, null], [5554, 6129, null], [6129, 6417, null], [6417, 6983, null], [6983, 7579, null], [7579, 7949, null], [7949, 8169, null], [8169, 8363, null], [8363, 8685, null], [8685, 9196, null], [9196, 9485, null], [9485, 10031, null], [10031, 10219, null], [10219, 10557, null], [10557, 11325, null], [11325, 11432, null], [11432, 11623, null], [11623, 11810, null], [11810, 12467, null], [12467, 12843, null], [12843, 13769, null], [13769, 13966, null], [13966, 14539, null], [14539, 15269, null], [15269, 15413, null], [15413, 15654, null], [15654, 16227, null], [16227, 16596, null], [16596, 17042, null], [17042, 18221, null], [18221, 18310, null], [18310, 18391, null], [18391, 18579, null], [18579, 18676, null], [18676, 18766, null], [18766, 18893, null], [18893, 19050, null], [19050, 19500, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, false], [5000, 19500, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 19500, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 19500, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 19500, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, true], [5000, 19500, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 19500, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 19500, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 19500, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, true], [5000, 19500, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 19500, null]], "pdf_page_numbers": [[0, 169, 1], [169, 357, 2], [357, 452, 3], [452, 831, 4], [831, 1386, 5], [1386, 1433, 6], [1433, 1625, 7], [1625, 1657, 8], [1657, 1689, 9], [1689, 2125, 10], [2125, 2482, 11], [2482, 2670, 12], [2670, 3037, 13], [3037, 3196, 14], [3196, 3385, 15], [3385, 3766, 16], [3766, 4438, 17], [4438, 4515, 18], [4515, 4793, 19], [4793, 5242, 20], [5242, 5554, 21], [5554, 6129, 22], [6129, 6417, 23], [6417, 6983, 24], [6983, 7579, 25], [7579, 7949, 26], [7949, 8169, 27], [8169, 8363, 28], [8363, 8685, 29], [8685, 9196, 30], [9196, 9485, 31], [9485, 10031, 32], [10031, 10219, 33], [10219, 10557, 34], [10557, 11325, 35], [11325, 11432, 36], [11432, 11623, 37], [11623, 11810, 38], [11810, 12467, 39], [12467, 12843, 40], [12843, 13769, 41], [13769, 13966, 42], [13966, 14539, 43], [14539, 15269, 44], [15269, 15413, 45], [15413, 15654, 46], [15654, 16227, 47], [16227, 16596, 48], [16596, 17042, 49], [17042, 18221, 50], [18221, 18310, 51], [18310, 18391, 52], [18391, 18579, 53], [18579, 18676, 54], [18676, 18766, 55], [18766, 18893, 56], [18893, 19050, 57], [19050, 19500, 58]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 19500, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-10
|
2024-12-10
|
f742688dd369dea5a3c997b977acbab2eb98edf8
|
miTLS: Verifying Protocol Implementations Against Real-World Attacks
Karthikeyan Bhargavan karthikeyan.bhargavan@inria.fr, Cédric Fournet fourn@microsoft.com, Markulf Kohlweiss markulf@microsoft.com
The TLS Internet Standard, previously known as SSL, is the default protocol for encrypting communications between clients and servers on the Web. Hence, TLS routinely protects our sensitive emails, health records, and payment information against network-based eavesdropping and tampering. For the last 20 years, the security of TLS has been analyzed in a variety of cryptographic and programming models, in order to establish strong formal guarantees for various configurations of the protocol. Yet, TLS deployments are still often found to be vulnerable to attacks, and still rely on security experts to fix the protocol implementations.
The miTLS project intends to solve this apparent contradiction between published proofs and real-world attacks, which reveals a gap between the theory and practice of TLS. To this end, we jointly develop a verified reference implementation and a cryptographic security proof that account for the low-level details of the protocol. The resulting formal development sheds light on recent attacks, yields security guarantees for typical usages of TLS, and informs the design of the next version of the protocol.
Both the Internet and cryptography took roots in military technology. One of the first uses of computers, pioneered by Alan Turing, was to decrypt German war-time communications; and the precursor of the Internet, the Arpanet, was designed for resilience in case of nuclear war. It was the invention of public-key cryptography by Diffie and Hellman that created the impetus for open academic research into cryptography, and eventually led to the ubiquitous use of encryption on the Internet.
The Secure Socket Layer (SSL) protocol, one of the first real-world deployments of public-key cryptography, was originally developed by Netscape, an early Internet browser vendor, to provide secure channels for electronic commerce. One of its main designers was Elgamal, a student of Hellman. As SSL took over the Web, it was renamed Transport Layer Security (TLS) and documented as an open standard by the Internet Engineering Task Force (IETF). Over time, it has undergone major changes; its implementations currently feature five versions—SSL2, SSL3, TLS 1.0, TLS 1.1, and TLS 1.2—while the next version of the protocol is actively being discussed at the IETF.
TLS implements a network socket API on top of a reliable but insecure network. It consists of two main protocols: a handshake that establishes sessions between clients and servers, relying on public-key cryptography to compute shared session keys; and a record layer that uses those keys to encrypt and authenticate their communications. SSL2 initially supported a single handshake scheme, based on RSA encryption, and a few record encryption algorithms, such as RC2 and DES. SSL3 added Diffie-Hellman schemes to the handshake, and further encryption algorithms, such as RC4 and 3DES. Over time, many of these cryptographic constructions came under attack, and were supplemented with stronger alternatives.
Since the client and the server may support different sets of cryptographic algorithms, the handshake lets them negotiate a combination of algorithms, called a ciphersuite. Hence, any TLS client and server can inter-operate as long as they have at least one ciphersuite in common. Over time, the number of ciphersuites supported by TLS implementations has grown steadily. For example, the popular OpenSSL library now supports over a hundred ciphersuites.
Not all ciphersuites are equally strong. Like most commercial software during the cold war, SSL was subject to US export regulations that classified cryptography as a weapon. To comply with these regulations, all protocol versions up to TLS 1.0 included deliberately weakened encryption algorithms for use in US software, such as web browsers, exported to foreign countries. Cryptographers and security practitioners started a rebellion, dubbed the Crypto Wars1, against this weakening of their work, and
eventually prevailed, but SSL and TLS implementations were still forced to support export-grade ciphersuites for interoperability.
Many of the challenges in designing and deploying TLS securely were already apparent in the early days of the protocol. In particular, Bleichenbacher demonstrated a side-channel attack against the way RSA encryption was used in the SSL handshake, and Vaudenay discovered another side-channel attack on the way application data was encrypted in the record protocol. Later versions of TLS continued to support those weak constructions, but mandated that implementations employ adequate countermeasures, triggering a series of increasingly sophisticated attacks and defences.
Besides cryptographic weaknesses, the SSL handshake protocol itself was shown to be vulnerable to logical flaws. The negotiation between strong and weak encryption had a protocol-level flaw in SSL2: a ciphersuite rollback (or downgrade) identified by Abadi, enabling a network attacker to force a client and a server to use a weak export ciphersuite even though they both preferred a stronger ciphersuite. This flaw was fixed in SSL3, but a subsequent analysis revealed a more advanced downgrade attack, enabling a network attacker to force SSL3 clients and servers to use SSL2, and then exploit its known weaknesses. This was fixed by modifying the use of RSA encryption, which in turn enabled an improved Bleichenbacher-style side channel attack.
Hence, by the early 2000s, TLS was already caught in a cycle of attacks and fixes that continues to the current day. Formal foundations, to validate the protocol design and prevent any such attacks, became very attractive, and researchers from both the cryptographic and formal methods communities started applying various verification techniques to communications protocols.
Since the 1980s, cryptographers had been working on turning cryptography from an art into a science. The resulting theory is nowadays referred to as provable security. Conceived at the Theory of Computation group at MIT, it is concerned with reducing the difficulty of breaking cryptographic protocols to problems in complexity theory and mathematics. This approach resulted in groundbreaking works like those by the Turing award winners Shafi Goldwasser and Silvio Micali on probabilistic encryption and zero-knowledge proofs.
From the cryptographer’s point of view, the TLS protocol is a combination of standard cryptographic constructions. Using compositional provable security techniques, one should be able to prove the security of each construction, and then put these proofs together to obtain a security theorem for TLS. In reality, composing proofs of various ad hoc parts of the protocol turned out to be hard, but over the last decade, cryptographers have successfully analyzed the security of many popular TLS ciphersuites. Their theorems confirm that, under some well-defined implementation and mathematical assumptions, the cryptographic core of TLS is not vulnerable to attack.
From the programmer’s point of view, protocols like TLS can be viewed as distributed processes that communicate across public channels and use cryptographic primitives as black boxes to protect their messages. The key analysis question is then whether the protocol, seen as a program, has logical flaws in its use of communications and cryptography, even if one assumes that the cryptographic building blocks are perfectly secure. For example, one may ask whether TLS admits ciphersuite or version downgrade attacks in the presence of an active network adversary.
The verification of concurrent and distributed processes has been investigated in a long line of research on programming language semantics, pioneered by other Turing award winners, Robin Milner and Tony Hoare. Their rigorous mathematical study of the meaning of programs allows us to formalize what it means for a program to keep a value secret, or for two programs to be equivalent. For simple cryptographic primitives, modelled as abstract mathematical functions, a message may hide a secret if it does not visibly depend on it; and two processes may be equivalent if they exchange similar-looking messages.
Most cryptographic algorithms hide secrets only computationally, meaning that given sufficient computational resources the secret can eventually be recovered. Their precise modelling requires complicated probabilistic definitions against restricted classes of adversaries. Instead, the semantics community proposed simpler symbolic approximations of cryptography to capture logical flaws, and developed tools to prove security (or find attacks) in their models. These techniques were used in a series of automated analyses of TLS, showing that the protocol is not vulnerable to logical attack, as long as the attacker is unable to break the cryptographic primitives.
Both the provable security and the symbolic verification of protocols were successful in their respective academic communities. As the former is more precise and the latter easier to automate, they are in principle complementary. However, the technical differences outlined above led to largely separate developments. As we will argue, this limited the impact that either of them had on the real-world security of TLS.
Theory vs Practice
Despite these theoretical successes, recent TLS versions have still been found vulnerable to practical attacks that rely on a combination of implementation bugs, cryptographic weaknesses, and protocol flaws. These attacks make it evident that the most advanced models of the provable security and verification communities still ignored many important implementation details. Such details include, for example, message formats, support for multiple protocol modes and algorithms for backward
compatibility, error handling exploitable as side channels, and signalling between the protocol and the application. Since these details affect the practical security of TLS, their omission limits the scope of theoretical statements.
It is worth reflecting on the cultural reasons for this gap between theory and practice. In their 2011 article on provable security, Degabriele, Paterson and Watson explain that a focus on principles can lead to simplistic or artificial models, and a neglect of implementation details. Interestingly, they notice a similar divide in the practical security community between specification writers and implementers. The former build in flexibility in specifications to allow for the competing interests of parties contributing to the development process. For example, specifications often avoid defining an API, and encourage implementations to accept a broad range of behaviours to support interoperability and backward compatibility. This flexibility can tempt cryptographers to interpret specifications in an overly abstract way that facilitates security analysis but misses real-world attacks that rely on implementation details.
Instead, we follow a model-attack-remodel cycle, informed by a dialog between practitioners and theoreticians. Concrete attack scenarios are invaluable for practice-oriented provable security: if they fall outside the security model, they encourage researchers to refine their model to better account for realistic threats. Conversely, model features that do not reflect any such scenario may point out simplifications.
Let us also mention a class of attacks often missed by practitioners and theoreticians alike. These attacks target the protocol design and evaluation process itself, sometimes directly, through the insertion of backdoors, or, more subtly, through influence on the culture in which designers operate. Juniper’s VPN security hole is a recent example in this class. Besides awareness of the interests that some organizations may have in subverting Internet security, we believe that formal, open, practice-oriented protocol verification helps prevent such attacks.
A more technical challenge that prevents cryptographic analysis techniques to be applied to TLS deployments is that the protocol and its implementations have simply grown too complicated to be analysed by humans. Unsurprisingly, the highly-optimized C code of TLS implementations such as OpenSSL is amenable neither to cryptographic proofs nor to formal verification.
Cryptographic and symbolic models of TLS alike could not keep up with implementations and did not account for the details of the protocol as specified in the standard. Consequently, proofs of these models were likely to miss practical attacks on the protocol. Of course, they also missed attacks that exploited basic implementation flaws, such as incorrect certificate validation (GotoFail) or buffer overflows (HeartBleed).
In summary, we argue that the co-existence of proofs and attacks can be attributed to multiple gaps between verified models and real-world protocols:
I. gaps between cryptographic models and standards;
II. gaps between standards and implementations;
III. gaps between individually secure ciphersuites and their insecure composition; and
IV. gaps between APIs and application-level security.
In the rest of this article, we describe these gaps in more detail, and explain how we try to bridge them in the miTLS project.
### miTLS: a verified reference implementation of TLS
By 2008, the theory and practice of TLS had largely diverged. To relate high-level specifications and low-level implementations (gaps I and II above), a group of researchers at the Microsoft Research-INRIA joint centre in Paris (including two authors of this paper) decided to build a reference implementation of the TLS 1.0 standard (RFC2246) in a style that enabled them to extract a formal model of the protocol directly from the code. By this approach, they ensured that the formal model was faithful to the standard and captured its low-level details. The model was then analyzed with a state-of-the-art protocol verifier, called ProVerif, to find both logical flaws in the protocol standard and implementation bugs in their code. Inasmuch as ProVerif did not find any flaws, they obtained high assurance in the security of their code against a large class of attacks.
This reference implementation, later dubbed miTLS (for Microsoft-INRIA TLS), was written in about 4000 lines of F# and the extracted symbolic models were among the largest to be automatically analyzed at the time, at the limits of verification technology. Symbolic tools like ProVerif are effective in automatically finding flaws without the need for any user intervention, but they do not necessarily scale well to large models. Verifying their TLS implementation for one protocol version and one ciphersuite took 3.5 hours and 4.5 GB of memory. Modelling other protocol modes was out of reach. Consequently, although they were able to find known attacks on early versions of SSL, they missed TLS renegotiation or Triple handshake attacks that were discovered later, because their models did not fully account for renegotiation.
As discussed above, a limitation of symbolic approaches is that they assume that the underlying cryptographic building blocks are perfect, and hence miss attacks. Some semi-automated tools, such as CryptoVerif, can analyze protocols in a more precise computational model of cryptography, but similarly do not scale up to large models. They applied CryptoVerif to core fragments of their TLS implementation, but were not able to analyze the full protocol using this tool. For example, they did not model
features like compression or the details of Cipher Block Chaining, and hence they missed subsequent vulnerabilities like BEAST and CRIME.
For the next version of miTLS\(^7\), we wanted to use a proof technique that could handle multiple versions and features of the protocol at the same time, and would rely on standard computational assumptions for the underlying cryptographic constructions. To this end, we switched to a verification method based on refinement types (to be explained shortly), originally designed for symbolic protocol analysis by Bhargavan, Fournet and Gordon,\(^8\) and then extended to modular computational proofs by Fournet, Kohlweiss, and Strub.\(^9\)

**Figure 1: miTLS verification architecture**
Refinement types allow programmers to annotate each function with logical formulas. These annotations can capture program invariants, cryptographic assumptions, protocol events, and many security guarantees. To verify that a program meets its type annotations, the developer runs a type-checker that automatically verifies the program with the aid of an external SMT solver to discharge logical proof obligations. Crucially, type-checking is compositional, in the sense that each function can be independently verified, assuming that all previous functions also meet their type annotations. Consequently, the time for type-checking a large program is more-or-less linear in its size, and can be controlled by writing additional intermediate annotations.
The miTLS implementation currently supports TLS 1.0, 1.1, and 1.2, with multiple handshake and record modes. It also fully supports session resumption and renegotiation. The code is written in about 5000 lines of code, and is split into a sequence of modules, each of which equipped with a refinement-type interface. The verification approach is depicted in Figure 1. For modules containing protocol code, the interface represents the target security goals we wish to verify. For modules implementing cryptographic primitives, the interface represents the idealized functionality of the primitive, according to some standard cryptographic security assumption.
The top-level security guarantees for miTLS are stated in terms of a secure channel interface presented by TLS to the application. This interface guarantees that application data sent on a connection between a miTLS client and a miTLS server is kept confidential, as long as the connection uses strong cryptographic algorithms and the long-term private keys of the two peers are unknown to the attacker. Moreover, the interface guarantees that the stream of application data received at one end is a prefix of the stream sent by the other. The security proof relies on type-checking each module, after applying a series of game-based transformations on the core cryptographic modules to replace the concrete algorithms by their ideal functionality. By this approach, we are able to verify the full miTLS implementation, module by module, under precise computational security assumptions. The total time for verification is under 20 minutes.
While it is valuable to have a security theorem for a reference implementation of TLS 1.2, the impact of miTLS is perhaps better evaluated in terms of the parts of the protocol design we were unable to prove, or where we had to make special cryptographic assumptions. These corner cases resulted in the discovery of weaknesses in the protocol and attacks on its real-world usage, discussed next.
**Application Interface (API) and its Security Goals**
Many problems stem from a mismatch between the security properties expected by applications using TLS and the actual guarantees provided by TLS (gap IV). The TLS standard does not specify an application interface (API) and so each implementation is free to implement its own. Application developers are expected to understand these APIs in detail and to use them in the right way to achieve their security goals. For example, some TLS libraries expect applications to validate the certificate presented by the server, and thus developers who wrongly assume that the library will do it for them become vulnerable to server-impersonation attacks. More generally, many attacks appear when building application-level authentication on top of TLS.
Consider an application that uses TLS to establish a secure channel where the client is initially unauthenticated. The application then runs an authentication protocol on top of TLS that allows the user to present a credential to the server. In this setting, the client expects that its use of TLS guarantees that the credential will only be presented at the target server; and a server that receives the credential over TLS may expect that the user intended to authenticate to it. However, as demonstrated by the attack outlined in Figure 2, these expectations are ill placed. We follow cryptographic tradition and refer to the client as Alice, the server as Bob, and the attacker as Eve. If Alice is willing to use the same credential (say, an X.509 certificate) with both Bob and Eve, then Eve can impersonate Alice at Bob, by forwarding Alice’s credential (say, her signature over some authentication message) over his own
channel with Bob. Even if Alice is careful and uses her credential only with Bob, a sophisticated attacker may impersonate Bob to mount a Man-in-the-Middle attack (MitM), by operating a phishing web-site, obtaining mis-issued certificates, or compromising the server key. Such credential forwarding attacks can only be prevented if Alice not only authenticates herself, but also her channel, e.g., by signing a unique identifier extracted from the TLS connection. Then, if Bob compares these channel identifiers he can detect the attack.
Credential forwarding attacks and their countermeasures have appeared multiple times in TLS applications. They were first discussed in the context of tunnelled compound authentication protocols for network access. They then reappeared in the context of user-authenticated TLS renegotiation as commonly used on the web. In response to these attacks, a variety of channel identifiers were defined for TLS and exposed within the APIs of various implementations. Compound authentication protocols used the TLS session key (called master secret) as an identifier for binding application-level credentials. TLS renegotiation used the protocol transcript of the previous handshake as a connection identifier.
We implemented these countermeasures in miTLS and tried to prove that applications using miTLS are not vulnerable to credential forwarding, but we failed. Instead, we discovered several counterexamples. A malicious server is able to synchronize the TLS session keys on two different connections, one from Alice and one to Bob, so that the channel identifiers on both connections are the same, hence defeating the compound authentication countermeasure. Then by running a second TLS connection that uses session resumption, the server can also synchronize the protocol transcripts on these connections, hence defeating the TLS renegotiation countermeasure. In fact, such channel synchronization attacks break all known credential forwarding protections over TLS by exploiting a misunderstanding of the TLS API; the protocol does not guarantee unique channel identifiers.
Implementing Negotiation
In addition to designing an API, a second major challenge for a TLS implementation is that it needs to handle a variety of protocol versions, extensions, authentication modes, and ciphersuites at the same time. While the TLS standard describes each mode in isolation, it does not always specify how an implementation should compose them (gap III). In particular, the protocol state machine is left unspecified and each implementation can design its own. In miTLS, we define and verify our own state machine. Our type-based proofs rely on careful invariants that require that the current protocol state is consistent with the desired protocol mode, and that the transcripts and signature formats for different modes are disjoint. Considering the effort that was required to prove our own state machine correct, we then tested other implementations to see if they implemented the TLS standard correctly, and to our surprise, many of them failed this test, resulting in subtle attacks.\[11\]
Some implementations failed to correctly implement the composition of the handshake and record protocols and allowed application data to be sent unencrypted, before the handshake was complete. Other implementations failed to correctly compose regular RSA ciphersuites with export RSA ciphersuites, allowing a downgrade attack, called FREAK, whereby a MitM attacker could fool a TLS client into accepting export-grade 512-bit RSA keys even though it wanted to use regular RSA. In all, by testing other open-source TLS libraries against miTLS, we found dozens of state machine bugs across all major TLS implementations, including four that could be exploited for real-world attacks.
Another attack on TLS negotiation, found by a large group of researchers including one of the current authors, relies on a protocol flaw rather than an implementation bug. 12 In Logjam, the server supports both regular Diffie-Hellman (DH) groups as well as export-grade 512-bit DH groups. The client does not support export-grade DH, but it allows the server to pick the group. As depicted in Figure 3, this situation leads to an MitM attack. The attacker tampers with the protocol messages to fool the server into thinking that the client only supports export-grade DH. So, the server sends the export-grade group to the client who thinks this is the server’s regular group and accepts it. This kind of attacks is sometimes called a cross-protocol attack since it involves confusions between two different protocols (DH and export DH). It is enabled by a protocol flaw in TLS: the server’s signature format for export DH ciphersuites is indistinguishable from its signature for regular DH. Hence, the attacker can successfully downgrade the connection to use export DH even though the client does not realize it. To complete the attack, the attacker still needs to solve the discrete log problem for the export DH group, which is well within reach of modern processing power.
Towards TLS 1.3
At the time when SSL was first designed, there was a real enthusiasm and sense of purpose to deploy practical cryptographic protocols. Often one and the same person worked on and understood both the cryptography and the implementation—to the extent possible at the time. Since then, advances in cryptographic theory and analysis have greatly improved our understanding of when protocols achieve their security goals and when they fail to do so. However, typically this analysis is performed either on toy protocols, or in retrospect on partial aspects of a protocol specification. Implementers still primarily follow a fix-attack-fix cycle. This cycle, however, only gets worse as protocols grow in complexity. We believe that the only way forward is through an active collaboration between theoreticians and practitioners.
A promising development in this direction is the standardization effort behind the upcoming TLS 1.3 protocol, which fixes many weaknesses in TLS 1.2 and, at the same time, promises improved performance. From the early stages of its design, the TLS working group has invited and encouraged the participation of academic researchers, who have responded with significant numbers. Not only was the design of the cryptographic core of TLS 1.3 strongly influenced by the OPTLS protocol by Krawczyk and Wee13, but we now have multiple published security proofs for different draft versions of the protocol even before it has been standardized. Such careful cryptographic analysis for a new standard is unprecedented at the IETF. As a result of this process, many attacks and weaknesses were detected and removed from early drafts, resulting in a simpler and more secure protocol.
Our main contribution to the standardization effort is a new version of miTLS that implements TLS 1.3, but also supports older versions for backwards compatibility. Since mainstream TLS implementations will continue to support such older versions for the foreseeable future, we were especially concerned with the potential for version downgrade attacks that might nullify the security advantages of TLS 1.3.
TLS 1.3 signs all exchanged messages to prevent MitM attacks like Logjam that rely on tampering with handshake messages for downgrade attacks. However, we discovered that by downgrading the protocol version to TLS 1.2, the attacker can force the server to use the weaker TLS 1.2 signature that does not cover all messages, hence re-enabling such tampering attacks. The problem is that, in older versions of TLS, clients cannot verify the maximum supported server version until the end of the protocol, by when it is too late.
That this downgrade attack went unnoticed until Draft 10 of TLS 1.3 is an example for the many intricacies and pitfalls of practical protocol security. Once detected and brought to the attention of the IETF, we helped develop a verified countermeasure depicted in Figure 4.14 that is peculiar but simple: shorten the server nonce, which is signed in TLS 1.2, and use some of its bytes to encode the server’s highest supported version number.
The future of verified implementations
The miTLS approach necessarily involves multi-disciplinary teams of cryptography, programming semantics, tooling and verification experts, as well as generalists knowledgeable of real-world security concerns and system performance. We require implementations to be written in a programming language with a well-defined formal semantics so that protocol properties devised by theorists can be verified using sound automated tools on code co-developed with practitioners.
Even verified implementations have to rely on cryptographic assumptions, the accuracy of the security model, and the correctness of proofs and verification tools. To ensure that our modelling assumptions do not miss concrete attacks, we advocate a comprehensive penetration testing regime that uses the miTLS codebase to find and implement attacks on miTLS and other TLS implementations. Such attacks can be on cryptographic primitives, on the TLS protocol level, but also on the HTTPS ecosystem and even against the soundness of our verification tools. Our goal is to use a combination of verification and testing to span and evaluate all four of these levels in order to reduce the trusted computing base for TLS applications.
Verification alone is not enough to ensure that a TLS implementation will be widely used. Real-world implementations have to be performant. A key challenge for future work on miTLS is to extend our verification techniques so that they can handle the programming idioms used in high-performance code. As our tools improve, we anticipate that the feature and performance gap between verified and unverified protocol implementations will vanish.
Karthikeyan Bhargavan is a researcher at INRIA, the French national lab for computer science. He is based in Paris where he leads a team called Prosecco (“programming securely with cryptography”) and is the principal investigator of an ERC consolidator grant CIRCUS on provably secure implementations of cryptographic web applications. Karthik was trained at IIT New Delhi and the University of Pennsylvania. Before coming to Paris in 2009, he worked as a researcher at Microsoft Research lab in Cambridge, England. His publications and CV are available from http://prosecco.inria.fr/personal/karthik
Cédric Fournet fournet@microsoft.com,
Cédric Fournet leads the Constructive Security group at the Microsoft Research lab in Cambridge, UK. He is interested in security, privacy, cryptography, programming languages, and formal verification. He is currently working on a verified TLS/HTTPS protocol stack and techniques for outsourcing computations with strong security and privacy guarantees. Cédric graduated from Ecole Polytechnique and Ecole Nationale des Ponts et Chaussées, and completed a PhD at INRIA in France. See also https://www.microsoft.com/en-us/research/people/fournet.
Markulf Kohlweiss markulf@microsoft.com
Markulf Kohlweiss is a researcher at Microsoft Research Cambridge in the Programming Principles and Tools group. He did his PhD at the COSIC (Computer Security and Industrial Cryptography) group at the K.U. Leuven, and his master thesis at IBM Research Zurich. Dr. Kohlweiss’ research focus is on privacy-enhancing cryptography and formal reasoning about cryptographic protocols. See also https://www.microsoft.com/en-us/research/people/markulf.
1 https://en.wikipedia.org/wiki/Crypto_Wars
2. Serge Vaudenay. 2002. Security Flaws Induced by CBC Padding - Applications to SSL, IPSEC, WTLS …. (Serge Vaudenay), in EUROCRYPT 2002
4 Analysis of the SSL 3.0 protocol (David Wagner and Bruce Schneier). In USENIX Workshop on Electronic Commerce Proceedings, 1996: 29-40
6 Cryptographically verified implementations for TLS (Karthikeyan Bhargavan, Cédric Fournet, Ricardo Corin,
Eugen Zalinescu), In ACM Conference on Computer and Communications Security, 2008
8 Modular verification of security protocol code by typing (Karthikeyan Bhargavan, Cédric Fournet, Andrew D. Gordon). POPL 2010: 445-456
13 The OPTLS Protocol and TLS 1.3, Hugo Krawczyk Hoeeteck Wee, October 9, 2015, Cryptology ePrint Archive, eprint.iacr.org/2015/978.pdf
|
{"Source-Url": "https://www.research.ed.ac.uk/portal/files/58985639/miTLS_verifying_protocol.pdf", "len_cl100k_base": 6353, "olmocr-version": "0.1.53", "pdf-total-pages": 9, "total-fallback-pages": 0, "total-input-tokens": 31328, "total-output-tokens": 7439, "length": "2e12", "weborganizer": {"__label__adult": 0.0005207061767578125, "__label__art_design": 0.0003573894500732422, "__label__crime_law": 0.00168609619140625, "__label__education_jobs": 0.0007967948913574219, "__label__entertainment": 0.00014543533325195312, "__label__fashion_beauty": 0.0002046823501586914, "__label__finance_business": 0.0005340576171875, "__label__food_dining": 0.0004529953002929687, "__label__games": 0.0009074211120605468, "__label__hardware": 0.00238800048828125, "__label__health": 0.0010890960693359375, "__label__history": 0.0005240440368652344, "__label__home_hobbies": 0.00011527538299560548, "__label__industrial": 0.0008044242858886719, "__label__literature": 0.0004258155822753906, "__label__politics": 0.0005793571472167969, "__label__religion": 0.0006546974182128906, "__label__science_tech": 0.482666015625, "__label__social_life": 0.0001519918441772461, "__label__software": 0.016815185546875, "__label__software_dev": 0.486572265625, "__label__sports_fitness": 0.0004453659057617187, "__label__transportation": 0.0010251998901367188, "__label__travel": 0.00026535987854003906}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 35445, 0.01339]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 35445, 0.38449]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 35445, 0.935]], "google_gemma-3-12b-it_contains_pii": [[0, 0, null], [0, 4431, false], [4431, 10235, null], [10235, 15974, null], [15974, 21226, null], [21226, 25036, null], [25036, 28965, null], [28965, 33513, null], [33513, 35445, null]], "google_gemma-3-12b-it_is_public_document": [[0, 0, null], [0, 4431, true], [4431, 10235, null], [10235, 15974, null], [15974, 21226, null], [21226, 25036, null], [25036, 28965, null], [28965, 33513, null], [33513, 35445, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 35445, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 35445, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 35445, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 35445, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 35445, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 35445, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 35445, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 35445, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 35445, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 35445, null]], "pdf_page_numbers": [[0, 0, 1], [0, 4431, 2], [4431, 10235, 3], [10235, 15974, 4], [15974, 21226, 5], [21226, 25036, 6], [25036, 28965, 7], [28965, 33513, 8], [33513, 35445, 9]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 35445, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-06
|
2024-12-06
|
a6047f4344b15258ea73a9cdeb5027e930d14f9f
|
Glisterings: Longest string; Marching along; A blank argument; A centered table of contents
Peter Wilson
Plain as the glistering planets shine
When winds have cleaned the skies,
Her love appeared, appealed for mine,
And wantoned in her eyes.
_Songs of Travel, Robert Louis Stevenson_
The aim of this column is to provide odd hints or small pieces of code that might help in solving a problem or two while hopefully not making things worse through any errors of mine.
The chief defect of Henry King
Was chewing little bits of string.
_Cautious Tales, Hilaire Belloc_
1 Longest string
Romildo wrote to _comp.text.tex_ saying that he tried to implement a macro for determining the longest string in a list but was having problems with the code [18]. Romildo’s user view of the macro (\Widest) was like this:
\begin{verbatim}
\newdimen\mydimen
\def\Format#1{{\itshape\tiny #1}}
\Widest{\mydimen}\{\Format\}{Good,morning,world}
\end{verbatim}
There were several responses, including ones from GL [8] and Heiko Oberdiek [16] who got into a bit of a discussion about their suggested solutions, partly because GL preferred the strings to look like multiple arguments (e.g., {a}{bbb}{cc}) and Heiko appeared to lean more towards a single argument with the strings being separated by commas (e.g., (a,bbb,cc)).
GL suggested (I have used \Widestg for GL’s macro and \Widesth for Heiko’s to distinguish between them):
\begin{verbatim}
\makeatletter
\newskip\result
\def\Widestg#1#2#3\Widestg{% #1 = Format
\settowidth{\dimen@}{#2{#3}}% #1\z@ % 0 pt
\ifdim#1<\dimen@
#1=\dimen@% \edef\longest{#3}% PW added
\def\flong{#2{\longest}}% PW added
\fi
\ifx\relax#2\else
\Widestg\{\Widestg\{#1\{\longest\}\}\relax\Widestg
\fi
}\makeatother
\result=0pt
\Widest\{\textbf}{one}{two}{three}\relax\Widest\the\result
\longest\ \the\result\ % added by PW
\flong\ \the\result\ % added by PW
\end{verbatim}
I added the code for \Widest which contains the longest string and \flong to typeset it using the specified format. This code, applying the macro to the list \{one\}{two\}{three\}, results in:
\begin{verbatim}
26.13898pt
three 26.13898pt
\end{verbatim}
Heiko came up with a version that uses the \texttt{kvsetkeys} package [14] for parsing a comma-separated list where spaces at the beginning and end of an entry are ignored.
\begin{verbatim}
\usepackage{kvsetkeys}
\newcommand*{\Format}[1]{\textit{\tiny #1}}
\newlength\WidestResult
\makeatletter
\@ifdefinable{\Widesth}{%
\def\Widesth#1#2(#3){% #1 = \z@ % 0 pt
\comma@parse{#3}{% #1=#2\relax% \dimen@=0pt% \edef\longest{#3}% PW added
\ifdim#1<\dimen@% \edef\longest{#3}% PW added
\def\flong{#2(#3)}% PW added
\fi
\ifx\relax#2\else
\Widesth\Widesth\{#3\}
\fi
\}@ifdefinable{\Widesth}{%\newcommand*{\Widesth}[1]{#1(#3)}% \edef\longest{#3}% PW added
\ifx\relax#2\else
\Widesth\Widesth\{#3\}
\fi
%} % ignore list entry argument
}%}%
\makeatother
\end{verbatim}
\begin{verbatim}
21.64417pt
morning 21.64417pt
\end{verbatim}
Just as with \Widestg I added the \longest and \flong code. Note that the comma-separated list of strings is enclosed in parentheses and not braces. The result from Heiko’s example is:
\begin{verbatim}
21.64417pt
morning 21.64417pt
\end{verbatim}
Applying GL’s macro to Romildo’s example as:
\begin{verbatim}
\result=0pt
\Widestg\{\tiny\textit}{Good}{morning}\relax\Widestg
\longest\ \the\result\ % added by PW
\end{verbatim}
Peter Wilson
\long\the\result
results in:
morning 21.64417pt
morning 21.64417pt
which is the same as that from \Widesth.
Although both macros give the same result I prefer Heiko's user interface to GL's, but then you may think it should be the other way round.
2 Marching along
2.1 Oddment
On \texttt{ctt} Roger said that he was
\ldots planning to take a string of the form \texttt{mm.nn.pp}
where \texttt{mm}, \texttt{nn}, and \texttt{pp} are all integers, and test if \texttt{pp} is odd. So I'd like to write a macro that does that and use that as the parameter to \texttt{ifodd}.
Joseph Wright responded \cite{22} that it sounded as though he wanted something like:
\begin{verbatim}
\makeatletter
\newcommand*\MyFunction[1]{%\My@function#1..\@nil\@stop}
\def\My@function#1.#2.#3#4\@stop{\def\My@mm{#1}%
\def\My@nn{#2}%
\def\My@pp{}%\ifx#3\@nil\else\My@function@#3#4\fi%0 below makes the test work when \My@pp is empty\ifodd0\My@last\relax
#1 Odd
\else
#1 Even\fi\def\My@function@#1..\@nil{\def\My@pp{#1}}\makeatother
\end{verbatim}
Example results are:
\begin{verbatim}
\MyFunctionI{11} ⇒ 11 Odd
\MyFunctionI{22} ⇒ 22 Even
\MyFunctionI{} ⇒ Even
\end{verbatim}
For a list of two numbers the command is:
\begin{verbatim}
\makeatletter
\newcommand*\MyFunctionII[1]{%\csparg{MyFunctionII}{#1} \LRA \My@FunctionII#1\@nil%\ifodd0\My@last\relax
#1 Odd
\else
#1 Even\fi\def\My@FunctionII#1.#2\@nil{\def\My@last{#2}}\makeatother
\end{verbatim}
Example results are:
\begin{verbatim}
\MyFunctionII{11.22} ⇒ 22 Even
\MyFunctionII{11.33} ⇒ 33 Odd
\MyFunctionII{11.} ⇒ Even
\end{verbatim}
For a list of three numbers the command is:
\begin{verbatim}
\makeatletter
\newcommand*\MyFunctionIII[1]{%\csparg{MyFunctionIII}{#1} \LRA \My@FunctionIII#1\@nil%\ifodd0\My@last\relax
#1 Odd
\else
#1 Even\fi\def\My@FunctionIII#1.#2\@nil{\def\My@last{#2}}\makeatother
\end{verbatim}
Example results are:
\begin{verbatim}
\MyFunctionIII{11.22.33} ⇒ 22 Even
\MyFunctionIII{11.22.44} ⇒ Even
\MyFunctionIII{11.} ⇒ Even
\end{verbatim}
With Joseph’s code, running his suggested test examples results in:
\begin{verbatim}
Odd Even Even Even
\end{verbatim}
Quite frankly, I do not understand just how his code works. In order to get a better feel for it I decided to write my own macros for dot-separated lists of one, two, and three numbers and then try to extend them to deal with a list of arbitrary extent. Here are my efforts for the one, two, and three length lists. I included some diagnostic output to help when my code didn’t work as I thought that it should.
Firstly, here are the code shorthands that I have used for the diagnostics—the \cs macro is defined in the \texttt{ltugboat} class, as shown:
\begin{verbatim}
\ DeclareRobustCommand\cs\{1\}{%\texttt{\char'\#1}}
\newcommand*\sarg\[1\]{\texttt{\{#1\}}}%
\newcommand*\csparg\[2\]{\cs{#1}sarg{#2}}%
\ensuremath{\Longrightarrow}
\end{verbatim}
For a single number the command is:
\begin{verbatim}
\makeatletter
\newcommand*\MyFunctionI[1]{%\cs{MyFunctionI}sarg{#1} \LRA \ifodd0\My@pp\relax
#1 Odd
\else
#1 Even\fi%
\makeatother
\end{verbatim}
Some example results are:
\begin{verbatim}
\MyFunctionI{11} ⇒ 11 Odd
\MyFunctionI{22} ⇒ 22 Even
\MyFunctionI{} ⇒ Even
\end{verbatim}
For a list of two numbers the command is:
\begin{verbatim}
\makeatletter
\newcommand*\MyFunctionII[1]{%\csparg{MyFunctionII}{#1} \LRA \My@FunctionII#1\@nil%\ifodd0\My@last\relax
#1 Odd
\else
#1 Even\fi\def\My@FunctionII#1.#2\@nil{\def\My@last{#2}}%\makeatother
\end{verbatim}
Example results are:
\begin{verbatim}
\MyFunctionII{11.22} ⇒ 22 Even
\MyFunctionII{11.33} ⇒ 33 Odd
\MyFunctionII{11.} ⇒ Even
\end{verbatim}
For a list of three numbers the command is:
\begin{verbatim}
\makeatletter
\newcommand*\MyFunctionIII[1]{%\csparg{MyFunctionIII}{#1} \LRA \My@FunctionIII#1\@nil%\ifodd0\My@last\relax
#1 Odd
\end{verbatim}
Glisternings: Longest string; Marching along; A blank argument; A centered table of contents
Based on the underlying idea—delimited arguments [1, 6, 9, 20]—of the above macros I then tried to develop one that would take a dot-separated list of any length and return whether the last number was odd or even.
I failed.
Eventually I remembered that the \TeX kernel includes an \texttt{@for} macro for marching along a comma-separated list of elements and decided to try and create a version that would handle dot-separated lists. It is effectively a copy of the \texttt{@for} code replacing every ‘,’ with a ‘.’ I can’t pretend to understand how it works. I have named it \texttt{@ford} as shorthand for \texttt{@fordot-separated-list}.
\makeatletter
% \@ford NAME := LIST \do {BODY}
\long\def\@ford#1:=#2\do#3{\relax
\expandafter\def\expandafter\@fortmp\expandafter{#2}\ifx\@fortmp\@empty \else
\expandafter\@forlooptd\@fortmp\@nil\@nil\@@#1{#3}\fi}
\long\def\@forlooptd#1.#2.#3\@@#4#5{\def#4{#1}\ifx #4\@nnil \else #5\@iforlooptd #3\@@#4{#5}\fi}\fi}
\long\def\@iforlooptd#1.#2\@@#3#4{\def#3{#1}\ifx #3\@nnil \expandafter\@fornoop\relax\else #4\relax\expandafter\@iforlooptd\fi#2\@@#3{#4}}\makeatother
Some example results are:
\\texttt{\MyFunctionIII{11.22.33}} \Rightarrow 33 \text{ Odd}
\\texttt{\MyFunctionIII{11.22.44}} \Rightarrow 44 \text{ Even}
\\texttt{\MyFunctionIII{11.33.}} \Rightarrow \text{ Even}
I did use this for a macro to handle unlimited length lists of the kind that Roger was interested in. Then there was a further posting from him [17] in response to Joseph (which I have abbreviated):
\textit{Thank you. That works (and was quite educational). However, I failed to completely specify my problem ...}
\textit{Here’s what I have:
\{a.b.c, x.y.z\} or
\{x.y.z\} or
Peter Wilson
\{x.y.z\}
where \texttt{a,b,c, x,y,z} are integers.
What I would like to do is to be able to set a switch in the file that if set then the ... would be included only if \texttt{z} is odd, but if the switch is not set then all ... will be included.
This requirement seemed to me to be a candidate for a combination of \texttt{@for} to handle the comma-separated parts and \texttt{@ford} for the portions that are dot-separated.
Below is what I ended up with to handle an unlimited comma-separated list of unlimited dot-separated lists determining whether the last entry of all is odd or even.
First the \texttt{\DotFunction} for a dot-separated list of numbers. I have added some diagnostic print out just in case together with a means (\texttt{@ifop}) for enabling it. The macro is called like:
\texttt{\DotFunction{(N.N.N...N)}}
and sets \texttt{\gotodddtrue} if the last number in the list is odd.
\newif\ifgotodd
\newif\ifop
\optrue
\makeatletter
\def\DotFunction#1{\relax
\ifop \csparg{DotFunction}{#1} \LRA \fi
\def\My@last{0}% in case arg is empty
\@ford\scratch:=#1\do{\edef\My@last{\scratch}}\ifodd0\My@last\relax\gotoddtrue\fiop\My@last\Odd \fi\else\gotoddfalse\fiop\My@last\Even \fi\fi}
\makeatother
Some example results are:
\\texttt{\DotFunction{}} \Rightarrow 0 \text{ Even}
\\texttt{\DotFunction{11}} \Rightarrow 11 \text{ Odd}
\\texttt{\DotFunction{11.22}} \Rightarrow 22 \text{ Even}
\\texttt{\DotFunction{11.22.33}} \Rightarrow 33 \text{ Odd}
\\texttt{\DotFunction{11.22.33.44}} \Rightarrow 44 \text{ Even}
\\texttt{\DotFunction{11.nowt.33.44.55}} \Rightarrow 55 \text{ Odd}
\\texttt{\DotFunction{11..33.44.55}} \Rightarrow 55 \text{ Odd}
\\texttt{\newcommand*{\numM}{11.22.33.44.55.66.77}}
\\texttt{\DotFunction{\numM}} \Rightarrow 77 \text{ Odd}
Note that for \texttt{\DotFunction}, only the last element in the list must be an integer (or blank), earlier
elements can be, for example, text. Further, unlike all the previous \MyFunction... macros, the argument may be a macro.
Finally, here is the end of the exercise—a generalised solution to Roger’s requests, called as \HisFunction\{N,N...N, N...N, ..., N...N\}
\makeatletter
\def\DotCommaFunction#1{%
\csparg{DotCommaFunction}{#1} \LRA
\opfalse% stop \DotFunction printing
\@for\first:=#1\do{%
\DotFunction{\first}}%
@ifgotodd
\My@last Odd
\else
\My@last Even
\fi
\makeatother
Some results of using \DotCommaFunction:
\DotCommaFunction{1.2.3, 4.5.7} ⇒ 7 Odd
\DotCommaFunction{4.5.7} ⇒ 7 Odd
\DotCommaFunction{1, 2.3, , 4.5, 7.8} ⇒ 8 Even
\DotCommaFunction{1,2.3, ,4.5,7.8} ⇒ 8 Even
All that remains is for the user to make appropriate changes to the actions of the odd/even result and to eliminate, or change, the diagnostic outputs to suit the application at hand.
2.2 Indexing into a list
Alastair asked [2]:
I’ve got a question about comma separated lists. Is there any way that you can index elements in a list. Lists can be iterated over in the PGF/TikZ package’s \foreach loop. How can you access an element whilst not in a loop?
Often responses to questions on ctt provide the bare bones of a solution, leaving the questioner to adapt or extend it to his own situation. There were several responses and the one I found that would best suit me was from Ulrike Fischer [7]. The following is essentially Ulrike’s code, edited to better fit the column:
\usepackage{tikz}
\def\values{i5, i4, i3, i2, i1}
\newcounter{loc}
\newcommand{\getitem}[1]{%
\setcounter{loc}{0}
\foreach \x in \values{%
\stepcounter{loc}%;
\expandafter\xdef\csname \x\endcsname\%=\csname alsval\text{\the\value{loc}}\endcsname %
\csname alsval\#1\endcsname}
Ulrike’s \getitem\{\(N\)} macro returns the item that is in the \(N\)th location in \values as \alsval{N}. With:
\getitem{1}, \getitem{4}, \getitem{8}.
the result is:
i5, i2, .
I wondered if there was a solution that did not involve calling the tikz package and came up with the following which does not require any packages, being based on the \LaTeX kernel’s \@for construct.
\let\xpf\expandafter % just to save some space
\makeatletter
\newcount{vindex}
\newcommand*{\getit}[2]{%
\xpf %xpfxpf\@getit\xpf{#2}{#1} %
\theans}
\newcommand*{\@getit}[2]{%
\vindex=0
\def\theans{Index #2 is out of range.} %
\xdef\alist{#1} %
\@for\tmp := #1 \do{%
\advance\vindex 1
\ifnum\the\vindex=#2
\xdef\theans{\tmp} %
\fi}}
\makeatother
The macro \getitem\{\(N\)}\{\list\} returns \theans as the value of the \(N\)th item in the \list where \list may be either a comma-separated list or a macro defined as one. I have included a check on whether \(N\) is valid for the given list (this would be better in the form of an error report in the log file external to the document instead of being typeset).
With these inputs
\getitem{1}{\values},\getitem{4}{\values},\getitem{8}{\values}.
\getitem{1}{i5, i4, i3, i2, i1}, \getitem{4}{i5, i4, i3, i2, i1}, \getitem{8}{i5, i4, i3, i2, i1}.
the results are:
i5, i2, Index 8 is out of range.
i5, i2, Index 8 is out of range.
The key problem that I had to solve in my method is that the ‘list’ that \@for operates on must be an actual sequence of comma-separated items and not a macro defined as such a list. That is why I have separated the code into two macros. The first to grab the list, be it actual or as a macro, and then
to hand that over to \texttt{\@getit} as an actual list by utilising a series of \texttt{\expandafter}s within \texttt{\getit}.\footnote{\texttt{\expandafter} and when it should be used is to me among the more difficult aspects of \TeX{} code. I usually come to a solution by either following what others have done in similar circumstances or by much experimentation—otherwise known as errors and trials.}
The tumult and the shouting dies,
The captains and the kings depart,
And we are left with large supplies
Of cold blanmcange and rhubarb tart.
\textit{After the Party}, RONALD KNOX
3 A blank argument
The title of a posting by Matthew to texhax was \textit{Finding blank argument to a macro}. There is a long history behind this kind of macro, initially posed as a challenge in Michael Downes' \textit{Around the Bend} \cite{Downes} series in the early 90s, and without looking any further I assumed that the solution would be the \texttt{ifmtarg} \cite{ifmtarg} package which provides a test as to whether a macro argument consists of zero or more blank spaces.
However, I was mistaken, as Matthew’s posting continued \cite{Matthew}:
\begin{quote}
I am trying to solve a problem in \LaTeX{} that I thought would be relatively straightforward. I would like to make a macro that will evaluate its argument and tell me whether the result is blank or not ... I managed to come up with a \TeX{} macro that handles different types of 'blank' pretty well. It properly recognizes an empty argument, empty braces, spaces, etc. It even works on another macro that evaluates to a blank, so I thought I was home free. However, as soon as I fed it a macro that takes an argument, bad things happen. I’ve attached a simple document below that shows the problem.
\end{quote}
The ‘simple document’ contains many lines of code implementing his \texttt{\blankArgTest{⟨arg⟩}}, together with examples of when it worked and when it didn’t give the required result. With the macros:
\begin{verbatim}
\usepackage{ifthen}
\newcommand{\testA}{\ifnum10=10 \empty\else A\fi}
\newcommand{\testB}{\ifthenelse{10=10}{\empty}{B}}
\newcommand{\testC}[1]{\ifnum#1=10 \empty\else C\fi}
\end{verbatim}
\texttt{\blankArgTest} worked when \texttt{⟨arg⟩} was \texttt{\testA} but failed for \texttt{\testB} and \texttt{\testC}.
Michael Barr \cite{Barr} came up with a remarkably simple solution which I am presenting as:
\begin{verbatim}
\newcommand{\IfBlank}[1]{\ifdim\wd0=0pt Blank \else Not blank \fi}
\end{verbatim}
The basic idea is to put the argument into an \texttt{\hbox} and check if the box’s width is zero. This assumes that a ‘blank’ argument is one that results in no typeset material (or rather, anything typeset ends with zero width). With the following definitions:
\begin{verbatim}
\newcommand{\blank}{ }
\end{verbatim}
examples of the \texttt{\IfBlank} macro are:
\begin{verbatim}
\IfBlank{} Blank
\IfBlank{ } Blank
\IfBlank{Text} Not blank
\IfBlank{\blank} Blank
\IfBlank{\tout} Blank
\testA Blank
\testB Blank
\testC{10} Blank
\end{verbatim}
A somewhat different need for an empty/blank argument was expressed by Timothy Murphy who wrote \cite{Murphy}:
\begin{quote}
I have a macro \texttt{\cmd{#1#2}}. Both arguments are given in the form {...}. I’d like an empty second argument {} to be added if none is given, i.e., if the next character after \texttt{\cmd{...}} is not {.
What is the simplest way to do this?
\end{quote}
There were three interesting proposed solutions which I have given below.\footnote{I have slightly edited the code, principally by using distinguished macro names instead of the somewhat generic \texttt{\cmd}, and using a common set of tests.}
Heiko Oberdiek’s was the first positive response and was essentially as follows \cite{Heiko}:
\begin{verbatim}
\newcommand*[\CmdH][1]{% \begingroup % remember parameter \toks0={#1}% % look forward \futurelet\NextToken.CmdI \newcommand*[\CmdI][1]{% \ifx\NextToken\bgroup \edef\next{\endgroup\noexpand\CmdImpl{\the\toks0}}% \else \edef\next{\noexpand\CmdImpl{\the\toks0}{}}% \fi
\end{verbatim}
Peter Wilson
\textbf{Heiko:} this is (#1) and here’s (#2).
\newcommand{\CmdImpl}[2]{
this is (#1) and here’s (#2)}
\CmdImpl{abc}{def} \relax
\CmdImpl{ghi}\relax
\CmdImpl{ jkl} %
which results in:
\textbf{Heiko:} this is (abc) and here’s (def).
\textbf{Heiko:} this is (ghi) and here’s ().
\textbf{Heiko:} this is (jkl) and here’s ().
Dan Luecking [10], noting that there were probably better ways (see Heiko’s reply), responded with:
\maketitle
\newcommand*{\CmdEnd}[1]{%\relax}
\newcommand{\CmdStart}[2]%\relax
\begin{#2}
\textbf{Dan:} this is (#1) and here’s (#2).
\end{#2} %
\makeatother
\CmdStart{abc}{def} \relax
\CmdStart{ghi}\relax
\CmdStart{ jkl} %
which results in:
\textbf{Dan:} this is (abc) and here’s (def).
\textbf{Dan:} this is (ghi) and here’s ().
\textbf{Dan:} this is (jkl) and here’s ().
Dan pointed out that his code does not examine the actual \texttt{next} character, but rather the next \texttt{nonspace} character. He also commented that Heiko’s solution emulates a portion of \texttt{@ifnextchar} without the skipping of spaces.
Joseph Wright [21] proposed a solution based on the \texttt{xparse} package [19] developed as part of the \texttt{I\TeX3} project. From the user’s viewpoint it appears to be the simplest of the three proposed solutions.
\begin{verbatim}
\usepackage{xparse}
\NewDocumentCommand{\CmdStart}{mG{}}{%\relax
\textbf{Joseph:} this is (#1) and here’s (#2).}
\CmdStart{abc}{def} \relax
\CmdStart{ghi}\relax
\CmdStart{ jkl} %
\end{verbatim}
which results in:
\textbf{Joseph:} this is (abc) and here’s (def).
\textbf{Joseph:} this is (ghi) and here’s ().
\textbf{Joseph:} this is (jkl) and here’s ().
The three very different implementations each handled all the test cases correctly.
America is a land whose center is nowhere;
England one whose center is everywhere.
\begin{flushright}
Pick Up Pieces, John Updike
\end{flushright}
4 A centered table of contents
Bogdan Butnaru\textsuperscript{3} uses the \texttt{memoir} class and asked me how to have a centered table of contents (ToC). I came up with one solution and passed Bogdan’s request on to Lars Madsen, who is now memoir’s maintainer, and he came up with a better solution; both of these were based on memoir’s tools for manipulating the ToC. I then came up with a more basic solution which is also applicable to the standard \texttt{book} and \texttt{report} classes.
In these classes a chapter entry is set by the \texttt{\l@chapter} macro, a section entry by \texttt{\l@section}, and so on. These may be redefined to produce centered entries. These macros have the general calling form of:
\begin{verbatim}
\l@chapter{⟨number-and-title⟩}{⟨page⟩}
\end{verbatim}
where \texttt{⟨number-and-title⟩} has the form:
\begin{verbatim}
{⟨numberline⟩}{number} title
\end{verbatim}
where \texttt{⟨numberline⟩} typesets the chapter number. The \texttt{\l@…} macros also take into account whether or not the entry should be printed and the surrounding vertical spacing. The \texttt{\L\TeX\ Companion} [12, §2.3] provides further information about ToCs and related packages.
The following redefinition of \texttt{\l@chapter} will center the chapter entries, with the chapter number above the title, and a middle-dot between the title and page number.
\begin{verbatim}
\makeatletter
\renewcommand{\l@chapter}[2]{%\relax
\ifnum\c@tocdepth>\m@ne % print chapter entry
\addpenalty{-\@highpenalty}
\vskip 1em plus 0pt
\begingroup
\def\numberline##1{##1\par} % number
\centering\bfseries
#1~\textperiodcentered~#2\par
\endgroup
\fi}
\makeatother
\end{verbatim}
The \texttt{\tableofcontents} macro uses \texttt{\chapter*} to set the title ragged right. A hack to that can be used to center the title is to make \texttt{\raggedright} into \texttt{\centering}.
\begin{verbatim}
\let\saverr\raggedright
\end{verbatim}
\textsuperscript{3} Private email, 2010/07/21
Glistering: Longest string; Marching along; A blank argument; A centered table of contents
To typeset the ToC with the heading and chapter entries centered is now as easy as:
\tableofcontents
If you wanted the section entries to be centered then \section can be redefined in a similar, but not identical, manner to \chapter. However, centered section entries following a centered chapter entry in my view looks rather confusing.
If you want chapter headings to be centered, you can do:
\begin{verbatim}
\sectioncenter
chapter[...]{...}
\end{verbatim}
or
\begin{verbatim}
\sectioncenter
chapter[...]{...}
\restorerr
\end{verbatim}
In each case the effect of \sectioncenter is limited to \chapter; if it were not then surprises could be in store later on.
References
\begin{verbatim}
\sectioncenter
\section{\chapter[...]{...}}
\end{verbatim}
|
{"Source-Url": "http://www.tug.org/TUGboat/tb36-3/tb114glister.pdf", "len_cl100k_base": 7411, "olmocr-version": "0.1.49", "pdf-total-pages": 7, "total-fallback-pages": 0, "total-input-tokens": 25345, "total-output-tokens": 9199, "length": "2e12", "weborganizer": {"__label__adult": 0.0002372264862060547, "__label__art_design": 0.0006299018859863281, "__label__crime_law": 0.00013744831085205078, "__label__education_jobs": 0.0011434555053710938, "__label__entertainment": 0.0001418590545654297, "__label__fashion_beauty": 0.00010055303573608398, "__label__finance_business": 0.0001455545425415039, "__label__food_dining": 0.00023186206817626953, "__label__games": 0.0006947517395019531, "__label__hardware": 0.00032329559326171875, "__label__health": 0.00011593103408813477, "__label__history": 0.00020885467529296875, "__label__home_hobbies": 0.0001430511474609375, "__label__industrial": 0.00013077259063720703, "__label__literature": 0.0007352828979492188, "__label__politics": 0.00015223026275634766, "__label__religion": 0.0003764629364013672, "__label__science_tech": 0.0025920867919921875, "__label__social_life": 0.0001697540283203125, "__label__software": 0.03973388671875, "__label__software_dev": 0.951171875, "__label__sports_fitness": 0.00016057491302490234, "__label__transportation": 0.00013589859008789062, "__label__travel": 0.0001533031463623047}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 25778, 0.03693]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 25778, 0.1545]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 25778, 0.7821]], "google_gemma-3-12b-it_contains_pii": [[0, 3503, false], [3503, 7445, null], [7445, 11045, null], [11045, 14452, null], [14452, 18542, null], [18542, 22535, null], [22535, 25778, null]], "google_gemma-3-12b-it_is_public_document": [[0, 3503, true], [3503, 7445, null], [7445, 11045, null], [11045, 14452, null], [14452, 18542, null], [18542, 22535, null], [22535, 25778, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 25778, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 25778, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 25778, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 25778, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 25778, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 25778, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 25778, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 25778, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 25778, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 25778, null]], "pdf_page_numbers": [[0, 3503, 1], [3503, 7445, 2], [7445, 11045, 3], [11045, 14452, 4], [14452, 18542, 5], [18542, 22535, 6], [22535, 25778, 7]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 25778, 0.0]]}
|
olmocr_science_pdfs
|
2024-11-27
|
2024-11-27
|
08e76ee57b6ed015e8914fdcc5e7203b55aa7e93
|
GenDB—an open source genome annotation system for prokaryote genomes
Folker Meyer*, Alexander Goesmann, Alice C. McHardy, Daniela Bartels, Thomas Bekel, Jörn Clausen1, Jörn Kalinowski, Burkhard Linke, Oliver Rupp, Robert Giegerich1 and Alfred Pühler2
Center for Genome Research, 1Technische Fakultät and 2Department of Biology, Bielefeld University, Bielefeld, Germany
Received October 30, 2002; Revised and Accepted February 4, 2003
ABSTRACT
The flood of sequence data resulting from the large number of current genome projects has increased the need for a flexible, open source genome annotation system, which so far has not existed. To account for the individual needs of different projects, such a system should be modular and easily extensible. We present a genome annotation system for prokaryote genomes, which is well tested and readily adaptable to different tasks. The modular system was developed using an object-oriented approach, and it relies on a relational database backend. Using a well defined application programmers interface (API), the system can be linked easily to other systems. GenDB supports manual as well as automatic annotation strategies. The software currently is in use in more than a dozen microbial genome annotation projects. In addition to its use as a production genome annotation system, it can be employed as a flexible framework for the large-scale evaluation of different annotation strategies. The system is open source.
INTRODUCTION
The process of genome annotation can be defined as assigning meaning to sequence data that would otherwise be almost devoid of information. By identifying regions of interest and defining putative functions for those areas, the genome can be understood and further research initiated. Annotation generally is thought to be of best quality when performed by a human expert. The vast amount of data which has to be evaluated in any whole-genome annotation project, however, has led to the (partial) automation of the procedure. Due to this, software assistance for computation, storage, retrieval and analysis of relevant data has become essential for the success of any genome project.
Comparison of existing tools
A number of genome annotation systems intended for the analysis of prokaryotic and eukaryotic organisms have been designed and presented in the last few years. The first generation was published in 1996 and consisted of the MAGPIE (1), GeneQuiz (2) and Pedant (3) systems. These focused primarily on generating human readable HTML documents based on tables and sometimes in-line graphics. A number of good ideas originated from this first generation of genome annotation systems, which made their way into today’s systems. Examples are the intuitive visualizations provided by MAGPIE and the splitting of results by significance levels to enable comparison of different tools (also MAGPIE). Since then, a second generation of mostly commercial genome annotation systems has been published, including ERGO (Integrated Genomics, Inc.), Pedant-Pro (successor to Pedant, Biomax Informatics AG), Phylosopher (Gene Data, Inc.), BioScout (Genequiz, Lion AG), WIT (4) and the open source system Artemis (5). Some systems (MAGPIE, Artemis and Phylosopher) contain extensive visualizations or include multiple genome comparison-based annotation strategies [most notably by ERGO (6)]. With the exception of Artemis, all systems provide an automatic annotation feature. To the best of our knowledge, except ERGO, all systems use a variant of ‘best blast hit’ as their fixed, built-in annotation strategy. Only MAGPIE, Artemis and the newer versions of Pedant allow the integration of expert knowledge through manual annotation. (In the last few weeks, the Manatee system has been made public by TIGR. The authors have not yet had the opportunity to evaluate this system.)
The substantial commercial interest in the area of genome annotation has led to a situation where, with the noted exception of Artemis, no genome annotation system is in the public domain. Therefore, only the source code of Artemis is available for further analysis by the research community. Even in-depth technical information, such as details about the annotation strategy implemented, is very hard to obtain. This lack of access is a major hurdle when trying to evaluate these complex systems. Together with the omission of well defined application programmers interfaces (APIs), this prevents the extension of existing systems. This situation is counterproductive for science in this field: the best experts in the field have no medium to contribute their experience to the cooperative evolution of better and better annotation systems. The resulting need for a well designed and documented open source genome annotation system is evident.
*To whom correspondence should be addressed. Tel: +49 521 106 4827; Fax: +49 521 106 5626; Email: fm@genetik.uni-bielefeld.de
source genome annotation system led us to develop GenDB. GenDB is a flexible and easily extensible system, which currently is in worldwide use for the annotation of more than a dozen novel microbial genomes.
As with the very successful Linux computer operating system, the open source license of GenDB enables the cooperative development of high quality software for genome annotation. The system is intended to provide a flexible, transparent infrastructure for genome projects, which other groups can adopt and modify to meet their requirements.
The `System Architecture' and `Implementation' sections describe in detail the GenDB software system; they are intended to enable bioinformatics scientists to evaluate the system. The next section outlines the bioinformatics methods currently implemented by the system; here the target audience is the biologist looking for a tool to annotate a genome. Finally, the section on applications is intended for a general audience to show the scope of projects in which GenDB currently is being used.
**SYSTEM ARCHITECTURE**
A surprising lesson learned from the analysis of the existing systems (as far as they are known to the authors) is the lack of consistent internal data representation. However, in our opinion, an internal data representation using a well defined data model is the prerequisite needed to provide an API for any larger software system.
**Data model design**
We chose a very simple data model, based on only three core types of objects. Regions describe arbitrary (sub-)sequences. A region can be related to a parent region, e.g. a CDS is part of a contig. Observations correspond to information computed by various tools [e.g. BLAST (7) or InterPro (8)] for those regions. Annotations store the interpretation of a (human) annotator. They describe regions based on the evidence stored in the observations. Figure 1 shows the relationships between the different core objects. As can be seen, there is a clear distinction between the results from various bioinformatics tools (observations) and their interpretation (annotations), implemented in the data model. While this data model seems very generic, it represents a hierarchy of classes, including the complete EMBL feature set with several extensions. There are additional classes (e.g. tools and annotators) that complement the three core classes.
Since data access is via the objects described above, the classes in GenDB themselves form the API.
This object-oriented approach makes code maintenance easy, and also makes the data and methods in our system accessible to other programs. At the same time, we provide a means to extend the GenDB system.
**General overview**
Figure 2 illustrates the architecture of the GenDB system: the GenDB objects are mapped onto tables via O2DBI and stored in an SQL database. All access to these data via a Perl client or server API, or via a C++ client interface is again managed by the O2DBI module. On the client side, user interfaces can be implemented that use the functionality of these APIs.
On the server side, sequence databases can be accessed with the SRS (9) system or via the BioPerl (http://www.bioperl.org) interfaces. Computational intensive tools such as BLAST or InterPro can be managed and scheduled via a BioGrid (e.g. Sun GridEngine http://www.sun.com/gridware).
**Plug-in architecture**
As all data in the system are accessible, almost any task can be performed by a plug-in, defined as a tool that operates on the GenDB data structures. While the core GenDB system provides a mechanism for manual annotation, an automatic annotation plug-in performs automatic assignment of regions (e.g. genes) and/or functional annotation for those regions. Another example of the plug-in architecture is the inclusion of the PathFinder (10) component for the analysis of metabolic data.
**Wizards**
Repetitive tasks such as updating the position of every downstream gene after a frameshift correction are performed.
There are several ways of accessing the system, an API, user functionality is possible in separate Perl modules. Methods are stored in Perl modules. Extension of the object etc.) for the objects. These automatically generated object that implements standard methods (create, delete, init, get/set, etc.) for the objects. These automatically generated object methods are stored in Perl modules. Extension of the object functionality is possible in separate Perl modules.
Interfaces
There are several ways of accessing the system, an API, user interfaces and a new client–server interface.
IMPLEMENTATION
We chose Perl (http://www.perl.org) as implementation language using a multitude of existing Perl modules from the BioPerl project. The widespread use of Perl in bioinformatics will enable many researchers to use GenDB as a platform for their implementation of further genome analysis pipelines. Using Perl with GenDB allows the incorporation of additional tools and methods from this area of research. To be able to offer an API to the outside world, the system requires a persistent storage layer. We elected to use an relational storage backend (SQL), which provides a fast, reliable and well tested storage subsystem.
O2DBIv2 (objects to database interface)
The complexity of our system encourages using an object-oriented approach not only in designing (see Fig. 1) but also in implementing the system. While Perl offers various interfaces to DBMS systems, there was no previous tool available for the mapping of Perl objects to relational tables, applicable for our purposes. We therefore used at first the original O2DBI system (O2DBI, J.Clausen, Technical Report, Bielefeld University, 2002) which was then enhanced substantially by B. Linke as O2DBIv2 (B. Linke, in preparation) to map Perl objects automatically to relational tables. Object descriptions in UML (XMI) format are now translated into a library of Perl objects with Perl and C++ client–server bindings. All objects are stored in a relational database [e.g. MySQL (http://www.mysql.com) or PostgreSQL (http://www.postgresql.org)].
Figure 3 shows a simplified version of the role of O2DBI. Classes are described as Perl hashes (denoting objects) which are mapped to relational tables. Perl source code is generated that implements standard methods (create, delete, init, get/set, etc.) for the objects. These automatically generated object methods are stored in Perl modules. Extension of the object functionality is possible in separate Perl modules.
User interfaces. The more widely used frontend is a Gtk-Perl (http://www.gtkperl.org) based graphical user interface (GUI) that offers access to the data in the system by a variety of navigation metaphors (see Figs 4 and 5). Since not all users have access to a platform with Perl/Gtk, a web interface is also provided. The web interface offers somewhat restricted functionality with respect to the GUI. However, due to its HTML standard compliance, the web interface provides access to GenDB for a wide range of platforms.
As stated above, the GenDB classes form the API. Documentation of each class and object property or method is available on our web site. The relative simplicity of our object model, together with the documentation, has led several groups to use GenDB as a platform for their research. The web site has several sample scripts that show the functionality of the GenDB API. Using this interface, programmers are able to extract or manipulate the GenDB data objects. This allows, for example, the user to write simple Perl scripts that compute the molecular weight for every protein in a given genome and to generate a table.
SOAP interface. In addition to the Perl API, we are in the final development stages of a client–server programmers interface. This will not only allow non-Perl platforms to connect to the GenDB system, but will also allow clients to run on remote machines. We use a SOAP (http://www.w3.org/2000/xp/Group/) interface to make our GenDB API available to languages such as C++, Python or Java.
System requirements
Since one aim of the GenDB project is to provide a platform for end users and developers, the system has very modest system requirements. A Unix system with Perl, an SQL database and BioPerl are necessary. If the user wants to compute new observations with GenDB, the required tools will have to be installed on the system or have to be available via some kind of queuing system. For a complete local installation, the sequence databases used by the tools and some sequence retrieval mechanism are required. We currently use SRS and BioPerl for this purpose. Of the systems available today, only SRS provides user-friendly views on the sequence databases.
The system can be installed on a single (e.g. Linux) server or can be spread out over multiple machines, creating a client–server installation. Locally, several test and development installations exist on single CPU Linux platforms, while our production environment includes a client–server environment with a server for the frontend, a dedicated database server and a BioGrid to perform the computation of observations.
License
To provide a resource to the academic community, we distribute the complete system (including source code) to non-commercial users under an open source license. Special commercial licenses are available on request.
Documentation and availability
The complete system including the source code, documentation, a guided tour and installation instructions is available from our web site: http://gendb.Genetik.Uni-Bielefeld.DE.
The documentation includes the details on the system architecture, the API and data model. An XML file describing the complete data model in great detail and hyperlinks to both versions of O2DBI can also be found on the website.
**BIOINFORMATICS METHODS**
Data import and export
An important step for any genome analysis project is the availability of good import and export facilities in the genome annotation system. Currently, the GenDB system allows data import from GenBank, EMBL and fasta format files. Supported export formats are GenBank, EMBL, fasta format files and GFF (genome feature format; see http://www.sanger.ac.uk/Software/formats/GFF). A user-configurable linear or circular whole-genome view (see Fig. 5), which can be exported as a PNG file, complements the export formats. For each gene annotated with GenDB, a printable gene report can be generated.
Integration of tools
As described in the System Architecture section, GenDB allows the incorporation of arbitrary programs for different kinds of bioinformatics analysis. According to the system design, these programs are integrated as tools, which create observations for a specific kind of region. The inclusion of such tools in GenDB is very easy, with the most time-consuming step typically being the implementation of a parser for the result files. For the prediction of regions, such as coding sequences (CDS) or tRNA-encoding genes, GLIMMER (11), CRITICA (12) and tRNAscan-SE (13) have been integrated into the system. Homology searches at the DNA or amino acid level against arbitrary sequence databases can be done using the BLAST program suite. In addition to using HMMer (14) for motif searches, we also search the BLOCKS (15) and InterPro databases to classify sequence data based on a combination of different kinds of motif search tools. A number of additional tools have been integrated for the characterization of certain features of coding sequences, such as TMHMM.
for the prediction of α-helical transmembrane regions, SignalP (17) for signal peptide prediction, or CoBias (A.C. McHardy et al., in preparation) for analyzing trends in codon usage.
Whereas some tools only return a numeric score and/or an E-value as a result, other tools such as BLAST or HMMer additionally provide more detailed information, such as an alignment. Although the complete tool results are available to the annotator, only a minimum data subset is stored in the form of observations. Based on this subset, the complete tool result record can be recomputed on demand. Storing only a minimal subset of data reduces the storage demands by two orders of magnitude when compared with the traditional ‘store everything’ approach. Our performance measurements have shown this also to be more time efficient than data retrieval from a disk subsystem for any realistic genome project. The computation of tool results is done via a plug-in that connects to a BioGrid using the Sun GridEngine software. The graphical user interface for the display of tool results is depicted in Figure 6. Upon selection of a certain region, all available tool results for this region are visualized in a completely customizable list. More information about the underlying database record is available by a cross-link to the corresponding sequence databases with the SRS system.
**Data navigation metaphors**
The design of the GenDB system allows the projection of data from any component or plug-in onto all views (see also Fig. 7). This allows the user to navigate the genome with a wide variety of synchronized views.
**Annotation**
As already mentioned, the GenDB data model features a strict separation of tool results (observations) and their interpretation (annotation). This confers a large amount of flexibility and enables researchers to define their application-specific annotation strategies freely. The GenDB system supports both manual annotation and the application of automated annotation strategies. For manual annotation, the user interface provides a ‘one click’ infrastructure; for automatic annotation, the API can be used.
Figure 6. The observations, a single BLAST report and the underlying database record (via SRS) for a CDS region as shown by GenDB. The user can create a manual annotation by clicking on an observation.
The core GenDB system offers simple automatic annotation functions which allow the application of user-defined ‘best tool result’ strategies. In addition to this, the GenDB-Annote plug-in provides more complex annotation strategies based on the integration of an expert system. Here, the user can define a set of rules to be used for automatic annotation of regions, or assignment of function to those regions. Owing to the consistent, internal data representation of GenDB, all GenDB objects can be accessed directly by an expert system. While implementing a new annotation strategy currently entails writing programming code, we are in the process of establishing a graphical editor (with XML export) for editing of annotation rules and a processor for computing annotations based on these rules.
For annotation projects, the linear contig with its list of genes often is only a starting point. The knowledge about metabolic pathways and the enzymes contained in them is connected to the data in GenDB via the GOPArc (Gene Ontology and Pathway Architecture) module. GOPArc integrates our previously described PathFinder system. It is a tool for the integration of metabolic pathway and ontology knowledge into GenDB. Using O2DBI, we created an object
Figure 7. Data navigation via KEGG pathways (here all annotated enzymes of the metabolism of nucleotide sugars for S. meliloti) or gene ontologies (here identified regions for a selected GO number).
model representation of the complete KEGG database. Knowledge from other databases [e.g. MetaCyc (http://www.metacyc.org), BRENDA (http://www.brenda.uni-koeln.de)] can be incorporated. In addition to that, the system also provides access to the complete Gene Ontologies (GO) (http://www.geneontology.org) and navigation metaphors that allow browsing genomic data via the GO categories.
Annotation pipeline
Figure 8 shows an example of a genome annotation pipeline that has been implemented with GenDB. Upon import of the raw sequence data, a parent region object describing the genome sequence is created. Following this step, user-defined tools for the prediction of different kinds of regions, such as coding sequences (CDS) or tRNA-encoding genes, can be run. The output of these tools is stored as observations which refer to the parent region object. Based on these observations, an annotator, human or machine, performs "region annotation". This means confirming or disregarding the results of gene prediction tools by creating region objects such as CDSs or tRNAs. The annotations form a complete protocol of all "region annotation" events. Following the creation of different kinds of regions, additional tools such as BLAST, HMMer or CoBias can be run, creating information related to their potential function. Finally, a "function annotation" step can be performed by an annotator in which a putative function is assigned to these regions by an interpretation of the observations.
APPLICATIONS
The GenDB system can be used for the annotation of novel genomes, as a model organism database (MOD) for the curation of already annotated genomes, or as a platform for software development.
Using GenDB for genome annotation
The GenDB system has already been installed at a number of European and worldwide institutions, including the German Max Planck network. GenDB currently is being used for the annotation of a number of microbial genomes. The genomes of Sinorhizobium meliloti (18) and Corynebacterium glutamicum ATCC 13032 (J.Kalinowski et al., in preparation) in addition to a large number of bacterial artificial chromosomes, cosmids and plasmids [e.g. Tauch et al. (19,20)] have already been analyzed with GenDB at Bielefeld University. Six novel genomes currently are being analyzed by other European groups with their own installations of GenDB. An additional five genomes (Sorangium cellulosum, Xanthomonas campestris pv. vesicatoria, Alcanivorax borkumensis, Azoarcus sp. and Clavibacter michiganensis) are analyzed by a network of German groups, which use the GenDB platform established at Bielefeld University.
GenDB as model organism database
For curation of already annotated genomes, these can be imported from EMBL or GenBank format files into the system. Any annotation information contained in these is stored in the form of GenDB objects. The data corresponding to these objects again are available via the GenDB API and user interfaces. Once there is a standard data model for prokaryote genomes (such as GMOD for the eukaryote world, see http://www.gmod.org), GenDB will be updated to support that data model.
GenDB as a platform for software development
Due to its versatility, the system is also well suited for use as a platform for novel software development, for which it has already been employed for 2 years at Bielefeld University. Recently, a number of German groups have started to implement their algorithms in the framework of GenDB, e.g. groups in the Max Planck Institutes in Tübingen and Bremen have implemented individual gene prediction strategies for their microbial genome projects using the GenDB framework.
DISCUSSION
We present a new open source platform, for both biologists and bioinformaticians, that implements the state of the art for genome annotation systems and enhances it in several areas. The system has been in use for 2 years at Bielefeld University and for more than a year at various other institutions. The key features of the system are its flexibility and extensibility. With respect to the genome annotation process, the system provides a flexible framework for implementing various user-defined annotation strategies, instead of relying on a single built-in annotation approach. Our past experiences have also shown the system to be well suited as an extensible platform for the integration of different kinds of functionality. It currently is used for the implementation of a system which links microarray data to gene annotation. We have implemented a wide range of metaphors for data navigation, which allow fast and easy access to different kinds of information during the genome annotation process. We hope that the positive features of the system which we provide to the research community will help to
Figure 8. A sample genome analysis pipeline implemented with GenDB.
initiate research in new directions and will also be used for generating novel knowledge.
The well designed and documented API has also enabled other researchers to build their own tools based on GenDB. This proves that the main benefit of the open source approach, the cooperative development of high quality software, is already emerging. The ongoing work on GenDB is in the direction of more sophisticated automatic annotation methods. Another direction is the integration of GenDB with other programs and data sources to build a platform for systems biology.
Since only 60–70% of the genes typically found in a bacterial genome can be characterized functionally using a purely sequence-based approach, there is a clear need for adding more information to the analysis process. The GenDB system is an ideal platform to link transcriptome and proteome evidence to the genome, facilitating further analysis of previously uncharacterized genes.
ACKNOWLEDGEMENTS
The authors would like to thank all GenDB users for their time, patience and feedback that helped greatly in optimizing numerous details of the system. A.C.M. was supported by the DFG-Graduiertenkolleg 635 Bioinformatik. The work of F.M. and A.G. is financed by the BMBF grant 031U213D.
REFERENCES
|
{"Source-Url": "https://pub.uni-bielefeld.de/download/1773880/2311334", "len_cl100k_base": 5382, "olmocr-version": "0.1.50", "pdf-total-pages": 9, "total-fallback-pages": 0, "total-input-tokens": 23461, "total-output-tokens": 7592, "length": "2e12", "weborganizer": {"__label__adult": 0.00033926963806152344, "__label__art_design": 0.000385284423828125, "__label__crime_law": 0.00042557716369628906, "__label__education_jobs": 0.0012121200561523438, "__label__entertainment": 0.00017452239990234375, "__label__fashion_beauty": 0.00021779537200927737, "__label__finance_business": 0.0003058910369873047, "__label__food_dining": 0.0005021095275878906, "__label__games": 0.0006008148193359375, "__label__hardware": 0.00185394287109375, "__label__health": 0.0011997222900390625, "__label__history": 0.00039076805114746094, "__label__home_hobbies": 0.00017881393432617188, "__label__industrial": 0.0007615089416503906, "__label__literature": 0.00032782554626464844, "__label__politics": 0.0003342628479003906, "__label__religion": 0.0006504058837890625, "__label__science_tech": 0.35888671875, "__label__social_life": 0.0002015829086303711, "__label__software": 0.045257568359375, "__label__software_dev": 0.5849609375, "__label__sports_fitness": 0.0003600120544433594, "__label__transportation": 0.0004911422729492188, "__label__travel": 0.00023317337036132812}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 31361, 0.02057]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 31361, 0.28939]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 31361, 0.85868]], "google_gemma-3-12b-it_contains_pii": [[0, 4932, false], [4932, 8929, null], [8929, 14535, null], [14535, 16496, null], [16496, 18634, null], [18634, 18836, null], [18836, 20290, null], [20290, 25151, null], [25151, 31361, null]], "google_gemma-3-12b-it_is_public_document": [[0, 4932, true], [4932, 8929, null], [8929, 14535, null], [14535, 16496, null], [16496, 18634, null], [18634, 18836, null], [18836, 20290, null], [20290, 25151, null], [25151, 31361, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 31361, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 31361, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 31361, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 31361, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 31361, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 31361, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 31361, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 31361, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 31361, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 31361, null]], "pdf_page_numbers": [[0, 4932, 1], [4932, 8929, 2], [8929, 14535, 3], [14535, 16496, 4], [16496, 18634, 5], [18634, 18836, 6], [18836, 20290, 7], [20290, 25151, 8], [25151, 31361, 9]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 31361, 0.0]]}
|
olmocr_science_pdfs
|
2024-11-28
|
2024-11-28
|
cba447eeb8d41624c68a1a6930acb21a8e54b68f
|
An Adaptive Resolution Scheme
for Performance Enhancement of a Web-based
Multi-User VR Application
Rishabh Pathak1, Anderson Augusto Simiscuka1, Member, IEEE, and
Gabriel-Miro Muntean1, Senior Member, IEEE
Abstract—Over the last few years, several frameworks have been introduced to help developers build virtual reality (VR) experiences for the web. One such open-source web framework is the A-Frame framework, which is built on top of WebXR and Three.js. A-Frame can be used to create 3D scenes that can be rendered using compatible browsers such as Chrome and Firefox. The performance of web-based VR applications, however, can be affected due to the limitations of the CPU and GPU, especially in multi-user applications. In this paper, an A-Frame-based multi-user VR application is developed and the performance is analyzed under different scenarios, demonstrating how an increase in the number of users affects metrics related to VR quality of experience (QoE). Then, an Adaptive Resolution Scheme for VR (ARS-VR) is proposed, which improves the VR performance in terms of frame rate and frame latency on remote devices with limited processing and display features.
Index Terms—VR, WebXR, A-Frame, Three.js, frame rate, resolution, adaptation
I. INTRODUCTION
WEBXR, formerly known as WebVR, is an application programming interface (API) that has made possible the development of VR applications on the web. As the name suggests, it is a combination of two technologies - Web and VR. The web takes care of the HTML, CSS styling, and JavaScript while VR is the usage of virtual reality devices such as Oculus and Google Cardboard. It is used in conjunction with WebGL, which is a JavaScript API that can be used for rendering 2D and 3D graphics in various compatible web browsers. These technologies together enable the user to experience a VR scene on their browsers. While VR applications built using development engines such as Unity and Unreal Engine need to be downloaded and installed on the user devices, with WebXR it is possible to access a VR application in a web browser.
The work presented in [1] showcases a Unity-based VR application wherein they evaluate the throughput and round trip time (RTT) against an increasing number of simulated users and server refresh rate. Authors in [2] attempt to evaluate A-Frame [3] as a VR technology by creating a 360-degree virtual tour consisting of panoramic equirectangular photos of the Conímbriga Monographic Museum in Portugal. A-Frame can be tested in terms of frame rate to demonstrate the quality and responsiveness of the experience [4], [5]. This indicates the need for approaches that increase the frame rate metric, especially in devices with limited processing resources.
As demonstrated by [1] and [6], rendering VR graphics in web browsers can be a graphics processing unit (GPU) intensive job and requires high-end graphics and processing hardware to provide a stable frame rate, which is the minimum requirement for a smooth user experience.
This paper describes the design and implementation of a multi-user VR application developed using the A-Frame library, rendered as a 360-degree experience within a browser. The application employs a novel Adaptive Resolution Scheme for VR (ARS-VR), which improves the VR performance in terms of frame rate and frame latency on remote devices with limited processing and display features.
A-Frame offers cross-platform support, being compatible with iOS, Android and Windows devices with an active internet connection. Fig. 1 shows the proposed application, a VR movie theater-like setting. Multiple remote users can join the VR scene with or without a VR headset and can watch a movie together. This allows for analysis of the performance of the application with multiple users connected via different devices consuming rich media content in VR.
The remaining sections of this paper are organized as follows. Section II presents related works and Section III discusses the application design and implementation. Section IV describes the performance analysis. Conclusions and directions for future work end this paper in Section V.
II. RELATED WORK
A number of approaches have been reviewed in relation to the scheme proposed in this paper. For instance, the authors in [7] built a synchronization test-bed consisting of a web application that uses A-Frame based HTML pages. These pages create a binding between the user interface and the core of another application that delivers instructions to IoT devices in a VR-IoT synchronization system [8]. The research focuses on achieving timely synchronization between IoT devices in the real and virtual world.
Authors in [6] proposed a multi-user VR application to facilitate inter-communication between different VR hardware vendors such as HTC Vive and Oculus Rift. Whereas authors in [1] analyzed the performance of a Unity-based VR application by spawning multiple moving users that can share streamable files in a virtual space through a mobility algorithm. However, the impact on the frame rate with an increasing number of users on the same machine has not been considered as the author has attempted to evaluate the performance on the network level.
The users in the VR environment as demonstrated in [6] and [1] are simulated within the VR environment in the form of capsule-like avatars, but the users might feel socially detached. The scheme proposed in [9] tries to tackle this problem by using a green screen to blend people into the VR environment developed using A-Frame. They observed certain resolution problems with the videos and background images. Also, the browser runs at a frame rate of 50-60 frames per second (fps) which is less than they anticipated nevertheless, it is difficult to say if the frame rate was supposed to be more than that unless they had mentioned the specifications (primarily the screen refresh rate) of the laptops used.
Most standard laptops have a 60Hz refresh rate and a frame rate above the laptop’s refresh rate can create screen tears and visual lag unless vertical sync (Vsync) [10] is enabled. Some gaming laptops provide up-to 165Hz refresh rate even though only a few of those are fully capable of supporting VR because of differences in the GPU. Less than 1% of sold computers and 6.8% of sold smartphones are VR ready, representing only 13 million computers and just under 200 million smartphones [11], [12]. The number was estimated to reach 100 million by 2020 which is still a small number as from 2015 to 2019, roughly 1.5 billion PCs were in use worldwide [13].
Regarding VR support on multiple devices, [14] also talks about problems with VR performance on mobile devices in multi-user distributed VR spaces. This paper proposes a novel adaptive resolution scheme within a multi-user VR application that aims at providing the best possible frame rate against different number of users, which if integrated with the WebXR API in future could help support VR for low-end devices.
III. APPLICATION DESIGN AND IMPLEMENTATION
The 360-degree scene in the application was principally designed using the A-Frame framework. It primarily uses HTML and has several Javascript libraries supporting it to take care of the 3D boilerplate and bi-directional communication between the clients and the application server. These libraries and their respective versions used have been listed in Table I. Some of the minified versions of the Javascript files were imported with their respective content delivery network (CDN) links.

<table>
<thead>
<tr>
<th>Library</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>A-Frame</td>
<td>1.0.4</td>
</tr>
<tr>
<td>three.js [16]</td>
<td>r119</td>
</tr>
<tr>
<td>WebGL [17]</td>
<td>2.0</td>
</tr>
<tr>
<td>WebVR PolyFill [18]</td>
<td>0.10.4</td>
</tr>
<tr>
<td>Networked A-Frame [19]</td>
<td>0.7.1</td>
</tr>
<tr>
<td>socket.io [20]</td>
<td>2.2.0</td>
</tr>
<tr>
<td>node.js [21]</td>
<td>12.18.3</td>
</tr>
</tbody>
</table>
The application allows users to watch a film in a synchronized manner, in a virtual cinema room, as seen in Fig. 1. The film used for the tests is the Big Buck Bunny animation [15].
As network security is a crucial factor in multi-user VR systems [1], [6], [9], the application keeping in mind security over the public internet uses a reverse proxy service called ngrok to expose the local application server to a firewall on the public internet using secure tunnels [23]. Therefore, users that are not on the same network as the server can access the application by querying the link to the secure tunnel. The reason this tunnel is called secure is because it uses Transport Layer Security (TLS version 1.2 - RFC 5246) to send the application data.
A. Client-Server Architecture
Two laptops were used as the application server and the client with their respective specifications shown in Tables II and III.
Additionally, a smartphone was used to simulate a client from a different network than the server. The configuration is given in Table IV. Fig. 2 demonstrates the architecture or the testbed containing the application server and the clients. The external clients access the application server through the secure tunnel as shown in the figure.
B. Client-Server Operation
Before the users can join the VR scene, the server is started by using the NPM JavaScript package manager so that it can pre-load all the dependencies inside a JavaScript Object Notation (JSON) file for Networked A-Frame. Networked A-Frame is another library that is built on top of A-Frame and helps with the creation of templates for the position synchronization of the avatars and video playback. Once the server starts listening on port 8080, the client can create a ngrok tunnel instance to open the application server port to receive public requests. Ngrok allows the use of mobile networks for the testing of the application, and a 4G connection was used.
Once the user opens a browser window, the request is sent to the server based on the source. If the request is made locally, a direct connection with the server is initiated, but if the request is made via a public network, it is re-directed through the
### TABLE II
**LAPTOP 1 - SPECIFICATIONS**
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>Model</td>
<td>Dell Inspiron 3551 15</td>
</tr>
<tr>
<td>Processor</td>
<td>Intel Pentium Quad Core N3540</td>
</tr>
<tr>
<td>Memory (RAM)</td>
<td>4GB</td>
</tr>
<tr>
<td>GPU</td>
<td>Intel Integrated HD Graphics</td>
</tr>
<tr>
<td>Screen Refresh Rate</td>
<td>60Hz</td>
</tr>
<tr>
<td>Screen Resolution</td>
<td>1366x768</td>
</tr>
<tr>
<td>Aspect Ratio</td>
<td>16:9</td>
</tr>
<tr>
<td>Operating System</td>
<td>Windows 10</td>
</tr>
</tbody>
</table>
### TABLE III
**LAPTOP 2 - SPECIFICATIONS**
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>Model</td>
<td>Dell Inspiron 13-5378</td>
</tr>
<tr>
<td>Processor</td>
<td>Intel Core i7-7500U</td>
</tr>
<tr>
<td>Memory (RAM)</td>
<td>16GB</td>
</tr>
<tr>
<td>GPU</td>
<td>Intel HD Graphics 620</td>
</tr>
<tr>
<td>Screen Refresh Rate</td>
<td>60Hz</td>
</tr>
<tr>
<td>Screen Resolution</td>
<td>1280x720</td>
</tr>
<tr>
<td>Aspect Ratio</td>
<td>16:9</td>
</tr>
<tr>
<td>Operating System</td>
<td>Windows 10</td>
</tr>
</tbody>
</table>
### TABLE IV
**SMARTPHONE - SPECIFICATIONS**
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>Model</td>
<td>Motorola One Power</td>
</tr>
<tr>
<td>Processor</td>
<td>Qualcomm Snapdragon 636</td>
</tr>
<tr>
<td>Memory (RAM)</td>
<td>4GB</td>
</tr>
<tr>
<td>GPU</td>
<td>Qualcomm Adreno 509</td>
</tr>
<tr>
<td>Screen Refresh Rate</td>
<td>60Hz</td>
</tr>
<tr>
<td>Screen Resolution</td>
<td>360x749</td>
</tr>
<tr>
<td>Aspect Ratio</td>
<td>19:9</td>
</tr>
<tr>
<td>Operating System</td>
<td>Android 10</td>
</tr>
</tbody>
</table>
At this point, two variables are initialized with the product between the device pixel ratio and the screen width and height respectively. Another function calculates the greatest common divisor between the two newly initialized variables. The variables are now divided by the divisor to get the aspect ratio. The numerator and denominator of the aspect ratio are multiplied with the frame rate to provide a dynamic resolution. This algorithm was found to be suitable for laptop 2 with a widescreen aspect ratio. In the case of smartphones, the screen height is usually more than the width therefore, the algorithm first takes a ratio of the width to the height and if it is less than 1, it adjusts the resolution using the screen height and width of the smartphone. The resolution, in this case, is not dependent on the frame rate.
In both cases, the user sees a drop in the resolution but in a multi-user environment, it intends to keep a stable average frame rate between 40-60fps. The reason why the resolution is dropped for smartphones is that by default, the application is rendered at a resolution of 1920x1920px [24], which is way more than the physical resolution of mid-range smartphones. One might argue that because of high number of pixels per inch (ppi) animations will be sharper and crisp on a small size display, but unless the device has a high-end processing unit to support it, it will only make the application lag and cause motion sickness if the user is wearing a VR headset.
### User Mobility and Audio-Video
Playback Simulated users can move around in the scene using the standard movement keys "w", "a", "s" and "d". Apart from the libraries mentioned in Table I, two more open source projects were used for allowing users to exchange voice messages and control playback of the video inside the scene [25], [26]. The WebRTC adapter enables microphone access in the browser for voice chat. The other project is a Javascript file based on top of the Networked-A-Frame library which defines a custom A-Frame component for broadcasting the video playback events to all the clients on the same network.
Algorithm 1: Adaptive Resolution Scheme for VR
\[
\text{while browser_window==open do}
\]
\[\text{Input: framerate; screen_width; device_pixel_ratio; window_height}
\]
\[\text{Output: maxCanvasSize}
\]
\[\text{Function greatest_common_divisor}(w, h):
\]
\[\begin{aligned}
&\text{var } w = \text{screen_width}*\text{device_pixel_ratio} \\
&\text{var } h = \text{window_height}*\text{device_pixel_ratio} \\
&\text{var ratio = screen_width/screen_height} \\
&\text{var gcd = greatest_common_divisor}(w, h) \\
&\text{var num = w/gcd} \\
&\text{var den = h/gcd} \\
&\text{return num, den, ratio, w, h}
\end{aligned}
\]
\[\text{Function Main:}
\]
\[\begin{aligned}
&\text{if ratio <1 then} \\
&\text{maxCanvasSize = \{height: h/2, width: w/2\}} \\
&\text{else} \\
&\text{maxCanvasSize =\{height: framerate*den, width: framerate*num\}} \\
&\text{return maxCanvasSize}
\end{aligned}
\]
\[\text{end}
\]
end
It roughly synchronizes the time each client is into the video since they entered the scene so that everyone is on the same point in the video once they join the room. The networked A-Frame library also uses the Open-EasyRTC server API for video synchronization [27]. Another custom component was added to the HTML front-end to allow users to broadcast play-pause events in the video.
IV. PERFORMANCE ANALYSIS
The testbed was set up as illustrated in Fig. 2 and analysis was performed after measuring QoS parameters for multiple users served by the same application server. Although A-Frame supports most browsers such as Chrome, Firefox, and Internet Explorer, Chrome was used as the client browser for all the experiments to keep the results consistent as all browsers have different rendering capabilities.
A. Frame Rate and Resolution Analysis
The application server was started and multiple browser windows were opened once a client avatar appeared for each window. The application was allowed to run at its default resolution for approximately 120 seconds with the algorithm code commented out and the video inside the scene playing. The frame rate data was sent to the console output every second.
The browser windows were closed and console data was collected. The application window was opened once again. However, this time, the JavaScript code for the algorithm was allowed to run. Fig. 3 shows the average frame rate for 4 simulated users with and without the algorithm running behind the scenes. The graphs indicate that the frame rate in the former case started well nevertheless, it dropped a few times and could peak up-to 50fps. In the latter case, the frame rate starts great and remains steady between up to 60fps for the whole duration. The same experiment for the same duration was repeated for 6 and 8 users. Figs. 4 and 5 show the variation of the frame rate against time in each case, respectively.
The downward spikes in Fig. 5 just after 40s is due to the frame rate getting dropped every time a new client was added. More downward spikes correspond to more users being added. The other downward spike just before 100s is because of the navigation between browser windows. The average frame rate in default resolution and adjusted resolution for each case is shown in Table V.
These results indicate that if the ideal frame rate for the 60Hz client monitor is considered to be 60fps, the algo-
The algorithm reduces the fps loss in the scenarios with 4, 6, and 8 simultaneous users by 23%, 30%, and 28%, respectively. Beyond 8 users, the CPU of the used computer reaches its full functioning capacity and after a point, the system starts to lag and either crashes or stops responding. In spite of having a reasonable GPU, the client system is bound by its CPU.
In order to verify that the values of the frame rate were not too spread out from the mean value, the standard deviation for frame rate of all scenarios was calculated, as seen on Table VI.
The impact of the algorithm on resolution over the 120-second tests is shown in Figs. 6, 7 and 8, in the scenarios with 4, 6 and 8 users, respectively. The resolution variation has a transitory initial period (visible in all graphs), followed by a relatively stable period, once the framerate is also adjusted. Without ARS-VR, the default resolution of 1920x1920px is rendered by A-Frame, with the FPS being affected by performance issues. With ARS-VR, the resolution is adjusted so the FPS is improved. As seen in Table V, the resolutions, are on average 806x453px, 801x450px and 667x375px for the scenarios with 4, 6 and 8 users, respectively.
### B. Frame Latency Analysis
For the analysis of frame latency, a WebVR API method [28] was used to provide a Document Object Model (DOM) timestamp. This method calls another method [29] to tell the browser that animation will be performed. The first method is then called once again to calculate the timestamp difference between the two values (once before the animation and once after) which gives the requested animation frame latency (RAF) also updated in real-time in the application window. This value is printed to the console output against a generated frame serial number starting from 1 for every user.
The same procedure for server and tunnel initiation was repeated and browser windows were opened on the client laptop. The console output was averaged with the number of users or windows and resulting values were plotted against the frame number. The results are shown in Figs. 9, 10 and 11.
The plots indicate that the frame latency peaks up-to 800 and 700 milliseconds respectively in the case of 4 and 6 users. The average frame latency when the application runs without the algorithm was observed to be between 90-100 milliseconds whereas when it runs with the algorithm, it was observed to be between 70-80 milliseconds. However, when the users were increased to 8, there is another peak of the latency reaching as high as 1500 milliseconds which is due to the larger processing power needed at this point.
Thus, by performing these experiments, it was possible to analyze the performance of the application under various scenarios by observing the variation of frame rate and frame latency on a laptop and a smartphone having a wide screen and a short width aspect ratio respectively. ARS-VR shows good improvement in the frame latency on both the devices. On the smartphone, the frame rate peaks up-to 60fps, a good improvement given the graphics configuration of the device.
### Table V
<table>
<thead>
<tr>
<th>No. users</th>
<th>Avg. fps</th>
<th>Avg. fps-ARS</th>
<th>Avg. resolution</th>
<th>FPS loss reduction</th>
</tr>
</thead>
<tbody>
<tr>
<td>4</td>
<td>36.65</td>
<td>50.94</td>
<td>806x453px</td>
<td>23%</td>
</tr>
<tr>
<td>6</td>
<td>29.69</td>
<td>47.33</td>
<td>801x450px</td>
<td>30%</td>
</tr>
<tr>
<td>8</td>
<td>27.94</td>
<td>45.23</td>
<td>667x375px</td>
<td>28%</td>
</tr>
</tbody>
</table>
### Table VI
<table>
<thead>
<tr>
<th>No. of users</th>
<th>STDEV</th>
<th>STDEV-ARS</th>
</tr>
</thead>
<tbody>
<tr>
<td>4</td>
<td>8.7078</td>
<td>8.7078</td>
</tr>
<tr>
<td>6</td>
<td>7.6326</td>
<td>8.7078</td>
</tr>
<tr>
<td>8</td>
<td>8.7078</td>
<td>8.7078</td>
</tr>
</tbody>
</table>
Fig. 6. Resolution Variation for 4 users
Fig. 7. Resolution Variation for 6 users
Fig. 8. Resolution Variation for 8 users
V. CONCLUSIONS AND FUTURE RESEARCH DIRECTIONS
This work presented an A-Frame browser-based multi-user VR application rendered on remote devices with limited processing and display features. The ARS-VR algorithm was also introduced, aimed at improving VR performance in terms of frame rate and frame latency on such devices, with the dynamic adaptation of the visuals resolution. ARS-VR significantly reduces the fps loss in the scenarios of 4, 6, and 8 simultaneous users by 23%, 30%, and 28%, respectively.
Future work will improve the algorithm to support devices with different screen height and width ratios. Other user applications, such as video conferencing in A-Frame and other device types will also be studied.
ACKNOWLEDGEMENTS
This work was supported by the European Union’s Horizon 2020 Research and Innovation programme under Grant Agreement no. 870610 for the TRACTION project. The support of the Science Foundation Ireland (SFI) Research Centres Programme via grants SFI/12/RC/2289_P2 (Insight) and SFI/16/SP/3804 (ENABLE), co-funded by the European Regional Development Fund, is also gratefully acknowledged.
REFERENCES
[22] [Online]. Available: https://www.npmjs.com/
[26] [Online]. Available: https://webrtc.org/
|
{"Source-Url": "http://doras.dcu.ie/26055/1/An_Adaptive_Resolution_Scheme_BMSB%20%283%29.pdf", "len_cl100k_base": 5362, "olmocr-version": "0.1.53", "pdf-total-pages": 6, "total-fallback-pages": 0, "total-input-tokens": 18772, "total-output-tokens": 6742, "length": "2e12", "weborganizer": {"__label__adult": 0.0006551742553710938, "__label__art_design": 0.0012903213500976562, "__label__crime_law": 0.0005350112915039062, "__label__education_jobs": 0.0005011558532714844, "__label__entertainment": 0.0004200935363769531, "__label__fashion_beauty": 0.0002689361572265625, "__label__finance_business": 0.0002536773681640625, "__label__food_dining": 0.0005497932434082031, "__label__games": 0.0033664703369140625, "__label__hardware": 0.0091552734375, "__label__health": 0.001026153564453125, "__label__history": 0.0004930496215820312, "__label__home_hobbies": 0.00013005733489990234, "__label__industrial": 0.0006051063537597656, "__label__literature": 0.00031375885009765625, "__label__politics": 0.0002541542053222656, "__label__religion": 0.0006532669067382812, "__label__science_tech": 0.2178955078125, "__label__social_life": 0.00010150671005249023, "__label__software": 0.031341552734375, "__label__software_dev": 0.728515625, "__label__sports_fitness": 0.0005536079406738281, "__label__transportation": 0.0006794929504394531, "__label__travel": 0.0004377365112304687}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 26381, 0.03576]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 26381, 0.15486]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 26381, 0.88267]], "google_gemma-3-12b-it_contains_pii": [[0, 4155, false], [4155, 10179, null], [10179, 14096, null], [14096, 17431, null], [17431, 21269, null], [21269, 26381, null]], "google_gemma-3-12b-it_is_public_document": [[0, 4155, true], [4155, 10179, null], [10179, 14096, null], [14096, 17431, null], [17431, 21269, null], [21269, 26381, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 26381, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 26381, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 26381, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 26381, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 26381, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 26381, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 26381, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 26381, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 26381, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 26381, null]], "pdf_page_numbers": [[0, 4155, 1], [4155, 10179, 2], [10179, 14096, 3], [14096, 17431, 4], [17431, 21269, 5], [21269, 26381, 6]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 26381, 0.27778]]}
|
olmocr_science_pdfs
|
2024-12-09
|
2024-12-09
|
d442a99c8c886e0ea633020aa98bb170f0b33535
|
Improving the Performance of a Large Scale Spreadsheet
Swidan, Alaaeddin; Hermans, Felienne; Koesoemawidjojo, Ruben
Publication date
2016
Citation (APA)
Important note
To cite this publication, please use the final published version (if applicable).
Please check the document version above.
Copyright
Other than for strictly personal use, it is not permitted to download, forward or distribute the text or part of it, without the consent of the author(s) and/or copyright holder(s), unless the work is under an open content license such as Creative Commons.
Takedown policy
Please contact us and provide details if you believe this document breaches copyrights.
We will remove access to the work immediately and investigate your claim.
Improving the Performance of a Large Scale Spreadsheet: A Case Study
Alaaeddin Swidan, Felienne Hermans and Ruben Koesoemowidjojo
Report TUD-SERG-2016-003
Abstract—Spreadsheets are used extensively for calculations in several domains, especially in finance and insurance. Spreadsheets offer a clear benefit to their users: they are an easy to learn application in which to express their business needs, however, there are downsides too. Like software, spreadsheets can have a long life span in which they are used by several people. This leads to maintainability issues, including errors, but also often to issues with performance. In this paper we present a case study in which a model for shortfall calculations, originally implemented in a spreadsheet, was adapted to run on an HPC cluster. We present the design, analysis and implementation of the solution which clearly improved the performance of the spreadsheet, with a factor of 50 in some cases. We subsequently reflect on challenges related to reverse engineering, testing and scalability. Finally, we identify opportunities that would provide automatic support to refactoring, dependency recognition and performance profiling in future spreadsheet optimization projects.
I. INTRODUCTION
Research shows the prevalent use of spreadsheets in various business domains in general, and financial services in particular [1], [2], [3]. Spreadsheet usage ranges from trivial data manipulation to complex modeling and simulation [3]. A spreadsheet model in principle is easy to create: domain experts convey their ideas into the intuitive UI, allowing for immediate results to show, and thus providing the ability to react with a business decision such as buying or selling certain stock. Within organizations, spreadsheets are used for long periods of time [2], which could lead to a spreadsheet model growing in size and complexity. Increased size and complexity could affect the performance of the spreadsheet, hampering immediate output and thus inhibiting one of the strongest features of spreadsheets [2].
To investigate the issues around spreadsheet performance in practice, we present a case study of one large-scale spreadsheet model which suffered from performance problems. The spreadsheet was developed at a major insurance company in the Netherlands. It was used to support risk analysts in comparing pension investments and obligations. The spreadsheet suffered from severe performance issues, as the execution regularly exceeded 10 hours. This situation was inconvenient to the business operations, as the time-consuming runs of the spreadsheet caused additional difficulties in its maintenance and usability for the analysts. To address these problems, a parallel-based solution was applied to the spreadsheet, based on a Microsoft HPC cluster. In this paper, we highlight the steps followed to improve the performance of the spreadsheet.
The contributions of this paper are: (i) providing an industrial investigation into addressing performance issues related to simulation models in spreadsheets, (ii) identifying the challenges that we faced throughout the project, and how they were overcome. Finally, (iii) we introduce possible enhancements, which we foresee could mitigate the risks in similar projects.
II. BACKGROUND AND MOTIVATION
Simulation models in general can be either deterministic or stochastic. In deterministic models, input values are set before the run, and calculations are built to produce an output accordingly. Running a deterministic model for many times will produce the same result in each run. Opposite to that is the stochastic modeling, where the knowledge of the inputs is neither complete nor certain. In a stochastic model, some of the inputs are chosen randomly, and usually independently, from within a range of distributed values. This is a common modeling approach used in the financial service-providers, banks and insurance companies that highly depend on live information of stocks. In each run of the model, a different set of inputs is used, leading to unique and discrete results. One of the most popular stochastic modeling techniques for numerical analysis is the Monte Carlo simulation [4]. As illustrated in Figure 1, Monte Carlo simulations aim to evaluate a specific calculation, a function, depending on a group of input parameters that are discrete, independent and randomly evaluated from a range of possible values. In Monte Carlo, the main calculation function is executed for a predefined number of iterations $n$. Each iteration’s result is recorded, and participates in presenting the final outcome to the user in the shape of graphs, aggregations and probability analysis.

A. Motivation
Monte Carlo simulations by nature suffer from performance issues. This is usually the case since analysts and domain experts prefer to run their simulations for as many iterations as possible. By this, they aim to produce more precise and reliable results. However, this leads to a high utilization of computing resources, and thus a growth in the runtime of the model relative to the number of iterations. The overall health of the model is also affected, because its maintenance becomes an issue. In our case for instance, modifying the model meant that a simple debugging, of any change, would take tens of hours to finalize.
III. Context
The company at which the spreadsheet was developed, is one of the largest financial service providers in the Netherlands, with millions of customers and thousands of employees. In the next subsections we provide information about the use case and aspects of the spreadsheet model. From now on, the company will be referred to as the insurance company.
A. Shortfall Analysis
The investigated spreadsheet model is called the shortfall risk calculator (SFC), and contains an application of a Monte Carlo simulation. A shortfall analysis aims to numerically predict the deficit of the pension liabilities of a company, compared to their stock market capitalization [5]. This is implemented through a stochastic evaluation of the expected returns of the company’s investments in equity markets for example, while simultaneously comparing it to the probabilities of the pension obligations at a certain point in the future. An SFC model usually involves a high level of uncertainty and deals with continuously changing data, such as the interest rate, stock compounded market rate, and mortality intensity of a person in a certain age [5].
In our case, the SFC model was implemented using Excel, and used to run it on the common enterprise PCs. The problem is that the model usually took many hours to complete, sometimes days. Worse case, the model would crash unexpectedly and the analysts had to run it again. The performance of the model caused a major problem to the risk analysis department by delaying the decision making process. Moreover, this made it difficult to maintain the spreadsheet model. For example to add a new functionality, debug or test any modification, meant that a new run will start, which then will take another tens of hours to complete.
B. Features of the Model
In this section we present the metrics of the original spreadsheet model and the contained VBA code. For that, we used our research spreadsheet analyzer [6], and a leading software tool for VBA code quality [7]. These metrics are shown here to illustrate the model features, but were not used by the developers in the case.
The SFC model in our case, features one core spreadsheet which is the shortfall calculator. The core spreadsheet depends on three external spreadsheets for providing input data and configurations. It produces data into three other spreadsheets. The core spreadsheet contains 12 worksheets, and a total of 3,329 nonempty cells. Within these cells, 329 contain formulas of which 72 are unique. The formulas used have low level of complexity, which is indicated by the number of cells (16) containing functions such as VLOOKUP, OFFSET, and IF.
The VBA project in the core spreadsheet has 37 source files with more than 7,000 LoC. The code contains 23 modules, 146 methods, and 58 user-defined types. We generated the standard complexity metrics for methods and types, finding the maximum Cyclometric Complexity (CC) of 386 paths for the main() method. Another 16 methods are labeled as too complex by the software tool we used, since they have CC value above 20 paths.
IV. The Case Study
As an HPC solution provider, our industry partner Bit-Brains [8] was approached by the insurance company to improve the spreadsheet’s performance. In collaboration with GridDynamics [9], the solution we provided is based on a framework called the HPC for Excel Acceleration Toolkit (HEAT). HEAT, developed by GridDynamics, is built on top of a standard Microsoft HPC cluster [10], and allows for the spreadsheet calculations to be offloaded into the HPC nodes (Figure 2). The project was carried out in three phases that included: setting up the design based on parallelism (Section IV.A), followed by analyzing the spreadsheet model to decompose its components (Section IV.B), and implementing needed changes to the original model (Section IV.C), leading to clear improvements in the model performance as presented in the evaluation (Section IV.D).
A. Design
In determining the design, the aim was to handle two major requirements: (i) the parallelization of the model, and (ii) the scalability of the provided solution. The parallelization of the model was achieved through a map-reduce derived algorithm. However, a limitation in Excel prevented user-defined types from being communicated between HPC nodes. In VBA, a user-defined type is a data structure that is defined by the keyword Type, and contains a combination of built-in types. Since the model contained more than 50 user-define types (Table I), the solution was to serialize them into built-in types before sending to the cluster nodes, and to deserialize them back to the original types on receiving.
The second requirement considered in the design was the
scalability. The insurance company’s aim was to evaluate as large as 30K scenarios in the future, and this would bring up two issues: a high scenario utilization, and an increased time in splitting the input data. Consequently, the original model was redesigned, and that included some code refactoring, such as minimizing the creation of temporary arrays inside the loops.
B. Analysis
In the analysis phase, the spreadsheet model was analyzed to determine what methods to parallelize and how. The analysis consisted of three operations:
a) Performance profiling: The profiling was done by instrumentation, where a time-logging library was called on each VBA method’s entrance and exit. Three methods were the most time-consuming, one of them was the main() method.
b) Complexity evaluation: Through standard tools, the complexity and size of the VBA project were measured. The main() method was the largest and most complex.
c) Dependency analysis: This was done by studying the input and output data flows of the methods, with the aim of avoiding parallelizing a method with high level of data coupling. The original VBA code was written in a way that introduces a considerable amount of data coupling between the methods, where the main() method exhibited the most dependency on other methods.
As a direct outcome of the analysis, various loops in a number of VBA methods were candidates for parallelization. Of which, the main() method was the most feasible since it contained the most time-consuming code. Important to note here, the analysis process was difficult, since the software engineers lacked the needed domain knowledge of the model. As such, information were regularly required from the model owners at the insurance company (discussed further in the Challenges, section VI.A).
C. Implementation
The implementation comprised rewriting parts of the VBA code, and adding other parts (i) to apply parallelization and (ii) to deliver a scalable solution.
The parallelization targeted various loops in the main method, and the focus was on splitting the arrays used in these loops’ iterations. The mapping for an array was done by dividing the total number of scenarios by the number of cluster cores, consequently creating split copies of that arrays. On the other hand, the reduce process was performed based on each function’s requirements: some arrays were averaged or summed, others were concatenated. To ensure successful parallelization, dependencies between the methods were minimized. In this manner we refactored, when applicable, code parts that include passing parameters by reference, or modifying the passed parameters inside a function’s body.
Because of the parallel approach, serialization and deserialization code was developed to allow the communication of each user-defined type in the model. This is due to a limitation in Excel, which forbade the proper transfer of user-defined types between the cluster nodes (described in section IV.A).
Finally, to ensure scalability both in terms of the number of scenarios and the number of cores, re-design of the model in some loops was implemented. For instance the creation of temporary arrays inside the loops was not allowed. In addition, the array splitting and copying were moved to the cluster instead of the client for some loops, and some data structures were made smaller through using data types with smaller sizes.
D. Evaluation
As a result of the parallelization approach and the modifications to the model, the run times showed clear improvements. In this section we present (i) the performance figures of the various runs of the model, (ii) the verification of the model’s health throughout the migration process.
a) Performance Results: There were two factors that directly affected the performance: the number of scenarios in the model and the number of cores utilized. First, Figure 3 shows the effect of increasing the scenarios on the model’s performance, while the number of cores was fixed: a single core for the sequential original model, versus a 24-core cluster for the parallel modified model. When the original model was considered, the runtime increased exponentially as we increased the number of scenarios. In the meanwhile, the modified model runtime increased as well, but in an almost linear manner. In Figure 3-b, we see that the modified model in parallel performed 39 and 52 times faster than the original model, for 480 and 960 scenarios respectively. To run 960 scenarios for instance, the original model required 729 minutes (more than 12 hours), while the modified model completed the run in 14 minutes on the 24-core cluster. Figure 4 illustrates the effect of increasing the number of cores on performance, while the number of scenarios is fixed. For 1008 scenarios, the original model needed more than 15 hours to complete. For the parallel runs, started by 8-cores and increased gradually up to 48 cores, the runtime goes down almost linearly, from 105 minutes to 33 minutes respectively.
b) Model Accuracy: The accuracy of the obtained results was verified throughout the migration of the model. The verifications were carried out by the insurance company’s team, who manually compared the outcomes of the calculations between the original and the modified models.
In one case for example, the results were slightly different, and an investigation showed that a conditional statement was not migrated correctly. However, the outcome of the modified model was more accurate than before, due to running more simulations, which is expected in a Monte Carlo simulation.
c) Migration Cost: According to the project plan sheet, the migration was finalized in 431 working hours. The recorded work included development of the new model and changes to the HEAT, testing and verification, bug fixing, and writing documentation. 93 hours of the recorded hours were related to providing support for the insurance company’s employees, helping them through the running of the model.
E. Maintainability of the Modified Model
The insurance company wanted to ensure business continuity. They required that the modified model is easily changed and maintained by their end-users, without continuously referring to the engineers in BitBrains. To achieve this, the HEAT provides an option for the end-users to run the model sequentially on a local machine. This is important to test the introduced changes, before the model is run on the cluster. Furthermore, the engineering team performed several hand-over sessions, and provided thorough documentation materials, that detailed how to modify the core parallel part of the code.
V. RELATED WORK
Related to our study is the work of Pichitlamken et al. [11], where they provided a prototype that is similar to the one we presented. The prototype, presented as an Excel add-in, offloads the calculations of a spreadsheet model to a computer grid. However, the two solutions still differ. The solution in [11] built its own resource management and scheduling unit, based on FCFS algorithm. In our solution, HEAT exploits the well-established Microsoft HPC services for these functionalities. Additionally, the solution they provided as a prototype, was not validated on a large-scale spreadsheet, or in an industrial setup. In another related work, Abramson et al. in [12] presented ActiveSheets, a solution designed to evaluate the parallel user-defined functions of a spreadsheet in the background. ActiveSheets is different to our solution by targeting independent user-defined functions, and the lack of an industrial application. Another related approach is ExcelGrid [13], in which a middleware tool was designed and built to connect an Excel spreadsheet with either a private or a public cluster. Even though ExcelGrid applies a parallel solution to distribute work on a cluster, it does not target spreadsheet models built completely inside Excel, as it uses the spreadsheet as a means for providing input data to another software. To the best of our knowledge, our paper presents the first industrial and large-scale case, involving the parallelization of a spreadsheet model.
VI. LESSONS LEARNED
In the above, we described the steps used by BitBrains and GridDynamics, to improve the performance of a spreadsheet-based model. This was done by creating a design based on a software framework, that allows Excel spreadsheets to run in parallel on an HPC cluster. Subsequently, the model was analyzed by the software developers to identify candidate methods for parallelization. Following that, the solution was implemented by modifying parts of the the methods, and adding other code parts to ensure a successful integration between the spreadsheet and the HPC cluster. In this section, we reflect on the project, identifying challenges that arose along the way to the final implementation. Subsequently, we introduce possible opportunities that can be addressed in future work, to minimize the efforts in similar spreadsheets projects.
A. Challenges
Throughout the phases of the solution, a number of issues proved to be challenging. We foresee that these challenges will also be faced in future projects that optimize other spreadsheet models. Therefore, the followings are our insights into some of the challenging issues.
a) Reverse Engineering and Restructuring: The analysis of the spreadsheet model was a difficult process. Four weeks were needed to reverse engineer the data flows and the algorithm of the original spreadsheet model. The difficulty originated from the fact that the developers lacked financial domain knowledge, which required holding several meetings with the model owners. These meetings hampered a speedy development process. On the other hand, the implementation phase involved applying several refactorings to the VBA code, as well as rewriting and adding some components to the HEAT framework, for the sake of fitting all the parts together. These recursive and continuous processes of reverse engineering, restructuring and integration development were vital to prepare the spreadsheet model for the parallel execution, without any unwanted result. These preparations however were done
manually, neither planned nor systematic, which was time consuming.
b) Preserving the Model’s Functionality: The transformation process is risky; each modification applied to the original model compromises the accuracy of the output results, thus forcing continuous validations throughout the process. These validations, in our case, were performed manually and remotely by the insurance company’s team. With the lack of domain knowledge added, it was difficult for the developers in some cases to track the root causes of the variances, causing some delays to the implementation process.
c) Scale of Improvement: When to consider the performance improvement enough in a similar project? This question was not answered in our case. The computational power was increased gradually to see the reflection on performance. However, we believe that a turnover point exists, at which the model’s run may take longer time. This would happen since the increase of the computation nodes means the increase of the number of intermediate results to be reduced. Depending on the size of the data structures used, the intermediate data may grow rapidly to utilize more memory, increasing the processing time. Therefore, the computing resources that would achieve the optimal performance is not previously defined, and is challenging to measure.
B. Opportunities
In this section we present areas for researchers to investigate in future. The aim is to provide tools and solutions to issues that could hinder the implementation of similar spreadsheets projects. We identify the following opportunities, categorized per phase of the solution:
1) Design: The solution was primarily based on parallelization of the spreadsheet model, by offloading the core computational parts to the underlying cluster. An improvement to the design is possible by accompanying the core parallel solution with a concurrent approach. For example, we envision a new design that includes a step related to detect and refactor spreadsheet smells that may cause performance issues, such as long calculation chains [14].
2) Analysis: In analyzing a spreadsheet model, software engineers could benefit from having tools in the following areas:
a) Dependency Recognition: To analyze the dependency between the VBA methods, the developers carried manual checks to the data flows and algorithms of the model. A systematic approach, through a tool for example, is needed to identify dependencies inside a spreadsheet model. This would allow the developers and spreadsheet users to decide possible parallel sections in their spreadsheet easily, and more quickly.
b) Performance Profiling and Hot-spot Analysis: In the same manner to the dependency checks, profiling of the VBA methods was done manually by writing code to log the run times, and upon that deciding the major functions. A spreadsheet model consists of different parts (both formulas and VBA code), that can consume time and resources. The manual process is error-prone and time consuming, thus a tool that detects code runtime, and links it directly to the associated formula or VBA method, would produce more assured results.
3) Implementation: The development cycles in the solution involve repetitive work that has room for improvement, in the form of automation or semi-automation of some processes. The developers identified a predefined set of code behaviors that lead to heavy dependencies between functions, such as the passing parameters by reference, and the modification of parameters inside the function body. A tool can be developed to detect and refactor the code to eventually remove, or reduce, the dependencies.
Finally, the solution presented is fully customized towards a specific spreadsheet model. This suggests that for each new spreadsheet model (new in terms of the simulation type, or the used data structures and algorithms) the same procedure shall be followed again. An opportunity to improve would be widening the targeted models, by specializing in a specific category of financial simulations, such as Monte Carlo. The solution would automatically analyze any model that fits the simulation criteria, based on a predefined set of rules and steps, reducing the amount of repetitive work in future projects.
REFERENCES
|
{"Source-Url": "https://pure.tudelft.nl/portal/files/13969659/13969502_TUD_SERG_2016_003.pdf", "len_cl100k_base": 4861, "olmocr-version": "0.1.53", "pdf-total-pages": 11, "total-fallback-pages": 0, "total-input-tokens": 23430, "total-output-tokens": 6270, "length": "2e12", "weborganizer": {"__label__adult": 0.0002791881561279297, "__label__art_design": 0.00025200843811035156, "__label__crime_law": 0.0003027915954589844, "__label__education_jobs": 0.0007443428039550781, "__label__entertainment": 5.143880844116211e-05, "__label__fashion_beauty": 0.0001316070556640625, "__label__finance_business": 0.0009679794311523438, "__label__food_dining": 0.0003542900085449219, "__label__games": 0.0003647804260253906, "__label__hardware": 0.0007314682006835938, "__label__health": 0.00044608116149902344, "__label__history": 0.0002124309539794922, "__label__home_hobbies": 7.462501525878906e-05, "__label__industrial": 0.0004963874816894531, "__label__literature": 0.00017178058624267578, "__label__politics": 0.0002384185791015625, "__label__religion": 0.00026702880859375, "__label__science_tech": 0.031890869140625, "__label__social_life": 8.034706115722656e-05, "__label__software": 0.01076507568359375, "__label__software_dev": 0.9501953125, "__label__sports_fitness": 0.00023186206817626953, "__label__transportation": 0.0004489421844482422, "__label__travel": 0.00017559528350830078}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 28092, 0.02519]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 28092, 0.41122]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 28092, 0.9388]], "google_gemma-3-12b-it_contains_pii": [[0, 961, false], [961, 1118, null], [1118, 1118, null], [1118, 5721, null], [5721, 11110, null], [11110, 16409, null], [16409, 21306, null], [21306, 28092, null], [28092, 28092, null], [28092, 28092, null], [28092, 28092, null]], "google_gemma-3-12b-it_is_public_document": [[0, 961, true], [961, 1118, null], [1118, 1118, null], [1118, 5721, null], [5721, 11110, null], [11110, 16409, null], [16409, 21306, null], [21306, 28092, null], [28092, 28092, null], [28092, 28092, null], [28092, 28092, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 28092, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 28092, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 28092, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 28092, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 28092, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 28092, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 28092, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 28092, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 28092, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 28092, null]], "pdf_page_numbers": [[0, 961, 1], [961, 1118, 2], [1118, 1118, 3], [1118, 5721, 4], [5721, 11110, 5], [11110, 16409, 6], [16409, 21306, 7], [21306, 28092, 8], [28092, 28092, 9], [28092, 28092, 10], [28092, 28092, 11]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 28092, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-06
|
2024-12-06
|
22a59f9de9cdb897c4fb8ca0c32efa79dcfbf9cb
|
1 Introduction
In the previous labs, we tested and debugged our digital designs by bread-boarding the actual circuits using ICs. For small designs, this method proved to be quite effective, and in the late 1960’s and early 1970’s, this was standard practice. However, as the gate counts of our circuits increased, this method became far less attractive. Thankfully, with advances in computer technology, there are alternatives to bread-boarding circuits. In this day and age, we can effectively simulate the operation of our digital circuits during the design process without being burdened with the tedium you all have experienced up to this point. In lab this week, we will demonstrate the concept of digital circuit simulation and, in doing so, introduce Verilog® HDL, an Institute of Electrical and Electronics Engineers (IEEE) standard Hardware Description Language (HDL).
2 Background
The following subsections will provide you with some of the background necessary to understand and appreciate the way modern digital design is carried out. For a more in-depth treatment, please consult the course text book.
2.1 Verilog HDL
Programming languages have proven to be effective for software development. Interestingly, a similar truth holds for hardware development. Just as programming languages boost developer productivity, Hardware Description Languages (HDLs) do so through various levels of abstraction, while providing a means to succinctly describe digital circuits. What differentiates a traditional programming language from a standard HDL is the manner in which operations described within the language are handled. In a traditional programming language such as C, operations happen sequentially, and conditional statements facilitate changes in program flow. In contrast, the operations described in an HDL happen concurrently, and signals (often called nets) allow concurrent operations to interact with one another.
In the 1980’s, two competing HDLs were developed, namely VHDL and Verilog. Today, both languages co-exist, encouraging tool vendors to support VHDL and Verilog simultaneously within a single design. For our work in this lab, we will concentrate on Verilog; however, it is important to note that many of the HDL principals demonstrated here apply to VHDL as well. Verilog offers various levels of abstraction for describing digital circuits with structural at the bottom and behavioral at the top. Any given design could have a mixture of these abstraction levels, but in this lab assignment, we will start at the lowest level and move up. The example shown below uses structural Verilog and the gate-level primitives built into Verilog to describe the 1-bit wide, 2:1 multiplexer you designed in the previous lab. The corresponding gate-level
schematic in Figure 1 labels the module ports, internal wires, and gate instance names according to the provided Verilog code.

Figure 1: Gate-level Schematic of a 1-bit wide, 2:1 MUX
```verilog
1 'timescale 1ns / 1ps
2 'default_nettype none
3 /* This module describes a 1-bit wide multiplexer using structural constructs */
4 * and gate-level primitives built into Verilog. */
5
6 module two_one_mux(Y, A, B, S); // define the module name and its interface
7
8 /* declare output and input ports */
9 output wire Y; // declare output of type wire
10 input wire A, B, S; // declare inputs of type wire
11
12 /* declare internal nets */
13 wire notS; // inverse of S
14 wire andA; // output of and0 gate
15 wire andB; // output of and1 gate
16
17 /* instantiate gate-level modules */
18 not not0(notS, S);
19 and and0(andA, notS, A);
20 and and1(andB, S, B);
21 or or0(Y, andA, andB);
22
23 endmodule // designate end of module
```
Syntactically, Verilog is very similar to the C programming language. Comments are designated in a similar fashion (i.e. `/* */` for comments which span multiple lines or `//` for single line comments), and semicolons end declarations, assignments, and statements. Verilog is case-sensitive and all keywords are lowercase. The keyword, `module`, marks the beginning of the Verilog module, while the keyword,
endmodule, marks the end. In the example above, the module name is two_one_mux, and its ports are Y, A, B, and S. The port order is not enforced by the language but follows a common convention in which the output ports are first, followed by the input ports. The keyword, output, is used to declare a net as an output port, while input declares a net as an input port. Nets can be of type wire or reg. For now, we will only be concerned with wires. Nets can take on one of four values, namely ‘1’, ‘0’, ‘Z’, and ‘X’ for high, low, floating, and undefined, respectively. Modules, whether built-in or user-defined, are instantiated as seen in lines 14 through 19 of the code above. The module name is followed by the instance name. The instance name must obviously be unique; however, multiple instances of the same module may exist. Notice the order of ports for the built-in primitives (i.e. not, and, or) follows the convention discussed above such that the output port is first, followed by the input ports. Since these operations are associative, the order of the inputs is not important.
2.2 Xilinx ISE
Xilinx® Integrated Software Environment (ISE™) version 13.4 is the hardware development tool that we will be using in this laboratory. Xilinx manufacturers a wide variety of reprogrammable logic devices (we will discuss these further in the next lab) and supplies ISE as a means to develop for these devices. Consequently, ISE is an excellent teaching tool for modern digital design. It supports digital circuit simulation, which is the focus of this week’s lab assignment, in addition to all of the implementation processes necessary to load a design into an Xilinx part. It comes with an easy-to-use Graphical User Interface (GUI) and waveform viewer and supports both VHDL and Verilog. Xilinx ISE is part of a larger class of computer-aided design (CAD) tools used to develop digital circuits. For additional information on Xilinx and ISE 13.4, consult the manufacturer’s website at: www.xilinx.com
2.3 Linux OS
Linux is an open-source Unix-like operating system (OS) commonly used in industry. The open-source license allows it to be used free of charge, which makes it a big win for the university setting. The Unix aspect allows Linux to be compatible with many of the CAD tools out on the market today. The Linux kernel along with the various support packages makeup the specific Linux distribution. The machines in the ECEN248 lab (Zach 115C) have a variant of Red Hat Linux called CentOS installed on them because many of the tool vendors will provide support for only Red Hat Linux.
The CentOS Linux installation has a window manager, which gives you the look and feel similar to that of MS Windows or MacOS. However, the Linux terminal is available for those acquainted with Unix. As a result, you will be provided with commands to execute in the terminal throughout the lab session. Please try to understand what these commands do so that you can execute them in future labs without instruction. The format of the commands provided is shown below. The command to be executed follows the > symbol.
>command argument0 argument1
Note: Please ensure that you have a Unix account with the ECE department before arriving to your lab session. It is imperative that you are able to log into the CentOS machines in Zach 115C.
3 Pre-lab
We will reuse the designs created in Lab 3 and Lab 4 for this week’s lab so no pre-lab submission is required. However, you will be expected to have the appropriate material ready for lab so please read over the entire lab manual before coming to your lab session.
4 Lab Procedure
The lab experiments below will guide you through the development of a simple 4-bit ALU in Verilog using the ISE software suite. Each module that you create will be individually tested using the built-in digital circuit simulator, ISim, with test bench files that we provide to you.
4.1 Experiment 1
The objective of this lab experiment is to familiarize you with the ISE development environment. Please take note of what it is you are doing as you will be expected to perform similar exercises on your own in future experiments.
1. Launch ISE Project Navigator and create a new design project.
(a) Open a terminal window in the CentOS workstation by selecting Applications → Accessories → Terminal and type the following command and hit “Enter” to create a work directory:
```shell
>mkdir $HOME/ecen248
```
(b) Now execute the following command to run ISE:
```shell
>/softwares/setup/xilinx/ise-13.4
```
(c) Once ISE loads, select File → New Project
The New Project Wizard will open as illustrated below. Type a Project Name (ex. lab6) and a Project Location (ex. /ecen248/lab1 in your home directory). Then chose HDL as the Top-Level Source Type and click “Next.”
(d) Next, the ‘Project Settings’ window appears (see screenshot below).
Set the following project settings:
- Evaluation Development Board: Spartan-3E Starter Board
- Simulator: ISim (VHDL/Verilog)
- Preferred Language: Verilog
(e) Hit “Next” to continue. A Project Summary window will appear. Examine the summary and click “Finish” when done.
2. Create a Verilog source file which describes the 2:1 MUX in Figure 1.
(a) From within ISE, select File → New to create a new file.
(b) A dialog box will appear as seen above. Select “Text File” and press “OK.”
(c) Type the Verilog code example found the in the Background section of this manual into the ISE text editor window.
Note: Do NOT copy and paste text from the PDF into the editor window. Symbols within the code do not always copy properly and will cause syntax errors when you attempt to build the project.
(d) Select File → Save and save the file you just created as "two_one_mux.v" within your lab6 directory.
3. Add the 2:1 MUX source file and test bench to the ISE project.
(a) Right-click on the Xilinx part number (xc3s500e-4fg320) within the Hierarchy window and select “Add Source...” as shown in below.
(b) In the file browser, navigate to the source file you just created and hit “Open.”
(c) A window will appear with Association and Library fields. Leave these settings as default and press “OK” to continue.
(d) Ensure the source file you just added appears under the Xilinx part number in the Hierarchy window.
(e) Open a new terminal window and copy the appropriate test bench file from the ECEN248 directory into your lab6 directory with the following commands:
```
> cd $HOME/ecen248/lab6
> cp /homes/faculty/shared/ECEN248/two_one_mux_tb.v .
```
The first command changes the current directory to your lab6 directory, while the second command copies the 2:1 MUX test bench into the current directory. You could also perform this operation in a single command by replacing the ‘.’ at the end of the copy command with the path to your lab6 directory.
(f) Add the “two_one_mux_tb.v” file to your ISE project, leaving the source file properties as default again.
(g) Change the “View” setting within the Hierarchy window to “Simulation” and ensure the hierarchy appears as seen in below.
(h) Open the 2:1 MUX test bench file and take a moment to examine the contents. The test bench utilizes advanced concepts in Verilog that we have not discussed yet, but some things should look familiar. A test bench file is nothing more than a Verilog module which instantiates the Unit Under Test (UUT) and stimulates the inputs for testing. Notice that the test bench module does not have any ports of its own. The input and output ports of the UUT are what are important, and when we simulate the test bench file, we will examine those signals.
4. Simulate the 2:1 MUX test bench.
(a) Click on the ‘+’ symbol to the left of “ISim Simulator” in the Process window.
(b) Select the 2:1 MUX test bench file in the hierarchy window and then double click “Simulate Behavioral Model” from within the Process window.
(c) If there are any errors or warnings, they will show up in the Console window. Correct any errors and warnings at this time. You may re-run the simulation process once you have fixed your source code.
(d) The ISim window shown below will open once your design successfully compiles. Take note of the waveform window in the top-right corner and the Console window at the bottom. Notice that the test bench exercises the multiplexer through all of the possible input combinations. Ensure that your design passes all of these tests. Please include a screenshot of the waveform in your lab write-up along with the console output of the test bench.
5 Experiment 2
The purpose of this experiment is to design the modules necessary to build our simple 4-bit ALU, while introducing a level of abstraction available in Verilog. Each component will be tested using ISim with the provided test benches. You may need to look back at Experiment 1 if you forgot how to perform a procedure listed below in ISE.
1. Figure 2 illustrates how to connect four 1-bit, 2:1 multiplexers together to create a single 4-bit, 2:1 multiplexer. This diagram should reflect the circuit you bread-boarded in the previous lab.
(a) Using the aforementioned diagram and the code below as a starting point, describe a 4-bit, 2:1 multiplexer, which uses the module you created in Experiment 1.
Laboratory Exercise #6
Figure 2: 4-bit wide, 2:1 MUX
```verbatim
module four_bit_mux (Y, A, B, S);
// declare output and input ports
// output is a 4-bit wide wire
input wire [3:0] A, B; // A and B are 4-bit wide wires
input wire S; // select is still 1 bit wide
endmodule
```
(b) Add the file you just created to your current ISE project.
(c) Copy the appropriate test bench file, “four_bit_mux_tb.v”, into your lab6 directory. As a refresher, the commands to do so may be found below.
```bash
>cd $HOME/ecen248/lab6
>cp /homes/faculty/shared/ECEN248/four_bit_mux_tb.v .
```
Note: If you use the same terminal that you used to do the last copy, you do not need to execute the first command!
(d) Add the test bench that you just copied over to your ISE project and simulate the logic behavior as you did in the previous experiment. Please include a screenshot of the waveform in your lab write-up along with the console output of the test bench.
2. In the previous steps, we used structural Verilog to describe a 1-bit, 2:1 MUX. Then we used structural Verilog again to create a 4-bit, 2:1 MUX from our 1-bit MUX module. For the addition/subtraction unit, we will start with a slightly higher level of abstraction available in Verilog, commonly referred to as dataflow. The following steps will guide you through the process.
(a) The `assign` statement in Verilog allows us to describe how data should flow from one wire to the next using arithmetic and logic operators available in most programming languages. The operand and result wires can be an arbitrary width; however, the width of each wire should match the operation being performed. For example, if you are describing a bit-wise AND operation on two 4-bit wires (`assign Result = A & B;`), the result wire should be 4-bits in width as well. Using the gate-level schematic for a full-adder illustrated in Figure 3 and the code snippet below as a template, describe a full-adder in Verilog using dataflow abstraction.
**Hint:** The full-adder schematic provides suggested intermediate signal names.
```verilog
`timescale 1ns / 1ps
module full_adder (S, Cout, A, B, Cin);
// declare output and input ports
// 1-bit wires
input wire A, B, Cin; // 1-bit wires
// declare internal nets
wire andBCin, andACin; // 1-bit wires (missing something???)
// use dataflow to describe the gate-level activity
assign S = A ^ B ^ Cin; // the hat (^) is for XOR
assign andAB = A & B; // the ampersand (&) is for and
assign Cout = andAB | andBCin; // pipe (|) is for or
// oh btw, the above line is missing something...
endmodule
```
(b) Copy over the full-adder test bench file, “full_adder_tb.v”, from the course directory and add it to your current ISE project. Simulate the full-adder design and ensure it works properly. Include a screenshot of waveform in your lab write-up along with the console output from the test bench.
(c) Now that we understand the basics of structural and dataflow Verilog, we can use a mixture of the two abstraction levels to create the addition/subtraction unit found in Figure 4. As with the previous procedures, use the code below as a starting point.
timescale 1ns / 1ps
default_nettype none
module add_sub(
// declare output and input ports
output wire [3:0] Sum, // 4-bit result
// This Verilog module describes a 4-bit addition/subtraction unit using full-adder modules which have already been designed and tested.
)
Laboratory Exercise #6
1. Using your corrected block diagram of the 4-bit ALU from the previous lab submission, create a top-level module with the following interface:
```verilog
module four_bitalu(
output wire [3:0] Rresult, //4-bit output
output wire Overflow, //1-bit signal for overflow
input wire [3:0] opA, opB, //4-bit operands
input wire opSel //opSel = 1 for subtract
);
```
2. Copy “add_sub_tb.v” from the course directory into your lab6 directory and simulate the test bench. As with the previous simulations, include the waveform and console output of the test bench simulation in your lab manual.
6 Experiment 3
For this experiment, you will use your new found Verilog skills to create the simple 4-bit ALU described in the previous lab.
1. Using your corrected block diagram of the 4-bit ALU from the previous lab submission, create a top-level module with the following interface:
```verilog
module four_bitalu(
output wire [3:0] Rresult, //4-bit output
output wire Overflow, //1-bit signal for overflow
input wire [3:0] opA, opB, //4-bit operands
input wire opSel //opSel = 1 for subtract
);
```
(d) Copy “add_sub_tb.v” from the course directory into your lab6 directory and simulate the test bench. As with the previous simulations, include the waveform and console output of the test bench simulation in your lab manual.
**Hint:** Your code should instantiate the 4-bit, 2:1 MUX and the addition/subtraction unit which you have already designed.
2. Copy the 4-bit ALU test bench, “four_bit_alu_tb.v”, file from the course directory and add it to your current ISE project.
3. Simulate the test bench and add the appropriate material to your lab submission. Demonstrate your progress to the TA once your circuit simulates properly without errors or warnings.
4. **(Honors)** In the last lab, we asked that you add a signal to your ALU which is asserted HIGH when performing a subtraction and $A \geq B$. Using the module interface below and a guide, modify your ALU to include this wire. Simulate your modification with the test bench file, “four_bit_aluHonors_tb.v”.
```verilog
module four_bit_alu_honors(
output wire [3:0] Result, //4-bit output
output wire Gteq, //1-bit wire for overflow
output wire Overflow, //1-bit wire for overflow
input wire [3:0] opA, opB, //4-bit operands
input wire [1:0] ctrl //2-bit operation select
);
```
7 **Post-lab Deliverables**
Please include the following items in your post-lab write-up in addition to the deliverables mentioned in the Policies and Procedures document.
1. Include the source code with comments for all modules you simulated. You do not have to include test bench code. Code without comments will not be accepted!
2. Include screenshots of all waveforms captured during simulation in addition to the test bench console output for each test bench simulation.
3. Examine the 1-bit, 2:1 MUX test bench code. Attempt to understand what is going on in the code. The test bench is written using behavior Verilog, which will read much like a programming language. Explain briefly what it is the test bench is doing.
4. Examine the 4-bit, 2:1 MUX test bench code. Are all of the possible input cases being tested? Why or why not?
5. In this lab, we approached circuit design in a different way compared to previous labs. Compare and contrast bread-boarding techniques with circuit simulation. Discuss the advantages and disadvantages of both. Which do you prefer? Similarly, provide some insight as to why HDLs might be preferred over schematics for circuit representation. Are there any disadvantages to describing a circuit using an HDL compared to a schematic? Again, which would you prefer.
6. Two different levels of abstraction were introduced in this lab, namely structural and dataflow. Provide a comparison of these approaches. When might you use one over the other?
7. (Honors) Examine the 4-bit ALU test bench code. The test bench actually computes the result it is expecting from the hardware that it is testing and uses this result to perform a known answer comparison. Notice that Overflow detection is done slightly different in the test bench. How is overflow detection different in the test bench compared to the UUT? Similarly, how is the result computation different?
8 Important Student Feedback
The last part of lab requests your feedback. We are continually trying to improve the laboratory exercises to enhance your learning experience, and we are unable to do so without your feedback. Please include the following post-lab deliverables in your lab write-up.
Note: If you have any other comments regarding the lab that you wish to bring to your instructor’s attention, please feel free to include them as well.
1. What did you like most about the lab assignment and why? What did you like least about it and why?
2. Were there any section of the lab manual that were unclear? If so, what was unclear? Do you have any suggestions for improving the clarity?
3. What suggestions do you have to improve the overall lab assignment?
|
{"Source-Url": "http://people.tamu.edu/~li3939108/ecen248/Honor_labs/lab6_honors.pdf", "len_cl100k_base": 5093, "olmocr-version": "0.1.49", "pdf-total-pages": 17, "total-fallback-pages": 0, "total-input-tokens": 33661, "total-output-tokens": 5848, "length": "2e12", "weborganizer": {"__label__adult": 0.00139617919921875, "__label__art_design": 0.00225830078125, "__label__crime_law": 0.0009870529174804688, "__label__education_jobs": 0.06597900390625, "__label__entertainment": 0.0002968311309814453, "__label__fashion_beauty": 0.000950336456298828, "__label__finance_business": 0.000766754150390625, "__label__food_dining": 0.001132965087890625, "__label__games": 0.002132415771484375, "__label__hardware": 0.141845703125, "__label__health": 0.001800537109375, "__label__history": 0.0013256072998046875, "__label__home_hobbies": 0.00164031982421875, "__label__industrial": 0.007305145263671875, "__label__literature": 0.0005369186401367188, "__label__politics": 0.0008931159973144531, "__label__religion": 0.0018215179443359375, "__label__science_tech": 0.367431640625, "__label__social_life": 0.00047898292541503906, "__label__software": 0.0118865966796875, "__label__software_dev": 0.38037109375, "__label__sports_fitness": 0.0016164779663085938, "__label__transportation": 0.0045166015625, "__label__travel": 0.0005331039428710938}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 22009, 0.0547]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 22009, 0.60337]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 22009, 0.88971]], "google_gemma-3-12b-it_contains_pii": [[0, 0, null], [0, 2782, false], [2782, 4179, null], [4179, 7330, null], [7330, 9020, null], [9020, 9250, null], [9250, 10200, null], [10200, 11059, null], [11059, 12117, null], [12117, 12765, null], [12765, 13485, null], [13485, 14447, null], [14447, 16640, null], [16640, 16917, null], [16917, 18296, null], [18296, 20181, null], [20181, 22009, null]], "google_gemma-3-12b-it_is_public_document": [[0, 0, null], [0, 2782, true], [2782, 4179, null], [4179, 7330, null], [7330, 9020, null], [9020, 9250, null], [9250, 10200, null], [10200, 11059, null], [11059, 12117, null], [12117, 12765, null], [12765, 13485, null], [13485, 14447, null], [14447, 16640, null], [16640, 16917, null], [16917, 18296, null], [18296, 20181, null], [20181, 22009, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 22009, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 22009, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 22009, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 22009, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, true], [5000, 22009, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 22009, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 22009, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 22009, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 22009, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 22009, null]], "pdf_page_numbers": [[0, 0, 1], [0, 2782, 2], [2782, 4179, 3], [4179, 7330, 4], [7330, 9020, 5], [9020, 9250, 6], [9250, 10200, 7], [10200, 11059, 8], [11059, 12117, 9], [12117, 12765, 10], [12765, 13485, 11], [13485, 14447, 12], [14447, 16640, 13], [16640, 16917, 14], [16917, 18296, 15], [18296, 20181, 16], [20181, 22009, 17]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 22009, 0.0]]}
|
olmocr_science_pdfs
|
2024-11-24
|
2024-11-24
|
1c70eb1fed3b159e56776ece8e7e9f29586229bd
|
Uninformed Search
Chapter 3
Some material adopted from notes by Charles R. Dyer, University of Wisconsin-Madison
Today’s topics
• Goal-based agents
• Representing states and actions
• Example problems
• Generic state-space search algorithm
• Specific algorithms
– Breadth-first search
– Depth-first search
– Uniform cost search
– Depth-first iterative deepening
• Example problems revisited
Allen Newell and Herb Simon developed the problem space principle as an AI approach in the late 60s/early 70s.
"The rational activity in which people engage to solve a problem can be described in terms of (1) a set of states of knowledge, (2) operators for changing one state into another, (3) constraints on applying operators and (4) control knowledge for deciding which operator to apply next."
• **Herb Simon** was a polymath who contributed to economics, cognitive science, management, computer science and many other fields
• He was awarded a Nobel Prize in 1978 “for his pioneering research into the decision-making process within economic organizations”
• He is the only computer scientist to have won a Nobel Prize
Example: 8-Puzzle
Given an initial configuration of 8 numbered tiles on a 3x3 board, move the tiles in such a way so as to produce a desired goal configuration of the tiles.
Start State
Goal State
Simpler: 3-Puzzle
Building goal-based agents
We must answer the following questions
— How do we represent the state of the “world”?
— What is the goal and how can we recognize it?
— What are the possible actions?
— What relevant information do we encode to describe the state and available transitions, and solve the problem?
![Initial state and goal state image]
What is the goal to be achieved?
• Can describe a situation we want to achieve, a set of properties that we want to hold, etc.
- Requires defining a **goal test**, so we know what it means to have achieved/satisfied goal
- A hard question, rarely tackled in AI; usually assume system designer or user specifies goal
- Psychologists and motivational speakers stress importance of establishing clear goals as a first step towards solving a problem
• What are your goals???
What are the actions?
• Characterize **primitive actions** for making changes in the world to achieve a goal
• **Deterministic** world: no uncertainty in an action’s effects (simple model)
• Given action and description of **current world state**, action completely specifies
– Whether action **can** be applied to the current world (i.e., is it applicable and legal?) and
– What state **results** after action is performed in the current world (i.e., no need for **history** information to compute the next state)
Representing actions
• Actions can be considered as **discrete events** that occur at an **instant of time**, e.g.:
- If “In class” and perform action “go home,” then next state is “at home.” There’s no time where you’re neither in class nor at home (i.e., in the state of “going home”)
• Number of actions/operators depends on the **representation** used in describing a state
- 8-puzzle: specify 4 possible moves for each of the 8 tiles, resulting in a total of **4*8=32 operators**
- Or, we could specify four moves for “blank” square and we only need **4 operators**
• Representational shift can simplify a problem!
Representing states
• What information is necessary to describe all relevant aspects to solving the goal?
• **Size of a problem** usually described in terms of possible **number of states**
- Tic-Tac-Toe has about $3^9$ states ($19,683 \approx 2 \times 10^4$)
- Checkers has about $10^{40}$ states
- Rubik’s Cube has about $10^{19}$ states
- Chess has about $10^{120}$ states in a typical game
- Go has $2 \times 10^{170}$
- Theorem provers may deal with an infinite space
• State space size $\approx$ solution difficulty
Representing states
- State space size ≈ solution difficulty
- Our estimates were loose upper bounds
- How many legal states does tic-tac-toe really have?
Representing states
• Our estimates were loose upper bounds
• How many possible, legal states does tic-tac-toe really have?
• Simple upper bound: nine board cells, each of which can be empty, O or X, so \(3^9\)
• Only 593 states after eliminating
– impossible states
– Rotations and reflections
Some example problems
• Toy problems and micro-worlds
– 8-Puzzle
– Missionaries and Cannibals
– Cryptarithmetic
– Remove 5 Sticks
– Water Jug Problem
• Real-world problems
8-Puzzle
Given an initial configuration of 8 numbered tiles on a 3x3 board, move the tiles in such a way so as to produce a desired goal configuration of the tiles.
Start State
Goal State
What are the states, goal test, actions?
8 puzzle
- **State:** 3x3 array of the tiles on the board
- **Actions:** Move blank square left, right, up or down
More efficient encoding than one with 4 possible moves for each of 8 distinct tiles
- **Initial State:** A given board configuration
- **Goal:** A given board configuration
15 puzzle
• Popularized, but not invented by, Sam Loyd
• In late 1800s he offered $1000 to all who could find a solution
• He sold many puzzles
• Its states form two disjoint spaces
• There was no path to the solution from his initial state!
The 8-Queens Puzzle
Place eight queens on a chessboard such that no queen attacks any other.
We can generalize the problem to a $N \times N$ chessboard.
*What are the states, goal test, actions?*
Route Planning
Find a route from Arad to Bucharest
A simplified map of major roads in Romania used in our text
Example: Water Jug Problem
- Two jugs J1 and J2 with capacity C1 and C2
- Initially J1 has W1 water and J2 has W2 water
- e.g.: a full 5 gallon jug and an empty 2 gallon jug
- Possible actions:
- Pour from jug X to jug Y until X empty or Y full
- Empty jug X onto the floor
- Goal: J1 has G1 water and J2 G2
- G1 or G0 can be -1 to represent any amount
- E.g.: initially full jugs with capacities 3 and 1 liters, goal is to have 1 liter in each
So...
- How can we represent the states?
- What an initial state
- How do we recognize a goal state
- What are the actions; how can we tell which ones can be performed in a given state; what is the resulting state
- How do we search for a solution from an initial state given a goal state
- What is a solution? The goal state achieved or a path to it?
Search in a state space
• Basic idea:
– Create representation of initial state
– Try all possible actions & connect states that result
– Recursively apply process to the new states until we find a solution or dead ends
• We need to keep track of the connections between states and might use a
– Tree data structure or
– Graph data structure
• A graph structure is best in general...
Search in a state space
Consider a water jug problem with a 3-liter and 1-liter jug, an initial state of (3,1) and a goal stage of (1,1).
Tree model of space
Graph model of space
graph model avoids redundancy and loops and is usually preferred
Formalizing search in a state space
• A state space is a graph \((V, E)\) where \(V\) is a set of nodes and \(E\) is a set of arcs, and each arc is directed from a node to another node.
• **Nodes** are data structures with a state description and other info, e.g., node’s parent, name of action that generated it from parent, etc.
• **Arcs** are instances of actions. When operator is applied to state at its source node, then resulting state is arc’s destination node.
Formalizing search in a state space
• Each arc has fixed, positive cost associated with it corresponding to the operator cost
– Simple case: all costs are 1
• Each node has a set of successor nodes corresponding to all legal actions that can be applied at node’s state
– Expanding a node = generating its successor nodes and adding them and their associated arcs to the graph
• One or more nodes are marked as start nodes
• A goal test predicate is applied to a state to determine if its associated node is a goal node
Example: Water Jug Problem
- Two jugs J1 and J2 with capacity C1 and C2
- Initially J1 has W1 water and J2 has W2 water
- e.g.: a full 5 gallon jug and an empty 2 gallon jug
- Possible actions:
- Pour from jug X to jug Y until X empty or Y full
- Empty jug X onto the floor
- Goal: J1 has G1 water and J2 G2
- G1 or G0 can be -1 to represent any amount
Example: Water Jug Problem
Given full 5 gallon jug and an empty 2 gallon jug, goal is to fill 2 gallon jug with exactly one gallon
- State representation?
- General state?
- Initial state?
- Goal state?
- Possible actions?
- Condition?
- Resulting state?
Action table
<table>
<thead>
<tr>
<th>Name</th>
<th>Cond.</th>
<th>Transition</th>
<th>Effect</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
Example: Water Jug Problem
Given full 5 gallon jug and an empty 2 gallon jug, goal is to fill 2 gallon jug with exactly one gallon
—State = (x,y), where x is water in jug 1 and y is water in jug 2
—Initial State = (5,0)
—Goal State = (-1,1), where -1 means any amount
Action table
<table>
<thead>
<tr>
<th>Name</th>
<th>Cond.</th>
<th>Transition</th>
<th>Effect</th>
</tr>
</thead>
<tbody>
<tr>
<td>dump1</td>
<td>x>0</td>
<td>(x,y)→(0,y)</td>
<td>Empty Jug 1</td>
</tr>
<tr>
<td>dump2</td>
<td>y>0</td>
<td>(x,y)→(x,0)</td>
<td>Empty Jug 2</td>
</tr>
<tr>
<td>pour_1_2</td>
<td>x>0 & y<C2</td>
<td>(x,y)→(x-D,y+D)</td>
<td>Pour from Jug 1 to Jug 2</td>
</tr>
<tr>
<td></td>
<td></td>
<td>( D = \min(x,C2-y) )</td>
<td></td>
</tr>
<tr>
<td>pour_2_1</td>
<td>y>0 & X<C1</td>
<td>(x,y)→(x+D,y-D)</td>
<td>Pour from Jug 2 to Jug 1</td>
</tr>
<tr>
<td></td>
<td></td>
<td>( D = \min(y,C1-x) )</td>
<td></td>
</tr>
</tbody>
</table>
Class Exercise
• Representing a 2x2 Sudoku puzzle as a search space
• Fill in the grid so that every row, every column, and every 2x2 box contains the digits 1 through 4
– What are the states?
– What are the actions?
– What are the constraints on actions?
– What is the description of the goal state?
<table>
<thead>
<tr>
<th></th>
<th>3</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>3</td>
<td></td>
<td>1</td>
</tr>
<tr>
<td></td>
<td>3</td>
<td>2</td>
</tr>
</tbody>
</table>
Formalizing search (3)
• **Solution**: sequence of actions associated with a path from a start node to a goal node
• **Solution cost**: sum of the arc costs on the solution path
– If all arcs have same (unit) cost, then solution cost is just the length of solution (number of steps / state transitions)
– Algorithms generally require that arc costs cannot be negative (why?)
Formalizing search (4)
• **State-space search**: searching through state space for solution by **making explicit** a sufficient portion of an **implicit** state-space graph to find a goal node
– Can’t materializing whole space for large problems
– Initially V={S}, where S is the start node, E={}
– On expanding S, its successor nodes are generated and added to V and associated arcs added to E
– Process continues until a goal node is found
• Nodes represent a *partial solution* path (+ cost of partial solution path) from S to the node
– From a node there may be many possible paths (and thus solutions) with this partial path as a prefix
State-space search algorithm
;; problem describes the start state, operators, goal test, and operator costs
;; queueing-function is a comparator function that ranks two states
;; general-search returns either a goal node or failure
function general-search (problem, QUEUEING-FUNCTION)
nodes = MAKE-QUEUE(MAKE-NODE(problem.INITIAL-STATE))
loop
if EMPTY(nodes) then return "failure"
node = REMOVE-FRONT(nodes)
if problem.GOAL-TEST(node.STATE) succeeds then return node
nodes = QUEUEING-FUNCTION(nodes, EXPAND(node, problem.OPERATORS))
end
;; Note: The goal test is NOT done when nodes are generated
;; Note: This algorithm does not detect loops
Key procedures to be defined
- **EXPAND**
- Generate all successor nodes of a given node, adding them to the graph
- **GOAL-TEST**
- Test if state satisfies all goal conditions
- **QUEUEING-FUNCTION**
- Used to maintain a ranked list of nodes that are candidates for expansion
Typical node data structure includes:
- State at this node
- Parent node(s)
- Action(s) applied to get to this node
- Depth of this node (# of actions on shortest known path from initial state)
- Cost of path (sum of action costs on best path from initial state)
Some issues
• Search process constructs a search tree/graph, where
– **root** is initial state and
– **leaf nodes** are nodes
• not yet expanded (i.e., in list “nodes”) or
• having no successors (i.e., they’re *deadends* because no operators were applicable and yet they are not goals)
• Search tree may be infinite due to loops; even graph may be infinite for some problems
• Solution is a *path* or a *node*, depending on problem.
– E.g., in cryptarithmetic return a node; in 8-puzzle, a path
• Changing definition of the QUEUEING-FUNCTION leads to different search strategies
Uninformed vs. informed search
Uninformed search strategies (blind search)
– Use no information about likely “direction” of goal node(s)
– Methods: breadth-first, depth-first, depth-limited, uniform-cost, depth-first iterative deepening, bidirectional
Informed search strategies (heuristic search)
– Use information about domain to (try to) (usually) head in the general direction of goal node(s)
– Methods: hill climbing, best-first, greedy search, beam search, algorithm A, algorithm A*
Evaluating search strategies
• Completeness
– Guarantees finding a solution whenever one exists
• Time complexity (worst or average case)
– Usually measured by *number of nodes expanded*
• Space complexity
– Usually measured by maximum size of graph/tree during the search
• Optimality/Admissibility
– If a solution is found, is it *guaranteed* to be an optimal one, i.e., one with minimum cost
Example of uninformed search strategies
Consider this search space where S is the start node and G is the goal. Numbers are arc costs.
Classic uninformed search methods
• The four classic uninformed search methods
– Breadth first search (BFS)
– Depth first search (DFS)
– Uniform cost search (generalization of BFS)
– Iterative deepening (blend of DFS and BFS)
• To which we can add another technique
– Bi-directional search (hack on BFS)
Breadth-First Search
- Enqueue nodes in **FIFO** (first-in, first-out) order
- **Complete**
- **Optimal** (i.e., admissible) finds shortest path, which is optimal if all operators have same cost
- **Exponential time and space complexity**, $O(b^d)$, where $d$ is depth of solution and $b$ is branching factor (i.e., # of children)
- Takes a **long time to find solutions** with large number of steps because must look at all shorter length possibilities first
Breadth-First Search
weighted arcs
<table>
<thead>
<tr>
<th>Expanded node</th>
<th>Nodes list (aka Fringe)</th>
</tr>
</thead>
<tbody>
<tr>
<td>$S^0$</td>
<td>${ A^1 B^1 C^8 }$</td>
</tr>
<tr>
<td>$A^3$</td>
<td>${ B^1 C^8 D^6 E^{10} G^{18} }$</td>
</tr>
<tr>
<td>$B^1$</td>
<td>${ C^8 D^6 E^{10} G^{18} G^{21} }$</td>
</tr>
<tr>
<td>$C^8$</td>
<td>${ D^6 E^{10} G^{18} G^{21} G^{13} }$</td>
</tr>
<tr>
<td>$D^6$</td>
<td>${ E^{10} G^{18} G^{21} G^{13} }$</td>
</tr>
<tr>
<td>$E^{10}$</td>
<td>${ G^{18} G^{21} G^{13} }$</td>
</tr>
<tr>
<td>$G^{18}$</td>
<td>${ G^{21} G^{13} }$</td>
</tr>
</tbody>
</table>
Note: we typically don’t check for goal until we expand node
Solution path found is $S\ A\ G$ , cost 18
Number of nodes expanded (including goal node) = 7
Breadth-First Search
Long time to find solutions with many steps: we must look at all shorter length possibilities first
• Complete search tree of depth $d$ where non-leaf nodes have $b$ children has $1 + b + b^2 + \ldots + b^d = (b^{d+1} - 1)/(b-1)$ nodes $= \Omega(b^d)$
• Tree of depth 12 with branching 10 has more than a trillion nodes
• If BFS expands 1000 nodes/sec and nodes uses 100 bytes, then it may take 35 years to run and uses 111 terabytes of memory!
Depth-First (DFS)
- Enqueue nodes on nodes in **LIFO** (last-in, first-out) order, i.e., use stack data structure to order nodes
- **May not terminate** w/o **depth bound**, i.e., ending search below fixed depth D (depth-limited search)
- **Not complete** (with or w/o cycle detection, with or w/o a cutoff depth)
- **Exponential time**, $O(b^d)$, but **linear space**, $O(bd)$
- Can find **long solutions quickly** if lucky (and **short solutions slowly** if unlucky!)
- On reaching deadend, can only back up one level at a time even if problem occurs because of a bad choice at top of tree
## Depth-First Search
<table>
<thead>
<tr>
<th>Expanded node</th>
<th>Nodes list</th>
</tr>
</thead>
<tbody>
<tr>
<td>S⁰</td>
<td>{ S⁰ }</td>
</tr>
<tr>
<td>A³</td>
<td>{ A³ B¹ C⁸ }</td>
</tr>
<tr>
<td>D⁶</td>
<td>{ E¹⁰ G¹⁸ B¹ C⁸ }</td>
</tr>
<tr>
<td>E¹⁰</td>
<td>{ G¹⁸ B¹ C⁸ }</td>
</tr>
<tr>
<td>G¹⁸</td>
<td>{ B¹ C⁸ }</td>
</tr>
</tbody>
</table>
Solution path found is S A G, cost 18
Number of nodes expanded (including goal node) = 5
Uniform-Cost Search (UCS)
• Enqueue nodes by **path cost**. i.e., let $g(n) = \text{cost of path from start to current node } n$. Sort nodes by increasing value of $g(n)$.
• Also called *Dijkstra’s Algorithm*, similar to *Branch and Bound Algorithm* from operations research
• **Complete (**)**
• **Optimal/Admissible (**)**
Depends on goal test being applied *when node is removed from nodes list*, not when its parent node is expanded & node first generated
• **Exponential time and space complexity, $O(b^d)$**
## Uniform-Cost Search
<table>
<thead>
<tr>
<th>Expanded node</th>
<th>Nodes list</th>
</tr>
</thead>
<tbody>
<tr>
<td>$S^0$</td>
<td>{ $B^1$ A$^3$ C$^8$ }</td>
</tr>
<tr>
<td>$B^1$</td>
<td>{ A$^3$ C$^8$ G$^{21}$ }</td>
</tr>
<tr>
<td>A$^3$</td>
<td>{ D$^6$ C$^8$ E$^{10}$ G$^{18}$ G$^{21}$ }</td>
</tr>
<tr>
<td>D$^6$</td>
<td>{ C$^8$ E$^{10}$ G$^{18}$ G$^{21}$ }</td>
</tr>
<tr>
<td>C$^8$</td>
<td>{ E$^{10}$ G$^{13}$ G$^{18}$ G$^{21}$ }</td>
</tr>
<tr>
<td>E$^{10}$</td>
<td>{ G$^{13}$ G$^{18}$ G$^{21}$ }</td>
</tr>
<tr>
<td>G$^{13}$</td>
<td>{ G$^{18}$ G$^{21}$ }</td>
</tr>
</tbody>
</table>
Solution path found is $S$ C G, cost 13
Number of nodes expanded (including goal node) = 7
Depth-First Iterative Deepening (DFID)
- Do DFS to depth 0, then (if no solution) DFS to depth 1, etc.
- Usually used with a tree search
- Complete
- **Optimal/Admissible** if all operators have unit cost, else finds shortest solution (like BFS)
- Time complexity a bit worse than BFS or DFS
Nodes near top of search tree generated many times, but since almost all nodes are near tree bottom, worst case time complexity still exponential, $O(b^d)$
Depth-First Iterative Deepening (DFID)
• If branching factor is $b$ and solution is at depth $d$, then nodes at depth $d$ are generated once, nodes at depth $d-1$ are generated twice, etc.
— Hence $b^d + 2b^{(d-1)} + \ldots + db \leq b^d / (1 - 1/b)^2 = O(b^d)$.
— If $b=4$, worst case is $1.78 \times 4^d$, i.e., 78% more nodes searched than exist at depth $d$ (in worst case)
• **Linear space complexity**, $O(bd)$, like DFS
• Has advantages of BFS (completeness) and DFS (i.e., limited space, finds longer paths quickly)
• Preferred for **large state spaces** where **solution depth is unknown**
How they perform
• **Depth-First Search:**
– 4 Expanded nodes: S A D E G
– Solution found: S A G (cost 18)
• **Breadth-First Search:**
– 7 Expanded nodes: S A B C D E G
– Solution found: S A G (cost 18)
• **Uniform-Cost Search:**
– 7 Expanded nodes: S A D B C E G
– Solution found: S C G (cost 13)
*Only uninformed search that worries about costs*
• **Iterative-Deepening Search:**
– 10 nodes expanded: S S A B C S A D E G
– Solution found: S A G (cost 18)
Searching Backward from Goal
• Usually a successor function is reversible
– i.e., can generate a node’s predecessors in graph
• If we know a single goal (rather than a goal’s properties), we could search backward to the initial state
• It might be more efficient
– Depends on whether the graph fans in or out
Bi-directional search
- Alternate searching from the start state toward the goal and from the goal state toward the start
- Stop when the frontiers intersect
- Works well only when there are unique start & goal states
- Requires ability to generate “predecessor” states
- Can (sometimes) lead to finding a solution more quickly
### Comparing Search Strategies
<table>
<thead>
<tr>
<th>Criterion</th>
<th>Breadth-First</th>
<th>Uniform-Cost</th>
<th>Depth-First</th>
<th>Depth-Limited</th>
<th>Iterative Deepening</th>
<th>Bidirectional (if applicable)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Time</td>
<td>(b^d)</td>
<td>(b^d)</td>
<td>(b^m)</td>
<td>(b^l)</td>
<td>(b^d)</td>
<td>(b^{dr/2})</td>
</tr>
<tr>
<td>Space</td>
<td>(b^d)</td>
<td>(b^d)</td>
<td>(bm)</td>
<td>(bl)</td>
<td>(bd)</td>
<td>(b^{dr/2})</td>
</tr>
<tr>
<td>Optimal?</td>
<td>Yes</td>
<td>Yes</td>
<td>No</td>
<td>No</td>
<td>Yes</td>
<td>Yes</td>
</tr>
<tr>
<td>Complete?</td>
<td>Yes</td>
<td>Yes</td>
<td>No</td>
<td>Yes, if (l \geq d)</td>
<td>Yes</td>
<td>Yes</td>
</tr>
</tbody>
</table>
|
{"Source-Url": "https://www.csee.umbc.edu/courses/undergraduate/471/spring19/01/notes/04_search1/04.pdf", "len_cl100k_base": 6133, "olmocr-version": "0.1.49", "pdf-total-pages": 52, "total-fallback-pages": 0, "total-input-tokens": 75638, "total-output-tokens": 7727, "length": "2e12", "weborganizer": {"__label__adult": 0.0004527568817138672, "__label__art_design": 0.0006237030029296875, "__label__crime_law": 0.0009336471557617188, "__label__education_jobs": 0.0037021636962890625, "__label__entertainment": 0.00018167495727539065, "__label__fashion_beauty": 0.00029087066650390625, "__label__finance_business": 0.0006899833679199219, "__label__food_dining": 0.0005335807800292969, "__label__games": 0.004932403564453125, "__label__hardware": 0.001903533935546875, "__label__health": 0.0009140968322753906, "__label__history": 0.0008244514465332031, "__label__home_hobbies": 0.0004010200500488281, "__label__industrial": 0.00122833251953125, "__label__literature": 0.0008444786071777344, "__label__politics": 0.0004763603210449219, "__label__religion": 0.0006322860717773438, "__label__science_tech": 0.3515625, "__label__social_life": 0.0002244710922241211, "__label__software": 0.0139007568359375, "__label__software_dev": 0.6123046875, "__label__sports_fitness": 0.0006561279296875, "__label__transportation": 0.00130462646484375, "__label__travel": 0.00029349327087402344}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 21234, 0.01982]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 21234, 0.48344]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 21234, 0.84872]], "google_gemma-3-12b-it_contains_pii": [[0, 115, false], [115, 402, null], [402, 890, null], [890, 1218, null], [1218, 1418, null], [1418, 1436, null], [1436, 1788, null], [1788, 2266, null], [2266, 2788, null], [2788, 3426, null], [3426, 3963, null], [3963, 4119, null], [4119, 4421, null], [4421, 4605, null], [4605, 4838, null], [4838, 5129, null], [5129, 5372, null], [5372, 5571, null], [5571, 5684, null], [5684, 6138, null], [6138, 6491, null], [6491, 6887, null], [6887, 7135, null], [7135, 7608, null], [7608, 8135, null], [8135, 8497, null], [8497, 9015, null], [9015, 9868, null], [9868, 10236, null], [10236, 10617, null], [10617, 11271, null], [11271, 11961, null], [11961, 12245, null], [12245, 12509, null], [12509, 13103, null], [13103, 13596, null], [13596, 14003, null], [14003, 14139, null], [14139, 14455, null], [14455, 14916, null], [14916, 15557, null], [15557, 16027, null], [16027, 16620, null], [16620, 16969, null], [16969, 17493, null], [17493, 18210, null], [18210, 18662, null], [18662, 19269, null], [19269, 19751, null], [19751, 20067, null], [20067, 20396, null], [20396, 21234, null]], "google_gemma-3-12b-it_is_public_document": [[0, 115, true], [115, 402, null], [402, 890, null], [890, 1218, null], [1218, 1418, null], [1418, 1436, null], [1436, 1788, null], [1788, 2266, null], [2266, 2788, null], [2788, 3426, null], [3426, 3963, null], [3963, 4119, null], [4119, 4421, null], [4421, 4605, null], [4605, 4838, null], [4838, 5129, null], [5129, 5372, null], [5372, 5571, null], [5571, 5684, null], [5684, 6138, null], [6138, 6491, null], [6491, 6887, null], [6887, 7135, null], [7135, 7608, null], [7608, 8135, null], [8135, 8497, null], [8497, 9015, null], [9015, 9868, null], [9868, 10236, null], [10236, 10617, null], [10617, 11271, null], [11271, 11961, null], [11961, 12245, null], [12245, 12509, null], [12509, 13103, null], [13103, 13596, null], [13596, 14003, null], [14003, 14139, null], [14139, 14455, null], [14455, 14916, null], [14916, 15557, null], [15557, 16027, null], [16027, 16620, null], [16620, 16969, null], [16969, 17493, null], [17493, 18210, null], [18210, 18662, null], [18662, 19269, null], [19269, 19751, null], [19751, 20067, null], [20067, 20396, null], [20396, 21234, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 21234, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 21234, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 21234, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 21234, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, true], [5000, 21234, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 21234, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 21234, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 21234, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 21234, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 21234, null]], "pdf_page_numbers": [[0, 115, 1], [115, 402, 2], [402, 890, 3], [890, 1218, 4], [1218, 1418, 5], [1418, 1436, 6], [1436, 1788, 7], [1788, 2266, 8], [2266, 2788, 9], [2788, 3426, 10], [3426, 3963, 11], [3963, 4119, 12], [4119, 4421, 13], [4421, 4605, 14], [4605, 4838, 15], [4838, 5129, 16], [5129, 5372, 17], [5372, 5571, 18], [5571, 5684, 19], [5684, 6138, 20], [6138, 6491, 21], [6491, 6887, 22], [6887, 7135, 23], [7135, 7608, 24], [7608, 8135, 25], [8135, 8497, 26], [8497, 9015, 27], [9015, 9868, 28], [9868, 10236, 29], [10236, 10617, 30], [10617, 11271, 31], [11271, 11961, 32], [11961, 12245, 33], [12245, 12509, 34], [12509, 13103, 35], [13103, 13596, 36], [13596, 14003, 37], [14003, 14139, 38], [14139, 14455, 39], [14455, 14916, 40], [14916, 15557, 41], [15557, 16027, 42], [16027, 16620, 43], [16620, 16969, 44], [16969, 17493, 45], [17493, 18210, 46], [18210, 18662, 47], [18662, 19269, 48], [19269, 19751, 49], [19751, 20067, 50], [20067, 20396, 51], [20396, 21234, 52]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 21234, 0.12895]]}
|
olmocr_science_pdfs
|
2024-11-26
|
2024-11-26
|
45715416343bc8c15eaf2232953ec536bca2b396
|
ABSTRACT
Statistical dialogue systems offer the potential to reduce costs by learning policies automatically on-line, but are not designed to scale to large open-domains. This paper proposes a hierarchical distributed dialogue architecture in which policies are organised in a class hierarchy aligned to an underlying knowledge graph. This allows a system to be deployed using a modest amount of data to train a small set of generic policies. As further data is collected, generic policies can be adapted to give in-domain performance. Using Gaussian process-based reinforcement learning, it is shown that within this framework generic policies can be constructed which provide acceptable user performance, and better performance than can be obtained using under-trained domain specific policies. It is also shown that as sufficient in-domain data becomes available, it is possible to seamlessly improve performance, without subjecting users to unacceptable behaviour during the adaptation period and without limiting the final performance compared to policies trained from scratch.¹
Index Terms— open-domain, multi-domain, dialogue systems, POMDP, Gaussian process
1. INTRODUCTION
Statistical spoken dialogue systems allow policies to be learned directly from data thereby avoiding the need for hand-crafting dialogue decisions [1, 2]. Furthermore, the recent introduction of sample-efficient reinforcement learning algorithms has substantially reduced the number of training dialogues required to train effective policies [3, 4] and this has enabled systems to be trained on-line in direct interaction with human users [5].
Current approaches to statistical dialogue assume that all possible dialogue states can be encapsulated in a single real-valued vector referred to as a belief state b and that dialogue decisions can be defined by a policy which maps belief states into actions π(b) → a. This model works well for applications in specific limited domains and it is sufficiently flexible to allow a specific domain to be adapted and extended on-the-fly in direct interaction with human users [6]. However, it does not readily scale to support multiple domains in which the user wishes to move from one topic to another.
In order to support large and potentially open domains, techniques that can reuse existing knowledge and adapt on-line are needed. Such a system has extensive knowledge which could be structured in the form of a hierarchical ontology populated with instances of the various types of entity that it knows about. Following Google, such data structures are frequently referred to as Knowledge Graphs (KGs) and they have already been explored in connection with spoken language understanding tasks [7, 8]. For the purposes of this paper, we consider a KG to be a tree-structured class hierarchy in which each class represents a domain or topic by a set of properties (slot-value pairs), and derived classes represent specialisations of that domain that inherit slots from their parent and add additional slots specific to the specialisation. For example (see Fig 1), a generic venue class might define the common properties of a venue such as name, area, phone, etc. A derived class such as restaurant will then inherit the common properties of a venue, but add restaurant-specific slots such as type of food, whether kids-allowed, etc. Actual entities are then class instances in which each slot has a specific value. The goal of a typical dialogue might then be to identify specific instances which match the user’s constraints (e.g. “Find a restaurant nearby serving Italian food”).
Fig. 1. Training a generic venue policy model \( M_V \) on data pooled from two subdomains \( D_R + D_H \) (left); and training specific policy models \( M_R \) and \( M_H \) using the generic policy \( M_V \) as a prior and additional in-domain training data (right).
One way to build a dialogue manager which can operate across a large knowledge graph is to decompose the dialogue policy into a set of topic specific policies that are distributed across the class nodes in the graph. Initially, there will be relatively little training data and the system will need to rely on generic policies attached to high level generic class nodes which have been trained on whatever examples are available from across the pool of derived classes. As more data is collected, specific policies can be trained for each derived class². An example of this is illustrated in Fig 1. On the left side is the initial situation where conversations about hotels and restaurants are conducted using a generic model \( M_V \) trained on example dialogues from both the hotel and restaurant domains. Once the system has been deployed and more training data has been collected, specific
¹Note: due to an error in the configuration settings, some of the results presented in the original version of this paper in the proceedings were not directly comparable. This version of the paper has the corrected results.
restaurant and hotel models $M_R$ and $M_H$ can be trained.\(^3\)
This type of multi-domain model assumes an agile deployment strategy which can be succinctly described as “deploy, collect data, and refine”. Its viability depends on the following assumptions:
1. it is possible to construct generic policies which provide acceptable user performance across a range of differing domains;
2. as sufficient in-domain data becomes available, it is possible to seamlessly adapt the policy to improve performance, without subjecting users to unacceptable disruptions in performance during the adaptation period.
The aim of this paper is to investigate the validity of these assumptions.
The remainder of the paper is organised as follows. In Section 2, the use of Gaussian process-based reinforcement learning (GPRL) is briefly reviewed. The key advantage of GPRL in this context is that in addition to being data efficient, it directly supports the use of an existing model as a prior thereby facilitating incremental adaptation. In Section 3, various strategies for building a generic policy are considered and evaluated. In Section 4, sub-domain policy adaptation is examined using the associated generic policy as a prior. Results are then presented for live on-line adaptation with human users in Section 5. Finally, in Section 6, conclusions are presented.
2. GP-BASED REINFORCEMENT LEARNING
The input to a statistical dialogue manager is typically an N-best list of scored hypotheses obtained from the spoken language understanding unit. Based on this input, at every dialogue turn, a distribution of possible dialogue states called the belief state, an element of belief space $b \in B$, is estimated. The quality of a dialogue is defined by a reward function $r(b, a)$ and the role of a dialogue policy $\pi$ is to map the belief state $b$ into a system action, an element of action space $a \in A$, at each turn so as to maximise the expected cumulative reward.
The expected cumulative reward for a given belief state $b$ and action $a$ is defined by the $Q$-function:
$$Q(b, a) = E_{\tau} \left( \sum_{T=0}^{T} r_{\tau} | b_t = b, a_t = a \right)$$ \hspace{1cm} (1)
where $r_\tau$ is the immediate reward obtained at time $\tau$, $T$ is the dialogue length and $\gamma$ is a discount factor, $0 < \gamma \leq 1$. Optimising the $Q$-function is then equivalent to optimising the policy $\pi$.
GP-Sarsa is an on-line reinforcement learning algorithm that models the $Q$-function as a Gaussian process [10]:
$$Q(b, a) \sim GP(\{m(b, a), k((b, a), (a, a))\})$$ \hspace{1cm} (2)
where $m(b, a)$ is the prior mean and the kernel $k(\cdot, \cdot)$ is factored into separate kernels over belief and action spaces $k_B(b, b')k_A(a, a')$.
For a training sequence of belief state-action pairs $\mathcal{B} = \{[b_0, a_0], \ldots, [b'_T, a'_T]\}$ and the corresponding observed immediate rewards $\mathbf{r} = [r_1, \ldots, r_T]^T$, the posterior of the $Q$-function for any belief state-action pair $(b, a)$ is given by:
$$Q(b, a) | \mathbf{r}, \mathcal{B} \sim N(\overline{Q}(b, a), \text{cov}((b, a), (a, a)))$$ \hspace{1cm} (3)
where the posterior mean and covariance take the form:
$$\overline{Q}(b, a) = k(b, a)^T H^T (HKH^T + \sigma^2 HH^T)^{-1} (r - m),$$
$$\text{cov}(b, a), (a, a)) = k((b, a), (a, a)) - k(b, a)^T H^T (HKH^T + \sigma^2 HH^T)^{-1} H k(b, a)$$
where $k(b, a) = [k((b, a^0), (b, a)), \ldots, k((b, a'), (b, a))]^T$. $K$ is the Gram matrix [11], $H$ is a band matrix with diagonal $[1, -\gamma]$; $m = [m(b^0, a^0), \ldots, m(b', a')]^T$ and $\sigma$ is an additive noise factor which controls how much variability in the $Q$-function estimate is expected during the learning process. Function $m()$ is 0 for the initial GP model estimation, and is subsequently set to the posterior mean of the previous GP model during incremental adaptation (see [5, 6] for details).
To use GPRL for dialogue, a kernel function must be defined on both the belief state space $B$ and the action space $A$. Here we use the Bayesian Update of Dialogue State (BUDS) dialogue model [12] and we use the same approach as in [13] for defining the kernel function. The action space consists of a set of slot-dependent and slot-independent summary actions which are mapped to master actions using a set of rules and the kernel is defined as:
$$k_A(a, a') = \delta_a(a')$$ \hspace{1cm} (5)
where $\delta_a(a') = 1$ iff $a = a'$, 0 otherwise. The belief state consists of the probability distributions over the Bayesian network hidden nodes that relate to the dialogue history for each slot and the value of each user goal slot. The dialogue history nodes can take a fixed number of values, whereas user goals range over the values defined for that particular slot in the ontology and can have very high cardinalities. User goal distributions are therefore sorted according to the probability assigned to each value since the choice of summary action does not depend on the values but rather on the overall shape of each distribution. The kernel function over both dialogue history and user goal nodes is based on the expected likelihood kernel [14], which is a simple linear inner product. The kernel function for belief space is then the sum over all the individual hidden node kernels:
$$k_B(b, b') = \sum_h k_h(b_h, b'_h)$$ \hspace{1cm} (6)
where $b_h$ is the probability distribution encoded in the $h^{th}$ hidden node. The dimensionality of the belief space grows with the number of slots and the cardinality of each. The impact of the latter can be mitigated by truncating the values to just the $\kappa$ most probable [12]. The impact of a large and growing number of slots requires some form of partitioning of belief space. The distributed policy design proposed in this paper is one approach to dealing with this.
3. DESIGNING A GENERIC POLICY
To investigate the distributed policy model described in Section 1, dialogue policies were built for restaurants and hotels in San Francisco, USA, referred to as SFRestaurant and SFHotel respectively. SFRestaurant contains 239 entities and SFHotel has 182 entities. These subdomains are described by ontologies that were automatically generated using information from the web [15]. A description of slots and the values they take is given in Table 1, where bold identifies the goal slots that can be specified by the user and the remaining slots are informational slots that the user can query.
In GPRL, the computation of $Q(b, a)$ requires the kernel function to be evaluated between $(b, a)$ and each of the belief-action points in the training data. If the training data consists of dialogues from subdomains (restaurants and hotels in this case) which have
domain-specific slots and actions, a strategy is needed for computing the kernel function between domains. Here three different strategies are considered.
The first and simplest is to consider only slots that are common to both subdomains \( R \) and \( H \):
\[
k_B(b^R, b^H) = \sum_{h \in H \cap R} \langle b_h^R, b_h^H \rangle, \tag{7}
\]
When goal nodes are paired with differing cardinalities (e.g. name in Table 1), the shorter vector is padded with zeros. Similarly, the kernel over actions only considers actions that are the same in both subdomains and in other cases returns 0. This strategy is referred to as mutual. In the second strategy, non-matching slots are renamed as slot-1, slot-2, etc and treated as abstract slots so that they are the same in both subdomains, these are the starred rows in Table 1. Hence for example, food is matched with dogs allowed, and so on. As with the mutual case, when goal nodes are paired with differing cardinalities, the shorter vector is padded with zeros. This strategy is referred to as abstract. Finally, a variation of the abstract strategy is considered where, instead of padding the shorter goal vectors with zeros, the longer vectors are normalised to match the length of the shorter. We refer to this strategy as renorm. Adaptation strategies based on [16] are also possible but are reliant on increasing the dimensionality.
In order to investigate the effectiveness of these strategies, generic policies were trained and then tested in both subdomains. In all cases the training data consisted of an equal number of restaurant and hotel dialogues. In addition, in-domain policies were trained as a reference. Training and testing was performed on an agenda-based simulated user operating on the dialogue act level [17, 18]. The reward function allocates –1 at each turn to encourage shorter dialogues, plus 20 at the end of each successful dialogue. The user simulator includes an error generator and this was set to generate incorrect user inputs 15% of the time. For each condition, 10 policies were trained using different random seeds using differing numbers of training dialogues. Each policy is then evaluated using 1000 dialogues on each subdomain. The overall average reward, success rate and number of turns is given in Table 2 together with a 95% confidence interval. The most important measure is the average reward, since the policies are trained to maximise this.
There are two important conclusions to be drawn from these results. First, all generic policies perform better than the in-domain policies trained only on the data available for that subdomain (i.e. half of the training data available for the generic policy in this case) and this is especially the case when training data is limited. Secondly, in the majority of cases the strategies using abstract slots provide the best performance.
### 4. ADAPTATION OF IN-DOMAIN POLICIES USING A GENERIC POLICY AS A PRIOR
We now investigate the effectiveness of a generic policy as a prior for training an in-domain policy as in the right hand side of Fig. 1. Since the strategy of using abstract slots provided the best overall generic performance and renorm strategy gave comparable performance, only abstract generic policies are used from now on. In order to examine the best and worst case, the abstract generic priors (from the 10 randomly seeded examples) that gave the best performance and the worst performance on each sub-domain trained with 500 and 5000 dialogues were selected. This results in four prior policies for each subdomain: abstract-500-worst, abstract-500-best, abstract-5000-worst and abstract-5000-best. In addition, a policy with no prior was also trained for each subdomain (i.e. the policy was trained from scratch). After every 5000 training dialogues each policy was evaluated with 1000 dialogues. The results are given in Fig. 2 and 3 with a 95% confidence interval. Performance at 0 training dialogues corresponds to using the generic policy as described in the previous section, or using a random policy for the no prior case.
The results from Figs. 2 and 3 demonstrate that the performance of the policy in the initial stages of learning are significantly improved using the generic policy as a prior, even if that prior is trained on a small number of dialogues and even if it was the worst performing prior from the batch of 10 training sessions. These results also show that the use of a generic prior does not limit the optimality of the final policy. In fact, the use of a prior can be seen as resetting the variance of a GP which could lead to better sample efficiency [19]. This may be the reason why in some cases the no-prior policies do not perform as well as the prior.
In Table 3, the performance of the best performing generic prior is compared to the performance of the same policy adapted using an additional 50K dialogues. The difference between bold values and non-bold values is statistically significant using an unpaired t-test where \( p < 0.02 \). This shows that additional in-domain adaptation has the potential to improve the performance further. So when enough training data is available, it is beneficial to create individual in-domain policies rather than continuing to train the generic policy. The reason behind this may be that the optimal performance can only be reached when the training and the testing conditions match.
5. ADAPTATION IN INTERACTION WITH HUMAN USERS
In order to investigate how the use of a generic policy as a prior influences training in interaction with human users, a generic policy was adapted on-line in a real-time spoken dialogue system using subjects recruited via Amazon Mturk. Each user was assigned specific tasks in the SFRestaurant subdomain and then asked to call the system in a similar set-up to that described in [20, 21]. After each dialogue the users were asked whether they judged the dialogue to be successful or not. Based on that binary rating, the subjective success was calculated as well as the average reward. An objective rating was also computed by comparing the system outputs with the assigned task specification. During training, only dialogues where both objective and subjective score were the same were used.
Two training schedules were performed in the SFRestaurant subdomain – one training from scratch without a prior and the other performing adaptation using the best generic prior obtained after 5000 training dialogues on the user simulator. For each training schedule three sessions were performed and the results were averaged to reduce any random variation. Fig. 4 shows the moving average reward as a function of the number of training dialogues. The moving window was set to 100 dialogues so that after the initial 100 dialogues each point on the graph is an average of 300 dialogues. The shaded area represents a 95% confidence interval. The initial parts of the graph exhibit more randomness in behaviour because the number of training dialogues is small.
6. CONCLUSIONS
This paper has proposed a distributed multi-domain dialogue architecture in which dialogue policies are organised in a class hierarchy aligned to an underlying knowledge graph. The class hierarchy allows a system to be deployed by using a modest amount of data to train a small set of generic policies. As further data is collected, generic policies can be adapted to give in-domain performance. Using Gaussian process-based reinforcement learning, it has been shown that it is possible to construct generic policies which provide acceptable in-domain user performance, and better performance than can be obtained using under-trained domain specific policies. To construct a generic policy, a design consisting of all common slots plus a number of abstract slots which can be mapped to domain-specific slots works well. It has also been shown that as sufficient in-domain data becomes available, it is possible to seamlessly adapt to improve performance, without subjecting users to unacceptable disruptions in performance during the adaptation period and without limiting the final performance compared to policies trained from
scratch. Future work will investigate the problem of finding adequate mappings for generic policies and training them with human users.
7. REFERENCES
|
{"Source-Url": "http://mi.eng.cam.ac.uk/~sjy/papers/gkty15a.pdf", "len_cl100k_base": 4342, "olmocr-version": "0.1.50", "pdf-total-pages": 5, "total-fallback-pages": 0, "total-input-tokens": 20191, "total-output-tokens": 5932, "length": "2e12", "weborganizer": {"__label__adult": 0.000644683837890625, "__label__art_design": 0.0011358261108398438, "__label__crime_law": 0.0006093978881835938, "__label__education_jobs": 0.0033130645751953125, "__label__entertainment": 0.0010061264038085938, "__label__fashion_beauty": 0.00031065940856933594, "__label__finance_business": 0.0004093647003173828, "__label__food_dining": 0.0007114410400390625, "__label__games": 0.0030765533447265625, "__label__hardware": 0.0013151168823242188, "__label__health": 0.0012493133544921875, "__label__history": 0.0004849433898925781, "__label__home_hobbies": 0.00010663270950317384, "__label__industrial": 0.0006933212280273438, "__label__literature": 0.002735137939453125, "__label__politics": 0.0005731582641601562, "__label__religion": 0.0006990432739257812, "__label__science_tech": 0.432861328125, "__label__social_life": 0.00024318695068359375, "__label__software": 0.0322265625, "__label__software_dev": 0.51416015625, "__label__sports_fitness": 0.0004611015319824219, "__label__transportation": 0.000751495361328125, "__label__travel": 0.0003287792205810547}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 23957, 0.02419]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 23957, 0.24201]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 23957, 0.91405]], "google_gemma-3-12b-it_contains_pii": [[0, 5006, false], [5006, 11744, null], [11744, 16493, null], [16493, 19917, null], [19917, 23957, null]], "google_gemma-3-12b-it_is_public_document": [[0, 5006, true], [5006, 11744, null], [11744, 16493, null], [16493, 19917, null], [19917, 23957, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 23957, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 23957, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 23957, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 23957, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 23957, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 23957, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 23957, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 23957, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 23957, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 23957, null]], "pdf_page_numbers": [[0, 5006, 1], [5006, 11744, 2], [11744, 16493, 3], [16493, 19917, 4], [19917, 23957, 5]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 23957, 0.0]]}
|
olmocr_science_pdfs
|
2024-11-27
|
2024-11-27
|
7ebd98900fe311e8cd147808dd5cf1b4c7f296cd
|
Knowledge Representation in Planning: A PDDL to $OCL_h$
Translation
R. M. Simpson, T. L. McCluskey, D.Liu, D.E.Kitchin
Department of Computing Science
University of Huddersfield, UK
e-mail ron@zeus.hud.ac.uk
March 16, 2000
Abstract:
Recent successful applications of AI planning technology have highlighted the knowledge
engineering of planning domain models as an important research area. We describe a prototype
implementation of a translation algorithm between two languages used in planning represen-
tation: PDDL, a language used for communication of example domains between research
groups, and $OCL_h$, a language developed specifically for planning domain modelling. The
translation algorithm has been used as part of $OCL_h$’s tool support to import models ex-
pressed in PDDL to $OCL_h$’s environment. In this paper we detail the translation algorithm
between the two languages, and discuss the issues that it uncovers. The tool performs well
when its output is measured against hand-crafted $OCL_h$ models, but more importantly, we
show how it has helped uncover insecurities in PDDL encodings.
1 Introduction
Despite many years of research into AI Planning and Scheduling, knowledge engineering for
applications of AI Planning technology is very much in its infancy. Recent successful AI
planning applications [12, 16, 2] have nonetheless highlighted the problems facing knowledge
engineering in planning. Questions include how to choose appropriate planner technology for
a given application, and how to encode knowledge into domain models for use with planning
algorithms. The engineering of knowledge-based planners has resulted in a set of workshops
and initiatives, including [3, 14].
Currently in the AI planning community an accepted syntax for exchange of models is
PDDL, a planning domain definition language. PDDL is a convention for representations
of actions, and many established planners can be obtained via the internet with a set of
domains encoded in this syntax. PDDL emerged from the need to construct a common
language for the biannual AIPS competitions (for details of PDDL and domain examples
consult reference [4]). Language conventions such as PDDL help the research community
to some extent in the problems of exchanging research information, and in the independent
validation of research results.
Domain definition languages such as PDDL, however, are not designed with the same
criteria in mind as a domain modelling language. The latter would be associated with a
domain building methodology, be structured to allow the expeditious capture of knowledge, and have the benefit of a tools environment for knowledge engineering. OCL$_h$ is a family of fairly simple planning-oriented domain modelling languages stemming from reference [11]. The benefit in using OCL$_h$ is seen as twofold: to improve the planning knowledge acquisition and validation process; and to improve and clarify the plan generation process in planning systems. A range of planners have been implemented for use with OCL$_h$ [17, 9, 7], and the language is being used as a prototype for a collaborative UK project to create a knowledge engineering platform for planning [15]. OCL$_h$ is structured to allow the capture of object and state-centred knowledge, as well as action-centred knowledge $^1$, and it is encased in a tools environment.
In this paper we discuss the issues raised in the construction of one of the tools in OCL$_h$’s environment: a translator, to help import models written in PDDL into the OCL$_h$ environment. The translation is feasible because PDDL and OCL$_h$ share similar underlying assumptions about worlds - they are assumed closed, actions are deterministic and instantaneous. A major difference, however, is that whereas PDDL action specifications are based on default persistence, this assumption is limited in OCL$_h$. The paper starts by briefly describing the languages PDDL and OCL$_h$ and an association between the two which forms the basis for the translation. This highlights some of the differences between the two languages. We then outline the translation algorithm, and the results in applying it to example domain models. The tool’s output is used to both make comparisons with hand-crafted models, and to identify omissions and insecurities in the PDDL encodings.
2 The Planning Domain Definition Language
PDDL was created by the AIPS-98 Competition Committee to enable competitors to have a common language for defining domains, and to aid the development of a set of problems written in PDDL on which the different planners could be tested [4]. PDDL provides a wide range of syntactic features, although not all planners are able to utilise all of them. Planners can just deal with particular subsets of the features that the language offers by declaring those language features required when the domain is defined. Here we only mention those features relevant to the paper.
PDDL’s basic level of representation is the literal, and a model’s central element is a set of operator schemata representing generalised domain actions (very much in the style of ‘classical planning’ literature with its roots in STRIPS [5]). Each operator is defined with a precondition and effect, where the semantics are interpreted under the STRIPS assumptions. Below are two examples of simple PDDL operator definitions which use typed parameters. They belong to an encoding of an example domain called the Tyre World which was taken from the distribution examples associated with reference [4]. A planner using the Tyre World should be able to output sequences of ground operators to solve goals involving changing a flat tyre. We will use this domain as a ”running example”.
(:action loosen
:parameters (?n - nut ?h - hub)
:precondition (and (have wrench)(tight ?n ?h)(on-ground ?h))
:effect (and (loose ?n ?h) (not (tight ?n ?h))))
$^1$traditionally, models of planning domains were equated with a set of action specifications, and were therefore only ‘action-centred’
The *loosen* operator models the action of undoing (but not removing) the nuts that fasten a wheel onto a hub. The *fetch* operator models the action of removing a tool or a wheel from a container in which it was stored (such as a car's trunk).
Problems for a planner to solve are posed as an initial state (a set of ground literals) and a goal condition. Although the current PDDL version includes many other features (hierarchically-defined operators, domain axioms, safety constraints, quantification over parameter domains etc) the majority of the planners competing in the AIPS-98 competition input the simple form of PDDL similar to that described above.
### 3 The Object-Centred Language $OCL_h$
$OCL_h$ was designed to be a kind of ‘lifted’ STRIPS-language, aimed to keep the generality of classical planning but to incorporate a model-building method and be structured to help the validation and operationalisation of domain models. For more information on the $OCL_h$ family and its development method, examples and tools, consult references [14, 8, 11]. An $OCL_h$ world is populated with dynamic/static objects grouped into *sorts*\(^2\). Each dynamic object exists in one of a well defined set of states (called ‘substates’), where these substates are characterised by predicates. On this view the application of an operator will result in some of the objects in the domain moving from one substate to another. In addition to describing the actions in the problem domain, $OCL_h$ provides information on the objects, their sort hierarchy and the permissible states that the objects may be in. Relations and propositions are not fully independent entities – rather they now belong to collections that can be manipulated as a whole. So instead of dealing with literals planning algorithms reason with objects. Similarly to a typed PDDL specification, the objects and the sorts they belong to are predefined, as is the sort of each argument of each predicate in the $OCL_h$ model.
An object description in a planning world is specified by a tuple $(s, i, ss)$, where $s$ is a sort identifier, $i$ is an object identifier of sort $s$, and $ss$ is its *substate*. A substate is a set of predicates which all *describe* $i$. For example, $(nut, nut0,[loose(nut0, hub1)])$ is an object description meaning that nut0 of sort nut is loosely done up on hub1. Or again, $(container, trunk1,[closed(trunk1), locked(trunk1)])$ is an object description meaning that container trunk1 is closed and locked. Only a restricted set of predicates are allowed to describe an object and appear in its substate. Substates operate under a *closed world assumption* local to this restricted set - thus in the last example, the predicate open(trunk1) is false because (a) it is used to describe objects of this sort (b) it does not appear in the substate.
The domain modeller defines the predicates used to describe objects, and the form of each substate, using *substate class definitions*. The predicate expressions in such definitions are constructed to form a complete, disjoint covering of the space of substates for objects of
\(^2\)we use the name ‘sorts’ rather than ‘object classes’ to emphasise that $OCL_h$ is an abstract object-centred modelling language - in contrast to an OO implementation language
each sort. When fully ground, an expression from a substate class definition forms a legal substate. For example, the substate class definitions for the sorts container, nut and hub are\(^3\):
```
substate_classes(container,C,[[closed(C)], [open(C)], [closed(C), locked(C)]] )
substate_classes(nut,N,[loose(N,H)], [tight(N,H), [off_hub(N)]] )
substate_classes(hub,H,[on_ground(H), fastened(H)], [jacked_up(H,J), fastened(H)],
[free(H), jacked_up(H,J), unfastened(H)], [unfastened(H), jacked_up(H,J)] )
```
The first example means that objects of sort container can be either closed, not open and not locked, or open, not closed and not locked, or closed, locked and not open (or here is exclusive). Thus, in OCL
\(_h\) negation is implicit: if it is the case that \(\neg open(trunk1)\), then this means that \(trunk1\) must be in one of two substates, its object description being \((container, trunk1, [closed(trunk1)])\) or \((container, trunk1, [closed(trunk1), locked(trunk1)])\). One can see that the examples of object descriptions given above contain valid substates according to this definition.
A domain model is built up in OCL\(_h\) by creating the operator set at the same time as creating the substate class definitions. We define:
- an **object expression** to be a tuple \((s, i, se)\) such that the expression part \(se\) is a generalisation of one or more substates (\(se\) is normally a set of predicates containing variables).
- an **object transition** to be an expression of the form \((s, i, se \Rightarrow ssc)\) where \(i\) is an object identifier or a variable of sort \(s\), \((s, i, se)\) forms a valid object expression, and \(ssc\) is taken from one of the substate class definitions. Thus when \(ssc\) is ground it will always be a valid substate.
An action in a domain is represented by operator schema \(O\) with an identifier \(O.id\), a prevail condition \(O.prev\), and a list of transitions. Each expression in \(O.prev\) must be true before execution of \(O\), and will remain true throughout operator execution.
Two OCL\(_h\) operators hand-crafted to (loosely) correspond to the PDDL operators above are as follows:
```
operator(loosen(N,H,W),
[ (wrench,W,[have(W)])], (hub,H,[on_ground(H),fastened(H)]) ] ),
[ (nut,N,[tight(N,H)]=>[loose(N,H)]) ] )
operator(fetch(T,C),
[[(container,C,[open(C)])],
[(tool_or_wheel,T,[in(T,C)]=>[have(T)])])
```
As with PDDL, OCL\(_h\) has many other features such as conditional operators, hierarchical operators, atomic and general invariants, but due to lack of space we refer the reader to the literature for these details.
4 Lifting PDDL To OCL\(_h\)
4.1 The general framework
We base the translation on two main assumptions: (1) the input to the translator will be any model written in the subset of PDDL that includes STRIPS-like operators with literals having typed arguments. The feasibility of using other variants of PDDL as input is briefly discussed in section 6 below. (2) the translation should keep, as far as possible, the names and
---
\(^3\) whereas in PDDL we write a variable as an identifier beginning with '?' in OCL\(_h\) variables are identifiers with leading capitals
structure of the input model. This leads us to the following general framework for translation:
PDDL parameter type name $\Rightarrow OCL_h$ sort name
PDDL predicate $\Rightarrow OCL_h$ predicate
PDDL operator name $\Rightarrow OCL_h$ operator name
The first association preserves the type hierarchy and translates it to an equivalent $OCL_h$ sort hierarchy. The consequential allocation of predicates to sorts, however, turns out to be the fundamental problem faced in extracting $OCL_h$ information from PDDL. The requirement to be able to identify all legal states of each primitive sort within the domain entails the identification of a complete set of descriptions that can characterise any object of the sort at any instance in time. Once this is done, re-writing the PDDL operators by extracting the object transitions and the prevail clauses from the raw STRIPS operator is relatively straightforward.
4.2 Inducing Substate Classes
Steps in the $OCL_h$ method that are used to derive substate class definitions are as follows:
1. Identify the sorts that are dynamic and those that are static
2. For each dynamic sort, identify those predicates that are to be included in defining its substate classes
3. For each dynamic sort, define its substate classes
For step 1, a sufficient condition for a sort $s$ to be dynamic is that PDDL type $s$ is described by a property which can be changed by a PDDL operator. Those types that have no changeable properties, but are referred to within a changing relation may or may not be mapped to a dynamic sort – this choice will become clear after our discussion of step 2.
In step 2, a difficult issue arises in that given a predicate $p(s1, s2, \ldots, sn)$, what subset of the $OCL_h$ sorts $s1, s2, \ldots, sn$ should it be associated with, to describe that sorts’ substate classes? In the method associated with $OCL_h$ it is proposed that normally each predicate describe a single sort (although if the sort were not primitive the predicate would be used in distinct primitive sorts). To illustrate this problem consider the PDDL predicate $in$, with two arguments of type $tool$ and $container$ respectively. Both types are mapped over to $OCL_h$ dynamic sorts, and the question arises: should the predicate ”in” be used to describe the state of an object of sort $tool$, the state of an object of sort $container$, or both? Though from a logical point of view there is no more reason to say that the predicate in characterises a tool than there is to say it characterises a container there are strong pragmatic reasons to classify the predicate as belonging to only one of the objects referenced. If we allow predicates to describe all its sorts’ states then there is a clear redundancy in our representation, in that we record the same information twice. More serious than this, allowing a relational predicate to characterise all referenced sorts introduces the frame problem in a particularly acute manner. Recall that the right hand sides of $OCL_h$ transitions must fully characterise the resulting substate of the dynamic object participating in the transition, without default persistence but with a closed world assumption local to the predicates describing that sort. Then to record the possible substates of the $container$ we would have to consider the possible combinations of the container being open, closed and locked along with all possible combinations of objects
such as the tools and wheels being either in or not in the container; this would lead to a proliferation of object transitions and operators.
The discussion above shows that it is not practicable to let a predicate be used in the substate descriptions of objects in every one of its argument sorts. Our solution to this frame problem is to try to follow the intuition in building an OCL$_h$ model manually: let the algorithm choose one single sort. This distinguished sort is said to own the predicate. Though from a logical point of view this may seem arbitrary it coincides with intuition in the sense that we would not naturally think of the action of opening the trunk as having a different result depending on the trunk's contents. In English an action verb is typically thought of as characterising the subject of the sentence rather than the object. In this spirit we say the the predicate in(wrench, trunk) describes the state of the wrench but not that of the trunk.
Given that we will only allow a predicate to characterise a single sort the choice of sort could be made in a number of competing ways. We could try to allocate predicates to sorts in a way to try and minimise the frame problem or to minimise the number of sorts that change state in the actions concerned, or we could simply allocate them to the first mentioned object in each predicate. Up to now our experiments have shown the third strategy gives satisfactory results when the auto-generated OCL$_h$ model has been compared to a hand crafted version.
Returning to step 1, this analysis determines the split of static and dynamic sorts: if some dynamic predicate has the property that its first argument can contain object identifiers of sort $s$, then $s$ is a dynamic sort; otherwise, $s$ will not be described by any dynamic predicates and hence will be static.
### 4.3 Dealing with Negation
Defining substate classes (i.e. step 3) when manually creating an OCL$_h$ model involves finding a set of adequate substate class definitions. The aim is that for any expression in a substate class definition, any instantiation will be a valid substate, and any valid description of an object is an instantiation of some expression in a substate class definition.
These classes can only be induced from the PDDL operators by examining the operator's effects, and, to some extent, using problem examples. For example, from the opening and closing actions, we arrive at the following sketch of the substate classes of container:
- $\neg$ open(container), locked(container)
- $\neg$ open(container), $\neg$ locked(container)
- open(container), $\neg$ locked(container)
- locked(container), $\neg$ open(container)
The fourth possibility open(container), locked(container) is not achievable using the PDDL operator set.
Negation in OCL$_h$ is not represented explicitly, because of the local closed world assumption used in substates. It may be the case, however, that a negative form (or opposite) is required. We deal with this by potentially creating for each predicate a negative form, identified by prepending the predicate with not. Though we start with the availability of all such possible negations, not all are used in the final translation.
5 The Translation
5.1 Description of the Algorithm
To simplify the expression of the algorithm we use abbreviation and the dot notation to access elements of PDDL or OCL Specifications. For example PDDL.actions refers to the actions of the specification, OCLh.sscd[0.sort], refers to the OCLh substate class definition for the sort of object o (page 4) and ot.rhs without further prefix refers to the right hand side predicates of an object transition of an OCLh action. In general we will also equate conjunctions with sets.
```
algorithm toOCL-First-Pass
In Pt : PDDL-types, Pp : PDDL-predicates, Pa : PDDL-actions
Out OCL : OCLh-domain-specification
1. OCL.types := PDDL.types
2. OCL.predicates := PDDL.predicates
3. ∀ a ∈ PDDL.actions
4. oa := new OCL-action
5. Vo ∈ controlling_objects(a.effect)
6. ot := new OCL-state-change-clause
7. ot.rhs = owned_predicates(o,a,effect)
8. ot.lhs = owned_predicates(o,a,precondition)
9. ot.rhs := ot.rhs ∪ {p : ot.lhs | ¬ (p ∈ ot.rhs) ∧ ¬ (¬ p ∈ ot.rhs)}
10. oa.nec := oa.nec ∪ {ot}
11. OCL.sscd[o.sort] := OCL.sscd[o.sort] ∪ {ot.rhs}
12. end_for
13. ∀ o ∈ owning_objects(a.precondition) − owning_objects(a.effect)
14. se := new OCL-state-expression
15. se.exp := owned_predicates(o,precondition)
16. oa.prev := oa.prev ∪ {se}
17. end_for
18. end_for
19. end,
```
Figure 1: First Pass of the PDDL to OCLh Translation Algorithm
The first pass of the translation algorithm deals with the initial identification of object sorts with their PDDL counterparts the argument types. Candidate predicates are similarly identified at this stage (lines 1,2 in Figure 1) Negations are recorded at this stage for predicates if they are used in an action and are not generated automatically for all predicates.
The main part of the algorithm begins with the processing of the PDDL actions (lines 3 - 19). For each PDDL action we create an empty OCLh action (line 4) and identify the variables and types for each owning object (i.e first argument of a predicate) in the actions effect section, and create a object transition (line 6). The right hand side of the transition clause is composed of the conjunction of predicates owned by that object in the PDDL action’s effect (line 7). The lefthand side is composed of the owned predicates in the actions precondition (line 8). For the PDDL fetch action (page 2) there is only a single owning object variable ?x in the effect clause therefore we produce the transition
\[(\text{tool_wheel}, x, [\text{in}(X,C)] \Rightarrow [\text{have}(X), \text{not_in}(X,C)])\]
In cases where a predicate of the owning object appears in the precondition of an operator
but its negation does not appear in the effect then we reason that the predicate must persist and accordingly we add that predicate to the right hand side of the transition (line 9). We now check the recorded `substate class definition` set for the owning object sort and add if not already present the right-hand side of the transition as a new candidate substate (line 11). In the fetch example we add the state `[have(X), not_in(X,C)]` to the substate list of the `tool - wheel` sort. The remaining processing of the action is to identify owning objects referenced in the actions precondition but not the effect. For each such object variable we create a substate expression clause from the conjunction of owned predicates to form part of the resulting `OCLh` operator's `Prevail` section(13-17), which for the `fetch` operator produces the expression:
```
(container, C, [open(C)])
```
To complete the first pass of the algorithm the domain problems given in the PDDL specification are translated. The strategy is similar to that adopted for operators but with the problem initial state forming the basis for identifying more candidate object substate class expressions (this part of the algorithm is not shown in the figure).
### 5.2 Translation Results
The first pass translation results are encouraging in that they are close to those produced by hand translation from the same PDDL source. See samples for the Tyre World and the “Gripper World” in the resources section of the web site in reference [15]. Of the thirteen actions in the Tyre World two of the actions contained anomalies flagged up by the translation. Eight of the translated actions contained unnecessary, though correct, negations on their right hand sides and two actions had incomplete object transitions.
The translation at this stage not only forms a basis for hand completion but also has the power to flag up potential problems and insecurities with the PDDL domain specification. The most interesting of the anomalies uncovered in the Tyre World domain occurs with the `jack-down` action which is translated as follows:
```
(:action jack-down
:parameters (?h - hub)
:precondition (not (on-ground ?h))
:effect (and (on-ground ?h) (have jack)))
goal
[ (hub, H, [not_on_ground(H)] => [on_ground(H)]),
(tool, jack, [null] => [have(jack)]) ]
```
The transition for the `jack` indicates that it may be in any state prior to being possessed as a result of jacking down the wheel. This is not adequate as the mechanic only possesses the jack after execution of the action because it was used to jack-up the wheel in the first place. The PDDL formulation works (operationally) because in the domain there is no alternative way of getting the wheel off the ground (although we might have an alternative jack-up action, such as use a block and tackle).
A second anomaly which arises with the encoding of the `jack-down` action is that we treat `[on_ground(H)]` as a complete substate of the `hub`. From the auto-generated substate class definition for the `hub` we see that either the predicate `fastened(H)` or `unfastened(H)` must also apply to the `hub` and this raises the following question: should it not be the case that we
should make it a precondition of the action that the hub has the wheel fastened to it prior to jacking down the hub? In effect, in $OCL_h$ terms the transition should be
$\langle \text{hub}, \text{H}, [\text{not on ground}(\text{H}), \text{fastened}(\text{H})] \Rightarrow [\text{on ground}(\text{H}), \text{fastened}(\text{H})] \rangle$,
5.3 Work Required to Complete the Translation
The primary issues to be addressed in a second pass of the translation algorithm, still to be fully implemented, are as follows:
Incomplete Object States
As $OCL_h$ requires the right hand side of a transition to completely characterise the resulting state we must inspect each such clause constructed so far to determine if there are missing predicates that in the PDDL representation would simply persist. An extension to the algorithm could identify such omissions after the first pass translation. Consider two candidate substate class expressions $x$ and $y$. If $x$ contained a subset of the predicates of $y$, and the negation of the predicates in $y - x$ cannot be inferred, then it would be reasonable to conclude that $x$ was an incomplete version of $y$.
Implicit agents
A problem with agents of actions being implicit in PDDL domain specifications arises when translating to $OCL_h$. The problem is amply illustrated by the following first pass translation of the move rule from the Gripper domain where we have a robot that can move from a named location to another named location.
operator(move(TO, FROM),
[],
[ (room,TO,[],[at_robb#y(TO)]),
(room,FROM,[at_robb#y(FROM)])=>[not_at_robb#y(FROM)]) ]
The rooms $TO$ and $FROM$ are being classed as dynamic objects subject to change, but we would more naturally want to say that it is the robot that has changed. In $OCL_h$ parlance locations should be treated as static. To solve this problem we need to recode the at_robb#y predicate and introduce an agent i.e. the robot. at(Agent,Location). If the agent has, as in this case been implicitly encoded into the predicate then there will only be one such agent and we can effectively introduce a new constant agent0 and a new type Agent.
Poorly Chosen Argument Ordering
Despite the decision to select the first place argument to denote the owning object of a predicate there are situations where this should be rejected. The problem may arise if the first argument of a relational predicate describes a property of an object referenced in a later position. For example if the wheel status in the Tyre World was encoded in a predicate status(condition,wheel) the translation of the inflate action would contain the following body:
$\langle \text{wheel}, \text{Wheel}, [\text{have}(\text{Wheel})] \\
\langle \text{condition}, \text{intact}, [\text{status}(\text{intact}, \text{Wheel})] \Rightarrow [] \rangle \\
\langle \text{condition}, \text{inflated}, [] \Rightarrow [\text{status}(\text{inflated}, \text{Wheel})] \rangle$
The symmetry of the empty right and left hand clauses is the indicator that we have a malcoded predicate which should be reordered. The result will eliminate the prevail clause and result in the transition
\[
\text{wheel, wheel, [have(wheel), condition(wheel, intact)]} \Rightarrow \\
\text{[have(wheel), condition(wheel, inflated)]}
\]
6 Discussion
It has been acknowledged since the modern inception of AI that the representation of knowledge has a critical bearing on the performance of a problem solver. In planning especially, there have been relatively few insights or research projects in this area - instead the planning literature has tended to concentrate on the efficiency issues of planners, or the adequacy of expression of their domain model languages. We see our ongoing work on the translation from PDDL to OCLh as promoting the debate on the relative merits of planning domain encodings, and, in time, the matching up of appropriate planner technology to application domain.
Working with a domain modelling language such as OCLh gives opportunities for higher level domain validation with rich tool support that eases domain modelling. Our ‘first pass’ translator from PDDL to OCLh has already given us access to a rich source of research examples written in PDDL to test OCLh tools. More importantly, it has highlighted those issues in representation such as use of negation, completeness/security of models, and construction of object hierarchies that are fundamental to the creation of a planning domain model.
6.1 Related Work
The basic strategies of re-casting domain knowledge from a predicate base into an object-centred base are not new and have been discussed in the literature for some period. An early general discussion of the issues is to be found in reference [13]. OCLh contrasts with previous domain modelling languages for planning such as [18, 1] in its simplicity and clarity. On the other hand, OCLh is far less sophisticated (for a comparison of O-Plan’s TF and OCLh see reference [10]).
Fox and Long in reference [6] show that the limitation of requiring arguments to be typed in the PDDL specification is not fundamental to the translation. They demonstrate that type information can be extracted from a set of PDDL operator schema only. Fox and Long’s TIM uses the operator schemae to analyse the domain and produce types such that objects belonging to them are identical up to naming. It therefore appears to produce a type structure more appropriate to OCLh. Our future work will involve merging the translation algorithm with the TIM engine into a tool that should produce a more adequate OCLh model.
References
|
{"Source-Url": "http://eprints.hud.ac.uk/2239/1/trans.pdf", "len_cl100k_base": 6870, "olmocr-version": "0.1.53", "pdf-total-pages": 11, "total-fallback-pages": 0, "total-input-tokens": 73062, "total-output-tokens": 8351, "length": "2e12", "weborganizer": {"__label__adult": 0.00040030479431152344, "__label__art_design": 0.0008478164672851562, "__label__crime_law": 0.0006380081176757812, "__label__education_jobs": 0.0020198822021484375, "__label__entertainment": 0.0001220703125, "__label__fashion_beauty": 0.0002903938293457031, "__label__finance_business": 0.0007457733154296875, "__label__food_dining": 0.0004487037658691406, "__label__games": 0.001247406005859375, "__label__hardware": 0.001216888427734375, "__label__health": 0.0006165504455566406, "__label__history": 0.0005750656127929688, "__label__home_hobbies": 0.00033736228942871094, "__label__industrial": 0.0017805099487304688, "__label__literature": 0.0005884170532226562, "__label__politics": 0.0005125999450683594, "__label__religion": 0.0005445480346679688, "__label__science_tech": 0.371826171875, "__label__social_life": 0.0001798868179321289, "__label__software": 0.021942138671875, "__label__software_dev": 0.58984375, "__label__sports_fitness": 0.0004968643188476562, "__label__transportation": 0.0026092529296875, "__label__travel": 0.00029087066650390625}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 33418, 0.01946]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 33418, 0.64541]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 33418, 0.89565]], "google_gemma-3-12b-it_contains_pii": [[0, 2511, false], [2511, 6030, null], [6030, 9337, null], [9337, 12537, null], [12537, 15978, null], [15978, 19208, null], [19208, 21861, null], [21861, 25077, null], [25077, 28011, null], [28011, 31151, null], [31151, 33418, null]], "google_gemma-3-12b-it_is_public_document": [[0, 2511, true], [2511, 6030, null], [6030, 9337, null], [9337, 12537, null], [12537, 15978, null], [15978, 19208, null], [19208, 21861, null], [21861, 25077, null], [25077, 28011, null], [28011, 31151, null], [31151, 33418, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 33418, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 33418, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 33418, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 33418, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 33418, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 33418, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 33418, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 33418, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 33418, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 33418, null]], "pdf_page_numbers": [[0, 2511, 1], [2511, 6030, 2], [6030, 9337, 3], [9337, 12537, 4], [12537, 15978, 5], [15978, 19208, 6], [19208, 21861, 7], [21861, 25077, 8], [25077, 28011, 9], [28011, 31151, 10], [31151, 33418, 11]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 33418, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-06
|
2024-12-06
|
efa8ae5b7691d45514bb8e8801547d5d94f471a1
|
A New Strategy for Shape Analysis Based on Coexistent Links Sets
A. Tineo, F. Corbera, A. Navarro, R. Asenjo, E.L. Zapata
published in
*Parallel Computing: Current & Future Issues of High-End Computing*,
Proceedings of the International Conference ParCo 2005,
John von Neumann Institute for Computing, Jülich,
© 2006 by John von Neumann Institute for Computing
Permission to make digital or hard copies of portions of this work
for personal or classroom use is granted provided that the copies
are not made or distributed for profit or commercial advantage and
that copies bear this notice and the full citation on the first page. To
copy otherwise requires prior specific permission by the publisher
mentioned above.
http://www.fz-juelich.de/nic-series/volume33
A new Strategy for Shape Analysis based on Coexistent Link Sets *
A. Tineo\textsuperscript{a}, F. Corbera\textsuperscript{a}, A. Navarro\textsuperscript{a}, R. Asenjo\textsuperscript{a}, and E.L. Zapata\textsuperscript{a}
\textsuperscript{a}Dpt. of Computer Architecture, University of Málaga, Complejo Tecnológico, Campus de Teatinos, E-29071. Málaga, Spain. \{tineo,corbera,angeles,asenjo,ezapata\}@ac.uma.es
The analysis of dynamic heap-based data structures is difficult due to the alias problem. Shape analysis tries to gather information conservatively about these structures at compile time. In the context of parallelizing compilers, information about how memory locations are arranged in the heap at runtime is essential for data dependence analysis. With proper shape information we can reveal parallelism for heap-based structures, which are typically ignored by compilers. Existing shape analysis techniques face a dilemma: either they are too costly to be useful for real compilers or they are too imprecise to be useful for real programs. In this work, we present a new strategy for shape analysis based on a compact representation for the shape of data structures. This is done by using Coexistent Link Sets for nodes in a graph. The technique is simple to implement and very precise at the core level. Further precision-vs-cost balance can be tuned with the use of extensible properties.
1. Introduction
Static knowledge of memory references in a program is a must for compilers, if they are to provide optimizations related to parallelism in an automated basis. Such knowledge is not easy to gather due to the existence of aliases. Arrays, pointers and pointer-based dynamic data structures introduce aliases in programs. Parallelizing compilers have obtained a reasonable degree of success when dealing with array aliases and stack-directed pointers. However, heap-directed pointers and the structures they dereference are a whole different ground that still needs significant work.
The problem of characterizing dynamically allocated memory locations in a program can be approached in several ways. We believe that, in order to provide accurate information for real-life programs, some sort of abstraction in the form of a bounded graph must be performed. The kind of analysis that represents the heap as a storage shape graph is known as shape analysis. Its main goal is to capture the shape of memory configurations that are accessible through heap-directed pointers in a program.
Information about the shape of dynamic data structures is useful for parallelizing compiler transformations over the input program. Maybe the most obvious application is data dependence detection, needed for instruction scheduling, data-cache optimization, loop transformation and automatic vectorization and parallelization. Another interesting application comes from the use of the shape information for debugging analysis of the program. The shape abstraction can provide information about incorrect pointer usage that can lead to mistakes difficult to track.
We present in this work a new strategy for shape analysis based on what we call Coexistent Link Sets (CLSs). CLSs codify possibilities of connectivity between memory locations in a
\*This work was supported in part by the Ministry of Education of Spain under contract TIC2003-06623.
neat and compact way. This is done by using graphs that represent the possible states of the memory configuration at a program point. Information is kept as a combination of possible reaching and leaving links over the memory locations. CLSs provide a rich description of the data structure with little storage requirements.
The goal of this paper is to present a new technique to achieve a shape abstraction of dynamic data structures. We think that it will provide more precision than existing techniques while at the same time keeping the storage and computation cost at a reasonable level. CLSs are the key instruments for the development of this technique. The remainder of this paper is organized as follows: Section 2 introduces the basics for our shape analysis technique; Section 3 describes CLSs in greater detail; Section 4 explains our criteria for summarization in graphs; Section 5 describes how the shape analyzer works by example; Section 6 comments some related work; and finally Section 7 concludes with the main contributions and ideas for future work.
2. Shape analysis basics
Our approach to shape analysis is based on graphs. A program dealing with dynamic data structures performs allocation of memory locations and establishes links between them. We represent memory locations in the program as nodes in graphs. Nodes can be referenced by pointer variables through pointer links (PLs). Additionally, selector links (SLs) are used to link nodes with other nodes.
The size of dynamic data structures is undecidable at compile time. Therefore, we must provide some mechanism to sum up the possible memory configurations in a finite, bounded shape graph. To achieve this, we can summon nodes that can actually represent several memory locations that are similar. We call this kind of nodes, summary nodes and the process of merging similar nodes, summarization. Very often, however, some of those locations are accessed later in the program and become so-called singular locations, which are somewhat different to other locations in the structure. It would be desirable to provide a mechanism to invert the summarization process, i.e., we would like to be able to focus over a singular node extracted out of a summary node. This can be achieved with the materialization operation. Depending on the case, we will be able to recover the information as we had it or instead, a conservative and less precise node will be materialized.
In our approach, there is a single graph associated to every statement in the program, which represents the possible memory configuration states at that point in the program. The shape analyzer works as an iterative data-flow analysis, by symbolically executing the statements in the source program, a process called abstract interpretation. For example, pointer statements receive an input graph ($SG_{in}$) and modify it to produce an output graph ($SG_{out}$). The rules for such transformation are determined by the statement abstract semantics.
Our technique only cares about statements that involve operations through pointers (pointer statements) and control flow decisions (loop and branch statements). Fig. 1 sketches out how the analysis operates in the presence of these kind of statements in a general, descriptive way.
In order to simplify the analysis, pointer statements are normalized to simple pointer statements, i.e., those that contain only simple access paths, or 1-level indirection. The simple pointer statements are (in C syntax):
```c
ptr=NULL; ptr=malloc(...); ptr1=ptr2;
ptr1->sel=ptr2; ptr1=ptr2->sel; ptr->sel=NULL;
```
At loop bodies the analysis must iterate over the statements of the loop until the graphs for each statement change no more, i.e., until the analysis achieves a fixed-point. This way we ensure that the graph for each statement holds all possible memory configurations at that point of the program at runtime. When a fixed-point is reached for all statements in the program, the analysis terminates. Termination of the algorithm is assured by the summarization process that automatically occurs whenever nodes are similar. The graphs cannot grow out of control and eventually the graphs will be bounded and stationary.
At join points in the CFG, such as loops and branching statements, incompatible memory configurations occur. An operation to join graphs, (graph union) while conservatively keeping all possibilities is needed. For instance, fig. 2(b) shows the two possible memory configurations (MC1 and MC2) at the end of the program in fig. 2(a). In the next section we will see how these two MCs can be represented in one graph.
3. Coexistent Link Set (CLS)
Our main contribution to shape analysis in this paper is the introduction of Coexistent Link Sets (CLSs). To better help us describe what a CLS is, let us consider an example. Fig. 3 shows the graph that would represent the memory configurations shown in fig. 2.
Let us assume at this point that we need three nodes (n1, n2 and n3) for the graph that captures MC1 and MC2 from fig. 2. In Section 4 we describe in detail why this is so. We could
Figure 3. Shape graph for example of fig. 2. CLSs describe the shape abstraction.
CLSs allow us to express possibilities of connectivity between nodes, i.e., they describe the links that may reach and leave a node in the memory configuration abstraction. In the example of fig. 3, CLS1(n1) is telling us that n1 supports PL1=<anchor,n1> and SL1=<n1,next,n2>. No other combination of links is possible for this node: n1 can only be reached through the pointer anchor and connects undoubtedly to n2 through its next selector. For n2, there are two possibilities. In any of them, PL2=<p,n2> reaches the node (i.e., p points to n2 in any case) and the node is reached from n1 through selector next (SL1). However, n2 can follow to n3 through the next selector or through the down selector, yielding two possibilities of connectivity for this node: CLS1(n2) and CLS2(n2). CLSs for n3 work in a similar way: n3 always supports PL3=<q,n3> and can be reached from n2 by following either SL2 or SL3.
SLs are stand-alone entities in the graph. They represent links between nodes through selectors. However, when used in the context of a CLS, they are complemented with information about the origin and destination nodes. Thus, SLs within CLSs can be: 1) incoming (i), when the SL is a reaching link for the current node; 2) outgoing (o), when the SL is a leaving link for the current node; 3) and cyclic (c), when the SL is at the same time a reaching and leaving link for the current node. In addition, a SL can be regarded as shared, if it can be used more than once to reach the same destination node for a given CLS. In our notation, a SL is not shared unless labelled with (s).
4. Summarization criteria
In the previous example we asked the reader to assume that three nodes were needed for the shape abstraction representation. We now explain the summarization criteria for our shape analysis technique. This criteria determines to a great extent the behavior and precision of the analysis. First, we define a basic, fixed mechanism about what nodes should be kept separate and what nodes could be merged; second, we add configurable properties to fine-tune summarization decisions.
The basic criterion for summarizing nodes dictates that nodes that are pointed by the same (possibly empty) set of pointers are merged together, i.e., if P(n1)=P(n2) then n2 merges into n1. Nodes that are pointed by pointers always remain singular nodes, i.e., they represent only one memory location for a given memory configuration. On the contrary, nodes that are not pointed by pointers will be merged (according to this basic criterion) into a unique summary node, that may be representing more than one actual memory location. This basic idea allows us to achieve precision on the entry points to the data structures, where it is more likely to be needed. This is the criterion applied in fig. 3.
However, merging all locations that are not directly accessed by pointers in a single node
can be very imprecise as soon as the data structures are a little complex, and this is certainly the case for real programs. Node properties can be used to prevent too much summarization in such cases. A compatibility function must be defined for every property. If two nodes are compatible with respect to all available properties and conform to the basic criterion (share the same pointers), then they will be merged. Otherwise they will be kept separate. This way there could be several summary nodes, while in the case of using only the basic criterion, there would be just one summary node for the whole graph.
Properties are configurable, in the sense that they can be turned on and off at will, depending on the requirements of the analysis. It is clear to see that keeping a lot of properties will yield bigger graphs, with more nodes, and this will have an impact in the analysis cost. On the other hand, properties are absolutely needed to carry precision for analysis of complex structures.
In particular, the touch property is a key instrument for data dependence analysis. While CLSs on their own capture spatial or topological information, the touch property is used to capture temporal information. During a typical structure traversal, locations are accessed for reading or writing. From a data dependence analysis point of view, it is of key importance to be able to discriminate, in the course of the traversal, between accessed (we say touched) locations in a structure and locations that have not been yet accessed (untouched). The touch property is annotated in nodes to avoid merging visited nodes with unvisited ones. Other properties can be effortlessly added, to add information about data type, structure connection, allocation site, etc., similarly to [1].
5. Shape analysis operations
In this section we illustrate how the shape analyzer works by example. First, we analyze a program that creates a single-linked list. Due to space limitations we will just focus on certain key aspects that are needed to understand the process. In fig. 4(a) we present the program used to create the list and the first steps of the algorithm.
Input graph is empty. Abstract interpretation of statement S1 produces the creation of node n1 and the corresponding PLs, SLs and CLSs. Notice that the analysis can track uninitialized selectors. This is useful for code correctness checking. Upon entering a loop for the first time (S3 in this example), input graph is preserved. Then, in S4, a new element is created and PLs, SLs and CLSs are updated accordingly. Changes with respect to previous graph appear in bold. Graphs for statements inside a loop are labelled with a superscript showing the number of the symbolic iteration.
Let us now consider an interesting situation that appears later in the analysis. Upon interpreting S5 for the third time (third iteration), we obtain the shape graph shown in fig. 4(b.1). At this point the list can be two (n6 and n3), three (n1, n4 and n3) or four elements (n1, n2, n4 and n3) long. Two nodes exist for the first element of the list to account for incompatible configurations.
After applying the abstract semantics of S6 in fig. 4(b.2), we find that nodes n1-n6 and n2-n4 now meet the summarization basic criterion, i.e., they are pointed by the same (possibly empty) set of pointers (P(n1)=P(n6)={list}, P(n2)=P(n4)={∅}), so they must be merged. For this example we do not consider properties for summarization. The process is completed in fig. 4(b.3), where the shape graph has been normalized to conform to the selected rules of summarization. The normalization process involves five steps: 1) find nodes that meet the current summarization criteria (n1-n6 and n2-n4); 2) substitute all references of the nodes to
Figure 4. (a) Start of analysis of single-linked list; (b) Node summarization in 3 steps.
Figure 5. (a) Memory configuration of shared and non-shared lists; (b) Materialization ex.
be merged by one of them in the lists of PLs and SLs (substitute $n6$ for $n1$ in PL7 and SL7 and substitute $n4$ for $n2$ in SL2, SL3 and SL4); 3) delete repeated PLs and SLs (eliminate PL7 that equals PL1 and SL3 that equals SL1); 4) update nodes, PLs, and SLs in the list of CLSs accordingly (substitute $n6$ for $n1$, $n4$ for $n2$, PL7 for PL1 and SL3 for SL1) and 5) eliminate duplicates in CLSs (CLS2($n1$) that equals CLS1($n1$)) and rename to avoid numbering gaps (CLS3($n1$) becomes CLS2($n1$)).
Node summarization solves the issue of bounding the graphs. Additionally, the graph union operation is used to reconcile different graphs that reach a join point in the CFG. A typical case is the head of a loop, where the graph coming from the last statement in the loop merges with the graph from the previous iteration. Graph union is performed by adding all the information of both graphs into a working graph. This graph is then normalized as described in the summarization operation, so that redundancies are removed. The result is a graph that conservatively captures all possibilities for the memory configurations at that point in the analysis.
Then we need to decide whether to enter the loop again or exit it. This is determined by the fixed-point test. If the result of the last iteration, $SG_{\text{loop}}^{(i)}$, contains the same information than the previous iteration, $SG_{\text{loop}}^{(i-1)}$, then we have reached a fixed-point. In that case, we can leave the loop because we have conservatively registered all possible memory configurations that originate from it. Otherwise, we must keep iterating until the information of the graphs at the head of the loop are equivalent. This state is ensured by the existence of summarization. The graphs cannot grow endlessly nor can we enter a deadlock situation.
Node summarization and graph union are necessary for the analysis to work. However, they only provide ways to merge information. Conversely, the materialization operation separates information, which is the key to achieve precision in shape analysis, as shown in the following example. Fig. 5(a) depicts a memory configuration for three single-linked lists: lists $x$ and $y$ share memory locations from the second element onwards, while the $z$ list is independent. The shape graph that matches this configuration appears in fig. 5(b). It represents all memory locations that are not directly accessed by stack pointers in a summary node ($n4$). CLSs for $n4$ are also shown. They indicate possibilities of connectivity of $n4$ with the rest of the nodes in the graph. In particular, CLS1($n4$) is telling that, when $n4$ is reached from $n1$, it is undoubtedly reached from $n2$ as well, but not from $n3$. On the other hand, CLS2($n4$) is telling that when $n4$ is reached from $n3$, it is not reached from $n1$ or $n2$. Therefore, CLSs are accurately capturing the memory configuration considered for this example. More importantly, since we have all the information about possible connections of links over $n4$, we are able to materialize a new node ($n5$) by traversing the $z$ list ($p=z->nxt$), free of links from $n1$ and $n2$. No other shape analysis that we know of would be able to discard those false links in the materialized node, given such a high level of compression for the summary node. This is achieved with very little storage requirements.
6. Related work
In the past decades pointer analysis has attracted a great deal of attention. A lot of studies have focused on stack-pointer analysis while others, more related to our work, have focused on heap-pointer analysis. Both fields require different techniques of analysis. In the context of heap analysis, some authors have proposed approaches that are based on encoding access-paths in path matrices [3] or limited path expressions [5]. Such approaches do not consider a graph representation of the heap. Other authors ( [4], [2], [6], [7] ) have considered shape
abstraction expressed as graphs, just like us.
Some early shape analysis techniques started with coarse characterization of the shape of the data structures as a matching process with pre-defined shapes, namely tree, DAG (direct acyclic graph) or cycle, like in [3]. In the case of cyclic structures nearly all precision is lost. However, Hwang et al. [5] have achieved some success applying his shape analysis abstraction to dependence detection in programs with cyclic structures traversed in an acyclic fashion.
Sagiv et al. [7] present a graph-based shape analysis framework that sets the foundations for our approach to the shape analysis problem. Their use of abstract interpretation/abstract semantics, along with materialization, were taken in as the basics for the development of our first shape analysis framework [1]. Corbera et. al augmented the analysis precision and introduced the concept of properties in nodes to be able to have separate summary graphs. Later, a powerful loop-carried dependence test was developed over this framework to provide good results for real-life programs that deal with complex pointer-based structures [8]. We propose now a new shape analysis technique based on CLSs that aims to surpass previous works.
7. Conclusions and future work
In this paper we have presented a new strategy for the static analysis of dynamically allocated data structures in pointer-based programs, like those easily found in C or C++. We have presented the key concept of Coexistent Link Sets, that codify in a neat and compact way possibilities of connectivity between memory locations. The sempiternal trade-off between precision and cost, that is so decisive in shape analysis, can be fine-tuned with the help of configurable and extensible properties. We are currently working in a compiler framework that conforms to the CLS description, in order to provide experimental results that can demonstrate the advantages of our approach.
References
|
{"Source-Url": "https://core.ac.uk/download/pdf/35010143.pdf", "len_cl100k_base": 4767, "olmocr-version": "0.1.50", "pdf-total-pages": 9, "total-fallback-pages": 0, "total-input-tokens": 27343, "total-output-tokens": 5676, "length": "2e12", "weborganizer": {"__label__adult": 0.0004756450653076172, "__label__art_design": 0.0004045963287353515, "__label__crime_law": 0.000457763671875, "__label__education_jobs": 0.00036525726318359375, "__label__entertainment": 7.808208465576172e-05, "__label__fashion_beauty": 0.00020778179168701172, "__label__finance_business": 0.0002034902572631836, "__label__food_dining": 0.0004818439483642578, "__label__games": 0.0006213188171386719, "__label__hardware": 0.00201416015625, "__label__health": 0.0009064674377441406, "__label__history": 0.0003235340118408203, "__label__home_hobbies": 0.00011307001113891602, "__label__industrial": 0.0005593299865722656, "__label__literature": 0.0002853870391845703, "__label__politics": 0.00039505958557128906, "__label__religion": 0.0006694793701171875, "__label__science_tech": 0.044525146484375, "__label__social_life": 8.660554885864258e-05, "__label__software": 0.00469970703125, "__label__software_dev": 0.9404296875, "__label__sports_fitness": 0.0004467964172363281, "__label__transportation": 0.0007877349853515625, "__label__travel": 0.0002703666687011719}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 23771, 0.02425]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 23771, 0.46402]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 23771, 0.91477]], "google_gemma-3-12b-it_contains_pii": [[0, 909, false], [909, 4266, null], [4266, 7874, null], [7874, 9386, null], [9386, 12365, null], [12365, 16145, null], [16145, 16327, null], [16327, 20303, null], [20303, 23771, null]], "google_gemma-3-12b-it_is_public_document": [[0, 909, true], [909, 4266, null], [4266, 7874, null], [7874, 9386, null], [9386, 12365, null], [12365, 16145, null], [16145, 16327, null], [16327, 20303, null], [20303, 23771, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 23771, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 23771, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 23771, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 23771, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 23771, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 23771, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 23771, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 23771, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 23771, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 23771, null]], "pdf_page_numbers": [[0, 909, 1], [909, 4266, 2], [4266, 7874, 3], [7874, 9386, 4], [9386, 12365, 5], [12365, 16145, 6], [16145, 16327, 7], [16327, 20303, 8], [20303, 23771, 9]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 23771, 0.0]]}
|
olmocr_science_pdfs
|
2024-11-30
|
2024-11-30
|
e23ca9a8aef7697822234540fb57ef8413949fe3
|
Internet Message Access Protocol (IMAP) CATENATE Extension
Status of This Memo
This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited.
Copyright Notice
Copyright (C) The Internet Society (2006).
Abstract
The CATENATE extension to the Internet Message Access Protocol (IMAP) extends the APPEND command to allow clients to create messages on the IMAP server that may contain a combination of new data along with parts of (or entire) messages already on the server. Using this extension, the client can catenate parts of an already existing message onto a new message without having to first download the data and then upload it back to the server.
1. Introduction
The CATENATE extension to the Internet Message Access Protocol (IMAP) [1] allows the client to create a message on the server that can include the text of messages (or parts of messages) that already exist on the server without having to FETCH them and APPEND them back to the server. The CATENATE extension extends the APPEND command so that, instead of a single message literal, the command can take as arguments any combination of message literals (as described in IMAP [1]) and message URLs (as described in the IMAP URL Scheme [2] specification). The server takes all the pieces and catenates them into the output message. The CATENATE extension can also coexist with the MULTIAPPEND extension [3] to APPEND multiple messages in a single command.
There are some obvious uses for the CATENATE extension. The motivating use case was to provide a way for a resource-constrained client to compose a message for subsequent submission that contains data that already exists in that client’s IMAP store. Because the client does not have to download and re-upload potentially large message parts, bandwidth and processing limitations do not have as much impact. In addition, since the client can create a message in its own IMAP store, the command also addresses the desire of the client to archive a copy of a sent message without having to upload the message twice. (Mechanisms for sending the message are outside the scope of this document.)
The extended APPEND command can also be used to copy parts of a message to another mailbox for archival purposes while getting rid of undesired parts. In environments where server storage is limited, a client could get rid of large message parts by copying over only the necessary parts and then deleting the original message. The mechanism could also be used to add data to a message (such as prepending message header fields) or to include other data by making a copy of the original and catenating the new data.
2. The CATENATE Capability
A server that supports this extension returns "CATENATE" as one of the responses to the CAPABILITY command.
3. The APPEND Command
Arguments: mailbox name
(The following can be repeated in the presence of the
MULTIAPPEND extension [3])
OPTIONAL flag parenthesized list
OPTIONAL date/time string
a single message literal or one or more message parts to
catenate, specified as:
message literal
or
message (or message part) URL
Responses: OPTIONAL NO responses: BADURL, TOOBIG
Result: OK - append completed
NO - append error: can’t append to that mailbox, error
in flags or date/time or message text, or can’t
fetch that data
BAD - command unknown or arguments invalid
The APPEND command concatenates all the message parts and appends
them as a new message to the end of the specified mailbox. The
parenthesized flag list and date/time string set the flags and the
internal date, respectively, as described in IMAP [1]. The
subsequent command parameters specify the message parts that are
appended sequentially to the output message.
If the original form of APPEND is used, a message literal follows the
optional flag list and date/time string, which is appended as
described in IMAP [1]. If the extended form is used, "CATENATE" and
a parenthesized list of message literals and message URLs follows,
each of which is appended to the new message. If a message literal
is specified (indicated by "TEXT"), the octets following the count
are appended. If a message URL is specified (indicated by "URL"),
the octets of the body part pointed to by that URL are appended, as
if the literal returned in a FETCH BODY response were put in place of
the message part specifier. The APPEND command does not cause the\n\Seen flag to be set for any catenated body part. The APPEND command
does not change the selected mailbox.
In the extended APPEND command, the string following "URL" is an IMAP
URL [2] and is interpreted according to the rules of [2]. The
present document only describes the behavior of the command using
IMAP URLs that refer to specific messages or message parts on the
current IMAP server from the current authenticated IMAP session.
Because of that, only relative IMAP message or message part URLs
(i.e., those having no scheme or <iserver>) are used. The base URL
for evaluating the relative URL is considered "imap://user@server/", where "user" is the user name of the currently authenticated user and "server" is the domain name of the current server. When in the selected state, the base URL is considered "imap://user@server/mailbox", where "mailbox" is the encoded name of the currently selected mailbox. Additionally, since the APPEND command is valid in the authenticated state of an IMAP session, no further LOGIN or AUTHENTICATE command is performed for URLs specified in the extended APPEND command.
Note: Use of an absolute IMAP URL or any URL that refers to anything other than a message or message part from the current authenticated IMAP session is outside the scope of this document and would require an extension to this specification, and a server implementing only this specification would return NO to such a request.
The client is responsible for making sure that the catenated message is in the format of an Internet Message Format (RFC 2822) [4] or Multipurpose Internet Mail Extension (MIME) [5] message. In particular, when a URL is catenated, the server copies octets, unchanged, from the indicated message or message part to the catenated message. It does no data conversion (e.g., MIME transfer encodings) nor any verification that the data is appropriate for the MIME part of the message into which it is inserted. The client is also responsible for inserting appropriate MIME boundaries between body parts, and writing MIME Content-Type and Content-Transfer-Encoding lines as needed in the appropriate places.
Responses behave just as the original APPEND command described in IMAP [1]. If the server implements the IMAP UIDPLUS extension [6], it will also return an APPENDUID response code in the tagged OK response. Two response codes are provided in Section 4 that can be used in the tagged NO response if the APPEND command fails.
4. Response Codes
When a APPEND command fails, it may return a response code that describes a reason for the failure.
4.1. BADURL Response
The BADURL response code is returned if the APPEND fails to process one of the specified URLs. Possible reasons for this are bad URL syntax, unrecognized URL schema, invalid message UID, or invalid body part. The BADURL response code contains the first URL specified as a parameter to the APPEND command that has caused the operation to fail.
4.2. TOOBIG Response
The TOOBIG response code is returned if the resulting message will exceed the 4-GB IMAP message limit. This might happen, for example, if the client specifies 3 URLs for 2-GB messages. Note that even if the server doesn’t return TOOBIG, it still has to be defensive against misbehaving or malicious clients that try to construct a message over the 4-GB limit. The server may also wish to return the TOOBIG response code if the resulting message exceeds a server-specific message size limit.
5. Formal Syntax
The following syntax specification uses the Augmented Backus-Naur Form (ABNF) [7] notation. Elements not defined here can be found in the formal syntax of the ABNF [7], IMAP [1], and IMAP ABNF extensions [8] specifications. Note that capability and resp-text-code are extended from the IMAP [1] specification and append-data is extended from the IMAP ABNF extensions [8] specification.
append-data =/ "CATENATE" SP "(" cat-part *(SP cat-part) ")"
cat-part = text-literal / url
text-literal = "TEXT" SP literal
url = "URL" SP astring
resp-text-code =/ toobig-response-code / badurl-response-code
toobig-response-code = "TOOBIG"
badurl-response-code = "BADURL" SP url-resp-text
url-resp-text = 1*(%x01-09 /
%x0B-0C /
%x0E-5B /
%x5D-FE) ; Any TEXT-CHAR except ")"
capability =/ "CATENATE"
The astring in the definition of url and the url-resp-text in the definition of badurl-response-code each contain an imapurl as defined by [2].
6. Acknowledgements
Thanks to the members of the LEMONADE working group for their input. Special thanks to Alexey Melnikov for the examples.
7. Security Considerations
The CATENATE extension does not raise any security considerations that are not present for the base protocol or in the use of IMAP URLs, and these issues are discussed in the IMAP [1] and IMAP URL [2] documents.
8. IANA Considerations
IMAP4 capabilities are registered by publishing a standards track or IESG approved experimental RFC. The registry is currently located at <http://www.iana.org/assignments/imap4-capabilities>. This document defines the CATENATE IMAP capability. The IANA has added this capability to the registry.
Appendix A. Examples
Lines not starting with "C: " or "S: " are continuations of the previous lines.
The original message in examples 1 and 2 below (UID = 20) has the following structure:
multipart/mixed MIME message with two body parts:
1. text/plain
2. application/x-zip-compressed
Example 1: The following example demonstrates how a CATENATE client can replace an attachment in a draft message, without the need to download it to the client and upload it back.
C: A003 APPEND Drafts (\Seen \Draft $MDNSent) CATENATE
(URL "/Drafts;UIDVALIDITY=385759045;/UID=20;/section=HEADER"
TEXT {42})
S: + Ready for literal data
C:
C: --------------030308070208000400050907
C: URL "/Drafts;UIDVALIDITY=385759045;/UID=20;/section=1" TEXT {42}
S: + Ready for literal data
C:
C: --------------------------030308070208000400050907
C: URL "/Drafts;UIDVALIDITY=385759045;/UID=30" TEXT {44}
S: + Ready for literal data
C:
C: --------------------------030308070208000400050907--
C: )
S: A003 OK catenate append completed
Example 2: The following example demonstrates how the CATENATE extension can be used to replace edited text in a draft message, as well as header fields for the top level message part (e.g., Subject has changed). The previous version of the draft is marked as \Deleted. Note that the server also supports the UIDPLUS extension, so the APPENDUID response code is returned in the successful OK response to the APPEND command.
C: A003 APPEND Drafts (\Seen \Draft $MDNSent) CATENATE (TEXT {738})
S: + Ready for literal data
C: Return-Path: <bar@example.org>
C: Received: from [127.0.0.2]
C: by rufus.example.org via TCP (internal) with ESMTPA;
C: Thu, 11 Nov 2004 16:57:07 +0000
C: Message-ID: <419399E1.6000505@example.org>
C: Date: Thu, 12 Nov 2004 16:57:05 +0000
C: From: Bob Ar <bar@example.org>
C: X-Accept-Language: en-us, en
C: MIME-Version: 1.0
C: To: foo@example.net
C: Subject: About our holiday trip
C: Content-Type: multipart/mixed;
C: boundary="-------------030308070208000400050907"
C:
C: -------------030308070208000400050907
C: Content-Type: text/plain; charset=us-ascii; format=flowed
C: Content-Transfer-Encoding: 7bit
C:
C: Our travel agent has sent the updated schedule.
C:
C: Cheers,
C: Bob
C: -------------030308070208000400050907
C: URL "/Drafts;UIDVALIDITY=385759045;UID=20;/;Section=2.MIME"
URL "/Drafts;UIDVALIDITY=385759045;UID=20;/;Section=2" TEXT {44}
S: + Ready for literal data
C:
C: -------------030308070208000400050907--
C: )
S: A003 OK [APPENDUID 385759045 45] append Completed
C: A004 UID STORE 20 +FLAGS.SILENT (\Deleted)
S: A004 OK STORE completed
Example 3: The following example demonstrates how the CATENATE extension can be used to strip attachments. Below, a PowerPoint attachment was replaced by a small text part explaining that the attachment was stripped.
C: A003 APPEND Drafts (\Seen \Draft $MDNSent) CATENATE
(URL "/Drafts;UIDVALIDITY=385759045;/UID=21;/section=HEADER"
TEXT {42}
S: + Ready for literal data
C:
C: --------------030308070208000400050903
C: URL "/Drafts;UIDVALIDITY=385759045;/UID=21;/section=1.MIME"
URL "/Drafts;UIDVALIDITY=385759045;/UID=21;/section=1" TEXT {255}
S: + Ready for literal data
C:
C: --------------030308070208000400050903
C: Content-type: text/plain; charset="us-ascii"
C: Content-transfer-encoding: 7bit
C:
C: This body part contained a Power Point presentation that was
C: deleted upon your request.
C: --------------030308070208000400050903--
C: )
S: A003 OK append Completed
Example 4: The following example demonstrates a failed APPEND command. The server returns the BADURL response code to indicate that one of the provided URLs is invalid. This example also demonstrates how the CATENATE extension can be used to construct a digest of several messages.
C: A003 APPEND Sent (\Seen $MDNSent) CATENATE (TEXT {541})
S: + Ready for literal data
C: Return-Path: <foo@example.org>
C: Received: from [127.0.0.2]
C: by rufus.example.org via TCP (internal) with ESMTPA;
C: Thu, 11 Nov 2004 16:57:07 +0000
C: Message-ID: <419399E1.6000505@example.org>
C: Date: Thu, 21 Nov 2004 16:57:05 +0000
C: From: Farren Oo <foo@example.org>
C: X-Accept-Language: en-us, en
C: MIME-Version: 1.0
C: To: bar@example.org
C: Subject: Digest of the mailing list for today
C: Content-Type: multipart/digest;
C: boundary="--------------030308070208000400050904"
C:
C: --------------030308070208000400050904
C: URL "/INBOX;UIDVALIDITY=785799047;/UID=11467" TEXT {42}
S: + Ready for literal data
C:
C: --------------030308070208000400050904
C: URL "/INBOX;UIDVALIDITY=785799047;/UID=113330;/section=1.5.9"
C: TEXT {42}
S: + Ready for literal data
C:
C: --------------030308070208000400050904
C: URL "/INBOX;UIDVALIDITY=785799047;/UID=11916" TEXT {44}
S: + Ready for literal data
C:
C: --------------030308070208000400050904--
C: )
S: A003 NO [BADURL "/INBOX;UIDVALIDITY=785799047;/UID=113330;
C: section=1.5.9"] CATENATE append has failed, one message expunged
Note that the server could have validated the URLs as they were received and therefore could have returned the tagged NO response with BADURL response-code in place of any continuation request after the URL was received.
9. Normative References
Author’s Address
Peter W. Resnick
QUALCOMM Incorporated
5775 Morehouse Drive
San Diego, CA 92121-1714
US
Phone: +1 858 651 4478
EMail: presnick@qualcomm.com
URI: http://www.qualcomm.com/~presnick/
Full Copyright Statement
Copyright (C) The Internet Society (2006).
This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights.
This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Intellectual Property
The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79.
Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr.
The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org.
Acknowledgement
Funding for the RFC Editor function is provided by the IETF Administrative Support Activity (IASA).
|
{"Source-Url": "http://svn.tools.ietf.org/pdf/rfc4469.pdf", "len_cl100k_base": 4217, "olmocr-version": "0.1.50", "pdf-total-pages": 13, "total-fallback-pages": 0, "total-input-tokens": 23620, "total-output-tokens": 5591, "length": "2e12", "weborganizer": {"__label__adult": 0.00032019615173339844, "__label__art_design": 0.0003590583801269531, "__label__crime_law": 0.0008358955383300781, "__label__education_jobs": 0.0004734992980957031, "__label__entertainment": 0.00020444393157958984, "__label__fashion_beauty": 0.00015938282012939453, "__label__finance_business": 0.0006732940673828125, "__label__food_dining": 0.000308990478515625, "__label__games": 0.0005731582641601562, "__label__hardware": 0.003482818603515625, "__label__health": 0.0003268718719482422, "__label__history": 0.00037932395935058594, "__label__home_hobbies": 6.67572021484375e-05, "__label__industrial": 0.0004906654357910156, "__label__literature": 0.0003964900970458984, "__label__politics": 0.000392913818359375, "__label__religion": 0.0005359649658203125, "__label__science_tech": 0.0994873046875, "__label__social_life": 0.0001150369644165039, "__label__software": 0.1986083984375, "__label__software_dev": 0.6904296875, "__label__sports_fitness": 0.00028705596923828125, "__label__transportation": 0.000545501708984375, "__label__travel": 0.000263214111328125}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 17934, 0.08482]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 17934, 0.25674]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 17934, 0.79236]], "google_gemma-3-12b-it_contains_pii": [[0, 932, false], [932, 3045, null], [3045, 5213, null], [5213, 7601, null], [7601, 9087, null], [9087, 9791, null], [9791, 10806, null], [10806, 12391, null], [12391, 13277, null], [13277, 14958, null], [14958, 15765, null], [15765, 15966, null], [15966, 17934, null]], "google_gemma-3-12b-it_is_public_document": [[0, 932, true], [932, 3045, null], [3045, 5213, null], [5213, 7601, null], [7601, 9087, null], [9087, 9791, null], [9791, 10806, null], [10806, 12391, null], [12391, 13277, null], [13277, 14958, null], [14958, 15765, null], [15765, 15966, null], [15966, 17934, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 17934, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 17934, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 17934, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 17934, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 17934, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 17934, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 17934, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 17934, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 17934, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 17934, null]], "pdf_page_numbers": [[0, 932, 1], [932, 3045, 2], [3045, 5213, 3], [5213, 7601, 4], [7601, 9087, 5], [9087, 9791, 6], [9791, 10806, 7], [10806, 12391, 8], [12391, 13277, 9], [13277, 14958, 10], [14958, 15765, 11], [15765, 15966, 12], [15966, 17934, 13]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 17934, 0.0]]}
|
olmocr_science_pdfs
|
2024-11-30
|
2024-11-30
|
a480a4c6f2f3f196e57e7f2ddd715b7d774907d6
|
[REMOVED]
|
{"Source-Url": "https://iris.unito.it/retrieve/handle/2318/1659344/409520/autodasp.pdf", "len_cl100k_base": 5809, "olmocr-version": "0.1.53", "pdf-total-pages": 12, "total-fallback-pages": 0, "total-input-tokens": 28960, "total-output-tokens": 7767, "length": "2e12", "weborganizer": {"__label__adult": 0.0003237724304199219, "__label__art_design": 0.00032711029052734375, "__label__crime_law": 0.0003268718719482422, "__label__education_jobs": 0.00034880638122558594, "__label__entertainment": 7.772445678710938e-05, "__label__fashion_beauty": 0.00013577938079833984, "__label__finance_business": 0.0002963542938232422, "__label__food_dining": 0.0003674030303955078, "__label__games": 0.0005030632019042969, "__label__hardware": 0.0011262893676757812, "__label__health": 0.0004825592041015625, "__label__history": 0.00023257732391357425, "__label__home_hobbies": 8.404254913330078e-05, "__label__industrial": 0.0004515647888183594, "__label__literature": 0.0001914501190185547, "__label__politics": 0.0002772808074951172, "__label__religion": 0.0004172325134277344, "__label__science_tech": 0.0423583984375, "__label__social_life": 7.957220077514648e-05, "__label__software": 0.0087738037109375, "__label__software_dev": 0.94189453125, "__label__sports_fitness": 0.00027823448181152344, "__label__transportation": 0.00046944618225097656, "__label__travel": 0.00019788742065429688}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 30313, 0.03029]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 30313, 0.49897]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 30313, 0.87169]], "google_gemma-3-12b-it_contains_pii": [[0, 2451, false], [2451, 5519, null], [5519, 8862, null], [8862, 11494, null], [11494, 13511, null], [13511, 16316, null], [16316, 19549, null], [19549, 21366, null], [21366, 24070, null], [24070, 26559, null], [26559, 30058, null], [30058, 30313, null]], "google_gemma-3-12b-it_is_public_document": [[0, 2451, true], [2451, 5519, null], [5519, 8862, null], [8862, 11494, null], [11494, 13511, null], [13511, 16316, null], [16316, 19549, null], [19549, 21366, null], [21366, 24070, null], [24070, 26559, null], [26559, 30058, null], [30058, 30313, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 30313, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 30313, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 30313, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 30313, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 30313, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 30313, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 30313, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 30313, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 30313, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 30313, null]], "pdf_page_numbers": [[0, 2451, 1], [2451, 5519, 2], [5519, 8862, 3], [8862, 11494, 4], [11494, 13511, 5], [13511, 16316, 6], [16316, 19549, 7], [19549, 21366, 8], [21366, 24070, 9], [24070, 26559, 10], [26559, 30058, 11], [30058, 30313, 12]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 30313, 0.04132]]}
|
olmocr_science_pdfs
|
2024-12-08
|
2024-12-08
|
278087e349907633c4de18639d6133d346984bf2
|
[REMOVED]
|
{"Source-Url": "http://doras.dcu.ie/21432/1/Author_Copy.pdf", "len_cl100k_base": 6907, "olmocr-version": "0.1.49", "pdf-total-pages": 14, "total-fallback-pages": 0, "total-input-tokens": 50842, "total-output-tokens": 9411, "length": "2e12", "weborganizer": {"__label__adult": 0.001003265380859375, "__label__art_design": 0.0012454986572265625, "__label__crime_law": 0.001056671142578125, "__label__education_jobs": 0.052398681640625, "__label__entertainment": 0.0003933906555175781, "__label__fashion_beauty": 0.00054931640625, "__label__finance_business": 0.0013818740844726562, "__label__food_dining": 0.0010728836059570312, "__label__games": 0.01824951171875, "__label__hardware": 0.0012140274047851562, "__label__health": 0.0009746551513671876, "__label__history": 0.000850677490234375, "__label__home_hobbies": 0.0002758502960205078, "__label__industrial": 0.000950336456298828, "__label__literature": 0.0013294219970703125, "__label__politics": 0.0006580352783203125, "__label__religion": 0.0011339187622070312, "__label__science_tech": 0.0301971435546875, "__label__social_life": 0.000385284423828125, "__label__software": 0.0130767822265625, "__label__software_dev": 0.86865234375, "__label__sports_fitness": 0.0011453628540039062, "__label__transportation": 0.001049041748046875, "__label__travel": 0.0005345344543457031}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 37126, 0.05033]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 37126, 0.33713]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 37126, 0.93021]], "google_gemma-3-12b-it_contains_pii": [[0, 2050, false], [2050, 5465, null], [5465, 8981, null], [8981, 12108, null], [12108, 14975, null], [14975, 15407, null], [15407, 17098, null], [17098, 20555, null], [20555, 22629, null], [22629, 26426, null], [26426, 29807, null], [29807, 32996, null], [32996, 36525, null], [36525, 37126, null]], "google_gemma-3-12b-it_is_public_document": [[0, 2050, true], [2050, 5465, null], [5465, 8981, null], [8981, 12108, null], [12108, 14975, null], [14975, 15407, null], [15407, 17098, null], [17098, 20555, null], [20555, 22629, null], [22629, 26426, null], [26426, 29807, null], [29807, 32996, null], [32996, 36525, null], [36525, 37126, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 37126, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 37126, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 37126, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 37126, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 37126, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 37126, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 37126, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 37126, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 37126, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 37126, null]], "pdf_page_numbers": [[0, 2050, 1], [2050, 5465, 2], [5465, 8981, 3], [8981, 12108, 4], [12108, 14975, 5], [14975, 15407, 6], [15407, 17098, 7], [17098, 20555, 8], [20555, 22629, 9], [22629, 26426, 10], [26426, 29807, 11], [29807, 32996, 12], [32996, 36525, 13], [36525, 37126, 14]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 37126, 0.21127]]}
|
olmocr_science_pdfs
|
2024-11-24
|
2024-11-24
|
0499b0355b2380028a98d8f091a405079494955d
|
[REMOVED]
|
{"len_cl100k_base": 5236, "olmocr-version": "0.1.53", "pdf-total-pages": 9, "total-fallback-pages": 0, "total-input-tokens": 23509, "total-output-tokens": 5440, "length": "2e12", "weborganizer": {"__label__adult": 0.0008444786071777344, "__label__art_design": 0.009368896484375, "__label__crime_law": 0.0007762908935546875, "__label__education_jobs": 0.0232696533203125, "__label__entertainment": 0.0005621910095214844, "__label__fashion_beauty": 0.000675201416015625, "__label__finance_business": 0.00044798851013183594, "__label__food_dining": 0.0008344650268554688, "__label__games": 0.0021877288818359375, "__label__hardware": 0.0027484893798828125, "__label__health": 0.001041412353515625, "__label__history": 0.002407073974609375, "__label__home_hobbies": 0.00018739700317382812, "__label__industrial": 0.0008258819580078125, "__label__literature": 0.02581787109375, "__label__politics": 0.0007758140563964844, "__label__religion": 0.005786895751953125, "__label__science_tech": 0.191162109375, "__label__social_life": 0.0003161430358886719, "__label__software": 0.13037109375, "__label__software_dev": 0.59814453125, "__label__sports_fitness": 0.0006222724914550781, "__label__transportation": 0.0006709098815917969, "__label__travel": 0.0004241466522216797}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 17867, 0.01836]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 17867, 0.41933]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 17867, 0.89982]], "google_gemma-3-12b-it_contains_pii": [[0, 1978, false], [1978, 2973, null], [2973, 6271, null], [6271, 8218, null], [8218, 9463, null], [9463, 11663, null], [11663, 14478, null], [14478, 17274, null], [17274, 17867, null]], "google_gemma-3-12b-it_is_public_document": [[0, 1978, true], [1978, 2973, null], [2973, 6271, null], [6271, 8218, null], [8218, 9463, null], [9463, 11663, null], [11663, 14478, null], [14478, 17274, null], [17274, 17867, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 17867, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 17867, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 17867, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 17867, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 17867, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 17867, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 17867, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 17867, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 17867, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 17867, null]], "pdf_page_numbers": [[0, 1978, 1], [1978, 2973, 2], [2973, 6271, 3], [6271, 8218, 4], [8218, 9463, 5], [9463, 11663, 6], [11663, 14478, 7], [14478, 17274, 8], [17274, 17867, 9]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 17867, 0.21311]]}
|
olmocr_science_pdfs
|
2024-12-11
|
2024-12-11
|
945d6ce6373387e490d71582c590bd3ced94e6b0
|
VisualGraph – A Graph Class Designed for Both Undergraduate Students and Educators
Jeff Lucas
U Wis. Oshkosh, USA
lucasj13@uwosh.edu
Thomas L. Naps
U Wis. Oshkosh, USA
naps@uwosh.edu
Guido Rößling
Darmstadt U Techn., Germany
roessling@acm.org
Abstract
Graphs and graph algorithms play an important role in undergraduate data structures and algorithms courses. However, they often also represent the first case where both the correctness and the underlying concepts of the algorithms are not evident. Both students and educators can therefore benefit from a simple yet expressive tool for coding graph algorithms and then conveniently visualizing them. We present such a tool, derived from a set of instructional requirements, and give an example application.
Categories & Subject Descriptors
K.3.2 Computers & Education: Computer & Information Science Education - Computer Science Education
General Terms
Algorithms
Keywords
Visualization, Animation, Pedagogy, CS 1, Graphs
1 Introduction
Graphs and graph algorithms are one of the more advanced topics typically covered in an undergraduate course on data structures and algorithms. Early in such a course, students will have been exposed to programming with pointers and recursion, usually by coding lists and trees. Thus, the focus of teaching graph algorithms often lies less on learning new programming techniques than on solving given problems.
The additional challenge of graph algorithms is that the typical algorithms are based on concepts that are deeper than students have previously studied. Even subtle aspects of advanced algorithms that students have encountered before – such as Quicksort partitioning – usually have a concept which can be explained within one or two sentences and is still relatively easy to understand. However, this is not true for many graph algorithms. Indeed, graph algorithms may be the first type of algorithms encountered by students that is not “obviously correct”. Consider for example the order of the loops for Floyd’s all-pairs shortest path algorithm, where the outer loop concerns the intermediate path vertex rather than the starting vertex.
Programming assignments that accompany the graph component of the course should allow the students to focus their energies upon understanding the more conceptual techniques rather than struggling with low-level implementation details of a graph data type. Typically, such an implementation is carried out using adjacency lists or adjacency matrices, neither of which will expose the student to anything substantially new from a coding perspective. Nor should the student have to climb an exceedingly complicated learning curve to understand the interface for a graph class library that is oriented to industrial-strength applications. Certainly such libraries have their place in courses that want to emphasize rigorous software engineering methodologies. But, in the course goals emphasized here, having students struggle more than necessary with a class interface only detracts their attention from the problem-solving and analysis techniques upon which they should be focusing.
Based on these premises, Section 2 presents a detailed breakdown of the requirements for the “ideal” graph class library to use in an undergraduate algorithms and data structure course. A set of existing libraries and software packages is evaluated in Section 3. As the regarded packages did not fully match our requirements, we present our own class library in Section 4. Section 5 illustrates how easy using the class library is for students and educators. Finally, Section 6 outlines future directions for research and development.
2 Requirements for an Educational Graph Library
2.1 Student Requirements
Basic graph operations
These operations let students implement a wide variety of graph algorithms using operations analogous to what they would find in textbook-style pseudo-code.
Set/query global graph attributes. Users should be able to set and then query two global graph attributes – directedness and weightedness. In a directed graph all edges are directed. Thus, a bidirectional edge is really two edges – one in each direction. If the graph is weighted, all edges must have a numerical weight.
Graph-editing operations. Four graph-changing operations are essential for all graphs – add or remove a vertex, and
add or remove an edge. For weighted graphs, users must also be able to set the weight of an edge to a particular value.
**Vertex- and edge-querying operations.** Users require an operation that, given two vertices, returns a boolean indicating whether or not an edge exists from one to the other. For weighted graphs, students must also be able to query the weight of an edge. Our focus on making it easy for undergraduates to code algorithms means that the vertex data type can be a simple enumeration such as characters.
**Graph generation operations**
Once a student has implemented the algorithm, inputting data to both test and experiment with the algorithm is vital. As graphs are a visually oriented data structure, requiring students to input a graph in textual fashion is counter-intuitive and awkward. We propose three basic modes for graph generation.
**Interactive input.** When called, this operation pops up a simple GUI that allows students to establish the two global graph attributes established above (directed/undirected and weighted/unweighted) and then point-and-click their way through the entry of vertices and edges. Because data in vertices are characters, vertices are automatically labeled with the next available character when the student picks a location for the vertex.
**Random graph generation.** Even with interactive input based on a GUI, entering a graph suitable for a particular problem can be time-consuming. It is therefore advantageous if the graph library itself can also generate random graphs that can then be used to test student-written algorithms. Of course, such generation cannot be completely random but must be subject to constraints determined by the problem being solved. Among these constraints are three shared by all graphs—weighted/unweighted, directed/undirected, and number of vertices or edges. Four additional constraints are then related to the specific type of graph to be generated—connected graphs, directed acyclic graphs, graphs with Hamiltonian cycles, and complete graphs.
**Input from and output to a file.** Once generated using random constraints or via the GUI, the graph must be writable to a file format that can later be read. This allows both students and educators to conveniently build up a suite of graphs to use as test data for a particular algorithm and to compare two algorithms solving the same problem on identical data sets.
**Graph animation operations**
Because graph algorithms are inherently visual in nature, it is natural for students to want to view the output of their work as an animation of the algorithm they have implemented. Recent research [1, 10] indicates that the most effective instructional use of algorithm animation may occur when students are responsible for developing code that produces the animation. There should be two modes that enable students to create their own animated algorithms. The first of these should make it nearly effortless to produce an “unadorned” animation in which no use of color or highlighting is used to explain the executing algorithm. In this unadorned mode, the graph class should produce a picture of the current state of the graph each time a “print graph” operation is called.
Creating an unadorned animation should thus be as easy for the student as the process of inserting tracer output to debug a program. The student merely needs to identify key points in the execution of the algorithm and add a call to the “print graph” operation. This operation is a sophisticated one from the perspective of the implementor of the class. This is because the resulting visual display of the graph must be laid out in an aesthetically pleasing way that minimizes unnecessary edge crossings and effectively displays the edge weights for a weighted graph. We discuss some of the details of the layout algorithm used by the VisualGraph class in Section 4.
At a level above that of an unadorned animation, we might want to ask students to develop a more visually effective animation that could become part of a larger project for a course. Here the graph class should provide a set of visually oriented operations that again make it relatively painless to produce such an animation. Among these operations are (1) set the color of a vertex or edge, (2) highlight a vertex or edge to distinguish it from other vertices, and (3) add explanatory text at a particular location on the graphics screen.
**2.2 Educator Requirements**
Since many educators may want to create instructional animations of graph algorithms for their students to explore, it is important that a graph class designed for instructional use offers the potential to develop such “expert-created” animations. What separates such animations from those created by students? Recent research on engagement techniques in algorithm animation [7] indicates that augmentation of the animation with “engagement objects” may serve to direct a student’s exploration of the algorithm in a more effective way. Such objects include the use of additional graphic displays to augment the graph itself, hypertext documents that supplement the algorithm’s animation with explanations of what the viewer is seeing, and the use of interactive questions that force the student to predict what future states of the animation will reveal. Although the graph library need not include specific engagement objects such as these, the library should encourage and make it relatively easy for educators to stream such materials into the animation.
**3 Existing Libraries and Software Packages**
Until we developed VisualGraph, no graph class libraries combined every aspect described in Section 2. Nonetheless, the VisualGraph class was not developed in a vacuum and owes much to a variety of earlier work. A selection of this work includes research in graph generation algorithms [2], graph layout algorithms [3, 4], object-oriented graph libraries [5], and instructional algorithm visualization [6, 9].
The work of Johnsonbaugh and Kalin [2] was presented in the context of a C program that generated random graphs subject to a variety of constraints. The criteria they used to define the graphs produced by the program are unsurpassed in terms of producing data sets suitable to test student-written algorithms and served as the basis by which we built random graph generation into the VisualGraph class.
The graph library providing the richest set of operations is certainly LEDA [5]. Apart from providing basic graph operations, it provides the implementations of many classical graph algorithms and a set of calls to graphic functions that are layered on the X Window system. However, although it sets the standard for industrial-strength graph libraries, LEDA entails a very steep learning curve. Its overall complexity is comparable to the LEDA Standard Template Library in C++. Consequently, unless students are well-versed in LEDA’s use from their work with simpler data structures, having them use it for the first time when they begin to study graphs will most certainly shift their focus to language-oriented details instead of the more conceptual algorithm analysis and experimentation that we are trying to encourage.
Our assumption that a vertex can be labeled by a single character means that a vertex will be geometrically small and
not vary in size due to the amount of labeling data. Under such conditions the graph layout algorithm described by Kamada in [3] provides an excellent means of drawing a graph using straight lines in such a way that edge intersections are minimized. This minimization of edge intersections is particularly important in weighted graphs because we must have space for displaying the textual weight along an edge in addition to the line that actually composes the edge. Providing all this information in a way that remains legible requires exceedingly judicious use of screen space. Prior to the development of our VisualGraph class, graph display systems employing such sophisticated algorithms had only been available in research-oriented tools such as COOL [4]. The combination of providing such a geometric layout algorithm with the ability to randomly generate meaningful graphs for assignment problems provides students with a rich visual playground in which to watch their algorithms work on many varied data sets.
We chose AnimalScript [8] for implementing the graphics in the VisualGraph class. AnimalScript is a scripting language in which textual animation commands are written to a file that is then parsed and rendered by the Animal animation system [8]. Animal is one of several animation engines supported by JHAVE [6], a platform that offers such engines the ability to intersperse instructional interaction objects into the stream of rendering information.
4 Implementation of the VisualGraph class
As outlined above, all graph vertices in VisualGraph are identified by a character. To support large graphs, characters go from upper to lower case, followed by digits. Accordingly, edges are identified by the character IDs of the vertices they connect, with the first character representing the starting vertex for directed graphs.
By default, VisualGraph generates AnimalScript output (optimized for size) to a Java PrintWriter. The resulting stream can then be used by JHAVE. Using the latest extensions of both AnimalScript and JHAVE, the stream may also contain interaction elements for asking questions about the display [6]. Because VisualGraph, AnimalScript, and JHAVE are all written in Java and use text to describe rendering information, algorithms developed in VisualGraph and their resulting animations are portable to virtually all environments.
Four methods support adding or removing vertices and edges from a graph. The position of a vertex is given by Cartesian coordinates, while the position of an edge is determined by the vertices it joins. The color and highlighting for added elements can be initialized. A set of auxiliary methods allows (un-)highlighting or coloring edges or vertices, toggling the highlight mode, and changing the weight of an edge. Apart from querying the existence of vertices and edges and their highlight state, the weight of a given edge can be retrieved for weighted graphs. Graphs can be tested for being empty, directed, or weighted.
VisualGraph can generate random graphs with certain properties, such as connected, directed acyclic, Hamiltonian, complete, or random. Each generation method (except for complete graph generation) requires the number of vertices and edges. Self-loops and weights are optional, as well as whether the graph is directed (apart from the directed acyclic random graph). The user can also specify minimum and maximum weights. A given graph can be saved and loaded to and from a file.
The organizeGraph method is used to geometrically layout the graph vertices in an aesthetically pleasing way, based on the Kamada algorithm [3]. Vertices are first arranged around a half-unit circle. The vertices with the highest “energy” are then moved until their energy reaches a (local) minimum, with the energy determined by the proximity to other nodes. The process is repeated until the sum energy of the graph reaches a (local) minimum. Vertices are then exchanged to test for lower-energy arrangements. If a lower energy state is achieved, the entire process is repeated. After thus determining the position of all vertices, the graph is suitable for AnimalScript display. The overall efficiency of this process is $O(V^3)$, where $V$ is the number of vertices.
As illustrated in Figure 1, while the display of the graph is usually quite good, it is not necessarily “optimal” with regard to the number of crossing edges. However, when considering that optimal graph layout is NP-complete, this is an acceptable compromise.
5 Example Application: Dijkstra’s Shortest Path
Consider the graph portrayed in Figure 1. This represents VisualGraph’s depiction of a connected graph that was randomly generated and then sent an organizeGraph message so that it would be subjected to the Kamada layout algorithm. Given appropriate input values for the variables nodes (8), edges (19), selfloops (false), weighted (true), directed (false), minWeight (2), and maxWeight (8), only three Java instructions are required to generate the graph and then produce its picture:
5 Example Application: Dijkstra’s Shortest Path
Consider the graph portrayed in Figure 1. This represents VisualGraph’s depiction of a connected graph that was randomly generated and then sent an organizeGraph message so that it would be subjected to the Kamada layout algorithm. Given appropriate input values for the variables nodes (8), edges (19), selfloops (false), weighted (true), directed (false), minWeight (2), and maxWeight (8), only three Java instructions are required to generate the graph and then produce its picture:
```java
// generate
g.randomConnectedGraph(nodes, edges, selfloops, weighted, directed, minWeight, maxWeight);
// layout
g.organizeGraph();
// display
g.printGraph();
```
Figure 1: Unadorned graph snapshot
Because the graph is displayed in the Animal rendering engine, the user interface for walking through snapshots of the graph is automatically equipped with a vast array of tools, including VCR-like controls, snapshot magnification controls, speed controls for playing the snapshots in automated slide-show mode, and stepping controls for rewinding the algorithm’s snapshots to any point in time.
The following Java code shows how a student may implement Dijkstra’s shortest path algorithm on such a graph:
```java
void leastSearch(VisualGraph g, char start, char goal) throws IOException {
char nextNode, n;
initOpenList(g, start);
do {
nextNode = findOpenNodeToExpand(g);
g.setColor(nextNode, "red");
if (nextNode != goal) {
nodes = g.getAllAdjacentNodes(nextNode);
while (!nodes.hasMoreElements()) {
n = ((Character) nodes.nextElement()).charValue();
g.setColor(n, "green");
updateStatus(nextNode, n, g);
}
g.printGraph(X_SIZE, Y_SIZE);
closeNode(nextNode, g);
g.setColor(nextNode, "black");
g.printGraph(X_SIZE, Y_SIZE);
}
if (nextNode != goal) {
g.printGraph(X_SIZE, Y_SIZE);
nextNode = findOpenNodeToExpand(g);
g.setColor(nextNode, "red");
while (nextNode != goal) {
n = ((Character) nodes.nextElement()).charValue();
g.setColor(n, "green");
updateStatus(nextNode, n, g);
}
g.printGraph(X_SIZE, Y_SIZE);
closeNode(nextNode, g);
g.setColor(nextNode, "black");
g.printGraph(X_SIZE, Y_SIZE);
}
} while (nodesLeftToExpand(g) && (nextNode != goal));
}
```
Here the methods `initOpenList`, `findOpenNodeToExpand`, `nodeClosed`, `updateStatus`, `nodesLeftToExpand` and `closeNode` represent functions that implement the classic priority queue operations for Dijkstra’s algorithm. The italicized messages are sent to the `VisualGraph` object `g`.
The `allAdjacentNodes` message sent to `g` returns a Java Enumeration that easily allows the student to walk through all the vertices adjacent to the vertex called `nextNode`. The `setColor` messages are sent to `g` after `nextNode` is removed from the open list and again after node `n` has had its status on the open list updated. These messages color the node removed from the open list and its adjacent nodes red and green, respectively. Consequently, the `printGraph` message sent to `g` after leaving the loop that iterates through the enumeration produces a snapshot that, by the use of colors, reflects the altered state of the algorithm. The `printGraph` message sent to the graph `g` after `nextNode` is closed produces the next snapshot in which closed nodes are colored black. One of the resulting snapshots from this adornment is shown in Figure 2.
The legend printed out below the graph in Figure 2 is an example of how supplementary material above and beyond the graph itself can be streamed into the animation script. To produce this legend, the student (or educator) would have to write a function (here called `legend`) that produces a Vector of Strings representing the state of the total-cost array associated with graph vertices. The addition of the following lines of Java code each time through the outer loop then produces the legend in the Animal renderer. Here, `animationScript` is the same PrintWriter to which the `VisualGraph` `g` is directing its rendering commands.
```java
Vector v = legend(g);
for (int i = 0; i < v.size(); i++)
animationScript.println("arrayPut \"");
+ (String)v.elementAt(i)\"
+ " on " + "legend" + position " + i);
```
6 Future Directions
This paper has focused on showing how easy it is for students using the `VisualGraph` class to generate test data for and produce high-quality animations of graph algorithms that they are implementing as part of a normal assignment for an undergraduate data structures and algorithms course.
The scope of the paper has prevented us from discussing the details of how one would insert complicated interaction objects, such as stop-and-think questions and hyper-document links, into an animation produced by the `VisualGraph` class. Presently doing this requires annotation of the algorithm in a fashion similar, albeit more complicated, than that used to produce the legend in Figure 2. Detailed knowledge of the rendering language [8] and the JHAVE instructional delivery environment are required. Hence, the addition of such embellishments is a time-consuming process for an instructor (or very ambitious student) who wants to augment an animation with these interaction objects. We hope in the future to use XML specifications for such interaction objects and thereby “abstract away” the details of incorporating them into an animation produced by `VisualGraph`.
References
|
{"Source-Url": "https://download.hrz.tu-darmstadt.de/media/FB20/Dekanat/Publikationen/TK/VisualGraph.pdf", "len_cl100k_base": 4379, "olmocr-version": "0.1.50", "pdf-total-pages": 5, "total-fallback-pages": 0, "total-input-tokens": 15636, "total-output-tokens": 5347, "length": "2e12", "weborganizer": {"__label__adult": 0.0007472038269042969, "__label__art_design": 0.0016870498657226562, "__label__crime_law": 0.0009312629699707032, "__label__education_jobs": 0.1187744140625, "__label__entertainment": 0.00022530555725097656, "__label__fashion_beauty": 0.0004298686981201172, "__label__finance_business": 0.0006437301635742188, "__label__food_dining": 0.0010175704956054688, "__label__games": 0.001384735107421875, "__label__hardware": 0.0018777847290039065, "__label__health": 0.0015010833740234375, "__label__history": 0.0011167526245117188, "__label__home_hobbies": 0.0003876686096191406, "__label__industrial": 0.0013132095336914062, "__label__literature": 0.0010786056518554688, "__label__politics": 0.0007929801940917969, "__label__religion": 0.0013551712036132812, "__label__science_tech": 0.12347412109375, "__label__social_life": 0.0005202293395996094, "__label__software": 0.013031005859375, "__label__software_dev": 0.724609375, "__label__sports_fitness": 0.00077056884765625, "__label__transportation": 0.0017900466918945312, "__label__travel": 0.0005240440368652344}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 24478, 0.00973]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 24478, 0.86635]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 24478, 0.9042]], "google_gemma-3-12b-it_contains_pii": [[0, 4369, false], [4369, 11704, null], [11704, 17899, null], [17899, 22992, null], [22992, 24478, null]], "google_gemma-3-12b-it_is_public_document": [[0, 4369, true], [4369, 11704, null], [11704, 17899, null], [17899, 22992, null], [22992, 24478, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 24478, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 24478, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 24478, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 24478, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, true], [5000, 24478, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 24478, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 24478, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 24478, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 24478, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 24478, null]], "pdf_page_numbers": [[0, 4369, 1], [4369, 11704, 2], [11704, 17899, 3], [17899, 22992, 4], [22992, 24478, 5]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 24478, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-02
|
2024-12-02
|
52bcadb12fef6e6b63e9ea8e6791f01020e48ff1
|
Clarification KBS as Consultation-Justification Mash Ups
Proposing a Novel Paradigm for All-in-One Knowledge-based Systems
Martina Freiberg, Felix Herrmann and Frank Puppe
Department of Artificial Intelligence and Applied Informatics, Institute of Computer Science,
University of Würzburg, Am Hubland, Würzburg, Germany
Keywords: Knowledge-based System, Clarification KBS, Consultation-Justification Mash Up, KBS UI Design, Agility.
Abstract: Regarding knowledge-based systems (KBS), the seminal paradigm—perfectly mimicking human experts—is gradually replaced by an increasing demand for enabling users to influence the reasoning process according to their domain knowledge. Therefore, we propose a novel KBS paradigm: Clarification KBS as a mash up type of consultation and justification interaction—intended to foster active user participation according to users’ competency, the KBS’ explicability, and the support for learnability. We introduce the theoretical concept of clarification KBS, as well as appropriate UI-interaction variants. Further, we discuss the results of iteratively evolving and evaluating ITree, a specific clarification KBS implementation for the legal domain.
1 INTRODUCTION
Today, knowledge-based systems (KBS) are widely applied, both in research-based and industrial applications—e.g., for medical documentation/diagnosis, technical fault diagnosis, or environmental advice (Castellanos et al., 2011; Ting et al., 2011; Chen et al., 2012; Zeng et al., 2012). Yet, the once common paradigm, that a KBS should perfectly mimic the abilities of human experts, is gradually replaced—by the increasing demand for enabling users to influence the reasoning process according to their expertise, e.g., by answering expert shortcut questions. Another desirable objective for such KBS is to provide a high level of skill-building ability—i.e., to enable users to gain knowledge about the domain by using the KBS.
A typical KBS session commonly conforms to answering questions that are queried by the system—other KBS types, such as embedded KBS, also exist but are not targeted here. Based on the input data, the KBS typically derives one or more solutions; there, it is essential to also explain how and why the respective conclusion was drawn, i.e., providing a justification. Justifications basically support reproducing and reviewing the KBS’s operation and conclusions (Puppe, 1993)—thus, apart from leveraging the KBS validation task, justifications help to build trust in the KBS, enable users to acquire domain knowledge, and thus enhance the overall user experience and utility. So far, handling the data input and presenting the results and corresponding justifications mostly are treated separately. In this paper, we motivate that mashing up the consultation and justification interaction can be highly beneficial: Resulting KBS offer a high level of explorability and freedom to the user; that in turn encourages users, to bring in their own competency and expertise; finally, the anytime provided justification, offered by such mashup KBS, strongly fosters the explicable and thus learnability of such a system. Today, diverse research is found regarding explanation generation and their use/utility (Arnold et al., 2006; Pinheiro et al., 2006); however, explanation/justification presentation, general KBS UI design and (usability) evaluation are still rather neglected. Specifically for clarification KBS, except our seminal work (Freiberg and Puppe, 2012) no similar research efforts are published so far. Therefore, as a generalization of our prior work, we propose clarification KBS as a consultation-justification mashup type in this paper.
The remaining paper is organized as follows: In Section 2, we propose the theoretical concept of clarification KBS as consultation justification mashups. Appropriate UI representations are presented in Section 3. We report various evaluations in Section 4, that we performed specifically for ITree—a particular clarification KBS instantiation. In Section 5, we conclude with a summary of the presented work and an outlook on prospective future research topics.
2 CLARIFICATION KBS TYPE
Forward Consultation & Backward Clarification. Forward- and backward chaining are known reasoning paradigms for rule-based systems, c.f., (Russel and Norvig, 2010, Ch. 6). Similarly, we define two KBS progression types: Starting with defined init questions, forward consultation KBS query in all directions, as all solutions contained in the KB can be derived equally well depending on the provided input. In contrast, backward clarification KBS target exclusively one defined solution at a time; i.e., only questions, that potentially contribute to the target solution rating, are posed.
Follow-up Questions & Abstractions. Follow-up questions are not contained in the original core interrogation sequence, but become activated only in case a certain trigger question is answered. Abstraction questions are questions the value/answer of which is automatically calculated by the KBS; an example is the BMI, which can be derived automatically once values for weight and size are known.
2.1 Clarification KBS—Base Concept
The core idea of clarification KBS is to unite consultation and justification interaction within an all-in-one UI module. They base on backward clarification, i.e., they target a single solution only. Clarification KBS generally can be seen as correspondent to the testing part in hypothesize and test: Hypothesizing—i.e., narrowing down the solution space to a probable solution candidate—can be performed using forward consulting KBS types or any other means such as mind-maps etc.; a clarification KBS then handles its detailed inspection.
Due to its mashup characteristic, the clarification KBS type can be invoked in two alternative ways: Filled in, and empty. Main objective of the filled in variant is to provide an interactively enhanced justification view with integrated, explorative consultation facilities. Thus, the target solution already possesses a certain rating/state, and the contributing question/answer pairs may be highlighted distinctly. Additionally, answer options might indicate—visually or textually—in what way they contribute to the target solution rating. The empty clarification variant aims at providing single issue consultation with integrated justification. Therefore, it is initialized with the yet unrated target solution, and entirely unanswered (and thus, not marked) questions. However they already might be marked with corresponding answer contribution indicators, see above. Those initialization variants can be applied for all UI styles that are proposed in the subsequent section.
3 CLARIFICATION KBS—THE UI
In the following, we introduce some interesting UI styles for clarification KBS: Hierarchical Clarifier, Answer Form Add-On, Daily, and Interview style. The latter two are equally well applicable for forward consultation; yet due to the focus of this paper, we describe them exclusively for the clarification context.
3.1 Hierarchical Clarifier Style
Hierarchical Clarifier is a single-line, interactive tree style, sketched in Fig. 1. It presents the question as well as all corresponding answers as one tree node, that spans (a greater part of) the UI. In the example, we experimented with placing answer options before the question text as to increase the efficiency of the answering interaction. The respectively clarified solution is displayed as topmost node (Fig. 1, a); this is followed by the base node set, representing all first-level items that directly contribute to the core issue rating (Fig. 1, b). Each question node again can be followed recursively by further refinement levels; thereby, parents denote the abstraction, and their children the corresponding abstraction sources that derive the parent’s value; e.g., in Fig. 1, the first question Temperature is an abstraction question, refined by a one-question abstraction source Degrees? . Answered and thus solution contributing questions are marked as to indicate the abstract contribution value, e.g., the two green top-level items in the example; the respectively selected answer options are displayed in bold print. Further, we recommend the inclusion of an anytime information display—here, realized by a side-panel (Fig. 1, d)—which presents additional explanations for a question once the corresponding info-button (Fig. 1, c) of a question is clicked. This form of presenting hierarchically nested/abstracted knowledge allows for answering questions either directly on the more abstract level, in case the users possess the required domain knowledge—which leads
to a shorter, more efficient session; or implicitly, by expanding the parent node, and answering the corresponding refinement questions—the respective answer values then are propagated to parent elements. That way, this style intends to support broad user groups (with varying proficiency) in highly expertise domains. It has to be noted, that technical or domain laymen may require some in-depth instructions and training time for familiarizing with this interaction principle. Hierarchical Clarifier optimally exploits its potential benefits in the context of highly expertise knowledge that can be defined using several differently detailed refinement levels; yet, this style can also be used with less staggered knowledge—then, however, it may degrade to a flat, list-like display that lacks any expert shortcuts.
3.2 Answer Form Add-on Style
Answer Form Add-on fore-mostly targets the context of providing interactive justification. Therefore, static justification presentation forms are enhanced by simple consultation widgets. In Section 3.2.1, we describe two exemplary justification presentation forms; based thereupon, we introduce the Answer Form Add-on style in Section 3.2.2.
3.2.1 Base Justification Styles
In general, KBS justifications can be presented using a vast array of text-based and visual techniques. Due to space restrictions, we introduce only two examples particularly apt regarding the Answer Form Add-on enhancement: Finding List and Rule Graph.
Finding List. We define a pair of a question and the user-entered answer as a finding. This justification style lists all findings that contribute to the target issue in a <question == value> style, c.f., Fig. 2; questions, that at the time of invocation are not (yet) answered, may display a default value, such as unknown (see Fig. 2, Lasted long). Already selected findings may further be highlighted, e.g., by bold face print; also, findings can indicate the value they contribute to the target issue—in the example, they are added in parentheses after the finding. Finding Lists generally suit all knowledge types, that allow for the identification of questions and corresponding selected/non-selected answers—e.g., rule-based-, set covering knowledge, case bases, etc.
Rule Graph. Rule Graphs specifically visualize rule-based knowledge. Those are a generalization of Derivation Graphs, which have already been subject to prior research (Baumeister and Freiberg, 2010). Rule Graphs represent solutions as well as findings by distinct nodes, c.f. Fig. 3. In case a finding contributes to a solution rating, an arc is drawn between finding- and solution node. In the case of compound rules—that connect several findings by AND or OR conditions or that negate findings—the respective branches are connected by a rounded arc; in Fig. 3, a continuous line is used for the AND connection, a dotted line for OR connections, and a bold dot before the finding for a negation. Further, the rounded arc can be decorated with the rating, the rule assigns to the solution; e.g., the compound AND rule in the upper half of Fig. 3 rates the solution positively with the abstract rating class P6. When used as the basis for the Answer Form Add-on, it is crucial that a Rule Graph also visualizes those potentially contributing rules that have not yet fired in the session as to enable encompassing exploration. Such rules may be presented with a default answer value—e.g., unknown, or in a greyed manner for indicating their state.
3.2.2 Answer Form Add-on Conception
Answer Form Add-On enhances static justification presentation forms—see the previous section—by simple Answer Form popups. Therefore, presented findings serve as triggers that, once clicked, invoke a popup that displays all further answer alternatives for the question at hand. Fig. 2 sketches an example that is based on the Finding List justification. There, the question Further Symptoms offers the answers Nausea, Fatigue, and Sneezing; in the current session, Sneezing was selected, thus it is rendered in the Finding List—the further answers then are listed.
Figure 2: Answer Form Add-On enhanced Finding List.
Figure 3: Answer Form Add-On variants for Rule Graph.
only in the answer form popup. Another example is shown in Fig. 3 for the Rule Graph justification style. It sketches two further variants for realizing the Answer Form popups themselves: In a plain juxtaposed style as shown in Fig. 3, a; and using radio buttons, Fig. 3, b; the latter variant additionally indicates the abstract rating value (green=positive, red=negative) of answers by background coloring. Once the user selects an answer inside the popup and closes it (X button), the respective finding is added in the current session and the justification view is re-rendered, this implies, that the original session state and justification are lost once the user starts interacting with the Answer Form widgets—it allows, however for a highly interactive, in-place adaption of the entered data. As Answer Form Add-On is based on justification presentation forms, it generally offers a high level of explicity and learnability: By explaining, why and how the current solution was reached; and by making explicit the coherences between findings and solutions.
### 3.3 Daily Style
Daily is a highly compact UI style where questionnaires, basically used as concept for grouping topically related questions, and their included questions form a column-wide, visual entity—similar to articles in newspapers—which becomes best evident, in multi-column variants; Fig. 4 sketches an example in two-column style. This style optimally supports the simultaneous display of (a greater part of) the entire KB. Questions and answers are rendered in a compact, juxtaposed style, c.f., Fig. 4, which in turn supports the overview and free exploration of all items. As the example indicates, the clarified solution is displayed prominently in the solution panel in the top or at one side of the UI (Fig. 4, a). Questions, potentially further grouped by collapsible questionnaires (Fig. 4, c), are rendered in the center part of the UI (Fig. 4, b). Answering questions is as simple as clicking on the respective answer text—repeated clicking deselects already set answers, de-
Despite its inherent focus on the consultation activity, Strict Interview can nevertheless be adapted for supporting a basic justification interaction: By integrating an interview object history that lists the entered findings (e.g., Fig. 5, e), and by enhancing that list by certain interactions supporting the adaption of such items. One example is interactive back-linking to the question display corresponding to the clicked finding, which enables users to quickly and easily go back and change the input; or the integration of answer form add-ons, as described previously, for in-place editing.
4 EVALUATION—ITREE
So far, we have implemented one instantiation of the Hierarchical Clarifier KBS style thoroughly—the ITree clarification KBS. Therefore, the tailored KBS engineering tool ProKEt (Freiberg et al., 2012) was used. The ITree vision originated from the JurisearSearch project—a cooperation between the university of Würzburg and RenoStar, a German legal counseling company. Since then, the design and conceptualization of ITree have been further refined in several iterative development and evaluation cycles. In the following, we begin with a rough subsumption of the ITree conception and its first evaluations; for details, see (Freiberg and Puppe, 2012). We then focus on discussing the results of the latest evaluations and the consequential evolution of ITree.
Original ITree Vision, 1st & 2nd Evaluation.
ITree is a tailored instantiation of Hierarchical Clarifier, see Section 3.1. It specializes that concept by mapping all questions on a fixed answer set—yes, no, uncertain; also, it applies special algorithms, based on partly complex AND/OR compound rules, for deriving the values of parent questions from the values of their child questions, see (Freiberg and Puppe, 2012).
The current implementation state of ITree is shown in Fig. 6. The highly proficient and complex legal domain is destined for defining a deeply nested abstraction/refinement KB as used with Hierarchical Clarifiers; e.g., the ITree KB on dismissal contains up to 10 abstraction levels (three levels shown in Fig. 6). Therewith, legal ITree KBS support a wider range of users by offering manifold operation levels regarding the required prior domain knowledge.
The first evaluation in March 2012 showed, that ITree generally is a favorable clarification UI style, that basically supports an efficient and effective usage, free exploration, and skill-building ability. In comparison to an Interview variant, ITree overall was rated the more appropriate, convenient variant. However, problems occurred regarding the KB contents: Concerning the understandability of question texts, as too often specialist terms and intricate phrases were used without deeper explanation; but also concerning the refinement/nesting structures; see also (Freiberg and Puppe, 2012). As those two aspects had been the main (negative) cause variables, we experimented with two follow up variants of the initial KB: One especially targeted at legal experts (EXP—structured similarly to the original yet refined regarding the wording/explanations); and one targeted towards laymen (USER—restructured entirely as to provide items, most interesting to laymen, in a more prominent manner). Those two variants were evaluated comparatively in May 2012—therefore, legal laymen and expert users were asked to solve some legal cases with the KBS variants. Interestingly, the preference regarding the USER variant by laymen was not as evident as assumed: In total, the USER variant was preferred in 35% of the cases; the LEGAL variant in about 30%; most remarkably, however, also in 35% a complete indifference between both variants was stated, both by expert and laymen users. As the EXP variant is based on commonly taught, unified, legal schemes, and thus can be formalized (by the experts themselves) and maintained in an easier manner, we finally decided to further rework and refine exclusively the EXP variant, as there were no convincing indications in favor of the USER variant. As a basically positive result, the overall success rate regarding the evaluated cases increased to 61% (USER) and 72% (LEGAL), which denotes a good improvement from the success rate of 43% for the ITree style in the first evaluation.
3rd User Study and Consequential UI Adaption.
After further refining the legal (expert oriented) KB as well as the basic ITree design, another user study was conducted at the end of 2013 with 19 students of med-
If conditions are fulfilled. This means, that your work contract still persists legally, in spite of the spoken dismissal.
You need to take care that you prosecute your case within 3 weeks from receiving the dismissal. This is the legal period of time from § 4 KSchG. If you do not adhere to this period of time, also a dismissal which is formerly incorrect becomes legally valid according to § 7 KSchG.
Is the reason for dismissal an extraordinary reason?
Is the dismissal prohibited due to timely restrictions?
Is the dismissal legally correct?
Result: NO
Figure 6: ITree Style Base Conception, used with a clarification KB on the legal correctness of a dismissal.
Expert Usability Evaluation (4th Study). In early spring 2014, ITree finally also was assessed particularly focussing on its general usability and design (and not so much on success rates). Therefore, an expert evaluation study was performed in early spring 2014, where ITree (amongst further KBS UI styles) was evaluated. 30 evaluators—human computer interaction students of the university of Würzburg—performed both a heuristic evaluation (Nielsen, 1994) and a cognitive walkthrough (Wharton et al., 1994). This evaluation partly confirmed previous evaluation insights, partly exhibited interesting new findings.
The first remark concerned the status mediation by color coding: Adhering to a red/green/yellow traffic lights scheme, the solution and question state were highlighted according to the current solution derivation state or the question’s contribution to the solution rating, respectively. Depending on the respective question, the answer yes and no can contribute both to a positive, or to a negative solution rating—which accordingly sometimes leads to coloring yes with green (positive contribution) or yes with red (negative contribution). The main remark there was, that this unsteady coloring of answer options was unfavorable, all the more in those cases where yes was marked red (as this additionally contradicts the cultural semantic feeling of yes being positive/green). Despite highlighting in the instructions that colors do not mirror the answer semantic but represent the contribution of that answer to the solution, this was rated as highly confusing. As color coding specifically was intended to mirror the current system status clearly at first glance—which was also approved of by several evaluation remarks—we did not remove colors entirely; also, we assumed that adding color-independent signs such as + and - would not be quite as clear and thus increase the memory load of users when estimating the KBS status. Thus, we introduced a different coloring scheme yellow/white/blue, shown in Fig. 6.
The next aspect was the scrolling behavior: Basically, ITrees are scrollable as to enable users to reach all nodes even if the expanded tree grows larger than the available UI space; however, in the original version this both induced a disappearance of the solution display header and of the additional information display side panel (which is especially critical as without the add-on explanations displayed there, ITree becomes almost unusable for most users). Thus, we fix-
ated and enlarged the side panel for prominent, anytime explanation display. Regarding the top panel, we added a flexible jump-to-the-top mechanism: Once users have answered enough questions for deriving a solution rating, the display automatically scrolls up to the solution panel; thus, the tree can to take up more available UI space as long as not solution is derived, yet as soon as a rating is available, it is brought prominently back into mind by the jump-scroll mechanism.
Regarding that side panel, also its general interaction—automatically updating panel contents, i.e., additional information for questions, when hovering a question node—was criticized. Specifically regarding high-resolution displays, the required precise hovering of potentially large question nodes was perceived as cumbersome and disrupting. However, we discarded the idea of using dedicated icon/question clicks as triggers, as ITree is deliberately intended as highly efficient UI and interaction type; thus requiring an extra click each time such information is required—potentially often in the complex target domains—would reduce the efficiency drastically. Thus for enhancing the side panel interaction, a short delay was added—i.e., once information for a question is displayed, hovering/touching another question does not update the panel immediately but only after a certain delay; this obviates unwanted explanation updates in the major part of cases.
The next remark concerned the initial automated expansion of parts of the tree—basically intended to highlight questions that are, on average, most relevant for a solution and should not be overseen. The evaluators remarked, however, that users often might be left wondering whether this a presentation flaw or a deliberate design decision. However, as we still believe that this initialization is beneficial especially for domain-related, experienced users—who might check such a similar base answer set in most cases anyhow—only a clear remark explaining the issue is added in the instructions but the mechanism was kept. This remark, as well as a short subsumption of the usage paradigm and color semantics are further displayed prominently in the UI header at system start—as initially not yet much solution related information is available for display there, this offers a great opportunity for presenting such important, initial information for quick start support.
Another major remark concerned the knowledge connector items \textit{If}, \textit{AND}, and \textit{OR}, displayed in front of the questions c.f., Fig. 6, c for visually mirroring the underlying derivation knowledge (rules). Those were partly rated as confusing and as rather increasing the mental workload of users. For ITree as a clarification KBS, however, this in-place justifications are essential for increasing its on-the-fly explainability. Therefore, a short-hand key to such symbols is planned for minimizing potential confusion.
It was further criticized that invoking a new case [Neuer Fall] by clicking the respectively termed button does not display any warning regarding the consequential loss of all currently entered data. Basically, we did not assume that as critical due to the button label that already indicates that implicitly. As this was a generally rather frequently stated issue, we nevertheless added a confirmation popup which highlights this issue more prominently.
Recent Studies Summer 2014 and Synopsis. In summer 2014, two more large- and smaller scale ITree studies were performed (248 and 21 computer science student participants, respectively), thus following a highly agile, iterative development—evaluation cycle. The overall baseline ratings remained positive also in those last studies; e.g., overall utility (2.2–2.7), KB quality (2.6–2.8), knowledge mediation (2.6–2.7) or ease of use (2.5–3.0) on scales from 1/very good–6/very bad. Success rates quite constantly remained at 86–88%, which we account as great results given the highly expert, specific domain and complexity of potential cases. Those studies further confirmed the suitability of the unusual coloring scheme and the added value of adding the delay regarding the additional information panel update. The latest suggestions for improvement, partly already realized, included: Moving the side panel as well as the answer buttons to the right side as to enable the western cultural left-to-right read flow; prominently displaying a notification once a solution rating is reached, in addition to the jump-scroll mechanism; and providing notifications once a user tries to enter values that contradict already derived values.
Having evolved iteratively over about two years, ITree now exhibits rather good baseline ratings; this specifically concerns the success rate, but also further important traits such as utility, KB quality, knowledge mediation, ease of use, etc. Also, the overall design/interaction was mostly perceived as convenient. This makes us confident, that ITree meanwhile denotes a beneficial clarification KBS UI style; and consequently, that the assumed benefits of consultation/justification mashup types—such as high flexibility, bringing in own competency, skill-building ability—within a unified KBS solution actually apply.
As one base insight, we claim that especially in the context of highly expert KBS, an iterative, agile development paradigm is extremely beneficial—which
was strongly fostered by the tool ProKEt. Another important general insight was, that the evaluation results not only depend on the particular UI/interaction realization, but likewise also on the KB quality and the quality of the test cases/descriptions—at least in similarly expertise domains and consequential complex test case descriptions.
5 CONCLUSIONS
In this paper, we proposed Clarification KBS as a novel KBS paradigm. Clarification KBS not only mashup consultation and justification UI/interaction within a single UI; they particularly possess the potential to foster more active user participation by letting them bring in their own competency and further offer a high explicability—therewith providing domain- and KBS related skill-building ability. We first introduced the basic concept of clarification KBS. We further proposed some interesting, suitable UI representations: Hierarchical Clarifier, Answer Form Add-On, Daily, and Interview style. Also, we discussed the results of evolving and evaluating an ITree KBS UI—a tailored instantiation of Hierarchical Clarifier—in the legal domain.
The overall results showed that ITree in particular and thus clarification KBS in general can stand up to the assumptions regarding the assumed benefits consultation/clarification KBS mashups; yet, also the insight manifested that clarification KBS are not well applicable for all diverse user types likewise—rather, they seem particularly useful for users with at least a little domain-related and/or technical experience; this assumption will be subject to future work. Further practical work regards the implementation of a more general clarification KBS for the medical domain. The currently envisioned medical clarifier requires the flexible integration of diverse further question types—e.g., numerical, date, or free-text questions. Consequently, also the propagation algorithm of ITree will require some reconsideration and generalization.
Also, the thorough implementation and evaluation of the other proposed clarification UI types is subject to future work. Regarding the Answer Form Add-On style, this particularly also concerns the static base justification types, two of which were presented in this work; there, we are currently realizing some experimental solutions with the tool ProKEt. Finally, also the envisioning and realization of further novel clarification KBS UI styles offers ample room for future work.
REFERENCES
|
{"Source-Url": "http://www.scitepress.org/Papers/2014/50285/50285.pdf", "len_cl100k_base": 6056, "olmocr-version": "0.1.50", "pdf-total-pages": 8, "total-fallback-pages": 0, "total-input-tokens": 26412, "total-output-tokens": 7239, "length": "2e12", "weborganizer": {"__label__adult": 0.0005517005920410156, "__label__art_design": 0.00286102294921875, "__label__crime_law": 0.0029163360595703125, "__label__education_jobs": 0.0167388916015625, "__label__entertainment": 0.00019037723541259768, "__label__fashion_beauty": 0.00037741661071777344, "__label__finance_business": 0.0011014938354492188, "__label__food_dining": 0.0005764961242675781, "__label__games": 0.0011653900146484375, "__label__hardware": 0.0013971328735351562, "__label__health": 0.0036563873291015625, "__label__history": 0.0008769035339355469, "__label__home_hobbies": 0.00021827220916748047, "__label__industrial": 0.0009484291076660156, "__label__literature": 0.0013561248779296875, "__label__politics": 0.0006651878356933594, "__label__religion": 0.0007419586181640625, "__label__science_tech": 0.26708984375, "__label__social_life": 0.0002484321594238281, "__label__software": 0.10296630859375, "__label__software_dev": 0.59228515625, "__label__sports_fitness": 0.00028252601623535156, "__label__transportation": 0.0005807876586914062, "__label__travel": 0.0002529621124267578}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 33050, 0.02638]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 33050, 0.16654]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 33050, 0.9252]], "google_gemma-3-12b-it_contains_pii": [[0, 4150, false], [4150, 8697, null], [8697, 12911, null], [12911, 14976, null], [14976, 19482, null], [19482, 22664, null], [22664, 28094, null], [28094, 33050, null]], "google_gemma-3-12b-it_is_public_document": [[0, 4150, true], [4150, 8697, null], [8697, 12911, null], [12911, 14976, null], [14976, 19482, null], [19482, 22664, null], [22664, 28094, null], [28094, 33050, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 33050, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 33050, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 33050, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 33050, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 33050, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 33050, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 33050, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 33050, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 33050, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 33050, null]], "pdf_page_numbers": [[0, 4150, 1], [4150, 8697, 2], [8697, 12911, 3], [12911, 14976, 4], [14976, 19482, 5], [19482, 22664, 6], [22664, 28094, 7], [28094, 33050, 8]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 33050, 0.0]]}
|
olmocr_science_pdfs
|
2024-11-29
|
2024-11-29
|
058e9867fff9e0d5bb4d3781d02c6c6dcdb7935f
|
Four principles for groupware design:
a foundation for participative development
Andy Cockburn
Steve Jones
Technical Report COSC 14/93
Department of Computer Science
University of Canterbury, Private Bag 4800
Christchurch, New Zealand
Four principles for groupware design: a foundation for participative development
Andy Cockburn
Dept of Computer Science
University of Canterbury
Christchurch
New Zealand
andy@cosc.ac.canterbury.nz
Tel: +64 3 364 2774
Steve Jones
Dept of Computer Sciences
Dundee Institute of Technology
Dundee
Scotland
mctsrj@uk.ac.dct.cc.vaxb
Tel: +44 382 308619
November 1993
Abstract
Participatory design amalgamates the expertise of interdisciplinary specialists with the task-specific expertise of end-users. Groupware design is widely recognised as benefiting from participative approaches. Recognition of this ideal, however, does not preclude the failure of groupware design due to poor communication and inadequate understanding between participants. We provide a grounding in the problems affecting groupware success, and introduce four design principles that guide all those involved in design around the pitfalls that have been encountered, some repeatedly, by groupware.
Keywords: groupware, participatory design, principles, user-acceptance.
1 Introduction
The failure of early groupware systems is well recorded [Gru88, Gru90]. The design approach adopted in these development projects was often characterised by computer scientists intending to radically increase the efficiency of organisations through deterministic models of cooperative activity. Such design strategies have been shown to be inadequate: they fail to account for the social factors in group work. As a consequence, research into computer supported cooperative work (CSCW) has broadened beyond computer science to include the social sciences that study the subtle factors that encompass collaborative work.
CSCW research focuses on a range of goals: from providing an understanding of social factors involved in support for group work, to the development of point systems that demonstrate the potential of new and innovative technologies. Evaluation and explanation of systems is frequently a casualty of the "next system trap" with developers eager to eliminate current failings in their next implementation. Mistakes and misguided developmental decisions are frequently unreported, resulting in a lack of guidance for the next generation of system developers. Consequently the same, or similar, design errors are replicated and rediscovered.
The latest, and most promising, group-
ware development methodology is participative design [MK93]. Interdisciplinary development teams work with the end-users to co-determine the support they receive. Yet participatory design is no panacea: the misguided intuitions that caused the failure of early systems may be collectively held by the participatory design team. All involved need to share a common understanding of the issues relevant to groupware design.
In this paper we examine and record the major causes of groupware failure, and provide four groupware design principles that encapsulate these problems and guide design teams around them.
2 Why principles?
In 1983, Donald Norman [Nor83] argued for "more fundamental approaches to the study of human-computer technology." He alerted human-computer interaction (HCI) researchers to the "tar pits and sirens of technology," referring to the temptations of system development and the self-serving enticements of new technology. He argued the need for fundamental principles to "broaden our views, sharpen our methods, and avoid temptation."
CSCW research is now in a similar situation to that of HCI in 1983. It can be viewed as research territory into which exploration has only just begun, rife with uncharted tar pits and sirens. The lessons of CSCW development are akin to folklore with design issues permeating local research communities, but often going no further.
The principles presented in this paper provide system designers\(^1\) with a guiding "chart," noting the relevant pitfalls, problems, and barriers to the development of successful cooperative work support tools. Personal intuitions, and a "feel for the right way to do things" remain a major part of design (and the key factor distinguishing good designers from bad ones), but intuitions, regardless of their foundations, are fallible. These principles alert designers to groupware's problems, and to the mis-guided intuitions encountered (some repeatedly) in collaboration support.
2.1 A pragmatic approach
The design guidance provided in this paper is derived from a number of sources. Much of it is gleaned from the fragmented lessons of groupware development that are recorded in CSCW literature.
The social implications of groupware are often cited as the fundamental barrier to its success [SK91]. We do not contend with this claim; rather, we note that a society's rejection of groupware is driven by an accumulation of individual rejections. If principles for groupware design make systems more acceptable to individuals, without hindering their value in group support, they are likely to be more acceptable to the user society.
The three major issues hindering the success of groupware (detailed in section 3) are:
- The lack of integration — this applies to several aspects of computer systems including interface differences, and incompatibility caused by information format requirements.
- The additional effort required to use systems — partially due to lacking integration, but effort is also imposed on users by explicit system requirements for information, and by the enforcement of specific usage styles.
- The vicious circle of groupware adoption (section 3.5) — if all system borne benefits are dependent on critical mass there will be little to encourage adoption until critical mass has been achieved.
\(^1\)In this paper we use the term "designers" to mean all those involved in (participatory) design. The shared understanding that is the aim of the principles is equally important to all participants, regardless of their educational backgrounds.
Each of the four principles for groupware design addresses a combination of these problems.
**Maximise the likelihood of personal system acceptance** — aiming to increase the perceived and immediate benefits. By making systems appealing to individuals, regardless of the number of other users, systems become less dependent on critical mass and provide the "kick-start" necessary to overcome the vicious circle of adoption.
**Minimise the requirements imposed on users** — explicit system requirements are the actions that must be executed by users for correct system operation. Such requirements impose an additional work burden on users (someone must carry out actions for benefits to be realised), and reduce system compatibility.
**Minimise the constraints imposed on users** — constraints imposed on users restrict and frustrate their natural styles of working, and limit their flexibility in customising information input/output formats.
**Maximise the potential for external system integration** — this principle examines the wider work environment that is beyond the direct control of system designers. Issues include the different hardware platforms supported by organisations, and how to draw together disparate resources contributing to efficient cooperative work.
The causes of groupware failure that motivate these principles are examined in the following section.
### 3 Causes of Groupware Failure
Forming and maintaining collaborative relationships is difficult. Even in ideal work environments continual trade-offs, give and take, between collaboration participants is required. The inclusion of computer support in this complex balance is frequently counter-productive. Rather than enhancing group efficiency and cohesion, computers hinder it. Typifying the extreme level of discontent with groupware, users called the Coordinator "worse than a lobotomised file clerk" [CG88], and reactions like the following about the Colab meeting support system are not uncommon:
"...they found it so frustrating that they put their heads in their hands, raised their voices, and ultimately threatened to walk out. They expressed astonishment that anyone would build such a tool," [TFB91] page-190.
What can be done to improve the poor performance of groupware? The issues of interest to groupware developers are "what can be done to avoid the failure of previous systems?", and "why have previous applications failed?". As a starting point, Grudin's widely cited paper (1988) identifies three major causes of failure in CSCW applications:
1. The disparity between who does the work and who gets the benefit.
2. The breakdown of intuitive decision-making in design.
3. The underestimated difficulty of evaluating CSCW applications. These three points can be generalised into three levels of failure: system-use, system-design, and system-evaluation.
In the following sections we examine the causes of groupware failure at the system-use level, pinpointing the components of Grudin's cost/benefit disparity and analysing the relationship between them. The observations made motivate the principles which assist designers in overcoming failure at the system-design level.
#### 3.1 Effort in Collaboration
The costs or undesired aspects of collaboration are the overheads of effort beyond that required to execute personal work tasks.
---
2 Grudin later extended these three points to include conflicts with social norms and inadequate facilities for exception handling.
Naturally, there are a plethora of social factors which can inhibit and discourage collaborative work, regardless of its supporting mechanisms. Many of these factors can be considered to increase "effort": personality clashes, for instance, make collaboration burdensome. Social complications of such a fundamental nature are, however, beyond the scope of this investigation.
When collaborators are physically remote, communication mechanisms must be used to mediate the interaction. All non face-to-face interaction mechanisms are limited by their bandwidth, reducing the richness of interaction\(^3\). The reduction in communication richness necessitates greater effort in completely and accurately transferring information [HS92].
These issues are inherent in collaboration and its mediation. When computers are used to support group work there is a further imposition of effort due to explicitly required user-actions, constraints on flexibility, and transitions between methods of task accomplishment. It is these issues that the following sections address.
### 3.2 Effort imposed by system requirements
Many systems explicitly require additional effort from users in order to support their functionality [CT93]. Usually this effort takes the form of structured information which we will term guidance. Guidance-dependence is best exemplified by the wide range of applications that support and enhance asynchronous messaging through the use of semi-structured message templates [MLF92]. If guidance is not supplied then, for successful operation, some other user must provide it on the sender's behalf. When systems attempt to maintain an active role in collaboration (coordinating activities, for example), failure to capture guidance detrimentally effects all users: the knowledge base on which active assistance is based becomes corrupt causing problems such as redundant or mis-timed reminders.
### 3.3 Effort imposed by lack of flexibility
Several CSCW applications have been based on explicit theories of cooperative tasks: examples include speech-act theory [FGHW88] and IBIS [CB88]. Systems based on rigid theories will be inflexible and impose specific styles of use that may conflict with those preferred by users.
Inflexible and constraining systems are likely to be unpopular: they enforce a form of "work to rule," a phrase synonymous with inefficient, restricted and inflexible working practices. Although users may find ways of working around system-imposed restrictions (perhaps using alternative mechanisms to record personal views—a paper note pad for instance), such work-around strategies illuminate system inadequacies.
### 3.4 Effort imposed by lack of integration
Sources of additional effort derived from groupware go beyond the requirements and the flexibility constraints imposed by each independent system. Effort is also required to manage work environments in which various tools, facilities, and communication mechanisms are used in conjunction.
In computer supported personal work people are required to make transitions (changes in their styles and methods of working) between the facilities used in their everyday work. When computer support is used for group work, additional transitions are required: between single- and multi-user applications, and between alternative communication mechanisms. If groupware is used infrequently, the effort required to re-learn its interface may be sufficient to discourage participation in group-work altogether.
---
\(^3\) Whether this will always be the case is discussed in [HS92], and is the subject of much futuristic virtual reality research.
Inadequate integration between groupware and other computer tools is not only a source of user-effort, it is also a missed opportunity. Computers can integrate access to a variety of information about communications and collaborators, they can actively initiate collaborations, and can carry out autonomous processing to establish suitable colleagues or communicants [CG93].
3.5 Adoption and Critical Mass
The additional effort required by a system will discourage users from adopting it. Users will also be discouraged by the imposition of inflexible working methods. Although the promise of work enhancement may encourage system use, groupware tools are prone to a vicious circle that restricts the realisation of system borne work enhancements (figure 1).

Figure 1: The “vicious circle” of dependencies in groupware adoption
The factors in this chain of dependencies are the system’s perceived benefits, its achievement of critical mass, and its adoption by individuals. The key determinant in the realisation of each of these components is the level of effort involved in system use.
Benefit and benefit-lag. Willingness to adopt a system is dependent on the benefits derived from its use, and during adoption this is primarily determined by immediate gains. All computer systems, however, suffer from “benefit-lag,” the period during which the effort put into mastering a system outweighs the benefit received. Mantei (1989) notes that “... a high learning threshold would cause meeting participants to reject the technology”.
Overcoming benefit lag is a complex problem for groupware. Not only must each individual undergo the learning process necessary to master new mechanisms, but the benefits encouraging this learning burden may not be available until critical mass has been established.
**Attainment of critical mass.** Achieving critical mass depends on adoption by a sufficient group of individuals. Sufficiency in this context is contingent on the group, individual, and task requirements: in one group-task the main factor for overcoming critical mass might be the number of collaborators, while in another, the involvement of particular individuals might be the main determinant.
**Adoption by individuals.** Individuals will be encouraged to adopt a system if there is an established base of regular users. A community of users ensures that information about the system and how to use it will be readily available, and consequently helps to break the inertia-driven maintenance of current working practices. Personal use of systems will be further encouraged if the rewards for doing so are clearly apparent: personal use is most likely to be stimulated by personal benefits.
The vicious circle of adoption. The vicious circle relating benefit, critical mass, and personal encouragement requires that all these properties are simultaneously available before groupware can become successful: critical mass depends on adoption by individuals which is encouraged by benefits, but the benefits are contingent on a critical mass of users. This situation appears to foretell a gloomy future for groupware!
What is required is some sort of kick-start,
a break in the vicious circle allowing, for in-
stance, benefits without the achievement of
critical mass. The dominant and discourag-
ing role of effort throughout system adoption
and subsequent use must also be minimised.
The groupware design principles, de-
scribed in the following sections, further
encapsulate groupware problems, and offer
some generic strategies that work towards
the breakdown of the vicious circle.
4 Maximise personal ac-
cceptance
Maximising personal acceptance is con-
cerned with encouraging individual users to
incorporate new systems into their work rou-
tines. There is a similarity in how users view
systems for personal and group work (for ex-
ample, a word processor and a collaborative
writing system). A common question users
ask about both types of tool is “what can it
do for me?” During initial system use, this
question will carry an additional component,
“now.” We therefore stress, in accordance
with Borenstein and Thyberg (1991), the
importance of interface issues in groupware.
In addition to underlying the need for close
attention to groupware user-interfaces, im-
plementation strategies for encouraging per-
sonal acceptance include “feature ticking,”
and the use of “champions.” The “reflex-
ive perspective” notes the group-like require-
ments of personal work coordination and ar-
gues that these similarities should be ex-
plained instant user-appeal.
A “Reflexive Perspective” of CSCW. Per-
nonal work is distributed through time and
space. Single users may work on several
machines, one at the office, one at home,
a lap-top, and an assistant’s machine, and
several projects may be pursued at different
times. The group-like properties of the sin-
gle user are further illustrated when the sepa-
rate roles undertaken in personal work are
examined [CT91]. These roles include the
following: a management role in which de-
cisions about work coordination are made;
a worker role in which the actions neces-
sary to advance or complete the work are
executed; a meta-management role in which
personal assistants (human or computer) are
instructed about appropriate actions.
With multiple tasks, roles, and work
places, the individual’s coordination require-
ments are similar to those of asynchronously
collaborating co-workers. The aim of the re-
flexive perspective is to use similarities in
personal and group work to blur the distinc-
tion between support mechanisms. By do-
ing so, the user benefits from familiarity and
predictability arising from a consistent inter-
face to the personal and collaborative work
environments. Skills transfer from one envi-
ronment to the other, and the effort of learn-
ing and remembering separate interfaces are
shared over a wider range of tasks.
Champions and encouragement. Stud-
ies of CSCW adoption [Ehr87, FRCL91]
have shown that enthusiasm for new sys-
tems is greatly enhanced by “champions” or
“evangelists” who promote the use of the
technology, raise awareness of what it can
achieve, and generally encourage system use.
Fafchamps et al (1991) noted this in their
study of decision making through email con-
ferences, “...the single most important factor
for a successful computer conference is the
activity level of the organiser of the confer-
ence,” page–220.
Catchpenny systems. Feature ticking is
a sales ploy used to add instant appeal to
a wide range of modern products. Attractive
features and additional facilities supplement
the core functionality, turning attention
away from the key task and onto fancy
bells and whistles. While not condoning the
design of poor (but feature rich) systems, a
form of feature ticking could be used to sup-
ply instant user-appeal.
User effort plays a pivotal role in system adoption (see figure 1) but a system's dependence on user effort has detrimental effects beyond issues of system adoption. These include the imposition of a cost/benefit disparity between those carrying out actions and those receiving the benefit, and an increased likelihood of system incompatibility due to dependence on specific information structures/format.
The intention of minimising requirements is to reduce the disparity between groupware's costs and benefits to user-acceptable levels. Strategies for achieving this goal, summarised below, include avoiding dependence on additional work, exploiting information inherently available through communication, and enabling shifts between the provision of benefits and the imposition of costs so that those most willing, able, or in need receive appropriate support.
Avoid dependence on user actions. The problems caused by system dependence on information that is explicitly provided by users (guidance) were discussed in the section on user-effort. Rather than depending on guidance, a more acceptable approach would use guidance when available, but not depend on it for system operation. However, it has been argued that a relaxed approach of this nature is impractical due to the inter-relations and dependencies inherent in collaborative work:
"Can a CSCW application succeed if doing the extra work is left to individual discretion? Unfortunately, probably not." Grudin (1988) page 88.
Unfortunately, depending on and requiring actions from users is as likely to cause system rejection as leaving the work to individual discretion. Certain forms of user-support will, indeed, be dependent on structured information. The major problem for system designers in supporting this structured information is how to retrieve it. The user is the most readily accessible and accurate resource, but research and experience has shown that systems can profitably look elsewhere [CS93, KM93, CT93].
Use what's available "for free." Avoiding dependence on user actions raises conflicting aims for system designers: how to leave users free from requirements, and yet still provide enhanced facilities.
Although guidance information is required to provide certain types of benefit, there are information sources other than that explicitly provided by users. Information is often accessible to computers through the process of communication: for instance, email messages contain header information revealing at least the who, the when, and the where information about a communication, and can also detail the subject matter, the direct relationship with previous messages, and so on. Existing "for free" approaches are wide ranging and include the following: the use of information in standard email headers to infer conversational relationships between email messages (Mona [CT93]); adaptive and learning systems that modify their performance dependent on user characteristics [KM93] or interaction pace [Dix92]; and techniques such as Latent Semantic Indexing [FD93] which infers the semantic distance between text documents.
Enable shifts of cost and benefit. Designers and managers who strive for efficiency-enhancing groupware have, typically, assumed that people are willing to work for the benefit of others [Gru88, Nag90]. This assumption ignores social affects, including the users' reluctance (or inability) to carry out actions that provide no personal benefit.
By shifting the provision of guidance (the cost) onto users gaining the benefit the
cost/benefit disparity is reduced—users execute additional actions when they are willing and able. Tapestry [GNOT92] underlines such an approach: through "collaborative information filtering" it exploits those people who are willing and eager to carry out the additional work.
The applicability of a cost-shifting approach depends on the politics and hierarchical structure of the organisation in which it is implemented. Although it may be reasonable to expect subordinates to work on behalf of a manager, the reverse may not be true. Social protocols should be allowed to resolve conflicts between expectations of actions and execution of actions. Enforcing rigid dependencies on the work of others will, for many groups, precipitate system rejection.
6 Minimise Constraints
Minimising requirements is concerned with the implementation stage of groupware development. It focuses on how systems retrieve the information they require. Minimising constraints attends to problems arising at an earlier and more abstract stage of system development. It examines the models and theories underlying groupware support. The aim is to avoid inflexible and constraining styles of use.
There is a causal relationship between the imposition of user-constraints and resultant user-requirements. Explicit models of group work processes constrain user flexibility, and require explicit guidance for correct operation. Designers implementing such models must ensure that their system can secure the required information, and the user is the most obvious source—hence the imposition of requirements.
Although rigid working practices can, in principle, support highly efficient organisations, in reality few organisations operate according to such deterministic methods; furthermore, they cannot be made to do so [Nag90]. Minimising constraints concurs with the sentiments of Dykstra and Carasik (1991) who, during development of the Amsterdam Conversation Environment, considered "...what it was that we really wanted to support: processes or people?", page 420. Their definition of support for people as "non-dependency-creating enablement" argues for groupware that leaves users free to develop protocols governing collaborative work as they, rather than their systems, see fit.
Strategies for achieving minimal constraints, summarised below, primarily aim to increase designers' awareness of problems arising from inflexible and rigid systems. Specific and detailed strategies are likely to be inappropriate due to the diversity of the models implemented by groupware.
Be aware of the two level perspective of technology. Sproull and Kiesler's (1991) two level perspective of technology examines conflicts between increased efficiency available through computer support and its negative social implications. The first level addresses the increased efficiency enabled by particular styles and uses of technology. The second level is concerned with social effects, raising issues such as user acceptance, personalised views of information, and individual preferences. The distinction between these levels can be expressed by the contrasting questions "what is possible with technology?" at the first level, and "how will it be used?" at the second.
Groupware designers, and all those involved in system development, must be aware of the social implications inherent in group work support. Technology capable of enhancing organisational efficiency will fail if relevant social factors are ignored. Design alterations based on projections of a system's social implications may temper the efficiency improvements achievable, but it is better to provide acceptable mechanisms providing some benefit than unacceptable ones which, despite great potential, fulfill
Beware of rigid models and theories. CSCW research into collaborative activity promises to yield workable explicit models for groupware in the future. However, the lack of maturity and incomplete state of this research makes the use of explicit models in current groupware largely inappropriate.
Open, unconstrained enhancement. While models and theories of collaborative activity are under development, open and unconstrained systems allow users to develop protocols as they see fit. User-specific models might be used to supplement an open system, but they should not impose constraints on collaborative tasks or on their mediation.
Several existing groupware applications exemplify various "open" approaches. In investigating the Capture Lab, Mantei (1989) cites the inadequate understanding of social exchange protocols; the system therefore supports a socially negotiated protocol for access to the system's shared workspace. Similar observations have led to toolkits such as GroupKit [RG92] supporting a range of open protocols for floor control and other facilities. Milo [Jon92] avoids modeling specific writing styles/roles in order to free co-authors from constraints.
7 External Integration
The first three groupware principles are primarily concerned with design and use of groupware in isolation. In contrast, maximising external integration requires designers to consider their system's role within, and relationship to, the entire work environment. In this extended collaborative context, group members use competing systems to execute similar tasks, and a variety of tools (computer and non-computer based) are drawn on to support and assist collaboration.
Enabling external integration attends to the user-effort that results from the changes (transitions) made between differing applications or communication environments. Its primary aims are twofold:
Curative — to reduce the number and magnitude of transitions between tools and facilities employed in collaborative work.
Augmentative — to improve and integrate access to resources that serve communication and collaboration requirements.
In this section we describe groupware approaches that reduce transitions (also termed "seams," and "barriers" [Bae93]) in CSCW.
Video fusion. Best exemplified by ClearBoard [IKG92] video fusion systems reduce the lack of compatibility between personally favoured tools, and ease the disruption to communication efficacy in distributed work caused by the loss of communicative cues such as gesture. Video fusion allows separate video images (perhaps a computer screen, and a human face) to be simultaneously displayed "on top of" each other, like layers of transparent acetate. In this way two (or more) otherwise incompatible applications, or work environments, can be used together.
Heterogeneous environments. Video-fusion techniques are primarily curative, overcoming problems brought about by the lack of integration between existing work support tools. In contrast, heterogeneous platforms augment collaboration by drawing together access to, and information about, collaboration resources in a way impossible without computer support. They work towards an "integrated portfolio of media" [Bai89]. For example, Telefreek [CG93] provides an extensible CSCW environment based on, but not limited to, standard networked computers. By drawing together information sources, communication mecha-
nisms, and collaboration applications. TELEFREEK users are provided with a platform for communication and collaboration.
Minimise dependence on structure and format. Dependence on system specific information formats and structures reduce the potential for system integration. Minimally, groupware that is intended for general release (rather than research point systems) must follow relevant standards. Many standards allow flexibility and additional structure to be added within their specifications, but designers must consider the impact of such structures on colleagues who do not have access to the same structuring mechanisms [LM90]. Systems built on existing communication media should do so monotonically: new facilities and enhanced features should not affect those already in use.
Implementation platforms. Incompatibilities between hardware and interface platforms are a primary concern for groupware developers. To avoid these problems designers must either replicate some of the implementation to support a variety of hardware, choose a suitable hardware-independent development platform (such as the X Window system), or use an interface development application that can generate code for several Graphical User Interface environments.
Cross-platform interface generators are becoming available and are likely to substantially ease the implementation of integrable groupware. Groupware development toolkits, such as GROUPKit [RG92] and OVAL [MLF92] also promise to increase the integrability of systems.
8 The principles effect on designers
Research and experience has shown that technology is able to offer novel, efficient, and work-enhancing facilities. However, providing systems capable of enhancing group work is insufficient, they must also (in many ways, primarily) be acceptable. Surface system issues such as interface quirks, or failure to provide adequate appeal to new users are likely to prompt system rejection. Designers may argue that such superficial problems will be overcome once enhancements in work efficiency are recognised, but rejection at an early stage means that the benefits will never be attained.
Employing these principles in system development will make substantial demand on development teams. The question asked by designers, however, should not be “which approach is the easiest?” but rather “which potentially successful approach is the easiest?” We contend that these additional development demands are not purely a consequence of the principles; rather they are qualities required for the development of successful and (necessarily) acceptable group work applications.
9 Conclusions
Participatory design offers a potential solution to many of the problems of groupware development. It also threatens to complicate and confound it if the team has a lacking appreciation of the complex design issues. In this paper we have provided a cross disciplinary perspective on groupware development that focuses on those most greatly affected by its deployment: the users. We have noted the common failings of groupware, and from those observations we have forwarded a set of design principles that encapsulate both the problems and ways to avoid them.
Three systems specifically adhering to the principles have been developed by the authors. Mona [CT93] supports a conversation-based email platform that does not require explicit user guidance, Milo [Jon92] is a minimally-constraining collaborative writing tool, and TELEFREEK [CG93] supports an extensible and customisable
platform for communication and collaboration resources. These point systems are freely available from the authors.
References
---
[GNOT92] D Goldberg, D Nichols, BM Oki, and D Terry. Using collaborative filtering to weave an information...
|
{"Source-Url": "https://ir.canterbury.ac.nz/bitstream/handle/10092/11754/cockburn_jones_report_14-93.pdf;sequence=1", "len_cl100k_base": 6580, "olmocr-version": "0.1.53", "pdf-total-pages": 13, "total-fallback-pages": 0, "total-input-tokens": 36513, "total-output-tokens": 9018, "length": "2e12", "weborganizer": {"__label__adult": 0.0005459785461425781, "__label__art_design": 0.01058197021484375, "__label__crime_law": 0.0004732608795166016, "__label__education_jobs": 0.034912109375, "__label__entertainment": 0.0002357959747314453, "__label__fashion_beauty": 0.0003857612609863281, "__label__finance_business": 0.0011129379272460938, "__label__food_dining": 0.0005679130554199219, "__label__games": 0.0009708404541015624, "__label__hardware": 0.0029468536376953125, "__label__health": 0.00101470947265625, "__label__history": 0.0009474754333496094, "__label__home_hobbies": 0.00030040740966796875, "__label__industrial": 0.0008668899536132812, "__label__literature": 0.0010633468627929688, "__label__politics": 0.00038313865661621094, "__label__religion": 0.0007944107055664062, "__label__science_tech": 0.17138671875, "__label__social_life": 0.00040078163146972656, "__label__software": 0.06353759765625, "__label__software_dev": 0.705078125, "__label__sports_fitness": 0.0003509521484375, "__label__transportation": 0.0007147789001464844, "__label__travel": 0.00035262107849121094}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 39883, 0.024]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 39883, 0.42888]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 39883, 0.92005]], "google_gemma-3-12b-it_contains_pii": [[0, 238, false], [238, 2598, null], [2598, 6170, null], [6170, 9657, null], [9657, 13294, null], [13294, 16504, null], [16504, 20193, null], [20193, 23743, null], [23743, 27494, null], [27494, 30909, null], [30909, 34437, null], [34437, 37294, null], [37294, 39883, null]], "google_gemma-3-12b-it_is_public_document": [[0, 238, true], [238, 2598, null], [2598, 6170, null], [6170, 9657, null], [9657, 13294, null], [13294, 16504, null], [16504, 20193, null], [20193, 23743, null], [23743, 27494, null], [27494, 30909, null], [30909, 34437, null], [34437, 37294, null], [37294, 39883, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 39883, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 39883, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 39883, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 39883, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 39883, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 39883, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 39883, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 39883, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 39883, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 39883, null]], "pdf_page_numbers": [[0, 238, 1], [238, 2598, 2], [2598, 6170, 3], [6170, 9657, 4], [9657, 13294, 5], [13294, 16504, 6], [16504, 20193, 7], [20193, 23743, 8], [23743, 27494, 9], [27494, 30909, 10], [30909, 34437, 11], [34437, 37294, 12], [37294, 39883, 13]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 39883, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-09
|
2024-12-09
|
92ae42d7292dc46ab744edfb90be63eb71f09ffd
|
Spam, Spam, Spam
Objective To gain experience with Strings.
Note 1: You may work with a partner on this lab. If you do, please turn in only one copy of your completed program.
Note 2: Be sure to select “Show Terminal” from BlueJ’s “View” menu. This will help you identify run-time errors. It is especially important for this lab, as you will also be able to see the headers for all of your email on fuji.
Note 3: After you download the starter folder, open the project by clicking on the bird icon. Do not click on bluej.pkg.
Before the mid-90s, Spam was a canned “meat” product. These days, the term “spam” means something else — unwanted email.
This week we build a program that provides insights into how mail programs filter spam. Our spam filter is rather simple. The user provides a list of words called the filter list. The program searches the “from” and “subject” headers of all your mail messages and divides your mail into a good list and a spam list. The spam list contains all the messages that contain one or more words from the filter list, and the good list contains the messages that do not contain any filter words.
The user interface for the SpamFilter program is shown below:
The text fields on the top left side of the window specify the machine and account from which mail will be fetched. When the “Get Mail” button is pressed, the program connects to the mail server and downloads the headers of all available messages.
The program then decides whether each fetched message is a good message or spam, based on what the user enters in the JTextArea labeled “Filter Terms.” (JTextAreas are just like JTextFields except that they display more than one line of text.) Each line of text entered in this JTextArea is treated as an indicator of spam. If the “from” field or the “subject” field of a mail message contains a substring that is identical to one of these lines, the message is considered spam.
The JComboBox at the bottom of the screen allows the user to switch between displaying the good mail or the spam in the JTextArea that occupies the center of the program window.
You can use this program to connect to mailboxes we have set up for you on the mail server fuji.cs.williams.edu. You will connect to that server with the same username and password that you use to log in on our lab machines. These mailboxes are currently empty, and you will need to send yourself a few short pieces of mail to test out your program. Your address will have the form 21abc3@fuji.cs.williams.edu, where 21abc3 is replaced with your Computer Science user name.
We provide the code to actually communicate with a mail server, and our code does not modify the mailbox on the server in any way.
If using your own computer, PurpleAir may prevent you from connecting to our server. You will need to work on a lab computer if you’re unable to connect to the server.
Program Structure
Your program will consist of 4 main classes. We will provide one of those (MailConnection) as a library, so you won’t see it in the BlueJ project window.
SpamFilter. This will be the controller class for your program, and we will provide all of the code for it. This class creates the components of the interface and defines event-handling methods for them. Since this program does not use the canvas, it extends Controller instead of WindowController.
MailConnection. This class provides methods to contact a mail server through the network and download messages from the server. As noted above, we will provide the code for this class as a library. The MailConnection class provides several methods that are used by the Controller.
- **public MailConnection(String host, String userName, String password):** The constructor expects three Strings as parameters. The first must be the name of the mail server to contact. When using the mailbox we created for you, the host will be fuji.cs.williams.edu, and the userName and password parameters will be what you use to log in to our lab computers.
- **public boolean isConnected()** Returns true if the program currently has a connection to the mail server.
- **public void disconnect()** Closes the connection to the mail server. This does nothing if there is no active connection.
- **public int getNumMsgs()** Returns the number of messages in the mailbox you are connected to. This returns 0 if there is no active connection.
- **public String header(int msg)** Returns the headers of a mail message identified by the number passed in. Unlike Java, mailboxes number messages beginning with 1 and go up to the number of messages contained in the mailbox.
The mail headers are returned in one long string, such as:
```
Return-Path: <lvining@cs.williams.edu>
Received: from [137.165.8.62] (tcl303.cs.williams.edu [137.165.8.62])
by bull.cs.williams.edu (8.12.3p3/8.12.3) with ESMTP id hADDU9NG013481
for <colloquium@cs.williams.edu>; Fri, 10 Nov 2017 08:30:09 -0500 (EST)
(envelope-from lvining@bull.cs.williams.edu)
Mime-Version: 1.0
Message-Id: <a05200f02bbd9370948a5@[137.165.8.62]>
Date: Fri, 10 Nov 2017 08:30:01 -0500
To: colloquium@cs.williams.edu
From: Lauren Vining <lvining@cs.williams.edu>
Subject: colloquium
Content-Type: multipart/alternative; boundary=""""="""
Status: RO
```
Your spam filter will look at only the “From” and “Subject” headers. Part of your job, described below, is to extract just those headers from the long header list that header returns.
The header method returns an empty string if it is called when there is no connection.
Note that the example above is just one sample of how the complete mail header string might look. The actual string might be much longer, or the various parts of the header string (e.g., the “From”, “To”, “Date”, etc, might appear in different orders).
Message. You will construct a Message object for each mail message downloaded from the server. The class is simple. It has a constructor and three accessor methods:
- **public Message(String headers):** The constructor expects a String containing the message (or at least its header) as a parameter
- **public String getFrom():** Returns the “From:” line found in the header of this message.
- **public String getSubject():** Returns the “Subject:” line found in the header of this message.
- **public String toString():** Returns the “From” and “Subject” headers as a single string with a newline between them and a newline at the end.
MessageList. A MessageList holds a list of mail Messages. Internally, it uses an array to keep track of the members of the collection. To make it possible to create an array of an appropriate size, the constructor takes the maximum size of the collection as a parameter.
We provide the necessary constructor and an add method to add messages to a message list. You should write three methods:
public String toString(): This method invokes the toString method of the Message class to obtain Strings describing each of the messages in the list. It concatenates all of these descriptions together (separated from one another by extra newlines) and returns this large String as its result.
public MessageList getSpam(String[] filterWords): This method takes an array of Strings containing one String for each line entered in the filter JTextArea. It returns the spam. To do this, it creates a new MessageList and adds to it any messages that are spam.
public MessageList getGood(String[] filterWords): This method should take an array of Strings containing one String for each line entered in the filter JTextArea. It does the same thing as getSpam, except that it returns the good messages.
Suggestions For Designing These Classes.
- Extracting the “From” and “Subject” headers from the long string that header returns is part of your task. As shown earlier, the String that header returns actually contains multiple headers with a newline between each. To find just one header, you should find a string that begins with a newline character \n followed by “From:” or “Subject:” and ending at the next newline character. Be sure to handle the special case where the header you are looking for is the last header and does not end with a newline! You should use a case-insensitive comparison when looking for these strings, but the string returned from this method should be capitalized as in the original header.
- You will need to determine if a header is spam. You should use String methods to search the header for the presence of any String in the filter list. You should use a case-insensitive comparison for your spam comparisons.
Note that the user may have inadvertently added blank lines to the filter area. When you look for matches in the filtering methods, you should ignore any empty strings in the array of filter terms.
- You may find it useful to introduce other private methods to keep your code simple and to prevent repetitive code in several places.
Design
This week we will again require that you prepare a written design for your program before lab. At the beginning of the lab, the instructor will briefly examine each of your designs to make sure you are on the right track.
Your design should include the following:
1. A design for the Message class and its three methods.
2. A design for the three methods in the MessageList class. We suggest that you think about writing an additional method in MessageList that you can use in both filtering methods with the following declaration:
private boolean matchExists(String[] terms, String searchString)
This method will return true if any of the terms appear in searchString.
The more time you spend on your design, the faster you will be able to proceed.
Implementation Strategy
We suggest that you approach this problem in the following order:
- Since your temporary mailbox on fuji is currently empty, send yourself a few short pieces of email (to yourMacID@fuji.cs.williams.edu).
- Download the starter code for this project from the handouts web page. Open the BlueJ project by clicking on the bird icon. Do not click on bluej.pkg.
- Define the Message class. The SpamFilter class is initially set up to use a MailConnection to download the first message's header. This header string is used to create a new Message, and the SpamFilter then displays the results of calling getFrom, getSubject, and toString on that message. Once you implement the Message methods, the appropriate information should be displayed for it in the text area. However, none of the filter components will behave properly yet.
- Once you finish writing and testing the Message class, open the SpamFilter class and add the following code where it says “INSERT CODE HERE”:
```java
int numMessages = connection.getNumMsgs();
allMessages = new MessageList(numMessages);
for (int i = 0; i < numMessages; i++) {
Message m = new Message(connection.header(i + 1));
allMessages.add(m);
}
filterMessageList();
```
This will make the spam filter download all of the messages and then filter the message list according to which filter is currently selected. You will also need to comment out the lines before it that downloaded the first message for the previous step.
- Start working on the MessageList and write the toString method. Once the toString method is implemented, the from and subject lines for all messages downloaded from the server should appear in the window when you get your mail.
- The last step is to write the two filtering methods. The starter code in the message list contains a getGood that returns a message list of all messages and getSpam that returns an empty message list. Change the filter methods in the message list to work properly.
We also include some ideas for optional extensions at the end of this handout.
Submitting Your Work
Once you have saved your work in BlueJ, please perform the following steps to submit your assignment:
- First, return to the Finder. You can do this by clicking on the smiling Macintosh icon in your dock.
- From the “Go” menu at the top of the screen, select “Connect to Server...”.
- For the server address, type in “afp://Guest@fuji” and click “Connect”.
- A dialog box will pop up. Connect as a guest by selecting the “Guest” option.
- A selection box should appear. Select “Courses” and click “OK”.
- You should now see a Finder window with a “cs134” folder. Open this folder by double clicking on it.
• You should now see the drop-off folders for the three lab sections. Drag your “Lab9IDnnnn” folder into the appropriate lab section drop-off folder. When you do this, the Mac will warn you that you will not be able to look at this folder. That is fine. Just click “OK”.
• Log off of the computer before you leave.
You can submit your work up to 11 p.m. on Wednesday if you’re in the Monday afternoon lab; up to 6 p.m. on Thursday if you’re in the Monday night lab; and up to 9 p.m. on Thursday if you’re in the Tuesday morning lab. If you submit and later discover that your submission was flawed, you can submit again. We will grade the latest submission made before your lab deadline. The Mac will not let you submit again unless you change the name of your folder slightly. It does this to prevent another student from accidentally overwriting one of your submissions. Just add something to the folder name (like the word “revised”) and the re-submission will work fine.
Grading Guidelines
As always, we will evaluate your program for both style and correctness. Here are some specific items to keep in mind and focus on while writing your program:
Style
- Descriptive comments
- Good names
- Good use of constants
- Appropriate formatting
Design
- General correctness/design/efficiency issues, avoiding redundancy and unnecessary repetition
- Efficient use of conditionals and loops
- Parameters, variables, and scoping
- Correct use of arrays
- Good use of private methods (useful for avoiding repetitive code)
- Good use of Strings
Correctness
- Extracting from and subject headers, without extra newlines
- Displaying message list properly, in their original case-sensitive form
- getGood filter, case-insensitive, handling blank lines in the filter properly
- getSpam filter, case-insensitive, handling blank lines in the filter properly
You will write the `Message` class from scratch, and the following starter code will be given to you for `MessageList`. You may examine the `SpamFilter` code by downloading the starter project, but you should not need to read that file to complete your design.
```java
public class MessageList {
// array of message objects to keep the list
private Message messages[];
// number of entries being used in the messages array
private int count = 0;
// Constructs a new message collection with the given maximum size.
public MessageList(int maxSize) {
messages = new Message[maxSize];
}
// Add a new message to the list.
public void add(Message newMessage) {
if (count < messages.length) {
messages[count] = newMessage;
count++;
} else {
System.out.println("No More Space in Message List!!!");
}
}
public String toString() {
return "Complete MessageList.toString()";
}
/*
* CHANGE THIS METHOD
* It currently just returns all of the messages.
*/
public MessageList getGood(String[] filterTerms) {
MessageList resultList = new MessageList(messages.length);
for (int i = 0; i < count; i++) {
resultList.add(messages[i]);
}
return resultList;
}
/*
* CHANGE THIS METHOD
* It currently just returns an empty list.
*/
public MessageList getSpam(String[] filterTerms) {
return new MessageList(0);
}
}
```
Optional Extensions
If you wrap up early and would like to extend the SpamFilter, below are two ideas.
Be sure to well-document your extensions with BONUS: or EXTENSION: comments!
**Thresholds.** Most spam filters only filter mail whose “spam content” is deemed high. A message with a single spam word may not be spam, but one with perhaps 3 or more almost certainly is. This helps reduce false positives, in which good mail is marked as spam.
Add a threshold to your filter. In particular, change your program so that it only marks a message as spam if its headers contain $n$ or more occurrences of spam words. You should change the SpamFilter's interface so that the user can configure the threshold $n$ to anywhere between 1 and perhaps 5. (A JSlider might work well for this.)
**Experimenting with Inheritance.** Your program's interface includes several JTextFields each of which must be placed next to a JLabel describing its function. Rather than creating each of these separately in your program's begin method, define a new class of GUI components that combines a JLabel and a text field in such a way that you can treat them as a single GUI component.
You can create a new class of GUI components that can hold several other components together by defining a class that extends JPanel. To understand how this works, think about what you would have done if you decided to create the needed JLabels and JTextFields separately in your begin method. To ensure that they were kept together in the program's interface you would create a JPanel and add them both to the JPanel (which would then in turn be added to the content pane).
Suppose now, that you instead want to define a new class named LabeledTextField designed to combine a JLabel and a JTextField. If you define the new class as an extension of JPanel this is quite easy. Since any object of the new class is a JPanel, Swing will let you add the object to the content pane. Also, since the object is a JPanel, you can include code in the constructor for the new class that creates a JLabel and a JTextField and adds them to the object being created. Finally, if you associate the JTextField with an instance variable, then you can define a getText method for the new class which simply returns the result of invoking getText on the JTextField associated with the instance variable.
Alas, things are made a bit more complicated by the fact that your program requires two JTextFields and one JPasswordField, all of which need to have JLabels attached to them. You could just define two separate classes that extend JPanel as described above, but to maximize your exploration of inheritance we have something more elegant in mind.
First, define a class named LabeledTextComponent. This class has a single purpose: to be extended by LabeledTextField and LabeledPasswordField. The LabeledTextComponent class should extend JPanel. It should include an instance variable of type JTextField and a getText method that returns the String obtained by invoking getText on the instance variable. Its constructor, however, will not actually create a text field. Instead, all it will do is create a JLabel and add it to the JPanel. As a result, the only parameter to the constructor for this class will be the String to use when creating the JLabel. Thus, the following is a complete implementation of LabeledTextComponent:
```java
class LabeledTextComponent extends JPanel {
protected JTextField textField;
public LabeledTextComponent(String label) {
add(new JLabel(label));
}
public String getText() {
return textField.getText();
}
}
```
You will define the two desired classes, `LabeledTextField` and `LabeledPasswordField` as extensions of `LabeledTextComponent`. Each of the constructors for these two classes will take an integer that determines how wide the field should be and a `String` that determines what is initially displayed in the field, as well as the label necessary for the super class. The constructor for `LabeledTextField` will create a `JTextField` and add it to the object being constructed. The constructor for `LabeledPasswordField` will create a `JPasswordField` and add it to the object being constructed. Both classes will inherit `getText` from `LabeledTextComponent`.
Add these three classes, and change the `SpamFilter` to use them when building the interface components in `begin`.
|
{"Source-Url": "http://cs.williams.edu/~cs134/lab9-spam.pdf", "len_cl100k_base": 4417, "olmocr-version": "0.1.53", "pdf-total-pages": 9, "total-fallback-pages": 0, "total-input-tokens": 19941, "total-output-tokens": 4940, "length": "2e12", "weborganizer": {"__label__adult": 0.0006661415100097656, "__label__art_design": 0.0003352165222167969, "__label__crime_law": 0.0004258155822753906, "__label__education_jobs": 0.00406646728515625, "__label__entertainment": 8.159875869750977e-05, "__label__fashion_beauty": 0.0002434253692626953, "__label__finance_business": 0.00016033649444580078, "__label__food_dining": 0.0006346702575683594, "__label__games": 0.0009226799011230468, "__label__hardware": 0.0009207725524902344, "__label__health": 0.0004451274871826172, "__label__history": 0.00021409988403320312, "__label__home_hobbies": 0.00017702579498291016, "__label__industrial": 0.0003933906555175781, "__label__literature": 0.00032019615173339844, "__label__politics": 0.0002586841583251953, "__label__religion": 0.0006794929504394531, "__label__science_tech": 0.0012941360473632812, "__label__social_life": 0.0002551078796386719, "__label__software": 0.00330352783203125, "__label__software_dev": 0.98291015625, "__label__sports_fitness": 0.0004761219024658203, "__label__transportation": 0.000732421875, "__label__travel": 0.000293731689453125}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 20200, 0.01146]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 20200, 0.30287]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 20200, 0.86468]], "google_gemma-3-12b-it_contains_pii": [[0, 1207, false], [1207, 3364, null], [3364, 6428, null], [6428, 9675, null], [9675, 12401, null], [12401, 14255, null], [14255, 15786, null], [15786, 19425, null], [19425, 20200, null]], "google_gemma-3-12b-it_is_public_document": [[0, 1207, true], [1207, 3364, null], [3364, 6428, null], [6428, 9675, null], [9675, 12401, null], [12401, 14255, null], [14255, 15786, null], [15786, 19425, null], [19425, 20200, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, false], [5000, 20200, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 20200, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 20200, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 20200, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 20200, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 20200, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 20200, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 20200, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 20200, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 20200, null]], "pdf_page_numbers": [[0, 1207, 1], [1207, 3364, 2], [3364, 6428, 3], [6428, 9675, 4], [9675, 12401, 5], [12401, 14255, 6], [14255, 15786, 7], [15786, 19425, 8], [19425, 20200, 9]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 20200, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-06
|
2024-12-06
|
c6ea644f584550542f1b9c67d4a8135a5d154364
|
University of Illinois
Charm++/Converse Parallel Programming System Software
Non-Exclusive, Non-Commercial Use License
Upon execution of this Agreement by the party identified below ("Licensee"), The Board of Trustees of the University of Illinois ("Illinois"), on behalf of The Parallel Programming Laboratory ("PPL") in the Department of Computer Science, will provide the Charm++/Converse Parallel Programming System software ("Charm++/Converse") in Binary Code ("Binary Code") to Licensee, subject to the following terms and conditions. For purposes of this Agreement, Binary Code is the compiled code, which is ready to run on Licensee’s computer. Source code consists of a set of files which contain the actual program commands that are compiled to form the Binary Code.
1. The Software is intellectual property owned by Illinois, and all right, title and interest, including copyright, remain with Illinois. Illinois grants, and Licensee hereby accepts, a restricted, non-exclusive, non-transferable license to use the Software for academic, research and internal business purposes only, e.g., not for commercial use (see Clause 7 below), without a fee.
2. Licensee may, at its own expense, create and freely distribute complimentary works that interoperate with the Software, directing others to the PPL server (http://charm.cs.illinois.edu) to license and obtain the Software itself. Licensee may, at its own expense, modify the Software to make derivative works. Except as explicitly provided below, this License shall apply to any derivative work as it relates to the original Software distributed by Illinois. Any derivative work should be clearly marked and renamed to notify users that it is a modified version and not the original Software distributed by Illinois. Licensee agrees to reproduce the copyright notice and other proprietary markings on any derivative work and to include in the documentation of such work the acknowledgement:
“This software includes code developed by the Parallel Programming Laboratory in the Department of Computer Science at the University of Illinois at Urbana-Champaign.”
Licensee may redistribute without restriction works with up to 1/2 of their non-comment source code derived from at most 1/10 of the non-comment source code developed by Illinois and contained in the Software, provided that the above directions for notice and acknowledgement are observed. Any other distribution of the Software or any derivative work requires a separate license with Illinois. Licensee may contact Illinois (kale@illinois.edu) to negotiate an appropriate license for such distribution.
3. Except as expressly set forth in this Agreement, THIS SOFTWARE IS PROVIDED “AS IS” AND ILLINOIS MAKES NO REPRESENTATIONS AND EXTENDS NO WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, OR THAT THE USE OF THE SOFTWARE WILL NOT INFRINGE ANY PATENT, TRADEMARK, OR OTHER RIGHTS. LICENSEE ASSUMES THE ENTIRE RISK AS TO THE RESULTS AND PERFORMANCE OF THE SOFTWARE AND/OR ASSOCIATED MATERIALS. LICENSEE AGREES THAT UNIVERSITY SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, OR INCIDENTAL DAMAGES WITH RESPECT TO ANY CLAIM BY LICENSEE OR ANY THIRD PARTY ON ACCOUNT OF OR ARISING FROM THIS AGREEMENT OR USE OF THE SOFTWARE AND/OR ASSOCIATED MATERIALS.
4. Licensee understands the Software is proprietary to Illinois. Licensee agrees to take all reasonable steps to ensure that the Software is protected and secured from unauthorized disclosure, use, or release and will treat it with at least the same level of care as Licensee would use to protect and secure its own proprietary computer programs and/or information, but using no less than a reasonable standard of care. Licensee agrees to provide the Software only to any other person or entity who has registered with Illinois. If license is not registering as an individual but as an institution or corporation each member of the institution or corporation who has access to or use Software must agree to and abide by the terms of this license. If Licensee becomes aware of any unauthorized licensing, copying or use of the Software, Licensee shall promptly notify Illinois in writing. Licensee expressly agrees to use the Software only in the manner and for the specific uses authorized in this Agreement.
5. By using or copying this Software, Licensee agrees to abide by the copyright law and all other applicable laws of the U.S. including, but not limited to, export control laws and the terms of this license. Licensee may redistribute without restriction works with up to 1/2 of their non-comment source code derived from at most 1/10 of the non-comment source code developed by Illinois and contained in the Software, provided that the above directions for notice and acknowledgement are observed. Any other distribution of the Software or any derivative work requires a separate license with Illinois. Licensee may contact Illinois (kale@illinois.edu) to negotiate an appropriate license for such distribution.
6. The user agrees that any reports or published results obtained with the Software will acknowledge its use by the appropriate citation as follows:
"Charm++/Converse was developed by the Parallel Programming Laboratory in the Department of Computer Science at the University of Illinois at Urbana-Champaign."
Any published work which utilizes Charm++ shall include the following reference:
Any published work which utilizes Converse shall include the following reference:
Electronic documents will include a direct link to the official Charm++ page at http://charm.cs.illinois.edu/
7. Commercial use of the Software, or derivative works based thereon, REQUIRES A COMMERCIAL LICENSE: Should Licensee wish to make commercial use of the Software, Licensee will contact Illinois (kale@illinois.edu) to negotiate an appropriate license for such use. Commercial use includes:
(a) integration of all or part of the Software into a product for sale, lease or license by or on behalf of Licensee to third parties, or
(b) distribution of the Software to third parties that need it to commercialize product sold or licensed by or on behalf of Licensee.
8. Government Rights. Because substantial governmental funds have been used in the development of Charm++/Converse, any possession, use or sublicense of the Software by or to the United States government shall be subject to such required restrictions.
9. Charm++/Converse is being distributed as a research and teaching tool and as such, PPL encourages contributions from users of the code that might, at Illinois’ sole discretion, he used or incorporated to make the basic operating framework of the Software a more stable, flexible, and/or useful product. Licensee who contribute their code to become an internal portion of the Software agrees that such code may be distributed by Illinois under the terms of this License and may be required to sign an “Agreement Regarding Contributory Code for Charm++/Converse Software” before Illinois can accept it (contact kale@illinois.edu for a copy).
UNDERSTOOD AND AGREED.
Contact Information:
The best contact path for licensing issues is by e-mail to kale@illinois.edu or send correspondence to:
Prof. L. V. Kale
Dept. of Computer Science
University of Illinois
201 N. Goodwin Ave
Urbana, Illinois 61801 USA
FAX: (217) 244-6500
## Contents
1 Motivation
2 Basic TCharm Programming
2.1 Global Variables
2.2 Input/Output
2.3 Migration-Based Load Balancing
3 Advanced TCharm Programming
3.1 Writing a Pup Routine
3.2 Readonly Global Variables
4 Combining Frameworks
5 Command-line Options
6 Writing a library using TCharm
1 Motivation
Charm++ includes several application frameworks, such as the Finite Element Framework, the Multiblock Framework, and AMPI. These frameworks do almost all their work in load balanced, migratable threads.
The Threaded Charm++ Framework, TCharm, provides both common runtime support for these threads and facilities for combining multiple frameworks within a single program. For example, you can use TCharm to create a Finite Element Framework application that also uses AMPI to communicate between Finite Element chunks.
Specifically, TCharm provides language-neutral interfaces for:
1. Program startup, including read-only global data setup and the configuration of multiple frameworks.
2. Run-time load balancing, including migration.
3. Program shutdown.
The first portion of this manual describes the general properties of TCharm common to all the application frameworks, such as program contexts and how to write migratable code. The second portion describes in detail how to combine separate frameworks into a single application.
2 Basic TCharm Programming
Any routine in a TCharm program runs in one of two contexts:
Serial Context Routines that run on only one processor and with only one set of data. There are absolutely no limitations on what a serial context routine can do—it is as if the code were running in an ordinary serial program. Startup and shutdown routines usually run in the serial context.
Parallel Context Routines that run on several processors, and may run with several different sets of data on a single processor. This kind of routine must obey certain restrictions. The program’s main computation routines always run in the parallel context.
Parallel context routines run in a migratable, user-level thread maintained by TCharm. Since there are normally several of these threads per processor, any code that runs in the parallel context has to be thread-safe. However, TCharm is non-preemptive, so it will only switch threads when you make a blocking call, like “MPI_Recv” or “FEM_Update_field”.
2.1 Global Variables
By “global variables”, we mean anything that is stored at a fixed, preallocated location in memory. In C, this means variables declared at file scope or with the static keyword. In Fortran, this is either variables that are part of a COMMON block, declared inside a MODULE or variables with the SAVE attribute.
Global variables are shared by all the threads on a processor, which makes using global variables extremely error prone. To see why this is a problem, consider a program fragment like:
```c
foo=a
call MPI_Recv(...)
b=foo
```
After this code executes, we might expect b to always be equal to a. but if foo is a global variable, MPI_Recv may block and foo could be changed by another thread.
For example, if two threads execute this program, they could interleave like:
At this point, thread 1 might expect b to be 1; but it will actually be 2. From the point of view of thread 1, the global variable foo suddenly changed its value during the call to MPIRecv.
There are several possible solutions to this problem:
- Never use global variables—only use parameters or local variables. This is the safest and most general solution. One standard practice is to collect all the globals into a C struct or Fortran type named “Globals”, and pass a pointer to this object to all your subroutines. This also combines well with the pup method for doing migration-based load balancing, as described in Section 3.1.
- Never write different values to global variables. If every thread writes the same value, global variables can be used safely. For example, you might store some parameters read from a configuration file like the simulation timestep $\Delta t$. See Section 3.2 for another, more convenient way to set such variables.
- Never issue a blocking call while your global variables are set. This will not work on a SMP version of Charm++, where several processors may share a single set of global variables. Even on a non-SMP version, this is a dangerous solution, because someday someone might add a blocking call while the variables are set. This is only a reasonable solution when calling legacy code or using old serial libraries that might use global variables.
The above only applies to routines that run in the parallel context. There are no restrictions on global variables for serial context code.
2.2 Input/Output
In the parallel context, there are several limitations on open files. First, several threads may run on one processor, so Fortran Logical Unit Numbers are shared by all the threads on a processor. Second, open files are left behind when a thread migrates to another processor—it is a crashing error to open a file, migrate, then try to read from the file.
Because of these restrictions, it is best to open files only when needed, and close them as soon as possible. In particular, it is best if there are no open files whenever you make blocking calls.
2.3 Migration-Based Load Balancing
The Charm++ runtime framework includes an automatic run-time load balancer, which can monitor the performance of your parallel program. If needed, the load balancer can “migrate” threads from heavily-loaded processors to more lightly-loaded processors, improving the load balance and speeding up the program. For this to be useful, you need to pass the link-time argument -balancer B to set the load balancing algorithm, and the run-time argument +vp N (use N virtual processors) to set the number of threads. The ideal number of threads per processor depends on the problem, but we’ve found five to a hundred threads per processor to be a useful range.
When a thread migrates, all its data must be brought with it. “Stack data”, such as variables declared locally in a subroutine, will be brought along with the thread automatically. Global data, as described in Section 2.1, is never brought with the thread and should generally be avoided.
“Heap data” in C is structures and arrays allocated using malloc or new; in Fortran, heap data is TYPEs or arrays allocated using ALLOCATE. To bring heap data along with a migrating thread, you have two choices: write a pup routine or use isomalloc. Pup routines are described in Section 3.1.
Isomalloc is a special mode which controls the allocation of heap data. You enable isomalloc allocation using the link-time flag “-memory isomalloc”. With isomalloc, migration is completely transparent—all
your allocated data is automatically brought to the new processor. The data will be unpacked at the same location (the same virtual addresses) as it was stored originally; so even cross-linked data structures that contain pointers still work properly.
The limitations of isomalloc are:
- Wasted memory. Isomalloc uses a special interface\(^1\) to acquire memory, and the finest granularity that can be acquired is one page, typically 4KB. This means if you allocate a 2-entry array, isomalloc will waste an entire 4KB page. We should eventually be able to reduce this overhead for small allocations.
- Limited space on 32-bit machines. Machines where pointers are 32 bits long can address just 4GB \(2^{32}\) bytes) of virtual address space. Additionally, the operating system and conventional heap already use a significant amount of this space; so the total virtual address space available is typically under 1GB. With isomalloc, all processors share this space, so with just 20 processors the amount of memory per processor is limited to under 50MB! This is an inherent limitation of 32-bit machines; to run on more than a few processors you must use 64-bit machines or avoid isomalloc.
## 3 Advanced TCharm Programming
The preceding features are enough to write simple programs that use TCharm-based frameworks. These more advanced techniques provide the user with additional capabilities or flexibility.
### 3.1 Writing a Pup Routine
The runtime system can automatically move your thread stack to the new processor, but unless you use isomalloc, you must write a pup routine to move any global or heap-allocated data to the new processor. A pup (Pack/UnPack) routine can perform both packing (converting your data into a network message) and unpacking (converting the message back into your data). A pup routine is passed a pointer to your data block and a special handle called a “pupper”, which contains the network message.
In a pup routine, you pass all your heap data to routines named pup_type or fpup_type, where type is either a basic type (such as int, char, float, or double) or an array type (as before, but with a “s” suffix). Depending on the direction of packing, the pupper will either read from or write to the values you pass—normally, you shouldn’t even know which. The only time you need to know the direction is when you are leaving a processor, or just arriving. Correspondingly, the pupper passed to you may be deleting (indicating that you are leaving the processor, and should delete your heap storage after packing), unpacking (indicating you’ve just arrived on a processor, and should allocate your heap storage before unpacking), or neither (indicating the system is merely sizing a buffer, or checkpointing your values).
Pup functions are much easier to write than explain— a simple C heap block and the corresponding pup function is:
```c
typedef struct {
int n1; /*Length of first array below*/
int n2; /*Length of second array below*/
double *arr1; /*Some doubles, allocated on the heap*/
int *arr2; /*Some ints, allocated on the heap*/
} my_block;
void pup_my_block(pup_er p, my_block *m)
{
if (pup_isUnpacking(p)) /*Arriving on new processor*/
m->arr1=malloc(m->n1*sizeof(double));
m->arr2=malloc(m->n2*sizeof(int));
}
```
\(^1\) The interface used is mmap.
pup_doubles(p,m->arr1,m->n1);
pup_ints(p,m->arr2,m->n2);
if (pup_isDeleting(p)) { /*Leaving old processor*/
free(m->arr1);
free(m->arr2);
}
This single pup function can be used to copy the my_block data into a message buffer and free the old heap storage (deleting pupper); allocate storage on the new processor and copy the message data back (unpacking pupper); or save the heap data for debugging or checkpointing.
A Fortran block TYPE and corresponding pup routine is as follows:
```fortran
MODULE my_block_mod
TYPE my_block
INTEGER :: n1,n2x,n2y
DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:) :: arr1
INTEGER, ALLOCATABLE, DIMENSION(:, :) :: arr2
END TYPE
END MODULE
SUBROUTINE pup_my_block(p,m)
IMPLICIT NONE
USE my_block_mod
USE pupmod
INTEGER :: p
TYPE(my_block) :: m
IF (fpup_isUnpacking(p)) THEN
ALLOCATE(m%arr1(m%n1))
ALLOCATE(m%arr2(m%n2x,m%n2y))
END IF
call fpup_doubles(p,m%arr1,m%n1)
call fpup_ints(p,m%arr2,m%n2x*m%n2y)
IF (fpup_isDeleting(p)) THEN
DEALLOCATE(m%arr1)
DEALLOCATE(m%arr2)
END IF
END SUBROUTINE
```
You indicate to TCHARM that you want a pup routine called using the routine below. An arbitrary number of blocks can be registered in this fashion.
```c
void TCHARM_Register(void *block, TCHARM_PupFn pup_fn)
SUBROUTINE TCHARM_Register(block,pup_fn)
TYPE(varies), POINTER :: block
SUBROUTINE :: pup_fn
Associate the given data block and pup function. Can only be called from the parallel context. For the declarations above, you call TCHARM_Register as:
/*In C/C++ driver() function*/
my_block m;
TCHARM_Register(m,(TCHARM_PupFn)pup_my_block);
```
6
!- In Fortran driver subroutine
use my_block_mod
interface
subroutine pup_my_block(p,m)
use my_block_mod
INTEGER :: p
TYPE(my_block) :: m
end subroutine
end interface
TYPE(my_block), TARGET :: m
call TCHARM_Register(m,pup_my_block)
Note that the data block must be allocated on the stack. Also, in Fortran, the "TARGET" attribute must be used on the block (as above) or else the compiler may not update values during a migration, because it believes only it can access the block.
void TCHARM_Migrate()
subroutine TCHARM_Migrate()
Informs the load balancing system that you are ready to be migrated, if needed. If the system decides to migrate you, the pup function passed to TCHARM_Register will first be called with a sizing pupper, then a packing, deleting pupper. Your stack and pupped data will then be sent to the destination machine, where your pup function will be called with an unpacking pupper. TCHARM_Migrate will then return. Can only be called from in the parallel context.
3.2 Readonly Global Variables
You can also use a pup routine to set up initial values for global variables on all processors. This pup routine is called with only a pup handle, just after the serial setup routine, and just before any parallel context routines start. The pup routine is never called with a deleting pup handle, so you need not handle that case.
A C example is:
```c
int g_arr[17];
double g_f;
int g_n; /* Length of array below */
float *g_allocated; /* heap-allocated array */
void pup_my Globals(pup_er p)
{
pup_ints(p,g_arr,17);
pup_double(p,&g_f);
pup_int(p,&g_n);
if (pup_isUnpacking(p)) { /* Arriving on new processor */
g_allocated=malloc(g_n*sizeof(float));
}
pup_floats(p,g_allocated,g_n);
}
```
A fortran example is:
```fortran
MODULE my_globals_mod
INTEGER :: g_arr(17)
DOUBLE PRECISION :: g_f
INTEGER :: g_n
SINGLE PRECISION, ALLOCATABLE :: g_allocated(:)
```
7
SUBROUTINE pup_my_globals(p)
IMPLICIT NONE
USE my_globals_mod
USE pupmod
INTEGER :: p
call fpup_ints(p,g_arr,17)
call fpup_double(p,g_f)
call fpup_int(p,g_n)
IF (fpup_isUnpacking(p)) THEN
ALLOCATE(g_allocated(g_n))
END IF
call fpup_floats(p,g_allocated,g_n)
END SUBROUTINE
You register your global variable pup routine using the method below. Multiple pup routines can be registered the same way.
void TCHARM_Readonly_globals(TCharmPupGlobalFn pup_fn)
SUBROUTINE TCHARM_Readonly_globals(pup_fn)
SUBROUTINE :: pup_fn
4 Combining Frameworks
This section describes how to combine multiple frameworks in a single application. You might want to do this, for example, to use AMPI communication inside a finite element method solver.
You specify how you want the frameworks to be combined by writing a special setup routine that runs when the program starts. The setup routine must be named TCHARM_User_setup. If you declare a user setup routine, the standard framework setup routines (such as the FEM framework's init routine) are bypassed, and you do all the setup in the user setup routine.
The setup routine creates a set of threads and then attaches frameworks to the threads. Several different frameworks can be attached to one thread set, and there can be several sets of threads; however, the most frameworks cannot be attached more than once to single set of threads. That is, a single thread cannot have two attached AMPI frameworks, since the MPI_COMM_WORLD for such a thread would be indeterminate.
void TCHARM_Create(int nThreads, TCharmThreadStartFn thread_fn)
SUBROUTINE TCHARM_Create(nThreads,thread_fn)
INTEGER, INTENT(in) :: nThreads
SUBROUTINE :: thread_fn
Create a new set of TCharm threads of the given size. The threads will execute the given function, which is normally your user code. You should call TCHARM_Get_num_chunks() to get the number of threads from the command line. This routine can only be called from your TCHARM_User_setup routine.
You then attach frameworks to the new threads. The order in which frameworks are attached is irrelevant, but attach commands always apply to the current set of threads.
To attach a chare array to the TCharm array, use:
CkArrayOptions TCHARM_Attach_start(CkArrayID *retTCharmArray, int *retNumElts)
This function returns a CkArrayOptions object that will bind your chare array to the TCharm array, in addition to returning the TCharm array proxy and number of elements by reference. If you are using frameworks like AMPI, they will automatically attach themselves to the TCharm array in their initialization routines.
5 Command-line Options
The complete set of link-time arguments relevant to TCharm is:
- **-memory isomalloc** Enable memory allocation that will automatically migrate with the thread, as described in Section 2.3.
- **-balancer B** Enable this load balancing strategy. The current set of balancers B includes RefineLB (make only small changes each time), MetisLB (remap threads using graph partitioning library), HeapCentLB (remap threads using a greedy algorithm), and RandCentLB (remap threads to random processors). You can only have one balancer.
- **-module F** Link in this framework. The current set of frameworks F includes ampi, collide, fem, mblock, and netfem. You can link in multiple frameworks.
The complete set of command-line arguments relevant to TCharm is:
+ **p N** Run on N physical processors.
+ **vp N** Create N “virtual processors”, or threads. This is the value returned by TCharmGetNumChunks.
+ **++debug** Start each program in a debugger window. See Charm++ Installation and Usage Manual for details.
+ **+tcharm_stacksize N** Create N-byte thread stacks. This value can be overridden using TCharmSetStackSize().
+ **+tcharm_nomig** Disable thread migration. This can help determine whether a problem you encounter is caused by our migration framework.
+ **+tcharm_nothread** Disable threads entirely. This can help determine whether a problem you encounter is caused by our threading framework. This generally only works properly when using only one thread.
+ **+tcharm_trace F** Trace all calls made to the framework F. This can help to understand a complex program. This feature is not available if Charm++ was compiled with CMK_OPTIMIZE.
6 Writing a library using TCharm
Until now, things were presented from the perspective of a user—one who writes a program for a library written on TCharm. This section gives an overview of how to go about writing a library in Charm++ that uses TCharm.
- Compared to using plain MPI, TCharm provides the ability to access all of Charm++, including arrays and groups.
- Compared to using plain Charm++, using TCharm with your library automatically provides your users with a clean C/F90 API (described in the preceding chapters) for basic thread memory managment, I/O, and migration. It also allows you to use a convenient ”thread-suspend()” and ”thread-resume()” API for blocking a thread, and works properly with the load balancer, unlike CthSuspend/CthAwaken.
The overall scheme for writing a TCharm-based library ”Foo” is:
1. You must provide a FOO_Init routine that creates anything you’ll need, which normally includes a Chare Array of your own objects. The user will call your FOO_Init routine from their main work routine; and normally FOO_Init routines are collective.
2. In your FOO_Init routine, create your array bound it to the running TCharm threads, by creating it using the CkArrayOptions returned by TCHARM_Attach_start. Be sure to only create the array once, by checking if you’re the master before creating the array.
One simple way to make the non-master threads block until the corresponding local array element is created is to use TCharm semaphores. These are simply a one-pointer slot you can assign using TCharm::semaPut and read with TCharm::semaGet. They’re useful in this context because a TCharm::semaGet blocks if a local TCharm::semaGet hasn’t yet executed.
//This is either called by FooFallbackSetup mentioned above, or by the user
//directly from TCHARM_User_setup (for multi-module programs)
void FOO_Init(void)
{
if (TCHARM_Element()==0) {
CkArrayID threadsAID; int nchunks;
CkArrayOptions opts=TCHARM_Attach_start(&threadsAID,&nchunks);
//actually create your library array here (FooChunk in this case)
CkArrayID aid = CProxy_FooChunk::ckNew(opt);
}
FooChunk *arr=(FooChunk *)TCharm::semaGet(FOO_TCHARM_SEMAID);
}
3. Depending on your library API, you may have to set up a thread-private variable(Ctv) to point to your library object. This is needed to regain context when you are called by the user. A better design is to avoid the Ctv, and instead hand the user an opaque handle that includes your array proxy.
//_fooptr is the Ctv that points to the current chunk FooChunk and is only valid in
//routines called from fooDriver()
CtvStaticDeclare(FooChunk *, _fooptr);
/* The following routine is listed as an initcall in the .ci file */
//initcall*/ void fooNodeInit(void)
{
CtvInitialize(FooChunk*, _fooptr);
}
4. Define the array used by the library
class FooChunk: public TCharmClient1D {
CProxy_FooChunk thisProxy;
public:
//called by TCharmClient1D when thread changes
virtual void setupThreadPrivate(CthThread forThread)
{
CtvAccessOther(forThread, _fooptr) = this;
}
FooChunk(CkArrayID aid):TCharmClient1D(aid)
{
thisProxy = this;
tCharmClientInit();
TCharm::semaPut(FOO_TCHARM_SEMAID,this);
//add any other initialization here
}
virtual void pup(PUP::er &p) {
TCharmClient1D::pup(p);
//usual pup calls
}
// ...any other calls you need...
int doCommunicate(...);
void recvReply(someReplyMsg *m);
........
5. Block a thread for communication using thread-suspend and thread-resume
int FooChunk::doCommunicate(...) {
replyGoesHere = NULL;
thisProxy[destChunk].sendRequest(...);
thread->suspend(); //wait for reply to come back
return replyGoesHere->data;
}
void FooChunk::recvReply(someReplyMsg *m) {
if(replyGoesHere!=NULL) CkAbort("FooChunk: unexpected reply
n");
replyGoesHere = m;
thread->resume(); //Got the reply -- start client again
}
6. Add API calls. This is how user code running in the thread interacts with the newly created library. Calls to TCHARM_API_TRACE macro must be added to the start of every user-callable method. In addition to tracing, these disable isomalloc allocation.
The charm-api.h macros CDECL, FDECL and FTN_NAME should be used to provide both C and FORTRAN versions of each API call. You should use the "MPI capitalization standard", where the library name is all caps, followed by a capitalized first word, with all subsequent words lowercase, separated by underscores. This capitalization system is consistent, and works well with case-insensitive languages like Fortran.
Fortran parameter passing is a bit of an art, but basically for simple types like int (INTEGER in fortran), float (SINGLE PRECISION or REAL*4), and double (DOUBLE PRECISION or REAL*8), things work well. Single parameters are always passed via pointer in Fortran, as are arrays. Even though Fortran indexes arrays based at 1, it will pass you a pointer to the first element, so you can use the regular C indexing. The only time Fortran indexing need be considered is when the user passes you an index—the int index will need to be decremented before use, or incremented before a return.
CDECL void FOO_Communicate(int x, double y, int * arr) {
TCHARM_API_TRACE("FOO_Communicate", "foo"); //2nd parameter is the name of the library
FooChunk *f = CtvAccess(_fooptr);
f->doCommunicate(x, y, arr);
}
/In fortran, everything is passed via pointers
FDECL void FTN_NAME(FOO_COMMUNICATE, foo_communicate)
(int *x, double *y, int *arr)
{
TCHARM_API_TRACE("FOO_COMMUNICATE", "foo");
FooChunk *f = CtvAccess(_fooptr);
f->doCommunicate(*x, *y, arr);
}
|
{"Source-Url": "http://charm.cs.illinois.edu/manuals/pdf/tcharm.pdf", "len_cl100k_base": 7128, "olmocr-version": "0.1.53", "pdf-total-pages": 13, "total-fallback-pages": 0, "total-input-tokens": 27107, "total-output-tokens": 8003, "length": "2e12", "weborganizer": {"__label__adult": 0.00022327899932861328, "__label__art_design": 0.00020325183868408203, "__label__crime_law": 0.0003008842468261719, "__label__education_jobs": 0.000690460205078125, "__label__entertainment": 5.6624412536621094e-05, "__label__fashion_beauty": 7.712841033935547e-05, "__label__finance_business": 0.00021755695343017575, "__label__food_dining": 0.00020635128021240232, "__label__games": 0.00054931640625, "__label__hardware": 0.0007038116455078125, "__label__health": 0.0001819133758544922, "__label__history": 0.00012010335922241212, "__label__home_hobbies": 5.632638931274414e-05, "__label__industrial": 0.0003120899200439453, "__label__literature": 0.00012767314910888672, "__label__politics": 0.00013899803161621094, "__label__religion": 0.0002658367156982422, "__label__science_tech": 0.010284423828125, "__label__social_life": 6.079673767089844e-05, "__label__software": 0.0125274658203125, "__label__software_dev": 0.97216796875, "__label__sports_fitness": 0.0002319812774658203, "__label__transportation": 0.0003147125244140625, "__label__travel": 0.00012409687042236328}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 31647, 0.01916]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 31647, 0.381]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 31647, 0.8555]], "google_gemma-3-12b-it_contains_pii": [[0, 0, null], [0, 7884, false], [7884, 8195, null], [8195, 11052, null], [11052, 14646, null], [14646, 17990, null], [17990, 19713, null], [19713, 21643, null], [21643, 24263, null], [24263, 27019, null], [27019, 29262, null], [29262, 31389, null], [31389, 31647, null]], "google_gemma-3-12b-it_is_public_document": [[0, 0, null], [0, 7884, true], [7884, 8195, null], [8195, 11052, null], [11052, 14646, null], [14646, 17990, null], [17990, 19713, null], [19713, 21643, null], [21643, 24263, null], [24263, 27019, null], [27019, 29262, null], [29262, 31389, null], [31389, 31647, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, false], [5000, 31647, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 31647, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 31647, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 31647, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 31647, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 31647, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 31647, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 31647, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 31647, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 31647, null]], "pdf_page_numbers": [[0, 0, 1], [0, 7884, 2], [7884, 8195, 3], [8195, 11052, 4], [11052, 14646, 5], [14646, 17990, 6], [17990, 19713, 7], [19713, 21643, 8], [21643, 24263, 9], [24263, 27019, 10], [27019, 29262, 11], [29262, 31389, 12], [31389, 31647, 13]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 31647, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-08
|
2024-12-08
|
60967011ff6653540e41da82c09e11b92866623e
|
Exploring SOA Pattern Performance using Coupled Transformations and Performance Models
Nariman Mani, Dorina C. Petriu, Murray Woodside
Department of Systems and Computer Engineering, Carleton University
Ottawa, Ontario, Canada
{nmani | petriu | cmw}@sce.carleton.ca
Abstract—Service Oriented Architecture (SOA) patterns can be applied to improve different qualities of SOA designs. The performance impact of a pattern (improvement or degradation) may affect its use, so we assess its impact by automatically generated performance models for the original design and for each candidate pattern and pattern variation. This paper proposes a technique to incrementally propagate the changes from the software to the performance model. The technique formally records the refactoring of the design model when applying a pattern, and uses this record to generate a coupled transformation of the performance model. The SOA design is modeled in UML extended with two profiles, SoaML and MARTE; the patterns are specified using Role Based Modeling and the performance model is expressed in Layered Queuing Networks. Application of the process, and pattern performance exploration, is demonstrated on a case study.
Keywords- Software performance model, service oriented systems, SOA pattern, coupled transformation, LQN
I. INTRODUCTION
In designing SOA (Service Oriented Architecture) systems, SOA patterns [1] are proposed as generic solutions to problems in the architecture, design and implementation. The patterns may have a substantial impact on performance, and we wish to evaluate this with a performance model (PModel) generated automatically from a software design model (SModel) and the pattern description. The baseline PModel may be created by an automated transformation as in PUMA (Performance from Unified Model Analysis) [2]. The automated refactoring of the PModel to reflect application of a pattern, using coupled transformations of the SModel and the PModel, is the subject of this work. Automating the refactoring makes it easier to consider the performance issues, and to rapidly consider a (possibly large) set of variations on a pattern. It also reveals the causal connections between the design changes and the performance issues, which may be of value to the designer. Manually refactoring the SModel and then regenerating the PModel using PUMA is a viable alternative but may suffer from inconsistency in the refactoring. In [3] we studied the impact of SModel changes to PModel due to application of SOA design patterns.
This research describes a coupled transformation technique to incrementally propagate design changes to the PModel by: (A) definition of the pattern using a role-based modeling technique; (B) formal recording the SOA design refactoring; (C) automatic derivation of the corresponding performance model changes; (D) application of the changes to the PModel. This paper describes (A) – (C) but does not address the implementation of the transformation in step (D). The SOA SModel is captured in UML with the OMG profiles SoaML (Service Oriented Architecture Modeling Language) [4] and MARTE (Modeling and Analysis of Real-Time and Embedded Systems) [5] for performance information. The Role Based Modeling Language (RBML) [6] is used to formally define each SOA design pattern in terms of first, the set of SModel elements that represent the problem addressed by the pattern and second, those that constitute the solution. The novel contributions of this work are the coupled transformation in Section VI, and the process (systematic and automatic) that supports its use, including the formal recording of the changes for SModel refactoring.
The paper is organized as follows: Section II presents related work, Section III surveys the approach; Section IV describes the models; Section V describes the SModel transformation rules; Section VI presents the coupled transformation; Section VII describes a case study. Finally Section VIII concludes the paper.
II. RELATED WORK
The relationship of PModels to SModels, and the derivation of one from the other, is the subject of considerable work, including diverse target PModel types such as Queuing Networks, Layered Queuing Networks (LQNs) [7] and Stochastic Petri nets [8]. The general approach of PUMA integrates diverse types of PModel and SModel [2]. This work uses it with UML SModels (for the SOA designs) annotated with MARTE, and LQN PModels. The SModel-to-PModel mapping of [9] is extended here to support the coupling of the refactoring transformations.
The impact of design patterns on software performance has been studied only indirectly, through the concept of performance anti-patterns, introduced in [10]. Anti-patterns are defined as common design errors that cause undesirable results. An approach based on anti-patterns for identifying performance problems and removing them is described in [11]. An OCL query is created to identify each anti-pattern and applied to the design model. The anti-pattern removal is special for each anti-pattern and is not automated.
Xu [12] described a rule-based system which discovered performance problems and automatically improved the
DOI reference number: 10.18293/SEKE2015-140
design as represented by the PModel. However the rules are slightly different from patterns or anti-patterns and the changes were not propagated automatically to the SModel.
III. PROCESS OVERVIEW
The overall process is shown in Figure 1. This paper describes stages B and C, shown in grey. The inputs include a SOA SModel (top left), and a library of pattern definitions with formal rules (bottom left). The designer steps are given on the left and the automated steps on the right side.
**Figure 1: Proposed Approach Overview**
The designer steps are supported by tools that have been implemented in this work. There are four stages:
A) Preliminaries: This stage uses the SModel to create the base PModel using PUMA, and creates the SModel/PModel mapping table. Pattern application begins at step (4), where the designer selects a candidate pattern for its own reasons (e.g. maintainability).
B) Model Transformation Rules: The selected pattern is specified using RBML. The designer indicates where the pattern is applied by binding pattern roles to entities in the SModel (step (5)) and then specifies SModel transformation rules that will satisfy the solution specification (step (6)).
C) Deriving the PModel Transformation Rules: Using the mapping table from (A) and the SModel transformation rules from (B), the PModel transformation rules are derived automatically.
D) Coupled Transformations: Both sets of transformation rules are executed via coupled transformations to refactor the SModel and PModel into $SModel^*$ and $PModel^*$, respectively. The $PModel^*$ results can be used to select the pattern to be applied. Therefore, Stages B, C and D may be repeated until the designer gets the desired results.
IV. MODELS
A. SOA Models
From the range of diagrams used to model SOA systems, we use the Business Processes Model (BPM) for behavior and the Service Architecture Model (SEAM) for structure and contracts, together with a UML deployment diagram. Figure 2 shows examples.
The BPM is specified as a UML activity diagram (Figure 2.B). Service invocations are modeled as operation calls, using three types of UML actions: a $CallOperationAction$ transmits a request to the target and waits for the reply via its input/output pins; an $AcceptCallAction$ is an accept event action waiting for the arrival of a request; and a $ReplyAction$ returns the reply values to the caller. The called operation appears in parentheses after the action name as “(classname:operation-name)”. We assume all BPM edges between ActivityPartitions are between these three Action types and represent calling interactions.
Performance information by MARTE annotations are given in shaded notes. They describe the behavior as a sequence of steps «PaStep» with a workload attached to the first step («GaWorloadEvents»), «PaStep» has attributes $hostDemand$ (the required CPU time), $rep$ (the mean repetitions) and $prob$ (its probability if it is an optional step). The workload «GaWorloadEvent» defines a population of $users$ each with a thinking time $ThinkTime$ defined by MARTE variables. Concurrent runtime instances «PaRunTInstance» are identified with swimlane roles.
The SEAM is specified as a UML collaboration diagram (Figure 2.A) with service participants and contracts (stereotyped «Participant» and «ServiceContract» respectively; these are not from MARTE but are specific to this process). Each participant plays a role of Provider or Consumer with respect to a contract. Participants correspond to pools, participants and swimlanes in the BPM.
Deployment is also defined, as in Figure 2.C. Processing nodes are stereotyped «GaExecHost» and communication network nodes are stereotyped «GaCommHost», with attributes for processing capacity, message latency and communication overheads.
B. Performance Models
PModels are expressed in an extended queueing notation called Layered Queuing Networks (LQNs) [2], selected because of its close coupling to the high-level software architecture. An LQN estimates waiting for service due to contention for host processors and software servers, and provides response time and capacity measures.
Figure 2.D shows the LQN model for the example. For each service there is a task, shown as a bold rectangle, and for each of its operations (contracts) there is an entry, shown as an attached rectangle. The task has a parameter for its multiplicity or thread pool size (e.g. ‘1’). Each entry has a parameter for its host CPU demand, equal to the total $hostDemand$ of the set of «PaSteps» for the same operation in the SModel. Calls from one entry to another are indicated by arrows between entries (a solid arrowhead indicates a synchronous call for which the reply is implicit, while an open arrowhead indicates an asynchronous call). The arrow is annotated by the number of calls per invocation of the sender. For deployment, an LQN host node is indicated by a round node associated to each task.
C. SModel to PModel Mapping Table
When the PModel is derived from the SModel using the PUMA [2] process, the mapping between the corresponding elements of the two models is recorded as described in [9], extended to identify a set of Actions initiated by a Call (an ActivitySet), and pairs of Call and Reply Actions. There are three mapping sub-tables, for StructuralElements, Calls, and Attributes. Each row in a table represents a link between an SModel element or set and a corresponding PModel element (because the PModel is more abstract, one element may correspond to a set of SMEs). Table 1 shows a few of the traceability links for the example in Figure 2.
D. Role-Based Models for SOA Patterns
To formalize the definition of SOA design patterns without resorting to a new language, we use Role-Based Modeling RBML [6], where the pattern is expressed with generic roles acting as formal parameters which must be bound to actual parameters from the application context to which the pattern is applied.
Table 1: Partial Mapping Table between SModel and PModel for Shopping and Browsing
<table>
<thead>
<tr>
<th>Link</th>
<th>Set of SModel Elements</th>
<th>PModel Element</th>
</tr>
</thead>
<tbody>
<tr>
<td>DTL3</td>
<td>Deployment Node: Order</td>
<td>LQN Host: Order</td>
</tr>
<tr>
<td>DTL2</td>
<td>Deployment Artifact: Browsing</td>
<td>LQN Task: Browsing</td>
</tr>
<tr>
<td>BTL1</td>
<td>ActivitySet: Checkout = [AcceptCall, BasketCheckout, CalculateShopping, CreateInvoice, CallOperation(OrderProcessing:PayCredit), CallOperation(OrderProcessing:PayDebit), Reply]</td>
<td>LQN Entry: Checkout Call to AcceptCallAction(Shopping::Checkout) and the corresponding reply from ReplyAction(Shopping::Checkout) back to CallOperationAction(Shopping::Checkout)</td>
</tr>
</tbody>
</table>
Sub-table (A) StructuralElements Trace Links
<table>
<thead>
<tr>
<th>Link</th>
<th>Set of SModel Calls</th>
<th>PModel Call</th>
</tr>
</thead>
<tbody>
<tr>
<td>BCTL1</td>
<td>Call fromCallOperationAction(Shopping::Checkout) to AcceptCallAction(Shopping::Checkout) and the corresponding reply from ReplyAction(Shopping::Checkout) back to CallOperationAction(Shopping::Checkout)</td>
<td>LQN synchronous Call from Entry:User to Entry:Checkout</td>
</tr>
</tbody>
</table>
Three UML views are used for each pattern: BPS (Behavioral Pattern Specification) for behavior, corresponding to the BPM; SPS (Structural Pattern Specification) for structure, corresponding to the SEAM; and DPS (Deployment Pattern Specification), not described here due to space limitations. Each view has two specifications: Pattern Problem (the view before pattern application) and Pattern Solution (after application). Figure 3 shows the role-based specification for the Service Façade pattern (which is described in Section VII), with the problem on the left and the solution on the right. As in [6] the names of generic roles start with the character ‘|’.
B. Creating the SModel Transformation Rules
The designer creates the SModel transformation, (governed by the RBM bindings and the pattern problem and solution specifications) as a set of operations to add, delete, and modify model elements. An operation is defined for each element type (e.g. addAssoc/deleteAssoc for adding/deleting associations). Depending on the element type it applies to, an operation is applied to the services and interactions of the SEAM and to the ActivityPartitions, Activities, Actions and ActivityEdges of the BPM. Transformation operations indicated by the designer are recorded using the tool shown in Figure 4 as follows:
- Remove elements that are present in the problem but not in the solution, by applying delete actions (such as deleteParticipant or deleteAssoc) to them
- Create new elements that are defined in the solution but are not present in the problem, by add actions (such as addParticipant or addActivityPartition),
- Modify elements present in both problem and solution, by modify actions (such as modifyActionCall).
SModel elements which are not in any of the above groups remained untouched. Figure 4 shows a screen shot of the tool support for the technique in this section with a set of operations recorded for the application of Service Façade pattern to the example in Figure 2, with the role bindings shown above.
VI. COUPLED TRANSFORMATION
A. Coupled PModel Refactoring Rules
This section describes the automated translation of the SModel transformation rules into PModel transformation rules, based on the mapping table described in Section IV.C. Each SModel transformation rule has an operation name and some arguments, which are processed as follows:
1. The operation name is translated into one or more PModel transformation operations. The action part of the name (add/delete/modify) is retained, and the operand-type part (e.g. Participant) is mapped according to the type correspondences of the Mapping Table. A partial list of these is:
Thus the SModel operation addParticipant is translated to addTask, and deleteActivitySet to deleteEntry.
2. The arguments of the PModel operation (e.g. the entity or entities to be added, deleted, or modified) are translated from the arguments of the SModel operation using the correspondences in the Mapping Table. For “add” operations the name of the new PModel element is taken as the name of the corresponding SModel element.
For example, the SModel “addParticipant” operation is mapped to “addTask” in the PModel, and the “addParticipant” argument becomes the new task name.
Modifications to calls require special consideration in the translation. The SModel “modifyActionCall” operation changes a service invocation from a CallOperationAction to an AcceptCallAction. As this might apply to more than one call to the same AcceptCallAction, the mapping table is searched (by the MappingTableSearchByKey command) to identify all the PModel activities making the call. Then the operation is mapped to one or more “modifyActivity” operations in the PModel domain, to change all the calls.
Some of the PModel transformation rules derived for the façade pattern (shown in Figure 4) are presented in Figure 5 as part of the screenshot from the implemented tool supporting coupled transformations.
B. Application of the PModel Rules
Briefly, the PModel transformation rules derived in Section VI.A are applied to the PModel in two steps. First the PModel is annotated with transformation directives indicating the changes, then the changes are applied by a transformation engine implemented using QVT [13] (Query, View, and Transformation, an OMG standard model transformation language) which processes the directives. The implementation of these two steps is not presented here.
VII. CASE STUDY
We suppose that a designer is assigned the task of redesigning the Shopping and Browsing SOA described earlier to support three different user access channels (mobile phone, desktop, kiosk, etc.) through a single multi-channel endpoint. Initially, the designer uses the SOA design pattern “Concurrent Contracts” [1] in which the multi-channel capability is implemented by providing separate shopping and browsing operations for each channel. Separate set of actions are created inside the shopping swimlane (see Figure 2.B) and also the browsing swimlane (not shown Figure 2.B). However, the designer realizes that those three separate operations introduce code duplication in the functional design.
To eliminate this duplication the designer considers using the SOA design pattern “Service Façade” [1]. In the service façade design pattern, the problem is that the tight coupling of the core service logic to its contracts can obstruct its evolution and negatively impact service consumers. As the solution, Façade logic is inserted into the service architecture to establish a layer of abstraction that can adapt to future changes to the service contract.
coupled transformation tool (as in Section VI and the screenshot of Figure 5) to derive the PModel transformation rules. The PModel transformation rules are applied to the LQN model shown in Figure 2.D, giving a performance model which is partly shown in Figure 6 below.
To illustrate how performance issues can be revealed, the performance was estimated for a range of user populations. For each N users in group “users1”, there were 2N in “users2”, and N/2 in “users3”. N ranged from 2 to 220, so the total users ranged from 7 to 770. Figure 7 shows the response times for the three groups of users and for both patterns. It shows that the groups have the same response time, and under heavy loads (which are also the conditions in which the system resources are efficiently utilized) the Façade pattern imposes about 30% additional delay in response time. This penalty is the price for the benefits it provides to the system architecture by preparing it for future changes to the service. An alternative view of the penalty is that it reduces the user population that a deployed system can serve with a given target response time.
This paper describes a process and tools for interpreting a software pattern in terms of the corresponding change in a performance model of the software, to support an immediate analysis of the performance effects of using a pattern. It helps the system designer to choose a pattern that has acceptable performance impact, and to choose between alternatives. It provides the system designer with a systematic approach and tool for formally recording those changes for the SOA design, and from these it automatically derives the performance model changes. Coupling the transformations ensures that the performance analysis remains in sync with the software changes, and relates the resource and performance changes back to the pattern.
The use of the process and tools was illustrated by an extensive example which applied the Façade pattern to a Browsing and Shopping system design, and by an analysis which compared its impact to that of the Concurrent Contracts pattern. The performance cost of the Façade pattern is a significant increase in response time under load, which could influence the development of the design.
VIII. CONCLUSION
This work was supported by the Ontario Centers of Excellence and by the Natural Sciences and Engineering Research Council of Canada (NSERC) through its Discovery Grant program.
ACKNOWLEDGMENT
REFERENCES
|
{"Source-Url": "http://ksiresearchorg.ipage.com/seke/seke15paper/seke15paper_140.pdf", "len_cl100k_base": 4316, "olmocr-version": "0.1.49", "pdf-total-pages": 6, "total-fallback-pages": 0, "total-input-tokens": 26661, "total-output-tokens": 5138, "length": "2e12", "weborganizer": {"__label__adult": 0.00028443336486816406, "__label__art_design": 0.0004148483276367187, "__label__crime_law": 0.0002923011779785156, "__label__education_jobs": 0.0005946159362792969, "__label__entertainment": 4.965066909790039e-05, "__label__fashion_beauty": 0.00012814998626708984, "__label__finance_business": 0.0002186298370361328, "__label__food_dining": 0.0002884864807128906, "__label__games": 0.00034618377685546875, "__label__hardware": 0.0007085800170898438, "__label__health": 0.0003764629364013672, "__label__history": 0.00021946430206298828, "__label__home_hobbies": 6.300210952758789e-05, "__label__industrial": 0.0003464221954345703, "__label__literature": 0.00020396709442138672, "__label__politics": 0.00022733211517333984, "__label__religion": 0.0003552436828613281, "__label__science_tech": 0.0163421630859375, "__label__social_life": 6.204843521118164e-05, "__label__software": 0.004947662353515625, "__label__software_dev": 0.97265625, "__label__sports_fitness": 0.0002491474151611328, "__label__transportation": 0.00042939186096191406, "__label__travel": 0.0001895427703857422}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 22253, 0.01314]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 22253, 0.31444]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 22253, 0.89836]], "google_gemma-3-12b-it_contains_pii": [[0, 5229, false], [5229, 10183, null], [10183, 12271, null], [12271, 14941, null], [14941, 17901, null], [17901, 22253, null]], "google_gemma-3-12b-it_is_public_document": [[0, 5229, true], [5229, 10183, null], [10183, 12271, null], [12271, 14941, null], [14941, 17901, null], [17901, 22253, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 22253, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 22253, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 22253, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 22253, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 22253, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 22253, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 22253, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 22253, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 22253, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 22253, null]], "pdf_page_numbers": [[0, 5229, 1], [5229, 10183, 2], [10183, 12271, 3], [12271, 14941, 4], [14941, 17901, 5], [17901, 22253, 6]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 22253, 0.09091]]}
|
olmocr_science_pdfs
|
2024-11-27
|
2024-11-27
|
f5d7e03b06568faabb203686a12ccc60702cabd3
|
Building Test Harness From Service-based Component Models
Pascal Andre, Jean-Marie Mottu, Gilles Ardourel
To cite this version:
Pascal Andre, Jean-Marie Mottu, Gilles Ardourel. Building Test Harness From Service-based Component Models. MoDeVVa 2013 Workshop on Model Driven Engineering, Verification and Validation, Oct 2013, Miami, United States. pp. 11-20, ISSN 1613-0073. hal-00918505
HAL Id: hal-00918505
https://hal.archives-ouvertes.fr/hal-00918505
Submitted on 13 Dec 2013
HAL is a multi-disciplinary open access archive for the deposit and dissemination of scientific research documents, whether they are published or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.
L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.
Abstract. In model-driven development, the correctness of models is essential. Testing as soon as possible reduces the cost of the verification and validation process. Considering separately PIM and PSM reduces the test complexity and helps the evolution of the system model. In order to test models before their final implementation, we propose an approach to guide the tester through the process of designing tests at the model level. We target model testing for Service-based Component Models. The approach produces test harness and provides information on how to bind the services of the components under test and how to insert the relevant data. The tests are then executed by plunging the harness into a technical platform.
Keywords: Test Harness, Model Conformance, Test Tool, MDD
1 Introduction
Testing as early as possible reduces the cost of Verification and Validation (V&V) [1]. In Model-Driven Development (MDD), V&V is improved by directly testing models for correctness [2]. Testing models helps to focus the effort on the early detection of platform independent errors, which are costly when detected too late. Testing models does not consider implementation specific errors and thus reduces the complexity of testing [3]. Designing the tests on models ease their adaptation when models are refactored. However, building and running tests on models remain a challenge.
We target service-based component models with behaviour, including data and communications. The specification detail level is sufficient enough to enable various kinds of test at the model level. While testing such software components, the encapsulation should be preserved. Therefore, finding where and how providing test data is difficult: variables are accessed through services, which are available from the interface of the component but also from other required services. Designing the test fixture of a service implies a sequence of service calls additionally to the component initialisation. In [4], Gross mentioned issues in Component-Based Software (CBS) testing: testing in a new context (i.e. development context one, deployment context ones), lack of access to the internal
working of a component. Ghosh et al. [5], also identify several problems: the selection of subsets of components to be tested and the creation of testing components sequences. Our work is concerned with these issues.
We consider the building of test harness for unit and integration testing dedicated to Service-based Component Systems. Test harnesses are used to provide test data, to run the test, to get the verdict (fail or pass). We create test harness from the platform independent model (PIM) of the system under test (SUT) and from test intentions. Those intentions declare which services are tested in which context, with which data. The tester incrementally builds a harness to run the test in an appropriate context, especially without breaking the encapsulation. The tester needs assistance for this task.
In this paper, we propose an approach assisting the test of service-based component models. This approach integrates the tests at the model level and is provided with tools. First, we propose operating at the model level, we modelise the tests at the same abstraction level as the component model. We build test harnesses as component systems made of Components Under Test (CUT) and Test Components (TC), which are created to test. As a consequence, the assembly of test components and regular components can benefit from the development tools associated with the component model. Additionally, test components could be transformed into platform specific models, thus capitalising the early testing effort. Second, we propose a guided process to assist the tester to manage the complexity of the component under test. The test harness is obtained from transformations of the SUT, guided by the test intention, enriched by test components, and assisted by several analyses and heuristics proposing relevant information and ensuring model correctness through verifications. Third, we illustrate the approach on a motivating example, a platoon of vehicles. We have developed a set of prototype tools designed to experiment the proposals. It is implemented in COSTO, the tool support of the Kmeia component model [6].
2 Testing Service-based Component Model
This section introduces the testing of service-based component model and the challenges to be tackled. It describes our approach on a motivating example.
2.1 Service-based Component Model
A component system is an assembly of components which services are bound by assembly links. The interface of a component defines its provided and required services. The interface of a service defines a contract to be satisfied when calling it. The service may communicate, and the assembly links denote communication channels. The set of all the services needed by a service is called its service dependency. The required services can then be bound to provided services. These needs are either satisfied internally by other services of the same component, or specified as required services in the component’s interface and satisfied by other components. A composite component encapsulates an assembly.
In the example of Figure 1, the component $c: \text{Client}$ requires a service provided by the component $s: \text{Server}$, through an assembly link. This assembly is illustrated with the SCA notation [7]. We extended the SCA notation (right part of the legend of Figure 1) to make explicit the dependencies and data useful for testing: (i) typed data define the component state, (ii) services access these variables, (iii) provided services internally depends on required services.
Figure 2 represents a motivating example: a simplified platoon of several vehicles. Each vehicle computes its own state ($\text{speed}$ and $\text{position}$) by considering its current state, its predecessor's state, and also a safety distance between vehicles. Each vehicle is a component providing its speed and position and requiring predecessor’s speed and position. Three vehicles are assembled in that example. Each vehicle provides a configuration service $\text{conf}$ initiating its state, a service $\text{run}$ launching the platoon and requiring the service $\text{computeSpeed}$ to calculate new position and speed. The leader is another component controlling its own values according to a position goal.
2.2 Testing Components at the Modelling Stage
Conformance testing aims to control that system under test behave correctly according to their specification. With Service-based Components, we test that
the behaviour conforms the specification of their interfaces. In the context of Service-Based Component Applications, the test harness is designed by selecting the components under test, replacing their clients and their servers (the first with mocks, the last with test drivers), then providing test data to the test drivers and getting their verdicts [8]. Test harness should preserve component encapsulation. JUnit classes are an example of test harnesses for Java OO programs.
In MDD, Service-based Component System is modelised with a PIM, and part of its components (the SUT) is tested depending on a test intention. The test intention defines for each test which part of the system is tested (component(s)), with which entry point (a service), in which situation (SUT state), with which request (service call with parameters), expecting which results. At the beginning, the test intention is tester’s knowledge, then she has to concretely prepare and run the test to get a verdict from oracles.
Testing such a SUT is not just creating test data and oracles, the difficulty is to consider components in an appropriate context (assembly of components), to run the test data on them, get the output to be checked with the oracles. The building of test harness to fulfil this task is an important work. Moreover, the process of creating a test harness is not trivial for models of components.
We consider several characteristics making the test of component models an original process: (i) Early specifications are often too abstract or incomplete to be executable. In order to test service-based component, we have to execute it in a consistent environment: its dependencies have to be satisfied by compatible services and every operation used in the environment has to be concrete enough or bound to a concrete operation. Furthermore, its environment must be able to run test cases. (ii) In strongly encapsulated components, finding where and how to insert data is challenging: variables are usually only accessible through services and some data is required from external services. (iii) At the model level, tests should be designed as models. Describing test artefacts like mocks and drivers in the component modelling language provides several benefits: it is easy to communicate with designers; tests follow the same validity rules as the model for both consistency and execution, allowing the use of the development tools associated with the component model. (iv) Models are subject to frequent refactoring or even evolutions, which can compromise the applicability of existing tests.
In this work, we are concerned with the building of test harness for service-based component models. The tester chooses the components and their services she tests (defined with the test intention). She orders the tests. She creates the test data based on existing works considering the specification of component: work of [13] with state machines, work of [14] performing LTS behaviours testing, etc. She creates oracles, for instance, based on the contracts usually available defining a service interface. Our approach assists the tester in building the test harness allowing her to run such test data and to apply such oracles.
3 Assisting the test harness building
The construction process takes as input the System Under Test (SUT) model which is a PIM (Platform Independent Model) and a test intention (Figure 3). It is made of three activities (transformations). The first one builds the test harness as an assembly with the SUT in a Test Specific Model (TSM) at the model level. The second composes the harness with a Platform Description Model (PDM) to get an executable model (code). During the execution, the concrete data providers give the test data needed to run the test, and the concrete assert functions return the verdicts. Designing the oracles and the data sets influences the operational level. This point is out of concern in the rest of the paper.
Fig. 3. Testing process overview
3.1 Test Harness Construction
This section explains how the tester is guided to build a consistent test harness. As noted in [5] (and filed under the issue C3), it is sometimes necessary to consider different subsets of the architecture when testing a component, because of the influence (e.g. race conditions) of the other components on the SUT. The test harness is designed by (i) selecting the relevant subset of original components and services to test, (ii) replacing all or parts of their clients (resp. servers) by test drivers (resp. mocks), (iii) providing data sources. The test intention serves as a guideline during the construction process.
As an example, we are intent on testing the conformance of the computeSpeed (safeDistance : Integer) : Integer service of the mid component with the following safety property: the distance between two neighbour vehicles is greater than a value safeDistance. The service behaviour depends on (a) the recommended safe distance from the predecessor, (b) the position and speed of the vehicle itself and its predecessor. Coming back to the example of Figure 2, testing the computeSpeed service of mid implies to give a value to the safeDistance parameter, to initialise the values of the pos and speed variables, which are used by the computeSpeed service and to find providers for pilotspeed et pilotpos which are required by computeSpeed. Only one component vehicle is under test here because other ones are not necessary to test the computeSpeed service, but a more complex architecture could have been retained.
The challenge for the tester is to manage the way these data can be provided. They can be provided by the test driver, by the configuration step, or by other
components (original components or mock components). Finding the service to be invoked in order to set the component in an acceptable state for the test is not trivial. Our goal is to help the tester to manage this complexity, in order to reduce testing effort. At this stage, assisting the harness building consists in:
1. Detecting missing features between the SUT and the test intention. This detection is achieved by the verification of two properties:
(a) Correctness. All the service dependencies are satisfied in the scope of the test harness. No pending or incompatible dependencies remain.
(b) Testability. All the formal test data are linked to values in the TSM (variables, parameters, results...).
2. Proposing candidates for the missing features: which service can configure data, can handle the test data or can fulfil missing required services?
3. Generating and linking test components (mocks, drivers as mirror services, bindings, abstract functions...).
Fig. 4. A TSM : test harness for the mid component’s service computeSpeed (SUT)
In the TSM of Figure 4, the vtd test driver is responsible to put the computeSpeed service in an adequate context (providing input data and oracle). The service testcase1 of vtd contains only a computeSpeed call and an oracle evaluation. To fix the computeSpeed requirements, the test designer could (1) ask for mock components (with random values), (2) reuse the first component coming from the SUT (and fulfil the requirements of first ...) or (3) design its own mock. This variability enables several kinds of test and answers to the issue C3 of Ghosh et al. [5]. Note that a single integer mock component im1 is used here because it offers a better control of the delivered speed (intdata1) and position (intdata2), but a harness with two independent integer mocks providing a single intdata service would also be possible.
The data of computeSpeed test harness are bound in the following way: (a) the safeDistance parameter is assigned in the call sequence of the test driver, (b) the position and speed (pos and speed variables) of the mid vehicle under test are bound to the conf service of mid, (c) the im1 mock component playing the role of the predecessor is configured to return the position and speed of the predecessor.
3.2 Mappings and Transformations
According to the MDD principles, the test will be executed by composing the test harness with the PDM (Figure 3). The test data and test primitives (oracle...) are provided by the PDM test support or implemented by the tester. The PIM may include primitive types and functions (numbers, strings, I/O...) that must also be mapped to the code level. These mappings are predefined in standard libraries or user-defined. High-level TSM primitives are connected to low level (PDM, code) functions, as illustrated by Figure 5. If the mapping is complete and consistent, then the model is executable.

The goal of the Mappings and Transformations activity (Figure 3) is to fix this composition. Each service involved in the test must be executable in a consistent environment: its dependencies must be satisfied by compatible services, and every operation used in the environment must be sufficiently concrete or related to a specific operation. Every abstract type should be mapped to a concrete type. At this stage, assisting the harness building consists in (1) detecting missing mappings between the TSM and PDM (Executability), (2) proposing tracks for the missing mappings based on signatures, pre/post conditions... (all the primitive types and functions are mapped to concrete ones, the test data inputs have concrete entry points), (3) generating standard primitive fragments (idle functions, random functions...). The mappings are stored in libraries in order to be reused later and the entries can be duplicated to several PDM. This activity induces an additional cost at model level, but the errors detected are less expensive to solve than those of components and services. Moreover, if the component model is implemented several times targeting several PDM, the tests would be reused and part of the behaviour would have been checked before runtime, as proposed here.
4 Experimentation
The test process of Figure 3 has been instrumented using the COSTO/Kmelia tool\(^1\). Kmelia is a wide-spectrum language dedicated to the development of correct components and services [6]. Kmelia includes an abstract language for computations, instead of links to the source code as in related languages like SCA, AADL, Sofa or Fractal. This layer is useful to check models before transforming to PSM. Kmelia is supported by the COSTO tool, a set of Eclipse plugins including an editor, a type checker, several analysis tools.
The test harness construction has been experimented on the platoon example. The goal was to build a harness to test the conformance of the service \texttt{computeSpeed} as introduced in Section 3.
- The test intention is a special Kmelia component, where only the name and description are mandatory. This trick enables to reuse the tool facilities and to consider test design at the model level.
```plaintext
TEST_INTENTION PlatoonTestIntention
DESCRIPTION "the vehicle will stop if it is too close to the previous one"
INPUT VARIABLES
pos, previous_pos, mindistance: Integer;
OUTPUT VARIABLES
speed: Integer
ORACLE
speed=0
```
- During the process, the building tool (1) starts from a test intention, (2) asks the user to select target system and services (or proposes some if the test intention is detailed), (3) displays the board to match the test intention with the SUT (Figure 6), (4) proposes candidates, (5) checks the correction and testability properties, (6) goes back to step (2) until the TSM is complete, (7) checks the executability properties and proposes candidates (from the libraries) for the missing elements, (8) generates the code.
A web-appendix\(^2\) shows the details of this example.
The harness building activities (transformations, decisions, assistance and generation) are implemented and integrated as COSTO functionalities. We developed the PDM framework in Java (7 packages, 50 classes, 540 methods and 3400 LOC). The service instanciation uses Java threads with an ad-hoc communication layer based on buffered synchronous channels (monitors). We keep strong traceability links from the code level to the PIM level for a better feedback on errors and also for animating the specification at the right level (GUI). We add specific support for contract checking (assertions and oracles).
Compared with the Junit practice, the tester could focus on the "business" part and did not need to care with Java details of the implementation. While the specification of the components was available, the tester could not modify them to make the test case more easy to write. He discovers the specification elements on-the-fly when mapping them to the test intention.
\(^1\) http://www.lina.sciences.univ-nantes.fr/aelos/projects/kmelia/
\(^2\) http://www.lina.sciences.univ-nantes.fr/aelos/download/ModeVVa_app.pdf
5 Related Work
There are several works interested in generating tests for testing components. In [9], Mariani et al. propose an approach for implementing self-testing components. They move testing of component from development to deployment time. In [10], Heineman applies Test Driven Development to component-based software engineering. The component dependencies are managed with mocks, and tests are run once components can be deployed. In contrary, in our proposal we propose to test the components at the modelling phase, before implementation.
In [11], Edwards outlines a strategy for automated black-box testing of software components. Components are considered in terms of object-oriented classes, whereas we consider component as entity providing and requiring services.
In [12], Zhang introduces test-driven modeling to apply the XP test-driven paradigm to an MDD process. Their approach designs test before modelling when we design test after modelling. In [13], the authors target robustness testing of components using rCOS. Their CUT approach involves functional contracts and a dynamic contract. However, these approaches apply the tests on the target platform when we design them at the model level and apply them on simulation code.
6 Conclusion
In this paper, we described a method to integrate testing early in an MDD process, by designing test artefacts as models. The test designer is assisted in
building component test harnesses from the component model under test and test abstract information through a guided process. The COSTO/Kmelia framework enabled to implement the process activities and to run the tests on the target specific execution platform with a feedback at the model level. The benefits are a shorter test engineering process with early feedback.
In future work, we will study different kinds of oracle contracts in order to find which logics are best fitted to express them in a testable way as well as ensuring a good traceability of the verdict. We will apply mutation analysis on the models rather than on the generated code because such an approach can be integrated in MDD while respecting the hypotheses of the mutation analysis.
References
|
{"Source-Url": "https://hal.archives-ouvertes.fr/hal-00918505/file/modevva2013_HAL_AMA.pdf", "len_cl100k_base": 4593, "olmocr-version": "0.1.50", "pdf-total-pages": 11, "total-fallback-pages": 0, "total-input-tokens": 23525, "total-output-tokens": 5880, "length": "2e12", "weborganizer": {"__label__adult": 0.00032448768615722656, "__label__art_design": 0.0003504753112792969, "__label__crime_law": 0.0002541542053222656, "__label__education_jobs": 0.0006823539733886719, "__label__entertainment": 4.3392181396484375e-05, "__label__fashion_beauty": 0.00015091896057128906, "__label__finance_business": 0.00015866756439208984, "__label__food_dining": 0.00028228759765625, "__label__games": 0.0004353523254394531, "__label__hardware": 0.0005784034729003906, "__label__health": 0.0003743171691894531, "__label__history": 0.0001862049102783203, "__label__home_hobbies": 7.140636444091797e-05, "__label__industrial": 0.0002758502960205078, "__label__literature": 0.00024056434631347656, "__label__politics": 0.0002114772796630859, "__label__religion": 0.0004286766052246094, "__label__science_tech": 0.007328033447265625, "__label__social_life": 8.374452590942383e-05, "__label__software": 0.004077911376953125, "__label__software_dev": 0.982421875, "__label__sports_fitness": 0.0002689361572265625, "__label__transportation": 0.0004413127899169922, "__label__travel": 0.0001990795135498047}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 25079, 0.03162]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 25079, 0.53567]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 25079, 0.90339]], "google_gemma-3-12b-it_contains_pii": [[0, 1026, false], [1026, 3202, null], [3202, 6270, null], [6270, 7677, null], [7677, 10907, null], [10907, 13410, null], [13410, 15705, null], [15705, 17681, null], [17681, 20579, null], [20579, 22002, null], [22002, 25079, null]], "google_gemma-3-12b-it_is_public_document": [[0, 1026, true], [1026, 3202, null], [3202, 6270, null], [6270, 7677, null], [7677, 10907, null], [10907, 13410, null], [13410, 15705, null], [15705, 17681, null], [17681, 20579, null], [20579, 22002, null], [22002, 25079, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 25079, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 25079, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 25079, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 25079, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 25079, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 25079, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 25079, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 25079, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 25079, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 25079, null]], "pdf_page_numbers": [[0, 1026, 1], [1026, 3202, 2], [3202, 6270, 3], [6270, 7677, 4], [7677, 10907, 5], [10907, 13410, 6], [13410, 15705, 7], [15705, 17681, 8], [17681, 20579, 9], [20579, 22002, 10], [22002, 25079, 11]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 25079, 0.0]]}
|
olmocr_science_pdfs
|
2024-11-29
|
2024-11-29
|
4b69f115e8502c92a61436bac6ea3833464e0419
|
SKaMPI: a comprehensive benchmark for public benchmarking of MPI
Ralf Reussner, Peter Sanders and Jesper Larsson Träff
Abstract: The main objective of the MPI communication library is to enable portable parallel programming with high performance within the message-passing paradigm. Since the MPI standard has no associated performance model, and makes no performance guarantees, comprehensive, detailed and accurate performance figures for different hardware platforms and MPI implementations are important for the application programmer, both for understanding and possibly improving the behavior of a given program on a given platform, as well as for assuring a degree of predictable behavior when switching to another hardware platform and/or MPI implementation. We term this latter goal performance portability, and address the problem of attaining performance portability by benchmarking. We describe the SKaMPI benchmark which covers a large fraction of MPI, and incorporates well-accepted mechanisms for ensuring accuracy and reliability. SKaMPI is distinguished among other MPI benchmarks by an effort to maintain a public performance database with performance data from different hardware platforms and MPI implementations.
1. Introduction
The Message-Passing Interface (MPI) [6,15,29] is arguably the most widespread communication interface for writing dedicated parallel applications on (primarily) distributed memory machines. The programming model of MPI is a distributed memory model with explicit message-passing communication among processes, coupled with powerful collective operations over sets of processes. MPI ensures portability of application programs to the same extent that the supported application programming languages C, C++, and Fortran are portable, and is carefully designed to be efficiently implementable on a wide variety of hardware platforms. Indeed, many high-quality vendor implementations achieve MPI communication performance close to that of their native communication subsystem.
Apart from basic semantic properties (liveness etc.) there are no performance model or performance guarantees associated with MPI, and the MPI standard stipulates no performance requirements for a valid MPI implementation. Without empirical performance data it is therefore not possible to predict/analyze the performance of a parallel application using MPI, much less to predict and obtain good performance when moving to another platform and/or MPI implementation. Reliable figures for performance characteristics of MPI implementations for as many different platforms as possible are indispensable to guide the design of efficient and performance portable parallel applications with MPI. Performance characteristics include the “raw” performance of MPI communication primitives, both for message-passing and collective communication for
varying parameters (message lengths, number of processes), performance under “load” (e.g. bisection bandwidth) or with typical communication patterns (e.g. master-slave, ring), as well as comparative measurements of different realizations of collective operations. Such information allows the application programmer to tune his application for a specific platform by choosing the appropriate communication primitives, and to tune for good performance across different platforms.
There are several benchmarks for MPI which partly address these issues. In this paper we describe the Special Karlsruher MPI benchmark, SKaMPI, which in particular addresses the issue of cross platform performance portability by maintaining a public performance database of performance measurements for different platforms. Some main features of SKaMPI are:
- Coverage of (almost) all of the MPI standard, including collective operations and user-defined datatypes.
- Assessment of performance under different communication patterns, e.g. ping-pong and master-slave.
- Automatic parameter refinement for accuracy, reliability and speed of benchmarking.
- Operation controlled by configuration files, which allow for detailed and flexible planning of experiments; the benchmark comes with a default set of measurement suites.
- A report generator, which allows for automatic preparation of measurements into a readable form.
- Last but not least a public performance database available on the WWW, which allows for interactive comparison of MPI performance characteristics across different implementations and platforms.
The SKaMPI project was initiated by Ralf Reussner, Peter Sanders, Lutz Prechelt and Matthias Müller at the University of Karlsruhe in 1996-97 [23,25,28], and has since then developed with new features and broader MPI coverage [26]. The interactive WWW-database was implemented by Gunnar Hunzelmann [11,24].
URL of the SKaMPI-project:
http://liinwww.ira.uka.de/~skampi/
1.1. Related work
Benchmarking has always played an important role in high-performance computing. For MPI, several benchmarks exist which differ in philosophy, goals, and level of ambition. In this section we briefly review some other well-known MPI benchmarks in relation to SKaMPI; the discussion is not meant to be exhaustive. A general discussion of problems and pitfalls in (MPI) benchmarking can be found in [7] and [10]; SKaMPI adheres to the sound advice of these papers.
Benchmarking of application kernels [1,2,18] is traditionally used to get an idea of the overall performance of a given machine, but such benchmarks measure communication in a specific, complex context and can only indirectly be used to guide the development of efficient programs.
A widely used MPI benchmark is the mpptest shipped with the MPICH implementation of MPI [8, 16]; it measures nearly all MPI operations, but is less flexible than SKaMPI and has limited coverage of user-defined datatypes. The low-level part of the PARKBENCH benchmarks [18] measures communication performance and provides a result database, but does not give much information about the performance of individual MPI operations. The MPI part of P.J. Mucci’s Low-Level Characterization Benchmarks (LLCbench) [13], mpbench, pursues similar goals to SKaMPI, but it covers only a part of MPI and makes rather rough measurements assuming a “dead” machine. The Pallas MPI Benchmark (PMB) [17] is easy to use and has a simple, well-defined measurement procedure, but covers relatively few functions, and offers no graphical evaluation. PMB is one of the few MPI benchmarks that covers MPI-2 functionality (one-sided communications, some MPI-I/O). Rolf Rabenseifner’s effective bandwidth benchmark [4] attempts to give a realistic picture of the achievable communication bandwidth. Bandwidth is measured by a ring pattern over all processes, which is implemented using both simple send and receive operations, as well as by a collective MPI_Alltoallv operation. Results from a number of high-performance platforms are publicly available. The effective bandwidth benchmark has recently been complemented by a similar I/O benchmark [20,21].
A comparison of SKaMPI, PMB, mpptest and mbbench benchmarks is given in [14] for benchmarking MPI on an SGI Origin2000. The benchmarks give roughly similar results, but differ in finer details due to different assumptions on use of cache, and placement and size of communication buffers. The mbbench is confirmed to be sensitive to other activities on the machine.
Many studies measure selected functions in more detail [5,19,22] but the codes are often not publicly available, not user configurable, and not designed for ease of use, portability, and robust measurements.
2. Performance considerations
MPI is an extensive interface and communication can be expressed in many different ways. MPI offers two basic types of communication: point-to-point message-passing where information is passed explicitly between a sending and a receiving process, and collective communication where a set of processes jointly performs a communication operation, possibly involving computation as in MPI_Reduce. For the applications programmer this raises a number of questions to be answered in order to get the best possible performance on a given platform/MPI implementation, as well as for being able to obtain and/or predict performance when moving to a different platform/MPI implementation.
Selection of communication mode: MPI differentiates between blocking and non-blocking point-to-point communication, which can be further adapted by different communication modes: standard, synchronous, ready and buffered. There also exist specialized compound operations like MPI_Sendrecv for simultaneous sending and receiving of data. It is possible to receive non-deterministically by using wildcards like MPI_ANY_TAG and/or MPI_ANY_SOURCE. The performance of point-to-point communication thus depends on the application context, the MPI implementation, and hardware capabilities that may allow especially efficient implementations of some of these primitives in special contexts.
Use of collective operations: A number of collective operations are available, but are not always used, either because they are not sufficiently known, or because their implementation is distrusted by some users. The question is whether an available MPI library provides good implementations. Do the implementations compare favorably to simple(r), ad hoc point-to-point based implementations?
Use of compound collectives: The MPI standard offers certain compound collective operations (MPI_Allreduce, MPI_Allgather, and others) that can easily be expressed in terms of more primitive collectives (e.g. MPI_Reduce, MPI_Gather, and MPI_Bcast). These compound operations are included in MPI since better algorithms than simple concatenation of more primitive collectives exist. Is this exploited in a given MPI implementation?
MPU user-defined datatypes: MPI has a powerful mechanism for working with user-structured, possibly non-consecutive data, but not all MPI implementations support user-defined datatypes equally well [9,30,26]. Is the best performance achieved by maintaining non-consecutive data “manually” or by relying on the MPI mechanism?
3. The SKaMPI benchmark
The SKaMPI benchmark package consists of three parts: the skampi.c benchmarking program itself, an optional post-processing program (also a C program), and a report generation tool (a Perl script). It is complemented by an interactive public database of benchmark results, accessible through the WWW. A run of SKaMPI is controlled by a configuration file, .skampi, which can be modified for more selective or detailed benchmarking. A default configuration file defines a standard run of the benchmark, and the results from such a run can be reported to the SKaMPI database.
The configuration file starts with a preamble identifying the benchmarker, the MPI implementation, and the machine and network used. It defines output and logfiles, and sets various default values. For the standard configuration file only the @MACHINE, @NODE, @NETWORK, @MPIVERSION and @USER fields have to be modified. The @MEMORY field controls the total size of communication buffers per processor (in KBytes). Figure 1 shows a sample configuration file. We refer to this example in the following.
The benchmark program produces an ASCII text file skampi.out (selected by @OUTFILE) in a documented format [27]; it can be further processed for various purposes. The post-processing program is only needed when the benchmark is run several times (see Section 4.3). Post-processing can also be done by SKaMPI itself by setting @POSTPROC to yes. The report generator reads the output file and generates a postscript file containing a graphical representation of the results. This includes comparisons of selected measurements. The report generator can also be customized via a parameter file. Reports (actually: output files) are collected in the SKaMPI result database in Karlsruhe, which can be queried for both textual and graphical presentation of results (including downloadable encapsulated postscript figures).
The @MEASUREMENT keyword starts the description of the actual experiments to be performed. This is
a list of named *measurement suites*, each of which controls a set of measurements to be performed. The configuration file in Fig. 1 lists only the single suite named `MPI_Send-MPI_Recv-dynamicVector1`. Each *suite* has a Type which identifies the pattern used to control and time the execution of the MPI operations to be benchmarked. More precisely a type is an instance of one of the four SKaMPI patterns to a specific combination of MPI functions. Individual measurements with given parameters are repeated a number of times determined by default value settings (`Max_Repetition`, `Min_Repetition`) and by SKaMPI's adaptive parameter refinement mechanism. The set of measurements to be performed by a suite is furthermore determined by the selected dimension to be varied along, which can be either message length, number of processes, or number of chunks (for the master-worker pattern). For variation along message length, interval and stepwidth must be given (`Start_Argument`, `End_Argument`, and `Stepwidth`). The overall time which should be spend measuring this suite can be set in `Time_Suite`. Table 2 lists the currently existing types of suites and the patterns to which they belong. A SKaMPI run is the results for the whole list of suites.
### 3.1. The patterns
The way execution times are measured and reported, and the way a set of measurements is coordinated is determined by a so-called *pattern*, of which SKaMPI currently has four. These predefined *measurement strate-
gies make it easy to extend SKaMPI with new pattern instances to cover new MPI functions and/or MPI functions in new contexts. Only a small core function with the proper MPI calls has to be written; the measurement infrastructure of the pattern is automatically reused. All current pattern instances are listed in Table 2.
The ping-pong pattern coordinates point-to-point communication between a pair of processors. The ping-pong exchange is between two processors with maximum ping-pong latency; this in order to avoid misleading results on clusters of SMP machines. SKaMPI automatically selects such a pair based on measurements. Time is measured for one of the processes. Parameter variation is on message Length. There are currently 9 instances of the ping-pong pattern, corresponding to (some of) the possible combinations of blocking and non-blocking communication calls under different modalities.
The collective pattern measures operations that are collective in the sense that all processors play a symmetric role. Processors are synchronized with MPI_Barrier. Execution time is measured on process 0 (the root), and the running time of the barrier synchronization is subtracted. Parameter variation can be either on message Length or number of Nodes. There are instances of the collective pattern for all collective MPI communication operations, for collective bookkeeping operations like MPI_Comm_split, and for some collectives implemented with point-to-point communication (e.g. gather-functions). There is also an instance of the collective pattern for measuring the performance of the memcpy function. This can be used to compare memory bandwidth with communication performance.
Master-worker pattern: Certain performance-relevant aspects such as the contention arising when one processor simultaneously communicates with several other processors cannot be captured by the ping-pong pattern. To compensate for this a master-worker-pattern is introduced. A master process partitions a problem into smaller chunks and dispatches them to several worker processes. These workers send their results back to the master which assembles them into a complete solution. Time is measured at the master process. Variation on message Length, number of Chunks, and number of Nodes is possible. Currently 7 instances of this pattern are implemented.
The simple pattern measures MPI-operations with local completion semantics such as MPI_Wtime, MPI_Comm_rank, and unsuccessful MPI_Iprobe. No parameter variation is possible.
3.2. User-defined datatypes
The MPI user-defined datatypes is a mechanism for describing the layout of user data in memory to the MPI implementation. All MPI communication operations can operate with complex data described by a user-defined datatype. Communication performance is usually dependent on the datatype, and the extent to which different MPI implementations work well with user-defined datatypes is known to vary. To be able to assess the quality of the datatype handling, SKaMPI incorporates a set of datatype patterns that is orthogonal to the communication pattern instances.
In SKaMPI the data used in a measurement suite are structured according to either a base type or a datatype pattern over a base type. Base types are defined in the preamble (@BASETYPE1, ...), and can be either a built-in MPI type (e.g. MPI_INT, MPI_CHAR, MPI_DOUBLE), or a simple structure given by a sequence of triples (c, o, t) each consisting of repetition count, offset, and an built-in MPI type. As the unit of communication either a base type or a type pattern over a base type is selected (Basetype_Number, Send_Datatype_Number, and Recv_Datatype_Number). SKaMPI contains a number of fixed type patterns, including instances of all MPI type constructors, as well as various nested types. Type patterns can be further customized in the preamble. All type patterns are constructed to have the same size, i.e. encompass the same amount of data. Therefore send and receive type can be chosen independently, and can be different type patterns. This gives rich possibilities to gauge the handling of user-defined datatypes of a given MPI implementation. The datatype patterns are described in more detail in [26].
4. Measurement mechanisms
We now describe SKaMPI’s approach to efficiently measure execution times to a given relative accuracy \( \epsilon \). The standard error is set in each suite by the Standard_error parameter.
4.1. A single parameter setting
Each SKaMPI result is eventually derived from multiple measurements of single calls to particular MPI functions as determined by the pattern instances, e.g. in the corresponding ping-pong pattern instance measurements of an MPI_Send followed by an MPI_Recv call for given message lengths. For each measurement, the number $n$ of repetitions needed to achieve the required accuracy with the minimum effort is determined individually. We need to control both the systematic and the statistical error.
A systematic error occurs due to the measurement overhead including the call of MPI_Wtime. It is usually small and can be corrected by subtracting the time for an empty measurement. Additionally, the user can choose to “warm up” the cache by setting the number of dummy @CACHEWARMUP calls to the MPI functions before actual measuring is started.
Individual measurements are repeated in order to control three sources of statistical error: finite clock resolution, execution time fluctuations from various sources, and outliers. The total time for all repetitions must be at least $\text{MPI_WTime}/\gamma$ in order to adapt to the finite resolution of the clock. Execution time fluctuations are controlled by monitoring the standard error $\sigma_z := \sigma/\sqrt{n}$ where $n$ is the number of measurements, $\sigma = \sqrt{\sum_{i=1}^{n} (x_i - \bar{x})^2/n}$ is the measured standard deviation, and $\bar{x} = \sum_{i=1}^{n} x_i/n$ is the average execution time. The repetition is stopped as soon as $\sigma_z/\bar{x} < \epsilon$. Additionally, upper and lower bounds on the number of repetitions are imposed, Min_Repetition and Max_Repetition. Under some operating conditions one will observe huge outliers due to external delays such as operating system interrupts or other jobs. These can make $\bar{x}$ highly inaccurate. Therefore, we ignore the slowest and fastest run times before computing the average, as determined by Cut_Quantile. Note that we cannot just use the median of the measured values, because its accuracy is limited by the resolution of the clock.
4.2. Adaptive parameter refinement
In general we would like to know the behavior of a communication routine over a range of possible values for the message length $m$ and the number $P$ of processors involved. SKaMPI varies only one of these parameters at a time. Two-dimensional measurements must be written as an explicit sequence of one-dimensional measurements.
Let us focus on the case were we want to find the execution time $t_P(m)$ for a fixed $P$ and message lengths in $[m_{\text{min}}, m_{\text{max}}]$.
First, we measure at $m_{\text{max}}$ and at $m_{\text{min}}^{\gamma_k}$ for all $k$ such that $m_{\text{min}}^{\gamma_k} < m_{\text{max}}$, with $\gamma > 1$. On a logarithmic scale these values are equidistant. Now the idea is to adaptively subdivide those segments where a linear interpolation would be most inaccurate. Since nonlinear behavior of $t_P(m)$ between two measurements can be overlooked, the initial stepwidth $\gamma$ should not be too large ($\gamma = \sqrt{2}$ or $\gamma = 2$ are typical values). Figure 3 shows a line segment between measured points $(m_b, t_b)$ and $(m_c, t_c)$ and its two surrounding segments. Either of the surrounding segments can be extrapolated to “predict” the opposite point of the middle segment.
Let $\Delta_1$ and $\Delta_2$ denote the prediction errors. We use $\min(|\Delta_1|/t_b, |\Delta_2|/t_c, (m_c - m_b)/m_b)$ as an estimate for the error incurred by not subdividing the middle segment. The reason for the last term in the minimum is to avoid superfluous measurements near sharp jumps in running times which often occur where an MPI implementation switches to a different communication protocol. We keep all segments in a priority queue. If $m_b$ and $m_c$ are the abscissae of the segment with largest error, we subdivide it at $\sqrt{m_b m_c}$. We stop when the maximum error drops below $\epsilon$ or the upper bound on the number of measurements is exceeded. In the latter case, the priority queue will ensure that the maximum error is minimized given the available computational resources.
4.3. Multiple runs
If a measurement run crashed, the user can simply start the benchmark again. SKaMPI will identify the measurement which caused the crash, try all suites not measured yet, and will finally retry the suite which led to the crash. This process can be repeated.
If no crash occurred, all measurements are repeated yielding another output file. Multiple output files can be fed to a post-processor which generates an output file containing the medians of the individual measurements. In this way the remaining outliers can be filtered out which may have been caused by jobs competing for resources or system interrupts taking exceptionally long.
4.4. Cache behavior
Whether data is sent from cache or not can make a large difference in communication performance. A benchmark that is used for program design should therefore state its assumptions regarding the cache content during communication. In SKaMPI the assumption is that code, MPI internal data, and user data will as far as possible reside in cache. SKaMPI therefore provides the simple means of “warming up” the cache outlined above. The main reason for “warming up” is that this avoids the effect that the first single measurement takes much longer than later repetitions so that the variance of the measured times is increased. Communication of data outside the cache can be measured by choosing message lengths that are larger than the size of the cache. A different caching assumption is made by mpptest, which makes an effort to ensure that the user data sent is not in the cache [7].
5. The result database
The SKaMPI result database has two WWW user-interfaces. One is for downloading detailed reports of the various runs on all machines. The other interface
enables interactive comparison of measurements for different pattern instances/machines. A snapshot of this interface is shown in Fig. 4. Querying the database takes three steps:
1. Choosing a run. The user selects one or more machine(s) of interest. On some machines several runs may have been performed, for example with different number of MPI processes, and it is possible to choose among these. Selection of runs is done in the upper left part of the browser window.
2. Choosing the suites. After selecting the runs the database is queried for the suites of these runs. The available suites for each selected run are presented at the upper right part of the browser window. For each run the suites of interest are selected; results from different runs can be combined.
3. Finally the database is queried for the selected measurements, and a single plot for all selected suites is created. The plot is shown in the lower half of the browser window, and can also be downloaded as an encapsulated postscript file. It is also possible to zoom into the plot.
The detailed design of the database is described in [11].
6. Examples
The public database currently has results for the default set of suites for Fujitsu VPP 300, Hitachi SR 8000, IBM RS 6000, NEC SX-5, SGI Origin 2000, Cray T3E. All results are supplied by users, who have run SKaMPI on their machine. We give three examples of the use of the benchmark database.
In Fig. 5 the performance of the MPI_Sendrecv primitive as measured with ping-pong pattern instance 8 on the Hitachi SR8000, the Cray T3E, and the NEC SX-5 is given. The suite varies on message length, and shows many cases of adaptive parameter refinement (high concentration of measurements). The shapes of the curves are sufficiently similar that Sendrecv will probably not pose problems when porting applications among these machines.
In Fig. 6 we compared four different ping-pong pattern instances on the Hitachi SR 8000, namely blocking send-recv, non-blocking either send or receive, and compound send-receive. It is worth noticing that the compound send-receive is clearly better than the other alternatives, about a factor 2 for short messages up to 1 KBytes. For this machine it thus seems advisable to use MPI_Sendrecv wherever possible. Similar, or even more complicated pictures appear for the other machines; in particular, the advice to always use MPI_Sendrecv is not universally true. The user may
gain performance on a particular machine by looking more closely in this direction.
Our last example investigates the implementation of the \texttt{MPI\_Gather} collective on the IBM RS 6000 SP [28, 24]. SKaMPI has a corresponding collective pattern instance, as well as two pattern instances which measure “hand-written” implementations of the gather functionality using point-to-point communication (see Table 2). Figure 7 compares the vendor implemented \texttt{MPI\_Gather}-operation to an implementation with
blocking send and receive operations for fixed, short messages of 256 bytes, varied over number of processors. For short messages the hand-written, naive implementation performs significantly better than the MPI_Gather implementation of the vendor MPI library. Findings like this may discourage users from relying on the MPI collectives, but should rather incite vendors to improve their library.
7. Future extensions
Although many aspects of MPI are covered by SKaMPI, there is still room for improvements in various directions. Of immediate concern are more collective pattern instances, e.g. for ring-communication (as in the effective bandwidth benchmark [4]), for “bisection bandwidth” where half the processes simultaneously communicate with the other half, and for more alternative implementations of collective operations, either in terms of point-to-point communication or in terms of other MPI collectives.
The benchmarking of the “irregular” (or vector) variants of MPI collectives like MPI_Alltoallv is rather rudimentary, in particular there is no room for individually varying the amount of data communicated between each pair of processes. In future versions of SKaMPI it should be made possible to select among different distributions and vary more flexibly over message lengths. Also more accurate measurement mechanisms for collective operations should be considered, see [3].
Another natural extension is towards MPI-2 functionality [6]. Particularly relevant, but also easy to incorporate in the existing patterns is the one-sided communications, but perhaps also I/O should be covered by the benchmark; for some thoughts on MPI-I/O benchmarking, see [12,17,20,21]. More flexible control over cache utilization may be required for realistic I/O benchmarking.
8. Summary
In the absence of an analytical performance model for MPI, accurate, reliable, and realistic benchmark data are necessary to guide the development and tuning of application programs. We described the SKaMPI benchmark which performs such detailed benchmarking of a large fraction of MPI, both in isolation and in more complex (master-worker) patterns. Not covered are the construction of datatypes and the construction and use of user-defined topologies. Complemented by application kernels benchmark, SKaMPI can give a realistic picture of the performance of a given MPI implementation on a given machine. The SKaMPI project is distinguished from other MPI benchmarks by a directed effort to collect results from a standard run into a public performance database. This public database can be a powerful aid to users who want to port their application to a machine to which they do not yet have access.
The most obvious problem with maintaining a public result database is that results get obsolete; this is especially so since benchmark results are supplied voluntarily by users. To keep up with the technical progress in MPI implementations and changes of machine details, support by vendors would be welcome.
Acknowledgments
We would like to thank Lutz Prechelt for contributions to the basic design and to the original SKaMPI-conference paper [25], Matthias Müller for the design of the web pages, Gunnar Hunze for implementing the result database and enhancing the report-generator significantly, Thomas Worsch and Werner Augustin for their current redesign of collective measurements, and Roland Vollmar for his ongoing administrative and financial support; all of the University of Karlsruhe, Germany. Furthermore, we would like to thank the following people for their extensive comments, detailed suggestions and submitted measurements: Ed Benson (DEC, USA), Julien Bourgeois (Univ. de Besançon, France), Bronis R. de Supinski (Lawrence Livermore National Laboratory, USA), Dieter Kranzlmüller (Univ. of Linz, Austria), John May (Lawrence Livermore National Laboratory, USA), Hermann Mierendorff (FhG-GMD, Germany), Jean-Philippe Proux (CNRS/IDRIS, France), Rolf Rabenseifner (HLRS Stuttgart, Germany), Umesh Kumar V. Rajasekaran (Univ. of Cincinnati, USA), Christian Schaubschlager (Univ. of Linz, Austria), and Scott Taylor (Lawrence Livermore National Laboratory, USA).
References
tion/services/models/mpilb_eff/
Submit your manuscripts at http://www.hindawi.com
|
{"Source-Url": "http://downloads.hindawi.com/journals/sp/2002/202839.pdf", "len_cl100k_base": 6263, "olmocr-version": "0.1.53", "pdf-total-pages": 12, "total-fallback-pages": 0, "total-input-tokens": 37994, "total-output-tokens": 8688, "length": "2e12", "weborganizer": {"__label__adult": 0.00035262107849121094, "__label__art_design": 0.0003979206085205078, "__label__crime_law": 0.00040340423583984375, "__label__education_jobs": 0.0009050369262695312, "__label__entertainment": 0.0001544952392578125, "__label__fashion_beauty": 0.0001809597015380859, "__label__finance_business": 0.0003597736358642578, "__label__food_dining": 0.0003676414489746094, "__label__games": 0.0006899833679199219, "__label__hardware": 0.0030269622802734375, "__label__health": 0.0007619857788085938, "__label__history": 0.0004954338073730469, "__label__home_hobbies": 0.0001342296600341797, "__label__industrial": 0.0008435249328613281, "__label__literature": 0.0003039836883544922, "__label__politics": 0.0003609657287597656, "__label__religion": 0.0006570816040039062, "__label__science_tech": 0.439453125, "__label__social_life": 0.00013136863708496094, "__label__software": 0.0185699462890625, "__label__software_dev": 0.52978515625, "__label__sports_fitness": 0.00040221214294433594, "__label__transportation": 0.000881195068359375, "__label__travel": 0.0002791881561279297}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 37148, 0.0268]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 37148, 0.33461]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 37148, 0.86561]], "google_gemma-3-12b-it_contains_pii": [[0, 2868, false], [2868, 7610, null], [7610, 12177, null], [12177, 13672, null], [13672, 18128, null], [18128, 22588, null], [22588, 24055, null], [24055, 26500, null], [26500, 27015, null], [27015, 31517, null], [31517, 37099, null], [37099, 37148, null]], "google_gemma-3-12b-it_is_public_document": [[0, 2868, true], [2868, 7610, null], [7610, 12177, null], [12177, 13672, null], [13672, 18128, null], [18128, 22588, null], [22588, 24055, null], [24055, 26500, null], [26500, 27015, null], [27015, 31517, null], [31517, 37099, null], [37099, 37148, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 37148, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 37148, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 37148, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 37148, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 37148, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 37148, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 37148, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 37148, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 37148, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 37148, null]], "pdf_page_numbers": [[0, 2868, 1], [2868, 7610, 2], [7610, 12177, 3], [12177, 13672, 4], [13672, 18128, 5], [18128, 22588, 6], [22588, 24055, 7], [24055, 26500, 8], [26500, 27015, 9], [27015, 31517, 10], [31517, 37099, 11], [37099, 37148, 12]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 37148, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-08
|
2024-12-08
|
396e7863212c79188552c929f31329ff619690cf
|
Implementation of Fast Address-Space Switching and TLB Sharing on the StrongARM Processor
Adam Wiggins\textsuperscript{1}, Harvey Tuch\textsuperscript{1}, Volkmar Uhlig\textsuperscript{2}, and Gernot Heiser\textsuperscript{1,3}
\textsuperscript{1} University of New South Wales, Sydney 2052, Australia
\textsuperscript{2} University of Karlsruhe, Germany
\textsuperscript{3} National ICT Australia, Sydney, Australia
\{awiggins,htuch,gernot\}@cse.unsw.edu.au
Abstract. The StrongARM processor features virtually-addressed caches and a TLB without address-space tags. A naive implementation therefore requires flushing of all CPU caches and the TLB on each context switch, which is very costly. We present an implementation of fast context switches on the architecture in both Linux and the L4 microkernel. It is based on using domain tags as address-space identifiers and delaying cache flushes until a clash of mappings is detected. We observe a reduction of the context-switching overheads by about an order of magnitude compared to the naive scheme presently implemented in Linux.
We also implemented sharing of TLB entries for shared pages, a natural extension of the fast-context-switch approach. Even though the TLBs of the StrongARM are quite small and a potential bottleneck, we found that benefits from sharing TLB entries are generally marginal, and can only be expected to be significant under very restrictive conditions.
1 Introduction
A context switch occurs in a multi-tasking operating system (OS) whenever execution switches between different processes (i.e. threads of execution in different addressing/protection contexts). Such a switch requires the operating system to save the present execution context (processor registers) as well as the addressing context (virtual memory translation data, such as page tables). This generally requires a few dozen (or at worst a few hundred) instructions to be executed by the operating system, and the cost could therefore be of the order of 100 clock cycles [1].
Some architectures, however, make context switches inherently more expensive, as changing the addressing context can costs hundreds or thousands of cycles, even though it may take less than a dozen instructions. One such architecture is the ARM [2], which is especially targeted to embedded applications. High context switching costs are not an issue for many embedded systems, which may only consist of a single application with no protection between subsystems. Even if the system features several processes, context switching rates are often low enough so that the cost of individual context switches is not critical.
However, embedded systems are becoming increasingly networked, and increasingly have to execute downloaded code, which may not be trusted, or is possibly buggy and should not easily be able to crash the whole system. This leads to an increased use of protection contexts, and increases the relevance of context-switching costs.
Furthermore, there is a trend towards the use of microkernels, such as µITRON [3], L4 [4] or Symbian OS [5], as the lowest level of software in embedded systems. A microkernel provides a minimal hardware abstraction layer, upon which it is possible to implement highly modular/componentised systems that can be tailored to the specific environment, an important consideration for embedded systems which are often very limited in resources.
In a microkernel-based system, most system services are not provided by the kernel, and therefore cannot be obtained simply by the application performing an appropriate system call. Instead, the application sends a message to a server process which provides the service, and returns the result via another message back to the client. Hence, accessing system services requires the use of message-based inter-process communication (IPC). Each such IPC implies a context switch. Therefore, the performance of microkernel-based systems are extremely sensitive to context-switching overheads.
An approach for dramatically reducing context-switching overheads in L4 on the StrongARM processor has recently been proposed and analysed [6]. In this paper we present an implementation of this approach on two systems: Linux, a monolithic OS and L4KA::Pistachio [7], a new and portable implementation of the L4 microkernel under development at the University of Karlsruhe.
2 StrongARM Addressing and Caching
The ARM architecture features virtually-indexed and virtually-tagged L1 instruction and data caches. This ties cache contents to the present addressing context. Furthermore, and unlike most modern architectures, entries in the ARM’s translation-lookaside buffer (TLB) are not tagged with an address-space identifier (ASID). As a consequence, multitasking systems like Linux flush the TLB and CPU caches on each context switch, an expensive operation. The direct cost for flushing the caches is 1,000–18,000 cycles. In addition there is the indirect cost of the new context starting off with cold caches, resulting in a number of cache misses (≈ 70 cycles per line) and TLB misses (≈ 45 cycles per entry). Worst case this can add up to around 75,000 cycles, or ≈ 350μsec on a 200MHz processor.
These costs can be avoided by making systematic use of other MMU features provided: domains and PID relocation [6].
2.1 ARM Domains
The ARM architecture uses a two-level hardware-walked page table. Each TLB entry is tagged with a four-bit domain ID. A domain access control register
DACR modifies, for each of the 16 domains, the TLB-specified access rights for pages tagged with that domain. The domain register can specify that access is as specified in the TLB entry, that there is no access at all, or that the page is fully accessible (irrespective of the TLB protection bits).
Domains allow mappings of several processes to co-exist in the TLB (and data and instructions to co-exist in the caches\(^4\)), provided that the mapped parts of the address spaces do not overlap. In order to achieve this, a domain is allocated to each process, and the domain identifier is essentially used as an ASID. On a context switch, instead of flushing TLBs and caches, the DACR is simply reloaded with a mask enabling the new process’s domain and disabling all others. Shared pages can also be supported (provided they are mapped at the same address in all processes using them), by allocating one or more domains to shared pages.
Obviously, this scheme is much more restrictive than a classical ASID, due to the small number of domains. In a sense, however, it is also more powerful than an ASID: if TLB entries of shared pages are tagged with the same domain, the TLB entries themselves can be shared between the contexts, reducing the pressure on the relatively small number of TLB entries (32 data-TLB and 32 instruction-TLB entries). Such sharing of TLB entries is particularly attractive for shared libraries, which are very widely shared and tend to use up a fair number of instruction TLB entries.
### 2.2 StrongARM PID Relocation
The requirement of non-overlapping address spaces, while natural in a single-address-space operating system [8,9], is in practice difficult to meet in traditional systems such as Linux, and would severely limit the applicability of domains. At the least it requires using position-independent code not only for libraries but also for main program text, which implies a different approach to compiling and linking than in most other systems. For that reason, the StrongARM implementation [10] of ARM supports an address-space relocation mechanism that does not require position-independent code: Addresses less than 32MB can be transparently relocated into another 32MB partition. The actual partition, of which there are 64, is selected by the processor’s PID register. This allows the operating system to allocate up to 64 processes at non-overlapping addresses, provided their text and data sections fit into 32MB of address space. Stacks and shared libraries can be allocated in the remaining 2GB of address space, although, in practice, the stack will also be allocated below 32MB.
### 2.3 Fast Context Switching on StrongARM
Using domains IDs as an ASID substitute and PID relocation of small address spaces, context switches can be performed without having to flush caches and
\(^4\) The caches do not have any protection bits, so a TLB lookup is performed even on a cache hit, in order to validate access rights.
TLBs. The limited number of domains, however, imposes severe restrictions on this scheme (which is probably the reason Windows CE [11] does not use domains, and therefore does not provide protection between processes).
PID relocation, by itself, does not lead to sharing of TLB entries. In order to share TLB entries, memory must be shared (with unique addresses). This can be achieved by allocating shared regions (everything that is `mmap()`-ed, including shared library code) in a shared address-space region outside the 32MB area. In order to avoid collisions with the PID relocation slots, this shared area should be the upper 2GB of the address space.
The 32-bit address space is too small to prevent collisions outright. Hence, address space must be allocated so that collisions are minimised, but if they occur, protection and transparency are maintained (at the expense of performance). This can be done via an optimistic scheme that will try to allocate `mmap()`-ed memory without overlap as far as possible, uses domains to detect collisions, and only flushes caches if there is an actual collision [6].
The approach is based on making use of the ARM’s two-level page table. Normally, the translation table base register is changed during a context switch to point to the new process’s page directory (top-level page table). In order to detect address-space collisions, we never change that pointer. Instead we have it point to a data structure, called the caching page directory (CPD), which contains pointers to several processes’ leaf page tables (LPTs). As page directory entries are also tagged with a region ID, it is possible to identify the process to which a particular LPT belongs.

**Fig. 1.** Caching page directory (CPD) and per-address-space page tables
Fig. 1 illustrates this. The CPD is a cache of PD entries of various processes, tagged with their domain IDs. If two address spaces overlap, then after a context switch an access might be attempted which is mapped via a CPD entry that belongs to another process (as indicated by the domain tag). As the DACR only enables access to the present process’ domain, such an access will trigger a fault.
The kernel handles this by flushing TLB and caches, reloading the CPD entry from the currently running process’ PD, and restarting execution. Flushes will then only be required under one of the following circumstances:
1. a process maps anything (e.g. using the MAP_FIXED flag to the Linux mmap() system call) into the PID-relocation region between 32MB and 2GB, and the corresponding PID(s) are presently in use;
2. a process maps anything (using MAP_FIXED) into the shared region above 2GB and it collides with a mapping of another process;
3. there is no more space in the shared region for all mappings (which need to be aligned to 1MB);
4. the kernel is running out of domains to uniquely tag all processes and shared memory regions.
Given the small number of available domains (16), and the fact that the use of MAP_FIXED is discouraged, the last option is the most likely, except when very large processes are running.
3 Implementation
3.1 Fast Address-Space Switching
With the approach described in Section 2.3, the TLB, caches and page tables do not normally get touched on a context switch. All that needs to be done is to reload the DACR with a mask enabling access to the domain associated with the newly scheduled process, as well as any shared domains used by that process. The DACR value becomes part of the process context.
Flushes are required at context switch time if the new process does not have an associated domain, and no free domain is available, or when a shared mapping is touched that has no domain allocated. In that case, a domain ID must be preempted, and all CPD entries tagged with that domain need to be invalidated. With a total of 16 domains, and some domains being required for shared regions, this is not an infrequent event.
Cache and TLB flushes are also required if an address collision is detected. This is the case when a process accesses a page which is tagged in the CPD with a domain the process has no access to. In order to minimise the occurrence of collisions, the following steps are taken in Linux:
- The data and bss segments as well as the stack are allocated in the 32MB region. This does not limit the size of the heap, as malloc() will mmap() more space if brk() fails.
- mmap()-ed areas are, where possible, grouped (by process) into non-overlapping 1MB blocks allocated in the top 2GB of the address space.
In L4, all such mappings are under full control of the user-level code, hence no specific steps are required in the L4 kernel in order to minimise collisions.
Whenever caches are flushed, all domains are marked clean. A domain is marked dirty if a process with writable mappings in that domain is scheduled. Clean domains can be revoked without flushing caches.
3.2 TLB Sharing
On Linux we also implemented sharing of TLB entries for pages shared between processes. The implementation will transparently share TLB entries for memory shared via `mmap()`, provided the pages are mapped at the same address in both processes. The approach will not share TLB entries for program executables (as opposed to library code), as it is unlikely to produce any benefit on the StrongARM. In order to share the executable between processes, the two processes would have to be located in the same 32MB slot. This would cause maximum collisions on their stacks and data segments, unless those were staggered within the 32MB region. The programs could no longer be linked with their data segment at a fixed address (which introduces run-time overhead for addressing data). Furthermore, the need to share a single 32MB region between several processes would be too limiting to make the scheme worthwhile.
The present implementation allocates a separate domain for each shared region. The domain ID is kept in the VMA data structure linked to the in-memory inode.
Dynamically linked libraries account for a large amount of executed code in the system. In particular the standard C library consumes multiple megabytes of code and data. This code is relocated and linked at run time whereby code and data is relocated for the respective application. Shared libraries are commonly divided into one read-only part containing code and constant data, which is directly followed by a writable part.
In order to support sharing of library code, we modified the dynamic linker to separate the library’s text and data segments. The data segments are allocated within the lower 32MB region, while the code is mapped into the shared area above 2GB.
Each library is given a preferred link address which is, at present, stored globally in the system. The first application using the library creates a copy of the binary image and, instead of performing a relocation of a privately mapped view, the copied image is relocated and saved. Afterwards, other processes can use the same image and map it into their address spaces. For security reasons we have two copies, one which can only be written with root privileges and a private per-user copy. When the pre-allocated link address is not available (e.g., it is already in use by another library), the linker falls back to the private linking scheme.
The separation of code and data has certain drawbacks. Relocation information is based on the fixed layout of the library in the address space. The ARM architecture has a very restrictive set of immediate operations. Hence, most immediate values are generated by storing offsets or absolute values interleaved with the code and using PC-relative addressing.
To separate code and data, and, in particular, share the code over multiple address spaces, we had to replace the mechanism to reference the global offset table (GOT) storing references to functions and global data. Instead of calculating the GOT address via a PC-relative constant (per function!), we divided the address space into slots of 1MB and maintain a table of GOT addresses for
each slot of shared library code; larger libraries allocate multiple slots. At link
time the code is rewritten from PC-relative references into PC-relative refer-
ences within the GOT slot. ARM’s complex addressing scheme allows inlining
this address computation, which therefore results in no extra overhead. Finally,
we eliminated the constant reference in the procedure linkage table (PLT).
TLB entry sharing was not implemented in L4.
4 Evaluation
4.1 Benchmarks
Linux
lmbench We use the following benchmarks from lmbench [12]: lat\_ctx, hot\_potato
and proc\_create. These are the subset of lmbench which can be expected to be
sensitive to MMU performance.
lat\_ctx measures the latency of context switches. It forks \(n\) processes, each of
which touches \(k\) kilobytes of private data and then uses a pipe to pass a token
round-robin to the next process.
hot\_potato consists of two processes sending a token for and back. The latency
test uses file locks, a FIFO, a pipe or UNIX sockets for synchronisation.
proc\_create tests the latency of process creation. It consists of the following:
the fork test tests the latency of \texttt{fork()} followed by an immediate \texttt{exit()} in
the child. In the exec test the child performs an \texttt{exec()} to a program which
immediately exits. The shell test times the latency of the \texttt{system()} service.
extreme We use a synthetic benchmark, which we call \texttt{extreme}, designed to
establish the maximum performance gain from TLB entry sharing. It forks \(n\)
child processes all running the same executable. Each child \texttt{mmap()}-s the same \(p\)
pages, either private or shared. The child then executes a loop where it reads a
byte from each page and then performs a \texttt{yield()}. The benchmark is designed
to stress the data TLB.
When using private mappings the benchmark will not benefit from sharing
TLB entries; it will thrash the TLBs as much as possible. With shared mappings
it will share as many DTLB entries as possible (up to the lesser of \(p\) and the
TLB capacity).
L4 The L4 benchmarks measure IPC times similarly to the Linux hot potato
benchmark. A server process fires up a number of client processes, each of which
IPCs back to the server (for synchronisation) and waits. The server process then
IPCs random client processes, which immediately reply. The average latency of
a large number (100,000) of such ping-pong IPCs measured. This benchmark
concentrates on the property most critical to a microkernel-based system — the
IPC cost. The benchmark is run for a varying number of client processes.
Table 1. Lmbench performance of original Linux vs. fast address-space switch ("fast") kernel. Numbers in parentheses indicate standard deviations of repeated runs. The last column shows the performance of the FASS kernel relative to the original kernel.
<table>
<thead>
<tr>
<th>Benchmark</th>
<th>original</th>
<th>fast</th>
<th>ratio</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Lmbench hot potato latency [µs]</strong></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>fcntl</td>
<td>39 (50)</td>
<td>25 (3)</td>
<td>1.56</td>
</tr>
<tr>
<td>fifo</td>
<td>263 (1)</td>
<td>15.6 (0.1)</td>
<td>17</td>
</tr>
<tr>
<td>pipe</td>
<td>257 (3)</td>
<td>15.4 (0.1)</td>
<td>17</td>
</tr>
<tr>
<td>unix</td>
<td>511 (10)</td>
<td>30.7 (0.1)</td>
<td>16</td>
</tr>
<tr>
<td><strong>Lmbench hot potato bandwidth [MB/s]</strong></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>pipe</td>
<td>8.77 (0.02)</td>
<td>14.76 (0.03)</td>
<td>1.7</td>
</tr>
<tr>
<td>unix</td>
<td>12.31 (0.02)</td>
<td>12.94 (0.00)</td>
<td>1.05</td>
</tr>
<tr>
<td><strong>Lmbench process creation latency [µs]</strong></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>fork</td>
<td>4061 (4)</td>
<td>3650 (4)</td>
<td>1.1</td>
</tr>
<tr>
<td>exec</td>
<td>4321 (12)</td>
<td>3980 (10)</td>
<td>1.08</td>
</tr>
<tr>
<td>shell</td>
<td>54533 (40)</td>
<td>51726 (27)</td>
<td>1.05</td>
</tr>
</tbody>
</table>
4.2 Results
StrongARM results were taken from a system with 32MB of RAM, a 200MHz SA-1100 CPU and no FPU. The StrongARM has a 32-entry ITLB and a 32-entry DTLB, both fully associative. It has a 16kB instruction and an 8kB data cache, both fully virtual and 32-way associative, and no L2 cache.
Lmbench hot potato and process creation results for Linux are shown in Table 1. Latencies of basic Linux IPC mechanisms (FIFOs, pipes and Unix sockets) in the original kernel are between 35% and 75% of the worst-case value of $2 \times 350µsec$ quoted in Section 2. File locking is faster, as the test code touches very few pages and cache lines, which reduces the indirect costs of flushing.
The table shows the dramatic effect the fast-context-switching approach has on basic IPC times, with FIFO, pipe and socket latency reduced by more than an order of magnitude. Pipe bandwidth is also significantly improved (by 70%), while the improvement of the socket bandwidth is marginal. Even process creation latencies are improved by 5-10%. This is a result of lazy flushing of caches, which in many cases can defer the cleanup of a process’s address space and cache contents until the next time caches are flushed anyway, hence reducing the number of flushes.
Fig. 2 shows Lmbench context switch latencies. For the case of zero data accessed (i.e. pure IPC performance) the improvement due to fast context switching is dramatic, between almost two orders of magnitude (factor of 57) for two processes and a factor of four for 13 processes. After that, domain recycling kicks in (three domains are reserved for kernel use in ARM Linux), and the relative improvement is reduced. However, IPC costs in the fast kernel remain below 60% of the cost in the original kernel.
The runs where actual work is performed between the IPCs (in the form of accessing memory) show that the absolute difference between the IPC times
Fig. 2. Lmbench context switching latency (\textit{lat\_ctx}) as a function of the number of processes for different amount of memory accessed. Higher lines are for the original kernel, lower lines for the kernel with fast context switching.
remain similar, at least for smaller number of processes. This is a reflection of the actual IPC overhead being almost unaffected by the amount of memory accessed between IPCs.
Fig. 3 shows a magnified view of the zero-memory case of Fig. 2, with an additional set of data points corresponding to TLB entry sharing turned on. It is clear from this graph that the TLB is not a bottleneck in these benchmarks.
Fig. 3. Lmbench context switching latency over the number of processes with (zero accessed memory), comparing original kernel, fast kernel, and fast kernel with TLB entry sharing enabled.
Consequently, the improvement of IPC performance is not dramatic, varying between zero and 23%.
We used the extreme benchmark in order to determine the best-case effect of TLB entry sharing. Results are shown in Fig. 4, which compares the fast kernel with private mappings (and hence no TLB entry sharing) and with shared mappings (and TLB entry sharing). With private mappings execution slows markedly as soon as more than about ten pages are touched. With shared mapping, performance remains essentially constant until about 20 pages are touched. Performance is the same once the number of pages reaches 32, which is the capacity of the ARM’s data TLB. Execution times differ by factors of up to 9 (two processes) or 3.7 (16 processes). The effect is less pronounced with larger number of processes, as library code is not shared in this benchmark, and for larger process numbers the instruction TLB coverage is insufficient.
In practical cases the performance benefits from TLB entry sharing will be somewhere in between those of Figures 3 and 4, but most likely closer to the former. The reason is that the window for significant benefits from TLB entry sharing is small. The following conditions must hold:
- high context switching rates
- large amount of data shared between processes
- page working set no larger than the TLB size.
This combination is rare in present day applications. We made similar observations when examining the effect of TLB entry sharing on the Itanium architecture [13].
Fig. 4. Execution time over number of pages accessed for the extreme DTLB benchmark for 2, 4 and 16 processes. Higher lines are for the private mappings, lower lines for the shared mappings.
![Graph showing IPC round-trip time vs Client processes]
**Fig. 5.** L4 IPC times with standard and fast context switching implementation.
The effect of fast context switching in the L4 microkernel is shown in Fig. 5. In the standard kernel the cost of a round-trip IPC is around 135µsec (67.5µsec per context switch or about 1/5 of the worst-case figure of 350µs), quite independent of the number of processes. Fast context switching reduces the round-trip IPC cost to a minimum of 10µsec, a more than thirteen-fold improvement, rising slowly with the number of processes to 12µsec with 14 client processes (total of 15 processes), still a more than eleven-fold improvement. The increase of the IPC cost with larger number of processes is probably a result of increased competition for TLB entries and cache lines, an effect that is invisible in the standard kernel, as all caches are flushed on each context switch.
From 15 client processes the IPC cost rises faster. This is the point where the number of active processes (16) exceeds the number of domains available (15, as one is reserved for kernel use).
With a further increase of the number of processes, the IPC cost increase slows down. This may surprise at first, as the probability of the client thread having a domain allocated decreases. However, when a domain is recycled, all caches are flushed, making all allocated domains “clean” and therefore cheap to preempt. Hence, the direct and indirect cost of flushing caches is amortised over several IPCs. The IPC cost in the fast kernel stays well below that of the standard kernel.
These results have been obtained on a mostly unoptimised kernel. For example, 10µsec (2000 cycles) per round-trip IPC is actually very high for L4. Even with the generic IPC code in L4Ka::Pistachio we would expect to see a figure of less than 5µsec. We suspect that the kernel still has some performance bug, possibly an excessive cache footprint. Furthermore, coding the critical IPC path in assembler is known from other architectures to reduce the cost of simple IPC operations by another factor of 2–4. An optimised round-trip IPC should be around 2µsec. Such improvements would be essentially independent of the num-
ber of processes, and thus have the effect of shifting the lower line in Fig. 5 by a constant amount (significantly increasing the relative benefit of fast address-space switching).
5 Conclusion
Our results show that fast context switching, based on using domain IDs as address-space tags, is a clear winner on the StrongARM processor, in spite of the small number of available domains. We found no case where the overheads associated with maintaining domains outweighed their benefits. For basic IPC operations the gain was at least an order of magnitude, but even process creation times benefited.
There seems to be no reason not to use this approach in a system like Linux. In a microkernel, however, where the performance of systems built on top is critically dependent on the IPC costs, fast context switching is essential.
In contrast, the benefits of sharing TLB entries are marginal. It seems that this will only show significant benefits in a scenario characterised by high context-switching rates, significant sharing, and the TLB big enough to cover all pages if entries are shared, but too small of entries are not shared. The combination of high context-switching rates and intensive sharing of pages is rare in today’s computer systems.
Acknowledgements
The Linux implementation of this work was carried out while Adam Wiggins was an intern at Delft University of Technology, Netherlands. We would like to thank all the members of the Delft’s UbiCom project, in particular Jan-Derk Bakker, Koen Langendoen and Erik Mouw, for making this work possible.
Availability
Patches for fast-context switching support in Linux are available from http://www.cse.unsw.edu.au/~disy/Linux/, L4Ka::Pistachio for StrongARM, including support for fast-context switching, is available from http://l4ka.org.
References
|
{"Source-Url": "http://unsworks.unsw.edu.au/fapi/datastream/unsworks:4557/SOURCE1?view=true", "len_cl100k_base": 6433, "olmocr-version": "0.1.49", "pdf-total-pages": 13, "total-fallback-pages": 0, "total-input-tokens": 29036, "total-output-tokens": 7607, "length": "2e12", "weborganizer": {"__label__adult": 0.0005321502685546875, "__label__art_design": 0.0006918907165527344, "__label__crime_law": 0.0005288124084472656, "__label__education_jobs": 0.0004944801330566406, "__label__entertainment": 0.0001494884490966797, "__label__fashion_beauty": 0.00023758411407470703, "__label__finance_business": 0.0004470348358154297, "__label__food_dining": 0.0004544258117675781, "__label__games": 0.0008206367492675781, "__label__hardware": 0.017913818359375, "__label__health": 0.000659942626953125, "__label__history": 0.0005707740783691406, "__label__home_hobbies": 0.00018227100372314453, "__label__industrial": 0.0014066696166992188, "__label__literature": 0.0002486705780029297, "__label__politics": 0.0003979206085205078, "__label__religion": 0.000720977783203125, "__label__science_tech": 0.336181640625, "__label__social_life": 7.826089859008789e-05, "__label__software": 0.01459503173828125, "__label__software_dev": 0.62060546875, "__label__sports_fitness": 0.0003995895385742187, "__label__transportation": 0.0013208389282226562, "__label__travel": 0.00029087066650390625}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 31022, 0.02804]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 31022, 0.35715]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 31022, 0.90828]], "google_gemma-3-12b-it_contains_pii": [[0, 2652, false], [2652, 5501, null], [5501, 8476, null], [8476, 10675, null], [10675, 13413, null], [13413, 16572, null], [16572, 19176, null], [19176, 22476, null], [22476, 23317, null], [23317, 25016, null], [25016, 27239, null], [27239, 29431, null], [29431, 31022, null]], "google_gemma-3-12b-it_is_public_document": [[0, 2652, true], [2652, 5501, null], [5501, 8476, null], [8476, 10675, null], [10675, 13413, null], [13413, 16572, null], [16572, 19176, null], [19176, 22476, null], [22476, 23317, null], [23317, 25016, null], [25016, 27239, null], [27239, 29431, null], [29431, 31022, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 31022, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 31022, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 31022, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 31022, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 31022, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 31022, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 31022, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 31022, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 31022, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 31022, null]], "pdf_page_numbers": [[0, 2652, 1], [2652, 5501, 2], [5501, 8476, 3], [8476, 10675, 4], [10675, 13413, 5], [13413, 16572, 6], [16572, 19176, 7], [19176, 22476, 8], [22476, 23317, 9], [23317, 25016, 10], [25016, 27239, 11], [27239, 29431, 12], [29431, 31022, 13]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 31022, 0.08861]]}
|
olmocr_science_pdfs
|
2024-11-24
|
2024-11-24
|
5db13120e3a3b08797a06094a2f8ba9ffbad5e8b
|
Release Process
Metron Release Types
There are two types of Metron releases:
- Feature Release - this is a release that has a significant step forward in feature capability and is denoted by an upgrade of the second digit
- Maintenance Release - this is a set of patches and fixes that are issued following the FR and is denoted by an upgrade of the third digit
Release Naming Convention
Metron build naming convention is as follows: 0.[FR].[MR]. We keep the 0. notation to signify that the project is still under active development and we will hold a community vote to go to 1.x at a future time. The first release in a Feature Release line is 0.[FR].0. There may or may not ever be a release 0.[FR].1, depending whether the community decides to create follow-on Maintenance Release(s) or just go straight to the next Feature Release (which would be named 0.[FR+1].0).
Creating a Feature Release
Step 0 - Setup Release Signing Keys
In order to ensure files are identical to the ones created by the release manager, all releases are PGP signed and signatures are provided. Read more at Apache Release Signing.
Setting up the appropriate keys can be done following the instructions at Apache GnuPG instructions. Make sure to follow the instructions on avoiding SHA-1.
Once this is done, the release manager should ensure their public key is provided in the KEYS file, following the usual Pull Request process. See METRON-1575 - Add leet gpg public key to the KEYS file and PR#1028 for an example.
Currently, the KEYS file is only pushed with a main Metron release. This means that, when there is a new release manager, they will be unable to release apache/metron-bro-kafka-plugin without a release of apache/metron.
Step 1 - Initiate a [DISCUSS] thread
Prior to the release the Release manager should do the following (preferably starting about a month before the release):
- Make sure that the list of JIRAs slated for the release accurately reflects the pull requests that are currently in master
- Construct an email to the Metron dev board (dev@metron.apache.org) which discusses with the community the desire to do a release. This email should contain the following:
- The version number for the new release to be.
- Proposed timeframe for the code freeze and release.
- The list of JIRAs already committed for the release, with descriptions.
(See "CHANGES file" below for a grep command that will generate the list of JIRAs already committed.)
- A solicitation of additional JIRAs that would be desirable to include in the next release. Users should rate them as must-have / should-have / good-to-have, as well as volunteering.
A release email template is provided here.
Step 2 - Monitor and Verify JIRAs
Once the community votes for additional JIRAs they want included in the release verify that the pull requests are in before the release. close these JIRAs and tag them in the JIRA app with the release name. All pull requests and JIRAs that were not slated for this release will go into the next releases. The release manager should continue to monitor the JIRA to ensure that the timetable is on track until the release date. On the release date the release manager should message the Metron dev board (dev@metron.apache.org) announcing the code freeze for the release.
Also, run the JIRA verification tool at dev-utilities/release-utils/validate-jira-for-release, and before the end of the release process assure that its results are made consistent with the release CHANGES document (see below).
Step 3 - Increment Metron version if needed
Determine the current build version number on master branch, as described here. If it is not the desired release number (for instance, if we desire to release version 0.5.0, but the current build version is 0.4.1), then submit a PR to update the build version number as described in Change the Build Version Number, get approval, and commit.
Step 4 - Review the Apache Documentation for Releases
Review the Apache documentation around Release Distribution and Release Policy. Make sure to understand what build artifacts are expected to produced, what are not expected to be produced (e.g. MD5 and SHA-1 used to be supplied, but are now omitted), what is expected of download links, etc. This may necessitate updates to the release process and/or script to handle.
https://www.apache.org/dev/release-distribution
https://apache.org/legal/release-policy.html
Step 5 - Create the Release Candidate
A script exists at `dev-utilities/release-utils/prepare-release-candidate` to create a release candidate and the appropriate accompanying artifacts. Follow the instructions at `dev-utilities/release-utils/README.md#prepare-release-candidate`.
In the following descriptions, `[N]` is used to denote the release candidate number. This starts at 1 and must be incremented each time a RC is pushed to Git.
It's strongly recommended to do a practice run first, validate the build ([Verifying Builds](http://www.apache.org/foundation/license-faq.html)) and licensing (see [Apache指导下](http://www.apache.org/foundation/license-faq.html)), then do a live run. A live run will do the appropriate Git and SVN pushed.
This script will:
- Do an SVN clone of the repo at `https://dist.apache.org/repos/dist/dev/metron`. We will refer to this as the dev repo. It will hold the release candidate artifacts.
- Do an SVN clone of the repo at `https://dist.apache.org/repos/dist/release/metron`. We will refer to this as the release repo. It will hold the release artifacts.
- Do a Git clone of the repo at `https://git-wip-us.apache.org/repos/asf/metron.git`. This holds the source code for the release candidate.
- Create appropriate tags (following the naming convention `git tag apache-metron_0.[FR].[MR]-rc[N]`).
- Create the release tarball (following the naming convention `apache-metron_0.[FR].[MR]-rc[N].tar.gz`).
- Create the appropriate release artifacts. The script will create these, and manual instructions are provided here:
- Release (candidate) Tarball
- Per [Apache guidance](http://www.apache.org/foundation/license-faq.html), we use SHA512 hash digests in the signing process, see [how to set your gpg defaults, and upgrade your signing keys if you have old ones](http://www.apache.org/foundation/license-faq.html). Likewise, do not use 4-byte fingerprints, like "DEAD BEEF" or "0xDEADBEEF", to refer to your signing key, as these have been demonstrated vulnerable. Instead use 8-byte fingerprints, like "BADD CAFE DEAD BEEF" or "0xBADDCAFEDEADBEEF".
- SHA512 hash of the release tarball; here we will also provide SHA256 hashes for backward compatibility:
- `gpg --print-md SHA512 apache-metron_0.[FR].[MR]-rc1.tar.gz > apache-metron_0.[FR].[MR]-rc1.tar.gz.sha512`
- `gpg --print-md SHA256 apache-metron_0.[FR].[MR]-rc1.tar.gz > apache-metron_0.[FR].[MR]-rc1.tar.gz.sha256`
- GPG signature of release tarball by the release manager:
- Assuming your 8-byte public code signing key fingerprint is 0xBADDCAFEDEADBEEF, so your signing command would be: `gpg -u 0xBADDCAFEDEADBEEF --armor --output apache-metron_0.[FR].[MR]-rc1.tar.gz.asc --detach-sig apache-metron_0.[FR].[MR]-rc1.tar.gz`
- Note: You only need the `-u` arg if you have more than one public/private key pair generated. If you have forgotten it, you can find it from the output of `gpg --fingerprint`. It's the last 8 bytes (16 hex characters) from the key fingerprint.
- If you do not know, or cannot recover, your code signing key and password as release manager, you must start over with a new code signing key. Follow the instructions at [https://www.apache.org/dev/release-signing.html#generate](https://www.apache.org/dev/release-signing.html#generate). You should then link your new code signing key into Apache's web of trust.
- The LICENSE and NOTICE files from the release tarball
- The KEYS file from the release tarball
- A CHANGES file denoting the changes
- Create the directory in the dev repo for the artifacts (following the convention `0.[FR].[MR]-RC[N]`). A live run will also commit them (`svn commit -m "Adding artifacts for Metron 0.[FR].[MR]-RC[N]"`). A practice run will simply print the commands.
**Historical Note:** Releases for Metron versions 0.6.0 and earlier used a - to delineate the prefix (apache-metron) from the version/release information (such as 0.6.0-release or 0.6.0-rc1).
Step 6 - Push the Git Tag
When you're confident this release candidate is worthy to be tested by the community, push the tag to the public git repo. Chdir back to the local repo from which you created the release candidate tarball, and verify that the tag is present:
```
git tag
```
Then push the tag to the public repo:
```
git push origin tag apache-metron_0.[FR].[MR]-rc[N]
```
Browse the public repo and confirm the tag has been pushed successfully.
Step 7 - Call for a community release vote
Next initiate a [VOTE] thread on the dev list to announce the build vote. The vote email template can be found here: [Build Vote Template](http://www.apache.org/foundation/release-voting.html). Allow at least 72 hours for the community to vote on the release.
- If issues are found with the release and the vote fails, then the vote thread is closed with a synopsis of the voting results and a new RC is worked on in the community.
- If issues are found with the release and the vote succeeds, then we proceed to cut the release, but should notify the community of the issues via an email on the dev list with the accompanying JIRA(s) required to correct the issue(s).
- If no issues are found, then we can cut a release.
When you get enough votes, close the vote by replying `[RESULT][VOTE]` to the email thread with the tally of all the votes. Again, wait for at least 72 hours before closing the vote.
### Step 8 - Tag the finished release
**apache/metron**
After the vote passes, re-tag the RC as the release. In your working repo for the release (cloned from https://git-wip-us.apache.org/repos/asf/metron.git), do:
```bash
git tag apache-metron_0.[FR].[MR]-release apache-metron_0.[FR].[MR]-rc[N]
git push origin tag apache-metron_0.[FR].[MR]-release
```
**apache/metron-bro-plugin-kafka**
After the vote passes, re-tag the RC as the release. In your working repo for the release (cloned from https://git-wip-us.apache.org/repos/asf/metron-bro-plugin-kafka.git), do:
```bash
git tag apache-metron-bro-plugin-kafka_0.[FR].[MR]-release apache-metron-bro-plugin-kafka_0.[FR].[MR]-rc1
git tag 0.[FR] apache-metron-bro-plugin-kafka_0.[FR].[MR]-release
git push origin tag apache-metron-bro-plugin-kafka_0.[FR].[MR]-release
git push origin tag 0.[FR]
```
The 0.[FR] tag is created to allow the release to be handled appropriately by bro-pkg. Note that we expect to be able to change this to 0.[FR].[MR] as of the release of bro 2.7 via https://github.com/bro/bro/commit/615ff78234fb6d1be889e3544eb034c0b6891a4, but it would need to be coordinated with a change in apache/metron-bro-plugin-kafka itself (https://github.com/apache/metron-bro-plugin-kafka/pull/8).
### Step 9 - Stage the finished release
A directory with the name of the release version should be made in the release svn repository.
Collateral from the release candidate in the dev repo should be moved to the release repo directory and renamed to remove the rc (e.g. mv apache-metron_0.[FR].[MR]-rc1.tar.gz apache-metron_0.[FR].[MR].tar.gz)
Regenerate the `sha*` files (but NOT the asc signature file), and compare against the original to confirm they have exactly the same hash fingerprints. Alternatively one may edit the `sha*` files to remove the “-rc1” internal references, but there is greater potential for human error with a manual edit.
Add the directory and commit via the subversion client:
```bash
svn add 0.[FR].[MR]
svn commit -m "Adding artifacts for Metron 0.[FR].[MR]"
```
Confirm that the new release is visible in dist, by pointing your browser at https://dist.apache.org/repos/dist/release/metron/. It should appear promptly, but may not be instantaneous.
### Step 10 - Update the Website to point at the new release location
Open a JIRA with title "update public web site to point at 0.[FR].[MR] new release". Suppose it is METRON-1234. Make a new git clone of Metron, and create a working branch for the website update submission:
```bash
cd <workdir>
git clone https://github.com/apache/metron.git
cd metron
git checkout -b METRON-1234 apache-metron_0.[FR].[MR]-release
```
Now rebuild the doc and web sites, and copy the built site-book to site/current-book
```
mvn clean site
cd site
rm -rf current-book
cp -r ../site-book/target/site current-book
```
To validate the current-book, do `open current-book/index.html` in your browser and confirm that it shows the correct Metron version number in the upper right.
Now edit the file `documentation/index.md` to change all instances of the old version number, in both human readable text and URIs.
Finally, use bundle and the jekyll local server to build and check the actual website, following the instructions here: Website PR Merge. Validate that the Download links are correct, and that the Book link is correct. Now submit a PR for METRON-1234, get approval, and commit the new "site" source to master, in the usual way. But don't do the final step yet (commit built site image from "target" to asf-site branch), until the release has propagated to mirrors; see next two steps.
Remember that download links in the Website should never point directly at dist, but rather always point at mirrors via http://www.apache.org/dyn/closer.cgi/metron/[VERSION]/... However, the signature files (.asc and .sha*) must point at https://www.apache.org/dist/metron/0.[FR].[MR]/...
### Step 11 - Wait for the new release to propagate to mirrors
According to Apache docs, "It may take up to 24 hours or more for a newly published release to be sync'd to all mirrors. Mirrors have their own schedules. Mirrors are required to check at least once a day, but most will check for updates 2 to 4 times per day." At least wait until a spot-check of mirrors on http://www.apache.org/dyn/closer.cgi/ show the new release.
### Step 12 - Add the release to the Apache database
Add the release to Apache so it shows up in the board report generator by going here: https://reporter.apache.org/addrelease.html?metron
### Step 13 - Announce the release
Commit the built Website to the Metron asf-site branch, per the final instructions from Website PR Merge, so it is publicly visible.
Send an email out to user@ and dev@ to announce the release along with the changelog and a word of thanks/praise.
### Step 14 - Clean up
Remove the old releases from the release repo, after making sure they are already mirrored into the archive repo. Only the current version and the KEYS file should be in the release repo.
It is good practice to increment the build version in master immediately after a Feature Release, so that dev builds with new stuff from master cannot be mistaken for builds of the release version. So, immediately after a release, increment the MINOR version number (eg, with the 0.4.0 just released, set the new version number to 0.4.1) per Change the Build Version Number.
In addition, if a new version of apache/metron-bro-plugin-kafka has been released, the development environments in apache/metron should be updated to point to the latest plugin release.
### Creating a Maintenance Release
Creation of the Maintenance Release should follow exactly the same set of steps as creating the Feature Release as outlined above, but with two exception. First, the version incremented on the maintenance release should be the MR++ so that the release is named 0.[FR].[MR++]. Second, if a critical JIRA comes in that requires an immediate patch, the votes with three binding +1's are still required, but the following can be waived:
- Step 1 (discussion)
- Step 2 (Jira collecting and tracking)
- the 72 hour waiting period in Step 9 (vote)
- Step 13 (mirror propagation)
A critical JIRA is something that is either a security vulnerability or a functional show stopper.
### Maintaining a Maintenance Branch
Being able to maintain the previous release train, with only critical or important bug fixes and security fixes (generally not new features) for users who are averse to frequent large changes is very important for production use. They get stability, while the new feature release code line proceeds as fast as the community wishes.
When needed, and with community discussion, create a Maintenance Branch for the previous Metron release by incrementing the "third" digit of the previous release like so 0.[FR]."[MR++"]. All patches to the previous Metron release will be checked in under the MR branch and where it makes sense also under the master branch. All new features will be checked in under the master branch.
Ensuring Consistency between Feature and Maintenance releases
It is important to assure that all commits to the maintenance branch also get made in the master branch (if relevant), to avoid the appearance of regressions in the next Feature Release from master branch. The formal process for assuring this is as follows:
- Every maintenance release JIRA should have a corresponding feature JIRA to make sure that the patch is applied consistently to both branches. The maintenance JIRA should be cloned and appropriate fix version for the feature release should be applied. If the fix is not relevant to the feature or maintenance branch then the submitter must explicitly state this. In general reviewers should refuse a maintenance branch patch PR unless both feature and maintenance JIRAs have been created.
- The release manager has a responsibility to review all commits to the maintenance line since last release, and make sure they were duplicated to the feature branch (unless not relevant, which must also be determined).
|
{"Source-Url": "https://cwiki.apache.org/confluence/download/temp/pdfexport-20191130-301119-1658-65934/METRON-ReleaseProcess-301119-1658-65935.pdf?contentType=application/pdf", "len_cl100k_base": 4237, "olmocr-version": "0.1.53", "pdf-total-pages": 5, "total-fallback-pages": 0, "total-input-tokens": 12525, "total-output-tokens": 4599, "length": "2e12", "weborganizer": {"__label__adult": 0.00026917457580566406, "__label__art_design": 0.0002287626266479492, "__label__crime_law": 0.00024116039276123047, "__label__education_jobs": 0.00043082237243652344, "__label__entertainment": 4.303455352783203e-05, "__label__fashion_beauty": 9.006261825561523e-05, "__label__finance_business": 0.00021851062774658203, "__label__food_dining": 0.0002199411392211914, "__label__games": 0.00040531158447265625, "__label__hardware": 0.00025177001953125, "__label__health": 0.0001379251480102539, "__label__history": 9.953975677490234e-05, "__label__home_hobbies": 6.312131881713867e-05, "__label__industrial": 0.00014972686767578125, "__label__literature": 0.00016379356384277344, "__label__politics": 0.000179290771484375, "__label__religion": 0.00023293495178222656, "__label__science_tech": 0.0006556510925292969, "__label__social_life": 9.41157341003418e-05, "__label__software": 0.0111083984375, "__label__software_dev": 0.984375, "__label__sports_fitness": 0.00017952919006347656, "__label__transportation": 0.00016629695892333984, "__label__travel": 0.00013554096221923828}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 17952, 0.01186]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 17952, 0.03437]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 17952, 0.887]], "google_gemma-3-12b-it_contains_pii": [[0, 3980, false], [3980, 9190, null], [9190, 12517, null], [12517, 16535, null], [16535, 17952, null]], "google_gemma-3-12b-it_is_public_document": [[0, 3980, true], [3980, 9190, null], [9190, 12517, null], [12517, 16535, null], [16535, 17952, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, false], [5000, 17952, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 17952, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 17952, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 17952, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 17952, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 17952, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 17952, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 17952, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 17952, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 17952, null]], "pdf_page_numbers": [[0, 3980, 1], [3980, 9190, 2], [9190, 12517, 3], [12517, 16535, 4], [16535, 17952, 5]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 17952, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-11
|
2024-12-11
|
48994f657df7148443901a3d73f8d982359fbd5c
|
Perspectives for using software agents in e-Government applications
Zbigniew Piotrowski*
Faculty of Computer Science and Information Systems, Szczecin University of Technology, Žołnierska 49, 71-210 Szczecin, Poland
Abstract
Governing a country includes a set of decentralised processes. Moreover, in the unions of countries with integrated economic space, the decentralisation issue gains the attention. The most known examples of federated governments are two of the biggest world economies: the United States of America and the European Union. The decentralisation is even more significant when considering resources for businesses. Specifically the workforce, the land and the infrastructure are commonly managed at the local or the sub-local level. The paper addresses the issues concerning citizens’ mobility (both for personal and professional purposes) and businesses’ pan-European operations.
Application of autonomous software agents to aid cross-border businesses operations and citizens movements is addressed. The paper presents the possibility of making citizens’ movements smoother and involving less paperwork. To support these ideas, the foundations and conclusions from Infocitizen initiative are introduced.
In the conclusions of the paper, it is suggested that the agent-based technology for opening agents-ready virtual offices by agencies at all levels of government should be used. It would benefit the users if they were allowed to set up software agents to act on their behalf and to search all possible locations in order to find required resources. The mentioned task would be impossible or extremely resource-consuming when done manually.
1. Introduction
The purpose of the Lisbon Strategy, drawn up by the European Union (EU), is to make European economy the world’s most competitive economy in terms of innovation, social inclusion, liberalisation and enterprise environment. The competitiveness of the EU is still behind the world’s most developed economies which are the USA and a group of “Asian tigers”: Japan, Hong Kong, the Republic of Korea, Singapore and Taiwan. In 2006 the EU average indicators were still far behind the leaders in the vast majority of analysed categories. To face that challenge, in February 2005 the Lisbon Strategy was re-launched with
*e-mail address: zpiotrowski@wi.ps.pl
new guidelines. The “Working together for growth and jobs” [1] strategy directs the main effort of the EU to make Europe a more attractive place to invest and work. To achieve that goal the EU needs to improve regulations and create a consistent single market without any obstacles. Switching to Euro – the common currency of European countries – was the first step in creating an integrated market covering the whole continent. Moreover, the consistency of law systems and freedom of operations is considered as the main factor which decides about the openness of the market. Additionally, an attractive place for jobs requires assuring the unrestricted mobility of the workforce. Unfortunately, the European market’s openness is far behind the traditional freedom of market in the USA, where all 50 states, which can be perceived as analogical to 29 European Economic Area countries, are under the single federal jurisdiction, use the same currency and speak the same language.
Achieving business’ and citizens’ mobility comparable to the USA is a challenge for European countries. To provide such functionality and to protect countries’ sovereignty at the same time, governments and administration structures of all countries must closely cooperate. However, the cooperation and fast as well as errorless information exchange would not be possible without applying advanced Information Technology (IT) solutions. Moreover, competing with the USA in the field of becoming the most competitive knowledge based economy of the world is possible only when the integration level of IT infrastructures of all member states will be sufficiently high [1,2].
Usefulness of IT in supporting administrative tasks is closely bonded with citizens’ ability to deal with e-solutions. In the last years citizens e-literacy is growing up around the world. Applying electronic solutions requires citizens to put more trust in their governments, on the other hand IT solutions give more control over the government’s actions to citizens. The efficiency of the e-Government can be improved by raising the overall level of education and computer literacy as well as with the development of the appropriate infrastructure [3].
2. Decentralisation of the government
Decentralising government competences arises from the European Treaty and is aligned with the European Union’s strategy. A country’s law shall guarantee local governments all means necessary to perform their duties. The preamble of the European Charter of Local Self-Governments [4] states: “Considering that the local authorities are one of the main foundations of any democratic regime; Considering that the right of citizens to participate in the conduct of public affairs is one of the democratic principles that are shared by all member States of the Council of Europe; Considering that it is at the local level that this right
can be most directly exercised."¹. The document was ratified by 43 countries at the end of the year 2007².
Reorganisation of a country’s administrative structure from the central managed structure into the self-governed one was done in Poland in the beginning of democratic reforms. The reorganisation is considered successful and it improved Poland’s management especially in the area of European financial aid, which became noticeable shortly before and after accession of Poland to the EU. Local governments improved the success ratio in accepting EU Structural and Consistency Funds.
In the EU the companies are not the only ones who compete between each other. Public agencies, governments, regions, cities compete as well. On the other hand, when a country enters the EU structures, it is bonded by a new set of regulations. Government institutions at the same time compete and cooperate with those in the entire Europe [5].
Moreover, the increased competition between regions is accompanied by the increased mobility of citizens and businesses. Mobile workers are willing to travel to any place to get their dream job. The mobility is embraced by the European Union as a factor which improves the joint European economy’s competitiveness. Therefore new services required by citizens and existing services should respond to the increased mobility of citizens. The main issue of citizens’ migrations is lack of consistent information exchange architecture/infrastructure. Institutions use their own systems, which are often incompatible within one country not to mention automated cross-border information exchange. Removing physical borders (on 21.12.2007 the Schengen zone grew to 22 countries) is not accompanied by removing administrative ones.
Centralisation of administrative tasks is impossible from the technological and organisational points of view. Furthermore, it is against the European philosophy of moving the governance closer to people. Finally, centralisation of some tasks can be considered as an attempt on a country’s sovereignty. Hence, other means of providing citizens with consistent European-wide administration shall be developed. European countries which reached some advance in developing the e-Government infrastructure developed sets of best practices and interoperability frameworks for that area. These attempts were noticed by the European community and the European Interoperability Framework [6] was created.
Introducing e-Government initiatives at the local level shifts the power from public managers to citizens and businesses. The approach presented in [7] suggests at first shaping e-government initiatives by public managers employed
¹Source: [4]
²http://conventions.coe.int/treaty/Commun/QueVoulezVous.asp?NT=122&CL=ENG
by government agencies and afterwards giving more control to local societies. The customers, in the case of the government – citizens and businesses, shall decide what level of technological advancement is necessary to achieve their goals. The paper warns against projecting citizens’ or businesses’ expectations directly on the e-Government structure. Their expectations can often have a very complex and indirect influence on desired e-Government functionalities.
3. Local resources for citizens and businesses
Each country possesses specific material and not material resources. There are various statistics of countries resources’ allocations, however, these statistics do not show the real availability of particular resources in particular places. The central government of a country is too far and too concerned with the big picture to micromanage resources at the local level. Making resources available to companies is the task of specialised government agencies, in the case of Poland these agencies are PAiiIZ\(^3\) (winning and supporting foreign investments) and PARP\(^4\) (supporting domestic small and medium enterprises). However, these agencies do not own any resources but they contact local governments to ask them for the availability of the resources. This approach makes the process less flexible and more time consuming. Electronic and automated workflow should be introduced to make providing potential investors with resources more efficient.
Despite the growing understanding of the role of the internet in the communication with businesses, using e-Government technologies as a competitive factor of regions is yet to be discovered. Local governments are closer to local societies and can listen to their needs. They also have access to more accurate information about the environment and available resources. The local government knows the detailed structure of the demographic profile of the society, therefore it can conclude what type of companies could benefit most for the region. For example, when the society is young and educated, the local administration should attract research facilities or high tech companies which can utilise locally available workforce.
The main driver of all businesses is to maximise the profit. Outsourcing of various processes gained significant attention in the last years. Companies are moving their production to countries where costs of manufacturing or providing services is lower. However, it is not rare that a cost-effective operation meets obstacles in the form of a huge amount of administrative paperwork to fulfil. Doing accounting for an investment in a foreign country often requires hiring a consulting company or funding a shell company in a target country. The
\(^3\)http://www.paiz.gov.pl/
\(^4\)http://www.parp.gov.pl/
additional effort is required because operations in every country are subjected to different jurisdictions and are considered as separate ventures. The additional paperwork creates additional costs.
The availability of government services in Internet evolves and can be divided into phases starting with (1) an initial presence of an institution marked by a simple website with basic information. In further stages the government heads to (2) extending the presence by adding dynamic information, (3) adding interactivity (downloadable forms, gathering feedback) and finally to (4) the transactional level when citizens can use remote connection to initiate transactions, which literally leads to a virtual visit to an institution’s branch by interacting with its website. Advancing the interaction level between citizens and the government is accompanied by integrating services from different levels of the government (vertical integration) and by integrating complementary services from different sources (horizontal integration). The final and the most evolved level of the government is the full integration of all services at the country’s level. In such a scenario a citizen can access all services from a single website (one-stop-shop), where he or she uses a unique identification name and password (single-log-on) to perform all operations regardless of their origin and to have all fees put on a single consolidated bill. The information exchange between all institutions is integrated both at the presentation layer (from the citizen’s point of view) and at the business logic layer (from the institution’s point of view) [7].
The issue which makes vertical integration more difficult is the slower progress of the development of electronic services by authorities at the local level. Even in countries with highly developed services at the country’s level, the local level is strongly underdeveloped. The situation is better in bigger cities which discovered the potential of electronic access channels earlier than smaller communities. Furthermore, services for businesses tend to be developed in the first place as the more friendly business environment gets more investments in the region. Creating e-Government services at any level is a good start for the propagation of the idea to other levels. Once citizens get acquainted with a service in one institution, they will demand it from other agencies. The same rule applies to agencies, when a decision maker sees how other agency benefits from a particular service, he embraces creating the same service for his institution [7].
4. Applying software agents
4.1. The idea of an agent localising administration units
The software agents paradigm describes the approach to mobile computing, where mobile code is executed on various host systems. The four main characteristics of a software agent can be distinguished [8]:
– Intelligence – ability to adapt to changing working environment,
– Cooperative behaviour – negotiating and sharing knowledge with other agents,
– Autonomy – performing specified tasks without any interaction from the user,
– Mobility – ability to transfer to another host system.
More vague definitions describe agency and software agency as reacting to data received from sensors, acting on user’s behalf by software entities or acting independently in a dynamic environment [9].
Software agents are being applied to various operations which mainly include information gathering and filtering, and decision making. A carefully designed set of such actions creates an e-commerce flow, including: product brokering, merchant brokering, price negotiations and arranging additional services. The most common application of software agents is supporting Business-to-Customer (B2C) relations by providing customers with “shop bots” and “auction bots” (more in [10]). Although these solutions can be applied for Business-to-Business (B2B) relations as well, dealing with enterprise interaction requires more sophisticated tools. Multi-attribute and multi-subject auctions, contract negotiations and Supply Chain Management (SCM) require dedicated solutions to help companies with achieving the best return from each spent monetary unit. A distinguishable family of negotiating software agents was designed as the answer to businesses needs. The strongest advantage of using software agents, which are able to embed their code into a remote system, is the data mining ability [10].
Software agents can be applied to integrate government services both horizontally and vertically. The agent can localise the appropriate institution according to the given task and perform all the necessary information exchange with it. Moreover, the agent can design and execute automatically the whole chain of operations between multiple organisations to perform a cross-border operation.
An automated, distributed e-Government applications architecture was proposed in [11]. The architecture uses web services, workflow specifications and software agents to automate one of the Finnish government’s business processes. A certain level of flexibility is achieved by utilising Business Process Execution Language (BPEL) and the software agents technology. A software agent dynamically creates a workflow process for each service call using available services description. A different approach was suggested in [12], where the Web Digital Government (WebDG) Web Services Management System was introduced. The WebDG utilises a central repository architecture for government services. The system creates a dedicated service for each request.
made by a citizen. The purpose of such an architecture is to achieve the highest Quality of Service (QoS).
Software agents can be applied to customised e-Government services where a set of user profiles is created and an agent associates a profile with a citizen requesting the service. Such an approach can be used to create personalised services for citizens. Such an approach should result in the gain of approval for the administration initiatives. The User Agent associated with a citizen makes an inquiry to the Service Manager Agent for services which may be interesting for the user associated with the User Agent. Services are chosen according to data in profiles stored in the User Profile Database. Profiles consist of demographic data [13].
4.2. The Infocitizen project
The unlimited mobility of people and businesses is one of the foundations of the EU. The Infocitizen project addresses that mobility in the area of peoples migrations. The purpose of the Infocitizen is to use software agents to perform all registration duties required during citizens’ migrations. The goal of the project is to allow citizens to contact only the office in the destination country, so he or she is not required to carry on any additional documents from his or her home country. The only document which is sufficient for all purposes is the identification card [14].
The described idea suits the EU policy of removing all barriers for the unrestricted mobility. With the Infocitizen project, all citizens can access any service concerning their registration duties from any place. The project consisted of designing a software agent architecture for local administrative units providing citizens’ registration services [14].
The unrestricted mobility is defined as an ability to perform all activities in any place within the EU, just as it would be done in the home country. All documentations related to citizens’ birth, changing marital status, birth of a child, adopting a child, registering a new residence, taking a job could be filled in any appropriate office participating in the information exchange (presumably any public service office in the EU).
The scope of the project covers providing services by public administration, requesting services by citizens and interaction between a citizen and public administration units. The whole process is coordinated by the Infocitizen agent. The process of citizens migration involves communicating with the citizen’s regional office to update his status. More complicated tasks are for example: marriage and adopting a child. In the case of marriage, offices of both spouses shall be queried about the marital status and the status shall be updated with the new information [14].
The Infocitizen’s technical architecture is based on the JAVA environment. The architecture is based on utilising a set of services. The services are combined at run-time when a business action is triggered [15].
The technical architecture of the Infocitizen is organised in the following way: each public administration unit has its own InfoCitizen Service Interface running on its own IT infrastructure, the InfoCitizen Interoperability Agent is the central component of the InfoCitizen Platform. Agents are utilized on “as-needed” basis. Several agents can exist within the architecture. The structure of software components of the Infocitizen architecture is shown in Fig. 1. An administrative unit requests a service from an agent. The agent who responds to the request carries out all tasks, including getting any additional input from the citizen or administrative employee. The other components are: the services repository, the interface between the agent infrastructure and legacy systems in administration offices, and maintenance and development components [16].
4.3. Aiding interactions between governments and businesses
Relations between governments (or local governments) and business can be considered twofold [17]:
1) a company is a subject of administrative responsibilities (G2B relation),
2) multiple governments (or local governments) compete to make a company invest on their soil (B2G relation).
Applying a software agent to act as a proxy who contacts all regions to gather necessary information for a company would benefit both the company and the whole business environment. Companies can make their decision based on
accurate and exhaustive data and local societies can compete between each other by making their regions more attractive for businesses. Local governments can even create coalitions with neighbouring societies from different countries to gain an attractive investor for the region. The “Euroregion”\(^5\) initiative is an example of cross-border cooperation of local governments within the EU. With software agents interactions between companies and local governments/societies can be independent of the administrative borders and of information systems frames. An agent can seek necessary resources in a heterogeneous environment.
**Conclusions**
Trying to integrate already decentralised administration structure would be a step back in the effort of making citizens’ and businesses’ flows easier. Applying an agent-ready framework, where citizens and businesses can set up a software agent to make their inquiries or perform their tasks is a compromise between the total centralisation and the autonomy of every country in managing their own systems. The most efficient vision of the government of the future is the vision of a single website where citizens and companies from any country belonging to a community (the European Union in the case of Europe) can do all government-related tasks regardless of their localisation and formal registration. The website should be accompanied by a single toll-free number where call-centre consultants can assist the user in solving all issues. The rules which apply to customer services in the government are not different from those which apply to businesses, as citizens are used to the customer service provided by businesses.
Considering government services from the angle of the three-tier software model, the single website (one-stop-shop) should provide integration of all government services at the presentation layer. User input shall be converted to a common data model for an agent which creates a task based on the provided data. Enabling more services in the manner applied in the Infocitizen project allows to achieve the desired interoperability level with preserving the autonomy of all countries in designing their administration. If the EU makes a requirement of extending all services to support the software agents infrastructure, countries can develop e-Government services according to their own visions constrained only by the single condition of the agent enablement.
A software agent can take over the role of an institution whose duty is to support companies when investing in a country. The agent can search for the best source of requested resources regardless of the country, which will enable internal competition and create a strong motivation to improve the business environment. The agent can perform the matchmaking of companies and regions
\(^5\)http://www.pomerania.net/
in order to achieve maximal synergetic effect or proper alignment. Maximising properties of individual regions creates a bottom-up effect on the economic growth of the joined European economic space.
References
|
{"Source-Url": "https://journals.umcs.pl/ai/article/download/3216/2412", "len_cl100k_base": 4324, "olmocr-version": "0.1.53", "pdf-total-pages": 10, "total-fallback-pages": 0, "total-input-tokens": 21881, "total-output-tokens": 5661, "length": "2e12", "weborganizer": {"__label__adult": 0.0005125999450683594, "__label__art_design": 0.001232147216796875, "__label__crime_law": 0.0025234222412109375, "__label__education_jobs": 0.005523681640625, "__label__entertainment": 0.0002682209014892578, "__label__fashion_beauty": 0.00033092498779296875, "__label__finance_business": 0.037994384765625, "__label__food_dining": 0.00058746337890625, "__label__games": 0.0017223358154296875, "__label__hardware": 0.0013208389282226562, "__label__health": 0.0008077621459960938, "__label__history": 0.0017595291137695312, "__label__home_hobbies": 0.00024235248565673828, "__label__industrial": 0.0013189315795898438, "__label__literature": 0.0006518363952636719, "__label__politics": 0.032562255859375, "__label__religion": 0.0006299018859863281, "__label__science_tech": 0.0755615234375, "__label__social_life": 0.0005393028259277344, "__label__software": 0.2471923828125, "__label__software_dev": 0.583984375, "__label__sports_fitness": 0.0003495216369628906, "__label__transportation": 0.0016698837280273438, "__label__travel": 0.0007767677307128906}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 26961, 0.02133]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 26961, 0.39889]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 26961, 0.92858]], "google_gemma-3-12b-it_contains_pii": [[0, 2341, false], [2341, 5223, null], [5223, 7997, null], [7997, 10805, null], [10805, 13698, null], [13698, 16420, null], [16420, 19157, null], [19157, 20807, null], [20807, 23664, null], [23664, 26961, null]], "google_gemma-3-12b-it_is_public_document": [[0, 2341, true], [2341, 5223, null], [5223, 7997, null], [7997, 10805, null], [10805, 13698, null], [13698, 16420, null], [16420, 19157, null], [19157, 20807, null], [20807, 23664, null], [23664, 26961, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 26961, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 26961, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 26961, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 26961, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 26961, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 26961, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 26961, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 26961, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 26961, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 26961, null]], "pdf_page_numbers": [[0, 2341, 1], [2341, 5223, 2], [5223, 7997, 3], [7997, 10805, 4], [10805, 13698, 5], [13698, 16420, 6], [16420, 19157, 7], [19157, 20807, 8], [20807, 23664, 9], [23664, 26961, 10]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 26961, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-06
|
2024-12-06
|
65d13e026a14d4ec9ed61551fea6a4273a562ec6
|
Unrestricted Grammars
An unrestricted, or Type 0, or phrase structure grammar $G$ is a quadruple
$(V, \Sigma, R, S)$, where
- $V$ is an alphabet,
- $\Sigma$ (the set of terminals) is a subset of $V$,
- $R$ (the set of rules) is a finite subset of
$$(V^* \setminus (V \cdot \Sigma) \setminus V^*) \times V^*.$$
- $S$ (the start symbol) is an element of $V - \Sigma$.
We define derivations just as we did for context-free grammars.
The language generated by $G$ is
$$\{w \in \Sigma^* : S \Rightarrow^* G w\}$$
There is no notion of a derivation tree or rightmost/leftmost derivation for unrestricted grammars.
Unrestricted Grammars
Example: $L = a^n b^n c^n$, $n > 0$
- $S \rightarrow aBSc$
- $S \rightarrow aBc$
- $Ba \rightarrow aB$
- $Bc \rightarrow bc$
- $Bb \rightarrow bb$
Another Example
$L = \{w \in \{a, b, c\}^* : \text{number of a's, b's and c's is the same}\}$
- $S \rightarrow ABCS$
- $S \rightarrow ABC$
- $AB \rightarrow BA$
- $BC \rightarrow CB$
- $AC \rightarrow CA$
- $BA \rightarrow AB$
- $CA \rightarrow AC$
- $CB \rightarrow BC$
- $A \rightarrow a$
- $B \rightarrow b$
- $C \rightarrow c$
A Strong Procedural Feel
Unrestricted grammars have a procedural feel that is absent from restricted grammars.
Derivations often proceed in phases. We make sure that the phases work properly by using nonterminals as flags that we're in a particular phase.
It's very common to have two main phases:
- Generate the right number of the various symbols.
- Move them around to get them in the right order.
No surprise: unrestricted grammars are general computing devices.
Equivalence of Unrestricted Grammars and Turing Machines
**Theorem:** A language is generated by an unrestricted grammar if and only if it is recursively enumerable (i.e., it is semidecided by some Turing machine M).
**Proof:**
- Only if (grammar → TM): by construction of a nondeterministic Turing machine.
- If (TM → grammar): by construction of a grammar that mimics backward computations of M.
**Proof that Grammar → Turing Machine**
Given a grammar G, produce a Turing machine M that semidecides L(G).
M will be nondeterministic and will use two tapes:
For each nondeterministic "incarnation":
- Tape 1 holds the input.
- Tape 2 holds the current state of a proposed derivation.
At each step, M nondeterministically chooses a rule to try to apply and a position on tape 2 to start looking for the left hand side of the rule. Or it chooses to check whether tape 2 equals tape 1. If any such machine succeeds, we accept. Otherwise, we keep looking.
Proof that Turing Machine → Grammar
Suppose that M semidecides a language L (it halts when fed strings in L and loops otherwise). Then we can build M' that halts in the configuration (h, 0).
We will define G so that it simulates M' backwards.
We will represent the configuration (q, 0aw) as
>uaqw<
M'
goesto
Then, if w ∈ L, we require that our grammar produce a derivation of the form
S →_G_ >h< (produces final state of M')
⇒_G_* >abq< (some intermediate state of M')
⇒_G_* >sw< (the initial state of M')
⇒_G_ w< (via a special rule to clean up >s)
⇒_G_ w (via a special rule to clean up <)
The Rules of G
S → >h< (the halting configuration)
> → ε (clean-up rules to be applied at the end)
< → ε
Rules that correspond to δ:
If δ(q, a) = (p, b) :
bp → aq
If δ(q, a) = (p, −) :
abp → aqb ∀b ∈ Σ
aqp< → aq<
If δ(q, a) = (p, ←), a ≠ 0
pa → aq
If δ(q, 0) = (p, ←)
pqb → qpb ∀b ∈ Σ
p< → q<
A REALLY Simple Example
\[ M' = (K, \{a\}, \delta, s, \{h\}) \]
\[
\delta = (\{(s, \Box), (q, \rightarrow)\}, 1 \\
(\{(q, a), (q, \rightarrow)\}, 2 \\
(\{(q, \Box), (t, \leftarrow)\}, 3 \\
(\{(t, a), (p, \Box)\}, 4 \\
(\{(t, \Box), (h, \Box)\}, 5 \\
(\{(p, \Box), (t, \leftarrow)\}) 6 \\
\]
\[ L = a^* \]
\[
S \rightarrow >\Box h < \\
>\Box s \rightarrow \varepsilon \\
< \rightarrow \varepsilon \\
\]
(1) \[ \Box q \rightarrow \Box s\Box \] \\
[ \Box aq \rightarrow \Box sa \] \\
[ \Box q< \rightarrow >\Box s< \]
(2) \[ a\Box q \rightarrow aq\Box \] \\
[ aaq \rightarrow aqa \] \\
[ a\Box q< \rightarrow aq< \]
Working It Out
\[
S \rightarrow >\Box h < \\
>\Box s \rightarrow \varepsilon \\
< \rightarrow \varepsilon \\
\]
(1) \[ \Box q \rightarrow \Box s\Box \] \\
[ \Box aq \rightarrow \Box sa \] \\
[ \Box q< \rightarrow >\Box s< \]
(2) \[ a\Box q \rightarrow aq\Box \] \\
[ aaq \rightarrow aqa \] \\
[ a\Box q< \rightarrow aq< \]
<table>
<thead>
<tr>
<th>Production</th>
<th>Step</th>
</tr>
</thead>
<tbody>
<tr>
<td>S \rightarrow >\Box h <</td>
<td>1</td>
</tr>
<tr>
<td>>\Box s \rightarrow \varepsilon</td>
<td>2</td>
</tr>
<tr>
<td>< \rightarrow \varepsilon</td>
<td>3</td>
</tr>
<tr>
<td>(1) \Box q \rightarrow \Box s\Box</td>
<td>4</td>
</tr>
<tr>
<td>\Box aq \rightarrow \Box sa</td>
<td>5</td>
</tr>
<tr>
<td>\Box q< \rightarrow >\Box s<</td>
<td>6</td>
</tr>
<tr>
<td>(2) a\Box q \rightarrow aq\Box</td>
<td>7</td>
</tr>
<tr>
<td>aaq \rightarrow aqa</td>
<td>8</td>
</tr>
<tr>
<td>a\Box q< \rightarrow aq<</td>
<td>9</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>Production</th>
<th>Step</th>
</tr>
</thead>
<tbody>
<tr>
<td>>\Box saa<</td>
<td>1</td>
</tr>
<tr>
<td>>\Box aqa<</td>
<td>2</td>
</tr>
<tr>
<td>>\Box aaq<</td>
<td>2</td>
</tr>
<tr>
<td>>\Box aaq<</td>
<td>2</td>
</tr>
<tr>
<td>>\Box aat<</td>
<td>4</td>
</tr>
<tr>
<td>>\Box a\Box q<</td>
<td>5</td>
</tr>
<tr>
<td>>\Box q<</td>
<td>6</td>
</tr>
<tr>
<td>>\Box t<</td>
<td>5</td>
</tr>
<tr>
<td>>\Box h<</td>
<td>5</td>
</tr>
</tbody>
</table>
Lecture Notes 25 Grammars and Turing Machines 4
An Alternative Proof
An alternative is to build a grammar $G$ that simulates the forward operation of a Turing machine $M$. It uses alternating symbols to represent two interleaved tapes. One tape remembers the starting string, the other “working” tape simulates the run of the machine.
The first (generate) part of $G$:
Creates all strings over $\Sigma^*$ of the form
\[ w = \text{# } \text{# } Q_s a_1 a_1 a_2 a_2 a_3 a_3 \ldots \]
The second (test) part of $G$ simulates the execution of $M$ on a particular string $w$. An example of a partially derived string:
\[ \text{# } \text{# } Q_s a_1 b_2 c b_4 Q_3 a_3 \]
Examples of rules:
- $b b Q_4 \rightarrow b 4 Q_4$ (rewrite $b$ as $4$)
- $b 4 Q_3 \rightarrow Q_3 b 4$ (move left)
The third (cleanup) part of $G$ erases the junk if $M$ ever reaches $h$.
Example rule:
- $\# h a_1 \rightarrow a_1 \# h$ (sweep $\# h$ to the right erasing the working “tape”)
Computing with Grammars
We say that $G$ computes $f$ if, for all $w, v \in \Sigma^*$,
\[ SwS \Rightarrow_{G^*} v \iff v = f(w) \]
Example:
- $S1S \Rightarrow_{G^*} 11$
- $S11S \Rightarrow_{G^*} 111$ \hspace{1cm} $f(x) = \text{succ}(x)$
A function $f$ is called grammatically computable iff there is a grammar $G$ that computes it.
**Theorem:** A function $f$ is recursive iff it is grammatically computable.
In other words, if a Turing machine can do it, so can a grammar.
**Example of Computing with a Grammar**
$f(x) = 2x$, where $x$ is an integer represented in unary
$G = (\{S, 1\}, \{1\}, R, S)$, where $R =$
- $S1 \rightarrow 11S$
- $SS \rightarrow \varepsilon$
Example:
Input: $S111S$
Output:
More on Functions: Why Have We Been Using Recursive as a Synonym for Computable?
Primitive Recursive Functions
Define a set of basic functions:
- \( \text{zero}_k(n_1, n_2, \ldots n_k) = 0 \)
- \( \text{id}_{j,k}(n_1, n_2, \ldots n_k) = n_j \)
- \( \text{successor}(n) = n + 1 \)
Combining functions:
- Composition of \( g \) with \( h_1, h_2, \ldots h_k \) is
\[ g(h_1(\quad), h_2(\quad), \ldots h_k(\quad)) \]
- Primitive recursion of \( f \) in terms of \( g \) and \( h \):
\[ f(n_1, n_2, \ldots n_k, 0) = g(n_1, n_2, \ldots n_k) \]
\[ f(n_1, n_2, \ldots n_k, m+1) = h(n_1, n_2, \ldots n_k, m, f(n_1, n_2, \ldots n_k, m)) \]
Example:
- \( \text{plus}(n, 0) = n \)
- \( \text{plus}(n, m+1) = \text{succ(plus}(n, m)) \)
Primitive Recursive Functions and Computability
Trivially true: all primitive recursive functions are Turing computable.
What about the other way: Not all Turing computable functions are primitive recursive.
Proof:
Lexicographically enumerate the unary primitive recursive functions, \( f_0, f_1, f_2, f_3, \ldots \).
Define \( g(n) = f_n(n) + 1 \).
\( G \) is clearly computable, but it is not on the list. Suppose it were \( f_m \) for some \( m \). Then
\( f_m(m) = f_m(m) + 1 \), which is absurd.
Suppose \( g \) is \( f_3 \). Then \( g(3) = 27 + 1 = 28 \). Contradiction.
Functions that Aren’t Primitive Recursive
Example: Ackermann’s function:
- \( A(0, y) = y + 1 \)
- \( A(x + 1, 0) = A(x, 1) \)
- \( A(x + 1, y + 1) = A(x, A(x + 1, y)) \)
Thus writing digits at the speed of light on all protons and neutrons in the universe (all lined up) starting at the big bang would have produced \( 10^{127} \) digits.
Recursive Functions
A function is \textbf{\(\mu\)-recursive} if it can be obtained from the basic functions using the operations of:
- Composition,
- Recursive definition, and
- Minimalization of minimalizable functions:
The \textbf{minimalization} of \(g\) (of \(k + 1\) arguments) is a function \(f\) of \(k\) arguments defined as:
\[
f(n_1,n_2,\ldots,n_k) = \begin{cases}
\text{the least } m \text{ such at } g(n_1,n_2,\ldots,n_k,m)=1, & \text{if such an } m \text{ exists,} \\
0 & \text{otherwise}
\end{cases}
\]
A function \(g\) is \textbf{minimalizable} iff for every \(n_1,n_2,\ldots,n_k\), there is an \(m\) such that \(g(n_1,n_2,\ldots,n_k,m)=1\).
\textbf{Theorem}: A function is \(\mu\)-recursive iff it is recursive (i.e., computable by a Turing machine).
Partial Recursive Functions
Consider the following function \(f\):
\[
f(n) = \begin{cases}
1 & \text{if } \text{TM}(n) \text{ halts on a blank tape} \\
0 & \text{otherwise}
\end{cases}
\]
The domain of \(f\) is the natural numbers. Is \(f\) recursive?
\textbf{Theorem}: There are uncountably many partially recursive functions (but only countably many Turing machines).
Functions and Machines

Is There Anything In Between CFGs and Unrestricted Grammars?
Answer: yes, various things have been proposed.
**Context-Sensitive Grammars and Languages:**
A grammar $G$ is context sensitive if all productions are of the form
$$x \rightarrow y$$
and $|x| \leq |y|$.
In other words, there are no length-reducing rules.
A language is context sensitive if there exists a context-sensitive grammar for it.
Examples:
- $L = \{a^n b^n c^n, n > 0\}$
- $L = \{w \in \{a, b, c\}^*: \text{number of } a's, b's \text{ and } c's \text{ is the same}\}$
Context-Sensitive Languages are Recursive
The basic idea: To decide if a string w is in L, start generating strings systematically, shortest first. If you generate w, accept. If you get to strings that are longer than w, reject.
Linear Bounded Automata
A linear bounded automaton is a nondeterministic Turing machine the length of whose tape is bounded by some fixed constant k times the length of the input.
Example: \[ L = \{a^n b^n c^n : n \geq 0\} \]
\[
\begin{array}{l}
\emptyset \xrightarrow{aabbcc} \\
\Rightarrow a' \xrightarrow{a} a' \xrightarrow{b} b' \xrightarrow{c} c' \xrightarrow{L_2}
\end{array}
\]
Context-Sensitive Languages and Linear Bounded Automata
Theorem: The set of context-sensitive languages is exactly the set of languages that can be accepted by linear bounded automata.
Proof: (sketch) We can construct a linear-bound automaton B for any context-sensitive language L defined by some grammar G. We build a machine B with a two track tape. On input w, B keeps w on the first tape. On the second tape, it nondeterministically constructs all derivations of G. The key is that as soon as any derivation becomes longer than \(|w|\) we stop, since we know it can never get any shorter and thus match w. There is also a proof that from any lba we can construct a context-sensitive grammar, analogous to the one we used for Turing machines and unrestricted grammars.
Theorem: There exist recursive languages that are not context sensitive.
Languages and Machines
- Recursively Enumerable Languages
- Recursive Languages
- Context-Sensitive Languages
- Context-Free Languages
- Deterministic Context-Free Languages
- Regular Languages
- FSMs
- DPDAs
- NDPDAs
- Linear Bounded Automata
- Turing Machines
The Chomsky Hierarchy
Type 0 | Type 1 | Type 2
Regular (Type 3) Languages
FSMs
PDAs
Linear Bounded Automata
Turing Machines
Recursively Enumerable Languages
Context-Sensitive Languages
Context-Free Languages
Regular Languages
FSMs
PDAs
Linear Bounded Automata
Turing Machines
|
{"Source-Url": "https://www.cs.utexas.edu/~cline/ear/automata/CS341-Fall-2004-Packet/1-LectureNotes/25-TuringMachinesHandout.pdf", "len_cl100k_base": 4160, "olmocr-version": "0.1.50", "pdf-total-pages": 11, "total-fallback-pages": 0, "total-input-tokens": 24044, "total-output-tokens": 4640, "length": "2e12", "weborganizer": {"__label__adult": 0.0005364418029785156, "__label__art_design": 0.0004868507385253906, "__label__crime_law": 0.0005598068237304688, "__label__education_jobs": 0.0012874603271484375, "__label__entertainment": 0.0001996755599975586, "__label__fashion_beauty": 0.0002613067626953125, "__label__finance_business": 0.00020182132720947263, "__label__food_dining": 0.0007052421569824219, "__label__games": 0.001094818115234375, "__label__hardware": 0.0013360977172851562, "__label__health": 0.000797271728515625, "__label__history": 0.00041604042053222656, "__label__home_hobbies": 0.00014328956604003906, "__label__industrial": 0.0008344650268554688, "__label__literature": 0.0014772415161132812, "__label__politics": 0.0005168914794921875, "__label__religion": 0.0010061264038085938, "__label__science_tech": 0.09918212890625, "__label__social_life": 0.0001462697982788086, "__label__software": 0.006816864013671875, "__label__software_dev": 0.88037109375, "__label__sports_fitness": 0.00044083595275878906, "__label__transportation": 0.0008540153503417969, "__label__travel": 0.00023293495178222656}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 12102, 0.01354]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 12102, 0.7719]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 12102, 0.71053]], "google_gemma-3-12b-it_contains_pii": [[0, 1120, false], [1120, 2551, null], [2551, 3447, null], [3447, 5036, null], [5036, 6661, null], [6661, 8318, null], [8318, 9538, null], [9538, 10086, null], [10086, 11555, null], [11555, 11824, null], [11824, 12102, null]], "google_gemma-3-12b-it_is_public_document": [[0, 1120, true], [1120, 2551, null], [2551, 3447, null], [3447, 5036, null], [5036, 6661, null], [6661, 8318, null], [8318, 9538, null], [9538, 10086, null], [10086, 11555, null], [11555, 11824, null], [11824, 12102, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 12102, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, true], [5000, 12102, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 12102, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 12102, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 12102, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 12102, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 12102, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 12102, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 12102, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 12102, null]], "pdf_page_numbers": [[0, 1120, 1], [1120, 2551, 2], [2551, 3447, 3], [3447, 5036, 4], [5036, 6661, 5], [6661, 8318, 6], [8318, 9538, 7], [9538, 10086, 8], [10086, 11555, 9], [11555, 11824, 10], [11824, 12102, 11]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 12102, 0.08]]}
|
olmocr_science_pdfs
|
2024-11-30
|
2024-11-30
|
f2e0cbc41e35be540fa1467bf5381a768d9899c0
|
## CONTENTS
1 Repositories .......................... 3
1.1 mozilla-central .......................... 3
1.2 GitHub .......................... 3
2 Browser .......................... 5
3 Localization (l10n) .......................... 7
3.1 Projects .......................... 7
3.2 Routine Extraction of new strings .......................... 8
3.3 When can I expect to see my strings land? .......................... 9
3.4 Debug locales .......................... 9
4 Server .......................... 11
4.1 Push Duty .......................... 11
5 UX .......................... 17
5.1 Add-ons Discovery Pane UX Specs .......................... 17
5.2 AMO to Firefox Account Migration UX Specs .......................... 21
5.3 Management UX .......................... 24
5.4 Submission UX .......................... 25
6 Random stuff .......................... 27
6.1 Github labels .......................... 27
7 Indices and tables .......................... 29
This refers primarily to the work done by the Add-ons team at Mozilla.
If you are an Add-on Developer wanting to work on developing an Add-on for Firefox, then you probably do not want to be looking at this documentation. Instead checkout MDN or AMO.
Contents:
1.1 mozilla-central
Browser code is maintained in mozilla-central. This includes several areas related to add-ons. All of the following bug trackers are in Bugzilla:
1.1.1 Add-ons Manager
Handles installing, running and updating add-ons within the application (eg: Firefox). Also has pages like about: addons. In bugzilla - product: Toolkit, component: Add-ons Manager. Existing bugs or file a new bug.
1.1.2 WebExtensions
An API for building add-ons that works with e10s and is compatible with Google Chrome. In bugzilla - product: Toolkit, component: WebExtensions. Existing bugs or file a new bug. Documentation on MDN.
1.2 GitHub
Almost everything else is on GitHub and issues are tracked in GitHub. This is a non-exhaustive list. Other repositories and libraries do appear around these main libraries:
1.2.1 addons
These docs and an issue tracker. This repository serves as an umbrella for everything add-ons. Bug tracker is in GitHub and can be used for almost anything add-ons related. Existing bugs.
1.2.2 addons-server
The addons.mozilla.org website. The repository and issue tracker is on GitHub. Documentation is on readthedocs. In the past this repository has been known as remora, zamboni or olympia.
1.2.3 addons-code-manager
A web application to manage add-on source code, such as reviewing code for add-ons submitted to addons.mozilla.org. The repository and issue tracker is on GitHub.
1.2.4 addons-linter
The linter checks WebExtensions for common errors and potential problems. It is used on addons.mozilla.org and web-ext. It can also be run in stand-alone mode. The repository, issue tracker and documentation is on GitHub.
1.2.5 dispensary
The dispensary collects and offers hashes of popular JavaScript libraries, mainly for the Mozilla’s addons-linter. The repository and issue tracker is on GitHub.
1.2.6 web-ext
This is a command line tool to help build, run, and test WebExtensions. The repository and issue tracker is on GitHub. The documentation and command reference is on Extension Workshop.
1.2.7 extension-workshop
Extension Workshop is a launchpad for building Firefox extensions. It contains resources about development, publication and management of WebExtensions. The repository and issue tracker is on GitHub.
Everything browser (and likely WebExtensions related).
These notes are primarily to support localizers working on localizations related to https://addons.mozilla.org/.
3.1 Projects
There are two core projects for AMO that require localization:
- addons-server (addons-server on Pontoon)
- addons-frontend (addons-frontend on Pontoon)
Both of these projects use Pontoon for translations.
3.1.1 addons-server
Addons-server is the default front-end for desktop users of AMO, it is also the API backend and home to the developer hub and reviewer tools. It is written in Python using the Django Framework.
Testing changes to addons-server localizations
The strings will be available on dev or stage depending on when they were committed see [When can I expect to see my strings land?](https://addons.mozilla.org/) for details.
The relevant hosts for addons-server are as follows:
- dev https://addons-dev.allizom.org/
- stage https://addons.allizom.org/
- prod https://addons.mozilla.org/
3.1.2 addons-frontend
Addons-frontend is the new frontend and default frontend for mobile user-agents, it will eventually replace the addons-server frontend for user-pages. It is written in JavaScript and uses React at its core. Addons-frontend currently provides an amo app (amo.po).
3.1.3 Advanced Configuration for testing addons-frontend strings
This will be enough for basic string checks. If you need to test strings related to the install buttons you will need to enabled preferences to allow add-on installation to work on the development and stage servers.
To fully configure Firefox to install add-ons on either dev/stage you will need to additionally do the following:
- Use Firefox Nightly or Firefox Developer Edition
- A new profile is recommended since changing the dev certs will mark existing add-on installs as invalid (this change is not immediate).
- Go to about:config and set extensions.webapi.testing as a Boolean to true.
- To install an add-on, you will need to be able to install a signed add-on from dev or stage. Create the xpinstall.signatures.dev-root pref in about:config as a Boolean and set it to true.
- If you see warnings when trying to install a theme or theme previews don’t work go to about:preferences#security and add an exception for dev/stage (See the “Exceptions” button next to “Warn me when sites try to install add-ons”).
- Restart the browser.
3.2 Routine Extraction of new strings
Newly added strings are extracted every week after the tag which is at 9am PST on Tuesdays.
3.3 When can I expect to see my strings land?
Once translations are committed into our repositories they are visible on our dev server within 30mins (or as long as it takes to deploy the code).
Master is tagged and pushed to stage weekly at around 9am PST every Tuesday.
The code is released to production every Thursday. The push generally starts around 9am PST.
3.4 Debug locales
There are two debug locales generated from the English keys. These can be useful to detect strings that are not marked for extraction.
The debug locales are called dbl (Debug left to right) and dbr (Debug right to left). The tool used to build these is called potools and it is both HTML and placeholder aware, to provide more accurate simulated localizations.
To access a debug locale simply replace the current locale in the url of the page you are on.
About the add-ons server.
Contents:
4.1 Push Duty
The pushing of the server rotates each week to another developer. Current rotation is:
- bsilverberg
- eviljeff
- mat
Check out the Add-ons calendar for a list of events.
4.1.1 Before the push
The code that will go in production on Thursday is tagged on Tuesday at 09:00 PT. The following repositories are tagged:
- addons-server
- addons-frontend
- addons-code-manager
- extension-workshop
Project Dependencies
Project dependencies are not tagged as part of the push duty responsibilities. If you’re working on a feature in a project that’s a dependency of a project e.g. addons-linter, then it’s your responsibility to make a release and update the project that consumes that dependency in time for the tag.
This way we can ensure that:
- Dependency packages are built and released in time for the tag.
- The new feature in the new version of a package has been validated on -dev.
Making multiple releases of a package during a weekly milestone is totally fine since this helps with testing smaller sets of changes.
Security Fixes
Security fixes for addons-server live on a separate private repository:
- **addons-server-security**
To make merging easier, when making a pull request against this repository, the remote branch should not be published to one’s fork but to the repository itself. Once the PR has been reviewed, it should not be merged right away. Instead, merging to main is part of push duty and happens right before tagging:
```
$ git checkout main
$ git pull
$ git fetch security
$ git merge security/<branch-name>
$ git diff upstream/main
$ git push upstream main
$ git push security main
```
**Note:** mozilla/addons-server-security main branch should never be pushed to directly without pushing to mozilla/addons-server main first - the two should always stay in sync.
This means the merge or edit buttons in github web UI must never be used in that repository.
**Note:** Here we are using **upstream** and **security** remotes, which point to mozilla/addons-server and mozilla/addons-server-security, respectively. If your configuration is different you can substitute upstream and security for whatever you call the mozilla/addons-server and mozilla/addons-server-security repositories’ remotes.
Tag the repos
Tags are of the format: **YYYY.MM.DD**,
**Note:** The date is the date of the push, not the date of tagging.
**Note:** Once addons-frontend has been tagged a new docker image will be built on CircleCI and is required to deploy to stage.
It’s usually the main branch that is tagged:
```
$ git checkout main
$ git pull
$ git tag 2015.09.10
$ git push upstream 2015.09.10
```
**Note:** Here we are using “upstream” as the remote. If yours is different you can substitute “upstream” for whatever you call the mozilla/addons-server repo remote.
Get a compare link from github to compare this tag to the last tag. Add that compare link to the push doc so that people can clearly see what is pushing.
If tagging the main branch can’t be done (some feature is already on main, but not ready for production), then the commits that need to be released should be cherry-picked
If you’re adding cherry-picks to a tag that already exists, it makes sense to create a new tag rather than overwrite the old one. The reason for this is that re-using a tag makes it less easy to see the process that was involved in arriving at that tag. Also, it’s entirely possible to make a mistake by using an old tag that exists locally rather than the newer version on the remote when tags are re-used.
When creating a new tag you can use the format YYYY.MM.DD-SUFFIX where suffix is a number that’s incremented with each revision. The first time this is done will look like this:
```
$ git checkout 2015.09.03
$ git cherry-pick <commit hash> # as many times as you need
$ git tag 2015.09.10-1
$ git push upstream 2015.09.10-1
```
And the second:
```
$ git checkout 2015.09.03-1
$ git cherry-pick <commit hash> # as many times as you need
$ git tag 2015.09.10-2
$ git push upstream 2015.09.10-2
```
Then update the push doc with the new comparison link for the updated tag.
**Extension Workshop**
The tag naming scheme for extension-workshop is a bit different. When tagging for stage, add the suffix -stage to the tag name. For example:
```
$ git checkout master
$ git pull
$ git tag 2022.02.10-stage
$ git push upstream 2022.02.10-stage
```
Note: When pushing to stage you must create a tag with the -stage suffix. If you create and push a tag without that suffix you will be deploying to production.
**Push to stage**
Our infrastructure automates pushing the tags to stage once the tags have been pushed up to the repository.
The only required step is to check that the tag has deployed by looking out for the automated push messages in the internal slack channel.
You can also check /__version__ or /__frontend_version__ on a given service which shows the currently deployed revision and tag e.g:
- Addons Server (stage)
- Addons Frontend (stage)
- Addons Code Manager (stage)
Note that for Extension Workshop, pushing a tag to upstream with a name including the -stage suffix, will automatically deploy the tag to stage. You should manually verify Extension Workshop on stage after the push has
completed. Visit https://extensionworkshop.allizom.org and view any pages that have been changed since the last push to verify they exist and are rendering properly.
**Extract locales**
Once you are done pushing the tags to stage:
- Run the `./bin/run-l10n-extraction` command in `addons-frontend` repository (documentation).
- Run the `./scripts/extract-l10n.sh` command in `addons-server` repository.
Because the `addons-server` is meant to be used inside the docker container, it doesn’t have access to your `git` credentials, so you’ll need to enter the container, run the script, exit the container and push the branch created by script. The `addons-frontend` one does that for you, but in both cases you’ll need to open the pull request yourself.
**Before the push**
Keep an eye out for any blocking bugs. Add them to the etherpad and find someone to work on them.
**4.1.2 Push**
The tag is pushed to production by ops (wezhou), once approved by QA (Krupa), on Thursdays. It is the responsibility of the push hero to follow-up with QA and ops, and be around during the push for any unexpected issues.
**Extension Workshop**
We push to extension-workshop on prod manually by creating a pushing a tag without the `--stage` suffix. For example:
```
$ git checkout 2022.02.10-stage
$ git tag 2022.02.10
$ git push upstream 2022.02.10
```
You should manually verify Extension Workshop on prod after the push has completed. Visit https://extensionworkshop.com and view any pages that have been changed since the last push to verify they exist and are rendering properly.
**Monitoring the push**
The best places to monitor the results of the push are:
- Sentry
- Grafana
- Ops dashboard
- Prod Health dashboard
- API usage/performance dashboard
The site performance graphs should show no large spikes or changes. Sentry should show no new errors, although it will show intermittent errors and the occasional error as the push occurs.
Once complete
Create a new github document for the next push, for example:
https://github.com/mozilla/addons/blob/main/releases/2019/05/09.md
You can use this handy template:
```markdown
# AMO Release Thursday 13th September 2018
This week's push hero is @GithubUsername
## Notable things shipping:
## Blockers:
## Cherry-picks:
<!-- Link to the actual commits, NOT merge commits. The commits need to appear in chronological order so that 'git cherry-pick' will apply them correctly. -->
## Pushing:
- https://github.com/mozilla/addons-server/compare/YYYY.MM.DD...YYYY.MM.DD
- https://github.com/mozilla/addons-frontend/compare/YYYY.MM.DD...YYYY.MM.DD
- https://github.com/mozilla/addons-code-manager/compare/YYYY.MM.DD...YYYY.MM.DD
## Before we push:
## Before we start:
## Before we promote:
## After we're done:
```
Set the topic of the AMO Matrix channel and #remora slack channel to include the new github doc link and the relevant nickname of next week’s push hero.
### 4.1.3 Future Goals
Move to continuous deployment and change the way this is done dramatically.
UX for the server and client.
Contents:
5.1 Add-ons Discovery Pane UX Specs
So I can find useful and trusted add-ons, as a new add-ons user, I want to browse from a small list of curated content.
5.1.1 changelog
July 12 - Added a slight drop shadow behind the extension/theme blocks.
May 25 - Changed app icon background to #ffffff. - Added new screen for 2nd or 3rd visit user prompts (still a wip)
5.1.2 Intro Video
Personalize Your Firefox
There are thousands of add-ons that let you to make Firefox all your own—everything from fun visual themes to powerful tools and features. Here are a few great ones to check out.
- Japanese Tattoo by MaDonna
Hover over the image to preview
- Block ads with Adblock Plus
“This add-on is amazing. Blocks all annoying ads. 5 stars.” - rany
- Take screenshots with Awesome Screenshot Plus
- When a user clicks “Click to play”, the copy to the left of the video thumbnail will fade away and the thumbnail will expand down and to the left.
• When a user clicks “close video” below the expanded video, the video will shrink up and to the right back to its original position. The copy to the left will fade back in.
5.1.3 Switch Interaction
- When a user turns on the switch, the install process begins: the switch shows download and install progress. When complete, a check mark appears in the switch.
- When a user turns off the switch, the uninstall process begins: the switch shows uninstall progress. When complete, the switch returns to original off state.
5.1.4 Theme Interaction
- When hovering over the theme image, the toolbar will change to show a preview.
5.1.5 AMO Link
- A button at the bottom of the discovery pane encourages users to visit AMO if they want to explore add-ons and themes further.
5.2 AMO to Firefox Account Migration UX Specs
So that I can reduce the numbers of logins I have, as a Mozilla Add-ons user, I want to switch from using my AMO login and start using a Firefox Account.
5.2.1 User Flow Diagram
Red line denotes common post-migration login experience.
5.2.2 Migrating from AMO
- When a currently authenticated AMO user returns to AMO, they will see a notice prompting them to upgrade their account.
- When a currently authenticated AMO user chooses the call to action in the notice, they are taken to the AMO login to confirm their identity.
- When an existing AMO user enters their email address, they are taken to the AMO login.
- When they log in successfully, they are shown a notice prompting them to upgrade their account.
- When they click Continue and do not have a Firefox Account, they taken to FxA registration that is pre-populated with their email.
- When they click Continue and do have a Firefox Account, they taken to FxA login that is pre-populated with their email.
- When they click Skip, they taken to AMO which contains an upgrade notice.
- When they attempt to use an email that is unverified with FxA, they are taken to the confirm your account screen.
- When they change their email to one that already exists in FxA or AMO, they see the message This account already exists on Mozilla Add-ons.
- When they are successful at migrating, they see the notice Great job! You can now log in to AMO using your FxA.
5.2.3 Registering
- When an unauthenticated user chooses to register, they will see a **Join Mozilla Add-ons** form that asks for their email, with secondary option to switch to **Sign in**.
- When a new user enters their email address, they are taken to the FxA registration.
- When an FxA user enters their email address, they are taken to the FxA login.
- When they change their email to one that already exists in FxA or AMO, they see the message **This account already exists on Mozilla Add-ons**.
- When a registering user successfully verifies their Firefox Account, they are taken to an incomplete AMO settings view that requires profile completion.
- When a registering user completes their AMO profile, the old AMO account can be retired from service.
5.2.4 Logging In
- When any unauthenticated user chooses to log in, they will see a **Sign in to Mozilla Add-ons** form that asks for their email, with secondary option to switch to **Create an account**.
5.2.5 Post-Migration
- When an already-migrated user returns to AMO, they will no longer see a notice prompting them to upgrade their account.
- When an already-migrated user chooses to log in, they will see a **Sign in to Mozilla Add-ons** form that asks for their email, with secondary option to switch to **Create an account**.
- When an already-migrated users clicks **Continue**, they taken to FxA login that is pre-populated with their email.
- When an already-migrated user logs in, they are taken to AMO.
5.3 Management UX
5.3.1 Flow
5.3.2 Wireframes
5.4 Submission UX
5.4.1 Flow
Source: Changes in add-on and file/version status
5.4.2 Wireframes
Just some random stuff.
Contents:
6.1 Github labels
Any repositories related to add-ons can have any labels of any format that it wants. But here’s a core list of labels and colours that we’d like to have a bit of consistency. Some key labels:
- blocks release
- blocked by upstream
- good first bug
- maybe good first bug
- not ready for merge
- pull request ready
- priority one
- priority two
- triaged
Colour wise:
- red (#b60205), pay attention to these, eg: “priority one”
- green (#0e8a16), projects that we might work on, eg: “Firefox Accounts” or “signing”
- light blue (#7def8), often left over from Bugzilla, usually and end statement eg: “invalid”, “won’t fix”, “enhancement”
- purple (#5319e7), needs... eg: “needs ux”
- yellow (#fbca04), intermediary state eg: “maybe good first bug” or “in progress”
- blue (#0052cc), a project area at the technical level, eg: “code quality”
Other comments:
- no need to add in - or _ between words, eg “pull-request-ready” vs “pull request ready”
- you can be verbose, eg: “needs more qa” vs “qa+”
Note: We maintain a JSON file with a list of common GitHub labels. If you want to add those labels to a repository, you can use the following command (a personal access token with “write” permission should be generated).
```
$ npx github-labels -t <token> -c ./default-github-labels.json
$ # You can pass `'-f'` to remove all existing labels before creating the new ones
```
Filing bugs:
- Github on this repository.
- Bugzilla
CHAPTER
SEVEN
INDICES AND TABLES
- genindex
- modindex
- search
|
{"Source-Url": "https://addons.readthedocs.io/_/downloads/en/latest/pdf/", "len_cl100k_base": 5083, "olmocr-version": "0.1.50", "pdf-total-pages": 33, "total-fallback-pages": 0, "total-input-tokens": 48236, "total-output-tokens": 6540, "length": "2e12", "weborganizer": {"__label__adult": 0.0003352165222167969, "__label__art_design": 0.00041365623474121094, "__label__crime_law": 0.00016391277313232422, "__label__education_jobs": 0.0005598068237304688, "__label__entertainment": 8.702278137207031e-05, "__label__fashion_beauty": 0.00012242794036865234, "__label__finance_business": 0.00020706653594970703, "__label__food_dining": 0.00017905235290527344, "__label__games": 0.0006699562072753906, "__label__hardware": 0.0005173683166503906, "__label__health": 0.00011265277862548828, "__label__history": 0.00013685226440429688, "__label__home_hobbies": 0.00010854005813598631, "__label__industrial": 0.00012218952178955078, "__label__literature": 0.00017321109771728516, "__label__politics": 9.804964065551758e-05, "__label__religion": 0.0002111196517944336, "__label__science_tech": 0.0005521774291992188, "__label__social_life": 0.0001380443572998047, "__label__software": 0.024017333984375, "__label__software_dev": 0.970703125, "__label__sports_fitness": 0.00018656253814697263, "__label__transportation": 0.00015211105346679688, "__label__travel": 0.00014138221740722656}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 21759, 0.04021]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 21759, 0.13992]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 21759, 0.84852]], "google_gemma-3-12b-it_contains_pii": [[0, 0, null], [0, 0, null], [0, 997, false], [997, 997, null], [997, 1260, null], [1260, 1260, null], [1260, 2485, null], [2485, 3528, null], [3528, 3583, null], [3583, 3583, null], [3583, 4809, null], [4809, 6051, null], [6051, 7001, null], [7001, 7001, null], [7001, 8082, null], [8082, 10007, null], [10007, 12300, null], [12300, 14255, null], [14255, 15342, null], [15342, 15342, null], [15342, 15748, null], [15748, 16335, null], [16335, 16509, null], [16509, 16857, null], [16857, 17311, null], [17311, 18575, null], [18575, 20060, null], [20060, 20108, null], [20108, 20207, null], [20207, 20207, null], [20207, 21263, null], [21263, 21694, null], [21694, 21759, null]], "google_gemma-3-12b-it_is_public_document": [[0, 0, null], [0, 0, null], [0, 997, true], [997, 997, null], [997, 1260, null], [1260, 1260, null], [1260, 2485, null], [2485, 3528, null], [3528, 3583, null], [3583, 3583, null], [3583, 4809, null], [4809, 6051, null], [6051, 7001, null], [7001, 7001, null], [7001, 8082, null], [8082, 10007, null], [10007, 12300, null], [12300, 14255, null], [14255, 15342, null], [15342, 15342, null], [15342, 15748, null], [15748, 16335, null], [16335, 16509, null], [16509, 16857, null], [16857, 17311, null], [17311, 18575, null], [18575, 20060, null], [20060, 20108, null], [20108, 20207, null], [20207, 20207, null], [20207, 21263, null], [21263, 21694, null], [21694, 21759, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, false], [5000, 21759, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 21759, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 21759, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 21759, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 21759, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 21759, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 21759, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 21759, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 21759, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 21759, null]], "pdf_page_numbers": [[0, 0, 1], [0, 0, 2], [0, 997, 3], [997, 997, 4], [997, 1260, 5], [1260, 1260, 6], [1260, 2485, 7], [2485, 3528, 8], [3528, 3583, 9], [3583, 3583, 10], [3583, 4809, 11], [4809, 6051, 12], [6051, 7001, 13], [7001, 7001, 14], [7001, 8082, 15], [8082, 10007, 16], [10007, 12300, 17], [12300, 14255, 18], [14255, 15342, 19], [15342, 15342, 20], [15342, 15748, 21], [15748, 16335, 22], [16335, 16509, 23], [16509, 16857, 24], [16857, 17311, 25], [17311, 18575, 26], [18575, 20060, 27], [20060, 20108, 28], [20108, 20207, 29], [20207, 20207, 30], [20207, 21263, 31], [21263, 21694, 32], [21694, 21759, 33]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 21759, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-03
|
2024-12-03
|
399936d8db647b058300a74a9f7008dc58e6d958
|
Thread is a secure, reliable, scalable, and upgradeable wireless IPv6 mesh networking protocol. It provides low-cost bridging to other IP networks while optimized for low-power / battery-backed operation. The Thread stack is designed specifically for Connected Home applications where IP-based networking is desired, and a variety of application layers may be required.
OpenThread released by Google is an open-source implementation of Thread. Google has released OpenThread to accelerate the development of products for the connected home and commercial buildings. With a narrow platform abstraction layer and a small memory footprint, OpenThread is highly portable. It supports system-on-chip (SoC), network co-processor (NCP), and radio co-processor (RCP) designs.
Silicon Labs has developed an OpenThread-based SDK tailored to work with Silicon Labs hardware. The Silicon Labs OpenThread SDK is a fully tested enhanced version of the GitHub source. It supports a broader range of hardware than does the GitHub version, and includes documentation and example applications not available on GitHub.
These release notes cover SDK version(s):
2.5.0.0 GA released on June 5, 2024
---
**Compatibility and Use Notices**
For information about security updates and notices, see the Security chapter of the Platform Release Notes installed with this SDK or on the TECH DOCS tab on [https://www.silabs.com/developers/thread](https://www.silabs.com/developers/thread). Silicon Labs also strongly recommends that you subscribe to Security Advisories for up-to-date information. For instructions, or if you are new to the Silicon Labs OpenThread SDK, see Using This Release.
**Compatible Compilers:**
GCC (The GNU Compiler Collection) version 12.2.1, provided with Simplicity Studio.
1 New Items
Simplicity SDK is an embedded software development platform for building IoT products based on our Series 2 and Series 3 wireless and MCU devices. It integrates wireless protocol stacks, middleware, peripheral drivers, a bootloader, and application examples – a solid framework for building power-optimized and secure IoT devices.
The Simplicity SDK offers powerful features such as ultra-low power consumption, strong network reliability, support for a large number of nodes, and abstraction of complex requirements like multiprotocol and pre-certification. Additionally, Silicon Labs provides over-the-air (OTA) software and security updates to remotely update devices, minimize maintenance costs, and enhance the end-user product experience.
Simplicity SDK is a follow-on from our popular Gecko SDK, which will continue to be available providing long-term support for our Series 0 and Series 1 devices. For additional information on the Series 0 and Series 1 devices please reference: Series 0 and Series 1 EFM32/EZR32/EFR32 device (silabs.com).
1.1 New Components
Added in release 2.5.0.0
- **ot_core_vendor_extension** - This component implements the `ot::Extension::ExtensionBase` interface for EFR32. When used with the OT Crash Handler component, crash info will be printed after the OpenThread instance is initialized.
1.2 New Features
Added in release 2.5.0.0
- The versions of OpenThread and the OpenThread Border Router have been updated. See sections 8.2 and 8.3.
- Libraries and sample applications in this SDK default to Thread 1.3. Thread 1.4 version and features, including credential sharing and ephemeral key support, are supported but are not ready for certification and still have ongoing development.
- Optimization to the OpenThread API to allow for thread-safe access to the OpenThread stack in a multi-threaded RTOS environment.
- A new platform component, Clock Manager, is integrated to all the openthread sample applications for clock configuration.
- A new platform component, Memory Manager, is integrated to all the openthread sample applications for dynamic memory management.
- OTBR on OpenWRT. A new multiprotocol openthread-br ipk package has been added for use in the OpenWRT host environment.
- Support for OpenThread Coex metrics
1.3 New APIs
Added in release 2.5.0.0
- Support for OpenThread diag channel and transmit power API and CLI commands: `otPlatDiagTxPowerSet()` and `otPlatDiagChannelSet()`.
1.4 New Radio Board Support
Added in release 2.5.0.0
Support has been added for the following radio boards:
- **BRD4116A** - EFR32MG26B410F3200IM48-A
2 Improvements
**Changed in release 2.5.0.0**
- The `ot_rcp_gp_interface` component has been renamed to `ot_gp_interface`.
- The openthread API includes all changes up to and including the updates described here: [https://openthread.io/reference/api-updates#may_17_2024](https://openthread.io/reference/api-updates#may_17_2024).
- The set of prebuilt demo sample applications has been updated as follows:
- `ot-ble-dmp` – (brd2703a, brd4116a, brd4180a, brd4186c)
- `ot-ble-dmp-no-buttons` – (brd2703a, brd4116a, brd4180a, brd4186c)
- `ot-cli-ftd` – (brd2703a, brd4116a, brd4180a, brd4186c)
- `ot-cli-mtd` – (brd2703a, brd4116a, brd4180a, brd4186c)
- `ot-rcp` – (brd2703a, brd4116a, brd4180a, brd4180b, brd4186c)
- `rcp-spi-802154` – (brd4116a, brd4180a, brd4180b, brd4186c)
- `rcp-spi-802154-blehci` – (brd4116a, brd4180a, brd4180b, brd4186c)
- `rcp-uartl-802154` – (brd2703a, brd4116a, brd4180a, brd4180b, brd4186c)
- `rcp-uart-802154-blehci` – (brd2703a, brd4116a, brd4180a, brd4180b, brd4186c)
- `sleepy-demo-ftd` – (brd2703a, brd4116a, brd4180a, brd4186c)
- `sleepy-demo-mtd` – (brd2703a, brd4116a, brd4180a, brd4186c)
- `sleepy-demo-ssed` – (brd2703a, brd4116a, brd4180a, brd4186c)
- Increased `OPENTHREAD_CONFIG_CSL_RECEIVE_TIME_AHEAD` to 750 us. for default FTD and MTD certification libraries for use with devices under test using library-based certification.
- For older project files (.slcps) the default config value of `CIRCULAR_QUEUE_LEN_MAX` must be greater than or equal to `SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT` (i.e. 16). Otherwise, the validation script will fail the project generation. This can be done by adding the config value entry in the .slcp directly or from Simplicity Studio: go to the ‘Circular Queue’ component, then go to configuration, and set the max length as per `SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT`.
- For multipan RCP applications, replace existing app.c with `<GSDK_DIR>/protocol/openthread/sample-apps/ot-ncp/app.c` in existing project or port changes from `<GSDK_DIR>/protocol/openthread/sample-apps/ot-ncp/app.c` to custom app.c if you have one.
# Fixed Issues
## Fixed in release 2.5.0.0
<table>
<thead>
<tr>
<th>ID #</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>1208578</td>
<td>Added support for linking the CPC library to Posix host apps by using provided paths, and by using pkg-config.</td>
</tr>
<tr>
<td>1235923</td>
<td>Fixed a wrapping bug in calls to otPlatAlarmMillStartAt and otPlatAlarmMicroStartAt.</td>
</tr>
<tr>
<td>1238120</td>
<td>In a multiprotocol RCP environment, certain incoming packets were wrongly interpreted as Zigbee Green Power packets, triggering a random outgoing packet. The issue is fixed by strengthening the Zigbee Green Power packet detection on the RCP.</td>
</tr>
<tr>
<td>1243597</td>
<td>Removed extra ot-ble-dmp-no-buttons sample apps from demos folder.</td>
</tr>
<tr>
<td>1249346</td>
<td>Addressed an issue where the RCP could incorrectly dequeue packets destined for the host, resulting in a parse error in the OTBR and unexpected termination.</td>
</tr>
<tr>
<td>1249492</td>
<td>The dBus FactoryReset command no longer causes the openthread border router to terminate.</td>
</tr>
<tr>
<td>1251926</td>
<td>When using the crash handler feature in a Host / RCP environment, the RCP was attempting to send the crash info to the Host too early after reboot, causing the info to be dropped prior to logging. The issue is addressed by introducing a new spinel property to the upstream openthread stack. The property allows the Host to request crash logs from the RCP once the Host is ready for them. See <a href="https://github.com/openthread/openthread/pull/10061">https://github.com/openthread/openthread/pull/10061</a> for more information on the new spinel property.</td>
</tr>
<tr>
<td>1251952</td>
<td>Fixed undefined reference to otInstanceResetToBootloader when building with ot_cert_libs and bootloader_interface.</td>
</tr>
<tr>
<td>1255595</td>
<td>Fix a type promotion issue when handling large values in otPlatAlarm APIs</td>
</tr>
<tr>
<td>1263222</td>
<td>Fixed coex metric "Average Request To Grant Time".</td>
</tr>
<tr>
<td>1277790</td>
<td>Fixed coex metric "Grant Immediate".</td>
</tr>
<tr>
<td>1287331</td>
<td>The ot-ble-dmp sample application is now only supported on parts with at least 768k of flash.</td>
</tr>
</tbody>
</table>
## Known Issues in the Current Release
Issues in bold were added since the previous release. If you have missed a release, recent release notes are available on [https://www.silabs.com/developers/thread](https://www.silabs.com/developers/thread) in the Tech Docs tab.
<table>
<thead>
<tr>
<th>ID #</th>
<th>Description</th>
<th>Workaround</th>
</tr>
</thead>
<tbody>
<tr>
<td>482915 495241 1295252</td>
<td>A known limitation with the UART driver can cause characters to be lost on CLI input or output. This can happen during particularly long critical sections that may disable interrupts, so it can be alleviated by repeating the CLI or waiting long enough for state changes.</td>
<td>No known workaround</td>
</tr>
<tr>
<td>815275</td>
<td>Ability to modify the Radio CCA Modes at compile-time using a configuration option in Simplicity Studio is currently not supported.</td>
<td>Use the SL_OPENTHREAD_RADIO_CCA_MODE configuration option defined in openthread-core-efr32-config.h header file included with your project.</td>
</tr>
<tr>
<td>1163281 1196499</td>
<td>The OTBR DUTs that need to pass Thread Certification Test "5.10.2 MATN-TC-02: Multicast listener registration and first use" need to enable the 'REFERENCE DEVICE' flag during OTBR bootstrap and setup. This issue will be addressed in a later release with a newer OpenThread stack that fixes this issue.</td>
<td>Compile with REFERENCE_DEVICE.</td>
</tr>
<tr>
<td>1286531 1295725</td>
<td>CSL/SSED instability.</td>
<td>Adjust settings of CSL related configuration macros.</td>
</tr>
<tr>
<td>1289835</td>
<td>The openthread border router when running within a docker container and under duress may drop more packets than expected.</td>
<td>Build and run host applications natively.</td>
</tr>
<tr>
<td>1295848</td>
<td>Communication between the host and the RCP when connected using SPI can become unstable when 15 devices are simultaneously pinging the OTBR.</td>
<td>No known workaround</td>
</tr>
</tbody>
</table>
5 Deprecated Items
**Deprecated in release 2.5.0.0**
None.
6 Removed Items
**Removed in release 2.5.0.0**
- Support for Series 0 and Series 1 parts
- Support for Proprietary Sub-GHz Support
7 Multiprotocol Gateway and RCP
7.1 New Items
Added in release 2.5.0.0
OpenWRT alpha support has been added for zigbeed, OTBR and Z3Gateway applications. Zigbeed and OTBR are now provided in IPK package format as well. See AN1333: Running Zigbee, OpenThread, and Bluetooth Concurrently on a Linux Host with a Multiprotocol Co-Processor for details.
Changed in release 2.5.0.0
None.
7.2 Fixed Issues
Fixed in release 2.5.0.0
<table>
<thead>
<tr>
<th>ID #</th>
<th>Description</th>
<th>Workaround</th>
</tr>
</thead>
<tbody>
<tr>
<td>1231021</td>
<td>Avoid an OTBR assert by recovering the RCP rather than passing unhandled transmit errors to the sub mac.</td>
<td></td>
</tr>
<tr>
<td>1242948</td>
<td>Removed spurious test asserts from zigbeed.</td>
<td></td>
</tr>
<tr>
<td>1244459</td>
<td>Fixed issue where MAC-retried Indirect transmissions via RCP can result in a source match table entry for child being removed despite messages pending.</td>
<td></td>
</tr>
<tr>
<td>1245988</td>
<td>Fixed an issue where Zigbee did not restart when performing a Trust Center Backup and Restore Reset Node action.</td>
<td></td>
</tr>
<tr>
<td>1282264</td>
<td>Fixed issue that could have interrupted radio transmit operations by clearing the transmit fifo prematurely, causing underflow.</td>
<td></td>
</tr>
<tr>
<td>1288653</td>
<td>Zigbee/OT/BLE SOC app will now print connection info upon receiving the CLI command "plugin ble gap print-connections".</td>
<td></td>
</tr>
<tr>
<td>1292537</td>
<td>Zigbee/BLE NCP application is now properly showing up in Simplicity Studio UI.</td>
<td></td>
</tr>
<tr>
<td>1252365</td>
<td>Added Coexistence plugin back into Zigbee NCP/OpenThread RCP sample application.</td>
<td></td>
</tr>
<tr>
<td>1293853</td>
<td>Reduced RAM footprint for zigbee_ncp-ot_rcp-spi and zigbee_ncp-ot_rcp_uart on MG21.</td>
<td></td>
</tr>
<tr>
<td>1124140</td>
<td>Fixed an issue where setting SL_OPENTHREAD_RADIO_RX_BUFFER_COUNT to a value other than 1 caused z3-light_ot-ftd_soc to not send Zigbee beacons after the OpenThread network is up.</td>
<td></td>
</tr>
</tbody>
</table>
7.3 Known Issues in the Current Release
Issues in bold were added since the previous release. If you have missed a release, recent release notes are available on https://www.silabs.com/developers/simplicity-software-development-kit.
<table>
<thead>
<tr>
<th>ID #</th>
<th>Description</th>
<th>Workaround</th>
</tr>
</thead>
<tbody>
<tr>
<td>1074205</td>
<td>The CMP RCP does not support two networks on the same PAN id.</td>
<td>Use different PAN ids for each network. Support is planned in a future release.</td>
</tr>
<tr>
<td>1122723</td>
<td>In a busy environment, the CLI may become unresponsive in the z3-light_ot-ftd_soc app.</td>
<td>No known workaround.</td>
</tr>
<tr>
<td>1209958</td>
<td>The ZB/OT/BLE RCP on MG24 and MG21 can stop working after a few minutes when running all three protocols.</td>
<td>Will be addressed in a future release.</td>
</tr>
<tr>
<td>1221299</td>
<td>Mfglib RSSI readings differ between RCP and NCP.</td>
<td>Will be addressed in a future release.</td>
</tr>
</tbody>
</table>
7.4 Deprecated Items
None.
7.5 Removed Items
Removed in release 2.5.0.0
None.
8 Using This Release
This release contains the following:
- Silicon Labs OpenThread stack
- Silicon Labs OpenThread sample applications
- Silicon Labs OpenThread border router
For more information about the OpenThread SDK see QSG170: Silicon Labs OpenThread QuickStart Guide. If you are new to Thread see UG103.11: Thread Fundamentals.
8.1 Installation and Use
The OpenThread SDK is part of the Simplicity SDK, the suite of Silicon Labs SDKs. To quickly get started with OpenThread and the Simplicity SDK, start by installing Simplicity Studio 5, which will set up your development environment and walk you through Simplicity SDK installation. Simplicity Studio 5 includes everything needed for IoT product development with Silicon Labs devices, including a resource and project launcher, software configuration tools, full IDE with GNU toolchain, and analysis tools. Installation instructions are provided in the online Simplicity Studio 5 User's Guide.
Alternatively, Simplicity SDK may be installed manually by downloading or cloning the latest from GitHub. See https://github.com/SiliconLabs/simplicity_sdk for more information.
The GSDK default installation location has changed beginning with Simplicity Studio 5.3.
- Windows: C:\Users\<NAME>\SimplicityStudio\SDKs\simplicity_sdk
- MacOS: /Users/<NAME>/SimplicityStudio/SDKs/simplicity_sdk
Documentation specific to the SDK version is installed with the SDK. API references and other information about this release are available on https://docs.silabs.com/openthread/latest/. Select your SDK version in the upper right.
8.2 OpenThread GitHub Repository
The Silicon Labs OpenThread SDK includes all changes from the OpenThread GitHub repo (https://github.com/openthread/openthread) up to and including commit 1fceb225b. An enhanced version of the OpenThread repo can be found in the following Simplicity Studio 5 GSDK location:
<GSDK Installation Location>\util\third_party\openthread
8.3 OpenThread Border Router GitHub Repository
The Silicon Labs OpenThread SDK includes all changes from the OpenThread border router GitHub repo (https://github.com/openthread/ot-br-posix) up to and including commit e56c02006. An enhanced version of the OpenThread border router repo can be found in the following Simplicity Studio 5 GSDK location:
<GSDK Installation Location>\util\third_party\ot-br-posix
8.4 Using the Border Router
For ease of use, Silicon Labs recommends the use of a Docker container for your OpenThread border router. Refer to AN1256: Using the Silicon Labs RCP with the OpenThread Border Router for details on how to set up the correct version of OpenThread border router Docker container. It is available at https://hub.docker.com/r/siliconlabsinc/openthread-border-router.
If you are manually installing a border router, using the copies provided with the Silicon Labs OpenThread SDK, refer to AN1256: Using the Silicon Labs RCP with the OpenThread Border Router for more details.
Although updating the border router environment to a later GitHub version is supported on the OpenThread website, it may make the border router incompatible with the OpenThread RCP stack in the SDK.
8.5 NCP/RCP Support
The OpenThread NCP support is included with OpenThread SDK but any use of this support should be considered experimental. The OpenThread RCP is fully implemented and supported.
8.6 Security Information
Secure Vault Integration
When deployed to Secure Vault High devices, sensitive keys are protected using the Secure Vault Key Management functionality. The following table shows the protected keys and their storage protection characteristics.
<table>
<thead>
<tr>
<th>Wrapped Key</th>
<th>Exportable / Non-Exportable</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<tr>
<td>Thread Master Key</td>
<td>Exportable</td>
<td>Must be exportable to form the TLVs</td>
</tr>
<tr>
<td>PSKc</td>
<td>Exportable</td>
<td>Must be exportable to form the TLVs</td>
</tr>
<tr>
<td>Key Encryption Key</td>
<td>Exportable</td>
<td>Must be exportable to form the TLVs</td>
</tr>
<tr>
<td>MLE Key</td>
<td>Non-Exportable</td>
<td></td>
</tr>
<tr>
<td>Temporary MLE Key</td>
<td>Non-Exportable</td>
<td></td>
</tr>
<tr>
<td>MAC Previous Key</td>
<td>Non-Exportable</td>
<td></td>
</tr>
<tr>
<td>MAC Current Key</td>
<td>Non-Exportable</td>
<td></td>
</tr>
<tr>
<td>MAC Next Key</td>
<td>Non-Exportable</td>
<td></td>
</tr>
</tbody>
</table>
Wrapped keys that are marked as “Non-Exportable” can be used but cannot be viewed or shared at runtime.
Wrapped keys that are marked as “Exportable” can be used or shared at runtime but remain encrypted while stored in flash.
For more information on Secure Vault Key Management functionality, see AN1271: Secure Key Storage.
Security Advisories
To subscribe to Security Advisories, log in to the Silicon Labs customer portal, then select Account Home. Click HOME to go to the portal home page and then click the Manage Notifications tile. Make sure that ‘Software/Security Advisory Notices & Product Change Notices (PCNs)’ is checked, and that you are subscribed at minimum for your platform and protocol. Click Save to save any changes.
8.7 Support
Development Kit customers are eligible for training and technical support. Use the Silicon Laboratories Thread web page to obtain information about all Silicon Labs OpenThread products and services, and to sign up for product support.
You can contact Silicon Laboratories support at http://www.silabs.com/support.
8.8 Thread Certification
This release has been qualified for Thread 1.3.0 for both the SoC and Host-RCP architectures with Thread Test Harness v59.0 (Member Release). For Thread Product certifications tied to this major release and associated patch releases (with no OpenThread stack updates), Silicon Labs recommends using the above TH version for qualification. Also included with this release is a set of OpenThread stack and PAL libraries that may be used for Thread certification by inheritance.
Simplicity Studio
One-click access to MCU and wireless tools, documentation, software, source code libraries & more. Available for Windows, Mac and Linux!
IoT Portfolio
www.silabs.com/IoT
SW/HW
www.silabs.com/simplicity
Quality
www.silabs.com/quality
Support & Community
www.silabs.com/community
Disclaimer
Silicon Labs intends to provide customers with the latest, accurate, and in-depth documentation of all peripherals and modules available for system and software implementers using or intending to use the Silicon Labs products. Characterization data, available modules and peripherals, memory sizes and memory addresses refer to each specific device, and “Typical” parameters provided can and do vary in different applications. Application examples described herein are for illustrative purposes only. Silicon Labs reserves the right to make changes without further notice to the product information, specifications, and descriptions herein, and does not give warranties as to the accuracy or completeness of the included information. Without prior notification, Silicon Labs may update product firmware during the manufacturing process for security or reliability reasons. Such changes will not alter the specifications or the performance of the product. Silicon Labs shall have no liability for the consequences of use of the information supplied in this document. This document does not imply or expressly grant any license to design or fabricate any integrated circuits. The products are not designed or authorized to be used within any FDA Class III devices, applications for which FDA premarket approval is required or Life Support Systems without the specific written consent of Silicon Labs. A “Life Support System” is any product or system intended to support or sustain life and/or health, which, if it fails, can be reasonably expected to result in significant personal injury or death. Silicon Labs products are not designed or authorized for military applications. Silicon Labs products shall under no circumstances be used in weapons of mass destruction including (but not limited to) nuclear, biological or chemical weapons, or missiles capable of delivering such weapons. Silicon Labs disclaims all express and implied warranties and shall not be responsible or liable for any injuries or damages related to use of a Silicon Labs product in such unauthorized applications.
Note: This content may contain offensive terminology that is now obsolete. Silicon Labs is replacing these terms with inclusive language wherever possible. For more information, visit www.silabs.com/about-us/inclusive-lexicon-project
Trademark Information
Silicon Laboratories Inc.®, Silicon Laboratories®, Silicon Labs®, SiLabs® and the Silicon Labs logo®, Bluegiga®, Bluegiga Logo®, EFM®, EFM32®, EFR, Ember®, Energy Micro, Energy Micro logo and combinations thereof, “the world’s most energy friendly microcontrollers”, Redpine Signals®, WiSeConnect®, n-Link®, EZLink®, EZRadio®, EZRadioPRO®, Gecko®, Gecko OS, Gecko OS Studio, Precision32®, Simplicity Studio®, Telegesis, the Telegesis Logo®, USBXpress®, Zentri, the Zentri logo and Zentri DMS, Z-Wave®, and others are trademarks or registered trademarks of Silicon Labs. ARM, CORTEX, Cortex-M3 and THUMB are trademarks or registered trademarks of ARM Holdings. Keil is a registered trademark of ARM Limited. Wi-Fi is a registered trademark of the Wi-Fi Alliance. All other products or brand names mentioned herein are trademarks of their respective holders.
|
{"Source-Url": "https://www.silabs.com/documents/public/release-notes/open-thread-release-notes-2.5.0.0.pdf", "len_cl100k_base": 5922, "olmocr-version": "0.1.50", "pdf-total-pages": 14, "total-fallback-pages": 0, "total-input-tokens": 26852, "total-output-tokens": 6388, "length": "2e12", "weborganizer": {"__label__adult": 0.0008668899536132812, "__label__art_design": 0.0005211830139160156, "__label__crime_law": 0.0006508827209472656, "__label__education_jobs": 0.00029277801513671875, "__label__entertainment": 0.00014960765838623047, "__label__fashion_beauty": 0.0004706382751464844, "__label__finance_business": 0.0005865097045898438, "__label__food_dining": 0.0005431175231933594, "__label__games": 0.0013837814331054688, "__label__hardware": 0.13037109375, "__label__health": 0.0007076263427734375, "__label__history": 0.0003349781036376953, "__label__home_hobbies": 0.00031304359436035156, "__label__industrial": 0.0023956298828125, "__label__literature": 0.0002114772796630859, "__label__politics": 0.0003046989440917969, "__label__religion": 0.0007596015930175781, "__label__science_tech": 0.05328369140625, "__label__social_life": 7.30752944946289e-05, "__label__software": 0.020782470703125, "__label__software_dev": 0.78271484375, "__label__sports_fitness": 0.0006766319274902344, "__label__transportation": 0.0012903213500976562, "__label__travel": 0.0003008842468261719}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 27186, 0.05354]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 27186, 0.03157]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 27186, 0.85033]], "google_gemma-3-12b-it_contains_pii": [[0, 1782, false], [1782, 1782, null], [1782, 4400, null], [4400, 6514, null], [6514, 9959, null], [9959, 13047, null], [13047, 13108, null], [13108, 13241, null], [13241, 17500, null], [17500, 17581, null], [17581, 20747, null], [20747, 22840, null], [22840, 23671, null], [23671, 27186, null]], "google_gemma-3-12b-it_is_public_document": [[0, 1782, true], [1782, 1782, null], [1782, 4400, null], [4400, 6514, null], [6514, 9959, null], [9959, 13047, null], [13047, 13108, null], [13108, 13241, null], [13241, 17500, null], [17500, 17581, null], [17581, 20747, null], [20747, 22840, null], [22840, 23671, null], [23671, 27186, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, false], [5000, 27186, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 27186, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 27186, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 27186, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 27186, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 27186, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 27186, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 27186, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 27186, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 27186, null]], "pdf_page_numbers": [[0, 1782, 1], [1782, 1782, 2], [1782, 4400, 3], [4400, 6514, 4], [6514, 9959, 5], [9959, 13047, 6], [13047, 13108, 7], [13108, 13241, 8], [13241, 17500, 9], [17500, 17581, 10], [17581, 20747, 11], [20747, 22840, 12], [22840, 23671, 13], [23671, 27186, 14]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 27186, 0.27869]]}
|
olmocr_science_pdfs
|
2024-11-30
|
2024-11-30
|
0f8dac59877d13c0a0f702e091e12a0f1092b791
|
PAIRSE: A Privacy-Preserving Service-Oriented Data Integration System
Djamal Benslimane, Mahmoud Barhamgi, Frédéric Cuppens, Franck Morvan, Bruno Defude, Ebrahim Nageba
To cite this version:
Djamal Benslimane, Mahmoud Barhamgi, Frédéric Cuppens, Franck Morvan, Bruno Defude, et al.. PAIRSE: A Privacy-Preserving Service-Oriented Data Integration System. SIGMOD record, ACM, 2013, vol. 42 (n° 3), pp. 42-47. <10.1145/2536669.2536677>. <hal-01124429>
HAL Id: hal-01124429
https://hal.archives-ouvertes.fr/hal-01124429
Submitted on 6 Mar 2015
HAL is a multi-disciplinary open access archive for the deposit and dissemination of scientific research documents, whether they are published or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.
L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.
Open Archive TOULOUSE Archive Ouverte (OATAO)
OATAO is an open access repository that collects the work of Toulouse researchers and makes it freely available over the web where possible.
This is an author-deposited version published in: http://oatao.univ-toulouse.fr/
Eprints ID: 12918
To link to this article: DOI :10.1145/2536669.2536677
URL : http://dx.doi.org/10.1145/2536669.2536677
To cite this version: Benslimane, Djamal and Barhamgi, Mahmoud and Cuppens, Frédéric and Morvan, Franck and Defude, Bruno and Nageba, Ebrahim PAIRSE: A Privacy-Preserving Service-Oriented Data Integration System, (2013) SIGMOD Record, vol. 42 (n° 3). pp. 42-47. ISSN 0163-5808
Any correspondance concerning this service should be sent to the repository administrator: staff-oatao@listes-diff.inp-toulouse.fr
PAIRSE: A Privacy-Preserving Service-Oriented Data Integration System
Djamal Benslimane
LIRIS, Lyon 1 University
69622 Villeurbanne, France
djamal.benslimane@univ-lyon1.fr
Mahmoud Barhamgi
LIRIS, Lyon 1 University
69622 Villeurbanne, France
mahmoud.barhamgi@univ-lyon1.fr
Frederic Cuppens
TELECOM Bretagne
35576 Rennes, France
frederic.cuppens@telecom-bretagne.eu
Franck Morvan
IRIT, Paul Sabatier University
31062 Toulouse, France
franck.morvan@irit.fr
Bruno Defude
TELECOM SudParis
91011 Evry, France
bruno.defude@it-sudparis.eu
Ebrahim Nageba
Claude Bernard University
69622 Villeurbanne, France
ebrahim.nageba@univ-lyon1.fr
ABSTRACT
Privacy is among the key challenges to data integration in many sectors, including healthcare, e-government, etc. The PAIRSE project aims at providing a flexible, loosely-coupled and privacy-preserving data integration system in P2P environments. The project exploits recent Web standards and technologies such as Web services and ontologies to export data from autonomous data providers as reusable services, and proposes the use of service composition as a viable solution to answer data integration needs on the fly. The project proposed new composition algorithms and service/composition execution models that preserve privacy of data manipulated by services and compositions. The proposed integration system was demonstrated at EDBT 2013 and VLDB 2011.
1. INTRODUCTION
Data integration has been a long-standing challenge for the database community. This is motivated by the number of contexts in which the need for a flexible data integration mechanism has become critical, including Web and enterprise data integration, scientific data exploration, data exchange in government agencies, etc.
Much of the literature on data integration across autonomous data sources has tacitly assumed that data on the side of each data source can be revealed and shared with other sources. In practice, however, data integration scenarios are often hampered by legitimate and widespread data privacy concerns. In the healthcare application domain for example, medical data are subject to many legislations (e.g., [2, 1]) around the world that restrict collection, processing, and disclosure of personal data, and hold data holders accountable for any unintended data disclosure or misuse.
The PAIRSE project addresses the challenge of flexible and privacy-preserving data integration in peer-to-peer environments. Driven by the recent trends of using SOA-oriented architectures for data integration in modern enterprises, PAIRSE assumes that data sources are exposed to the data sharing environment as Web services. This type of services is commonly known as data services [11], where data services provide a well documented, platform (and source) independent, interoperable method of interacting with data. PAIRSE proposes a service composition-based approach for on-demand data integration; i.e., heterogeneous data services from autonomous service providers are selected and composed on the fly to answer users’ queries. Data privacy preservation is a key objective of PAIRSE. Users in PAIRSE are allowed only to access the information they are entitled to for a given purpose.
PAIRSE focuses on modeling, discovering, selecting and composing data services to efficiently answer users’ queries. The contributions of PAIRSE, which was demonstrated at EDBT 2013 [5] and VLDB 2011 [9], are summarized as follows:
• Semantic description model for data services: The semantics of data services should be explicitly represented to automate their discovery, selection and composition. We modeled data services as “RDF Views” over domain ontologies to formally define their semantics [7]. The service description files (e.g., WSDLs) are annotated with these RDF views.
• Query resolution by automatic service composition: Queries in PAIRSE are resolved by automatically selecting and composing data services. We exploited mature query rewriting techniques to devise a novel service composition algorithm [7, 9]. The algorithm relieves users from having to manually select and com-
pose services, tasks that would generally require important programming skills. We proposed also an efficient algorithm to locate relevant services in a P2P environment [14].
- Privacy preservation: We proposed a privacy preserving composition model [5, 8, 16]. Our model allows services providers to locally enforce their privacy and security policies when their services are invoked. In addition, it prevents services in a composition from learning any information about the data that each other holds, beyond what is permitted.
The rest of the paper is organized as follows. Section 2 gives an overview of our integration system. Section 3 describes our semantic modeling of data services. Section 4 presents our composition approach. Section 5 presents our techniques to privacy preservation. Section 6 applies our work in two application domains, and summarizes obtained results. Section 7 concludes the paper.
2. PAIRSE’S ARCHITECTURE
The PAIRSE data integration system has a hybrid peer-to-peer infrastructure [14], where peers form communities of interest, called Virtual Organizations VOs. Each VO has a common domain ontology modeling its expertise, and peer members that may have relations with members from other VOs. Relations between peers exist only if there is a mapping between the ontologies of their respective VOs. PAIRSE does not impose any constraint on the topology graph formed by the ontologies and the different mappings. Peers export their (shareable) data sources as data services.
PAIRSE follows a declarative approach to compose data services (Figure 1). Data services in each peer are modeled as RDF Views over domain ontologies to explicitly define their semantics. Users formulate their queries on domain ontologies using SPARQL query language. Then, our system exploits the defined RDF views (added as annotations to service description files) to select and compose the relevant services using an RDF query rewriting algorithm that we have devised for that purpose. Queries may necessitate the use of remote data services, in which case an efficient P2P service discovery algorithm [14] is used to locate and retrieve the descriptions of relevant services from remote peers. The system generates then an execution plan for the composition and executes it to provide the user with the requested data. As data services may manipulate privacy-sensitive information, PAIRSE proposed new service and composition execution models to preserve privacy.
3. SEMANTIC MODELING AND SERVICE QUERYING
In this section, we explain our service composition based approach to query resolution.
3.1 Semantic Modeling of Data Services
Modeling and explicitly specifying the semantics of data services are the first step towards the automation of service selection and composition.
In PAIRSE, we proposed in [7] to model data services as RDF Parameterized Views (RPVs) over domain ontologies. A parameterized RDF view uses concepts and relations whose meanings are formally defined in domain ontologies to define the semantic relationships between input and output parameters sets of a data service. A parameterized view is a technique that has been used to describe content and access methods in Global-as-View (GaV) integration architectures [13]. Figure 2 shows an RPV of a service returning the personal information (i.e., name and dates of birth) of patients admitted in a given medical center. Note that input parameters are prefixed with the symbol “?” and output parameters are prefixed with the symbol “?”.
RDF views may also specify constraints to characterize the data manipulated by their corresponding services. These constraints may have different forms, including simple interval constraints (e.g., \(X \in [a, b]\), where \(X\) is a variable used in an RDF view), and fuzzy constraints interpreted according to a fuzzy membership function (e.g., the medications returned by a service have “High” concentration of hydroxypropyl-β-cyclodextrin; i.e., \(X\) is \(High\), where the fuzzy term “High” is interpreted by a membership function specifying for each value of \(X\) the degree to which it is high).
We adopted an approach similar to SAWSDL\(^1\) to
\(^1\)http://www.w3.org/2002/ws/sawsdl/
RDF schema constraints such as our query rewriting algorithm takes into account the case of RDF/RDFS data integration. Specifically, XML data integration [13, 17], we considered the most of previous work has focused on relational and Compliant with the RDF/S data models following aspects:
- Query rewriting and data integration [13] in the RPVs, rewrites the query in terms of calls to rele-
- vances on the fly [7, 9]. The algorithm, given a SPARQL position algorithm to select and compose data ser-
- vices on the fly. Each virtual peer, where the relevant services will be selected and composed. Furthermore, for each discovered service we return the mapping path between the ontologies associated with the expertise domains (i.e., VO) of the discovered service and the initial peer. This mapping path allows the translation of RPV views.
We proposed a query rewriting based service composition algorithm to select and compose data services on the fly [7, 9]. The algorithm, given a SPARQL query, and a set of data services represented by their RPVs, rewrites the query in terms of calls to relevant services. Our algorithm extends earlier works on query rewriting and data integration [13] in the following aspects:
Compliance with the RDF/S data models: while most of previous work has focused on relational and XML data integration [13, 17], we considered the case of RDF/RDFS data integration. Specifically, our query rewriting algorithm takes into account RDF schema constraints such as rdfs:subClassOf, rdfs:subPropertyOf, rdfs:domain, and rdfs:range when comparing RPVs to queries. The consideration of RDFS constraints is important as allows our system to infer more results than the previous rewriting techniques. For example, suppose there is a statement in an RDFS ontology specifying that :Medication rdfs:subClassOf :Drug. Given a data service S returning the medications administered to a given patient, and a query Q for the drugs administered to a given patient, our algorithm automatically infers that S can be used to generate rewritings for Q.
Answering parameterized queries: while previous data integration systems have focused on answer-
- ing specific queries, PAIRSE has focused on answering parameterized queries. The key focus was on constructing compositions of services (i.e., parameterized integration plans) that are independent of a particular input value. For example, assume a parameterized query $Q(x,y)$ for the medications $y$ that may interact with a given medication $x$. Assume also two data services:
$$S_1(x,y), \text{where } x \in [1, 5] \text{ and } y \in [100,150],$$
$$S_2(x,y), \text{where } x \in [6,10] \text{ and } y \in [150,200]$$
If $Q$ was a specific query ($Q_{x=2}$), then $S_2$ would not be considered in the rewriting (i.e., composition) as $x=2$ is not covered by $S_2$. In contrast, both of $S_1$ and $S_2$ are usable for $Q$, to cover as much as possible of the potential values of $x$. Our composition algorithm extends the previous ones with: (i) a probabilistic subsumption test to determine in a polynomial time the minimum number of services required to satisfy the value constraints that may be specified on query’s parameters [6], and (ii) a mechanism to optimize the generated composition plans based on value constraints specified in service descriptions [7].
Inclusion of user’s preferences: often the number of candidate compositions that may be used to answer the same query is very large. We proposed an approach [9] to compute the top-k compositions based on user preferences. In our approach, we modeled user’s preferences using fuzzy sets. We match the (fuzzy) constraints of the relevant services to those of the query and determine their matching degrees using a set of matching methods from the fuzzy set theory. We then rank-order candidate services based on a fuzzification of Pareto dominance and compute the top-k compositions.
4. PRIVACY PRESERVATION IN PAIRSE
In this section, we briefly present our models to preserve the privacy of manipulated data at the service and the composition levels.
4.1 Privacy-preserving Service Execution Model
Data returned by a data service may be subject to different security and privacy concerns. For example, different people may have different access rights over the same data item; data subjects\(^2\) may
\(^2\)We use the term data subject to mean the individual whose information is manipulated by data services.
have different preferences about the disclosure of their data, etc. A common approach in the database field to handle such concerns is to push them to the underlying DBMS by rewriting the query to include these constraints [15]. However, this may not be applicable to data services as the same service may access a multitude of heterogeneous data sources that may not be necessarily managed by a DBMS. An alternative approach is to enforce privacy and security policies at the application level [4], by modifying, in our case, the source code of data services. However, this may not always be applicable, as most of current data service creation platforms (e.g., AquaLogic [11]) provide data services as black boxes that cannot be modified. Even if the code was modifiable, this approach often leads to privacy leaks [15].
We proposed a secure, privacy-preserving execution model for data services allowing service providers to enforce their privacy and security policies without changing the implementation of their data services (i.e., services are seen as black boxes). Our model is inspired by the database approach to “declaratively” handle the security and privacy concerns. It involves the following steps (refer to Figure 3):
**Step 1:** **View rewriting to integrate security and privacy constraints.** When a data service is invoked, our model rewrites its corresponding RDF view to take into account applicable security and privacy rules from the service’s associated policies, which are expressed using the OrBAC and PrivOrBAC models over domain ontologies and take into account the data recipient (i.e., service consumer), his purpose for requesting the data, and the consents of data subjects [16]. The soundness and correctness of our algorithm are demonstrated in [16, 18].
**Step 2:** **Rewriting the extended view in terms of data services.** The extended RDF view $v_{\text{extended}}$ may include additional data items (denoted by $\Delta v = v_{\text{extended}} - v_{\text{original}}$) required to enforce security and privacy constraints. In this step, we find the data services covering $\Delta v$, and rewrites $v_{\text{extended}}$ in terms of these services along with the initial service.
**Step 3:** **Enforcing security and privacy constraints.** Services selected in the previous step are composed and executed using the conventional service execution process. The composition returns (i) the data items returned by the invoked service along with (ii) the data items necessary to evaluate the security and privacy constraints. We defined a privacy filter that evaluates the privacy constraints of the different items that are subject to privacy constraints in the view. Null values will be returned for items whose privacy constraints evaluate to False.
We demonstrated the validity of our model by extending the architecture of the famous service container AXIS\(^3\) 2.0 with a new module implementing our privacy-preserving service execution model.
### 4.2 Privacy-preserving Composition Execution Model
Executing compositions may disclose confidential information to component services. Assume, for example, a composition of two services: $S_1$ returns HIV patients in a given city, and $S_2$ checks whether a given patient has been treated for psychiatric disorders. Such composition could be needed (by a pharmaceutical researcher) to investigate the connection between a chemical component present in HIV medicines and the development of severe psychiatric disorders. Assume also Bob is a common patient to $S_1$ and $S_2$. If $S_2$ is invoked with Bob’s identifier, and the provider of $S_2$ has an access to the composition plan (i.e., he knows that Bob was outputted by $S_1$), then he will infer that Bob is an HIV patient. On the other hand, if the data returned by $S_1$ were completely privacy-sanitized (e.g., by removing identifiers and sensitive information), then the composition could not be executed.
We proposed a privacy-preserving composition execution model in [5] that limits the information disclosed to services in a composition about the data that each other holds. Our model distinguishes between the following entities: (i) the services in the composition, (ii) the execution engine, and (iii) the recipient of final results. It relies on two key ideas: First, data services use the same order-preserving encryption scheme OPES [3] to encrypt the identifier attributes that are needed to connect data subjects across the different services. They are still free to protect non-identifier attributes with their own techniques (e.g., anonymization, etc.). This way the execution engine has only access to protected data and can still link data subjects across services using the encrypted identifier attributes (note that OPES allows for applying equality queries on encrypted
\[^{3}\text{http://axis.apache.org/axis2/java/core/}\]
5. IMPLEMENTATION AND EVALUATION
We evaluated our different techniques and algorithms in the healthcare and bioinformatics application domains. These domains have widely embraced Web standards, such as XML and Web services [12, 10], and are characterized by the need for a flexible and privacy-preserving data integration approach.
The cardiology hospital of Lyon provided us with access to two medical databases. The identities of patients in these databases were changed. We also generated synthetic medical data about the same patients. We implemented about 400 data Web services on top of our real and synthetic data. Services were all deployed on an extended version of AXIS 2.0 implementing our service execution model. We built a medical ontology based on the building blocks and the data types defined in the HL7 standard, and used it for the annotation of service description files. To evaluate our techniques in the bioinformatics domain, we used a set of 300 services from the BioCatalogue registry.
Figure 4 (part a) shows the query interface to PAIRSE. Users are assisted in formulating their SPARQL queries over domain ontologies. The figure shows (in part b) also the composition plan of a selected composition, along with the privacy-sanitized results (part c).
We conducted exhaustive experiments to evaluate the performance of our integration system. We summarize below obtained results:
- Composition construction and execution: Our experiments in [7] showed that our composition algorithm can handle hundreds of data services in a reasonable time. For example, for chain queries [13] and RPVs with a length of 3 or 4 object properties the algorithm was able to handle up to 400 services in less than 4 seconds. In the context of parameterized queries, our experiments in [6] showed that our algorithm to find the minimum set of services introduced only a small cost at the composition construction time (i.e., in all experiments the algorithm required less than 10% of the time needed to write the query), and improved substantially the composition execution time (i.e., in all experiments the composition execution time was reduced to less than 0.75% of the time needed without optimization), as it removes redundant services. In the context of preferences queries, our experiments in [9] considered that services can be grouped in classes. The experiments showed that the top-k compositions can be computed efficiently. For instance, for classes containing about 400 services, the top-k compositions are computed in less than 4 seconds.
- Security and privacy preservation: The conducted experiments in [8] showed that our secure and privacy preserving service execution model added only a small increase to the service execution time. In all experiments, the cost incurred in the enforcement of security and privacy constraints did not exceed 10% of the time required to execute the service with ignoring these security and privacy constraints altogether. The conducted experiments for the evaluation of our composition execution model [5] showed that the time required to execute the composition with privacy preservation is at most three orders of magnitude of the time required without privacy preservation ($K_1$ was set to 4 in all tests). We were able to cut down that cost to two orders of magnitude by reusing the values of the protocol parameters that were computed in past invocations of the same services (and during the same composition execution).
6. CONCLUSION
The goal of the PAIRSE project was to develop new methods and techniques for flexible and privacy-preserving data integration. We have evaluated our composition-based approach in the healthcare and the bioinformatics domains. The obtained results [5, 9, 7, 14, 8, 16, 6] are promising.
7. ACKNOWLEDGMENTS
PAIRSE is funded by the French National Research Agency under the grant number ANR-09-SEGI-008.
8. ADDITIONAL AUTHORS
Michael Mrissa (Lyon 1 University, michael.mrisss@univ-lyon1.fr), Francois Paulus (Semsoft Company, francois.paulus@semsoft-corp.com), Stephane Morucci (Swid Company, stephane.morucci@swid.fr), Nora Cuppens (Telecom-Bretagne, nora.cuppens@telecombretagne.fr).
9. REFERENCES
|
{"Source-Url": "https://hal.archives-ouvertes.fr/hal-01124429/file/Benslimane_12918.pdf", "len_cl100k_base": 5128, "olmocr-version": "0.1.50", "pdf-total-pages": 8, "total-fallback-pages": 0, "total-input-tokens": 24536, "total-output-tokens": 6594, "length": "2e12", "weborganizer": {"__label__adult": 0.0005488395690917969, "__label__art_design": 0.0004742145538330078, "__label__crime_law": 0.00154876708984375, "__label__education_jobs": 0.00168609619140625, "__label__entertainment": 0.00012695789337158203, "__label__fashion_beauty": 0.00026226043701171875, "__label__finance_business": 0.0011968612670898438, "__label__food_dining": 0.0006241798400878906, "__label__games": 0.0006237030029296875, "__label__hardware": 0.0009832382202148438, "__label__health": 0.00325775146484375, "__label__history": 0.0005712509155273438, "__label__home_hobbies": 0.00014698505401611328, "__label__industrial": 0.0006480216979980469, "__label__literature": 0.00063323974609375, "__label__politics": 0.0008187294006347656, "__label__religion": 0.0005197525024414062, "__label__science_tech": 0.39111328125, "__label__social_life": 0.00026679039001464844, "__label__software": 0.04962158203125, "__label__software_dev": 0.54296875, "__label__sports_fitness": 0.0003314018249511719, "__label__transportation": 0.0006356239318847656, "__label__travel": 0.0002884864807128906}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 26223, 0.05423]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 26223, 0.16747]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 26223, 0.87521]], "google_gemma-3-12b-it_contains_pii": [[0, 1086, false], [1086, 1887, null], [1887, 6004, null], [6004, 10239, null], [10239, 14694, null], [14694, 19592, null], [19592, 23785, null], [23785, 26223, null]], "google_gemma-3-12b-it_is_public_document": [[0, 1086, true], [1086, 1887, null], [1887, 6004, null], [6004, 10239, null], [10239, 14694, null], [14694, 19592, null], [19592, 23785, null], [23785, 26223, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 26223, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 26223, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 26223, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 26223, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 26223, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 26223, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 26223, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 26223, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 26223, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 26223, null]], "pdf_page_numbers": [[0, 1086, 1], [1086, 1887, 2], [1887, 6004, 3], [6004, 10239, 4], [10239, 14694, 5], [14694, 19592, 6], [19592, 23785, 7], [23785, 26223, 8]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 26223, 0.0]]}
|
olmocr_science_pdfs
|
2024-11-30
|
2024-11-30
|
25648fad79c456b6e11c02a036d9c506d3a0ea8b
|
Requirements Engineering: Goals and Constraints
CECS 590
Visit by Intel
• March 18 or 23 (to be confirmed)
• Erik Simmons, head of “Emergent Systems and Coaching”
• What would you like him to talk about? (idea: 30 min presentation plus long Q & A)
• I will give you his slide set a week before so you can prepare for the visit
→ flipped classroom
Literature Review
• Feedback posted on BeachBoard
• Points assigned
• Remember: You all made an effort, and I recognize that. I wrote more about my critique and things you could do better than about the things that worked well – because that’s what you need to know to improve.
References – again...
In one of the reference lists:
“XML messaging for Mobile Devices: From requirements to implementation” by Jakko Kangasharju, Sasu Tarkoma
published in ScienceDirect
Your team projects
- Software Scalable Three-Dimensional Printer Carriage w/ Interchangeable Print Heads
- Home automation installation work order system
- Pitching machine for tennis balls
- PriceShare
- HyperSocialYelp
- StuList
- Product Review on Social Platform
- Sportsbuddy
- Beach Cops
- 2 tbd
Recap time!
- Stakeholders
- Definition
- What types of stakeholders are there?
What roles? Which functions?
- Which are the characteristics we need for stakeholder analysis?
- Why a stakeholder model?
How do I elaborate a stakeholder model?
Requirements Engineering – Outline
• WHY do we need Requirements Engineering and what is it?
• Principles: Definitions, process, roles, problem/solution view, artifact orientation
• System Models: Decomposition and abstraction, system views
• Frameworks: What reference structures can I use for requirements?
• Business Case Analysis: Why are we building this system?
• Stakeholders: Who are the people to talk to about requirements?
• Goals and Constraints: What are the major objectives for the system?
• System Vision: What exactly do we want to achieve?
• Domain Models: What are the surrounding systems ours interacts with?
• Usage Models: How will the system interact with the user?
• Software quality models: How to determine the quality characteristics?
• Quality requirements: How to specify which qualities need to be met?
• Process requirements: How to specify constraints for development?
• Towards a system specification: How to hand over to design?
• Quality assurance: How to ensure that RE is done in a good way?
• Change management: How to evolve requirements?
Connecting to last lecture: Stakeholders and Elicitation
- Elaboration of an adequate, complete requirements and system specification
- Stakeholder Model
- Elicitation and creativity techniques
- Modeling is part of requirements elicitation and analysis
Questions that follow w.r.t. goals:
→ How to elicit goals in models and which techniques are available?
→ Which interdependencies exist between goal models and other RE contents?
→ How can I use goal models within the requirements analysis?
→ Which challenges may arise when performing goal modeling?
Today’s learning goals
• **Foundations of goal modeling**
– Definition, characteristics, meaning and purpose
– Interdependencies between goal models and other RE content
• **Overview of**
– Types of goals
– Goal models in the context of analysis (dependencies, identification and avoiding conflicts, QA)
– Techniques for goal modeling
• Goal modeling in context of **AMDiRE**
• **Understanding** of typical problems
CSULB spring 2015
Goals and Constraints
• Motivation and overview
• Definition
• Types of goals
• Goal refinement and abstraction
• Goal models and usage for analysis and quality assurance
• Techniques for goal modeling
• Goal modeling with AMDiRE
• Typical problems when using goal models
Meaning of explicit goals
• Explicit elicitation of the goals pursued by a project/ a system development/ a system:
*Why should the system be developed?*
→ Which **goals** are being pursued?
– Business goals, market goals, relation to strategic goals of the company, ...
– Technical goals
– Methodical goals
– Functional goals
– ...
→ Goals form an **essential part of the rationale for requirements** and build a basis early on for
→ Traceable requirements
→ Prioritization of requirements
→ ....
Problems addressed by goal modeling
**Advantages** of a systematic elicitation and documentation of explicit, negotiable, assessable goals:
- **Analysis** of goals as well as
- early identification of goal conflicts
- early identification of „Moving Targets“
- A series of requirements **justifications** documents the decision path from goals to solution basis.
- **Differentiation between problem and solution:**
- How are the requirements to be evaluated and to be justified?
- What are the necessary and reasonable assumptions?
- What reveals itself as free (unconstrained) design decision?
→ **Avoid** too much solution orientation (**via goal abstraction**).
Examples for goals
• Goal of the system user or customer:
– The system administrates the essential data of our company over the next 20 years.
• Business goal of the system manufacturer or an investor:
– The system reaches a market satisfaction of at least 20%.
• Quality goals of a typical user:
– The system is easy to handle.
– The system is fast and efficient.
• Prescriptions by a standard:
– The system fullfills the security standard xyz.
Which goals could the stakeholders have?
Goals and Constraints
- Motivation and overview
- Definition
- Types of goals
- Goal refinement and abstraction
- Goal models and usage for analysis and quality assurance
- Techniques for goal modeling
- Goal modeling with AMDiRE
- Typical problems when using goal models
What is a goal?
Definition
Discretionary abstract characteristic, which
1. the system shall fulfill w.r.t. its operational environment or
2. the development process of the system shall fulfill.
Critical points
• No hint w.r.t. the solution and often not quantified.
→ Unmistakeable clarity, when a goal is reached
→ Basic achievability of a goal
Delimitation of goals and requirements
„A goal is a prescriptive statement of intent.“
- Axel van Lamsweerde
→ Goals impose general constraints or a vision, state or effect that is connected with development.
By the way:
- „Prescriptive“: A (high-level) goal itself often doesn’t require a rationale, goals are the rationale for deduced requirements.
- Goals serve for the understanding of the to-be-reached state of the system, the system context, etc.
Example
- Goals are used for gap analysis and conversion from the current state of business processes and legacy systems to a desired state.
From goals to requirements
In tendency
- **Goals**: encompassing, general, bound to intents and motivations, mostly directed towards the context of the system under development
- **Requirements**: Demands for concrete, often detailed characteristics of a system or its development process (ideally rationalized by a goal)
Delimitation
- In some approaches (e.g. KAOS) **requirements** are denoted as specialized goals that are related to specific subsystems and actors ("Agents").
Characteristics of goals
• A goal is characterized by it’s goal description
• We distinguish between goals and their description
– **Precision**: How unambiguous is a goal described? (subjective/objective goal description)
– **Concreteness/abstractness**
– **Verifiability**: How unambiguously can the satisfaction of the goal be verified?
– **Degree of satisfaction**: Is the goal satisfiable to a specific degree or only as a whole?
**Careful**: Often goals are characterized indirectly by metrics that shall be achieved!
Goal satisfaction
• *Satisfaction of goals* happens via adequate steps, characterized by
– subgoals
– (deduced) requirements / constraints
→ To *characterize* goals and make them more precise, it is helpful to introduce metrics for the degree of satisfaction
– Relations between goals, subgoals via formulas
→ This allows for statements whether satisfying *Goal A* to a higher degree helps, hinders or doesn’t influence *Goal B*
– Definition of performance metrics for individual goals (for example via GQM – the Goal Question Metric approach)
Goal models: Idea
Goal models for structuring all relevant:
• **Goals** and **subgoals**
• **Relations** between goals:
– Hierarchy/decomposition of goals and/into subgoals
– Interdependencies between goals
Goal models
• **Network of characteristics**
– Set of related characteristics
• **Goal tree**
– Set of related characteristics of goals with a hierarchical refinement relation and different interdependencies
– Known representatives: KAOS (van Lamsweerde, et al.), GSN (Goal Structuring Notation, Kelly et al.), i* (Yu et al.), ...
• **Expectation**
– Leaf of the goal tree that can exclusively be related to its context with regard to its satisfaction.
• **Requirement**
– Leaf of the goal tree that can exclusively be related to the system with regard to its satisfaction.
– Functional or non-functional characteristic of the system that can be deduced from the goals
• Expectation and requirement can be combined to an **Assumption/Guarantee pair** (A/G specification) w.r.t. the interface between system and context.
Goals and Constraints
• Motivation and overview
• Definition
• Types of goals
• Goal refinement and abstraction
• Goal models and usage for analysis and quality assurance
• Techniques for goal modeling
• Goal modeling with AMDiRE
• Typical problems when using goal models
Types of goals
• **Categorization** of goals happens according to different criteria:
– Underlying system models, quality models, ...
– Application domain/ Characteristics of the expected system context
– Methodical approach (e.g. KAOS) as well as characteristics that can be expressed by modeling concepts
---
CSULB spring 2015
Examples for types of goals according to Lamsweerde
• Quality-related goals (part of non-functional goals)
– Usability, Performance, Security, Accuracy
– *Reliability: 99% of the uptime, the system reacts correctly to user queries.*
• Optimization goals (also „soft“ goals)
– If measurable: Max-/Minimisation, increase/decrease
– *Performance: The operating grade of the tracks between A and B is increased by 3% per year in the next 5 years.*
• Behavioral goals (also „hard“ or functional goals):
– E.g. after interaction phase: satisfaction goal (A requests from B), information goal (A informs B)
– *Accuracy: 280-300ms, the train control must be informed about the state of the level-crossing.*
• Anti-goals (also „obstacles“):
– E.g. „safety hazards“ and „security threats“
– *The data loss is estimated at 5% despite backup.*
Exercise
For each of the following types, specify two goals for a car sharing system:
- Quality-related goals (part of non-functional goals)
- Optimization goals (also „soft“ goals)
- Behavioral goals (also „hard“ or functional goals)
- Anti-goals (also „obstacles“)
Goals and Constraints
- Motivation and overview
- Definition
- Types of goals
- Goal refinement and abstraction
- Goal models and usage for analysis and quality assurance
- Techniques for goal modeling
- Goal modeling with AMDiRE
- Typical problems when using goal models
Ideal RE: Concretion and Abstraction
Ideally, **RE Top Down** happens in this form:
- Based on elicited and consolidated, generally formulated goals
- *The product must be deployable internationally*
- We define abstract requirements, consolidated and documented:
- *The product must be deployable in 3rd world countries*
- *The product must be usable independent of the energy resource*
- And retrieve refined, concrete requirements
- *The system has a dynamo, that generates the necessary energy; the electric tension is at...*
- And finally determine a system specification
- *We use a dynamo of the company AB...*
- **Reverse path:** From system specification /concrete requirements or prototypes to goals (Reverse Engineering)
Example (simplified)
**Goals:** (Often) hard to measure
1. *The system must be deployable internationally.*
2. *The system must be easy to use.*
3. *The development will follow a systematic process.*
**Requirements:** objectively measurable/decideable
1. *The user interface must support the languages [x,y,z]..*
2. *The average inexperienced user must be able to use the function* \([\text{Function}]\) *within 20 seconds.*
3. *The process must be certified as CMMI Level 3.*
- **Roundtrip:** requirements make the satisfaction of goals more concrete (over various steps), goals describe a justification for requirements.
- **Tracing:** Ideally, the relations between goals, abstract and concrete requirements are documented in a traceable way.
Goal abstraction and goal refinement
Goal abstraction
- What goals are behind the requirements and might open up the design space?
- Which goals are determining the currently present set of requirements?
→ “Why” questions: retrieval of application domain knowledge
Goal refinement (Re decisions) and Scoping:
- Problem scoping: for which tasks or functions of the system do we need requirements?
For which context do we need to deduce requirements?
- System scoping: How can the design space of the problem under consideration be technically determined?
Goals and Constraints
- Motivation and overview
- Definition
- Types of goals
- Goal refinement and abstraction
- Goal models and usage for analysis and quality assurance
- Techniques for goal modeling
- Goal modeling with AMDiRE
- Typical problems when using goal models
Do we have a goal conflict here?
- Low production costs
- Easy to use
- High information security
Usage of goal models for conflict analysis
Resolving goal conflicts
1. Goals are made measurable by evaluation and prioritization – and thereby made comparable.
2. For goals, specific threshold levels are determined as standards that can be reached by all.
3. Goals are prioritized.
4. Conflicts are resolved by negotiation.
Identification of goal conflicts in a KAOS example
Conflict between optimization goals
Quelle: Lamsweerde, siehe ff.
Goals and Constraints
- Motivation and overview
- Definition
- Types of goals
- Goal refinement and abstraction
- Goal models and usage for analysis and quality assurance
- Techniques for goal modeling
- Goal modeling with AMDiRE
- Typical problems when using goal models
Goal modeling techniques
• KAOS (Keep All Objects Satisfied)
• i* Modelling Framework
• *System Dynamics* and *Balanced Scorecards* for encompassing analysis and simulation of complex dynamic systems
• **Basic ideas and commonalities** of goal modeling techniques:
– Hierarchical decomposition of goals into subgoals
– Model of dependencies (e.g. conflicts, ...)
– Mapping of goals to agents (subsystems/components/actors)
– „seamless transition“ to design
Example technique: KAOS
Abstract Solution alternative via OR
why?
how?
Goal satisfaction via combination AND
CSULB spring 2015
Example technique: KAOS
Subgoal contributes pos. / neg. to super goal
Soft or optimization goal
Super goal is a logic conclusion from subgoals
Behavioral goal
ServeMorePassengers Minimize[Costs]
Min[DevlptCosts]
Min [OperationCosts]
NewTracksAdded
Max[Train-Speed]
Min [Distance BetweenTrains]
SafeTransport
Avoid [TrainEntering ClosedGate]
Maintain [WCS-DistBetweenTrains]
Maintain [TrackSegmentSpeedLimit]
Quelle: Lamsweerde, siehe ff.
Measuring goal satisfaction
Goal function
Evaluation of goal satisfaction
Priorisation and optimization via goal function
Measurable “requirement”
Example technique: i*
Why Agent-Oriented Requirements Engineering
Eric S. K. Yu
Faculty of Information Studies, University of Toronto
Toronto, Ontario, Canada M5S 3G6
www.cs.utoronto.ca/~eric
Abstract. Agent concepts have been used in a number of recent approaches to requirements engineering. In view of the rapid shift towards open, networked, and cooperative computing, we argue for the fuller development of emerging agent-oriented approaches to requirements engineering. Such approaches would address crucial requirements engineering concerns such as functionality, quality, and process, using agents as the focal concept.
1 Introduction
Agent concepts have been used in a number of recent approaches to Requirements Engineering (RE). It is generally acknowledged that the main focus of Requirements Engineering should be on the characterization of the intended system in relation to its environment [2, 13, 14]. Agent concepts have been introduced to RE primarily as modelling constructs to characterize active elements in the environment, usually including the target system. These active elements may be human or machine, and may contain hardware and/or software.
In this paper, we put forth the position that the concept of agent should be further developed to serve as a focal, guiding concept in RE frameworks, much like objects and goals have served as guiding concepts. The key benefit of having an RE-level concept of agent is that it will serve to bring issues centering on an agent together, so that they can be identified and addressed.
An agent-oriented approach to RE will be of particular interest for new settings in which there is a high degree of open distributed
Goals and Constraints
- Motivation and overview
- Definition
- Types of goals
- Goal refinement and abstraction
- Goal models and usage for analysis and quality assurance
- Techniques for goal modeling
- Goal modeling with AMDiRE
- Typical problems when using goal models
Goals and other content items
- The **goal model is the basis** for
- Early identification and resolution of conflicts
- Rationale of a requirement
- Modeling of the system behavior on different levels of abstraction
- Domain Model
- System Vision
- Usage Model
Goal categories and dependencies
Categories
- **Business Goals**: all business-relevant (strategic) goals as well as goals with direct impact on the system or project.
- **Usage Goals**: direct relation to functional context and usage of the system (user perspective) → for behavior modeling
- **System Goals**: system-related goals that target system characteristics → to determine system characteristics
Dependencies (selection)
- **Decomposition** of goals into subgoals.
- **Supports**: A goal supports in achieving another goal.
- **Conflicts**: A goal is in conflict with another goal.
Elaborating a goal model
Problems in goal modeling
• Goals often intentional
– Explain desired state but not how to reach it
– Fuzzy, imprecise
– Hard to determine when a goal is satisfied
• Goals are often in conflict
– Optimization of one goal is in conflict with another one, e.g.:
• The system shall be of high quality
• The system shall be cheap
• Abstraction levels & precision in differentiating between problem and solution
– General goal trees allow for a smooth transition between problem and solution.
→ Danger of veering off into architecture design too early.
→ Solution orientation
Exercise
Take your goals from the exercise last time for the car sharing system:
• Quality-related goals
• Optimization goals
• Behavioral goals
• Anti-goals
And re-classify them as Business Goals, Usage Goals, System Goals, and Constraints.
Which classification seems to be more useful to you and why?
Example 1
A tree-shaped hierarchy would be easier to read. Missing: user features (or should be phrased differently). If we only talk about enhancing / extending the system, reduced features might be ok.
---
**Above,**
- Red - business goals
- Brown - system goals
- Yellow and green - usage goals
- Black lines - conflicts
Example 2 (PDF in Beach Board)
Figure 2: Goal Model
Try to put it on one page in a way I can still read it.
Example 3
Careful!
What’s different in here from the AMDiRE model?
Try to refine Usage goals from Business Goals. System goals can be derived from both Business and Usage goals.
The Plant Guild Composer: Goal Model
Example 4
Exercise
Let’s make a goal model for the car sharing system:
• Business goals
• Usage goals
• System goals
Then let’s define the relations between them:
• Subgoal
• Supports
• Conflicts
Assignment
Make a goal model for your project system.
Let’s take a look at the assignment description.
|
{"Source-Url": "http://birgit.penzenstadler.de/teach/590/2015spring_CECS-590_07_GoalsAndConstraints.pptx.pdf", "len_cl100k_base": 4440, "olmocr-version": "0.1.53", "pdf-total-pages": 54, "total-fallback-pages": 0, "total-input-tokens": 99516, "total-output-tokens": 6493, "length": "2e12", "weborganizer": {"__label__adult": 0.0006375312805175781, "__label__art_design": 0.0019168853759765625, "__label__crime_law": 0.0006833076477050781, "__label__education_jobs": 0.137451171875, "__label__entertainment": 0.00027751922607421875, "__label__fashion_beauty": 0.0004756450653076172, "__label__finance_business": 0.0023593902587890625, "__label__food_dining": 0.0006680488586425781, "__label__games": 0.001824378967285156, "__label__hardware": 0.0014142990112304688, "__label__health": 0.001010894775390625, "__label__history": 0.0010404586791992188, "__label__home_hobbies": 0.0003426074981689453, "__label__industrial": 0.00141143798828125, "__label__literature": 0.0012979507446289062, "__label__politics": 0.0005688667297363281, "__label__religion": 0.0009927749633789062, "__label__science_tech": 0.1331787109375, "__label__social_life": 0.0005512237548828125, "__label__software": 0.0222930908203125, "__label__software_dev": 0.68701171875, "__label__sports_fitness": 0.0006799697875976562, "__label__transportation": 0.0015783309936523438, "__label__travel": 0.0004968643188476562}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 20436, 0.00597]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 20436, 0.64779]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 20436, 0.90753]], "google_gemma-3-12b-it_contains_pii": [[0, 58, false], [58, 351, null], [351, 630, null], [630, 818, null], [818, 818, null], [818, 1121, null], [1121, 1380, null], [1380, 2459, null], [2459, 3022, null], [3022, 3471, null], [3471, 3744, null], [3744, 4264, null], [4264, 4942, null], [4942, 5402, null], [5402, 5443, null], [5443, 5716, null], [5716, 6068, null], [6068, 6670, null], [6670, 7153, null], [7153, 7687, null], [7687, 8243, null], [8243, 8457, null], [8457, 9294, null], [9294, 9567, null], [9567, 9905, null], [9905, 10757, null], [10757, 11026, null], [11026, 11299, null], [11299, 12043, null], [12043, 12792, null], [12792, 13350, null], [13350, 13623, null], [13623, 13722, null], [13722, 14049, null], [14049, 14168, null], [14168, 14441, null], [14441, 14908, null], [14908, 15040, null], [15040, 15481, null], [15481, 15632, null], [15632, 15654, null], [15654, 17403, null], [17403, 17676, null], [17676, 17957, null], [17957, 18553, null], [18553, 18578, null], [18578, 19174, null], [19174, 19481, null], [19481, 19808, null], [19808, 19918, null], [19918, 20098, null], [20098, 20146, null], [20146, 20333, null], [20333, 20436, null]], "google_gemma-3-12b-it_is_public_document": [[0, 58, true], [58, 351, null], [351, 630, null], [630, 818, null], [818, 818, null], [818, 1121, null], [1121, 1380, null], [1380, 2459, null], [2459, 3022, null], [3022, 3471, null], [3471, 3744, null], [3744, 4264, null], [4264, 4942, null], [4942, 5402, null], [5402, 5443, null], [5443, 5716, null], [5716, 6068, null], [6068, 6670, null], [6670, 7153, null], [7153, 7687, null], [7687, 8243, null], [8243, 8457, null], [8457, 9294, null], [9294, 9567, null], [9567, 9905, null], [9905, 10757, null], [10757, 11026, null], [11026, 11299, null], [11299, 12043, null], [12043, 12792, null], [12792, 13350, null], [13350, 13623, null], [13623, 13722, null], [13722, 14049, null], [14049, 14168, null], [14168, 14441, null], [14441, 14908, null], [14908, 15040, null], [15040, 15481, null], [15481, 15632, null], [15632, 15654, null], [15654, 17403, null], [17403, 17676, null], [17676, 17957, null], [17957, 18553, null], [18553, 18578, null], [18578, 19174, null], [19174, 19481, null], [19481, 19808, null], [19808, 19918, null], [19918, 20098, null], [20098, 20146, null], [20146, 20333, null], [20333, 20436, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 20436, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 20436, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 20436, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 20436, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 20436, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 20436, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 20436, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 20436, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 20436, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 20436, null]], "pdf_page_numbers": [[0, 58, 1], [58, 351, 2], [351, 630, 3], [630, 818, 4], [818, 818, 5], [818, 1121, 6], [1121, 1380, 7], [1380, 2459, 8], [2459, 3022, 9], [3022, 3471, 10], [3471, 3744, 11], [3744, 4264, 12], [4264, 4942, 13], [4942, 5402, 14], [5402, 5443, 15], [5443, 5716, 16], [5716, 6068, 17], [6068, 6670, 18], [6670, 7153, 19], [7153, 7687, 20], [7687, 8243, 21], [8243, 8457, 22], [8457, 9294, 23], [9294, 9567, 24], [9567, 9905, 25], [9905, 10757, 26], [10757, 11026, 27], [11026, 11299, 28], [11299, 12043, 29], [12043, 12792, 30], [12792, 13350, 31], [13350, 13623, 32], [13623, 13722, 33], [13722, 14049, 34], [14049, 14168, 35], [14168, 14441, 36], [14441, 14908, 37], [14908, 15040, 38], [15040, 15481, 39], [15481, 15632, 40], [15632, 15654, 41], [15654, 17403, 42], [17403, 17676, 43], [17676, 17957, 44], [17957, 18553, 45], [18553, 18578, 46], [18578, 19174, 47], [19174, 19481, 48], [19481, 19808, 49], [19808, 19918, 50], [19918, 20098, 51], [20098, 20146, 52], [20146, 20333, 53], [20333, 20436, 54]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 20436, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-08
|
2024-12-08
|
58c8e2d716b737ccc600b5a6659b64ed9fe891ff
|
THE COCV DOCUMENTCLASS USERS GUIDE VERSION 1.1 ∗, ∗∗
AUTHOR ONE1,2, AUTHOR TWO3 AND AUTHOR THREE2,4
Abstract. This paper describes the use of the cocv \LaTeX document class and is prepared as a sample to illustrate the use of this class written for the ESAIM: Control, Optimisation and Calculus of Variations Journal.
Résumé. Cette courte note décrit la classe de \LaTeX cocv et illustre son usage en se présentant sous la forme d’un article du journal ESAIM: Control, Optimisation and Calculus of Variations pour lequel elle a été écrite.
AMS Subject Classification. 35L05, 35L70.
The dates will be set by the publisher.
Contents
Introduction 2
1. About the “head” of your paper 2
1.1. Your private macros (the preamble) 2
1.2. The top matter 3
2. About the “body” of your paper 3
2.1. The environments 3
2.2. Specific macros 4
2.3. Particular situations 5
2.4. Including postscript files 6
2.5. Acknowledgements 7
2.6. Cross references and bibliography 7
References 7
Keywords and phrases: EDP Sciences, \LaTeX, article, cocv
* Authors express their thanks here.
** Not more than 5 thanks are allowed.
1 Department of Theoretical Physics, University of ...; e-mail: author.one@... & author.three@...
2 The Royal Academy of ...
3 Institute for Fundamental ...; e-mail: author.two@...
4 The GLM Laboratories, ...
INTRODUCTION
This short note describes the cocv \LaTeX{} class for authors preparing a compuscript for the ESAIM: Control, Optimisation and Calculus of Variations journal. In itself it is an example of the use of the cocv class. It is assumed that authors have some experience with \LaTeX{} or \AMS-LaTeX{}; if not, they are kindly referred to [2,4,7], and to [3,6] for plain \TeX{}. Apart from its few high-level structuring commands, standard \LaTeX{}-commands will work normally (\begin{...} ... \end{...}, \section{...}, \subsection{...}, etc).
1. ABOUT THE “HEAD” OF YOUR PAPER
Your paper contains essentially two parts: the preamble, where you put your personal macros, which is between the \documentclass and the \begin{document} commands, and its body, which is where you put its contents. The body is in turn made of two parts: the top matter and the text. The top matter is where you give the initial data of your paper (the date, your name, the abstract, etc.). Your paper should begin with its preamble:
\begin{verbatim}
\documentclass{cocv}
⟨ your macros ⟩
\end{verbatim}
This is followed by its body:
\begin{verbatim}
\begin{document}
\title{your title}⟨ your thanks ⟩ ... ⟨ your thanks ⟩
\author{name of the first author} ⟨ his/her address ⟩
... ⟨ name of the last author ⟩ ⟨ his/her address ⟩
\date{dates will be set by the publisher}
\subjclass{the ams subject classification}
\keywords{your keywords}
\begin{abstract} your abstract \end{abstract}
\begin{resume} votre résumé \end{resume}
\maketitle
your text and your references
\end{document}
\end{verbatim}
1.1. Your private macros (the preamble)
Your private definitions must be placed between the \documentclass and the \begin{document} commands (the preamble), and at no other place. Definitions using the commands \newcommand, \renewcommand, \newenvironment and \renewenvironment should be used with an extreme care.
Sensible, restricted usage of private definitions is thoroughly encouraged. Large macro packages should be avoided when they are not used but for very few macros that can be isolated. Pasting macros borrowed from everywhere without needing them must certainly be avoided. Do not change existing environments commands or any part of standard \LaTeX{}. Never use macros that are mere abbreviations (e.g. \bt{} to replace \begin{theorem}) but use the facilities of your editor to minimize keystrokes. Intelligible comments of your macros are appreciated and may be useful.
Beware that deviations from these simple and sensible rules may cause inaccuracies and delays in the publication, or may even result in your \LaTeX{} file being discarded altogether, which implies traditional typesetting, hence costs and delays.
1.2. The top matter
The top matter consists of the information obtained from the commands
\begin{itemize}
\item \texttt{\title}
\item \texttt{\thanks}
\item \texttt{\author}
\item \texttt{\address}
\item \texttt{\date}
\item \texttt{\subjclass}
\item \texttt{\keywords}
\end{itemize}
and also from the\n
\begin{itemize}
\item \texttt{\begin{abstract}...\end{abstract}}
\item \texttt{\begin{resume}...\end{resume}}
\end{itemize}
environments. The following commands, when used, are also part of the top matter:
\begin{itemize}
\item \texttt{\runningtitle}
\item \texttt{\runningauthor}
\item \texttt{\sameaddress}
\item \texttt{\secondaddress}
\end{itemize}
these are described in section 2.3. All these commands must come before the \texttt{\maketitle} command, which indicates the end of the top matter.
1. Title and thanks. The title of your paper is given with the \texttt{\title} command.
The \texttt{\thanks} command is optional; their uses are summarized by
\texttt{\title{Measuring \ldots} \thanks{The P.T. Smith Laboratory} \thanks{NRR grant S30-A3x}}
Each \texttt{\thanks} produces superscripts (*), (**), etc. referring to a footnote. Note that it is used outside the \texttt{\title} command, not inside the \texttt{\title} command. There cannot be more than five thanks.
2. Authors and their addresses The full name of each author is given with the \texttt{\author} command. The \texttt{\address} command takes as its argument the address of one (or several) author(s) and is to be used optionally outside an \texttt{\author{...}} command to give the address of the author mentioned in the argument of \texttt{\author}. Their uses are summarized by the example:
\texttt{\author{John Smith} \address{University of \ldots}}
\texttt{\author{Paul Dupont} \address{Laboratoire \ldots}}
\texttt{\address} produces numeral superscripts \(^1\), \(^2\), etc. referring to footnotes. It sometimes happen that several authors have the same address, or that some authors have two addresses. These special cases are considered in section 2.3.
3. Dates Chronological data like \textit{Received march 1998, revised \ldots, etc.} will be added by the publisher. You may specify a date using the \texttt{\date} command, but if you do not, \texttt{cocv} automatically typeset \textit{“The dates will be set by the publisher”}.
4. Subject classes, keywords, abstract, résumé. Each of these items is mandatory; omitting any of them will result in an error message being typeset.
2. About the “body” of your paper
2.1. The environments
All theorem-like environments are numbered continuously from 1 upwards in each section. The following are defined, and these definitions should not be modified:
\begin{itemize}
\item \texttt{\theoremstyle{plain}}
\item \texttt{\newtheorem{thrm}[section]{Theorem}}
\item \texttt{\newtheorem{lmm}[thrm]{Lemma}}
\item \texttt{\newtheorem{crllr}[thrm]{Corollary}}
\item \texttt{\newtheorem{prpstn}[thrm]{Proposition}}
\item \texttt{\newtheorem{crtrn}[thrm]{Criterion}}
\item \texttt{\newtheorem{lgrthm}[thrm]{Algorithm}}
\end{itemize}
Each environment has a “\LaTeX-name” made of the consonants (lowercase) of the corresponding “natural name” (v.g. R e m a t k ↦ rmrk). Notice the numbering sequence below, produced by
\begin{prpstn}\label{abc} ... \end{prpstn}
\begin{thrm}[The rigidity of the category of sets] ... \end{thrm}
\begin{cnjctr} ... \end{cnjctr}
Proposition 2.1. Full sub-categories of \text{Set}_\text{fin}, the category of finite sets and maps, generated by two non empty and non isomorphic sets possess fixing-object endofunctors not isomorphic to the identity endofunctor.
Theorem 2.2 (The rigidity of the category of finite sets). In contrast to what is stated in Proposition 2.1, endofunctors of \text{Set}_\text{fin} fixing all objects are isomorphic to the identity endofunctor.
Conjecture 2.3 (The rigidity of the category of sets). Endofunctors of \text{Set} fixing all objects are isomorphic to the identity endofunctor.
Note that in Theorem 2.2 the reference to Proposition 2.1 is in normal text (roman font); this is always so, and it can be achieved using \Rref instead of \ref (we used \Rref{abc} in the text of the theorem). In an analogous manner, there is \Rpageref.
Proofs should begin with \begin{proof} and end with \end{proof}, and not with personal macros.
Theorem 2.4 (Brouwer). There exist irrational numbers \(h, k\) such that \(h^k\) is rational.
Proof. If \(\sqrt{2}^\pi\) is rational, there is nothing to prove. If \(\sqrt{2}^\pi\) is not rational, then consider \((\sqrt{2}^\pi)^\pi = \sqrt{2}^{\pi^2}\); again, there is nothing to prove! (Was there something to prove?)
The proof was typeset between \begin{proof} and \end{proof}.
2.2. Specific macros
Fixed mathematical “object”, “operators”, \textit{etc}. are usually typeset in roman (v.g. \cos, \sup, \textit{etc}). This should be the general rule, and the coccv class provides macros in this spirit; for example \xCzero yields \(\mathcal{C}^0\). These macros are:
\texttt{xCzero} \(\mapsto C^0\) \quad \texttt{xCone} \(\mapsto C^1\) \quad \texttt{xCtwo} \(\mapsto C^2\)
\texttt{xCinfty} \(\mapsto C^\infty\) \quad \texttt{xCn}\{p\} \(\mapsto C^p\)
\texttt{xHzero} \(\mapsto H^0\) \quad \texttt{xHone} \(\mapsto H^1\) \quad \texttt{xHtwo} \(\mapsto H^2\)
\texttt{xHinfty} \(\mapsto H^\infty\) \quad \texttt{xHn}\{p\} \(\mapsto H^p\)
\( L^0 \mapsto L^0 \) \( L^1 \mapsto L^1 \) \( L^2 \mapsto L^2 \)
\( L^\infty \mapsto L^\infty \) \( L^p \mapsto L^p \)
\( W^0 \mapsto W^1 \) \( W^2 \mapsto W^2 \)
\( W^\infty \mapsto W^\infty \) \( W^p \mapsto W^p \)
\( \ker u \mapsto \ker u \) \( \coker u \mapsto \coker u \)
\( \dim V \mapsto \dim V \) \( \codim V \mapsto \codim V \)
\( \operatorname{Hom}(X,Y) \mapsto \operatorname{Hom}(X,Y) \)
\( \operatorname{Ext}_{\Omega}(X,Y) \mapsto \operatorname{Ext}_{\Omega}(X,Y) \)
\( \operatorname{Tor}_{\varepsilon}^\Lambda(X,Y) \mapsto \operatorname{Tor}_{\varepsilon}^\Lambda(X,Y) \)
Of course, they may be used in display style if necessary: \[ \text{\displaystyle}\frac{\text{d}x_1}{\text{d}t_1} \] Recall that \( \dim \), \( \ker \) are already defined in \LaTeX, and may be used instead of \( \dim \) and \( \ker \) (given here for uniformity). The macro \( \im \) is for the image of a map, and \LaTeX provides \( \Re \) and \( \Im \) for the real and the imaginary parts of a complex number; \( \Re z \) and \( \Im z \) yield \( \Re z \) and \( \Im z \) respectively.
For the quaternions, the complex numbers, etc., \( \mathbb{H} \), \( \mathbb{C} \), \( \mathbb{R} \), \( \mathbb{Q} \), \( \mathbb{Z} \), \( \mathbb{N} \) yield respectively \( \mathbb{H} \), \( \mathbb{C} \), \( \mathbb{R} \), \( \mathbb{Q} \), \( \mathbb{Z} \), \( \mathbb{N} \). There is also \( \mathbb{P} \) and \( \mathbb{A} \) for \( \mathbb{P} \) and \( \mathbb{A} \) respectively. To use this font in some command, type (for example) \( \newcommand{\F}{\mathbb{F}} \); \( \F \mapsto \mathbb{F} \). Vectors should be in boldface: \( \mathbf{v} \).
### 2.3. Particular situations
1. **Several authors for one address.** It frequently happens that two or more authors come from a same institution; their addresses are the same (except for their e-mail). In this case, use the \texttt{\sameaddress} command; its use is described in an example with the \texttt{\secondaddress} command below.
2. **Two addresses for one author.** Some authors have two academic addresses; in this case, they may use the \texttt{\secondaddress} command. The uses of \texttt{\sameaddress} and \texttt{\secondaddress} is better explained with an example (this paper itself!):
\begin{verbatim}
\author{Author One}
\address{Department of Theoretical Physics, University of ... ; \email{author.one@...} \& \email{author.three@...}}
\secondaddress{The Royal Academy of ... }
\author{Author Two}
\address{Institute for Fundamental ... ; \email{author.two@...}}
\author{Author Three}
\sameaddress{2} \secondaddress{The GLM Laboratories, ... }
\end{verbatim}
Observe that: (1) \texttt{\address} and \texttt{\secondaddress} have an argument which is an address; like the \texttt{\address} command, \texttt{\secondaddress} produces numeral superscripts \( 1, 2, \) etc. referring to footnotes; (2) the argument of the \texttt{\sameaddress} command is an integer; it is the responsibility of the authors to give it its right value upon typesetting the document.
3. **Running title.** The argument of the \texttt{title} command automatically becomes the running title, unless you specify a running title using the \texttt{runningtitle} command. The \texttt{title} and \texttt{runningtitle} commands work as follows: if the title is too long and you do not specify a running title, the running head of odd pages will be
YOUR TITLE IS TOO LONG TO BE A RUNNING TITLE; USE THE \texttt{runningtitle} COMMAND.
In this case, you must use the \texttt{runningtitle} command:
\texttt{runningtitle{Measuring ...}}
4. **Running authors.** When the list of all authors is too long for the running head, use the \texttt{runningauthors} command. The \texttt{author} and \texttt{runningauthors} command work as follows: if the list of all authors is too long, the running head of even pages will be
THE LIST OF AUTHORS IS TOO LONG TO BE IN THE RUNNING HEAD; USE THE \texttt{runningauthors} COMMAND.
If so use the \texttt{runningauthors} command with a shorter list of authors. The latin abbreviation \texttt{et al.} (\texttt{et al}) may be used as in “J. Smith \textit{et al.}” (\textit{v.g.} \texttt{runningauthors{J. Smith \textit{et al.}}}).
The command \texttt{et al} is defined as well as \texttt{cf, ie, etc, apriori, afortiori, vg and loccit; note that the period after “etc” is not produced by \texttt{etc} (to allow for “etc).” as at the end of the first paragraph of this document), and that \texttt{etc} is never followed by “... “. These latin abbreviation commands should not be changed; they must generally be followed by a pair of empty braces ({} ) when they are followed by a space.
2.4. **Including postscript files**
There are several packages used to include postscript files. For the journal, authors are kindly asked to use the graphicx package by D.P. Carlisle and S.P.Q. Rahtz (it is most likely already in your \TeX{} distribution).
For a full documentation on this package, see [5], and more generally, for including postscript files, see [1].
First, you preamble must contain the line \texttt{usepackage{graphicx}}. Let us suppose that you have an \texttt{eps} file called \texttt{circl.eps}; the lines below produce figure 1.
\begin{verbatim}
\begin{figure}
\centering \includegraphics[height=0.2\textwidth]{circl.eps}
\quad \includegraphics[height=0.2\textwidth, angle=39]{circl.eps}
\caption{To illustrate the use of the graphicx package}
\end{figure}
\end{verbatim}
\begin{figure}
\centering \includegraphics[height=0.2\textwidth]{circl.eps}
\quad \includegraphics[height=0.2\textwidth, angle=39]{circl.eps}
\caption{To illustrate the use of the graphicx package}
\end{figure}
2.5. Acknowledgements
There is an environment \begin{acknowledgement} \ldots \end{acknowledgement}; it may be used immediately before the bibliography to express your acknowledgements.
\begin{acknowledgement}
The first authors is thankful for support.
\end{acknowledgement}
Thanks (\thanks) are generally reserved for thanking institutions, “acknowledgements” for thanking persons.
2.6. Cross references and bibliography
Authors should in all cases use the \label, \ref, \pageref, \cite, \ldots commands and no “plain numbers”. Every numbered part to which one wants to refer to should be labeled with a \label{\ldots}, but unreferenced parts (sections, equations, figure, etc.) should not have a \label{\ldots}. For multiple citations, do not use \cite{A1}, \cite{A2}, but \cite{A1,A2} instead.
There are two ways to produce literature references: either using the environment \thebibliography or using BiB\TeX (see \[2, 4\]); in all cases, your references must appear as numbers: (\textit{v.g.:} use \bibitem{abc} and not \bibitem[xyz]{abc}, \textit{i.e.} do not give the optional argument to \bibitem). Do not use a “hand-made” bibliography.
REFERENCES
|
{"Source-Url": "http://ftp.edpsciences.org/pub/cocv/userguide.pdf", "len_cl100k_base": 4702, "olmocr-version": "0.1.50", "pdf-total-pages": 7, "total-fallback-pages": 0, "total-input-tokens": 23972, "total-output-tokens": 5564, "length": "2e12", "weborganizer": {"__label__adult": 0.00037288665771484375, "__label__art_design": 0.0026340484619140625, "__label__crime_law": 0.0004837512969970703, "__label__education_jobs": 0.0517578125, "__label__entertainment": 0.0003705024719238281, "__label__fashion_beauty": 0.00033164024353027344, "__label__finance_business": 0.0013551712036132812, "__label__food_dining": 0.00044798851013183594, "__label__games": 0.00110626220703125, "__label__hardware": 0.0013332366943359375, "__label__health": 0.0008697509765625, "__label__history": 0.0010328292846679688, "__label__home_hobbies": 0.0004754066467285156, "__label__industrial": 0.000941753387451172, "__label__literature": 0.0027599334716796875, "__label__politics": 0.0004911422729492188, "__label__religion": 0.0009412765502929688, "__label__science_tech": 0.348388671875, "__label__social_life": 0.0005412101745605469, "__label__software": 0.1385498046875, "__label__software_dev": 0.44384765625, "__label__sports_fitness": 0.0003745555877685547, "__label__transportation": 0.0004754066467285156, "__label__travel": 0.0003056526184082031}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 17175, 0.01836]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 17175, 0.58801]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 17175, 0.79037]], "google_gemma-3-12b-it_contains_pii": [[0, 1325, false], [1325, 4042, null], [4042, 7158, null], [7158, 9465, null], [9465, 12528, null], [12528, 15170, null], [15170, 17175, null]], "google_gemma-3-12b-it_is_public_document": [[0, 1325, true], [1325, 4042, null], [4042, 7158, null], [7158, 9465, null], [9465, 12528, null], [12528, 15170, null], [15170, 17175, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 17175, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 17175, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 17175, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 17175, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 17175, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 17175, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 17175, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 17175, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 17175, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 17175, null]], "pdf_page_numbers": [[0, 1325, 1], [1325, 4042, 2], [4042, 7158, 3], [7158, 9465, 4], [9465, 12528, 5], [12528, 15170, 6], [15170, 17175, 7]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 17175, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-01
|
2024-12-01
|
f5e2c4a0ac3f18d6b99af5409c90fb9cb886b276
|
Incremental ASR, NLU and Dialogue Management in the Potsdam INPRO P2 System
Timo Baumann, Michaela Atterer, Okko Buss
IVI Workshop, Bielefeld, 2009-06-08
Context:
Spoken Dialogue Systems
ASR
NLU
dialogue manager
history
domain
TTS
visual output
response generator
[Diagram showing the components of a spoken dialogue system, including ASR, NLU, dialogue manager, history, domain, TTS, and visual output.]
Context: Spoken Dialogue Systems
ASR
NLU
dialogue manager
history
domain
response generator
TTS
visual output
domain
Context:
Spoken Dialogue Systems
Context: Spoken Dialogue Systems
- no reaction before the user finishes talking
Context: **Incremental**
Spoken Dialogue Systems
- **partial results** are being processed immediately
- reaction is quicker, back-channels are possible
Incremental Spoken Dialogue Systems
- **Part 1:** Timo
- ASR
- Dialogue Manager
- NLU
- TTS
- Visual output
- **Part 2:** Michaela
- Partial results are being processed immediately
- Reaction is quicker, back-channels are possible
- **Part 3:** Okko
- History
- Domain
**Context:** Incremental
Context: **Incremental**
Spoken Dialogue Systems
Assessing and Improving Speech Recognition for Incremental SDS: Measures & Methods
Part 1: Timo
Baumann et al., 2009
A Real-World Example of Incremental ASR Hypotheses
- ASR hypotheses change with time (open movie)
A Real-World Example of Incremental ASR Hypotheses
- ASR hypotheses change with time
- more edit than necessary $\rightarrow$ overhead $\sim 90\%$
- 90% of a consumers work will be useless
A Real-World Example of Incremental ASR Hypotheses
- ASR hypotheses change with time
- more edit than necessary $\rightarrow$ overhead $\sim 90\%$!
A Real-World Example of Incremental ASR Hypotheses
- ASR hypotheses change with time
- more edit than necessary → overhead ~ 90%!
- reduce overhead, sacrifice some timeliness
Patience, Young Jedi! Waiting helps
which edits should we trust?
A Real-World Example of Incremental ASR Hypotheses
- ASR hypotheses change with time
- more edit than necessary \( \rightarrow \) overhead \( \sim \) 90\%
- reduce overhead, sacrifice some timeliness
Software from Malsburg et al., submitted
which edits
waiting helps
A Reduced Example
- $w_{hyp_t}$ is the word sequence hypothesized at time $t$
- two dimensions:
- time we reason about: $\rightarrow$
- time we reason at: $\downarrow$
- $w_{gold}$ is final hypothesis
Change Measure
- changes on the right
- *add*, *delete* or *revise*
- ideally: one *add* per word
- in fact: **edit overhead**
$$\text{EO} = \frac{|\text{unnecessary edits}|}{|\text{edits}|}$$
Change Measure
ideally: 3 edits
actually: 11 edits
unwanted: 8 edits
EO: 8/11 = 72 %
Edits are bad:
- edits lead to unnecessary processing of a consumer
- less edits mean less processing
→ we would like to **reduce the edit overhead**
→ by **deferring** or **suppressing** edits
- deferring edits leads to delays, deteriorating *timing measures* …
Measuring Timing
• when do we find out about a word?
▪ word first correct: WFC
• when do we become certain about a word?
▪ word first final: WFF
• this is per word
→ averages are important
Measuring Timing
- when do we find out about a word?
- word first: WFC
- when do we become certain about a word?
- word final: WFF
- this is per word
- averages are important
Timing Measures
- depending on the use-case we may care for …
- if we want to assume as soon as possible $\rightarrow$ low first
- if we want to know as soon as possible $\rightarrow$ low final
- deferring edits means two things:
- worse first timings
(as the lag passes through)
- less increase in final timings,
(if we eliminate wrong edits)
Certainty Considerations
- the correction time for a word is \( \text{WFF} - \text{WFC} \)
- 58.6% of all words are immediately correct
- we can calculate the degree of certainty for given hypothesis ages
- e.g. if a correct hyp. lasts for 0.55s, we can be certain (95%) that it will not change anymore
Improving Incremental ASR
- our primary goal is to reduce edit overhead
- ... by deferring or suppressing edits
- deferring edits will always hurt first timings
- less impact on final timings
- the final (non-incremental) result does not change
→ only trust older parts of hyps. (Right Context)
→ only trust older edits (Message Smoothing)
Right Context to Improve Incremental Performance
- much jitter is at the right end of the hypotheses
- at time $t$ only evaluate $hyp_t$ up to $t - \Delta$
- we need to take this into account for correctness:
- $fair$ r-correct: $w_{hyp_{t-\Delta}} = w_{gold_{t-\Delta}}$
- $first$ increases with $\Delta$, $final$ increases $\leq \Delta$
- we can predict the future with negative $\Delta$
- e.g. fair r-correctness down 50% at 100ms in the future
Message Smoothing to Improve Incremental Performance
• most bad edits only last for a short while
▪ "zwei" → "zwar" → "zwei"
→ hold back edits until they reach a certain age
▪ only output if they don't die before maturing
• multiple short edits of a word may delay messages:
▪ **first** may grow without fixed bounds occasionally
▪ probable resolution/mitigation: **future work**
allow for some kind of "majority smoothing"
Right Context vs. Smoothing
EO parity (50%)
EO
Correctness
Fixed Lag
Smoothing
delay in s (scale shows larger right contexts towards the left)
**Right Context vs. Smoothing**
**Right Context:**
- 530 ms
- Bounded ($\leq 530$)
- Timing increase
**Smoothing:**
- 110 ms window
- Low (+140/67 ms)
- Timing increase
**EO parity (50%)**
Delay in s (scale shows larger right contexts towards the left)
Spoken Dialogue Systems
Part 2: Michaela
Incremental Natural Language Understanding
Incremental NLU in INPRO P2
- RUBISC: Robust Unification-Based Incremental Semantic Chunker (SRSL 2009)
- Incremental Probabilistic Reference Resolver (submitted)
RUBISC: Incremental Chunking with Semantic Chunks
- Chunks based on semantic content rather than syntax
- Inspired by the notion of sense units (Selkirk, 1984)
- φ-phrases: consist of head and all its specifiers/head and all the material on the non-recursive side of the head up to the next head outside of its maximal projection (Nespor and Vogel, 1986)
- Sense units: up to head; semantic chunks: up to semantically relevant material
Domain (revisited)
- Actions:
- grasp, turn, flip, move
- Objects:
- w, cross, ...
- End positions
- head, leg, ...
Incremental Chunking
**Input:**
- turn
- erm
- the
- piece
- erm
- the
- second
- in
- the
- upper
- row
- to
- erm
- clockwise
**Chunk:**
- [turn]
- erm
- erm the
- piece
- piece
- the
- the
- second
- in
- in the
- upper
- row
- to
- to
- to
- erm
- [to erm clockwise]
**Semantics:**
- action: turning
- end: --
- object: [name: --
xpos: --
ypos: --]
- action: turning
- end: --
- object: [name: --
xpos: 2
ypos: --]
- action: turning
- end: --
- object: [name: --
xpos: 2
ypos: 1]
- action: turning
- end: right
- object: [name: --
xpos: 2
ypos: 1]
Grammar
@:action
@:entity:name
@:entity:xpos
@:entity:ypos
@:end
action:flipping-> spieg(le|el) \{flip\}
action:grasping,end:empty -> nimm|nehme \{take\}
entity:name:x -> kreuz|plus|((das|ein) x) \{cross|plus|((the|an) x)}
end:horizontal,action:flipping -> horizontal \{horizontally\}
Slot Unification
- time:
- Input:
- [schieb]
- das
- das mh
- [das mh horizontal]
- liegt
- liegt ins
- [liegt ins Vorderbein]
- unification component:
- unify frame with
- [action:movement]
- →success:
- unify frame with
- [action:flipping]
- end:horizontal
- →failed:
- unify frame with
- [end:leg1]
- →success:
- Frame:
- action:–
- end:–
- ...
- action:movement
- end:–
- ...
- action:movement
- end:–
- ...
- action:movement
- end:leg1
- ...
...
Schieb das Kreuz in den Kopf des Tieres, das wie ein Elefant ...
Push the cross into the head of the animal, which looks like....
Atterer, Baumann, Schlangen (Coling 2008): Syntactic features: don't know if sentence has ended
Atterer & Schlangen (SRSL 2009): Chunker state: 3 slots filled:
action: movement
object: cross
end: head
-> can react, barge in etc
Implementation
- OAA-agent
- Supports: add, revoke, commit
- Evaluation: 55% frames correct, 87% slots correct
Incremental Reference Resolver
- Complementary agent to chunker
- Bayesian believe update model which treats the intended referent as a latent variable generating a sequence of observations ($w_{1:n}$ is the sequence of words $w_1, w_2, \ldots, w_n$):
$$P(r|w_1,\ldots,w_n) = \alpha \times P(w_n|r, w_1,\ldots,w_{n-1}) \times P(r|w_1,\ldots,w_{n-1})$$
Reference Resolution -- Disfluencies
• Psycholinguistic evidence: more hesitations when describing something hard (Tanenhaus et al., 1995; Brennan & Schober, 2001; Bailey & Ferreira, 2007; Arnold et al., 2007)
• Include (filled) pauses into our language model
Probabilistic Reference Resolution
- OAA agent demo:
Probabilistic Reference Resolution
- Add 'nimm':
```
simple:
x
w
hard:
f
n
y
```
![Bar Chart Image]
Probabilistic Reference Resolution
- Add 'das':
```
simple:
x
w
hard:
f
n
y
```


Probabilistic Reference Resolution
- Add '<sil>':
simple:
x
w
hard:
f
n
y
• Add 'm':
```
simple:
\[ x \]
\[ w \]
hard:
\[ f \]
\[ n \]
\[ y \]
```
Probabilistic Reference Resolution
- Revoke 'm':
```
simple:
x
w
hard:
f
n
y
```

## Reference Resolution - Evaluation
- **N-best approach:** select all pieces above a threshold
<table>
<thead>
<tr>
<th></th>
<th>hes</th>
<th>no hes</th>
</tr>
</thead>
<tbody>
<tr>
<td>Last belief correct:</td>
<td>55%</td>
<td>54%</td>
</tr>
<tr>
<td>When correct?</td>
<td>88%</td>
<td>85%</td>
</tr>
<tr>
<td>correct during silences:</td>
<td>37%</td>
<td>31%</td>
</tr>
</tbody>
</table>
(Schlangen, Atterer, Baumann (submitted))
Context: **Incremental**
Spoken Dialogue Systems
Part 3: Okko
Dialogue Manager
Overview
- Receives incremental add/revoke/commit messages from acoustic, ASR and NLU components and allows in- utterance processing.
- Handles timeouts for different kinds of dialogue acts to define behaviour (domain-independent interaction management/dialog skills).
- Delegates actions across modalities via Action Manager
## Dialogue Manager
### Incremental vs transaction-based DM (1)
<table>
<thead>
<tr>
<th>Incremental</th>
<th>Transaction-based</th>
</tr>
</thead>
<tbody>
<tr>
<td>• Events are handled asynchronously.</td>
<td>• Events are handled sequentially.</td>
</tr>
<tr>
<td>• All components are always active, no blocking control.</td>
<td>• Single component has control.</td>
</tr>
<tr>
<td>• Dialogue state and timeouts must vary dynamically.</td>
<td>• Static property set.</td>
</tr>
</tbody>
</table>
Dialogue Manager
Incremental vs transaction-based DM (2)
Transaction-based dialog timeouts
Timers:
- Timeout
- Silence
- Maxspeech
- Silence
User:
- "Take the um..."
- "X-shaped one"
Semantics:
- \{action:-\}
- \{action:'take'\}
System:
- "Which piece?"
- "<takes the X>"
Dialog Manager
Incremental Timers & States (1)
- **Timers**
- **maxspeech**
- Cuts off talk that leads nowhere
- **silence**
- Has settings for types of silence correlating to dialog states
- **States**
- **preUtterance**
- **noContent**
- **partialContent**
- **fullContent**
Dialog Manager
Incremental Timers & States (2)
**system:** Which piece? **preUtterance timer**
**user:** <silence>
**system:** Which piece? **preUtterance timer**
**user:** <silence> Erm, yes let's see...
**system:** Which piece? **noContent timer**
**user:** <silence> Erm, yes let's see...
**system:** Which piece? **noContent timer**
**user:** Let's see... take the erm...
**system:** Which piece? **noContent timer**
**user:** Let's see... take the erm...
**system:** Which piece? **partialContent timer**
**user:** Let's see... take the erm...
**system:** Which piece? **fullContent timer**
**user:** Let's see... take the erm...
**system:** Which piece? **fullContent timer**
**user:** Let's see... take the erm...
**system:** Which piece? **fullContent timer**
**user:** Let's see... take the erm...
**system:** Which piece? **fullContent timer**
**user:** Let's see... take the erm...
**system:** Ok! **fullContent timer**
**user:** x-shaped piece
Dialogue Manager
Incremental vs transaction-based DM (3)
Incremental dialog timeouts
user
system
semantics
timers
maxspeech
preUtterance
inUtterance(1)
inUtterance(2)
postUtterance
And now?
Which piece?
Ok.
<takes the X>
And now?
{action:-
piece:-}
{action:'take'
piece:-}
{action:'take'
piece:'x'}
Take the um...
X-shaped one
{action:-
piece:-}
• Incremental dialog management has the ability to:
▪ process user input before end of utterance.
▪ reset timers and thresholds during utterance.
▪ issue clarification requests mid-utterance.
▪ enable backchannel utterances/dialog acts.
Dialogue Manager
Incremental DM State Chart
preUtterance State
- onEntry: Prompt
- onEntry: start silenceTimer[preUtterance]
- onTimeout: Reprompt
- onExit: stop timer
noContent State
- onEntry: start silenceTimer[inUtterance]
- onEntry: start uselessTalkTimer[noSem]
- onTimeout: Reprompt
- onExit: stop timer
fullContent State
- onEntry: start silenceTimer[postUtterance]
- onTimeout: performAction
partialContent State
- onEntry: start silenceTimer[inUtterance]
- onEntry: start uselessTalkTimer[Sem]
- onTimeout: Reprompt
- onExit: stop timer
Synchronization:
- ASR/VAD
- Silence
- Prosody (final)/Chunker (frame)
- Chunker/revoke
Dialog Management
Action Management
- Action Management delegates output to GUI and speech production modalities.
- Aware of status of output modalities (busy/idle), can choose free modality if a dialog act can be embodied in either.
Summing Up
Incremental component features
ASR
Optimization of Incr. Output
NLU
Robust Incr. Chunking, Hesitation sensitive Incr. Statistical RefRes
TTS
visual output
response generator
dialogue manager
status aware, Dynamic modalities
Dynamic thresholds for dialogue states, Backchannel
history
domain
Thank You!
Acknowledgements:
David Schlangen
DFG for funding (Emmy Noether programme)
Transaction-based timeouts (from VXML)
Timers
- Timeout
- Incomplete
- Maxspeech
- Complete
User
- {action:- piece:-}
Semantics
- {action:'take' piece:'x'}
System
- (prompts)
- (responds)
|
{"Source-Url": "https://nats-www.informatik.uni-hamburg.de/pub/User/TimoBaumann/Publications/bielefeldIVI.pdf", "len_cl100k_base": 4195, "olmocr-version": "0.1.53", "pdf-total-pages": 57, "total-fallback-pages": 0, "total-input-tokens": 81967, "total-output-tokens": 6426, "length": "2e12", "weborganizer": {"__label__adult": 0.0004315376281738281, "__label__art_design": 0.0008373260498046875, "__label__crime_law": 0.00041747093200683594, "__label__education_jobs": 0.0010585784912109375, "__label__entertainment": 0.0003306865692138672, "__label__fashion_beauty": 0.00017261505126953125, "__label__finance_business": 0.0002129077911376953, "__label__food_dining": 0.0002930164337158203, "__label__games": 0.0010938644409179688, "__label__hardware": 0.001255035400390625, "__label__health": 0.0005383491516113281, "__label__history": 0.00026917457580566406, "__label__home_hobbies": 5.429983139038086e-05, "__label__industrial": 0.0004100799560546875, "__label__literature": 0.0007123947143554688, "__label__politics": 0.0003273487091064453, "__label__religion": 0.0005502700805664062, "__label__science_tech": 0.0809326171875, "__label__social_life": 0.00013720989227294922, "__label__software": 0.042327880859375, "__label__software_dev": 0.86669921875, "__label__sports_fitness": 0.0002770423889160156, "__label__transportation": 0.0003390312194824219, "__label__travel": 0.00016999244689941406}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 14720, 0.009]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 14720, 0.38014]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 14720, 0.73475]], "google_gemma-3-12b-it_contains_pii": [[0, 155, false], [155, 415, null], [415, 541, null], [541, 574, null], [574, 655, null], [655, 810, null], [810, 1126, null], [1126, 1295, null], [1295, 1394, null], [1394, 1586, null], [1586, 1735, null], [1735, 1978, null], [1978, 2249, null], [2249, 2455, null], [2455, 2650, null], [2650, 2739, null], [2739, 3009, null], [3009, 3207, null], [3207, 3393, null], [3393, 3755, null], [3755, 4059, null], [4059, 4408, null], [4408, 4863, null], [4863, 5302, null], [5302, 5451, null], [5451, 5708, null], [5708, 5794, null], [5794, 5958, null], [5958, 6395, null], [6395, 6518, null], [6518, 7092, null], [7092, 7380, null], [7380, 7938, null], [7938, 8305, null], [8305, 8417, null], [8417, 8771, null], [8771, 9033, null], [9033, 9087, null], [9087, 9201, null], [9201, 9375, null], [9375, 9466, null], [9466, 9541, null], [9541, 9668, null], [9668, 10039, null], [10039, 10103, null], [10103, 10449, null], [10449, 11076, null], [11076, 11353, null], [11353, 11652, null], [11652, 12630, null], [12630, 13006, null], [13006, 13251, null], [13251, 13891, null], [13891, 14127, null], [14127, 14441, null], [14441, 14529, null], [14529, 14720, null]], "google_gemma-3-12b-it_is_public_document": [[0, 155, true], [155, 415, null], [415, 541, null], [541, 574, null], [574, 655, null], [655, 810, null], [810, 1126, null], [1126, 1295, null], [1295, 1394, null], [1394, 1586, null], [1586, 1735, null], [1735, 1978, null], [1978, 2249, null], [2249, 2455, null], [2455, 2650, null], [2650, 2739, null], [2739, 3009, null], [3009, 3207, null], [3207, 3393, null], [3393, 3755, null], [3755, 4059, null], [4059, 4408, null], [4408, 4863, null], [4863, 5302, null], [5302, 5451, null], [5451, 5708, null], [5708, 5794, null], [5794, 5958, null], [5958, 6395, null], [6395, 6518, null], [6518, 7092, null], [7092, 7380, null], [7380, 7938, null], [7938, 8305, null], [8305, 8417, null], [8417, 8771, null], [8771, 9033, null], [9033, 9087, null], [9087, 9201, null], [9201, 9375, null], [9375, 9466, null], [9466, 9541, null], [9541, 9668, null], [9668, 10039, null], [10039, 10103, null], [10103, 10449, null], [10449, 11076, null], [11076, 11353, null], [11353, 11652, null], [11652, 12630, null], [12630, 13006, null], [13006, 13251, null], [13251, 13891, null], [13891, 14127, null], [14127, 14441, null], [14441, 14529, null], [14529, 14720, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 14720, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 14720, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 14720, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 14720, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 14720, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 14720, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 14720, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 14720, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 14720, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 14720, null]], "pdf_page_numbers": [[0, 155, 1], [155, 415, 2], [415, 541, 3], [541, 574, 4], [574, 655, 5], [655, 810, 6], [810, 1126, 7], [1126, 1295, 8], [1295, 1394, 9], [1394, 1586, 10], [1586, 1735, 11], [1735, 1978, 12], [1978, 2249, 13], [2249, 2455, 14], [2455, 2650, 15], [2650, 2739, 16], [2739, 3009, 17], [3009, 3207, 18], [3207, 3393, 19], [3393, 3755, 20], [3755, 4059, 21], [4059, 4408, 22], [4408, 4863, 23], [4863, 5302, 24], [5302, 5451, 25], [5451, 5708, 26], [5708, 5794, 27], [5794, 5958, 28], [5958, 6395, 29], [6395, 6518, 30], [6518, 7092, 31], [7092, 7380, 32], [7380, 7938, 33], [7938, 8305, 34], [8305, 8417, 35], [8417, 8771, 36], [8771, 9033, 37], [9033, 9087, 38], [9087, 9201, 39], [9201, 9375, 40], [9375, 9466, 41], [9466, 9541, 42], [9541, 9668, 43], [9668, 10039, 44], [10039, 10103, 45], [10103, 10449, 46], [10449, 11076, 47], [11076, 11353, 48], [11353, 11652, 49], [11652, 12630, 50], [12630, 13006, 51], [13006, 13251, 52], [13251, 13891, 53], [13891, 14127, 54], [14127, 14441, 55], [14441, 14529, 56], [14529, 14720, 57]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 14720, 0.01887]]}
|
olmocr_science_pdfs
|
2024-12-11
|
2024-12-11
|
f071ae2391e44864e6d0bf1db47cc1c99ee56ec4
|
FT-GReLoSSS: a Skeletal-Based Approach towards Application Parallelization and Low-Overhead Fault Tolerance
Constantinos Makassikis, Stéphane Vialle, Xavier Warin
To cite this version:
Constantinos Makassikis, Stéphane Vialle, Xavier Warin. FT-GReLoSSS: a Skeletal-Based Approach towards Application Parallelization and Low-Overhead Fault Tolerance. 20th Euromicro International Conference on Parallel, Distributed and Network-Based Computing - PDP 2012, Feb 2012, Garching, Germany. 8 p., 2012. <hal-00681664>
FT-GReLoSSS: a Skeletal-Based Approach towards Application Parallelization and Low-Overhead Fault Tolerance
Constantinos Makassikis
Université Henri Poincaré & AlGorille INRIA Project Team
France
Email: Constantinos.Makassikis@loria.fr
Stéphane Vialle
SUPELEC - UMI-2958 & AlGorille INRIA Project Team
France
Email: Stephane.Vialle@supelec.fr
Xavier Warin
EDF R&D & OSIRIS group
France
Email: Xavier.Warin@edf.fr
Abstract—FT-GReLoSSS (FTG) is a C++/MPI framework to ease the development of fault-tolerant parallel applications belonging to a SPMD family termed GReLoSSS. The originality of FTG is to rely on the MoLOToF programming model principles to facilitate the addition of an efficient checkpoint-based fault tolerance at the application level. Main features of MoLOToF encompass a structured application development based on fault-tolerant “skeletons” and lay emphasis on collaborations. The latter exist between the programmer, the framework and the underlying runtime middleware/environment. Together with the structured approach they contribute into achieving reduced checkpoint sizes, as well as reduced checkpoint and recovery overhead at runtime. This paper introduces the main principles of MoLOToF and the design of the FTG framework. To properly assess the framework’s ease of use for a programmer as well as fault tolerance efficiency, a series of benchmarks were conducted up to 128 nodes on a multicore PC cluster. These benchmarks involved an existing parallel financial application for gas storage valuation, originally developed in collaboration with EDF company, and a rewritten version which made use of the FTG framework and its features. Experiments results display low-overhead compared to existing system-level counterparts.
Keywords—distributed fault tolerance; application-level checkpointing; SPMD paradigm; framework; skeletons
I. INTRODUCTION
As a result of increased competition, many industries have strived for new, more accurate simulation models. Their design, assessment and exploitation often requires huge amounts of computational power which eventually led those industries to adopt high performance distributed systems (HPDS).
In many cases, computations may be broken into several independent parts which can straightforwardly exploit HPDS. However, not all computations fit efficiently the embarrassingly parallel computation model. Programmers with little parallel background face three major issues. Firstly, they need to learn how to make their applications run efficiently on HPDS. Secondly, as the probability of failure increases with the number of computational resources (or nodes) used, developed applications have to be robust and fault-tolerant. Finally, HPDS systems involve rapidly evolving hardware and software which compels the use of portable fault tolerance (FT) solutions. Efficiency of these solutions is not an option as industrial environments are subject to time constraints: for example, some long-running applications in financial institutions are run overnight, and their results are expected in the morning in order to decide on the daily strategy to follow. Hence, FT efficiency translates into little slowdown of applications during failure-free time intervals. In case of failure, it translates into little wasted work and short restart times.
Checkpointing is a widely spread FT technique which consists in periodically saving the application state to stable storage. Following a failure, application execution is interrupted and the most recent saved state is then used to resume execution. This paper presents FTG, a specialized framework derived from the MoLOToF programming model [1]. MoLOToF aims to facilitate the development of efficient parallel applications and their endowment with efficient application-level checkpointing.
After covering related works (Section II), we describe the MoLOToF programming model and the software architecture of the FTG programming framework (Sections III and IV). Ease of development is assessed through the use of FTG on an existing industrial application for gas storage valuation from EDF company (Section V). Finally, the efficiency of the approach is evaluated experimentally (Section VI) before concluding (Section VII).
II. RELATED WORKS
Existing FT research for message passing applications has focused a lot on transparency. By combining a sequential checkpointer (e.g.: BLCR [2], MTCP [3] …) and some rollback recovery (RR) protocol, it was possible to endow existing MPI libraries such as OpenMPI [4] or MPICH [5] with transparent FT or to provide more general solutions such as DMTCP [6] for socket-based distributed applications. RR protocols ensure that individual checkpoints of MPI processes remain consistent despite interdependencies created by communications: they form a recovery line. Most available solutions implement a so called blocking RR protocol which “freezes” communications while a checkpoint is made.
MPICH-V [5] is the exception, for it implements several other RR protocols. From our experience with the OpenMPI-BLCR pair or DMTCP, such solutions yield bulky checkpoint files, and are very sensitive to changes of the underlying runtime system. As a result of including too much system-dependent information, issues are often raised as the system is updated.
C³ [7] and CPPC [8] strive for similar levels of transparency to the user, but at the application level. By leveraging source-to-source compilers, source code of C/Fortran MPI applications is automatically transformed such as the resulting application can checkpoint and restart itself. Besides unburdening the user from non-trivial source code transformations, this approach benefits from high portability for it works at the application level. Many legacy and recent applications written in C/Fortran can benefit from this approach. However, providing similar transformations is challenging for languages such as C++ which is commonly used in many applications.
On the other end, FT can be tackled manually. Though not clearly stated in the literature, the manual approach to FT is not unusual. Admittedly, the approach is tedious even with the aid of third-party libraries (e.g., TCS [9], SCR [10] checkpointing libraries). Nevertheless, resulting FT is very efficient and portable, and the user may improve it further based on his knowledge of the application. For production applications, the efficiency gained quickly outweighs the endeavour.
Finally, users can rely upon frameworks to achieve FT. PUL-RD [11] and Cactus [12] are examples where users are subject to some programming constraints in exchange of which they benefit among others from FT. Compared to the previous two approaches, frameworks also facilitate writing parallel applications. As a framework, FTG shares similarities with PUL-RD and Cactus as far as the parallelization model is concerned. All three involve iterative calculations with two array datastructures, swapped at the end of each iteration. FTG supports applications with non-trivial distribution of calculations among processes. It differs by relying on a specific programming model for fault tolerance named MoLOToF. The introduction of fault-tolerant skeletons yields an explicit structuration of the application, which in turn provides a simple, yet efficient, way to endow applications with FT. Hence, users are led to “actively” interact with the framework. Our fault-tolerant skeletons are inspired by the skeleton programming approach, and are designed at lower level. Hence they should be named “sub-skeletons” (or “low-level skeletons”). But for simplicity, in the rest of this paper we call them “skeletons”.
III. MoLOTOF PROGRAMMING MODEL FOR FT
MoLOTOF (Model for Low-Overhead Tolerance of Faults) is a programming model geared towards easing the development of fault-tolerant parallel applications. MoLOTOF relies (1) on a peculiar structuring of the application and (2) on establishing collaborations through inter-action functionalities between the programmer, the framework and the underlying environment. To achieve these, MoLOTOF introduces the concept of fault-tolerant skeletons. The latter are structured pieces of code endowed with fault-tolerant properties. Usually, they are made of fault-tolerant loops each of which has the ability to save and restore itself. As illustrated in fig. 1, a typical loop body contains calculation, and possibly communication phases (l. 5-6). Checkpoint definition (l. 7) within the loop allows to save calculations and related application state.
A. Skeleton-based code structuring
Using fault-tolerant skeletons, the application is split into two broad types of code operations: heavy and light operations. Heavy operations correspond to time-consuming code. Such code is usually found within calculation and communication phases of a skeleton. Light operations designate every other piece of code which is really fast to reexecute, and hence not interesting to checkpoint. Such separation results in a straightforward save/restore (checkpointing) mechanism based on application reexecution. To illustrate the mechanics, let us assume an application made of a single skeleton as the one in fig. 1. As represented in fig. 2, the application comprises an initialization phase, a skeleton and a cleanup phase.
During normal application execution (cf. Fig. 3), checkpointing occurs whenever a checkpoint location and a checkpoint condition are met. In our example, a checkpoint occurs on the second iteration. Among saved data is the iterator’s value (i.e.: 2). Consistency of individual checkpoints is ensured by some adapted RR protocol. An application executes until it quits gracefully or until a failure occurs. In our example it fails somewhere during communications of the third iteration.
After the detection of a failure (cf. Fig. 4), the application is restarted from its most recent recovery line: here, the checkpoint taken at iteration 2. The application enters recovery mode (cf. “restarting:true” in fig. 4). Namely, each process restarts from the very beginning as in its initial run till it reaches the checkpoint location where the checkpoint it is supposed to restart from was achieved. During this course, only light operations are reexecuted therefore resulting in fast restarts. When reaching the appropriate checkpoint location, application context is restored. To complete recovery, checkpoint file contents are loaded back into the application, which can then normally resume its execution: the application falls back into normal execution mode (cf. “restarting:false” in fig. 4) and resumes with the third iteration.
B. Collaborations
To ease parallel programming, skeletons enclose a parallelization paradigm and come usually as part of a specialized framework. Through their use, the programmer easily develops his parallel application and installs checkpoint/restart semantics in it. Further involvement of the user may be required when checkpoints of fault-tolerant skeletons are not “self-contained”. This means that their default contents do not capture entirely the application state. The user has to register as part of the checkpoint contents missing data in order to capture the application state. When fault-tolerant skeletons are self-contained, such action on behalf of the user is unnecessary as far as correctness is concerned. However, it is desirable in order to reduce the resulting checkpoint size and hence improve checkpointing efficiency. Therefore, in order to either constitute a consistent checkpoint or improve efficiency, the programmer's intervention may be needed. It makes all the more sense as the programmer, knowing the application semantics, may come up with smart choices.
Moreover, checkpoint efficiency may depend on the execution environment characteristics over time. For example, platforms under heavy load or aged platforms are more prone to failures. Hence, it is important that the application is able to adapt its fault tolerance based on external information.
To allow such interventions, FT skeletons come up with additional functionality allowing the programmer to control data which is enclosed in a checkpoint as well as setting the checkpointing frequency. Such interaction is seen as collaboration between the framework and the programmer. The other collaboration envisioned by MoLOToF lies between the framework and the underlying middleware, and is fully compatible with the spirit of fault-tolerant ecosystems such as the Fault-Tolerant Backplane [13].
Fig. 3: Normal execution with checkpoint and failure.
Fig. 4: Recovery execution.
To date, two framework implementations following the MoLOToF programming model exist. The first implementation is a Javaspace-based Master-Worker framework [14] which considers self-contained skeletons. The second implementation is a framework named FT-SPMD [1] which targets a broad family of SPMD applications named GReLoSSS (cf. Section IV). FT-SPMD benefitted from several modifications in its architecture and API which resulted in a seriously improved version called FT-GReLoSSS (FTG for short) which is presented hereafter. Compared to [1] the framework architecture is presented more in-depth and it is validated using an industrial application (cf. Section IV).
IV. FTG PROGRAMMING FRAMEWORK
A. GReLoSSS computation model
The GReLoSSS (Globally Relaxed, Locally Strict Synchronization SPMD) parallel computation model encompasses SPMD applications consisting in a main loop where each iteration (or superstep) contains a calculation and a communication phase. Such applications follow globally a classic BSP scheme [15]. However, these applications differ from BSP in two ways:
1) to improve efficiency on big parallel architectures, algorithms do not have a global synchronization between supersteps: each process starts its next superstep as soon as it has issued, but not necessarily completed, all its communications. Hence, global synchronization is relaxed as in the PRO model [16].
2) yet, to improve checkpointing efficiency, each process completes all its communications before starting the next superstep. Dependencies due to communications between processes disappear and consistent checkpointing is facilitated. Hence, compared to PRO, GReLoSSS has a locally strict synchronization which prevents overlapping of calculations with communications.
B. Application class supported by GReLoSSS and examples
The applications of the class supported by FTG (FT-GReLoSSS) involve two array datastructures one of which contains data used in the current superstep. The role of the second one depends on the application. A domain decomposition application such as Jacobi relaxations [17] will use that datastructure to store new results at the current superstep. A data circulation application such as in some parallel matrix multiplication algorithms [1] will use it to receive data for the next superstep from neighbouring processes.
During communications, processes exchange data corresponding to initial data or to intermediary results. Communications between processes may be quite varied, yet, in most cases, they are sufficiently foreseeable to be specified by the programmer. For example, in a Jacobi relaxations application, it consists in exchanging borders (or shadow regions) between
subdomains assigned to different processes. A subdomain designates the subset of the entire domain which was assigned to a process. Thus, a subdomain has the same datatype as array datastructures. At the end of communications, the two array datastructures are swapped.
Algorithms using two array datastructures (of 1 or more dimensions) such as the ones described may seem restrictive. But from our experience, they cover the needs of a fairly wide class of applications.
C. Software architecture and features
FTG is a C++ framework implementing programming principles described in MoLTOF. It is built on top of the MPI specification which makes it compatible with every MPI library. It provides a set of classes to ease the development of fault-tolerant GReLoSSS parallel applications.
Relations between main FTG classes are depicted in fig. 5. The ftg_Skel class represents a GReLoSSS skeleton and comprises:
- a calculation kernel (cf. ftg_Calc_Kern) which provides the calculation method and the skeleton’s main loop iterator. It is also possible to specify a condition for communications achievement.
- a routing plan (cf. ftg_Routing_plan) which is responsible for determining and scheduling communication exchanges between processes.
- a checkpoint (cf. ftg_Checkpoint) which sets the location in the skeleton where checkpoints will be taken.
- two array datastructures (cf. ftg_Domain) as introduced previously in the GReLoSSS computation model (cf. Sections IV-A and IV-B).

The source code excerpt of ftg_Skel class (cf. Fig. 6) shows how these abstractions are layed out within the execute method. The resulting structure closely follows the example skeleton in fig. 1. It differs in the existence of conditional communications (l. 30-31) and the presence of a swap method (l. 61) where the two datastructures exchange their data according to the GReLoSSS computation model. Condition has to be verified globally; all processes enter communication phase or none. Notice the name prefixes: ftgu_ are user-provided (l. 29-30, 41, 44), ftg_ are framework provided (l. 16), and ftgf_ are framework-provided based on user-provided methods (l. 38).
Concerning FT, the GReLoSSS skeleton defines a checkpoint right after the swap operation. By default, it contains data internal to the skeleton such as the two datastructures and skeleton iterators. ftg_Skel exposes to the programmer an interface allowing him to control data to include in the checkpoint. Furthermore, data which can be included in checkpoint files has to be either a primitive C++ type or derived from the framework’s ftg_Serializable class (cf. Fig. 5), in which case the programmer has to provide a pair of save and load methods. This approach was used within FTG to make ftg_Domain and ftg_Domain_desc classes serializable. The latter is a helper class which describes the extent of a domain (or subdomain) along each dimension.
Upon instantiation of the skeleton, the user has to inform the routing plan whether application communication consists in borders exchanges or in circulating data. Aside from this, he may choose among different communication schemes. Currently, the routing plan integrates two schemes based on the MPI_Issend-MPI_Irecv pair of MPI primitives. The first scheme performs all communications in parallel, while the second tries to “pace” them so that there is only a limited amount of ongoing concurrent communications at a time [18]. Concerning data movement, the routing plan groups sparse data into contiguous large messages and also minimizes copies from/to communication buffers by detecting ranges of contiguous elements. This last feature proved useful in applications where data to transfer is contiguous as it avoids using intermediate buffers.
The calculation kernel is merely made of pure virtual methods which the programmer has to define.
The array datastructure provides the programmer with an interface to N-dimensional arrays enclosed in ftg_Domain. When interfacing his own array datastructure (by inheriting from ftg_Domain), the programmer provides information regarding (1) the way the domain is split among processes as well as (2) the way to access an element given its coordinates ($x_1, x_2, \cdots, x_n$). Moreover, the programmer provides information regarding the storage order. In 2D, C storage order consists in storing the array line-wise, while a Fortran storage order consists in storing the array column-wise. Storage order generalizes in higher dimensions and can lead to more different storages depending on the order of storing each dimension.
Since the interface proposed by ftg_Domain targets N-dimensional domains, it manipulates a vector of coordinates which can be inconvenient to the programmer in small dimensions. It can also be less efficient. Therefore, FTG proposes specific interfaces for dimensions 2 and 3 (resp. ftg_Domain2D and ftg_Domain3D in fig. 5).
Finally, after splitting a domain among processes (cf. Fig. 7), any given element can be located either relative to the first element of the entire domain or relative to the first element of
template <class T_numtype, int N_rank, class T_iter>
class ftg_Skel
{
private:
T_iter it; // Main loop iterator (user-defined)
int step; // Local iterator
// DOUBLE DATASTRUCTURE POINTERS
T_iter ftg_Domain_t = read_buffer, write_buffer;
T_iter is_circulation; // Communication type
// Constructor, Destructor and other methods
// ...
// Executes the skeleton.
void execute (void)
{
// Init routing plan and iterators
T_iter it_beg = ck->ftg(Domain_Beg());
T_iter it_end = ck->ftg(Domain_End());
T_iter it_nxt;
step = 0;
// MAIN LOOP
for (it = it_beg; it != it_end; it = it_nxt)
{
// CALCULATION PHASE
T_calc_c = ck->ftg_calculate (read_buffer, write_buffer, it);
// CONDITIONAL COMMUNICATION PHASE
if (ck->ftg_do_execute_routing_plan (it))
rt = rt->ftg_comm (rt, it_nxt);
// CHECKPOINT PHASE
c.run (step ++);
// DATASTRUCTURES SWAP
swap ();
}
}
};
Fig. 6: FTG’s fault-tolerant skeleton.
Fig. 7: Global versus local array access.
the subdomain it belongs to (resp. Global ref and Local ref in fig. 7). The first are called global coordinates while the second are called local coordinates.
FTG allows the programmer to use either of them without any further involvement. Access through local coordinates is preferable since it is faster, but it is not always the most convenient. Using global coordinates incurs a slight overhead due to an additional offset computation.
From a design standpoint, the use of dynamic polymorphism (through classic inheritance) is sufficient. However, since array access methods are often used, the resulting overhead is tremendous. That is why FTG relies also on static polymorphism, and more specifically on the Curiously Recurring Template Pattern (CRTP) [19].
In the following section, we describe the Swing application and the steps to interface it efficiently with FTG.
V. Swing FINANCIAL APPLICATION MIGRATION
Due to house heating, demand in gas is higher in winter than in summer. Gas is mainly provided by pipes that cannot deliver more than a specific amount of gas per day and it results in far higher gas prices in winter. In order to provide energy to their customers, gas market actors have to own some storages that can help them smooth peak demand. In order to assess a project’s rentability, gas companies can use a financial real option approach that can be implemented in a software.
A. Swing application goal and implementation
The Swing application is used at EDF company to valuate a gas storage facing the energy market. It aims at giving the average cash flow generated by the asset depending on some scenarios. It also gives the management and hedging strategies [20]. These calculated strategies are used in a second application simulating the way the storage is used. This second application gives some cash flow distributions obtained by the storage management. While the time needed for the second application is short, the swing valuation can be very costly depending on the price models used to generate scenarios. The price models used at EDF for this software are a gaussian one-factor model (g), a normal inverse gaussian model (nig), and a two-factor gaussian model (g2d) [21]. The resolution method for the Swing application is the dynamic programming method that has been written in C++ and uses MPI for parallelization following the methodology in [18]. It also makes extensive use of the Blitz library for its convenient array manipulation facilities [22], and is about 18380 logical lines of code.
From an algorithmic standpoint, the Swing application fits perfectly the GReLoSSS computation model. While being a domain decomposition application, it is more complex than classic Jacobi relaxations. Indeed, over supersteps:
- calculations involve a subdomain of the entire calculation domain; that subdomain may change;
- shadow regions between processes have no fixed extent and may change as well.
To interface the existing application with FTG, we follow some typical development steps which are described hereafter and summarized in fig. 8.
B. Development workflow
As part of the typical development steps, we have to inherit from ftg_Calc_Kern to define a calculation kernel:
```cpp
template <class T_numtype, int N_rank, class T_iter>
class Swing:
{
public ftg_Calc_Kernel <T_numtype, N_rank, T_iter, Swing_Domain>
{
}
};
```
```cpp
Fig. 6: FTG’s fault-tolerant skeleton.
Fig. 7: Global versus local array access.
```
and also to inherit from one of the available ftg_Domain classes to define the calculation domain:
```cpp
template <class T_numtype, int N_rank, class T_iter>
class Swing_Domain:
public ftg_Domain2D<T_numtype, N_rank, T_iter, Swing_Domain>:
// implements Curiously Recurring Template Pattern
```
When inheriting from ftg_Calc_Kernel we provide the calculation method:
```cpp
void ftgu_calculate (ftgu_Domain_t *d1, ftgu_Domain_t *d2, T_iter step);
```
the main loop calculation iterator:
```cpp
T_iter ftgu_beg (void);
T_iter ftgu_end (void);
T_iter ftgu_beg (T_iter);
```
and a method which tells when to achieve communications:
```cpp
bool ftgu_do_execute_routing_plan (T_iter step);
```
When inheriting from one of the available ftg_Domain classes, we have to define two so called partition methods:
```cpp
ftg_Domain_desc<N_rank>
ftgu_data_possessed_def (int rank, int numprocs, int step)
ftg_Domain_desc<N_rank>
ftgu_data_needed_def (int rank, int numprocs, int step)
```
which tell what data is owned and what is needed by each process at each superstep. In an application with borders exchange, such as the Swing application, data owned is a subset of the data needed.
Moreover, we have to define a method telling the framework how to resize a domain:
```cpp
void ftgu_resize (TinyVector<int, N_rank> &extent)
```
and some methods on how to access any element or retrieve its memory address, given its local coordinates:
```cpp
double ftgu_get (int lx, int ly)
void ftgu_get (int lx, int ly, double e)
double* ftgu_getAddr (TinyVector<int, N_rank> &coord)
```
The resize method is not relevant to every application. Yet, in the case of Swing, it is interesting as subdomains attributed to each process and subdomains sizes vary across the course of an execution. Leveraging this feature, FTG can optimize memory management. The resize, the partition and the local access methods which the user provides (ftgu_prefix) are used to build the routing plan. The “ftg_Domain*” classes also use local access methods to implement the global access methods they provide the user with.
Finally, the application’s main function consisted in instantiating a calculation kernel and using it to initialize and execute the GRLoSSS skeleton. The corresponding source code has to be enclosed between the initialization and finalization statements of the framework provided by the ftg_Cpr (Checkpoint recovery) singleton class (cf. Fig. 8). The last step consists in choosing relevant checkpoint data. In particular, we unregister from the checkpoint the Domain which is useless at the end of the iteration, and register some application specific data which is not restored upon recovery (by mere reexecution), and hence has to be saved.
C. Ease of development assessment
The definition of the calculation method within our Swing calculation kernel involves the reuse of calculation functions in Gas_storage_price, and access to data in Gas_storage_asset (cf. Fig. 8). Both classes stem from the original Swing application. Similarly, partition methods in our Swing_Domain class require access to data and code reuse from Gas_storage_asset.
The calculation and partition methods are usually the most time-consuming to write. Especially the partition methods, which are prone to error due to indexes. Since compatible partition functions already exist in the original parallel Swing application, it is a matter of adapting them to use ftg_Domain_desc type to describe subdomains. The same applies for the calculation method, but some pieces of code have to be rewritten to use the accessors provided by ftg_Domain instead of those provided by Blitz Arrays. In the process, the interface of Swing_Domain was enriched to allow efficient and convenient access to ranges of data.
Another challenge we encountered concerned efficiency. In particular, partition methods have to be really fast as they are often called by the framework either to access elements through global coordinates or to build the routing plan.
In the end, the full fault-tolerant Swing application with FTG is about 353 logical lines of code less than the original application. Provided we are careful, the resulting application displays a clean and simple design as shown in fig. 8. Moreover, the application is fault-tolerant and the programmer has less lines of code to write. As shown in the next section, performance is as good as without FTG, sometimes slightly better.
VI. PERFORMANCE EXPERIMENTS
The evaluation of FTG consists in a comparison with the popular OpenMPI (OMPI) library which implements a blocking checkpoint protocol in combination with BLCR. OMPI applications benefit from a system-level checkpoint/restart solution. Experiments led, assess FTG and OMPI performances without and with FT enabled. When FT is enabled, checkpoints are taken, and we consider application runtimes in the failure-free case and recovery times otherwise. We also consider checkpoint size reduction and their impact on runtime overhead.
In these experiments, we consider temporary crash failures of nodes which can be dealt with by having both FTG and
OMPI store checkpoints locally to each node (i.e.: `./tmp`). Also, this setting avoids disrupting measurements due to additional communications resulting from significant data transfer across the network.
### A. Testbed description
Experiments were led on the Intercell cluster hosted at SUPELEC. Intercell features 256 nodes running on 64-bit Fedora Core 8 and interconnected through a CISCO 6509 Gigabit Ethernet switch. Each node has an Intel Xeon-3075 dual-core processor (i.e.: a total of 512 cores) and 4 GB of RAM. However, experiments were run with one process per node. Benchmarks applications use OpenMPI 1.5.3 and were compiled with g++ 4.1.2 compiler and `-O3` optimization flag.
### B. Runtime overheads comparison in absence of checkpoints
Fig. 9 shows that FTG exhibits negligible to no overhead for the g2d price model, and scales well up to 256 nodes where it performs better than the application not using FTG. Similar results were observed for the g and nig price models.
### C. Checkpoint size
Checkpoint size is dominated by the size of the two array datastructures used for parallelization. Since at the end of a superstep, the input data is useless, it can be omitted from the checkpoint. This optimization results in checkpoint sizes per node twice as light compared to system-level checkpoints (cf. Fig. 10). The same can be observed for the g and nig models. These models require less memory and result in checkpoints size ranging between 20 MB and several kilobytes with FTG compared to 40 MB and 7 MB for OMPI BLCR. In what follows, we focus on the g2d model: its' long runtimes make it a good candidate for FT.
### D. Fault tolerance performance without failures
For this experiment, we have run both versions of our application with the g2d model and different number of checkpoints: the lengthier the benchmark the more checkpoints were achieved in order to minimize the wasted amount of time in case of failure. In the present experiments we set the maximum allowed wasted amount of time to 4 minutes. Fig. 11 reports the runtimes on 128, 64 and 32 nodes. The plots compare OMPI with BLCR and FTG. In the latter’s case we measured runtimes without and with checkpoint size optimization in an attempt to quantify the impact of checkpoint size reduction. The difference remains marginal (0 – 3%) and is the highest with the biggest checkpoint sizes as the ones involved on 32 nodes. The difference is expected to grow further with bulkier checkpoint files. The remaining overhead observed with OMPI-BLCR ranges between 6% and 40%. Overhead incurred by FTG is always lower and does not exceed 8% in all cases. OMPI-BLCR’s overhead is mainly attributed to its blocking checkpoint protocol [4], which, unlike FTG’s protocol, involves communications and “freezes” the application execution in order to checkpoint.
### E. Recovery overhead
Recovery from a checkpoint comprises (1) a negotiation phase where processes decide from which recovery line to recover, followed by a (2) context recovery phase, and finally (3) a recovery from checkpoint file phase (i.e.: time to load data). Measured negotiation phase time is negligible (< 10ms). Context recovery phase is small as well. Overall recovery time from a checkpoint is rather small as it does not exceed 1s for the g2d model on 128, 64 and 32 nodes. Thus, fast restarts combined with the low-overhead checkpointing pointed out earlier make FTG suited for applications with time constraints.
### VII. Conclusion and Perspectives
Endowing parallel applications with efficient checkpoint-based FT at the application level can be a tedious task which adds up to the existing difficulties of parallelization. Our approach based on the MoLOToF programming model introduces fault-tolerant skeletons and results in a tractable way for users to endow efficient fault tolerance into their applications. Moreover, combined with a specialized framework, MoLOToF eases parallel programming, and encourages a synergy between the user, the framework and the runtime environment to improve FT efficiency. MoLOToF is applied to the GReLoSSS family of applications which we characterized in this paper. The application of the resulting FTG framework to an industrial application of EDF company showed that initial development with FTG involved simple steps and points out some elements to watch in order to minimize runtime overhead. Finally, experiments show the effectiveness of the overall approach and especially the efficiency of FT. For the same number of checkpoints achieved, FTG yields smaller checkpoint sizes than OMPI-BLCR and incurs at most 8%
runtime overhead. Recovery from achieved checkpoints exhibited negligible overheads. These results confirm previous ones we achieved on more elementary but varied benchmark applications [1].
Many principles of MoLOToF were used in the design of FTG. But some of them, such as the integration with fault-tolerant ecosystems, still have to be integrated and experimented with. Moreover, due to its inherent portability, the approach appears viable for hybrid GP-GPU applications. FTG might further be extended to support other parallelization models such as asynchronous distributed iterative algorithms. Future works are planned along the aforementioned lines.
ACKNOWLEDGMENT
This research is partially supported by Region Lorraine.
REFERENCES
|
{"Source-Url": "https://hal-supelec.archives-ouvertes.fr/file/index/docid/681664/filename/CM_PDP2012.pdf", "len_cl100k_base": 7565, "olmocr-version": "0.1.49", "pdf-total-pages": 9, "total-fallback-pages": 0, "total-input-tokens": 32243, "total-output-tokens": 9599, "length": "2e12", "weborganizer": {"__label__adult": 0.0004210472106933594, "__label__art_design": 0.00044035911560058594, "__label__crime_law": 0.0004222393035888672, "__label__education_jobs": 0.0005831718444824219, "__label__entertainment": 0.00013458728790283203, "__label__fashion_beauty": 0.00021588802337646484, "__label__finance_business": 0.0005817413330078125, "__label__food_dining": 0.0004286766052246094, "__label__games": 0.000972270965576172, "__label__hardware": 0.002410888671875, "__label__health": 0.0006527900695800781, "__label__history": 0.00048828125, "__label__home_hobbies": 0.00015234947204589844, "__label__industrial": 0.0011301040649414062, "__label__literature": 0.0002899169921875, "__label__politics": 0.00041103363037109375, "__label__religion": 0.000667572021484375, "__label__science_tech": 0.2135009765625, "__label__social_life": 0.00010120868682861328, "__label__software": 0.01140594482421875, "__label__software_dev": 0.7626953125, "__label__sports_fitness": 0.0004436969757080078, "__label__transportation": 0.0010442733764648438, "__label__travel": 0.0002942085266113281}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 40796, 0.00859]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 40796, 0.36189]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 40796, 0.89564]], "google_gemma-3-12b-it_contains_pii": [[0, 514, false], [514, 5477, null], [5477, 11180, null], [11180, 15871, null], [15871, 21019, null], [21019, 25732, null], [25732, 30878, null], [30878, 35509, null], [35509, 40796, null]], "google_gemma-3-12b-it_is_public_document": [[0, 514, true], [514, 5477, null], [5477, 11180, null], [11180, 15871, null], [15871, 21019, null], [21019, 25732, null], [25732, 30878, null], [30878, 35509, null], [35509, 40796, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 40796, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 40796, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 40796, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 40796, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 40796, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 40796, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 40796, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 40796, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 40796, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 40796, null]], "pdf_page_numbers": [[0, 514, 1], [514, 5477, 2], [5477, 11180, 3], [11180, 15871, 4], [15871, 21019, 5], [21019, 25732, 6], [25732, 30878, 7], [30878, 35509, 8], [35509, 40796, 9]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 40796, 0.0]]}
|
olmocr_science_pdfs
|
2024-11-27
|
2024-11-27
|
f9a694b3a572e38f6dd2186ae141263cfc1f9f5c
|
ABC: A Blocked C/C++ Parallel Programming Model
Mike Holly and Bill Homer, Cray Research, Inc.,
655-F Lone Oak Drive, Eagan, Minnesota 55121
ABSTRACT: A model is proposed for programming massively parallel machines in the C and C++ languages. This model, which addresses both data and execution parallelism, is designed to achieve that parallelism with only small user-program modifications. The model is initially proposed for implementation on massively parallel (MPP) machines, but should also be useful for parallel-vector (PVP) and symmetric multiprocessing (SMP) architectures.
1 Introduction
The current Cray C/C++ parallel-vector (PVP) machine environment provides parallel operations via microtasking (where parallelism is explicitly stated with user directives) and autotasking (where parallelism is implicitly applied to loops via an automatic optimizer). In either of these PVP models, execution begins with a single thread, and breaks into multiple parallel threads in well-defined regions and tasked loops. A thread is not associated with any particular processor.
On Cray Research’s massively parallel (MPP) machines (Cray-T3D™, Cray-T3E™), the current parallel C and C++ approach has three components:
• message passing via calls to PVM library routines
• fast get/put operations on distributed data via shmem library calls
• a few intrinsics (_num_pes and _my_pe)
The current MPP model has multiple execution threads from the beginning of the program, with each thread corresponding exactly to one physical processor (PE).
In this paper we propose a new paradigm for parallel C/C++: the “ABC” (A Blocked C/C++) parallel programming model. This model is intended for eventual implementation on both PVP and MPP machines, thus unifying parallel programming across a diverse set of hardware. It is designed to minimize the changes needed to convert an existing serial program into a parallel program.
2 Goals for a Parallel C/C++ Model
The ABC parallel C/C++ model has been developed to meet a number of goals. Among the more important are:
• Require only modest changes to normal C/C++ serial programs.
• Provide high speed execution.
• Be implementable and supportable using current technology.
• Provide support for distributed data.
• Provide prior art for future standards (unfortunately, no present standards exist in this area).
• Be compatible with PVM (quasi-standard message passing).
We believe that the ABC model will meet all of these goals.
3 Framework
A complete programming model for C/C++ needs to address two major areas: data distribution and work distribution. Data distribution is particularly important for MPP machines, where there is a significant performance penalty associated with accessing non-local data; this is much less of a problem on PVP machines where all of memory is directly accessible to all processors. For work distribution, work should be done in parallel as often as possible, and the distribution of the work should be such as to minimize the elapsed time. On MPP machines, this often means that work should be done where the data resides, to minimize communication costs (“owner computes” rule).
In the ABC model we assume, first of all, that execution begins in parallel, i.e. that there are some number n of threads which are active at the start of the program. On an MPP machine this is assumed to correspond to the number of physical processors assigned to the program, which may be chosen by the user at compile, link, or load time. We also assume that, by default, all data is replicated on each processor, i.e. all data is by
default private. Within this framework, the ABC model provides for both data distribution and work distribution.
4 Data Distribution
The main question in data distribution is how to partition a data array across the local memories of the \( n \) processors. Many partitions are possible. Some of the more common distributions are
- cyclic: the array is considered linearly, and each successive element is assigned to the next processor in sequence, wrapping around to processor 0 after processor \( n-1 \);
- blocked: some rectangular subset of the array is assigned to each processor;
- degenerate: the entire array, or some dimension(s) of the array, is assigned to a single processor.
In the ABC model we choose to allow a combination of blocked and degenerate distribution, requiring that at least one dimension of a distributed array be designated as “blocked” by using a new keyword block. The general syntax for distributed array declarations is:
\[
type\ array\_name[\text{dim 0}][\ldots][\text{dim} m\ block][\ldots][\text{dim} n];
\]
where the keyword block may appear in any or all dimensions as the last item in the brackets. The meaning of such a declaration is that the array will have its blocked dimension(s) spread as evenly as possible across the available processors. For an array with a single blocked dimension, this implies a block size of:
\[
\text{ceiling}(\text{dimension} / \text{number of processors}).
\]
As an example, consider the array declaration
\[
\text{int } a[20][50 \text{ block}];
\]
In this declaration the leftmost dimension is “degenerate”, i.e. it appears in full on all processors. If compiled (or linked or loaded) for 4 processors, the subarray \( a[0-19][0-12] \) would reside on processor 0, the subarray \( a[0-19][13-25] \) on processor 1, etc. The resulting arrangement is shown graphically in Figure 1.
When more than one dimension is blocked, we intend that the compiler will allocate the array in a fashion which tends to minimize the so-called “surface-to-volume” ratio, i.e. to make each \( n \)-dimensional subblock as “round” as possible. The exact algorithm for doing this is not yet specified. But as an example, consider the declaration
\[
\text{int } a[20 \text{ block}][50 \text{ block}];
\]
If compiled for 64 processors, the compiler algorithm could consider the processor grid as a 4x16 array, and choose to put something like a 5x4 subarray on each of the first 8 processors, and a 5x3 subarray on the remaining 56 processors. Intrinsic functions, described later, will be provided to allow the user to determine the exact layout chosen by the compiler.
4.1 Distributed Arrays
The inclusion of the keyword block designates a new C/C++ derived type, the “distributed” array. Such an array will obey the current C/C++ rules for arrays, except that
- the memory for the distributed array is allocated in local memory across the available processors;
- no pointer object can contain the address of a subobject of a distributed array (no declaration involving the distributed array may omit the blocked dimension or any dimensions to the right of the blocked dimension);
- distributed arrays are not allowed as members of structs or unions;
- there are implications for loops operating on distributed arrays, as described later.
Some of these restrictions are illustrated in the code examples in Figure 2 below.
4.2 Local Operations on Distributed Arrays
ABC also provides two operators for doing local operations on distributed arrays, local_address and local_sizeof.
The local_address operator is useful for accessing the locally resident portion of a distributed array via a pointer. For the array declaration
\[
\text{int } a[20][50 \text{ block}];
\]
we allow writing
\[
\text{int } * \text{ local\_a } = \text{local\_address}(a);
\]
which causes local_a on each processor to point to the beginning of the portion of \( a \) which is stored in the local memory of that processor. Figure 1 shows how the values of local_a are set for this example.
An additional operator, local_sizeof, evaluates to the size of that portion of a distributed array that is resident on a given processor:
\[
\text{local\_sizeof(array, proc\_number)}
\]
provides the size of the portion of \( array \) which resides on processor \( proc\_number \). The array parameter may be either the actual name of a distributed array, or simply a distributed array type.
Using the above declarations, the array \( a \) can be set to zero using the local pointers:
\[
\text{for } (i = 0; i < \text{local_sizeof}(a, _MY_PE)/\text{sizeof} (\text{int}); i++) \\
\text{ \quad } \*\text{local}_a++ = 0;
\]
The `local_sizeof` operator is also useful in allocating a dynamic distributed array:
\[
\text{int } (*q)[20][50 \text{ block}];
\]
\[
q = \text{shmalloc(local_sizeof(*q, 0));}
\]
Here processor 0 is specified, because its local share of the array will have maximal size. The `shmalloc` function allocates memory from the shared heap; there is a corresponding `shfree` function which must be used to release memory allocated via `shmalloc`.
### 5 Work Distribution
There are many possibilities for data distribution on a parallel system, and even more possibilities for work distribution. We consider that the most important case involves the C `for` loop, and the distribution of the work in such a loop to the various processors.
In the ABC model, the directive
\[
\#pragma _CRI shared_on <expr>
\]
is provided to designate a loop or loop nest for shared execution. The iterations of any loop which immediately follows this directive are parcelled out among the available processors, each processor executing a portion of the loop in parallel with all of the other processors. The expression `<expr>` is used to determine which processor executes a particular iteration of the loop: it is exactly that processor where the lvalue expression `<expr>` resides. This expression must designate a distributed array element, using indices which have the general form \( a*i+b \) where \( a \) and \( b \) are constants and \( i \) is a loop control variable for the shared loop. None of the loop control variables may be used in the expression more than once.
There is also an implicit `barrier` at the end of such a loop. That is, all processors will be held at the loop termination point until all other processors have finished with the loop execution.
The `shared_on` directive may not be nested; users are responsible to ensure, for example, that a function called from within a shared loop does not itself contain a `shared_on` directive. Undefined behavior results if this restriction is violated.
### 6 Examples
With this much of the ABC programming model specified, we are in a position to provide a few examples.
#### 6.1 Matrix Multiply
An example for matrix multiply is shown in Figure 3.
Here the columns of the three arrays will be distributed as evenly as possible across the available processors. The loop nest will have a portion of its iterations done on each processor; each processor will execute, for all values of \( k \), those parts of the loop for which \( a[i][j] \) resides on the processor. The loop control variables in the expression must be those for the tight loop nest following the directive; that is, in this example \( i \) and \( j \) are permitted, but not \( k \).
```c
main() {
float a[100][100 block], b[100][100 block], c[100][100 block];
int i, j, k;
\#pragma _CRI shared_on a[i][j]
for (i=0; i<100; i++) {
for (j=0; j<100; j++) {
a[i][j] = 0.0;
for (k=0; k<100; k++) {
a[i][j] += b[i][k]*c[k][j];
}
}
}
}
```
Figure 3: Matrix Multiply Example
---
**Figure 2: Code Examples**
Using the above declarations, the array \( a \) can be set to zero using the local pointers:
\[
\text{for } (i = 0; i < \text{local_sizeof}(a, _MY_PE)/\text{sizeof} (\text{int}); i++) \\
\text{ \quad } *\text{local}_a++ = 0;
\]
The `local_sizeof` operator is also useful in allocating a dynamic distributed array:
\[
\text{int } (*q)[20][50 \text{ block}];
\]
\[
q = \text{shmalloc(local_sizeof(*q, 0));}
\]
Here processor 0 is specified, because its local share of the array will have maximal size. The `shmalloc` function allocates memory from the shared heap; there is a corresponding `shfree` function which must be used to release memory allocated via `shmalloc`.
Note that the code and the result are the same as would be achieved in a normal serial matrix multiply, except for the block keyword and the shared_on directive.
6.2 Matrix Transpose
In the next example, given in Figure 4, we show how a matrix transpose function might be written using the ABC model. We assume that the underlying compiler already provides a variable-length-array (VLA) syntax (as do Cray’s and GNU’s C compilers). The VLA syntax is an integral part of the ABC proposal.
Here, with 4 processors and \( m = n = 100 \), there would be 10000 accesses of \( b \) on the left side of the assignment, and 10000 accesses of \( a \) on the right. All of the reads of \( a \) will be local, since the shared_on expression is \( a[j][i] \), but there will be 7500 remote stores to \( b \).
Note that:
a) the remote/local accesses in these cases are probably optimal, or at least a better arrangement is not obvious; and
b) the code will have the same result in a non-parallel environment, with no change required except to define away the block keyword and ignore the pragma directive.
```c
void mtranspose(int m, int n, float b[m][n block],
float a[n][m block]) {
int i,j;
#pragma _CRI shared_on a[j][i]
for (i=0; i<m; i++) {
for (j=0; j<n; j++) {
b[i][j] = a[j][i];
}
}
}
```
Figure 4: Matrix Transpose Example
7 Built-in Macros
The ABC model provides several built-in macros for frequently needed functionality. These are:
- \_N_PES which resolves to the number of threads (number of processors in the MPP case) for which the program was compiled (or linked or loaded).
- \_MY_PE which is the index of the currently executing thread, a number between 0 and (\_N_PES - 1)
- \_HOME_PE(variable) which designates the thread (processor) where variable resides; variable must be a shared scalar or a fully dereferenced distributed array element.
8 Intrinsic Functions
While the essential ABC model presented so far can be used to easily parallelize many sequential C programs, more is needed. There are also two intrinsic functions which are a part of ABC.
- \_in_master() returns TRUE if execution is in a master region, FALSE otherwise
- \_blksize(arr, dim, proc) provides a count of the number of elements of the distributed array arr in dimension dim which reside on the designated processor proc; the dimension is numbered from the leftmost dimension which is dimension 1.
9 Additional Directives
The basic work and data distribution algorithm, which spreads the distributed array and the work to be done evenly across the available processors, is expected to be useful in most cases. However, for those instances where more control is needed, ABC provides the following set of directives:
- #pragma _CRI master
- #pragma _CRI endmaster[,copy(var[ var,... var])] delimit a serial region. executed only by processor 0, with all other threads waiting at the start and end of the master region. The variables in the copy list must denote private scalar or array objects, which are copied from processor 0 to all other processors when processor 0 reaches the endmaster directive. Objects with type bit-field or char are not allowed in the copy list.
- #pragma _CRI critical
- #pragma _CRI endcritical define a critical region; only one processor enters at a time, without regard to order; no synchronization occurs.
- #pragma _CRI atomic_update enforces serial access to the single statement which follows the directive; this is useful to prevent potential race conditions.
- #pragma _CRI shared var[,var,... var] designates shared scalar variables or arrays, i.e. variables and arrays which will reside in the memory of only one processor (processor 0). Each var must be a simple variable name; see Figure 5 for some examples.
- #pragma _CRI symmetric var[,var,... var] designates local variables which will be placed at the same local memory offset on each processor.
- #pragma _CRI barrier
- #pragma _CRI nobarrier respectively create an explicit barrier and eliminate an implicit barrier.
10 A Further Example
Figure 6 gives an additional example which illustrates the use of some of the ABC macros and directives. This example is derived from a similar program in reference [2]. It estimates a value for $\pi$ by counting the number of randomly-generated (x,y) coordinate pairs which fall within a unit circle. The trials are run independently on all processors, and then the results are summed in a reduction which is executed by each processor, one at a time, in indeterminate order.
In this example the first ABC construct is the shared directive at line 17, which causes the variable totalhits to exist only on processor 0. Neither the block keyword nor the shared_on directive are needed for this very parallel example.
At line 18 the total number of trials is broken up into trials-per-processor (my_trials). At lines 21-22 the major part of the work is done. Since this loop is not controlled by any directives, each processor will execute the entire loop.
At line 24, the atomic_update directive ensures that only one processor at a time will update the totalhits value.
Finally, at line 27, the directive establishing a master region ensures that the calculation of $\pi$ and the printf are executed only on processor 0. Since there is an implied barrier at this directive, this calculation does not begin until all processors are finished with their loop calculations and have made their contribution to the totalhits sum.
11 Summary
ABC is a model for C and C++ parallel programming. It is designed to make use of parallelism simple, and only requires a single keyword to designate data arrays which are to be processed in parallel, plus a single directive to designate parallel loops.
12 References
|
{"Source-Url": "https://cug.org/5-publications/proceedings_attendee_lists/1997CD/F95PROC/337_342.PDF", "len_cl100k_base": 4098, "olmocr-version": "0.1.50", "pdf-total-pages": 6, "total-fallback-pages": 0, "total-input-tokens": 17767, "total-output-tokens": 4888, "length": "2e12", "weborganizer": {"__label__adult": 0.0003342628479003906, "__label__art_design": 0.000263214111328125, "__label__crime_law": 0.0002963542938232422, "__label__education_jobs": 0.0003814697265625, "__label__entertainment": 5.519390106201172e-05, "__label__fashion_beauty": 0.00013363361358642578, "__label__finance_business": 0.0001983642578125, "__label__food_dining": 0.0003821849822998047, "__label__games": 0.0004334449768066406, "__label__hardware": 0.0016813278198242188, "__label__health": 0.00046896934509277344, "__label__history": 0.00022149085998535156, "__label__home_hobbies": 9.524822235107422e-05, "__label__industrial": 0.0005145072937011719, "__label__literature": 0.00016546249389648438, "__label__politics": 0.0002605915069580078, "__label__religion": 0.0005388259887695312, "__label__science_tech": 0.0220184326171875, "__label__social_life": 6.395578384399414e-05, "__label__software": 0.00439453125, "__label__software_dev": 0.9658203125, "__label__sports_fitness": 0.0003485679626464844, "__label__transportation": 0.0006313323974609375, "__label__travel": 0.00021505355834960935}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 18807, 0.02039]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 18807, 0.57804]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 18807, 0.87755]], "google_gemma-3-12b-it_contains_pii": [[0, 3607, false], [3607, 8038, null], [8038, 12065, null], [12065, 16141, null], [16141, 18348, null], [18348, 18807, null]], "google_gemma-3-12b-it_is_public_document": [[0, 3607, true], [3607, 8038, null], [8038, 12065, null], [12065, 16141, null], [16141, 18348, null], [18348, 18807, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 18807, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 18807, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 18807, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 18807, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 18807, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 18807, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 18807, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 18807, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 18807, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 18807, null]], "pdf_page_numbers": [[0, 3607, 1], [3607, 8038, 2], [8038, 12065, 3], [12065, 16141, 4], [16141, 18348, 5], [18348, 18807, 6]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 18807, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-01
|
2024-12-01
|
f5d877eea241900d0c3e70686b609a470de908fb
|
PROPOSED EFFICIENT METHOD FOR TICKET BOOKING (PEMTB)
K. Ahmed1,*, M. S. A. Khan2, O. A. Siddiqui1, S. A. Iftikhar3, B. Das4, M. Khurrum5
1Assistant professor, Sir Syed University of Engineering & Technology Karachi, Pakistan
2Chairman Computer Science Department, University of Karachi
3Sir Syed University of Engineering & Technology Karachi, Pakistan
4Department of Electronic Engineering, Quaid-e-Awam University of Engineering, Science and Technology, Nawabshah, Sindh, Pakistan
5Nizwa college of Technology, Nizwa, Sultanate of Oman
Published online: 7 March 2018
ABSTRACT
The main purpose of this study is to explore the different platform that influence the client to become social. Our project (GO-tickets) is more easy way to book /buy ticket for all categories of events which is held in our town which includes the movie, festivals, holiday tour, events, sports and much more. This project is based on Cloud computing and we implement the digitalized concept of ticket marketing in which person can buy tickets in digital form and use single platform for all types of events booking. We used angular JS, ionic for a front end and node.js, express.js for a back end and mongo DB for a database. Our application works on both OS platform (IOS and android). Our proposed system is totally softcopy and in digitalized. The project has been successfully in the developing process and the system performance is found satisfactory. The use of computers in this technology era is nonproductive tasks to helps the users to reduce the time and wait. User-friendly menu interface the users can then use the services of the application via to fill a registration form can register themselves for book the tickets.
Author Correspondence, e-mail: kkhanzada@hotmail.com
doi: http://dx.doi.org/10.4314/jfas.v10i6s.125
This research paper of Go-Ticket application deals with the modern technology development of mobile phone application which is more simple effective, easy way to use and we also introduce QR scanning bar code reader that contain information about ticket in the form of bar-code. Moreover, the authentication of the ticket is checking by another person through QR scanning bar code reader which verify, QR-code detail information with the database and reduces the burden of event manager.
**Keywords:** Ios, Android, Cloud-database, Quick response code (QR), MongoDB database, QR scanning barcode reader.
### I. INTRODUCTION
Nowadays, modern technologies conclude different services i.e email, mobile phones, and the internet etc. However, with the development of new technology, we are faced number of challenges, task, risks are emerging for the many other organizations. Some of the important issues include such as new payment methods, integration of the new technology with the modern device .In this project, the main idea is to utilize the new technologies for our ease, digital tickets are very much common in developed countries.
“Digitalized ticketing system is the ticketing system which uses self-service technology as a base of application helping the user to book a ticket by themselves”.
In the modern era the technology is surrounded everywhere everyone is running behind with the time and achieve the goal. The main purpose of moderate technology is to produce a time and cost efficient product which is easy to use and attract the user/client if they use, it is easy to use. Even in the online or digitalized ticketing was introduced for facilitating the users to book/buy ticket through application which is install in your mobile phone. The Mobile ticketing was introduced which sends user pop-up message of tickets for validate and after the successful validation. This facility was never implemented in Pakistan this is the first time introduced in Pakistan. This research paper presents the methods of the online ticket booking system in digitalized form with unique bar code. PEMTB is a way of tickets purchasing for different event platform it is the challenging task to combine all events in single platform. PEMTB is an simple application which enables the users to buy a tickets in an efficiently, with the help of an application with is install in your mobile phone. It can carry tickets in the form of picture which is directly download in mobile gallery with a Quick Response (QR) code in it or in form of
digitalized it is an application that containing the whole details information of the ticket in an encrypted code form. The information about a single/individual user and the digital ticket is stored in database for easy availability everywhere and any time and are easily retrieved when it is required. All information about ticket details information is transferred in a secure manner and the user also check their purchasing history in their account page. PEMTB will be the best solution for all kinds of events selection, holiday planning, weekend visits or educational trips due to which a person can get rid of long queues, fake passes and mismanagement it will minimize the black marketing, ticket sharing will be easy. PEMTB development team are introducing the concept of 'In-App-Ticket Market', this market is for the users of PEMTB where a user can resale its tickets if they want. In-App-Ticket Market will be helpful for money refunding and tickets utilization.
PEMTB is also having the Management Panel for event managers, where a manager can register itself and submit their event publish request to the panel. Event Manager can have fully access to the details of the current or past events. Record of each ticket will be render to the manager and he can also notify the ticket holders for any update or event reminder.
This application Go-Tickets used MongoDB for a database for non-relational database management system. It is query Language which provides a highly-functionality about all secondary indexes. Our ticketing system is online limited for all kinds of events in a single platform where you can search diff categories of events like sports, entertainment, education and vacation trips.
It is a separate application for client and event planner. The clients access the database. The database of the server can access through internet (dbms). For the better results the availability, effective resource and the database uses cloud computing Paas with the tools to test, develop and host the applications in the secure environment and also provide to manage or maintain security, backup send the server software. MongoDB database give the scalability, efficiency and availability for continuously of the system easily, efficiently for durability. Some of the advantages of database are accessibility, recovery, better maintainability and the better good performance. But there are some of the disadvantage, include security and privacy and loss of data in the case of any disaster or any mishap due to some situation. This application is to contact server connect it to directly to receive updated of data for the user or application. To be a
designed for the unique QR code, a set of black modules arrange in encoded. The encoded code info may be alphabetic, numeric no, byte/binary and so on the bar-code is unique.
II. LITERATURE REVIEW
The paper is easy to provide a more easy way to book/reserve tickets for the movie entertainment and also provides an interface for users to manage or maintain a multiplex cinema ticket booking process system. On the front end they used php and sql server on the back end. They design their own back end. It has been developed in php and database has been created in my sql server server. We also study that this project paper have some limitations like customer will not be select their seat number at that system. The customer will only book their tickets on the current day and the Upcoming movies does not include the Advance bookings. In this paper a user finally decides to reserve and grab their tickets, the purchaser's name, email and information, including billing/payment instruction is securely, manageably and permanently stored in the mongoDB database for future visits that has been paid.
This paper is based on the existing real-time booking reservation booking system for the meeting of any event and seminar halls of graduate students which studies at sana’s university, this paper also conclude the basic comparison between manual booking and the online booking system for the graduate student. In this paper Technology Acceptance Model it was used as a factor in the use of computer modern technologies. In order, the Software Development Life Cycle (SDLC) model was used for designing the proposed online reservation system for the meeting of any event and seminar halls and give online questionnaire among 100 students of the university which evolved two sections; the first represents the usefulness and satisfaction of the manual booking system, while the second represents the usefulness and satisfaction of the Online booking system. The proposed system was tested and the results showed that the student did not like the Manual Booking System as a useful. The majority of the student like online booking system is easy to use and give vote to online booking system.
This paper is based on the live music events festivals. The future of the online marketor live music events festivals which holds potential for the growth of the music event festivals continue to rise in popularity. The ticket resale industry as the ticket resale opportunity. As a media communication is increasing day by day through mobile phones is also a leading factor in
growing industry of the popularity of music events festival i.e concert through this it is extremely active on social media while attending live music /concert festivals. This paper propose the dealing with the online event ticketing that will continue to grow among millenial. The enhancement of new technology is a set task and risks .The major and the most important issues include is payment methods system for the integration of the newest technology. This research, shows the challenges of the online event ticketing booking are presented along with solutions. With all the opportunities, to expand their fame, business and provided that they find efficient ways for emerging challenges, task and risk. Due to customer demands the leading companies need to adapt these services in order to make the customer comfort, and give free mobile payments for the newest technology like Apple pay when it comes to customer satisfaction. The event ticketing platform is to provide the most affordable ticket prices discount, increases ticket sales opportunity and the build a trusting relationship with the customer/users/client is increase.
This paper proposed the modern ticket system which is strong, high and polarized, stable by those involved in the selling purchasing of the tickets for sports, concerts and theatres, and some of the people go to attend the events. The market in tickets for entertainment and sports events is regarded by the scourge, in addition to see it as a valuable good services ,it is a good way to obtain tickets for oversubscribed events. The tickets can now be bought and sold in a very short time, and it is easy for trade in their spare time. As tickets for many popular events are put on the market at prices which are lower than many consumers are willing to pay for it.
This paper propose the easy booking is a system which provides the facilities for booking holiday tour and other accommodations opportunity for customers. In back end they used MySQL, and on the backend side they used sql server, Microsoft Access Oracle. And in front end they used Visual Studio 2010 Adobe Dreamweaver, Notepad, and Notepad++ and others are .net framework. In other hand this system will have limitations in their system i.e enquiry/emergency the customers send their feedback,. This paper system does not have the separate web page for checking all the customers enquiry/complain and send reply to them as soon as possible. This application will work for both OS Platform (IOS & Android).
This paper proposes to deal with the web based cinema ticket booking system which is time saving for the customers by booking the tickets online in very short period. This system is designed on the bases of modern architecture to cut with the changing requirement. They provide
benefits like checking your booking history, special offers and discounts deals for registered customers. After selecting the show, the user is presented a seating layout so that he can select seats of his choice of required, their system offers a "Pay Later" option, payment at the time of buying tickets is not compulsory. User can pay tickets at the theater itself. The payment process is made extremely secure and manageable. They use trusted payment gateways using SSL encryption technology to protect your personal information. First User make their profile then they can update his profile details, and then they can take a printout of the ticket and also view his booking history. Their system also permits advance ticket booking. They have introduced a mobile app for booking movie tickets through Smart phones application. This works for both Android as well as IOs. And the best part is no need for a printed ticket because they send a ticket on phone that can be produced at the theater as a valid ticket7.
III. METHODOLOGY
Front end:
We use angular.js and ionic for a front-end. AngularJS is a front-end web application framework and is based on .js open source. It simplifies the enhancement, implementation and the testing of such an applications by providing a framework for client side development. AngularJS is the front-end part of the mean stack generator that consisting of MongoDB as a database, whereas ionic is a complete open-source sdk which is use to provides tools, services for developed the hybrid mobile applications by using the web technologies like Html5,Css and Sass for styling.
Back end:
We use node.js and express.js for a backend. Node.js is an open source platform. Node.js enables the language of java Script to be used for server side scripting, and runs the scripts to produce dynamic web pages content and Express.js is middleware part which provide a web app framework for Node.js, It is designed for building web and Api’s. Express.js is the backend part, together with MongoDB database and AngularJS frontend framework.
Database:
MongoDB is use for a database. MongoDB database is uses for the cloud resource which give the scalability, efficiency and availability of the system easily and durability. It is used for a use
cases Mongodb is include Real-Time Analytics etc. MongoDB provides only a document-wide transaction.
MongoDB had a server-wide write lock. It is a perfect isolation mechanism and also in order to achieve it if they want to sacrifice enough performance.
*Multi services:*
This is sometimes called as a third party services which is mlab, firebase, heroku these all provide services, whereas mlab provide service to Mongodb database. Firebase provide a real time database and give support backend as a service. It also provides an application for developing an Api’s that allows application data to be synchronized across the client side and stored on Firebase, heroku is a cloud that are based on the platform as a service (paas). The heroku platform supports the developing part of the node.js server.
**A. Open Architecture**
In order to enhance the experience, we have taken our ticket booking system one step further. We have introduced a mobile app for booking movie tickets, festivals, events, seminars etc through Smart phones. This works for both android as well as for ios. This way you can easily find out event related information and book tickets through your phone. And the best part is, no need for a printed ticket because we send you a ticket on your phone that can be produced at the theater, cinema halls, seminar halls etc as a valid ticket. So it ends the user's worries about waiting in long queues at the ticket counter as well. Have a great experience. PEMTB is a web app to provide the customers facility to book tickets for cinema, events and avail best deals in town and the user can select the events per his choice and also pay for ticket, payment at the time of buying tickets is compulsory.
**B. System Design**
This system design showed the application description with detail information to the product development by defining the architecture, components, model with all possible module and data for a system to satisfy the requirements. The main goal of design phase for the system was to find the best possible design within the required limitations in which the system was to easily operated in efficient manner.
C. System Implementation
This system implementation involved the building of the various elements of a system where we are having front end device that is connect to node.js server. The process flow in the form of cycle with the front end device the http request to the server of node.js where we using get function to get information to server in which we can be post, delete information functions call. We also use express.js for a endpoint device that is a service serves the middleware and generate query function. This query ask from database to select and find query in database and after that it will give respond back after getting query with the help of return function as a json format in the device.
D. System High Service Availability
The system provide high service availability and backup the periodically and adopting certain redundant approach in order to guarantee the system recovery within the shortest time as soon as
possible, the large amount of customers may purchase or collect their tickets shortly before the
time begins. Moreover the requirement is on availability, and only for some of the services and
the ticket purchase, issuance and printing are the most common issue in the event ticketing
systems mechanism or digitalized ticketing system which to guarantee the high availability and
durability of the system.
E. Scalability
This systems are vary from system to system in all event types of categories and geographic
locations also being covered. Some of the ticket system sell tickets for various kinds of which
held in our town. This paper proposed an architecture of the digitalized ticketing system based on
cloud computing implementation, UI interface etc which supports various categories of events,
multiple event providers.
F. Functional Requirement of the System
The fundamental functions of the digitalized ticket is to provide mobile-based online ticket
purchasing services based on both android and Ios to the individual customers The mobile phone
supports Internet for the online purchase or digitalized purchase through application. The single
customer/user can buy tickets of different events through the Internet at any time anywhere
directly through the application which is install in your mobile phone after that first register
yourself then login to the account and after that show the event and easily buy the ticket on your
fingertips. The digitalized ticketing system provides services to users, the web plan is only for the
event manager to insert their event, details/information about the event, ticket for the customers.
1. Register/login :
The first procedure starting for the user is collect information of the users through registration. In
addition if the user is using the smart application for the first time they has to fill the registration
form for buying any ticket in registration form give some of his information like name, email,
gender, no etc. When a user has already registered he has to enter to the login page. All these
information are securely stored in a database and can be accessed easily. These information are
necessary during the generation of QR -code of the ticket, validate and for future.
2. **Buying of the Ticket**
For the buying the ticket you must first register itself after that then book the tickets they have to fill details form like payment method through credit card, No. of ticket which limits is only 5 ticket you can purchase at one time if you are ticket ambassador. Then click the generate ticket options to generating a ticket. Then payment mode has to be selected. They also have an option where you can store the credit card information. This is known as token payment or strip payment method.
3. **Generation of the QR code:**
After the creation or generation of the ticket QR-code number at the time of buying the ticket from the above mentioned step, QR code is generated from the Api engine. Thus in response a QR code is generated as a http Response against the request sent earlier as possible.
4. **QR Reader Check**
The QR bar Code is used for retrieve the detail information from the QR code in an encrypted form for validating the details of the ticket including its date, event category, time etc.
5. **Database Checking**
The database checking it also called an backup plan for the user’s mobile device whether it is damaged or shows any of the problem. It is directly can be checked by the user with the ticket number and ticket purchasing details to get detailed information about the events category etc.
6. **Event Management Panel**
Our system also provide the event management panel where event manager has required to fill some information details for the publishment of events and then has to request to the admin for publishing the event. Admin will check the event manager's information from admin panel or contact the event manager for the approval and verification. After confirmation the admin will grant access to the manager. After gaining the access for publishment of event, event manager will be able to go to the event panel and can easily manage event. The manager a can check details in the run time and details of the current event or the previously held events or to be in the near future, the details of sold out tickets, how many remaining and can manage cost and count of
the tickets if there is capacity left in the hall. Event manager can also manage the date venue or the time of the event and also change venue or time and can postpone the event too.
7. Event Service provide by Management Subsystem:
The overall system provides event service management. The services are required for all event providers to create events/post event related information details and to manage or arrange the event conveniently via standard Web interface/browser. Event management provides details and can schedule the event, announce the prices, and announce the no of ticket availability and venue. The online updates, reports and news are given to event provider which describes the various statistic report of purchase. After function/services provides details to handle business issues with the administrator (admin).
G. Non Functional Requirement
The application was designed to fulfill the non-functional requirements of the application.
1. Performance Requirements
Performance of the system is dependent on the internet speed with the local host and also the hardware itself.
2. Security Requirements
Every system has a security requirement. There is only one authorized person who can see the Information which is the admin. The information of the customer is only available for the administrator only.
3. Software Quality Attributes
The software quality of the system is vary by the user friendly and flexible requirement.
H. Architecture Design of the Application System
1. Hardware Requirements
Hardware(laptop, mac), Device Smart Phones (Android 5.0 marshmallow), IOS, Xcode.
2. **Software Requirement**
IDE (Web storm), IDE(intelli), Language (Java script), Operating System (Windows, Mac, Android), Supporting Device (Android sdk, IOS), Version of Android is from(SDK 2.2 to 4.1), Database (Mongodb).
3. **Android SDK**
Android sdk is the development kit which includes a set of libraries, errors, documentation, tutorials, etc. In addition the developers uses the edit java or xml files with any other text editor we use webstorm. The android project needs a editor to be create dprogram then compiled and then run. All the.apk file is a package of all android applications. This .apk file is stored the app data folder for the Android Operating system.
4. **QR Code scanner**
The Quick Response (QR) code the [Figure 3] shows the QR code which is used to store user information and ticket purchasing details in encoded form with black and white and have no restriction of QR size. This QR code can be used to transfer from one mobile to another and can be shown ticket detail to the ticket checker for validation and for invalid ticket.

**IV. RESULT AND DESCRIPTION**
The use of online ticketing application or digitalized ticketing system in the android mobile and Ios mobile which will minimize the overhead of the user to waiting in a long queue and book, purchase the tickets. PEMTB is a system where mobile users can book, pay, purchase, tickets through an mobile phone. The need of Ticketing is increase day by day to overlook with the technologies. This modern application has ample the useful features to make it popular in the modern technology market. First all the user information are stored in an encoded manner and
also providing the maximum/efficient security, flexibility for the customer/user in addition, all the user information is stored in database in a secure manner. Thus Go-Tickets application installed in the mobile phone for booking a ticket as well as for the validating the tickets. It also automatically expire the tickets after the validation of the ticket at event place. Payment can be done through strip payment method. All the required facilities for ticket booking are present in this smart modern application with multiple events category. It also provides the security in the efficient manner.
Thus the go-tickets application will become popular soon in the market. The below reasons that make this application better than the other application in the modern technology market.
- It resolve the problem for the users stand/waiting in a long queue to book their tickets when they are with family and friends..
- It really enables to the customer comfort to purchase the tickets online, everywhere, anytime if you have an internet in your mobile phone it is available 24 hour.
- Users information is store in the database and thus the system can access the data anywhere anytime.
• Single platform of all types of events booking all events are categorized in fusible manner, so there will be a single platform for all nature of events booking and getting events detail on a single tap.
• The user of go-tickets application can carry the QR code. This code is generated on the ticket after purchasing the tickets, the ticket is directly save in mobile gallery. It does not worried about the carrying any smart card or a print out of the ticket.
• The encrypted form of QR- code, security is maintained and manageable easily.
• The ticket information is in the database i.e MongoDB, used to accessed to the validate tickets.
• For the payment method go-tickets implement strip payment method.
• Ticket market concept where user can sale its purchase pass or ticket in case of some issues.
Fig.4. Home page
Fig.5. Login page
Fig.6. Registration page
Figure 5 describes the page where an existing user can login and a new user first register itself and can create account with the register here option there is open free to see what show is going on no need to register or login but if you purchase any tickets you must first register and login. Whereas Figure 7 displays the homepage where the users has to show different categories pages.
after selecting the ticket it shows the detail of the event time, venue and ticket cost details for buy the ticket after buying the ticket it shown a ticket if available. QR code is attached with the ticket received by the user with the ticket. Figure 8 shows the Validation and invalid of the ticket.
V. CONCLUSION
To conclude this research paper we will like to sum up that the product that will discussed will be revolutionary in this modern era this product encompasses all the necessary details regarding holiday planning like festival, trips, seminars etc. The go-tickets is designed to meet the requirements of all the necessary details regarding a holiday plan. This product will full fill all the required ideas that a user can have and will satisfy user by providing complete knowledge of any event in our town. The advantage of this product is that there is no use of any sort of fraud activities as it encompasses end to end security parameters providing secure environment and there is no restriction for any platform because it is hybrid app. Different event managing companies can meet customer requirement, with this platform we developed and created, we avoid wasting time to reduce misunderstandings. Nowadays, event companies are taking important role in managing event festivals and to make reservation reliable that they will make reservation easier, simple, safer and cost time efficient manageable. It has been developed in HTML5, SCSS as styling, java script and database mongoDB. By using this application, the event company provides information to their customers without the limitation of office hours or man power it available 24 hours. It easily book any trip which available and events around the clock at any location time through internet but it is also designed for the company to manage their business processes, overcoming difficulties and problems and it established time to time that arose in the previous system. On other side this app will be having a commercial value and financial return like all others app are earning these days. We can enhance this concept further in future after the successful deployment.
VI. REFERENCE
[2] Mobile Food Ordering Application using Android Os platform,
[9] Online movie ticketing services market and analysis by platform (internet, mobile) and segment forecast to 2022.
How to cite this article:
|
{"Source-Url": "https://www.ajol.info/index.php/jfas/article/download/171990/194878", "len_cl100k_base": 5900, "olmocr-version": "0.1.53", "pdf-total-pages": 18, "total-fallback-pages": 0, "total-input-tokens": 32469, "total-output-tokens": 7134, "length": "2e12", "weborganizer": {"__label__adult": 0.0006694793701171875, "__label__art_design": 0.0008330345153808594, "__label__crime_law": 0.00035691261291503906, "__label__education_jobs": 0.0014400482177734375, "__label__entertainment": 0.0008392333984375, "__label__fashion_beauty": 0.0002548694610595703, "__label__finance_business": 0.001316070556640625, "__label__food_dining": 0.0012502670288085938, "__label__games": 0.0023555755615234375, "__label__hardware": 0.0015077590942382812, "__label__health": 0.000621795654296875, "__label__history": 0.0002694129943847656, "__label__home_hobbies": 9.453296661376952e-05, "__label__industrial": 0.00029850006103515625, "__label__literature": 0.0004091262817382813, "__label__politics": 0.00026679039001464844, "__label__religion": 0.00030684471130371094, "__label__science_tech": 0.01107025146484375, "__label__social_life": 0.00015246868133544922, "__label__software": 0.0187225341796875, "__label__software_dev": 0.955078125, "__label__sports_fitness": 0.0004489421844482422, "__label__transportation": 0.0008502006530761719, "__label__travel": 0.0007309913635253906}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 32023, 0.01744]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 32023, 0.0184]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 32023, 0.93449]], "google_gemma-3-12b-it_contains_pii": [[0, 1818, false], [1818, 4359, null], [4359, 7032, null], [7032, 9602, null], [9602, 12395, null], [12395, 14669, null], [14669, 16824, null], [16824, 17765, null], [17765, 20011, null], [20011, 22155, null], [22155, 23763, null], [23763, 25455, null], [25455, 26644, null], [26644, 27469, null], [27469, 27513, null], [27513, 27903, null], [27903, 30333, null], [30333, 32023, null]], "google_gemma-3-12b-it_is_public_document": [[0, 1818, true], [1818, 4359, null], [4359, 7032, null], [7032, 9602, null], [9602, 12395, null], [12395, 14669, null], [14669, 16824, null], [16824, 17765, null], [17765, 20011, null], [20011, 22155, null], [22155, 23763, null], [23763, 25455, null], [25455, 26644, null], [26644, 27469, null], [27469, 27513, null], [27513, 27903, null], [27903, 30333, null], [30333, 32023, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 32023, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 32023, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 32023, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 32023, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 32023, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 32023, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 32023, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 32023, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 32023, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 32023, null]], "pdf_page_numbers": [[0, 1818, 1], [1818, 4359, 2], [4359, 7032, 3], [7032, 9602, 4], [9602, 12395, 5], [12395, 14669, 6], [14669, 16824, 7], [16824, 17765, 8], [17765, 20011, 9], [20011, 22155, 10], [22155, 23763, 11], [23763, 25455, 12], [25455, 26644, 13], [26644, 27469, 14], [27469, 27513, 15], [27513, 27903, 16], [27903, 30333, 17], [30333, 32023, 18]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 32023, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-08
|
2024-12-08
|
ba364d6ffedf1efcc279bdbd233f9e3be73ae582
|
An algorithm and case study for the object oriented abstraction
Jakub Ratajczak*
Institute of Computer Science, Warsaw University of Technology, Nowowiejska 15/19, 00-665 Warszawa, Poland
Abstract
Model checking of software systems becomes more effective each day. However it still can not handle huge state spaces of real software. Particularly, concurrent systems are hard to verify. Abstraction techniques are one of the solutions aimed at managing the complexity problem. This paper describes the object oriented abstraction algorithm. It allows semi-automatic abstraction of real (i.e. Java) programs. A novelty method for constructing class abstractions is shown. It uses additional program annotations expressed in a formal manner. Proposed techniques are shown in a context of algorithms used in the Bandera toolset. A short case study of this approach is also shown.
1. Introduction
Model checking is one of the formal methods for software verification, which becomes more effective each day. This approach has proved its advantages in the hardware applications and now there is a lot of effort put into migrating this technology to the software domain. One of the goals to achieve is to verify programs written in the modern object oriented languages. Since the state space of such program is possibly infinite (or extremely large) it can not be examined straightforwardly by model checking algorithms. Additionally, the state explosion occurs when concurrent software is being verified. There are several ways to avoid the state space size and explosion problems. Abstraction algorithms appear to be the most promising approaches [1,2].
There are several methodologies and tools developed to aid the verification of software systems developed using ordinary programming languages like C or Java. Nevertheless, most of them can not handle real-size applications due to size and efficiency problems. The Bandera toolset [3,4] is one of more sophisticated model checking tools dealing with Java programs. It uses combination of slicing and abstraction [5] to reduce a state space of model checked programs. The slicing is a program reduction technique that allows for
* E-mail address: j.ratajczak@ii.pw.edu.pl
removing parts of a program that does not affect the property being examined. Unlike slicing, the abstraction does not remove anything. It reduces state space of the modeled system intensively by appropriate merging sets of states together in a way preserving desired properties of a system. Reduced programs have to be treated in a special way in order to prove their correctness but it is beyond the scope of this paper. Appropriate techniques are described in [5-7].
In the paper the abstraction algorithm for object oriented programs is described. It is an enhanced version to the one used in the Bandera toolset. The original one allows abstracting variables of a few types only – simple, built-in ones. The algorithm proposed in the paper allows abstraction of variables of any class or type, even API and user-defined classes. It opens model checking possibilities to a much wider range of applications.
Idea of the automatic abstraction presented in this paper covers Java programs, it uses PVS prover and it is interfaced with the Bandera toolset. However, it may be smoothly applied to other programming languages and formal verification tools. It does not require any particular model checker.
Section 2 describes briefly the program verification process. The way of preparing specifications of classes and methods is shown in Section 3. Section 4 explains a method for abstracting objects. Section 5 concludes abstraction and shows how to prepare an abstracted program. Section 6 presents a case study. The last sections present conclusions.
2. The program verification process
The process of the verification of program [3] consists of several tasks: i) preparing the property (set of properties) being verified $\Phi$, ii) slicing the program in order to remove its irrelevant parts, iii) abstracting a program ($P \rightarrow P'$) and an examined property ($\Phi \rightarrow \Phi'$), iv) model checking of sliced and/or abstracted program, v) interpreting results. In this paper we focus on a program and property abstraction (iii). The original type abstraction algorithm used by the Bandera toolset allows to abstract Java programs by replacing program $P$ variables of built-in types only with their abstractions. Here the enhanced version is proposed. It handles objects of any class.
The object abstraction algorithm produces an over-approximation of the original program $P'$: the abstraction process introduces extra activities to the program. In other words there are fewer states in the program but additional transitions appear. These transitions appear as a result of merging states (abstracting concrete variables) while all possible execution paths (transitions) are preserved. Therefore an abstracted state must be the starting point for all transitions that started in the concrete states that produced the abstracted state. Respectively the abstract state has to be an end point of all transitions that in the concrete domain ended in all states the new one is abstracted from [8].
Over-approximation preserves universal propositions. Informally, a universal proposition states that the given proposition holds on all paths of the program. An over-approximation is not conservative. It is only weak property-preserving:
$$P \models \Phi \iff P' \models \Phi'.$$
Unfortunately, because of extra transitions the over-approximated program and property do not preserve existential properties. Therefore, the over-approximation may lead to false alarms while universal propositions are examined. Some techniques of avoiding this problem are described in [6]. They apply as well to the proposed enhanced abstraction algorithm.
3. Formal specification of a class
Formal specification of a class is the description of its behavior expressed in a formal language. Specification is used later on in the reasoning about abstracted class methods. It is not necessary to write specification of a class if one does not want to preserve fully formal path leading from original to abstracted class. In such case abstraction may be done using other class description (i.e. documentation or just source code).
Formal specification of a class consists of three steps:
- translating relevant class members to a formal description,
- providing necessary class invariants concerning the above fields,
- providing specifications of methods of a class.
Specification of a class has to be done manually. However, when all methods are well specified it should be a relatively easy task. There are successful projects on proving correctness of such specifications basing on real Java code [9]. Any formalism can be used for the specification. Here the PVS [10] was chosen because of its powerful proving engine.
3.1. Translating class members
Translating class members is rewriting them (either abstracted or not) in a formal way. Class fields have to be translated to allow defining methods specifications. Each method is to be specified in terms of how it acts on these fields. Only fields that are vital for a class behavior (and for behavior of its abstraction) should be translated. There is no universal recipe how to decide which ones are relevant and which are not.
Types of fields of the class should be translated to types of a formal language in a way allowing for defining methods behavior later on. If a given type is not abstracted then the closest possible type of a formal language is chosen. When a field is an object its class formal definition should be used.
3.2. Class invariants
Class invariants are used as auxiliary lemmas for proving falsifications (see the next section) during the phase of deducing abstract methods. Their usage eliminates repeating conditions they cover in each method definition.
Class invariants should operate on fields translated in the previous step. Invariants do not have to hold inside method bodies. They should be valid always when no operation is performed on an object.
3.3. Methods definitions
Method definition defines how method acts depending on the object state and method actual arguments. It defines also if and when an exception is thrown by a method.
Method description should be as detailed as possible. The better description is the more accurate abstractions it will produce.
4. Class abstraction algorithm
The program abstraction algorithm uses i) a set of abstract domains, ii) a set of mappings of concrete variable values to abstract values, iii) a set of abstracted methods and operators operating on abstract domains. Abstract domains (i) depend on a property being checked, on types of semantics and on the use of variables. Mappings from concrete values to abstract values (ii) are derived both from concrete and abstract type semantics. A developer prepares them. Abstracted operators (iii) are prepared automatically from the semantics of equivalents of original operators present in the used theorem prover (e.g. PVS [10]) [5,11]. Bodies of abstracted methods (iii) are built using formal annotations of original methods – if they exist. Formal annotating of Java class is described in Section 3. If formal specification of a class was omitted abstract methods (iii) have to be prepared manually. Abstract methods used in the case study below were prepared manually.
Most elements from the sets above i), ii) and iii) are reusable and thus may improve the efficiency of the whole verification process. They may be prepared in advance as well. Such an approach seems to be extremely useful when applied for API classes. Nevertheless usefulness of the algorithm is not restricted only to API classes. Each ordinary class can be annotated and its abstraction (together with abstracted methods) can be introduced to the abstraction library and reused.
4.1. Class abstraction
To abstract a class we have to complete the following tasks:
– an abstract domain has to be specified,
An algorithm and case study for the object oriented abstraction
- a function mapping from concrete domain to the abstract one has to be specified,
- all methods (used in the verified program) of the class have to be abstracted.
They are described in [3] apart from the third one which is here substantially modified.
**Specifying an abstract domain**
An abstract domain is a set of values that objects of abstracted class can take. An abstract domain has to be chosen carefully. During the abstraction process we lose information about original program. However, we have to preserve enough to decide about properties of a program. Choosing proper abstractions is the key issue.
**Function mapping from concrete to abstract domain**
Given the abstract domain, we have to specify how real objects are to be mapped to abstract ones. We need to prepare a mapping from a concrete to an abstract domain (surjection).
4.2. Abstracting methods
Applying a method $m$ on an object $o$ in the concrete domain changes its state from $os_j$ (old value) to $os_j$ (new value). Applying abstracted method $m'$ (where $m' = \alpha(m)$) in the abstract domain should change state of an object $os_i$ to the other state $os'_j$, which is the abstraction of $os_j$ ($os'_j = \alpha_c(os_j)$):
\[
\begin{align*}
&os_i \xrightarrow{m(o)} os_j \\
&\downarrow \alpha(o) \quad \downarrow \alpha(o) \\
&os'_i \xrightarrow{m'(o')} os'_j
\end{align*}
\]
Because abstraction function $\alpha_c$ is narrowing, abstract methods are indeterministic. In fact, each method that in abstract domain leads to all abstract values of an object (we may say is fully indeterministic) is a well-defined abstract method. It is a trivial case. The goal is to decrease its indeterminism in order to use the model checking on abstract programs practically.
Preparing abstract methods can be automated with a theorem prover as shown in [12].
While operators have only one or two arguments methods may have multiple arguments. Moreover, some of them can be of different type or class from the class the method belongs to. These arguments require abstraction as well. There are two ways to manage this problem:
1. To provide a method abstraction separately for each combination of abstract argument types. Unfortunately, it causes exponential growth of the library due to the increasing number of abstraction domains.
2. To annotate the abstracted method in such a way that its behavior for a particular argument abstraction can be determined just in time. Methods abstracted in this way are stored in the library.
5. Abstracting program
Abstracting a program is a clue of the abstraction process. After this step an abstracted program is generated and, hopefully, it is small enough to be the model checked.
Because the whole abstraction algorithm is compatible with the Bandera toolset the program abstraction steps are similar. The difference is that while originally only types and operators are replaced with their abstract equivalents now also classes and methods have to be replaced. For a full description see [5].
Abstracted program may be expressed in the original language (i.e. Java).
6. Case study
This case study is described in details in [13]. The algorithm proposed in the paper was tested on a real application. The application being verified is a Java ME (CLDC/MIDP) program for mobile devices. It has more than 2000 code lines with 1 to 3 tasks running concurrently. It is a part of a language teaching system – Mnemonius [14].
During the final test phase on a real cellular phone (Nokia 6310i) there was a bug noticed. It caused that one of the texts showed on a screen appeared in a wrong place: at the top of a screen, while it should appear in the middle (see Fig. 1). It is a scrolled hint for a user. This malfunction was not notified in a development environment and it was noticed only once during all tests.
Fig. 1. The Mnemonius application screenshot
There are 2 concurrent tasks involved in the screen rendering. Thread A is responsible for the main part of a screen showing definition of a learned word at the top and the status line at the bottom. Thread B is responsible for scrolling hint for an user in the middle. The very bottom of a screen is maintained by the system and shows menu options.
Mobile applications have to be extremely small and stable. They run on devices with very limited resources. Because of that an application can not use sophisticated programming constructs and many tasks are simplified. In our case screen access among different tasks can not be fully separated. Tasks have to cooperate, exchange data and synchronize themselves.
The bug appeared only once. It was almost impossible to debug it traditionally, so we decided to try model checking. We decided to use the JavaPath Finder [16] model checker. The original application is a concurrent one and it was too big to verify it straightforward. It had to be reduced. The application was reduced as postulated in this paper. Irrelevant parts were omitted (slicing), classes (incl. API) were abstracted and finally some concurrent blocks of code were atomized. Atomization allowed to decrease significantly the state explosion problem.
There were 8 API classes with 30 methods abstracted. Also some application methods were abstracted. The abstraction was made manually, without preparing formal specification. It was based on documentation and no special tool used. Slicing and abstraction left only about 400 lines of code from the original program.
```java
protected void paint(Graphics g) {
Verify.beginAtomic(); //BEGIN ATOMIC BLOCK
...
Verify.endAtomic(); //END ATOMIC BLOCK
if (m_iScreenWidth==0) {
m_iScreenWidth=g.getWidth(); //ERROR
m_iStatusLineTop=iScreenH-font.getHeight()-2;
if (m_bShowHelpScroll)
m_iBottomLine=m_iStatusLineTop-font.getHeight();
else
m_iBottomLine=m_iStatusLineTop;
}
Verify.beginAtomic(); //BEGIN ATOMIC BLOCK
...
Verify.assertTrue(m_iStatusLineTop>50); //ASSERTION
g.drawString(sText,m_iScreenWidth-m_iVScrollHelpPos,m_iStatusLineTop+1,
...
Verify.endAtomic(); //END ATOMIC BLOCK
}
```
Fig. 2. Source code with the assertion line, atomic blocks and the error line
The question we asked (property being verified) was: Under what circumstances is the variable responsible for determining place for a hint line too low? There was no need to prepare a temporal logic predicate. Introducing assertion into the source code was enough. Reduction had to take into account what variable is to be preserved.
Assertion Violated
=================================== path to error (88 steps):
Step #0 Thread #0
jr\testscreens\Environment.java:12 Memo m=new Memo();
...
Step #36 Thread #0
jr\testscreens\NokiaLearnScreen.java:45 m_iStatusLineTop=0;
Step #56 Thread #0 Random #0
...
jr\testscreens\NokiaLearnScreen.java:86 m_scrollTask.start();
...
Step #66 Thread #0
jr\testscreens\NokiaLearnScreen.java:251 if (m_iScreenW==0)
Step #67 Thread #0
jr\testscreens\NokiaLearnScreen.java:253 m_iScreenW=getWidth();
Step #68 Thread #0
jr\testscreens\javax\microedition\lcdui\Canvas.java:51 return 100;
Step #69 Thread #0
jr\testscreens\NokiaLearnScreen.java:253 m_iScreenW=getWidth();
Step #70 Thread #0
jr\testscreens\NokiaLearnScreen.java:254
m_iStatusLineTop=iScreenH-
font.getHeight()-2;
Step #71 Thread #0
jr\testscreens\javax\microedition\lcdui\Font.java:35 return
m_iHeight; Step #72 Thread #1
...//thread #1 is being executed
Step #86 Thread #1
jr\testscreens\NokiaLearnScreen.java:251 if (m_iScreenW==0)
Step #87 Thread #1
jr\testscreens\NokiaLearnScreen.java:260 Verify.beginAtomic();
...
jr\testscreens\NokiaLearnScreen.java:285
Verify.assertTrue(m_iStatusLineTop>50);
===================================
1 Error Found: Assertion Violated
Fig. 3. Fragments of a detailed counterexample path
Also the artificial execution environment was prepared because model checking applies only to closed systems – no input can be provided from outside. It simulated starting the application and user input leading to the moment when the bug appeared. It was 1 class with about 20 lines of code.
There were several tries undertaken to verify the application. A few first attempts failed because the program was too big for the verifier. The verifier either used all possible memory or it took too long to finish. It was caused by a state explosion problem. Thus we had to reorganized atomic blocks. Proper atomization decreases unnecessary checking interleaved tasks.
The final verification pass took about 18 s on a 1 GHz Intel. The full counterexample path leading to an error was shown (see Fig. 3). Detailed path allowed quick error detection and removal.
7. Conclusions and future work
We proposed the idea for improving object oriented program abstractions in this paper. It appeared to have practical application. The proposed algorithm handles abstracting not only built-in types and operators but also user defined classes and their methods. It allows for abstracting (and hence for the verification by model checking) of much wider range of Java programs. The proposed method allows compositional approach to the model checking. As classes abstractions can be prepared in advance (and reused) a programmer may focus on verification of his/her program itself. It seems to be particularly useful when applied for API classes for which the abstractions can be specified (and proved) just by their developers.
Articles [9] and [15] present the way to prove specification of real Java programs. Also the rest of abstraction algorithm is sound according to [5]. Therefore the presented algorithm allows the completely formal examination of Java programs.
The case study exemplifies a way of verification object programs and it is a practical application of the proposed algorithm.
The algorithms presented above can be the valuable and practical contribution in the field of software verification. However, they are still under development and their testing on more examples is required.
Acknowledgements
This work has been supported by grant No. 7 T 11 C 013 20 from Polish State Committee for Scientific Research (Komitet Badań Naukowych).
References
[16] http://ase.arc.nasa.gov/visser/jpf, JavaPathFinder homepage
|
{"Source-Url": "http://journals.umcs.pl/ai/article/download/2965/2161", "len_cl100k_base": 4265, "olmocr-version": "0.1.53", "pdf-total-pages": 10, "total-fallback-pages": 0, "total-input-tokens": 22796, "total-output-tokens": 5567, "length": "2e12", "weborganizer": {"__label__adult": 0.0003943443298339844, "__label__art_design": 0.000247955322265625, "__label__crime_law": 0.0003981590270996094, "__label__education_jobs": 0.0005016326904296875, "__label__entertainment": 4.607439041137695e-05, "__label__fashion_beauty": 0.00014770030975341797, "__label__finance_business": 0.00013720989227294922, "__label__food_dining": 0.00032782554626464844, "__label__games": 0.0004982948303222656, "__label__hardware": 0.0006132125854492188, "__label__health": 0.0004723072052001953, "__label__history": 0.00016367435455322266, "__label__home_hobbies": 6.759166717529297e-05, "__label__industrial": 0.00029087066650390625, "__label__literature": 0.0002142190933227539, "__label__politics": 0.00026226043701171875, "__label__religion": 0.00042510032653808594, "__label__science_tech": 0.00527191162109375, "__label__social_life": 7.700920104980469e-05, "__label__software": 0.0030364990234375, "__label__software_dev": 0.9853515625, "__label__sports_fitness": 0.0003440380096435547, "__label__transportation": 0.0004544258117675781, "__label__travel": 0.0001939535140991211}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 22849, 0.03067]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 22849, 0.51211]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 22849, 0.89213]], "google_gemma-3-12b-it_contains_pii": [[0, 2227, false], [2227, 5246, null], [5246, 7725, null], [7725, 10111, null], [10111, 12286, null], [12286, 14066, null], [14066, 16403, null], [16403, 18315, null], [18315, 20883, null], [20883, 22849, null]], "google_gemma-3-12b-it_is_public_document": [[0, 2227, true], [2227, 5246, null], [5246, 7725, null], [7725, 10111, null], [10111, 12286, null], [12286, 14066, null], [14066, 16403, null], [16403, 18315, null], [18315, 20883, null], [20883, 22849, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 22849, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 22849, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 22849, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 22849, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 22849, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 22849, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 22849, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 22849, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 22849, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 22849, null]], "pdf_page_numbers": [[0, 2227, 1], [2227, 5246, 2], [5246, 7725, 3], [7725, 10111, 4], [10111, 12286, 5], [12286, 14066, 6], [14066, 16403, 7], [16403, 18315, 8], [18315, 20883, 9], [20883, 22849, 10]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 22849, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-10
|
2024-12-10
|
9f572eeb716a4edc493cf2da552636ff4b01e4ce
|
Software Greenability: A Case Study of Cloud-Based Business Applications Provisioning
Hayri Acar, Hind Benfenatki, Jean-Patrick Gelas, Catarina Ferreira da Silva, Gülfem Alptekin, Aïcha-Nabila Benharkat, Parisa Ghodous
To cite this version:
HAL Id: hal-01887065
https://hal.archives-ouvertes.fr/hal-01887065
Submitted on 3 Oct 2018
HAL is a multi-disciplinary open access archive for the deposit and dissemination of scientific research documents, whether they are published or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers. L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.
Software greenability: A case study of cloud-based business applications provisioning
Hayri Acar
*Univ Lyon, Université Claude Bernard Lyon 1*
LIRIS UMR 5205 CNRS
69621 Villeurbanne Cedex, France
hayri.acar@univ-lyon1.fr
Hind Benfenatki
University of Lyon, CNRS, INSA-Lyon
LIRIS UMR5205
Lyon, France
hind.benfenatki@insa-lyon.fr
Jean-Patrick GELAS
ENS GELAS
LIP, UMR 5668
69007 Lyon Cedex, France
jean-patrick.gelas@univ-lyon1.fr
Catarina Ferreira Da Silva
*Univ Lyon, Université Claude Bernard Lyon 1*
LIRIS UMR 5205 CNRS
69621 Villeurbanne Cedex, France
catarina.domingues-ales-ferreira-da-silva@univ-lyon1.fr
Gulfem I. ALPTEKIN
Galatasaray University
Department of Computer Engineering
Istanbul, Turkey
gisiklar@gsu.edu.tr
Aïcha-Nabila Benharkat
University of Lyon, CNRS, INSA-Lyon
LIRIS UMR5205
Lyon, France
nabila.benharkat@insa-lyon.fr
Parisa Ghodous
*Univ Lyon, Université Claude Bernard Lyon 1*
LIRIS UMR 5205 CNRS
69621 Villeurbanne Cedex, France
parisa.ghodous@liris.cnrs.fr
Abstract—The emission of CO2 due to ICT (Information and Communication Technologies) is found as equivalent to aviation sector. Although the energy consumption in ICT is due both to hardware and software. In recent decade, the energy efficiency studies focus on the hardware part, especially with the development of cloud computing. Indeed, it is the software application that is responsible for executing tasks, that indirectly affects the hardware energy consumption. This work focus on software energy consumption. We introduce a methodology which evaluates and improves the software greenability by considering its energy consumption, performance and readability. Contrary to existing methodologies, we associate the effect of several components (CPU, memory, disk and network) when estimating software energy consumption instead of considering only the CPU as it is the case in literature. Moreover, the proposed framework can dynamically examine source code to integrate some measurement functionality. A Tool to Estimate Energy Consumption (TEEC) is implemented and its applicability is demonstrated on the case of cloud-based business application provisioning software, called MADONA. MADONA allows dynamically generating service-oriented business applications by automatically composing business services and automatically deploying the generated applications on cloud environment.
Index Terms—Green IT, energy efficiency, cloud computing, use case, automatic business application provisioning
I. INTRODUCTION
Scientists have commonly stated that human activity is responsible for the increase of the earth’s atmospheric temperature mainly due to the greenhouse gases generated by energy production. Consequently, the United Nations Climate Change Conference, COP 21 (Conference of the Parties), has reasserted the aim of keeping the increase in temperature below 2°C by the end of the century. Moving to cloud is said to be a way of preserving the environment, stated also by a study commissioned by Microsoft and conducted by Accenture and WSP Environment & Energy [1]. In fact, this allows reducing energy consumption and carbon emissions by 30% or more compared to running the same applications on their own infrastructure. For small organizations (up to 100 users), carbon emissions reduce by up to 90%. For large corporations, the reduction is about 30% or more. As an example, according to Microsoft, in a large consumer goods company, 32% of net carbon emissions could be avoided by moving 50,000 email users in North America and Europe to a cloud [1].
Cloud greenability is due to dynamic provisioning (i.e. better management of usage peak), multi-tenancy (i.e. shared infrastructure), server utilization (i.e. workload optimization) and datacenter efficiency (i.e. to minimize energy use for a given amount of computing power). Even if the cloud infrastructure has been studied in terms of offering green solutions, there is a lack of developing sustainable and green software applications on the cloud. To this end, we introduce TEEC (Tool to Estimate Energy Consumption), which improves the source code quality of software by estimating its power consumption. The estimation is based on mathematical equations that take into account the CPU, the memory, the disk and the network together, instead of considering only the CPU consumption. Moreover, TEEC examines the source code and locates the parts that consume the highest amount of energy.
These parts then may be analyzed and optimized by software developers for improving the energy consumption of the code, its performance and its readability. In this paper, TEEC is used to improve the source code quality of MADONA, which is a framework for provisioning business application on cloud environments. Hence, MADONA will allow to select and compose business and cloud services, configure and deploy generated cloud-based business applications in a more ecologically friendly way.
The remaining part of the paper is organized as follows: Section 2 presents related works regarding energy consumption measurement methodologies. Section 3 briefly gives the main ideas of TEEC. Then, Section 4 describes the use case on which the efficiency of TEEC is evaluated. Sections 5 evaluates and discusses the findings, and Section 6 draws final conclusions.
II. RELATED WORK
In first studies of estimating the energy consumption, an online power calculator have been used. The energy consumption of each component (CPU, memory, disk, etc.) in a device was taken into account to approximately calculate global energy consumption of the device. This approach has helped, in particular, the game developers to build faster devices with better game performances. The disadvantage of these tools is the fact that it is not possible to estimate software energy consumption distinctly. Thus, researchers oriented their works to new methodologies in order to measure and/or estimate an application energy consumption with accuracy. This will both limit the negative impact of the software on the environment and optimize the source code quality for customer satisfaction.
A. Hardware methodologies
In recent literature, hardware methodologies have been frequently proposed to measure software energy consumption. A hardware device, such as a power meter, is used to measure the global system energy consumption or several sensors are directly connected to the component to measure this component’s energy consumption. Thus, hardware methodologies can be grouped in two categories: Power meter-based, and sensor-based. Power meter performs current and voltages measurements to directly calculate power consumption in Watts [2], [3]. This device also measures and logs different types of data, such as current, voltage, power usage, energy consumption, etc. These data are then stored on the device memory or sent to a computer. Then related curves in terms of time or graphical representations are generated. In the second group [4], [5], energy consuming components are listed in advance and one directly connects customized power sensors on them. Generally, high performance servers use this technique [4].
In general, hardware methodologies are found to be more accurate than the hybrid and software methodologies. However, there are several important limitations. With hardware methodologies, it is not possible to measure the energy consumption of a particular process and virtual machines. Moreover, the required devices may be expensive and they can also consume energy themselves.
B. Hybrid methodologies
The goal of hybrid methodologies is to combine accuracy of hardware methodologies and simplicity of software methodologies [6]. Unfortunately, proposed tools use a hardware device to measure the total energy consumption and a software to manage the collected data. Hence, it is complicated to distinguish them. Moreover, adding several hardware can imply additional energy consumption, which can be more than the saved energy.
C. Software methodologies
Instead of direct measurement, software methodology involves mathematical formulae, which are determined for each component, with respect to its characteristics. Usually, simplifications and assumptions are adopted depending on the area of study. In the majority of proposed methodologies, only the CPU power consumption is taken into account, whereas the other components (memory, disk, network, etc.) are neglected. The lack of information can cause unsatisfactory and incorrect results. In a power measurement tool, accuracy and completeness are fundamental. In Table I, we summarize tools proposed to estimate software energy consumption. Each tool focuses on one component only, and neglects the others.
There is a lack of a tool for the estimation of software power consumption taking into account several components (CPU, memory, disk, network) together. This is our motivation in this paper. We integrated this capacity in our methodology, even if the energy consumed by a component can be neglected in several situations. Among the proposed methodologies in literature, we have not encountered a study that examines the effects of source code on energy consumption. The most related ones propose a manual approach, which require integrating several functions to the source code. However, the manual approach can be complicated, boring or expensive for developers. It requires that the developers be experts or co-work with experts. Thus, a tool allowing to dynamically locate the hotpoints during runtime of software would simplify the tasks of developers.
III. TEEC (TOOL TO ESTIMATE ENERGY CONSUMPTION)
We developed TEEC (see Figure 1) (Tool to Estimate Energy Consumption) that operates both on Windows OS, and on GNU/Linux. TEEC allows estimating energy consumption of Java programs taking into account the CPU, memory, disk and network consumptions. Our prototype uses Sigar [12] Javassist [13] libraries, which allow to provide Java agents with the capability to load the content of classes at runtime in the JVM, and to modify a class file when the JVM loads it and/or define a new class at runtime, respectively.
As illustrated in Figure 2, insertBefore and insertAfter Javassist methods allow to modify methods (methodName) in a class (className) by adding several lines of code at the beginning and/or at the end of these methods without...
<table>
<thead>
<tr>
<th>Tools</th>
<th>Component considered</th>
<th>Description</th>
<th>Limits</th>
</tr>
</thead>
<tbody>
<tr>
<td>Intel Power Gadget [7]</td>
<td>CPU</td>
<td>A software-based power usage monitoring tool enabled for Intel Core processors. Monitor and estimate real-time processor package power information in Watts using the energy counters in the processor</td>
<td>Estimate the power consumption due to CPU only. It is not possible to estimate the power consumption of a specific process.</td>
</tr>
<tr>
<td>Orion [8]</td>
<td>Network</td>
<td>A power performance interconnection network simulator that is able to provide power features, in addition to performance features, to allow rapid power performance trade-offs at the architectural level</td>
<td>Dynamic power is formulated depending on the switching activity, the clock frequency, the switch capacitance and the supply voltage. Only a total network power consumption is estimated.</td>
</tr>
<tr>
<td>MIND [9]</td>
<td>Disk</td>
<td>A black box power model for RAID arrays. It is designed to quantitatively measure the power consumption of redundant disk arrays running different workloads in several execution modes. Five modes (idle, standby and several types of access) and four actions have been defined to precisely characterize power states and changes of RAID arrays</td>
<td>Energy consumption by four types of actions and power consumption in five types of modes are modeled depending on controller and disks. Only disk arrays power consumption are estimated.</td>
</tr>
<tr>
<td>CACTI-D [10]</td>
<td>Memory</td>
<td>It adds support for main memory DRAM chip organization and support for modeling of commodity DRAM technology. It allows modeling of the complete memory hierarchy with consistent models all the way from SRAM based L1 caches through main memory DRAMs on DIMMs</td>
<td>Using benchmarks with large data sets architectural simulation is performed. The execution time results, power breakdown in the memory hierarchy and system energy delay product for the different system configurations are presented. It is a tool limited to the modelization of the DRAM.</td>
</tr>
<tr>
<td>SPAN [11]</td>
<td>CPU</td>
<td>A two-level power model that estimates per core power dissipation on CMP (Chip Multi Processor) on the fly by using only one CMP and frequency information from CPUs. SPAN is a software power analyzer, which identify behavior of power associated with software source code manually. Given an application, SPAN is able to determine its power dissipation rate at the function-block level</td>
<td>Only the energy consumed by CPU is considered. In this case, programmers need to use specific function manually (span-create(), span-open(), span-start(), span-stop(), etc.) to call the SPAN APIs. Not easy for developers. Simplicity and adaptability aspects are more emphasized than accuracy.</td>
</tr>
</tbody>
</table>
In this work, we are interested only in dynamic power consumption. Now, let us represent the power model of each component.
1. CPU
Power consumption of CPU is calculated as the multiplication of frequency, square of voltage and a constant. We propose an equation (1) that is distinguished from others with its constant part:
$$ P_{CPU} = \beta \cdot f \cdot V_{dd}^2 $$
(1)
where $\beta = CL.N.\alpha$ is the constant, CL is the capacitance, N represents the number of gates and $\alpha < 1$ is the average fraction of gates that commute at each cycle, f is the frequency and $V_{dd}$ corresponds to voltage. In order to obtain the power consumed by a specific process, we multiply (1) by the percentage of the process id, $N_{id}$:
$$ P_{id} = P_{CPU} \cdot N_{id} $$
(2)
deployed and made available to the user. Where the user introduces her requirements through a Web-oriented development and deployment on cloud environment, MADONA [14]. MADONA allows automatic service-oriented development and deployment on cloud environment, where the user introduces her requirements through a Web form, and a business application is automatically generated, deployed and made available to the user.
This section presents the use case to be evaluated. It consists of the prototype of a Method for AutomateD provisioning of clOud-based component-oriented busiNess Applications (MADONA) [14]. MADONA is composed of three levels as follows:
1. The interface level (Level 1 of Figure 3) allows communication with the user. It is composed of controllers and views representing the MADONA Web interfaces.
2. The application level (Level 2 in Figure 3) enables the generation and deployment of composition plans. It consists of Java classes, distributed over five packages (Engine, Ranking, Config, Deployment, Integration) as follows:
(a) Engine: this package is responsible for generating the composition plans based on the requirements of the user.
(b) Ranking: this package deals with calculating the QoS rating of a service and a composition plan.
(c) Config: this package contains the class "CompositionPlanConfig", which allows to generate the Juju configuration script of a business service from the configuration data entered by the user via the configuration Web form. The constructor of this class takes as input the name of the service to configure, its configurable parameters, as well as the configuration data to generate the configuration script, which will
\[
P_{CPU, id} = P_{CPU} \cdot N_{id}
\] (2)
2. Memory
The power of dynamic DRAM covers four states: active, precharge, read and write. Power consumption can then be expressed as (3):
\[
P_{Memory} = P_{Active} + P_{Precharge} + P_{Read} + P_{Write}
\] (3)
We multiply previous equation (3) by the usage percentage \( M_{id} \) of the process id to obtain Eq. (4):
\[
P_{Memory, id} = P_{Memory} \cdot M_{id}
\] (4)
3. Disk
While executing a sequence of requests, a disk can be in one of the four states: active, idle, standby and sleep. The dynamic disk power consumption is obtained when the disk is in active mode. Thus, we can deduce the following equation :
\[
P_{Disk, dynamic} = P_{Active} = P_{Read} + P_{Write}
\] (5)
\[
P_{Disk, dynamic} = P_{DiskRead} \cdot B_{Read} + P_{DiskWrite} \cdot B_{Write}
\] (5)
Where \( P_{DiskRead} \) and \( P_{DiskWrite} \) are, respectively, the power consumption of disk read and write, \( R_{DiskRead} \) and \( R_{DiskWrite} \) are the rate of disk read and write, \( B_{Read} \) and \( B_{Write} \) represents the bytes read and write by the process at runtime.
4. Network
In this study, we assume that the network power consumption is related to the main activity of transmitting and receiving bytes. Thus, we establish the following equation:
\[
P_{Network} = P_{Receive} + P_{Transmit}
\] (6)
\[
P_{Network} = P_{Transmit} + P_{TransmitBytes} \cdot NetT
\] (6)
where NetR is Network Received bytes, \( P_{ReadBytes} \) represents the maximum power received, NetT is Network Transmit bytes and \( P_{TransmitBytes} \) corresponds to the maximum power transmit. \( P_{ReadBytes} \) and \( P_{TransmitBytes} \) are data obtained by the manufacturer specifications.
IV. USE CASE
This section presents the use case to be evaluated. It consists of the prototype of a Method for AutomateD provisioning of clOud-based component-oriented busiNess Applications (MADONA) [14]. MADONA allows automatic service-oriented development and deployment on cloud environment, where the user introduces her requirements through a Web form, and a business application is automatically generated, deployed and made available to the user.
be stored in the MADONA shell directory.
d) Deployment: this package is responsible for deploying the application corresponding to the selected composition plan. MADONA relies on the Juju Orchestrator to manage the deployment, configuration, and composition of business services. It generates the deployment and configuration scripts, and runs them on the Juju server via Open-SSH.
e) Integration enables the integration of new business services into the marketplace. We implemented five classes, which provide capabilities to integrate new services into the marketplace.
3. The service level (Level 3 in Figure 3) represents the marketplace of services. It consists of extended Linked USDL (Unified Service Description Language) descriptions of marketplace services, XML-formatted QoS files, and distributed business services’ packages. The Marketplace elements are used when discovering, composing, scoring, configuring, and deploying services.
V. EVALUATION
We evaluate the green dimension of MADONA regarding the energy consumption, performance and readability aspects.
A. Energy consumption
Energy consumption is evaluated following both software (using the proposed TEEC) and hardware (using a power meter) methodologies for comparison purposes. Figures 4 and 5 compare the variation of energy consumption of optimized and non-optimized MADONA source code with 10 users, who use MADONA sequentially using TEEC and a power meter, respectively. In both figures, we can observe that optimized MADONA consumes less energy than the non-optimized one and it ends in less time, which is the reason why the curve’s peaks do not occur at the same time.
The total energy consumption while executing MADONA corresponds to the area of the curve representing the energy consumption as a function of time according to the formula \( E = P \cdot T \) where \( E \) is the energy (Joules), \( P \) is the power (Watt) and \( T \) represents the time (Seconds). While executing MADONA with 10 users using respectively non-optimized and optimized codes, the energy consumption goes from 985.8 Joules for power meter and 968.484 Joules for TEEC to 373.5 Joules for power meter and 368.523 Joules for TEEC; thus saving 612.3 Joules (62% less).
In Figures 4 and 5, we note that the gain of average margin of error of TEEC compared to the power meter is equal to 1.76% for non-optimized MADONA and 1.33% for optimized MADONA.
B. Performance
Source code quality improvement of MADONA implies reducing the execution time. Figure 6 illustrates the execution time of MADONA in respect to 1, 10 and 100 users. The figure shows that the time saving is significant allowing to save at least 34% of execution time. In fact, for one user, our tool allowed to save 56% of execution time; for 10 users, it allowed to save 34% of execution time; and for 100 users, it allowed to save 38% of execution time.
Table 2 illustrates several examples of used techniques, which allowed us to save execution time in some parts of

source code. Here, the saved times are calculated for one user executing MADONA.
These positive results show us the importance to improve the source code quality to obtain efficient, sustainable and green software.
C. Readability
In a context that is more and more collaborative, readability of source code becomes essential. In fact, it allows analysts to review source code in a faster way, which implies an energy economy due to time saving. This is why we are considering the readability criterion in this work. We reduced MADONA source code from 3571 to 2134 lines (1437 less lines, which corresponds to 40% of reduction in code size). This has been done by eliminating non-used portions of code, and those allowing to display control messages used by developers.
VI. CONCLUSION
In this paper, we describe a methodology and a tool to evaluate software energy consumption and to improve software quality in respect to three dimensions: energy consumption, performance and source code readability. As the demonstrative example, we have evaluated a software for provisioning cloud business application, called MADONA. The evaluations demonstrate the accuracy and efficiency of TEEC. In fact, TEEC estimation error rate of energy consumption is lower than 2%, which is commonly acceptable. Moreover, MADONA execution time decreased from 145s to 140s for 10 executions, number of lines of source code decreased from about 3000 lines to 2000 lines. Moreover, non-optimized MADONA program consumes 5000 Joule, whereas the optimized one consumes 2000 Joule. This energy gains correspond approximately to the nonstop operating power of a computer during one year.
TABLE II
DETAILS OF TIME CONSUMPTION OPTIMIZATION
<table>
<thead>
<tr>
<th>Parts</th>
<th>Saved time (ms)</th>
<th>Remarks</th>
</tr>
</thead>
<tbody>
<tr>
<td>Composition plan generation</td>
<td>18</td>
<td>Variables allowing to read the files have been deleted. Some attributes were used only in one method, consequently we change them as a variable of the concerned method.</td>
</tr>
<tr>
<td>Composition plan ranking and selection</td>
<td>5855</td>
<td>Inside the loop, a default model was created and a file was opened with the format TTL (Turtle), whereas it is more efficient to do these tasks before beginning the loop in order to do only one model creation. We also avoid using the collection’s length in the declaration of the loop’s parameters in order to call the length method only one time (before the loop).</td>
</tr>
<tr>
<td>Generated application configuration and deployment</td>
<td>3524</td>
<td>SPARQL (SPARQL Protocol and RDF Query Language) have been improved in removing line break at the end of each line. Not used variables have been deleted. The same improvement regarding the declaration of the size of a loop. For reading/writing files, we replaced the methods used in the original code of MADONA by the new ones defined in Java 8, which are more optimized and more readable.</td>
</tr>
</tbody>
</table>
As future works, TEEC will integrate energy consumption measurements for physical resources in cloud environment. This will be done by defining a middleware, which communicates with public and private cloud APIs to collect measurement data. APIs differ according to the cloud providers. We will then define translation rules for communication among these APIs.
REFERENCES
|
{"Source-Url": "https://hal.archives-ouvertes.fr/hal-01887065/file/IEEE_CLOUD_2018_paper_150.pdf", "len_cl100k_base": 5492, "olmocr-version": "0.1.53", "pdf-total-pages": 9, "total-fallback-pages": 0, "total-input-tokens": 23207, "total-output-tokens": 6822, "length": "2e12", "weborganizer": {"__label__adult": 0.00035381317138671875, "__label__art_design": 0.0003490447998046875, "__label__crime_law": 0.00035762786865234375, "__label__education_jobs": 0.0004181861877441406, "__label__entertainment": 9.042024612426758e-05, "__label__fashion_beauty": 0.00015532970428466797, "__label__finance_business": 0.0005254745483398438, "__label__food_dining": 0.0003814697265625, "__label__games": 0.00063323974609375, "__label__hardware": 0.0029582977294921875, "__label__health": 0.0007748603820800781, "__label__history": 0.0002803802490234375, "__label__home_hobbies": 0.0001291036605834961, "__label__industrial": 0.0005869865417480469, "__label__literature": 0.00022208690643310547, "__label__politics": 0.0002856254577636719, "__label__religion": 0.0003657341003417969, "__label__science_tech": 0.130615234375, "__label__social_life": 9.185075759887697e-05, "__label__software": 0.017303466796875, "__label__software_dev": 0.841796875, "__label__sports_fitness": 0.00028395652770996094, "__label__transportation": 0.0006561279296875, "__label__travel": 0.0002598762512207031}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 29036, 0.0406]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 29036, 0.68639]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 29036, 0.87392]], "google_gemma-3-12b-it_contains_pii": [[0, 1230, false], [1230, 5747, null], [5747, 11678, null], [11678, 15581, null], [15581, 19451, null], [19451, 22511, null], [22511, 24176, null], [24176, 27227, null], [27227, 29036, null]], "google_gemma-3-12b-it_is_public_document": [[0, 1230, true], [1230, 5747, null], [5747, 11678, null], [11678, 15581, null], [15581, 19451, null], [19451, 22511, null], [22511, 24176, null], [24176, 27227, null], [27227, 29036, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 29036, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 29036, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 29036, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 29036, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 29036, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 29036, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 29036, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 29036, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 29036, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 29036, null]], "pdf_page_numbers": [[0, 1230, 1], [1230, 5747, 2], [5747, 11678, 3], [11678, 15581, 4], [15581, 19451, 5], [19451, 22511, 6], [22511, 24176, 7], [24176, 27227, 8], [27227, 29036, 9]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 29036, 0.07362]]}
|
olmocr_science_pdfs
|
2024-12-10
|
2024-12-10
|
5bbab007fb04afb63d152e758dd069f8410c3cd4
|
[REMOVED]
|
{"len_cl100k_base": 6841, "olmocr-version": "0.1.53", "pdf-total-pages": 8, "total-fallback-pages": 0, "total-input-tokens": 25952, "total-output-tokens": 9812, "length": "2e12", "weborganizer": {"__label__adult": 0.0003783702850341797, "__label__art_design": 0.0005702972412109375, "__label__crime_law": 0.0003790855407714844, "__label__education_jobs": 0.0012674331665039062, "__label__entertainment": 0.00014019012451171875, "__label__fashion_beauty": 0.00019669532775878904, "__label__finance_business": 0.0004553794860839844, "__label__food_dining": 0.0003840923309326172, "__label__games": 0.0005631446838378906, "__label__hardware": 0.0035419464111328125, "__label__health": 0.0007643699645996094, "__label__history": 0.00046706199645996094, "__label__home_hobbies": 0.00013494491577148438, "__label__industrial": 0.0006513595581054688, "__label__literature": 0.0003216266632080078, "__label__politics": 0.0003113746643066406, "__label__religion": 0.0005855560302734375, "__label__science_tech": 0.3154296875, "__label__social_life": 0.00014531612396240234, "__label__software": 0.0196533203125, "__label__software_dev": 0.65234375, "__label__sports_fitness": 0.00025272369384765625, "__label__transportation": 0.0007991790771484375, "__label__travel": 0.0002363920211791992}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 42920, 0.02811]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 42920, 0.27956]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 42920, 0.88656]], "google_gemma-3-12b-it_contains_pii": [[0, 3475, false], [3475, 9388, null], [9388, 15498, null], [15498, 21565, null], [21565, 27587, null], [27587, 34671, null], [34671, 42920, null], [42920, 42920, null]], "google_gemma-3-12b-it_is_public_document": [[0, 3475, true], [3475, 9388, null], [9388, 15498, null], [15498, 21565, null], [21565, 27587, null], [27587, 34671, null], [34671, 42920, null], [42920, 42920, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 42920, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 42920, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 42920, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 42920, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 42920, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 42920, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 42920, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 42920, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 42920, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 42920, null]], "pdf_page_numbers": [[0, 3475, 1], [3475, 9388, 2], [9388, 15498, 3], [15498, 21565, 4], [21565, 27587, 5], [27587, 34671, 6], [34671, 42920, 7], [42920, 42920, 8]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 42920, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-06
|
2024-12-06
|
ac96550169a027f0b509fa16611a43291ce56240
|
Project A: Extending Red, White, and Blue
In this first project, you will work on understanding the implementation of a small map-based web application, Red, White, and Blue, which we will refer to as RWB, and extending it to add additional functionality.
The project can be done individually or in groups of two or three. The goal here is for you to understand, top-to-bottom how a database-backed web application works.
Before you start
Read the handout “Using Databases in the Web Of Things Environment”. This will explain how to log in to the server, how to configure your environment, and how to access oracle using SQL*Plus. Make sure that your environment is working correctly.
Getting and installing RWB
To install RWB, log into your account on the server and do the following:
```
cd ~/www
tar xvfz ~/pdinda/339/HANDOUT/rwb/rwb.tgz
cd rwb
more README
```
The README file will give you detailed instructions on how to configure RWB and verify that it is working. You should be able to visit your RWB instance via https://murphy.wot.eecs.northwestern.edu/~you/rwb/rwb.pl. It is important to use https – Google Maps will not work correctly without it.
Note that you will need to change the rwb.pl code to reflect your Oracle account, and your Google Maps key. If you don't have a relevant Google Cloud account to get a Google Maps key, you can easily create one and the default account credit should be more than sufficient for this lab. You will probably want to restrict the use of your key to our host machine.
Once you have it installed, what you will see is a map view centered on your current location, which is indicated with an additional marker. The map will update as you move, and you can zoom and scroll the map manually as well. In addition to the marker signifying you, you will also see additional markers. These represent the locations of political committees (political parties, election committees, PACs, SuperPACs, etc, for example) that lawfully spend money to affect elections.
By default, you are logged into the application as an anonymous user, and can only view the map and log in as a registered user. A registered user typically has more functions, which appear below the map. As initially configured, the only registered user is the “root” user, which has all functions available, including the ability to register new users, and to grant and revoke their permissions.
What does RWB do?
The goal of RWB is to provide a user with a view of the political activity in his/her vicinity that affects elections for national offices, a view that combines the following sources of information.
- Federal Election Commission (FEC) data. The FEC is responsible for implementing federal campaign finance laws that apply to all entities involved with fundraising, spending, advertising, etc, in elections for national offices. As part of this effort, the FEC makes available disclosures, for every election cycle, of committees, candidates, and individual contributors. We have imported this data into an Oracle database for use with RWB, and other parts of the class. The database currently covers election cycles (1980-2018) and contains over 96,000 candidate records, over 218,000 committee records, millions of committee-to-candidate transactions, and 10s of millions of individual contributions.
- Geolocation data. The FEC identifies the addresses of the entities it tracks. Where possible, we have used an open source geolocation database to translate these addresses into map coordinates, specifically latitude and longitude. The geolocation database is also available to you.
- Crowdsourced data. RWB users will be able to provide additional information, outside of the scope of the FEC data, such as an opinion of the politics of a location, and (maybe) improved geolocation information for FEC entities. Such data will be incorporated into the view that other RWB users see.
Out-of-the-box RWB simply shows the FEC committee data for the current election cycle on the map. Over the course of the project, you will extend it to do the following:
- Include candidate, individual, and opinion data in the map view alongside the committee data. The user will be able to select what information to show.
- Aggregate the FEC information to show the total political funds, and funds by party, for the current map view. This information will be shown as both dollar amounts and as a color, the “color of the money”, ranging from red to blue.
- Aggregate the opinion information to an overall opinion of the “color of the opinion” of the current map view, also ranging from red to blue.
- Have the ability for existing registered users to invite new users.
- Collect opinion data from registered users.
How does RWB work?
The entire state of RWB exists in the Oracle database. There are two parts to the schema. The FEC and geolocation data are kept in a read-only database in the CS339 account, while the parts of the schema that need to be written by students (users, opinions, user-supplied geolocations, etc) are kept in their own accounts. The file `rwb.sql` describes the non-shared application data. This is where you may make changes.
The shared FEC data model is described in `~pdinda/339/HANDOUT/rwb/fec`. Note that there is a lot of complexity to this, but for the most part, the example code in RWB illustrates the relevant tables and columns for this project. Also, the tables we use for the shared FEC data follow the data schemas given on the FEC web site as closely as possible (`http://www.fec.gov/finance/disclosure/ftpdet.shtml`). They are described there.
as “data dictionaries”. The corresponding SQL for these tables is in ~pdinda/339/HANDOUT/rwb/fec/ora. There are two primary changes that we have made. First, the information about a given class of entities (e.g., committees) from all election cycles is kept in the same table, and a new column indicates the specific election cycle for a record. For example, the committee_master table contains committee records from all cycles. If you want to find committee records for a specific cycle, you need to query the table specifically for that cycle. The second change is that there are additional tables that we have created that map specific entities to their geographical coordinates. For example, the cmte_id_to_geo table, maps from committee records in the committee_master table to their latitude and longitude. Similarly, the cand_id_to_geo table, maps from candidate records in the cand_master table to their latitude and longitude. These mappings are reasonably accurate since the FEC provides detailed address data. The ind_to_geo table maps from individual contribution records in the individual table to their latitude and longitude, but these are very inaccurate since the FEC only provides zip code information (at best). These geolocation tables are defined in ~pdinda/339/HANDOUT/rwb/geo. Note that both the fec and the geo directories contain scripts and other tools that we use to import and construct data. You only need to consider the SQL files.
Outside of the shared FEC and geolocation data, the state of RWB consists of the following tables, which are defined in the rwb.sql file. The rwb_users table contains the username, password\(^1\), and email address of each RWB user, as well as the name of the user who referred him. The rwb_actions table contains the names of all the possible actions that a user may take in RWB. The rwb_permissions table maps from RWB usernames to the actions that they have permission to take. An action should only be taken if the action exists in the rwb_actions table, the user exists in the rwb_users table, and the user has permission for the action in the rwb_permissions table. By default, the following actions are made available:
- query-fec-data – can query the FEC data
- query-opinion-data – can query the crowdsourced opinion data
- query-cs-ind-data – can query the crowdsourced individual geolocation data
- give-opinion-data – can provide opinion data
- give-cs-ind-data – can provide individual geolocation data
- invite-users – can invite a new user to the system
- add-users – can explicitly add a new user to the system
- manage-users – can add/remove users and their permissions.
Two users are added by default: root, with password rootroot, who can do anything, and anon, with password anonanon, who can only query the FEC and opinion data. A typical user that is registered or invited by root will be able to query all data, give opinion data, and invite or add new users. The actions that an invited or added user can take is a subset of the actions the inviting or adding user can take. Notice that users form a tree, with each user pointing to the user who invited or added him, and having a subset of that user’s abilities.
---
\(^1\) The password is stored in clear text in the database, which is highly insecure. This is for pedagogical purposes only – a real system should not do this.
The **rwb_opinions** table provides a mapping from a geolocation and user to a “color” represented by a number in the range -1 (red) through 0 (white) to +1 (blue). The purpose of this table is to provide a starting point for the crowdsourced opinion component of the project. This is a starting point. You are welcome to change the representation as you choose.
The **rwb_cs_ind_to_geo** table provides a mapping between an individual contribution and the geolocation of its origin. The idea here is to improve the information provided by FEC for individual contributions through crowdsourcing. A record in the table also points to its requesting user, the submitting user, and third user who has validated the submission. The purpose of this table is to provide a starting point for the crowdsourced individual geolocation extra credit. You can ignore this table if you don’t want to do this extra credit.
RWB has a notion of user sessions. Most of the state of a user session exists within the client, namely the HTML and JavaScript data that the user’s web browser display and use. However, a portion of the state, namely the login credentials, is shared between the client and the server. This sharing is done in the form of a cookie named **RWBSession**. When users log into RWB they are given a cookie that contains their login name and password in cleartext (this is not secure!) and is set to expire in about one hour. Without a cookie, the user is treated as the “anon” user. When presented with a cookie, RWB uses its contents to authenticate the user and check to see if he has the necessary permissions (authorization) to do what he wants.
RWB is implemented in a “three tier” style. The client or “presentation tier” consists of HTML and JavaScript that is running in the user’s web browser. The HTML is dynamically generated by **rwb.pl**, while the relevant JavaScript is in the file **rwb.js**. The RWB client code in **rwb.js** also makes use of the Google Maps API to show and decorate the map. The client code uses the browser’s geolocation API to determine its current location and when the location changes, and it registers a callback so that is informed whenever the user scrolls or zooms the map. The client code may fetch more information and manipulate the map based on it. It does so by issuing a request and having the callback dump the results into a hidden portion of the HTML. More complicated user interactions are done with web forms.
The middle tier or “logic tier” consists of **rwb.pl**, a Perl CGI script that is run by the web server. There are basically three kinds of interaction modes between the client and server. First, **rwb.pl** generates the entire HTML and JavaScript for the client. Second, **rwb.pl** handles forms submitted by the client. Finally, **rwb.pl** can return raw data to the client-side JavaScript. The code is designed so that every invocation of **rwb.pl** is essentially handled as an HTML form submission. The script’s activity is governed by the cookie, and the act and run parameters. A special **debug** parameter, when set to 1 will add information to the HTML about the parameters, cookies, SQL commands being run, and their outputs.
The third tier, or “data tier” consists of the database, which combines the **rwb.sql** and shared FEC data schemas. The logic tier (**rwb.pl**) speaks to the data tier using Perl’s
DBI interface, which is an example of a “dynamic SQL” interface. In response to an invocation, `rwb.pl` will generate and run one or more statements of SQL, and then generate HTML based on their results.
The following is a more detailed description of an RWB session:
- The user visits [https://murphy.wot.eecs.northwestern.edu/~you/rwb/rwb.pl](https://murphy.wot.eecs.northwestern.edu/~you/rwb/rwb.pl)
- `rwb.pl` notices there is no cookie, and thus assumes that the user is anonymous. Since no action is given, it also assumes the action is “base”, which means to generate the baseline client page. It therefore generates a default HTML page, with embedded references to `rwb.js` and other components.
- The user’s browser parses and displays the HTML. As part of this, it executes the associated JavaScript in `rwb.js`:
- `rwb.js` issues a request for the current location, registering a callback function.
- Once the location is determined, the callback is executed, and it edits the HTML to add a new map object, centered at that location. It also registers callbacks for any change in the bounds, center, or zoom-level of the map, and a callback for any change in position of the user.
- Once the map is created, the bounds callback fires. The callback function then determines the current map center and bounds, and issues a new request back to the server, invoking `rwb.pl` again, but this time with the “near” action, which will return data about committees within the view. This request includes another callback function.
- `rwb.pl` is invoked again, with the “near” action and the bounds. It then issues a database query to find the relevant committees, and returns them as a very simple HTML document.\(^2\)
- When the document has made its way back to the client, the request callback function (in `rwb.js`) is fired. It takes the data and places it into a hidden division in the HTML, caching it locally. It then parses the data and uses it to add markers to the map for each of the committees.
- Whenever the map view changes or the user's location changes, the callback functions that are fired essentially repeat the previous three steps.
Beyond map interaction, which is mediated by `rwb.js`, the user can also invoke forms. The following description is what happens for a login form:
- If the user presses the login link, `rwb.pl` is invoked again, with the “login” action, and “run” set to zero. As a result, the page `rwb.pl` generates will consist of a login form.
- The user fills out the login form and hits submit.
- `rwb.pl` is invoked with the “act” parameter set to “login”, and the “run” parameter set to 1.
\(^2\) This is even simpler than JSON, for those who are familiar with that. The intent of the RWB is to be entirely self-contained except for the maps and the database. A web app framework is **not** used because we want you to see everything between the database and the user.
o \texttt{rwb.pl} extracts the “user” and “password” parameters provided by the form, and does a SQL query to see if the combination exists in the database.
o If the combination exists, it creates a cookie with the combination and passes it back to the user’s browser. Next, it displays the base page again. On generating the base page, for every action the user could take, it will produce a link. At minimum, this will now include a “logout” link. Logout is handled by expiring the client cookie.
\textbf{Debug Functionality}
If you invoke \texttt{rwb.pl} with the debug flag, for example \url{https://murphy.wot.eecs.northwestern.edu/~you/rwb/rwb.pl?debug=1}, it will provide a detailed view of the cookies, parameters, and SQL operations that are performed, as well as their results.
Syntax errors in \texttt{rwb.pl} can be annoying, since they will be reported by your browser as internal server errors. If you run \texttt{rwb.pl} from the command-line on murphy, it will show any syntax errors in a cleaner way.
Sometimes it is essential to see what is happening on the server side on a script execution. \textit{We have made the server side logs visible to you for such debugging. The logs are in /var/log/httpd/*, with access_log and error_log being the most important.}
JavaScript (\texttt{rwb.js}) and HTML is best debugged in the browser. If you are using Chrome, you can select Tools->Developer Tools from the menu. This will open a set of very useful tools. The “Elements” tab will show you a breakdown of your HTML, as Chrome has parsed it. Any JavaScript or related errors will show up in the Console tab, and if you click on an error, it will show you the specific line of code that’s failing. The Sources tab gives you access to the JavaScript Debugger. The Network tab will show you the network requests that are being made. Safari and Firefox have similar tools. We generally use Firefox or Chrome.
\textbf{Project Steps}
In this project, you will extend RWB to provide the following functionality. Each extension is marked with a percentage that is intended to reflect its perceived difficulty level. You may do the extensions in any order, although we believe the order presented will be the easiest. We believe the best approach to building each extension is the following:
1. Read and understand \texttt{rwb.sql}, the fec and geo SQL files, \texttt{rwb.pl}, and \texttt{rwb.js}. You may find it very useful to use the debugging tools described above to help you.
2. Design the SQL statements that are needed
3. Test the SQL statements using SQL*Plus.
4. Embed the SQL statements into Perl functions (see UserAdd(), for example)
5. Write the Perl logic to call the functions based on form parameters
6. Write the JavaScript (if needed) to use the data returned by \texttt{rwb.pl}
You should avoid becoming bogged down in the Perl, and, especially, the JavaScript and HTML, parts of the code. As this is a databases course, you will be graded on correctness, not the appearance of the final product. Just ask us for help in person or in the discussion group if you can’t figure something out.
**Extending queries (40%)**: As handed out, only committee data for the map region and the current election cycle is included in the map view. Extend this to include candidate and individual data for a selection of election cycles. The user should be able to select (using checkboxes, for example) which FEC data they want to see (any combination of committee, candidate, and individual) and for which election cycles (any combination of election cycles). In your implementation, all filtering of the data by the selections needs to happen in SQL. That is, the only data that should be transferred from rwb.pl to your client is the data that will be shown. The most straightforward way to achieve this is to extend the “near” action with additional parameters and have the code for the action construct the appropriate SQL queries based on those parameters. Also, your implementation must determine the available election cycles dynamically, by querying the database. In this way, your code will work correctly for future election cycles.
This part of the project will teach you, among other things, about basic SQL SELECT FROM WHERE queries, as well as JOINs, since the geolocation and FEC data are in distinct tables. It will also teach you about dynamic query construction (writing code that writes the code of the query).
**Crowdsourcing opinions (30%)**: Here, you will add the ability for users to extend the database with opinions. As the starting point of implementing this functionality, you will need to add the ability to invite users. Out of the box, RWB really only lets root explicitly add users. If a user has the “invite-users” permission, the application should give him a form in which he gives the email address of a user he’d like the invite. The system should then send mail to that user with a special, one-time-use link they can use to create an account. The created account should have a subset of the permissions of the inviter.
Any user with the “give-opinion-data” permission should see a simple interface where they can assign a political “color” to their current location. This assignment will then be sent back to rwb.pl, which will put it into the rwb_opinion table. In turn, your query interface should be extended to include these opinions along with the FEC data. Any user with the “query-opinion-data” permission will be able to see the opinion markers on their map.
This part of the project will teach you, among other things, about SQL INSERT, DELETE, and UPDATE, which are used to manipulate the data in the database in a controlled manner.
**Aggregated view (30%)**: In this part of the project, you will add the display of summary statistics about the information shown in the map. This summary information needs to be computed by the database – that is, you will further extend the “near” action to generate SQL queries that compute the summary information and return it. We want you to compute the following summaries:
If the user has “committees” selected, then compute the total amount of money involved by the committees in the current view. The \texttt{cs339.comm_to_cand} and \texttt{cs339.comm_to_comm} tables contain such information. Color the background of this summary with a color from blue to red based on the difference between contributions to the Democratic and Republican parties.
If the user has “individuals” selected, then compute a similar display for individual data.
If the user has “opinions” selected, include the average and standard deviation of the “colors” in the map region. Color the background of this summary from blue to red, as above.
An important issue is how to determine the aggregate view when there are few or no data points in the region specified by the query. In this case, your code should use queries to progressively larger regions, centered around the user, until you find enough data to produce an aggregate view.
It is possible to simply use the database to collect the relevant data, send that to your JavaScript, and then compute the summary on the client side. This may be much easier to do in some cases and is OK as a starting point, but you ultimately need to compute your aggregates in the database using SQL for this part of the project.
The purpose of this part of the project is to get you to think about the data, the summaries, and how to use JOINs and GROUP BY to do the work of computing summaries over data.
**Where to go for help**
The goal of this project is to learn how a database-backed web application works. Don’t fall into the trap of spending lots of time generating pretty HTML, cool JavaScript, or particularly elegant Perl. Get the SQL right first and make the Perl return what you need. We don’t want you to get stuck on the details of Perl, CGI, JavaScript, or HTML, so please use the following resources:
- Use the built-in debug functionality, logs, and the developer features of your browser, as described earlier.
- The discussion group as described on the course web page. Don’t forget to help others with problems that you’ve already overcome.
- Office hours. Make sure to use the office hours made available by the instructor and the TAs.
- Handouts: we have prepared handouts on using databases in the WOT environment, a high-level introduction to the Perl programming language, and a high-level introduction to the JavaScript programming model.
- Web content. You will find many examples of Perl, JavaScript, and SQL programming on the web. We have links to several particularly noteworthy resources on the web site.
- Additional examples. You will find additional examples on Perl, SQL, etc, in \texttt{~pdinda/339/HANDOUT}.
Hand-in
To hand in the project, you will do the following:
- Get a copy of your extended RWB up and running in your account on the server.
- Email the instructor and the TAs with a copy of all the files that you have modified or added. At minimum, this will be `rwb.pl`, `rwb.js`, `rwb.sql`. In the email, also supply a URL for your running app and the root account name and password. Be sure to note your partners' name(s), if you have partners.
- We may provide more detailed hand-in instructions later.
Extra Credit (30% Maximum)
You can gain extra credit by trying the following extensions. If you are interested in these, please talk to us first so that we can determine the possible credit.
Geolocating individual contributions through a game with a purpose: The FEC data, for various reasons, only locates individual contributions to the granularity of zip codes. In our data, we have geolocated them to “10 main street, city, state, zip”. The result is that all their markers will appear at this location. Improve this by creating a “game with a purpose”. The idea here is that a user can request a more accurate geolocation of a particular contribution. These requested geolocations will then be randomly assigned to users in the general vicinity who have the “give-cs-ind-data” permission. These requests will just pop up during their normal use of the application. If two randomly selected users (the submitter and the validator) give roughly the same geolocation data, this data is then considered good, and provided as a more accurate information for any user who has the “query-cs-ind-data” permission.
Security: RWB is horrendously insecure because passwords are stored in cleartext in the database and cookie file, and could be sent in cleartext over the network if the user does not use https. Read about more secure approaches to session management and implement one of them.
iPhone App or Android App. Improve the mobile client experience by writing an app.
Deeper analysis queries. Examine the FEC data model and develop additional queries that characterize the monetary side of electioneering for national offices.
Integrating voting data. Our data does not indicate the specific elections, or who won each election. Find a source of data that does and integrate it into RWB. A starting point might be the Congress’s statistical reports on congressional elections from 1920 to the present: https://history.house.gov/Institution/Election-Statistics. An initial version of this functionality would simply allow the user to see election contests in the map view. A more sophisticated version would correlate committee expenditures and election contest outcomes to let a user see how important political contributions are to deciding outcomes within the current map view.
Better geolocation. Many of the entries in the FEC data, particularly for individual contributions, do not have any geolocation data at all, and others have poor data. We use a free public domain geocoding database (geocode.us). Find and recode the FEC data with a better one.
Precomputed or cached summaries. A weakness of the “Aggregated View” part of the project is that whether you compute summaries in the database or on the client, you may be repeating work. This is particularly important for summaries since they are expensive to compute. But in an urban area like Chicago, an app like RWB may have many users making similar or identical summary queries. The FEC data is static (it only changes once per year). We could either precompute the answers to common queries in advance or cache query results for reuse. For extra credit, implement one or both of these ideas.
Persistent database connections. RWB encapsulates its interaction with the database in the ExecSQL function in order to try to make things clearer for the student. Each time ExecSQL is invoked, a new database connection is made. This is very inefficient. A more scalable (but less clear) design would reuse the connection within one invocation of `rwl.pl`, and, even better, across invocations of it. Learn how to use the database interface more efficiently, and then improve `rwb.pl`.
Improved query throttling. Query throttling is important for scaling an application like RWB. The current JavaScript frontend of RWB throttles requests going to the backend in two ways: queries are limited to a geographic bounding box, and queries are rate-limited so that a long chain of queries (say from user moves or scrolling the map) reduces to a small number of queries. Ideally, however, query throttling would be implemented in the logic tier (`rwb.pl`) and in the data tier (Oracle), so that users could not avoid it (and UI programmers could not get it wrong). For extra credit, implement such query throttling.
|
{"Source-Url": "http://www.cs.northwestern.edu/~pdinda/db/rwb.pdf", "len_cl100k_base": 6250, "olmocr-version": "0.1.42", "pdf-total-pages": 10, "total-fallback-pages": 0, "total-input-tokens": 29057, "total-output-tokens": 6721, "length": "2e12", "weborganizer": {"__label__adult": 0.00031566619873046875, "__label__art_design": 0.0002682209014892578, "__label__crime_law": 0.00040268898010253906, "__label__education_jobs": 0.00748443603515625, "__label__entertainment": 7.718801498413086e-05, "__label__fashion_beauty": 0.0001385211944580078, "__label__finance_business": 0.00027751922607421875, "__label__food_dining": 0.00032973289489746094, "__label__games": 0.00045943260192871094, "__label__hardware": 0.0006685256958007812, "__label__health": 0.00028252601623535156, "__label__history": 0.0002903938293457031, "__label__home_hobbies": 0.00010979175567626952, "__label__industrial": 0.0002849102020263672, "__label__literature": 0.0002894401550292969, "__label__politics": 0.000911235809326172, "__label__religion": 0.0003669261932373047, "__label__science_tech": 0.004947662353515625, "__label__social_life": 0.00021731853485107425, "__label__software": 0.0123138427734375, "__label__software_dev": 0.96875, "__label__sports_fitness": 0.00018036365509033203, "__label__transportation": 0.000492095947265625, "__label__travel": 0.0001659393310546875}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 28893, 0.00333]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 28893, 0.41005]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 28893, 0.9171]], "google_gemma-3-12b-it_contains_pii": [[0, 2416, false], [2416, 5626, null], [5626, 8997, null], [8997, 12390, null], [12390, 15316, null], [15316, 18127, null], [18127, 21406, null], [21406, 24107, null], [24107, 27183, null], [27183, 28893, null]], "google_gemma-3-12b-it_is_public_document": [[0, 2416, true], [2416, 5626, null], [5626, 8997, null], [8997, 12390, null], [12390, 15316, null], [15316, 18127, null], [18127, 21406, null], [21406, 24107, null], [24107, 27183, null], [27183, 28893, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, false], [5000, 28893, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, true], [5000, 28893, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 28893, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 28893, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, true], [5000, 28893, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 28893, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 28893, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 28893, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 28893, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 28893, null]], "pdf_page_numbers": [[0, 2416, 1], [2416, 5626, 2], [5626, 8997, 3], [8997, 12390, 4], [12390, 15316, 5], [15316, 18127, 6], [18127, 21406, 7], [21406, 24107, 8], [24107, 27183, 9], [27183, 28893, 10]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 28893, 0.0]]}
|
olmocr_science_pdfs
|
2024-11-22
|
2024-11-22
|
0ac45f129d7e7db3465c54b99ca7aa8089a367af
|
1. [8pts] This question concerns generating random numbers in Ruby. Recall that the Ruby function `rand(n)` returns a random integer between 0 and n-1, inclusive. Using the `rand` function, show how to compute the following:
1a. [2pt] A random integer between 0 and 99, including 99. \( \text{rand}(100) \)
1b. [2pt] A random integer between 5 and 10, including 10. \( \text{rand}(6) + 5 \)
1c. [2pt] A random string from the array `cars` below. \( \text{cars}[\text{rand}(4)] \)
```ruby
cars = ["Chevrolet", "Honda", "Mercedes", "Toyota"]
```
1d. [2pt] An random odd integer between 1 and 9, inclusive. \( 2*\text{rand}(5) + 1 \)
2. [12pts] This question concerns writing functions that involve randomness.
2a. [2pt] Suppose that a course grade can either be a “pass” or “fail”. The following function uses randomness to return a grade. The function is written such that a pass or fail grade is equally likely. Fill in the blanks. You can assume that when `rand(n)` is used, every value in the range 0 to n-1 is equally likely as a return value.
```ruby
def lazy_teacher ()
if \( \text{rand} (\frac{2}{2}) \) == 0 then
return "pass"
else
return "fail"
end
end
```
2b. (2pt) Write a different version of the function above that returns “pass” with probability 90% and “fail” with probability 10%.
```python
def generous_teacher():
if rand(10) <= 6:
return "pass"
else:
return "fail"
```
2c. [4pt] Consider the simple functions given below. They simulate throwing a 6-sided die and a 10-sided die, respectively.
```python
def roll6():
return rand(6) + 1
end
def roll10():
return rand(10) + 1
end
```
Suppose that we want to simulate a game by throwing a 6-sided die and a 10-sided die by using the functions above. If the result of the 6-sided die is greater than the result of the 10-sided die we return the sum of two dice. Otherwise, we return the result of the 10-sided die. Point out the flaw in the following function that attempts to implement this simulation.
```python
def faulty():
if roll6() > roll10():
return roll6() + roll10()
else:
return roll10()
end
```
The function above is not a correct implementation because each time we use one of the roll functions we generate a new random number. In order to use the numbers we generate we need to store them in a variable.
2d. [4pt] Write a function of your own that eliminates the flaw in the function faulty(). Your function should call the functions roll6() and roll10(). Hint: Your function should also use assignments.
```python
def correct():
x = roll6()
y = roll10()
if x > y:
return x + y
else:
return y
```
3. [14pts] This problem concerns one-dimensional binary cellular automata such as the ones you experimented with in the OLI module and homework assignments. Consider an automaton whose initial state is shown in line (i) below. The next generation is shown in line (ii).

3a. [4pts] What is the rule for this automaton? In the spaces below, fill in the dashed boxes with a 1 (for black) or a 0 (for white) to specify the rule this automaton must be using to produce line (ii) from line (i).
```
7 6 5 4 3 2 1 0
<p>| | | | | | | |</p>
<table>
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
</tr>
</tbody>
</table>
```
3b. [4pts] Using the rule numbering scheme we studied, the rule for this automaton must be a number between 0 and 255. What is the number? 78
3c. [6pts] Apply the rule to compute generations (iii) and (iv) above by coloring in selected squares.
4. [14pts] This question concerns networking and the Internet.
4a. [2pts] In packet-switching networks, two network nodes (e.g., computers) send messages by breaking the message up into small packets and sending each packet on to the network with a serial number and a destination address. A router is a device that determines the next network point to which a packet should be forwarded, on its way to its final destination.
4b. [2pts] The principle known as **net neutrality** advocates no restrictions by ISPs or governments on consumers' access to networks that participate in the Internet.
4c. [2pts] A domain name server is used to translate human-friendly computer hostnames into IP addresses.
4d. [2pts] A communication **protocol** is a collection of rules that govern the ways in which computers interact with one another.
4e. [4pts] Suppose that computers in an institution are assigned IPv4 addresses that start with a common sequence of 16 bits that uniquely identify the institution's network. Given that there are 32 bits in an IPv4 address, how many hosts can this institution have in its network using this addressing scheme?
\[ 2^{16} \]
4f. [2pts] A Web page is identified by a Uniform Resource Locator (URL), which has the following format:
\[ part1://part2/page \]
Part 1 stands for a **protocol** such as HTTP.
Part 2 stands for a **domain name** or **host address**.
5. [14pts] This question concerns key establishment and encryption.
Alice and Bob want to agree on a secret key they can use to exchange encrypted messages. They use the Key Agreement Protocol of Diffie, Helman, and Merkel to construct this key. The protocol relies on the existence of a function \( f(x,y) \) that is a one-way function and also has the special property that \( f(f(p,q),r) \) equals \( f(f(p,r),q) \). Alice picks a secret value \( a \) and Bob picks a secret value \( b \). They both know the value of \( g \), which is an industry standard constant.
5a. [3pts] Why is it safe for Alice to publicly disclose \( f(g,a) \), and Bob to publicly disclose \( f(g,b) \)?
\[ f \text{ is a one-way function, so cannot recover } a \text{ or } b \]
5b. [3pts] Alice can derive the secret key she needs to communicate securely with Bob by taking his publicly disclosed value for \( f(g,b) \) and her secret value \( a \) and doing what?
\[ \text{compute } f( f(g,b), a) \]
5c. [3pts] How does Bob derive the same secret key that Alice has obtained?
\[ \text{Compute } f ( f (q, a), b ) \]
5d. [5pts] Mark each of the following as True or False, assuming \( f(x, y) \) is a one-way function.
- **True** It is easy to compute the value of \( f(x, y) \), given \( x \) and \( y \).
- **False** It is easy to compute the value of \( y \), given \( f(x, y) \) and \( x \).
- **True** The product of two primes is a one-way function as long as you know the product \( f(x, y) \) but neither of the primes \( x \) and \( y \).
- **False** The product of two primes is a one-way function even if you know \( f(x, y) \) and also \( x \), but not \( y \).
- **False** A substitution cipher \( c = f(p, k) \), such as the Caesar cipher, where \( c \) is the ciphertext, \( k \) is the key, and \( p \) is the plaintext, is a one-way function if you don’t know \( k \).
6. [20pts] This question concerns AI and recursion.
Consider a two-player game where there are two choices for each move, A or B. We can represent the game tree in Ruby using a nested array. Before the first move, the tree is just the root node:
\[
[\ ]
\]
We can extend the tree to the next level by replacing each terminal node by a list of two new nodes, generated by appending a symbol \( :a \) or \( :b \) to the original node. Initially the root is the only terminal node. After the first move, we have one nonterminal node (the root) with two terminal nodes, \([:a] \) and \([:b] \), so the tree (also shown at right) becomes:
\[
[ [[:a], [:b]], \ ]
\]
Notice that tree[0] is the left terminal node, and tree[1] is the right one.
We can repeat the tree generation process described above to create the tree for a two move game:
\[
[ [[[:a, :a]], [[[:a, :b]]], [[[:b, :a]], [[[:b, :b]]]]]
\]
As the above list and the tree at right both show, there are four possible games consisting of two moves. The left subtree, i.e., the first nonterminal node below the root, is tree[0], and the first terminal node is tree[0][0], which is \([:a, :a] \). The last terminal node is tree[1][1], which is \([:b, :b] \).
We can in turn use this tree to generate the tree for three-move games:
\[
\]
The above tree has eight terminal nodes, corresponding to the eight possible games with three moves. The first terminal node is \( [a;a;a] \) and the last is \( [b;b;b] \). Terminal nodes are lists composed of the symbols \( a \) and \( b \); they do not contain any lists inside them.
6a. [6pts] Write a function \( \text{terminal?}(\text{node}) \) that takes as input a list representing some node in a game tree for this game, and returns true if \( \text{node} \) is a terminal node, and false otherwise. Your function should return true for inputs such as \( [b] \) or \( [a;b;b,a] \) and false for non-terminal inputs such as \( [[a],[b]] \). Note that the empty game tree \( [\ ] \) is also a valid terminal node. You can assume that \( \text{node} \) will always be either a valid terminal node or a valid non-terminal node, not some random junk.
\[
\begin{align*}
def \text{terminal?}(\text{node}) \\
\quad \text{if } \not \text{ node[0].kind of? (Array)} \\
\quad \quad \text{then return true} \\
\quad \quad \text{else return false} \\
\end{align*}
\]
6b. [7pts] Write a recursive function that takes a non-empty game tree as input and returns the first (leftmost) terminal node. Your function should call the \( \text{terminal?} \) function you wrote above.
\[
\begin{align*}
def \text{first-terminal}(\text{tree}) \\
\quad \text{if } \text{terminal?}(\text{tree}) \\
\quad \quad \text{then return tree} \\
\quad \quad \text{else return \text{first-terminal}(\text{tree}[0])} \\
\end{align*}
\]
6c. [7pts] Write a recursive function that takes a game tree as input and returns the number of moves in a game. You can assume that the game tree is complete, i.e., all nodes at the same level have the same number of children, so the number of moves is equal to the level of the terminal nodes, which is the depth of the tree. Your function should call the \( \text{terminal?} \) function you wrote above.
\[
\begin{align*}
def \text{number_of_moves}(\text{tree}) \\
\quad \text{if } \text{terminal?}(\text{tree}) \\
\quad \quad \text{then return 0} \\
\quad \quad \text{else return 1 + \text{number_of_moves}(\text{tree}[0])} \\
\end{align*}
\]
6
7. [18pts] This question concerns concurrency.
Suppose that two programs P1 and P2 have access to the same variable x in memory, and they can use actions \texttt{read}(x) and \texttt{dec}(x, c), which represent, respectively, reading from the location x and decreasing the value in location x by the value c. The program steps for P1 and P2 are given below.
\begin{verbatim}
# Program P1
P1A: a = read(x)
P1B: if a > 2 then dec(x, 3)
else do nothing
# Program P2
P2A: b = read(x)
P2B: if b > 1 then dec(x, 2)
else do nothing
\end{verbatim}
7a. [4pts] Suppose that x initially contains the value 3, and P1 and P2 are executed sequentially such that the program steps are executed in the following order: P1A, P1B, P2A, P2B. What will the memory location x contain at the end of the execution?
After step P1A, the value of x is: 3
After step P1B, the value of x is: 0
After step P2A, the value of x is: 0
After step P2B, the value of x is: 0
7b. [4pts] Suppose that the programs P1 and P2 are executed by two different processors that have access to a shared memory containing the variable x. This means that the steps of the two programs may be interleaved. For example, the first 3 steps in an execution can be P1A, P2A, P2B. Now, assume that the memory location x initially contains the value 3 as in the previous question. Give a 4-step execution sequence that starts with the step P2A such that the resulting value of x is negative.
\begin{verbatim}
P2A, P1A, P1B, P2B
or
P2A, P1A, P2B, P1B
\end{verbatim}
7c. [4pts] Now consider the following programs P3 and P4, which are executed concurrently. Notice that they include calls to P1 and P2, respectively. If we want to guarantee that \( x \) never contains a negative value after the programs complete their execution, we may want to treat the calls to P1 and P2 as critical sections and try to ensure that only one program is executing its critical section at a time. You can assume that \texttt{xfree\_P3} and \texttt{xfree\_P4} are shared variables that are initialized to true and that functions \texttt{noncritical\_P3()} and \texttt{noncritical\_P4()} do not involve the location \( x \). Give an execution sequence in terms of the labels in the given programs that results in a deadlock.
Program P3:
\[
\begin{align*}
\text{while true do} & \\
\text{P3A: call noncritical\_P3()} & \\
\text{P3B: xfree\_3 = false} & \\
\text{P3C: while xfree\_4 == false} & \\
& \quad \text{do nothing} \\
& \quad \text{end} \\
\text{P3D: call Program P1} & \\
\text{P3E: xfree\_3 == true} & \\
\text{end}
\end{align*}
\]
Program P4:
\[
\begin{align*}
\text{while true do} & \\
\text{P4A: call noncritical\_P4()} & \\
\text{P4B: xfree\_4 = false} & \\
\text{P4C: while xfree\_3 == false} & \\
& \quad \text{do nothing} \\
& \quad \text{end} \\
\text{P4D: call Program P2} & \\
\text{P4E: xfree\_4 == true} & \\
\text{end}
\end{align*}
\]
Any interleaving that sets both \texttt{xfree\_3} and \texttt{xfree\_4} to false before \texttt{P3C} or \texttt{P4C} is executed would lead to deadlock.
7d. [6pts] Pipelining is used in computers to speed up computer execution. The steps for executing an instruction are as follows:
F. Fetch instruction from memory
D. Decode the instruction
R. Read data from registers
E. Execute the instruction
W. Write the result into a register.
Suppose that each of the above steps takes 1 time unit to perform, and we want to execute 5 instructions in a pipelined fashion. Draw a diagram to illustrate the pipelined execution of the five instructions, i1 through i5. There are multiple ways to graphically depict pipelining; we used two different ways in the lecture notes. You are free to pick whatever convention you like, provided that it correctly expresses the pipelining process. For example, you might choose to have time run vertically, or you might prefer that it run horizontally. Use the grid below to make your diagram. You can label the rows and columns, in any way you need to show how your diagram makes sense. What you write in the grid squares is also up to you. And we've given you way more space than you need, so don't expect to use every row and column. This is actually an easy problem, so don't panic!
|
{"Source-Url": "http://www.cs.cmu.edu/~15110-f12/exam3A-answers.pdf", "len_cl100k_base": 4161, "olmocr-version": "0.1.50", "pdf-total-pages": 9, "total-fallback-pages": 0, "total-input-tokens": 10287, "total-output-tokens": 4799, "length": "2e12", "weborganizer": {"__label__adult": 0.0005359649658203125, "__label__art_design": 0.0006175041198730469, "__label__crime_law": 0.0004606246948242187, "__label__education_jobs": 0.0191650390625, "__label__entertainment": 0.0001481771469116211, "__label__fashion_beauty": 0.00024437904357910156, "__label__finance_business": 0.0003418922424316406, "__label__food_dining": 0.000843048095703125, "__label__games": 0.00116729736328125, "__label__hardware": 0.0027446746826171875, "__label__health": 0.0005917549133300781, "__label__history": 0.0004992485046386719, "__label__home_hobbies": 0.00030303001403808594, "__label__industrial": 0.0009694099426269532, "__label__literature": 0.00054168701171875, "__label__politics": 0.0003390312194824219, "__label__religion": 0.0007538795471191406, "__label__science_tech": 0.041473388671875, "__label__social_life": 0.00025773048400878906, "__label__software": 0.008148193359375, "__label__software_dev": 0.91845703125, "__label__sports_fitness": 0.0004334449768066406, "__label__transportation": 0.0008945465087890625, "__label__travel": 0.0002834796905517578}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 14717, 0.03273]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 14717, 0.62929]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 14717, 0.86704]], "google_gemma-3-12b-it_contains_pii": [[0, 1207, false], [1207, 2387, null], [2387, 3612, null], [3612, 5999, null], [5999, 8339, null], [8339, 10502, null], [10502, 12026, null], [12026, 13554, null], [13554, 14717, null]], "google_gemma-3-12b-it_is_public_document": [[0, 1207, true], [1207, 2387, null], [2387, 3612, null], [3612, 5999, null], [5999, 8339, null], [8339, 10502, null], [10502, 12026, null], [12026, 13554, null], [13554, 14717, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, false], [5000, 14717, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 14717, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 14717, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 14717, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, true], [5000, 14717, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 14717, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 14717, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 14717, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 14717, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 14717, null]], "pdf_page_numbers": [[0, 1207, 1], [1207, 2387, 2], [2387, 3612, 3], [3612, 5999, 4], [5999, 8339, 5], [8339, 10502, 6], [10502, 12026, 7], [12026, 13554, 8], [13554, 14717, 9]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 14717, 0.015]]}
|
olmocr_science_pdfs
|
2024-11-30
|
2024-11-30
|
b0a4c55a7de5e909daf07559b126f96add744840
|
Avionics in the view of reliability
Fly-By-Wire
Vít Hampl
**Avionics**
The development of avionics software products has to conform to the DO-178B standard. DO-178B does not prescribe a specific development process, it identifies important steps inside a development process and defines objectives for each of these steps. DO-178B distinguishes the development processes from “integral” processes that are meant to ensure correctness control and confidence of the software life cycle processes and their outputs. The verification process is part of the integral processes.
**Development Processes**
Four processes are identified:
- The software requirements process develops High Level Requirements (HLR) from the outputs of the system process;
- The software design process develops Low Level Requirements (LLR) and Software Architecture from the HLR;
- The software coding process develops source code from the software architecture and the LLR;
- The software integration process loads executable object code into the target hardware for hardware/software integration.
Each of the above mentioned processes is a step towards the actual software product.
**Verification Process**
The results of all activities of the development must be verified. Detailed objectives are defined for each step of the development, typically some objectives are defined on the output of a development process itself and also on the compliance of this output to the input of the process that produced it. For example, Figure 2 presents the objectives related to LLR. Arrows are labeled with verification objectives; the loop arrow on LLR means the objectives only concern LLR while the arrow between LLR and HLR means that objectives address relationships between LLR and HLR. On one hand, LLR shall be accurate and consistent, compatible with the target computer, verifiable, conform to requirements
standards, and they shall ensure algorithm accuracy. On the other hand, LLR shall be compliant and traceable to HLR. Verification means identified by DO-178B are reviews, analyses and test. Reviews provide a qualitative assessment of correctness. Analyses provide repeatable assessment of correctness. Reviews and analyses are used for all the verification objectives regarding HLR, LLR, software architecture and source code. Test is used to verify that the executable object is compliant with LLR and HLR. Test is always based on the requirements (functional test) and shall include normal range and robustness cases. A structural coverage analysis is performed to ensure that the software has been tested enough (different coverage criteria are used depending on the criticality level of the software).
**Deductive Methods**
The first kind of formal technique is deductive proof based on Hoare logic, and the computation of Dijkstra’s weakest precondition predicate transformer. The objective is to prove user defined properties on a given program. Properties must be formally expressed in logic. This technique proceeds in two steps:
- computation of the verification conditions: post-conditions (properties that should hold after the execution of the program) are defined, this first step analyses the program and computes the conditions that must hold for these post-conditions to be verified;
- proof of the verification conditions: a theorem prover is used to prove the conditions computed before.
The first step is completely automated, the second step usually requires interaction with the user, but automation can be improved by the definition of specific heuristics. Several tools exist for different programming languages (mostly C and Java), for example Caveat and Frama-C
**Abstract Interpretation Based Static Analysis**
The second kind of techniques are techniques based on Abstract Interpretation. The principle of Abstract interpretation is the construction of a sound approximation of the
semantics of programs. A specific approximation is generated for each particular property being analyzed. Abstract interpretation is a completely automated technique. It may produce “false positives” (errors that can occur on the approximation of the program that has been computed, but cannot occur on the real program). The challenge is thus to be able to build a precise enough approximation in order to have as few false positives as possible. This usually implies a specialization of the technique with respect to the analyzed programs.
Usage of formal methods
Unit Proof: Within the development process of the most safety-critical avionics programs, the unit verification technique is used for achieving DO-178B objectives related to the verification of the executable code with respect to the Low Level Requirements, the classical technique being the Unit Tests.
Worst Case Execution: Time analysis: In real-time systems, computing correct values is not enough. Indeed, the program must also compute these values in due time in order to remain synchronized with the physical environment. The scheduling of the most critical avionics real-time programs is an off-line scheduling. This means that the serialization (single processor) of the various program tasks is performed at design time, leading to a fixed interleaving of these tasks. In this context, schedulability analysis boils down to the safe computation of an upper bound of the Worst Case Execution Time of the program tasks, almost exclusively.
Maximum stack usage computation: The amount of memory given to a task of an avionics program is determined statically when the program is built. If any task stack of a program actually requires more memory than what has been allocated statically, a stack overflow exception is raised during execution. In order to avoid this serious problem, a safe upper bound of each stack of the program must be computed. With these figures, the computation a safe upper bound of the total amount of memory used for stacks is
performed, by means of an analysis that takes into account some mechanisms such as interrupt tasks or Operating System calls.
**Fly-By-Wire**
**Beginning of the Fly-By-Wire – armed forces**
The Digital Fly-By-Wire (DFBW) concept uses an electronic flight-control system coupled with a digital computer to replace conventional mechanical flight controls.
The first test of a DFBW system in an aircraft was in 1972 on a modified F-8 Crusader at the Flight Research Center, Edwards, Calif. (now Dryden Flight Research Center). It was the forerunner of the fly-by-wire flight control systems now used on the space shuttles and on today’s military and civil aircraft to make them safer, more maneuverable and more efficient. It was safer because of its redundancies and because, for military aircraft, wires were less vulnerable to battle damage than the hydraulic lines they replaced. It was more maneuverable because computers could command more frequent adjustments than a human pilot and designers could do away with features that made the plane more stable and thus harder to maneuver. For airliners, computerized flight control could also ensure a smoother ride than a human pilot alone could provide. Finally, digital fly-by-wire was more efficient because it was lighter and took up less volume than hydraulic controls and thus either reduced the fuel required to fly with the extra weight and/or permitted carrying more passengers or cargo. It also required less maintenance than older systems.
In the first few decades of flight, pilots controlled aircraft through direct force — moving control sticks and rudder pedals linked to cables and pushrods that pivoted control surfaces on the wings and tails.
As engine power and speeds increased, more force was needed and hydraulically boosted controls emerged. Soon, all high performance and large aircraft had hydraulic-mechanical
flight-control systems. These conventional flight-control systems restricted designers in the configuration and design of aircraft because of the need for flight stability.
As the electronic era evolved in the 1960s, so did the idea of aircraft with electronic flight-control systems. Wires replacing cables and pushrods would give designers greater flexibility in configuration and in the size and placement of components such as tail surfaces and wings. A fly-by-wire system also would be smaller, more reliable, and in military aircraft, much less vulnerable to battle damage. A fly-by-wire aircraft would also be much more responsive to pilot control inputs. The result would be more efficient, safer aircraft with improved performance and design.
On May 25, 1972, the highly modified F-8 became the first aircraft to fly completely dependent upon an electronic flight-control system. The pilot was Gary Krier. Wires from the control stick in the cockpit to the control surfaces on the wings and tail surfaces replaced the entire mechanical flight-control system in the F-8. The heart of the system was an off-the-shelf backup Apollo digital flight-control computer and inertial sensing unit which transmitted pilot inputs to the actuators on the control surfaces. The first phase of the DFBW program validated the fly-by-wire concept and quickly showed that a refined system — especially in large aircraft — would greatly enhance flying qualities by sensing motion changes and applying pilot inputs instantaneously. The DFBW program lasted 13 years. The final flight — the 210th of the program — was made April 2, 1985, with Dryden Research Pilot Ed Schneider at the controls.
Fly-By-Wire in civil usage
The first electrical flight control system for a civil aircraft was designed by Aerospatiale and installed on Concorde. This is an analog, full-authority system for all control surfaces and copies the stick commands onto the control surfaces. A mechanical back-up system is provided on the three axes. The first generation of electrical flight control systems with digital technology appeared on several civil aircraft at the start of the 1980’s. These systems control the slats, flaps and spoilers. These systems have very stringent safety
requirements. However, loss of a function is permitted as the only consequences are a supportable increase in the crew’s workload. In the second generation of EFCS, all control surfaces are controlled electrically by high/level control laws in normal operation and that the system is designed to be available under all circumstances. This system was built to very stringent dependability requirements both in terms of safety and availability. The basic building blocks are the fail-safe control and monitoring computers. These computers have stringent safety requirements and are functionally composted of a control channel and a monitoring channel. The control channel ensures the function allocated to the computer. The monitoring channel ensures that the control channel operates correctly. A high level of redundancy is built into the system. Special attention has been paid to possible external aggressions. The system is built to tolerate both hardware and software design faults. The overall dependability of the aircraft is also reinforced by the stability augmentation and flight envelope protection provided by the system. The aircraft safety is demonstrated using qualitative and quantitative assessments, this approach is consistent with the regulation. Qualitative assessment is used to deal with design faults, interaction faults and external environmental hazard. For physical faults, both qualitative and quantitative assessments are done.
On a conventional airplane, the pilot orders are transmitted to the actuators by an arrangement of mechanical components. In addition, computers are modifying pilot feels on the controls, and auto-pilot computers are able to control the actuators. In auto-pilot mode, the flight controls computers take their orders from the auto-pilot computers. The flight controls computers are of a control and monitoring type.
**Control and monitoring computers**
Functionally, the computers have a control and a monitoring channel. The control channel ensures the function allocated to the computers. The monitoring channel ensures that the control channel operates correctly.
These computers can usually be considered as being two different and independent computers placed side by side. These two computers have different functions and are placed adjacent to each other only to make aircraft maintenance easier. Both command and
monitoring channels of one computer are active simultaneously, or waiting simultaneously so go from stand-by to active state. Usually two computers with one control and one monitoring channel for each of them are used.
Technical specification
The specification of a computer includes on the one hand and equipment and software development technical specification used to design the hardware and, in part the software and on the other hand and equipment functional specification, which accurately specifies the functions implemented by the software. This functional specification is written using Computer-Assisted Specification. One of the benefits of this method is that each symbol used has a formal definition with strict rules governing its interconnections. The specification is under the control of a configuration management tool and its syntax is partially checked automatically.
Each channel includes one or more processors, their associated memories, I/O circuits a power supply unit and specific software. When the results of one of these two channels diverges significantly, the channel or channels which detected this failure cut the links between the computer and the exterior. The system is designed so that the computer outputs are then in a dependable state. Failure detection is mainly achieved by comparing the difference between the control and monitoring commands with a predetermined threshold. This schema therefore allows the consequences of a failure of one of the computer’s components to be detected and prevents the resulting error from propagating outside of the computer. This detection method is completed by monitoring for good execution for the program via its sequencing. Flight control computers must be especially robust. They are especially protected against overvoltages and undervoltages, electromagnetic aggressions and indirect effects of lightning. They are cooled by a ventilation system but will operate correctly even if ventilation is lost.
Software development
To make software validation easier, the various tasks are sequenced in a predetermined order with periodic scanning of the inputs. Only the clock can generate interrupts used to
control task sequencing. This sequencing is deterministic. A part of the task sequencer validation consists in methodically evaluating the margin between the maximum execution time for each task and the time allocated to this task.
An important task is to check the conformity of the software with its specification. This is performed by means of tests and inspections. The result of each step in the development process is checked against its specification. For example, a code module is tested from its specification. This test is first of all functional, then structural. Adequate coverage must be obtained for the internal structure and input range, however this does not mean, that the tests are exhaustive. For example, for the structural test of a module, the equivalence classes are defined for each input. The tests must cover the module input range taking these equivalence classes and all module branches as a basis. These equivalence classes and a possible additional test effort have the approval of the various parties involved. The software control channel is different from that of the monitoring channel.
**Failure detection and reconfiguration**
*Latent failure:* Certain failures may remain masked a long time after their creation. A typical case is that of a monitoring channel made passive and detected only when the monitored channel itself fails. Tests are conducted periodically so that the probability of the occurrence of an undesirable event remains sufficiently low. Typically, a computer runs its self-tests and tests its peripherals during the power up of the aircraft and therefore at least once a day.
*Comparison threshold – robustness:* The results are compared in the two channels. The difference between the results of the control and monitoring channels are compared with a threshold. A failure is detected if the difference between the channels is above an allowable threshold. This must be confirmed before the computer is disconnected. The confirmation consists in checking that the detected failure lasts for a sufficiently long period of time. The detection parameters must be sufficiently “wide” to avoid unwanted disconnections and sufficiently “tight” so that undetected failures are tolerated by the computer’s environment. More precisely, all system tolerances are taken into account to prevent
undue failure detection, and errors which are not detectable are assessed with respect of their handling quality, and structural loads effect.
**Redundancy:** The redundancy aspect is handled at system level. The functions of the system are divided out between all the computers so that each one is permanently active at least on one subassembly of its functions. For any given function, one computer is active the others are in standby. As soon as the active computer interrupts its operation, one of the standby computers almost instantly changes to active mode without a jerk or with a limited jerk on the control surfaces. Typically, duplex computers are designed so that they permanently transmit healthy signals and so that the signals are interrupted at the same time as the “functional” outputs following the detection of a failure.
**System Validation**
The system validation proceeds through several different steps:
- peer review of the specifications, and their justification
- analysis, most notably the System Safety Assessment which, for a given failure condition, check that the monitoring and reconfiguration logic allow to fulfill the quantitative and qualitative objectives, but also analysis of system performances, and integration with the structure
- tests with a simulated system, taking credit to the automatic programming of the functional specification, with a coupling with a rigid aircraft model
- test of an equipment on a partial test-bench, with input simulation and observation of internal variables
- tests on iron bird and flight simulator. The iron bird is a test bench with all the system equipment, installed and powered as on aircraft. The flight simulator is another test bench with an aircraft cockpit, flight controls computers, and coupled with a rigid aircraft model. The iron bird and the flight simulator are coupled for some tests.
- flight tests, on up to four aircraft, fitted with an “heavy” flight test instrumentation. More than 10000 flight controls parameters are permanently monitored and recorded.
The working method for these tests is twofold:
- a deterministic way, based on a test program, with a test report answering
- a way which takes credit of the daily use of these test facilities for work on other systems, for demonstration, or test engineer and pilot activity. If the behavior of the system is not found satisfactory, a Problem Report is risen, registered and investigated.
**Fly-by-optics**
Fly-by-optics is sometimes used instead of fly-by-wire because it can transfer data at higher speeds, and it is immune to electromagnetic interference. In most cases, the cables are just changed from electrical to fiber optic cables. Sometimes it is referred to as "Fly-by-light" due to its use of Fiber Optics. The data generated by the software and interpreted by the controller remain the same.
**Power-by-wire**
Having eliminated the mechanical circuits in fly-by-wire flight control systems, the next step is to eliminate the bulky and heavy hydraulic circuits. The hydraulic circuit is replaced by an electrical power circuit. The power circuits power electrical or self-contained electro-hydraulic actuators that are controlled by the digital flight control computers. All benefits of digital fly-by-wire are retained. The biggest benefits are weight savings, the possibility of redundant power circuits and tighter integration between the aircraft flight control systems and its avionics systems. The absence of hydraulics greatly reduces maintenance costs. This system is used in the Lockheed Martin F-35 and in Airbus A380 backup flight controls. The Boeing 787 will also incorporate some electrically operated flight controls (spoilers and horizontal stabilizer), which will remain operational with either a total hydraulics failure and/or flight control computer failure.
**Intelligent Flight Control System**
A newer flight control system, called Intelligent Flight Control System (IFCS), is an extension of modern digital fly-by-wire flight control systems. The aim is to intelligently compensate for aircraft damage and failure during flight, such as automatically using
engine thrust and other avionics to compensate for severe failures such as loss of hydraulics, loss of rudder, loss of ailerons, loss of an engine, etc. Several demonstrations were made on a flight simulator where a Cessna-trained small-aircraft pilot successfully landed a heavily-damaged full-size concept jet, without prior experience with large-body jet aircraft. This development is being spearheaded by NASA Dryden Flight Research Center. It is reported that enhancements are mostly software upgrades to existing fully computerized digital fly-by-wire flight control systems.
Sources
http://personales.upv.es/juaruiga/teaching/TFC/Material/Trabajos/AIRBUS.PDF
http://www.nasa.gov/centers/dryden/news/FactSheets/FS-024-DFRC.html
http://www.aviationexplorer.com/Fly_By_Wire_Aircraft.html
http://www.springerlink.com.nukweb.nuk.uni-lj.si/content/0265621453714708/fulltext.pdf
|
{"Source-Url": "http://lrss.fri.uni-lj.si/sl/teaching/rzd/tutorials/hampl2010_avionics.pdf", "len_cl100k_base": 4132, "olmocr-version": "0.1.48", "pdf-total-pages": 13, "total-fallback-pages": 0, "total-input-tokens": 20412, "total-output-tokens": 4687, "length": "2e12", "weborganizer": {"__label__adult": 0.0015087127685546875, "__label__art_design": 0.0007672309875488281, "__label__crime_law": 0.001270294189453125, "__label__education_jobs": 0.0011653900146484375, "__label__entertainment": 0.00022220611572265625, "__label__fashion_beauty": 0.0005221366882324219, "__label__finance_business": 0.0007157325744628906, "__label__food_dining": 0.0011072158813476562, "__label__games": 0.0029354095458984375, "__label__hardware": 0.031341552734375, "__label__health": 0.0012731552124023438, "__label__history": 0.0010976791381835938, "__label__home_hobbies": 0.00047969818115234375, "__label__industrial": 0.005260467529296875, "__label__literature": 0.0006022453308105469, "__label__politics": 0.0005960464477539062, "__label__religion": 0.0012531280517578125, "__label__science_tech": 0.173095703125, "__label__social_life": 0.00018608570098876953, "__label__software": 0.01715087890625, "__label__software_dev": 0.6845703125, "__label__sports_fitness": 0.001529693603515625, "__label__transportation": 0.0699462890625, "__label__travel": 0.001129150390625}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 22081, 0.00499]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 22081, 0.88416]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 22081, 0.94214]], "google_gemma-3-12b-it_contains_pii": [[0, 60, false], [60, 1892, null], [1892, 3907, null], [3907, 5937, null], [5937, 7827, null], [7827, 10080, null], [10080, 12460, null], [12460, 14651, null], [14651, 16997, null], [16997, 19180, null], [19180, 21155, null], [21155, 21737, null], [21737, 22081, null]], "google_gemma-3-12b-it_is_public_document": [[0, 60, true], [60, 1892, null], [1892, 3907, null], [3907, 5937, null], [5937, 7827, null], [7827, 10080, null], [10080, 12460, null], [12460, 14651, null], [14651, 16997, null], [16997, 19180, null], [19180, 21155, null], [21155, 21737, null], [21737, 22081, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 22081, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 22081, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 22081, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 22081, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 22081, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 22081, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 22081, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 22081, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 22081, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 22081, null]], "pdf_page_numbers": [[0, 60, 1], [60, 1892, 2], [1892, 3907, 3], [3907, 5937, 4], [5937, 7827, 5], [7827, 10080, 6], [10080, 12460, 7], [12460, 14651, 8], [14651, 16997, 9], [16997, 19180, 10], [19180, 21155, 11], [21155, 21737, 12], [21737, 22081, 13]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 22081, 0.0]]}
|
olmocr_science_pdfs
|
2024-11-25
|
2024-11-25
|
a7398dfb67f425cd4d776c97d8647f23be576961
|
[REMOVED]
|
{"Source-Url": "http://nlp.ipipan.waw.pl/Bib/buc:prz:09.pdf", "len_cl100k_base": 6312, "olmocr-version": "0.1.49", "pdf-total-pages": 12, "total-fallback-pages": 0, "total-input-tokens": 27282, "total-output-tokens": 7745, "length": "2e12", "weborganizer": {"__label__adult": 0.0006604194641113281, "__label__art_design": 0.0015935897827148438, "__label__crime_law": 0.0008225440979003906, "__label__education_jobs": 0.00363922119140625, "__label__entertainment": 0.0005373954772949219, "__label__fashion_beauty": 0.0003554821014404297, "__label__finance_business": 0.0003840923309326172, "__label__food_dining": 0.0006465911865234375, "__label__games": 0.0013647079467773438, "__label__hardware": 0.0009002685546875, "__label__health": 0.0008120536804199219, "__label__history": 0.0007181167602539062, "__label__home_hobbies": 0.00015807151794433594, "__label__industrial": 0.0006604194641113281, "__label__literature": 0.01207733154296875, "__label__politics": 0.0006971359252929688, "__label__religion": 0.0012216567993164062, "__label__science_tech": 0.1719970703125, "__label__social_life": 0.00033354759216308594, "__label__software": 0.04620361328125, "__label__software_dev": 0.7529296875, "__label__sports_fitness": 0.00041604042053222656, "__label__transportation": 0.0006890296936035156, "__label__travel": 0.00025916099548339844}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 29436, 0.02307]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 29436, 0.65612]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 29436, 0.84008]], "google_gemma-3-12b-it_contains_pii": [[0, 2359, false], [2359, 4251, null], [4251, 7648, null], [7648, 10255, null], [10255, 13170, null], [13170, 15766, null], [15766, 17269, null], [17269, 19817, null], [19817, 22652, null], [22652, 25870, null], [25870, 28991, null], [28991, 29436, null]], "google_gemma-3-12b-it_is_public_document": [[0, 2359, true], [2359, 4251, null], [4251, 7648, null], [7648, 10255, null], [10255, 13170, null], [13170, 15766, null], [15766, 17269, null], [17269, 19817, null], [19817, 22652, null], [22652, 25870, null], [25870, 28991, null], [28991, 29436, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 29436, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 29436, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 29436, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 29436, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 29436, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 29436, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 29436, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 29436, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 29436, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 29436, null]], "pdf_page_numbers": [[0, 2359, 1], [2359, 4251, 2], [4251, 7648, 3], [7648, 10255, 4], [10255, 13170, 5], [13170, 15766, 6], [15766, 17269, 7], [17269, 19817, 8], [19817, 22652, 9], [22652, 25870, 10], [25870, 28991, 11], [28991, 29436, 12]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 29436, 0.03896]]}
|
olmocr_science_pdfs
|
2024-11-25
|
2024-11-25
|
5380d7cd5e88d6fd9d004e79643acc7406b3f6a1
|
Strings
A string is a sequence of characters.
An alphabet $\Sigma$ is the set of possible characters in strings.
Examples of strings:
- C program
- HTML document
- DNA sequence
- Digitized image
Examples of alphabets:
- ASCII
- Unicode
- ($\{0,1\}$)
- ($\{A,C,G,T\}$)
Notation:
- $\text{length}(P)$ ... #characters in $P$
- $\lambda$ ... empty string ($\text{length}(\lambda) = 0$)
- $\Sigma^m$ ... set of all strings of length $m$ over alphabet $\Sigma$
- $\Sigma^*$ ... set of all strings over alphabet $\Sigma$
$\nu\omega$ denotes the concatenation of strings $\nu$ and $\omega$
Note: $\text{length}(\nu\omega) = \text{length}(\nu) + \text{length}(\omega)$
Exercise #1: Strings
The string $a/a$ of length 3 over the ASCII alphabet has
- how many prefixes?
- how many suffixes?
- how many substrings?
Note:
- 4 prefixes: "", "a", "a/", "a/a"
- 4 suffixes: "a/a", "a/", "a", ""
- 6 substrings: "", "a", "a/", "a/a", "/a", "a/a"
Note:
- "" means the same as $\lambda$ (empty string)
ASCII (American Standard Code for Information Interchange)
- Specifies mapping of 128 characters to integers 0..127
- The characters encoded include:
- upper and lower case English letters: A-Z and a-z
- digits: 0-9
- common punctuation symbols
- special non-printing characters: e.g. newline and space
Reminder:
In C a string is an array of chars containing ASCII codes
- these arrays have an extra element containing a 0
- the extra 0 can also be written '\0' (null character or null-terminator)
- convenient because don't have to track the length of the string
Because strings are so common, C provides convenient syntax:
```c
char str[] = "hello"; // same as char str[] = {'h', 'e', 'l', 'l', 'o', '\0'};
```
Note: `str[]` will have 6 elements
C provides a number of string manipulation functions via \#include <string.h>, e.g.
- `strlen()` // length of string
- `strncpy()` // copy one string to another
- `strcat()` // concatenate two strings
- `strstr()` // find substring inside string
Example:
```c
char *strncat(char *dest, char *src, int n)
```
appends string `src` to the end of `dest` overwriting the `\0` at the end of `dest` and adds terminating `\0` returns start of string `dest` will never add more than `n` characters (If `src` is less than `n` characters long, the remainder of `dest` is filled with `\0` characters. Otherwise, `dest` is not null-terminated.)
### Pattern Matching
**Pattern Matching**
**Pattern Matching**
Example (pattern checked backwards):
```
<table>
<thead>
<tr>
<th>a</th>
<th>b</th>
<th>c</th>
<th>a</th>
<th>c</th>
<th>a</th>
</tr>
</thead>
<tbody>
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
<td>a</td>
<td>b</td>
<td>c</td>
</tr>
</tbody>
</table>
```
- **Text** ... abacaab
- **Pattern** ... abacab
### Analysis of Brute-force Pattern Matching
Brute-force pattern matching runs in $O(nm)$
Examples of worst case (forward checking):
- $T = \text{aaa...ah}$
- $P = \text{aaah}$
- may occur in DNA sequences
- unlikely in English text
### Boyer-Moore Algorithm
The Boyer-Moore pattern matching algorithm is based on two heuristics:
- **Looking-glass heuristic**: Compare $P$ with subsequence of $T$ moving backwards
- **Character-jump heuristic**: When a mismatch occurs at $T[i] = c$
- if $P$ contains $c$ => shift $P$ so as to align the last occurrence of $c$ in $P$ with $T[i]$
- otherwise => shift $P$ so as to align $P[0]$ with $T[i+1]$ (a.k.a. "big jump")
```
j=0
while j<m ∧ T[i+j]=P[j] do // check from left to right
j=j+1
if j=m then // test ith shift of pattern
return i // entire pattern checked
end if
end while
end for
return -1 // no match found
```
**Boyer-Moore Algorithm**
Brute-force pattern matching algorithm preproceses pattern $P$ and alphabet $\Sigma$ to build
- last-occurrence function $L$
- $L$ maps $\Sigma$ to integers such that $L(c)$ is defined as
- the largest index $i$ such that $P[i]=c$, or
- -1 if no such index exists
Example: $\Sigma = \{a,b,c,d\}$, $P = \text{acab}$
```
c a b c d
```
L(c)
- L can be represented by an array indexed by the numeric codes of the characters
- L can be computed in \(O(m+s)\) time (\(m\) ... length of pattern, \(s\) ... size of \(\Sigma\))
... Boyer-Moore Algorithm
BoyerMooreMatch(T, P, \(\Sigma\)):
Input text T of length n, pattern P of length m, alphabet \(\Sigma\)
Output starting index of a substring of T equal to P
-1 if no such substring exists
L = lastOccurrenceFunction(P, \(\Sigma\)) \hspace{1cm} // start at end of pattern
i = m-1, j = m-1 \hspace{1cm} // start at end of pattern
repeat
if T[i] = P[j] then
if j = 0 then
return i \hspace{1cm} // match found at i
else
i = i-1, j = j-1
end if
else
i = i + m - min(j, 1 + L[T[i]]) \hspace{1cm} // character-jump
j = m-1
end if
until i ≤ n
return -1 \hspace{1cm} // no match
- Biggest jump (\(m\) characters ahead) occurs when \(L[T[i]] = -1\)
... Boyer-Moore Algorithm
Case 1: \(j ≤ 1 + L[c]\)
Case 2: \(1 + L[c] < j\)
Exercise #2: Boyer-Moore algorithm
For the alphabet \(\Sigma = \{a, b, c, d\}\)
1. compute last-occurrence function \(L\) for pattern \(P = abacab\)
2. trace Boyer-More on \(P\) and text \(T = abacababcdabacabaabb\)
- how many comparisons are needed?
Analysis of Boyer-Moore algorithm:
- Runs in \(O(nm+s)\) time
- \(m\) ... length of pattern \(n\) ... length of text \(s\) ... size of alphabet
- Example of worst case:
- \(T = \text{aaa} \_ \text{a}\)
- \(P = \text{baaa}\)
- Worst case may occur in images and DNA sequences but unlikely in English texts
\(\Rightarrow\) Boyer-Moore significantly faster than brute-force on English text
Knuth-Morris-Pratt Algorithm
The Knuth-Morris-Pratt algorithm ...
- compares the pattern to the text left-to-right
- but shifts the pattern more intelligently than the brute-force algorithm
Reminder:
- \(Q\) is a prefix of \(P\) ... \(P = Q\omega\), for some \(\omega \in \Sigma^*\)
- \(Q\) is a suffix of \(P\) ... \(P = \omega Q\), for some \(\omega \in \Sigma^*\)
... Knuth-Morris-Pratt Algorithm
When a mismatch occurs ...
- what is the most we can shift the pattern to avoid redundant comparisons?
• Answer: the largest \textit{prefix} of \(P[0..j]\) that is a \textit{suffix} of \(P[1..j]\)
... Knuth-Morris-Pratt Algorithm
KMP preprocesses the pattern to find matches of its prefixes with itself
• \textit{Failure function} \(F(j)\) defined as
o the size of the largest prefix of \(P[0..j]\) that is also a suffix of \(P[1..j]\)
o if mismatch occurs at \(P_j \Rightarrow \text{advance } j \text{ to } F[j-1]\)
Example: \(P = \text{abaaba}\)
| \(j\) | 0 | 1 | 2 | 3 | 4 | 5 |
| \(P_j\) | a | b | a | a | b | a |
| \(F(j)\) | 0 | 0 | 1 | 1 | 2 | 3 |
\[ j \quad 0 \quad 1 \quad 2 \quad 3 \quad 4 \quad 5 \]
\[ P_j \quad a \quad b \quad a \quad a \quad b \quad a \]
\[ F(j) \quad 0 \quad 0 \quad 1 \quad 1 \quad 2 \quad 3 \]
... Knuth-Morris-Pratt Algorithm
Construction of the failure function is similar to the KMP algorithm itself:
\textit{failureFunction} \((P)\):
\begin{itemize}
\item \textbf{Input} pattern \(P\) of length \(m\)
\item \textbf{Output} failure function for \(P\)
\end{itemize}
\begin{itemize}
\item \(F[0]=0\)
\item \(i=1, j=0\)
\item \textbf{while} \(i < m\) \textbf{do}
\begin{itemize}
\item \textbf{if} \(P[i]=P[j]\) \textbf{then}
\begin{itemize}
\item \(j=j+1\)
\end{itemize}
\item \textbf{else if} \(j > 0\) \textbf{then}
\begin{itemize}
\item \(F[i]=F[j-1]\)
\end{itemize}
\item \textbf{else}
\begin{itemize}
\item \(F[i]=0\)
\end{itemize}
\end{itemize}
\item \textbf{end while}\n\end{itemize}
KMPMatch \((T, P)\):
\begin{itemize}
\item \textbf{Input} text \(T\) of length \(n\), pattern \(P\) of length \(m\)
\item \textbf{Output} starting index of a substring of \(T\) equal to \(P\)
\begin{itemize}
\item \(-1\) if no such substring exists
\end{itemize}
\end{itemize}
\begin{itemize}
\item \(P=\text{failureFunction}(P)\)
\item \(i=0, j=0\)
\item \textbf{while} \(i < n\) \textbf{do}
\begin{itemize}
\item \textbf{if} \(T[i]=P[j]\) \textbf{then}
\begin{itemize}
\item \(F[i]=F[j-1]\)
\end{itemize}
\item \textbf{else if} \(j > 0\) \textbf{then}
\begin{itemize}
\item \(i=i+1, j=j+1\)
\end{itemize}
\item \textbf{else}
\begin{itemize}
\item \(i=i+1\)
\end{itemize}
\end{itemize}
\item \textbf{end while}\n\end{itemize}
Knuth-Morris-Pratt Algorithm
Analysis of failure function computation:
- At each iteration of the while-loop, either
- $i$ increases by one, or
- the “shift amount” $i-j$ increases by at least one (observe that $F(j-1)<j$)
- Hence, there are no more than $2m$ iterations of the while-loop
$\Rightarrow$ failure function can be computed in $O(m)$ time
Boyer-Moore vs KMP
Boyer-Moore algorithm
- decides how far to jump ahead based on the mismatched character in the text
- works best on large alphabets and natural language texts (e.g., English)
Knuth-Morris-Pratt algorithm
- uses information embodied in the pattern to determine where the next match could begin
- works best on small alphabets (e.g., A, C, G, T)
Tries
Tries are trees organised using parts of keys (rather than whole keys)
Preprocessing Strings
Preprocessing the pattern speeds up pattern matching queries
- After preprocessing $P$, KMP algorithm performs pattern matching in time proportional to the text length
If the text is large, immutable and searched for often (e.g., works by Shakespeare)
- we can preprocess the text instead of the pattern
A trie …
- is a compact data structure for representing a set of strings
Depth $d$ of trie = length of longest key value
Cost of searching $O(d)$ (independent of $n$)
Tries
Possible trie representation:
```c
#define ALPHABET_SIZE 26
typedef struct Node *Trie;
typedef struct Node {
bool finish; // last char in key?
Item data; // no Item if !finish
Trie child[ALPHABET_SIZE];
} Node;
typedef char *Key;
```
Note: Can also use BST-like nodes for more space-efficient implementation of tries
Basic operations on tries:
1. search for a key
2. insert a key
Traversing a path, using char-by-char from Key:
```plaintext
find(trie, key):
Input trie, key
Output pointer to element in trie if key found
NULL otherwise
node=trie
for each char in key do
if node.child[char] exists then
node=node.child[char] // move down one level
else
return NULL
end if
end for
if node.finish then // “finishing” node reached?
return node
else
return NULL
end if
```
Insertion into Trie:
```plaintext
insert(trie, item, key):
Input trie, item with key of length m
Output trie with item inserted
if trie is empty then
t=new trie node
end if
if m=0 then
t.finish=true, t.data=item
else
t.child[key[0]]=insert(trie, item, key[1..m-1])
end if
return t
```
Analysis of standard tries:
- \(O(n)\) space
- \(O(d \cdot m)\) time for insertion and search in text
\(n\) ... total size of text (e.g. sum of lengths of all strings in a given dictionary)
\(m\) ... size of the string parameter of the operation (the “key”) (e.g. 26)
\(d\) ... size of the underlying alphabet (e.g. 26)
Word Matching With Tries
Preprocessing the text:
1. Insert all searchable words of a text into a trie
2. Each leaf stores the occurrence(s) of the associated word in the text
Example text and corresponding trie of searchable words:
Compressed Tries
Compressed tries …
- have internal nodes of degree ≥ 2
- are obtained from standard tries by compressing "redundant" chains of nodes
Example:
Possible compact representation of a compressed trie to encode an array $S$ of strings:
- nodes store ranges of indices instead of substrings
- use triple $(i,j,k)$ to represent substring $S[i][j..k]$
- requires $O(s)$ space ($s$ = #strings in array $S$)
Example:
Pattern Matching With Suffix Tries
The suffix trie of a text $T$ is the compressed trie of all the suffixes of $T$
Example:
Compact representation:
Input:
compact suffix trie for text $T$
pattern $P$
Goal:
find starting index of a substring of $T$ equal to $P$
Example:
```
suffixTrieMatch(trie, P):
Input compact suffix trie for text $T$, pattern $P$ of length $m$
Output starting index of a substring of $T$ equal to $P
-1 if no such substring exists
j=0, v=root of trie
repeat
// we have matched $j+1$ characters
```
if \( \exists w \in \text{children}(v) \) such that \( P[j] = T[\text{start}(w)] \) then
\[
\begin{align*}
i &= \text{start}(w) & // \text{start}(w) \text{ is the start index of } w \\
x &= \text{end}(w) - i + 1 & // \text{end}(w) \text{ is the end index of } w \\
\text{if } m \leq x & & // \text{length of suffix } \leq \text{length of the node label} \\
\text{if } P[j..j+m-1] = T[i..i+m-1] & & \text{then} \\
\text{return } i - j & & // \text{match at } i - j \\
\text{else} & & \text{return } -1 & & // \text{no match} \\
\text{else} & & \text{return } -1 & & \text{if } P[j..j+x-1] = T[i..i+x-1] \text{ then} \\
\text{if } \text{match} & & \text{update suffix start index and length} \\
v &= w & & // \text{move down one level} \\
\text{else} & & \text{return } -1 & & // \text{no match} \\
\text{else} & & \text{return } -1 & & \text{end if} \\
\end{align*}
\]
until \( v \) is leaf node
\text{return } -1 & // \text{no match}
... Pattern Matching With Suffix Tries
Analysis of pattern matching using suffix tries:
Suffix trie for a text of size \( n \) ...
- can be constructed in \( O(n) \) time
- uses \( O(n) \) space
- supports pattern matching queries in \( O(s \cdot m) \) time
- \( m \) ... length of the pattern
- \( s \) ... size of the alphabet
Text Compression
Problem: Efficiently encode a given string \( X \) by a smaller string \( Y \)
Applications:
- Save memory and/or bandwidth
Huffman's algorithm
- computes frequency \( f(c) \) for each character \( c \)
- encodes high-frequency characters with short code
- no code word is a prefix of another code word
- uses optimal encoding tree to determine the code words
Example: \( T = \text{abracadabra} \)
Huffman's algorithm
- computes frequency \( f(c) \) for each character
- successively combines pairs of lowest-frequency characters to build encoding tree "bottom-up"
Example: \( \text{abracadabra} \)
Huffman Code
Huffman's algorithm using priority queue:
\[
\text{HuffmanCode}(T): \\
\quad \text{Input: string } T \text{ of size } n \\
\quad \text{Output: optimal encoding tree for } T \\
\end{align*}
\]
- compute frequency array
- \(Q=\text{new priority queue}\)
- for all characters \(c\) do
- \(T=\text{new single-node tree storing } c\)
- \(\text{join}(Q,T) \text{ with frequency}(c) \text{ as key}\)
- end for
- while \(|Q|>2\) do
- \(f_1=Q.\text{minKey}(), T_1=\text{leave}(Q)\)
- \(f_2=Q.\text{minKey}(), T_2=\text{leave}(Q)\)
- \(T=\text{new tree node with subtrees } T_1 \text{ and } T_2\)
- \(\text{join}(Q,T) \text{ with } f_1+f_2 \text{ as key}\)
- end while
- return \(\text{leave}(Q)\)
Analysis of Huffman's algorithm:
- \(O(n+d \cdot \log d)\) time
- \(n\) … length of the input text \(T\)
- \(d\) … number of distinct characters in \(T\)
Summary
- Alphabets and words
- Pattern matching
- Boyer-Moore, Knuth-Morris-Pratt
- Tries
- Text compression
- Huffman code
Suggested reading:
- Tries … Sedgewick, Ch.15.2
Produced: 17 Oct 2017
|
{"Source-Url": "https://www.cse.unsw.edu.au/~cs9024/17s2/slides/week12/notes-2.pdf", "len_cl100k_base": 4943, "olmocr-version": "0.1.53", "pdf-total-pages": 9, "total-fallback-pages": 0, "total-input-tokens": 27346, "total-output-tokens": 5714, "length": "2e12", "weborganizer": {"__label__adult": 0.000335693359375, "__label__art_design": 0.0003516674041748047, "__label__crime_law": 0.0004448890686035156, "__label__education_jobs": 0.0007781982421875, "__label__entertainment": 9.715557098388672e-05, "__label__fashion_beauty": 0.00015354156494140625, "__label__finance_business": 0.0001271963119506836, "__label__food_dining": 0.0004734992980957031, "__label__games": 0.0006098747253417969, "__label__hardware": 0.0018310546875, "__label__health": 0.0005407333374023438, "__label__history": 0.00027370452880859375, "__label__home_hobbies": 0.00015997886657714844, "__label__industrial": 0.0005860328674316406, "__label__literature": 0.0003254413604736328, "__label__politics": 0.0002598762512207031, "__label__religion": 0.0005970001220703125, "__label__science_tech": 0.0738525390625, "__label__social_life": 0.00010269880294799803, "__label__software": 0.00994110107421875, "__label__software_dev": 0.9072265625, "__label__sports_fitness": 0.0003736019134521485, "__label__transportation": 0.0005660057067871094, "__label__travel": 0.0002079010009765625}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 15570, 0.01086]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 15570, 0.47476]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 15570, 0.60842]], "google_gemma-3-12b-it_contains_pii": [[0, 1759, false], [1759, 3907, null], [3907, 6043, null], [6043, 8456, null], [8456, 10096, null], [10096, 11564, null], [11564, 12550, null], [12550, 14485, null], [14485, 15570, null]], "google_gemma-3-12b-it_is_public_document": [[0, 1759, true], [1759, 3907, null], [3907, 6043, null], [6043, 8456, null], [8456, 10096, null], [10096, 11564, null], [11564, 12550, null], [12550, 14485, null], [14485, 15570, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, false], [5000, 15570, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 15570, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 15570, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 15570, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 15570, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 15570, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 15570, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 15570, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 15570, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, true], [5000, 15570, null]], "pdf_page_numbers": [[0, 1759, 1], [1759, 3907, 2], [3907, 6043, 3], [6043, 8456, 4], [8456, 10096, 5], [10096, 11564, 6], [11564, 12550, 7], [12550, 14485, 8], [14485, 15570, 9]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 15570, 0.01463]]}
|
olmocr_science_pdfs
|
2024-12-09
|
2024-12-09
|
a102392e7b2903b17d125c90d8097a65f4a7b0d3
|
Monitor Network Traffic with Packet Capture (pcap) on an Android Device
by Ken F Yu
NOTICES
Disclaimers
The findings in this report are not to be construed as an official Department of the Army position unless so designated by other authorized documents.
Citation of manufacturer’s or trade names does not constitute an official endorsement or approval of the use thereof.
Destroy this report when it is no longer needed. Do not return it to the originator.
Monitor Network Traffic with Packet Capture (pcap) on an Android Device
by Ken F Yu
*Computational and Information Sciences Directorate, ARL*
The purpose of this report is to provide detailed information on how to effectively build an Android application to monitor network traffic using open source packet capture (pcap) libraries.
Contents
List of Figures iv
1. Purpose 1
2. Configuration Used 1
3. Overview 1
4. Android Tool Kits Setup 1
5. Rooting Android 2
6. Setup Android on VirtualBox 2
7. Cross-Compile Android Native Code on x86 2
8. Building Application with Native Codes 5
8.1 Calling Native Codes Using JNI 5
8.2 Calling Native Codes from an Android Application 8
9. Retrieve Live Network Traffic via pcap 10
10. Conclusions 12
11. References 13
List of Symbols, Abbreviations, and Acronyms 14
Distribution List 15
# List of Figures
<table>
<thead>
<tr>
<th>Fig.</th>
<th>Description</th>
<th>Page</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Example of .bashrc with Android tool kit settings</td>
<td>2</td>
</tr>
<tr>
<td>2</td>
<td>Example of Application.mk file</td>
<td>3</td>
</tr>
<tr>
<td>3</td>
<td>Example of how to get CPU information in code</td>
<td>4</td>
</tr>
<tr>
<td>4</td>
<td>Example of retrieving files from the asset folder</td>
<td>5</td>
</tr>
<tr>
<td>5</td>
<td>Example of Java calling C using JNI</td>
<td>6</td>
</tr>
<tr>
<td>6</td>
<td>Example of compiling C/C++ header file from Java using javah</td>
<td>6</td>
</tr>
<tr>
<td>7</td>
<td>Example of using JNI in C</td>
<td>7</td>
</tr>
<tr>
<td>8</td>
<td>Example of the “su” granting process using native code</td>
<td>9</td>
</tr>
<tr>
<td>9</td>
<td>Example of how to open and retrieve network data using pcap</td>
<td>12</td>
</tr>
</tbody>
</table>
1. Purpose
The purpose of this document is to provide detailed information on how to effectively build an Android application to monitor network traffic using open source packet capture (pcap) libraries.¹
2. Configuration Used
The following list is the software and hardware used for development and testing:
- Operating System (OS): Red Hat Enterprise Linux (RHEL), version 6.5
- Android Development Tools (ADTs), Version 22.3.0–887826
- Saferoot²
- Samsung Galaxy S3
- Dell Precision T7400
- 8 GB memory
- Intel Xeon X5472 Central Processing Unit (CPU)
- 64-bit quad and dual-core
- 3.00 GHz
- Open source pcap libraries
- Oracle VirtualBox³ – optional
- Android OS ISO for x86⁴ – optional
- Android Software Development Kit (SDK)⁵
- Android Native Development Kit (NDK)⁶
3. Overview
In the field of network monitoring, the pcap Application Programming Interface (API) is a well-known set of open source libraries for capturing network traffic. Because the pcap API is written in C, the codes can be ported to an Android device natively to improve speed performance while monitoring high-volume network traffic.
4. Android Tool Kits Setup
To setup the Android tool kits, download Android SDK⁵ and NDK.⁶ Then, decompress the 2 files to the local bin path. Afterward, setup the local .bashrc with the correct Android environment settings, assuming that home/user1/bin is where the tool kits are installed. See Fig. 1.
export ANDROID_SDK=/home/user1/bin/adt-bundle-linux-x86_64-20131030/sdk
export ANDROID_NDK=/home/user1/bin/android-ndk-r9
export PATH=$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools: $PATH
export ANDROID_HOME=/home/user1/bin/adt-bundle-linux-x86_64-20131030/sdk
Fig. 1 Example of .bashrc with Android tool kit settings
Ensure that “ndk-build” command can be executed if NDK is setup correctly. From ECLIPSE, an integrated development environment (IDE), part of the Android SDK, ensure that the SDK location is set to the correct directory. To perform this operation, open Eclipse, go to <Preference->Android>. The SDK location edit line should be set to the path where SDK was installed (i.e., </home/user1/bin/adt-bundle-linux-x86_64-20131030/sdk>).
5. Rooting Android
Because the pcap library requires root privileges, rooting of the Android device is necessary. Refer to the Technical Note (TN), Rooting Android Device\(^7\) for more detail.
6. Setup Android on VirtualBox
To speed up the debugging process without using the actual Android device, or the very slow Android virtual machine, deploy the Android OS on VirtualBox. Refer to the TN, Android Virtual Machine (VM) Setup on Linux\(^8\) for additional information.
7. Cross-Compile Android Native Code on x86
CROSS-COMPILER can create executable code for a processor other than the one on which the compiler is running. I used VirtualBox to run the Android OS VM on an x86 processor. Because this processor is a nonARM-based processor, it requires cross compilation.
To add this capability to a processor that runs on a different platform, create an Android makefile (Application.mk) for the current Android project under the <jni> subdirectory. Make sure to use uppercase characters in the Application.mk file. An example of this file is shown in Fig. 2.
APP_STL := gnustl_static
APP_ABI := armeabi armeabi-v7a x86
Fig. 2 Example of Application.mk file
The <x86> is the keyword used in this makefile to specify the x86 processor type, which is used to cross-compile applications that run on the Android OS using an x86 processor. After the processor type is added, simply perform the normal ndk-build steps\(^9\). The native code is now ready for deployment.
The Android application can use the Java Native Interface (JNI) to communicate with the native codes. As a result, there is no need to be concerned about building a separate executable for native calls. However, if the application is required to spawn a native process, then it is necessary to have a separate build for each processor-based executable. In order to deploy the native executable from the Android package, this executable must be copied or saved under the <asset> path of the project directory.
There are many options that allow a programmer to distribute processor-based executables. The easiest method is to have a separate processor build package for deployment. Another more complicated option is to create a separate path for a processor-based directory under the project’s <asset> path. For example, <project/asset/x86> for x86 and <project/asset/arm> can be used for ARM processors. To deploy the correct type of executable when running the application, the CPU type should be obtained. The processor type on the device can be retrieved by using the BufferedReader class from the device’s </proc/cpuinfo> file. Figure 3 shows an example of how to retrieve the CPU information.
Private String getCpuInfo() {
StringBuffer sb = new StringBuffer();
sb.append("abi: ").append(Build.CPU_ABI).append("\n");
if (new File("/proc/cpuinfo").exists()) {
try {
BufferedReader br = new BufferedReader(new
FileReader(new File("/proc/cpuinfo")));
String data;
while ((data = br.readLine()) != null) {
sb.append(data + "\n");
}
if (br != null) {
br.close();
}
} catch (IOException e) {
e.printStackTrace();
}
} catch (IOException e) {
e.printStackTrace();
}
// info from the cpu file
return sb.toString();
}
Fig. 3 Example of how to get CPU information in code
After the CPU type is obtained, the AssetManager in <android.content.res.AssetManager> API can be used to extract the native executable. The codes shown in Fig. 4 are an example of how to retrieve files from the asset folder.
Private void copyFileFromAssets(String assetPath, String filename, String toPath) {
AssetManager assetManager = this.getAssets();
InputStream in = null;
OutputStream out = null;
try {
in = assetManager.open(assetPath);
out = new FileOutputStream(new File(toPath));
byte[] buffer = new byte[1024];
int read;
while ((read = in.read(buffer)) != -1) {
out.write(buffer, 0, read);
}
in.close();
in = null;
out.flush();
out.close();
out = null;
} catch (Exception e) {
Log.e(mServiceName, e.getMessage());
}
}
Fig. 4 Example of retrieving files from the asset folder
8. Building Application with Native Codes
8.1 Calling Native Codes Using JNI
One way for an Android application to interact with native codes is to use JNI. JNI provides the cross-platform between Java and C/C++. When calling C from Java, it is necessary to have the Java-to-C calling method be static. The keyword “static native” should be used. The C++ method has to be static as well. The example in Fig. 5 illustrates how Java calls C using JNI.
Public int callNativeExample()
{
String config = "config";
String pcap = "pcap";
String datafile = "file";
String savefile = "save";
// calls the native code
int ret = naInitElide(config, pcap, datafile, saveFile);
}
// JNI native call declaration
private static native int naInitElide(String config, String pcap, String datafile, String saveFile);
private static native String naStartElideTest();
private static native void naStopService();
static {
System.loadLibrary("TestJni");
}
Fig. 5 Example of Java calling C using JNI
The above examples show 3 methods: 1) Method naInitElide() passes 4 strings to
the JNI interface method and returns an integer; 2) Method naStartElideTest() has
no passing parameter and returns a string; and 3) Method naStopElideTest() has no
passing and no return parameters. These methods belong to the native library called
“TestJni”. The library must be declared as static. After these methods are created
and saved as a Java file, the javah utility program can be used to create the C/C++
interface header. An example of the usage is shown in Fig. 6.
Javah -verbose -classpath $ANDROID_SDK/platforms/android-19/android.jar:bin/classes -jni -d jni
com.example.elidetest.ElideTestService
Fig. 6 Example of compiling C/C++ header file from Java using javah
As shown in Fig. 6, a C/C++ based header file will be created based on the number
of native methods that are created. In this example, I assume that ElideTestService
is an <ElideTestService.java> file and that <com.example.elidetest> is the
namespace. The “-classpath” option points to where the <android.jar> file is. The
–d option specifies where to place the output header files. The header file can be
used as definition for the methods used later—just need to fill in the contents. An
example of the C/C++ implementation using JNI is shown in Fig. 7.
Fig. 7 Example of using JNI in C
The C/C++ method name uses a very strict declaration for the Android JNI. The method name must follow the correct naming convention for it to work properly. For this reason, the javah program comes in very handy because it creates the header automatically. Once the native codes are written, compile the codes using
the usual `<ndk-build>` command via command shell under the project’s `<jni>` directory. It will build the native codes object library for you.9
8.2 Calling Native Codes from an Android Application
The purpose of calling native codes from an Android application is to allow the application itself to have the ability to start as “root”. This application can spawn a process that requires administrative privileges. Under the current design Android development requirement, an Android Graphical User Interface (GUI) application cannot directly call any native API that requires administrative permissions, as in the case of pcap’s `<pcap_open_live()>` method. To overcome this obstacle, the application needs to spawn the super user (su) process, which requires the user to grant permission. After “su” is granted by the user, this process will need to spawn a shell process and then calls the process that requires “root” access. An example of the “su” granting process using native code is illustrated in Fig. 8.
private static java.lang.Process mElideProcess = null;
private 9escry9 bCreated = false;
private DataOutputStream mOS = null;
try {
mElideProcess = Runtime.getRuntime().exec("su", null, null);
// Attempt to write a file to a root-only
mOS = new DataOutputStream(mElideProcess.getOutputStream());
mReader = new BufferedReader(new InputStreamReader(mElideProcess.getInputStream()));
if(null != mOS && null != mReader)
bCreated = true;
} catch (Exception e) {
// Can’t get root!
mRoot = false;
mRootMsg = “createProcess failed: su “ + e.getMessage();
}
if (bCreated == true) {
try {
mOS.writeBytes("id
");
mOS.flush();
String currUid = mReader.readLine();
9escry9 exitSu = false;
if (true == currUid.contains("uid=0"))
// do something after permission is granted.
// ie. Call your own process
// pcapElide is an example of the command
// that is using
try {
String cmd = "./pcapElide”;
mOS.writeBytes(cmd);
mOS.flush();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
Fig. 8 Example of the “su” granting process using native code
There are many ways to capture live network traffic on an Android device. However, one way to capture network traffic is to use the pcap library in native codes. This method is the most preferred for optimal performance in obtaining network traffic data for analyses.
To open network traffic, the `<pcap_open_live()>` method is used. The 2 API methods to retrieve network data once the device is opened are `<pcap_next()>` and `<pcap_loop()>`. I performed experiments using both API methods. At constant network traffic, I discovered that if an Android device receives data speed lower than 100 kbps, the 2 API methods did not have any performance issues. However, with constant incoming data rate higher than 250 kbps, `<pcap_next()>` does not respond to the caller. In other words, the API just stayed in an infinite loop without returning back to the caller. On the other hand, `<pcap_loop()>` uses the callback handler capability, and it has no problem handling any network speed. If the network speed is too fast, it simply drops the packets and continues its required request. An example of how to open and retrieve network data using pcap is shown in Fig. 9.
pcap_t* getPCapFileDescriptor(const string &pcapOrDevice)
{
pcap_t* plescry = NULL;
char errbuf[PCAP_ERRBUF_SIZE]; // 256
bpf_u_int32 pMask; /* subnet mask */
bpf_u_int32 pNet; /* ip address*/
// use this if it is an offline file
plescry = pcap_open_offline(pcapOrDevice.c_str(), errbuf);
pcap_if_t *alldevs, *d;
char dev_buff[64] = {0};
int i = 0;
// Prepare a list of all the devices
if (pcap_findalldevs(&alldevs, errbuf) == -1)
{
cout << "no device found\n";
return NULL;
}
cout << "flags: " << alldevs->flags << "\n";
// Print the list to user
// so to see the right selection is made
bool bFoundDevice = false;
for (d=alldevs; d; d=d->next)
{
if (pcapOrDevice == d->name)
// requested device found
bFoundDevice = true;
}
if (bFoundDevice == false)
{
cout << "device " << pcapOrDevice << " cannot be found as active\n";
return plescry;
}
// fetch the network address and network mask
pcap_lookupnet(pcapOrDevice.c_str(), &pNet, &pMask, errbuf);
// Now, open device for sniffing none promiscuous = 0
plescry = pcap_open_live(pcapOrDevice.c_str(), // name of the device
65536, // guarantees that the whole packet will be captured on all the link layers
0, // none promiscuous mode
1000, // read timeout 1 sec
errbuf); // error buffer
// no longer need device list
pcap_freealldevs(alldevs);
}
/* Callback function invoked by libpcap for every incoming packet */
void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data)
{
// do your own processing here
}
// example of opening device
pcap_t *pCap = getPCapFileDescriptor("wlan0");
// example of setting pcap_loop after device is opened
if (pcap_loop(pCap, -1, (pcap_handler)packet_handler, NULL) == -1)
{
// problem with pcap_loop
}
Fig. 9 Example of how to open and retrieve network data using pcap
10. Conclusions
Network traffic capturing on Android using pcap with native codes is relatively new. This report serves as a guide for any developer creating an application on Android to take advantage of the proven open source speedy performance to monitor or capture network traffic using pcap.
11. References
2. Saferoot: Root for VRUEMJ7, MK2, and Android 4.3. [accessed 24 July 2014].
<table>
<thead>
<tr>
<th>Symbol</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>ADT</td>
<td>Android Development Tool</td>
</tr>
<tr>
<td>API</td>
<td>Application Programming Interface</td>
</tr>
<tr>
<td>CPU</td>
<td>Central Processing Unit</td>
</tr>
<tr>
<td>GUI</td>
<td>Graphical User Interface</td>
</tr>
<tr>
<td>IDE</td>
<td>integrated development environment</td>
</tr>
<tr>
<td>JNI</td>
<td>Java Native Interface</td>
</tr>
<tr>
<td>NDK</td>
<td>Native Development Kit</td>
</tr>
<tr>
<td>OS</td>
<td>Operating System</td>
</tr>
<tr>
<td>pcap</td>
<td>packet capture</td>
</tr>
<tr>
<td>RHEL</td>
<td>Red Hat Enterprise Linux</td>
</tr>
<tr>
<td>SDK</td>
<td>Software Development Kit</td>
</tr>
<tr>
<td>su</td>
<td>super user</td>
</tr>
<tr>
<td>TN</td>
<td>Technical Note</td>
</tr>
<tr>
<td>VM</td>
<td>Virtual Machine</td>
</tr>
</tbody>
</table>
INTENTIONALLY LEFT BLANK.
|
{"Source-Url": "https://www.arl.army.mil/arlreports/2015/ARL-TN-0650.pdf", "len_cl100k_base": 4501, "olmocr-version": "0.1.50", "pdf-total-pages": 22, "total-fallback-pages": 0, "total-input-tokens": 35838, "total-output-tokens": 5652, "length": "2e12", "weborganizer": {"__label__adult": 0.0003566741943359375, "__label__art_design": 0.00015223026275634766, "__label__crime_law": 0.000308990478515625, "__label__education_jobs": 0.0002624988555908203, "__label__entertainment": 4.5359134674072266e-05, "__label__fashion_beauty": 0.00011426210403442384, "__label__finance_business": 0.0001055598258972168, "__label__food_dining": 0.0002560615539550781, "__label__games": 0.000438690185546875, "__label__hardware": 0.0026874542236328125, "__label__health": 0.0003046989440917969, "__label__history": 0.00015974044799804688, "__label__home_hobbies": 6.0439109802246094e-05, "__label__industrial": 0.0003058910369873047, "__label__literature": 0.0001018047332763672, "__label__politics": 0.00017559528350830078, "__label__religion": 0.000293731689453125, "__label__science_tech": 0.0098114013671875, "__label__social_life": 5.9604644775390625e-05, "__label__software": 0.007205963134765625, "__label__software_dev": 0.97607421875, "__label__sports_fitness": 0.0002541542053222656, "__label__transportation": 0.0005059242248535156, "__label__travel": 0.00016582012176513672}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 19263, 0.02217]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 19263, 0.78244]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 19263, 0.7337]], "google_gemma-3-12b-it_contains_pii": [[0, 85, false], [85, 463, null], [463, 607, null], [607, 798, null], [798, 1313, null], [1313, 2366, null], [2366, 3804, null], [3804, 5628, null], [5628, 7235, null], [7235, 8223, null], [8223, 9373, null], [9373, 11254, null], [11254, 11604, null], [11604, 12620, null], [12620, 13952, null], [13952, 15119, null], [15119, 16394, null], [16394, 17420, null], [17420, 18556, null], [18556, 19238, null], [19238, 19238, null], [19238, 19263, null]], "google_gemma-3-12b-it_is_public_document": [[0, 85, true], [85, 463, null], [463, 607, null], [607, 798, null], [798, 1313, null], [1313, 2366, null], [2366, 3804, null], [3804, 5628, null], [5628, 7235, null], [7235, 8223, null], [8223, 9373, null], [9373, 11254, null], [11254, 11604, null], [11604, 12620, null], [12620, 13952, null], [13952, 15119, null], [15119, 16394, null], [16394, 17420, null], [17420, 18556, null], [18556, 19238, null], [19238, 19238, null], [19238, 19263, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 19263, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 19263, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 19263, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 19263, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 19263, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 19263, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 19263, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 19263, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 19263, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 19263, null]], "pdf_page_numbers": [[0, 85, 1], [85, 463, 2], [463, 607, 3], [607, 798, 4], [798, 1313, 5], [1313, 2366, 6], [2366, 3804, 7], [3804, 5628, 8], [5628, 7235, 9], [7235, 8223, 10], [8223, 9373, 11], [9373, 11254, 12], [11254, 11604, 13], [11604, 12620, 14], [12620, 13952, 15], [13952, 15119, 16], [15119, 16394, 17], [16394, 17420, 18], [17420, 18556, 19], [18556, 19238, 20], [19238, 19238, 21], [19238, 19263, 22]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 19263, 0.09091]]}
|
olmocr_science_pdfs
|
2024-11-30
|
2024-11-30
|
6c5d1e683223811cf8268707febf91ebd435856e
|
GENG5508
Robotics: C Programming
Lecture 01
(Unit Outline and Introduction to C)
Dr. Syed Mohammed Shamsul Islam
School of Electrical, Electronic and Computer Engineering
The University of Western Australia
Why Learning C Programming?
• C is the world's most popular, and widely deployed programming languages.
• The world's popular operating systems, Linux, Windows and Mac OS X, their interfaces and file systems, are written in C.
• The infrastructure of the Internet, including most of its networking protocols, web servers, and email systems, are written in C.
• Software libraries providing graphical interfaces and tools, and efficient numerical, statistical, encryption, and compression algorithms, are written in C.
• Most relevantly, the software for most embedded devices, including those in robots, cars, aircraft, smart appliances, sensors, mobile phones, and game consoles, is written in C.
• The software on the Mars Phoenix Lander is written in C.
Why Learning C Programming?
- Portability on different architectures
- 4-bit and 8-bit microcontrollers
- Traditional 16-, 32-, and 64-bit virtual memory architectures in most PCs and workstations
- Larger 64- and 128-bit supercomputers
- Traditional large instruction set architectures, such as Motorola 680x0, Sun SPARC, Intel x86, and DEC-Alpha
- Newer reduced instruction set architectures (RISC), such as SGI MIPS, IBM/Motorola PowerPC
- Mobile phones, home theatre equipment, routers and access-points
- Parallel and pipelined architectures
Handbook description of GENG5508
• This unit develops programming and design skills for various robotics technologies such as mobile robots, robot simulators, robot navigation and mapping, vision guidance and tracking and artificial intelligence (AI) for robotics (neural nets and genetic algorithms).
• This also incorporates a significant amount of C programming skills. The unit introduces a procedural programming language in the context of mobile robotics as an engineering application discipline, as well as fundamental robotics concepts.
• Contents delivery of the two areas are strongly interleaved. The unit contents include
➢ (1) programming—advanced C programming, data structures, procedural control elements, and usage of libraries for larger projects; and
➢ (2) robotics—introduction to mobile robots, driving robots design and kinematics, use of real mobile robots and robot simulator (in tutorials and laboratories), robot navigation and mapping, vision guidance and tracking, and AI for robotics (neural nets and genetic algorithms).
Topics to be covered in the unit
• An introduction to the ISO-C99 programming language
The structure of a C program, variables, initialization of variables, basic datatypes - integers, floats, characters and Booleans, enumerations, precedence of operators, flow control.
• Compilation of ISO-C99 programs
The GNU ISO-C99 compiler, gcc, compiling and linking, scope rules of global, local, and external variables, storage modifiers.
• C programs in greater detail
The C preprocessor - header file inclusion, textual constants, macros, conditional compilation, portability of C programs, using third-party libraries.
• Basic data structures and data representation
Arrays and character strings, enumerated types, user-defined types and structures, bitwise operators.
• The use of functions and basic I/O
Functions, parameter passing, return values, C's stdio functions, function prototypes, external functions, passing functions as parameters, variadic functions.
Topics to be covered in the unit…
• **Pointers in C**
Parameter passing-by-reference using pointers, pointers to arrays and character strings, command-line parameters, pointer arithmetic.
• **Dynamic memory allocation**
Motivation, allocation and de-allocation, self-referential structures - linked lists, trees.
• **The Standard C library**
String handling functions, mathematical functions, formatted I/O, file I/O, buffered and un-buffered I/O, sorting vectors, dates and times.
• **GUI Toolkit**
FLTK and FLUID.
• **Developing C projects**
Managing multi-file projects with *make*, calling C programs and functions from other languages (Java, MATLAB...).
Assessment Schedule
<table>
<thead>
<tr>
<th>Item</th>
<th>Value</th>
<th>Due Date</th>
</tr>
</thead>
<tbody>
<tr>
<td>Mid-term Exam</td>
<td>25%</td>
<td>7th Week</td>
</tr>
<tr>
<td>Practical (Labs)- total four</td>
<td>10%</td>
<td>By Saturday each week. Late penalties apply.</td>
</tr>
<tr>
<td>Quiz</td>
<td>5%</td>
<td>4th Week</td>
</tr>
</tbody>
</table>
- **Lab Submission**
Preferably through cssubmit https://secure.csse.uwa.edu.au/run/cssubmit. If you have difficulties, directly by emails to me.
- **Lecture and Lab dates**
Six 2-hour lectures at the beginning of the semester: Tuesday 3:00 to 5:00pm (@ RBST:LT, G.16 - Robert Street Lecture Theatre, Robert Street Building)
- **Lab dates**
4 Lab sessions (2 supervised hours each): Friday 9-11 am @CSSE 2.05 or **Friday 2-4pm @CSSE 2.03.**
Software Required
• If you want to run the programs on your machine (e.g., laptop), you will need to have gcc or Microsoft Visual Studio or Dav C++ installed.
• Dav C++ is free to download. Other software you can get a copy at: http://web.csse.uwa.edu.au/students/computing/software
• Contact: Faculty IT help: ithelp-ecm@uwa.edu.au; UWA Service Desk <servicedesk@uwa.edu.au>
Schaum's Outline of Programming with C, 2nd Edition
Byron Gottfried
Publisher: McGraw-Hill
532 pages
1996
Some Other Books
**Computer Science: A Structured Programming Approach Using C, 3rd Edition**
Behrouz Forouzan, Richard Gilberg
Publisher: Thomson Course Technology
1184 pages, 2007
**A First Book of ANSI C, 4th Edition**
Gary Bronson
Publisher: Thomson Course Technology
2007
**A Book on C: Programming in C, 4th Edition**
Al Kelley, Ira Pohl
Publisher: Addison Wesley Professional
ISBN: 0201183994, 752 pages
1997
**C: The Complete Reference, 4th Edition**
Herbert Schildt
Publisher: Addison Wesley Professional
ISBN: 0072121246
805 pages
2000
Other Resources
• **Online books and tutorials**
- [The Definitive C Book Guide and List](#), by contributors to *stackoverflow*.
*Introductory C Programming*, chapters 1-14.
- [The C Book](#), by Mike Banahan, Declan Brady and Mark Doran (originally by Addison Wesley, 1991).
- A tutorial on pointers and arrays in *C*, by Ted Jensen, Sept 2003
- [C Tutorial](#), from java2s.com *(lots of information, but difficult to navigate)*.
• **C Language and Library Resources**
- The [Wikipedia entry](#) for the C programming language.
- [Standard C Library Functions](#). Type `man <function name>` on the CSSE laboratory computers for details.
- [POSIX Library Functions](#) (which are not part of the Standard C Library)
About the Lecturer
• Name: Asst. Prof Syed Mohammed Shamsul Islam (Shams)
• Age: 36
• Location: CSSE Room 2.16
• Email: syed.islam [at] uwa.edu.au
• Research interests: Computer vision, image processing, artificial intelligence, robotics and computer networking.
• Consultation Time: Friday 11am-12.30pm
Acknowledgement
• Some lecture materials were prepared by Dr. Chris McDonald, Dr. L Barone and Dr. Ferdous Sohel.
So what is C?
- In one breath, C is often described as a good **general purpose language**, an excellent **systems programming language**, and just a **glorified assembly language**.
- C can be correctly described as a general purpose programming language, a description also given to Java, Visual-Basic, C++, and C#.
- C is a **procedural programming language**, having programming features provided by most procedural programming languages –
- strongly typed variables, constants,
- standard (or *base*) data types, enumerated types, user-defined types,
- aggregate structures,
- standard control flow, recursion, and
- program modularization.
So what is C?...
- C has separate compilation, conditional compilation, bitwise operators, pointer arithmetic, and language independent input and output.
- However, C is not an object-oriented language like Java, Objective-C, or C#. It does not offer
- tuples or sets,
- Java's concept of classes or objects,
- nested functions,
- subrange types, (C has only recently added a Boolean datatype).
- Evolution of C:
- invention in early 1970s,
- the ANSI-C standard in 1989,
- the ISO-C99 standard in 1999, and
The structure of C programs
• Hello World! A first C program:
```c
#include <stdio.h>
void main()
{
printf("Hello World!");
}
```
Notes:
• Characters such as a space, tab, or newline, may appear almost anywhere (used to provide a lay out of the program)- they are stripped out and ignored by the C compiler.
• Functions in C, may be thought of as a block of statements to which we give a name. In this example, we have one function: `main`.
• Lines commencing with a '#' in blue are processed by a separate program, named the C preprocessor.
The structure of C programs...
• High-level structure of a C program:
Of note in this example:
• Keywords, in **bold**, mean very specific things to the C compiler.
• Lines in **green** are **comments**. They are ignored by the C compiler, and may contain (almost) any characters. C99 provides two types of comments -
/* block comments */ and
// comments to the end of a line
• A variety of brackets are employed, in pairs, to group together items to be considered in the same way. Here:
• angle brackets enclose a filename in a `#include` directive,
• round brackets group items in arithmetic expressions and function calls,
• square brackets enclose the index when access arrays (vectors and matrices...) of data, and
• curly brackets group together sequences of one or more **statements** in C. We term a group of statements a **block** of statements.
The structure of C programs...
More notes:
- When our programs are run by the operating system, the operating system always starts our program from `main`. Thus, every complete C program requires a `main` function.
- The operating system passes some special information to our `main` function, `command-line` arguments, and `main` needs a special syntax to receive these.
- When our program finishes its execution, it returns some information to the operating system. Our example here `exits` by announcing either its failure or success.
```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
/* Compile this program as:
gcc -std=gnu99 -Wall -Werror -pedantic -o rot rot.c
*/
#define ROT 13
static char rotate(char c)
{
....
return c;
}
int main(int argc, char *argv[])
{
// check the number of arguments
if(argc != 2) {
....
exit(EXIT_FAILURE);
}
else {
....
exit(EXIT_SUCCESS);
}
return 0;
}
```
Compiling and linking our C programs
• C programs are human-readable text files, that we term source-code files.
• This makes them very easy to copy, read, and edit on different computers and different operating systems.
• C is often described as being portable at the source-code level.
• Before we can run (execute) our C programs, we must translate, or compile, their source-code files to files that the operating system can better manage.
• A program known as a compiler translates (compiles) source-code files into object-code files.
• Finally, we translate or link one or more object-code files to produce an executable program, often termed a 'binary' or an 'exe' file.
• A program known as a linker performs this translation, also linking our object-code file(s) with standard libraries and (optionally) 3rd-party libraries.
Variables
• Variables
- Variables are locations in a computer's memory. A typical desktop or laptop computer will have 1GB of memory, or one billion addressable memory locations, and C programs will typically use 4 bytes to hold 1 integer value.
- Any variable can only hold a single value at any time - they do not maintain a history of past values they once had.
• Naming our variables
- For better readability, we use simple names reflecting the role of the variable in our programs.
- Name can be almost anything except-
- cannot be same as keywords in C
- they must commence with an alphabetic or the underscore character (_ A-Z a-z), and
- be followed by zero or more alphabetic, underscore or digit characters (_ A-Z ,a-z, 0-9).
- C variable names are case sensitive, thus:
- MYLIMIT, mylimit, Mylimit and MyLimitare four different variable names.
- Older C compilers may limit variable names to, say, 8 unique characters. Thus,
- for them, turn_reactor_coolant_on and turn_reactor_coolant_off are the same variable!
Keep this in mind when writing portable code.
- While not required, it's preferred that variable names do not consist entirely of uppercase characters.
- We'll consistently use uppercase-only names for constants provided by the C preprocessor, or user-defined type names: MAXLENGTH, AVATAR, BUFSIZ, and ROT
Basic Data types
<table>
<thead>
<tr>
<th>Type name</th>
<th>Description, and an example of variable initialization</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>bool</strong></td>
<td>Boolean (truth values), which may only hold the values of either true or false <br> e.g. bool finished = false;</td>
</tr>
<tr>
<td><strong>char</strong></td>
<td>character values, to each hold a single value such as an alphabetic character, a digit character, a space, a tab... <br> e.g. char initial = 'C';</td>
</tr>
<tr>
<td><strong>int</strong></td>
<td>integer values, negative, positive, and zero <br> e.g. int year = 2006;</td>
</tr>
<tr>
<td><strong>float</strong></td>
<td>floating point values, with a typical precision of 10 decimal digits (on our lab machines) <br> e.g. float inflation = 4.1;</td>
</tr>
<tr>
<td><strong>double</strong></td>
<td>"bigger" floating point values, with a typical precision of 17 decimal digits (on our lab machines) <br> e.g. double pi = 3.1415926535897932;</td>
</tr>
</tbody>
</table>
Above types are standard, or base types that C provides to hold commonly required values, and later we'll see how we can also define our own user-defined types to meet our needs.
The scope of variables
• The scope (visibility or lexical range) of a variable describes the range of lines in which the variable may be used.
➢ Global scope (/file scope): Variables are declared outside of all functions and statement blocks, and
➢ Block scope: Variables are declared within a function or statement block.
Of note in this example:
• the variable count has global scope. It is defined on line 06, and may be used anywhere from line 06 until the end of the file (until line 26).
• The variable nfound has block scope. It is defined on line 10, and may be used anywhere from line 10 until the end of the block in which it was defined (until line 26).
• The variable nerrors has block scope. It is defined on line 14, and may be used anywhere from line 14 until line 18.
• The variable ntimes has block scope. It is defined on line 20, and may be used anywhere from line 20 until line 24.
• We could define a different variable named nerrors in the block of lines 20-24 - without problems.
• We could define a different variable named nfound in the block of lines 20-24 - but this would be a very bad practice!
Increment and decrement of a variable
• The "traditional" mechanism of incrementing integer values, in both assignment statements and in for loops:
```c
int value = 0;
....
value = value + 1;
....
for(int i=0 ; i < MAXVALUE ; i=i+1) {
....
}
```
• C provides a shorthand notation (operator) for incrementing and decrementing scalar variables, by one:
```c
int value = 0;
char ch = 'z';
++value; // value is now 1
--ch; // ch is now 'y'
....
for(int i=0 ; i < MAXVALUE ; ++i) {
....
}
for(char letter='a' ; letter <= 'z' ; ++letter) {
....
```
Increment and decrement of a variable...
- While pre- and post-incrementing (and decrementing) initially appears simple, we must be careful when using modified variables in expressions. Consider these results:
```
int x = 0;
int y = 0;
int what = 0;
// -------------- what --- X --- Y --------------
what = ++x; // 1 1 0
what = y++; // 0 1 1
what = y++; // 1 1 2
what = ++y; // 3 1 3
```
- When the increment or decrement operator follows the variable, the operation is performed after its value has been obtained for use in the expression.
- When the operator precedes the variable, the operation is performed first, and then the value of the variable is obtained for use in the expression.
- **Shorthand arithmetic**
A similar notation may be used to perform any standard arithmetic operation on a variable. For example, assuming the correct declarations:
```
value += 2; // equivalent to value = value + 2;
total *= x; // equivalent to total = total * x;
half /= 2; // equivalent to half = half / 2;
poly += x+1; // equivalent to poly = poly + (x+1);
```
Other operators in C
- **Relational Operators**: (Associativity: L→R)
<table>
<thead>
<tr>
<th>Operator</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>></td>
<td>Greater than</td>
</tr>
<tr>
<td>>=</td>
<td>Greater than or equal</td>
</tr>
<tr>
<td><</td>
<td>Less than</td>
</tr>
<tr>
<td><=</td>
<td>Less than or equal</td>
</tr>
<tr>
<td>==</td>
<td>Equal</td>
</tr>
<tr>
<td>!=</td>
<td>Not equal</td>
</tr>
</tbody>
</table>
- **Logical Operators**: (Associativity: L→R)
<table>
<thead>
<tr>
<th>Operator</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>&&</td>
<td>AND</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td>!</td>
<td>NOT</td>
</tr>
</tbody>
</table>
- **Arithmetic Operators**: (Associativity: L→R)
<table>
<thead>
<tr>
<th>Operator</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>*</td>
<td>Multiply</td>
</tr>
<tr>
<td>/</td>
<td>Divide</td>
</tr>
<tr>
<td>%</td>
<td>Remainder</td>
</tr>
<tr>
<td>+</td>
<td>Add</td>
</tr>
<tr>
<td>-</td>
<td>Subtract</td>
</tr>
</tbody>
</table>
- **Conditional Operators** (?, ?): (Associativity: R→L)
\[ \text{expression 1} \ ? \ \text{expression 2} : \ \text{expression 3} \]
- If \text{expression 1} is true (i.e., if its value is nonzero), then \text{expression 2} is evaluated and this becomes the value of the conditional expression.
- However, if \text{expression 1} is false, then \text{expression 3} is evaluated and this becomes the value of the conditional expression.
Flow control
- **Conditional execution**
Conditional statements first evaluate a Boolean condition and then, based on whether it's true or false, execute other statements.
The most common form is:
```c
if(condition) {
more statements;
.....
} else {
more statements;
.....
}
```
Sometimes, the else clause is omitted:
```c
if(condition) {
more statements;
.....
}
```
Often, the else clause itself provides further if statements:
```c
if( condition1) {
more statements;
.....
} else if(condition2) {
more statements;
.....
} else {
more statements;
.....
}
```
Flow control...
- **Multiple Conditions** (Executes from left to right)
```c
if(ConditionOne && ConditionTwo && ConditionThree)
{
Code to execute
}
if(ConditionOne)
{
if(ConditionTwo )
{
if(ConditionThree)
{
Code to execute
}
}
}
if ( a = 10 || b < 20 )
{
}
```
Flow control...
- **Bounded Loop:**
```c
// here, variable i holds the values 1,2,...10
for(int i = 1 ; i <= 10 ; i = i+1) {
// the above introduced a loop-control variable, i
......
printf("loop number %d\n", i);
......
// variable i is available down to here
}
// but variable i is not available from here
``
```c
// here, variable ch holds each lowercase value
for(char ch = 'a' ; ch <= 'z' ; ch = ch+1) {
......
printf("loop using character \'%c\'\n", ch);
......
}
``
- C provides its **for** control statement to loop through a sequence of statements, a block of statements, a known number of times.
- A variable called *loop control variable* is used to count how many times we go through the loop (e.g. *i* in the top example).
- The loop control variable does not always have to be an integer (i.e. *ch* in bottom example is a *char* type variable).
- The variables may be used *inside* each loop, in the statement block, but then "disappear" once the block is finished (after its bottom curly bracket).
- It's also possible to use any other variable as the loop control variable, even if defined *outside* of the for loop. In general, we'll try to avoid this practice - unless the value of the variable is required outside of the loop.
Flow control...
• **Unbounded Loops:**
Unbounded loops are used when we *don't* know, ahead of time, how many iterations may be required.
C provides two types of unbounded loops:
- the **while** loop, where zero or more iterations are made through the loop
- the **do....while** loop, where at least one iteration is made through the loop
Notice that in both cases we still use a variable, `i`, to control the number of iterations of each loop, and that the changing value of the variable is used to determine if the loop should "keep going".
However, the statements used to modify the control variable may appear almost anywhere in the loops. They provide flexibility, but can also be confusing when loops become several tens or hundreds of lines long.
```c
i = 1;
while(i <= 20) {
printf("iteration number %d\n", i);
....
....
i = some_calculation_setting_i;
n = n + 1;
}
printf("loop was traversed %d times\n", n);
```
```c
i = 1;
while(1) {
printf("iteration number %d\n", i);
....
....
i = some_calculation_setting_i;
n = n + 1;
} while(i <= 20);
printf("loop was traversed %d times\n", n);
```
Flow control...
- Loops within loops:
```c
for(int i = 1; i <= 6; i = i+1) {
for(int j = 1; j <= 4; j = j+1) {
printf("(%d,%d) ", i, j); // print i and j as if "coordinates"
}
printf("\n"); // finish printing on this line
}
```
- Notice that we have two distinct loop-control variables, i and j.
- Each time that the inner loop (j's loop) starts, j's value is initialized to 1, and advances to 4.
- As programs become more complex, we will see the need for, and write, all combinations of:
- for loops within for loops,
- while loops within while loops,
- for loops within while loops,
- and so on....
Flow control...
- Changing the regular flow of control within loops:
```c
for(int i = 1 ; i <= 10 ; i = i+1) {
// Read an input character from the keyboard
//......
if(input_char == 'Q') // Should we quit?
break;
//......
} // Come here after the 'break'. i is unavailable
```
- Sometimes we need to leave a loop early, using the `break` statement, possibly skipping some iterations and some statements.
- In this example, we iterate through the loop at most 10 times, each time reading a line of input from the keyboard. If the user indicates they wish to quit, we `break` out of the bounded loop.
```c
for(char ch = 'a' ; ch <= 'z' ; ch = ch+1) {
if(ch == 'm') // skip over the character 'm'
continue;
//......
statements that will never see ch == 'm'
//......
}
```
- Sometimes we need to start the next iteration of a loop, even before executing all statements in the loop.
- In this example, we wish to perform some work for all lowercase characters, except 'm'. We use `continue` to ignore the following statements, and to start the next loop (with ch == 'n').
Flow control...
- **The equivalence of bounded and unbounded loops:**
- We need to accept (for now), that the three "pieces" of the `for` construct, are not always *initialization, condition, modification*.
- More generally, the three pieces may be C *expressions* - for the moment we'll consider these as C *statements* which, if they produce a value, the value is often ignored.
- The following loops are actually equivalent:
```c
for(int i = 1 ; i <= 10 ; i = i+1) {
// Read an input character from the keyboard
....
if(input_char == 'Q') // Should we quit?
break;
....
....
}
// Come here after the 'break'. i is unavailable
```
```c
for(char ch = 'a' ; ch <= 'z' ; ch = ch+1) {
if(ch == 'm') // skip over the character 'm'
continue;
....
....
statements that will never see ch == 'm'
....
}
```
- In both cases, we're expecting *expression2* to produce a Boolean value, either `true` or `false`, as we need that truth value to determine if our loops should "keep going".
Flow control...
• Some unusual loops you will encounter
Some for or while loops may appear to have something missing. In fact, any (or all!) of the three "parts" of a for loop may be omitted. For example, the following loop initially sets i to 1, and increments it each iteration, but it doesn't have a "middle" test to see if the loop has finished:
```c
for(int i = 1 ; ; i = i+1) {
....
....
}
```
• Some loops don't even have a loop-control variable, and don't test for their termination. This loop will run forever, until we interrupt or terminate the operating system process running the C program. We term these infinite loops:
```c
#include <stdbool.h>
// cryptic - avolo tnis mecanism
for( ; ; ) {
....
....
}
```
```c
// clearer - use tnis mecanism
while( true ) {
....
....
}
```
• While infinite loops are sometimes used, they are not expected to run forever! Typically an enclosed condition and a break statement is used to terminate the loop, either based on some user input, or the state of some calculation.
Some unusual loops you will encounter
Some \texttt{for} or \texttt{while} loops may appear to have something missing. In fact, any (or all!) of the three "parts" of a \texttt{for} loop may be omitted. For example, the following loop initially sets \texttt{i} to 1, and increments it each iteration, but it doesn't have a "middle" test to see if the loop has finished:
\begin{verbatim}
for(int i = 1 ; i = i+1) {
....
....
}
\end{verbatim}
Some loops don't even have a loop-control variable, and don't test for their termination. This loop will run forever, until we interrupt or terminate the operating system process running the C program. We term these infinite loops:
\begin{verbatim}
// cryptic - avoid this mechanism
for( ; ; )
{
....
....
}
\end{verbatim}
\begin{verbatim}
#include <stdbool.h>
// clearer - use this mechanism
while( true )
{
....
....
}\end{verbatim}
While infinite loops are sometimes used, they are not expected to run forever! Typically an enclosed condition and a \texttt{break} statement is used to terminate the loop, either based on some user input, or the state of some calculation.
Flow control...
- The switch Statement
```c
switch(expression){
case constant-expression :
statement(s);
break; /* optional */
case constant-expression :
statement(s);
break; /* optional */
/* you can have any number of case statements */
default : /* Optional */
statement(s);
}
```
- The switch statement causes a particular group of statements to be chosen from several groups.
- Multiple expressions can have the same statements.
- Beware: once an expression is true, case does not check any further expressions rather executes all of the rest. Therefore, a break command is generally used.
|
{"Source-Url": "http://robotics.ee.uwa.edu.au/courses/robotics/c/Lecture1_v2.pdf", "len_cl100k_base": 7066, "olmocr-version": "0.1.50", "pdf-total-pages": 34, "total-fallback-pages": 0, "total-input-tokens": 51938, "total-output-tokens": 8647, "length": "2e12", "weborganizer": {"__label__adult": 0.0006585121154785156, "__label__art_design": 0.000598907470703125, "__label__crime_law": 0.0004897117614746094, "__label__education_jobs": 0.0311431884765625, "__label__entertainment": 0.00013124942779541016, "__label__fashion_beauty": 0.000301361083984375, "__label__finance_business": 0.00033593177795410156, "__label__food_dining": 0.0007991790771484375, "__label__games": 0.0012607574462890625, "__label__hardware": 0.0023937225341796875, "__label__health": 0.00070953369140625, "__label__history": 0.00042819976806640625, "__label__home_hobbies": 0.0002970695495605469, "__label__industrial": 0.0008592605590820312, "__label__literature": 0.0005192756652832031, "__label__politics": 0.0003829002380371094, "__label__religion": 0.000949382781982422, "__label__science_tech": 0.015838623046875, "__label__social_life": 0.00024819374084472656, "__label__software": 0.005886077880859375, "__label__software_dev": 0.93359375, "__label__sports_fitness": 0.0007314682006835938, "__label__transportation": 0.0012598037719726562, "__label__travel": 0.00039458274841308594}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 27783, 0.02642]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 27783, 0.74537]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 27783, 0.82668]], "google_gemma-3-12b-it_contains_pii": [[0, 208, false], [208, 966, null], [966, 1529, null], [1529, 2587, null], [2587, 3564, null], [3564, 4238, null], [4238, 5155, null], [5155, 5534, null], [5534, 5667, null], [5667, 6282, null], [6282, 7373, null], [7373, 7794, null], [7794, 8453, null], [8453, 9023, null], [9023, 9572, null], [9572, 10444, null], [10444, 11447, null], [11447, 12291, null], [12291, 13668, null], [13668, 14689, null], [14689, 15824, null], [15824, 16398, null], [16398, 17514, null], [17514, 18647, null], [18647, 19271, null], [19271, 19589, null], [19589, 20897, null], [20897, 22044, null], [22044, 22678, null], [22678, 23802, null], [23802, 24927, null], [24927, 25982, null], [25982, 27127, null], [27127, 27783, null]], "google_gemma-3-12b-it_is_public_document": [[0, 208, true], [208, 966, null], [966, 1529, null], [1529, 2587, null], [2587, 3564, null], [3564, 4238, null], [4238, 5155, null], [5155, 5534, null], [5534, 5667, null], [5667, 6282, null], [6282, 7373, null], [7373, 7794, null], [7794, 8453, null], [8453, 9023, null], [9023, 9572, null], [9572, 10444, null], [10444, 11447, null], [11447, 12291, null], [12291, 13668, null], [13668, 14689, null], [14689, 15824, null], [15824, 16398, null], [16398, 17514, null], [17514, 18647, null], [18647, 19271, null], [19271, 19589, null], [19589, 20897, null], [20897, 22044, null], [22044, 22678, null], [22678, 23802, null], [23802, 24927, null], [24927, 25982, null], [25982, 27127, null], [27127, 27783, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, false], [5000, 27783, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, true], [5000, 27783, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 27783, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 27783, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, true], [5000, 27783, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 27783, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 27783, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 27783, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, true], [5000, 27783, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 27783, null]], "pdf_page_numbers": [[0, 208, 1], [208, 966, 2], [966, 1529, 3], [1529, 2587, 4], [2587, 3564, 5], [3564, 4238, 6], [4238, 5155, 7], [5155, 5534, 8], [5534, 5667, 9], [5667, 6282, 10], [6282, 7373, 11], [7373, 7794, 12], [7794, 8453, 13], [8453, 9023, 14], [9023, 9572, 15], [9572, 10444, 16], [10444, 11447, 17], [11447, 12291, 18], [12291, 13668, 19], [13668, 14689, 20], [14689, 15824, 21], [15824, 16398, 22], [16398, 17514, 23], [17514, 18647, 24], [18647, 19271, 25], [19271, 19589, 26], [19589, 20897, 27], [20897, 22044, 28], [22044, 22678, 29], [22678, 23802, 30], [23802, 24927, 31], [24927, 25982, 32], [25982, 27127, 33], [27127, 27783, 34]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 27783, 0.05664]]}
|
olmocr_science_pdfs
|
2024-11-27
|
2024-11-27
|
a1f75e6bbf41a7cc8e1d2c092b07972394e88223
|
Hydrascope: Creating Multi-Surface Meta-Applications Through View Synchronization and Input Multiplexing
Björn Hartmann, Michel Beaudouin-Lafon, Wendy E. Mackay
To cite this version:
HAL Id: hal-00931142
https://hal.archives-ouvertes.fr/hal-00931142
Submitted on 15 Jan 2014
HAL is a multi-disciplinary open access archive for the deposit and dissemination of scientific research documents, whether they are published or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers. L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.
HydraScope: Creating Multi-Surface Meta-Applications Through View Synchronization and Input Multiplexing
Björn Hartmann
Computer Science Division
University of California
Berkeley, USA
bjoern@eecs.berkeley.edu
Michel Beaudouin-Lafon
in|situ|
Université Paris-Sud
Institut Universitaire de France
mbl@lri.fr
Wendy E. Mackay
in|situ|
INRIA Saclay
France
mackay@lri.fr
ABSTRACT
As computing environments that combine multiple displays and input devices become more common, the need for applications that take advantage of these capabilities becomes more pressing. However, few applications are designed to support such multi-surface environments. We investigate how to adapt existing applications without access to their source code. We introduce HydraScope, a framework for transforming existing web applications into meta-applications that execute and synchronize multiple copies of applications in parallel, with a multi-user input layer for interacting with it. We describe the Hydra-Scope architecture, validated with five meta-applications.
Categories and Subject Descriptors
H5.2 [Information Interfaces and Presentation]: User Interfaces—Graphical User Interfaces
Keywords
Application architectures, Multi-screen displays, Toolkits
1. INTRODUCTION
The decreasing cost of technology has led to the rise of multi-surface environments: In the home, newly interoperable interactive TVs and tablets share content and distribute control. In school and at work, smartphones, tablets and laptops link to interactive whiteboards, video projectors and tabletop displays. In labs, high-resolution wall-sized displays offer a hundred times more pixels than a desktop computer.
Unfortunately, existing applications rarely scale to these multi-surface environments for several reasons. First, few are designed to run in a distributed environment, where different machines control different displays but offer the illusion of a single interconnected display surface. Second, many applications are restricted to single-user input even though multi-surface environments encourage collaborative work. Finally, they are written for a specific screen resolution, making it difficult to resize to significantly larger – or smaller – displays. For example, when a web browser is displayed on a wall, the user must read excessively long lines of text and traverse a long distance to reach the back button.
One solution is to rewrite applications using specially designed user interface frameworks, such as jBricks [12]. This offers maximum control but requires a major upfront investment to re-engineer common applications. An alternative is to adapt existing applications to run in multi-surface environments – ideally, without modifying the applications’ source code. Users can thus leverage their existing expertise instead of learning new, dedicated applications.
We introduce the concept of a meta-application, which assembles and synchronizes existing applications to run across multiple interactive surfaces. A meta-application coordinates multiple application instances by sensing changes in application state due to user input and propagating appropriate changes across applications according to specific coordination rules. Prior work has identified several promising patterns of use that meta-applications should support [1]:
• Viewing a large section of a document, e.g., a map, at full resolution, with no pixel scaling;
• Viewing “small multiples” or coordinated views from one document or related documents, e.g., several stock quotes or slides from a presentation (see Fig. 1);
• Compositing related documents, e.g., a list of search results and a subset of the resulting documents; and
• Sharing content with remote users, e.g., extending a multi-surface environment to include several locations.
To enable these scenarios, meta-applications can either present multiple synchronized instances of a single application, or orchestrate the state of different applications.
This paper presents HydraScope, our meta-application framework for web applications. HydraScope uses DOM inspection and event injection methods to coordinate web applications without having access to application source code. Any approach that does not modify source code can only control or modify some aspects of an application. To investigate what can be achieved, we focus on multiple view interfaces [14], which display several views of a single document, and on compositing related documents from different applications. By building several meta-applications (see Fig. 2), we demonstrate that our approach can be used to rapidly produce a useful range of applications.
2. HYDRASCOPE
HydraScope supports web-based meta-applications by executing multiple copies of one or more web applications in parallel and keeping the copies synchronized. HydraScope leverages the fact that many web applications already support data synchronization across multiple clients, and adds view synchronization logic to create a meta-application out of individual application instances.
Users manage and control meta-applications using the HydraScope mobile controller (Fig. 3A), delivered over the web to mobile devices. The application manager (Fig. 3B) lets users launch meta-applications and assign them to a subset of the available display surfaces (Fig. 3C). Several users can interact simultaneously with the meta-applications using HydraScope’s extensible architecture: First, users can provide standard desktop input events (mouse pointing, scrolling, and text entry) to any application and display surface (Fig. 3D). Second, meta-applications can provide a dedicated interface to control specific features, such as navigating search results in a web search application (Fig. 3E).
HydraScope meta-applications must assemble a coherent user interface from multiple application instances, for multiple users. Achieving this conceptual coherence requires: (1) data synchronization, (2) view synchronization, (3) meta-application management and (4) handling multi-user input.
2.1 Data Synchronization
Application instances need a coherent, shared model of the data they present, e.g., the document being viewed or edited. In cases such as maps, on-line catalogs and search results, the underlying document is essentially static. The necessary information is often encoded in the document’s URL, which can simply be shared.
For meta-applications that support document editing, real-time data synchronization among application instances is required. Fortunately, an increasing number of web applications, such as Google Docs\(^1\), already support simultaneous editing. HydraScope takes advantage of their synchronization mechanisms to execute multiple copies of each.
HydraScope can also create meta-applications out of non-collaborative web applications by using web frameworks for real-time data sharing, such as ShareJS\(^2\). The developer first adds data synchronization to the application, then uses HydraScope to add view synchronization.
2.2 View Synchronization
View synchronization manages how the various instances of an application are presented: together, they must present a coherent view of the overall application. For example, view synchronization for a tiled map may entail calculating appropriate latitude and longitude offsets for each application instance to generate a single large map. Similarly, a large document may appear as a series of pages that are kept in sync as the document is scrolled.
HydraScope features an application-specific interface instance manager (IIM) that synchronizes different views using runtime interface inspection and event injection. When a user interacts with an application, the IIM senses the corresponding view changes and tells the other applications to update their views accordingly. Because these view synchronization rules are unique to each application and encapsulate the multiple display logic, they must be created by the meta-application developer. Rules can either be hardcoded\(^1\)\(^2\).
---
\(^1\)http://docs.google.com
\(^2\)http://sharejs.org
in the meta-application or controlled by users at runtime via auxiliary user interfaces. For example, a meta-application may enable users to switch between a large tiled map or diverse views of the same map at runtime. Communication among interface instance managers on different machines is coordinated by a single, application-agnostic synchronization server.
2.3 Meta-Application Management and Input
Large-screen displays and multi-surface environments are especially well-suited for co-located collaboration. While traditional pointing devices can be scaled to multiple users working across multiple displays [9], users may also need to physically move in the room, e.g., to see detail on a wall display. Handheld input devices that support such movement complement desk-bound devices and offer additional displays for auxiliary interactions. Hydrascope’s mobile input controllers unify two key functions:
(1) managing meta-applications (start, close, and manage display real estate), and (2) providing input to running meta-applications.
The HydraScope application manager lists the available meta-applications and lets the user choose on which displays they should run. It also lets users switch between a meta-application-specific mobile control interface and a generic interface to control cursor and text input.
Meta-application developers can define mobile control interfaces to deliver specific events to their applications. For example, a slideshow controller may provide buttons to navigate the slide deck, while a search controller may provide a search box on the mobile device so users need not point to a search box on the multi-screen display. To manage input conflicts, we use stateless commands such as next/previous slide, or temporary locks for commands that require continuous control, such as a slider to adjust the scale of a map.
Providing cursor and text input to a meta-application is challenging because it requires controlling the system cursors and keyboard focus of each computer running a display surface, allowing several users to interact simultaneously with the same or different meta-applications. HydraScope extends prior work on remote cursor control schemes to move input across different computers [9] by sharing a single system cursor among several simulated cursors, one per user, using optimistic locking: the system cursor is used only when absolutely necessary, essentially for clicks and drags, therefore minimizing (but not entirely avoiding) conflicts.
3. ARCHITECTURE & IMPLEMENTATION
The HydraScope architecture comprises four distinct components (Fig. 4): (1) application specific interface instance managers (IIM) that run on each display server to monitor view changes and update views; (2) a system input manager (SIM) that runs on each display server to permit use of multiple cursors across multiple machines; (3) mobile meta-application managers to assign applications to displays and control them; (4) a master synchronization server that marshals messages across display servers and mobile controllers.
Developers write individual meta-applications by providing (1) a brief meta-application definition in the synchronization server; (2) interface instance manager code; and, optionally, (3) a mobile control user interface for their meta-application.
Our implementation uses the Google Chrome browser running on OS X, however the architectural principles are not tied to this browser or operating system. Each display server runs one or more Chrome windows. Interface instance managers (IIM) are written as browser extensions. System input managers (SIM) are native applications written in Objective-C to directly interact with the operating system’s input APIs. The synchronization server is implemented in Javascript using the node.js event-driven I/O server. The mobile devices, synchronization server and browser extensions communicate using socket.io.
Our test setup comprises two MacPro display servers, each with six screens, with a total display resolution of 11520px × 2160px.
3.1 Interface Instance Manager
On starting the meta-application, the IIM launches one or more browsers per screen, positions their windows to fill each screen, and initializes each view by loading appropriate application URLs, possibly with different parameters for each window. Because each display server can have multiple
A display server is any computer in the environment that controls one or more display surfaces.
http://nodejs.org
http://socket.io, uses web sockets when available
Figure 3: (A) Meta-applications can be controlled on mobile devices: (B) When users launch a new meta-application in the manager UI, they can (C) assign available screens to that application. Users can then select an appropriate control interface: either (D) a generic touch pad and text entry controller; or (E) application-specific controllers. The search controller shown here enables users to “pin” search results to screens and to enter new query terms.
screens running multiple windows, the IIM is split into a host component with one instance per display server, and window wrappers with one instance per browser window (Fig. 4 Right). Wrappers observe as users interact with the application. When actions change the application view, they pass a message to the IIM host, which then determines the proper steps for view synchronization. The IIM host then issues update commands to the other IIM wrappers on the same machine. In our implementation, the IIM host is implemented as a Chrome background page and the IIM wrappers are written as Chrome content scripts.
For multi-display environments that involve multiple display servers, HydraScope uses an additional synchronization server: IIM hosts forward the view update messages they receive from an IIM wrapper to the synchronization server, which in turn broadcasts it to all other display servers.
View Synchronization involves several strategies. Some web applications implement a stateless design: all parameters needed to determine the view are passed from the browser to the web application server, usually through URL parameters. For such applications, IIM wrappers can simply monitor the URL for changes. Other web applications maintain internal state. For these, a meta-application developer must reverse-engineer relevant state through inspection. We have had success in identifying relevant DOM elements and watching them for changes. For example, in a slide presentation, sensing which slide an application is currently showing can be done by parsing a label that states Slide x of y.
IIM wrappers must also actuate the interface programmatically to change the view. For stateless applications, an appropriate URL can be constructed and loaded, but this causes a complete reload of the view at each change. Alternatively, a view can be controlled by injecting appropriate input events into the application. For example, the IIM wrapper of a slideshow viewer can synthesize clicks on the next / previous slide navigation elements. Finally, an application could also expose an API to explicitly support its integration into meta-applications.
3.2 System Input Manager
The System Input Manager (SIM) manages multiple cursors across multiple display servers and allows users to send mouse and text input to the meta-applications. It is composed of a native OS X application running on each display server (OScontrol), a web interface running on each mobile device, and glue code running in the synchronization server.
The mobile interface features a touchpad to control the cursor, a vertical bar to control scrolling, and an input field to send text input (Fig. 3D). Since the touchpad can be quite small relative to the available display surfaces, our cursor control features both a traditional gain and a less traditional cursor inertia: when lifting the finger at the end of a quick flicking gesture, the cursor continues with an amortized motion, therefore anticipating the subsequent movement. OScontrol can also be used with a regular mouse and keyboard for a result similar to, e.g., PointRight [9].
OScontrol uses optimistic locking to acquire the system cursor for button and drag events: if the system cursor is not locked, the request succeeds and the events are relayed to the system cursor; if the system cursor is locked, which happens only if another user is performing a drag operation on the same display server, the operation fails silently. In practice, conflicts are rare because web applications rarely use dragging, especially since scrolling is handled separately. Applications that use dragging extensively should probably use an application-specific control interface.
3.3 Mobile Meta-Application Manager
The synchronization server maintains a global configuration of all displays in a multi-display wall or multi-surface environment, which it delivers to the mobile meta-application manager (Fig. 3B). When the user chooses a set of displays on which to run an application (Fig. 3C), the configuration is broadcast to all IIM hosts, which then load the application’s URL if their screens are affected by the launch.
4. SAMPLE APPLICATIONS
We developed five meta-applications to demonstrate the HydraScope design space (see Fig. 2 and the accompanying video). These projects show that meta-applications are more like scripts than system programs and can be implemented with only a few hundred lines of JavaScript (Fig. 5).
4.1 Slide Presenter (Fig. 2A)
Users can give or review presentations on the multi-screen display, with one slide per monitor. They can navigate through the slide deck by pressing two buttons on a mobile controller or clicking on navigation controls inside each application instance. Advancing beyond the last currently visible slide shifts all the slides to the left.
The Slide Presenter builds on Google Documents’ Presentation Viewer. Each monitor runs one Chrome window with one presentation page. Since each slide has a unique id, the user can start the deck at a specified slide by passing the slide’s id as a URL parameter, which is used to initialize the views. For efficient updating, we inject mouse events on the “previous” and “next” buttons inside the player whenever the user presses the corresponding mobile controller buttons.
---
Figure 4: (Left) Global architecture of HydraScope; (Right) Local architecture on a single HydraScope display server.
4.2 Stock Viewer (Fig. 2B)
Users can compare the financial performance of several stocks over time, with one stock chart per monitor. With the system cursor, the user can pan the graph or use its slider widget to change the time interval shown in one window; all other windows update to show the same time interval.
The Stock Viewer builds on Google Finance. Unlike the Slide Viewer, the stock chart is an embedded Flash object, with no easily accessible way to inject events. Instead, we reload the page with new URL parameters, which precludes interactive data “scrubbing”. We take advantage of an embedded link designed to let users share their current view, checking the URL to monitor if the graph was scrolled.
4.3 Tiled Map (Fig. 2C)
Users control a tiled map that spans all monitors, using the mobile controller to pan and zoom. Users can view a single large map or “small multiples” with different data, such as roads, satellite images and topographic views.
The Tiled Map builds on Google Maps. Like the Stock Viewer, we take advantage of an embedded link that serializes the view state into URL parameters. For smooth scrolling, we use Google’s JavaScript Maps API to get and set map parameters and a separate HTML page that stores map boundary and zoom information in the DOM.
4.4 Wall Search (Fig. 2D)
Users can build up a set of Google search results: The two left screens synchronize scrolling to create the illusion of a single, tall window; the four right screens each show a top search result. The user can type new terms into the query box on the mobile controller or pin search result pages onto its display by tapping the corresponding screen icon (see Fig. 3E). The previous and next buttons switch between results, displaying them on screens not yet pinned.
Wall Search builds on Google Search. The interface instance manager maintains two types of screens: result listings and individual results pages. The IIM wrapper parses Google’s results listing and extracts links to external sites. When a user searches for a new term, the IIM wrappers for both results listing screens construct the appropriate search URL, reload the page, and adjust the scroll position. A similar synchronization occurs when users arrive at the end of one results page and advance to the next.
4.5 Document Editor
Multiple users can edit a single document simultaneously, by manipulating different text caret in different windows (albeit only one text caret per window) using multiple cursors from the System Input Manager. The Document Editor builds on HackPad, a real-time collaborative editor that already performs the necessary data synchronization.
synchronize scroll positions so that scrolling one document window updates the other windows.
5. LIMITATIONS AND GUIDELINES
We encountered a few anticipated limitations when developing meta-applications with HydraScope. Generally, reverse engineering state can be both limited and brittle. It may not be possible to detect internal application state changes that do not result in user interface changes. Web applications can also change their interface layout frequently. Such changes can break both detection and injection code written by meta-application authors. Event injection code can also fail because the web application interfaces may have different latencies based on network traffic. Finally, applications may not fully support concurrent interactions.
To support re-use as meta-applications, web applications should follow several design guidelines:
1. give access to the view state for use by a remote controller: a) encode the application’s state in the URL to facilitate initial loading or latecomer synchronization; and b) store important state in documented DOM elements for monitoring by the meta-application.
2. separate the interface from the rest of the application using well-known patterns such as MVC. The Stock Viewer shows how opaque containers such as Flash make it impossible to finely monitor interaction and synchronize views if such separation is absent.
3. allow meta-applications to replicate application widgets for direct use on a remote controller. For example, Google search’s query box, the Stock Viewer’s slider and the Slide Presenter’s navigation should be easy to migrate, instead of requiring reverse-engineering and reimplementation.
6. RELATED WORK
HydraScope builds on three main research areas: multi-display environments, multi-user input, and reverse engineering of existing applications.
6.1 Multi-Display Environments
Creating interactive applications that span multiple displays and multiple computers has been studied primarily in the context of large tiled displays and immersive environments. Early work focused on rendering performance and used OpenGL, e.g. Chromium [8]. More recent work simply runs a copy of the application on each display server, using different viewports to compose part of the overall image. jBricks [12] runs the Java-based ZVTM toolkit on a visualization cluster, while Shiffman’s Most Pixels Ever7 extends Processing programs to multiple screens. Shared Substance [5] provides sharing mechanisms to create distributed applications on wall-sized displays. In Google Earth’s8 LiquidGalaxy mode, a master instance controls several slaves to generate high-resolution interactive maps on tiled displays.
Another common approach, e.g., the SAGE environment9, runs the application on a single machine and moves pixels to the display servers using protocols such as VNC [13]. The drawback is that scaling pixels creates blocky images, losing the benefits of high-resolution wall-size displays.
---
7http://github.com/shiffman/Most-Pixels-Ever/
8http://earth.google.com
9http://www.sagecommons.org
HydraScope uses a version of the distributed rendering approach by running a copy of the application on each display server. Unlike previous work, it does not require access to the source code of the application.
6.2 Multi-User Input
Distributing input across multiple computers and managing input from multiple users is a long-standing problem in collaborative applications. MMM [2] is an early single-display groupware system that supports multiple mice, while PointRight [9] distributes mouse and keyboard input to multiple displays across multiple computers. FourBySix [6] supports multiple cursors on a tabletop driven by a single machine by drawing simulated cursors and multiplexing access to the system cursor. HydraScope uses a similar approach, except that it works with multiple computers.
While HydraScope manages a simple 2D geometry of the display surfaces, PointRight [9] manages a 2D-manifold and the Perspective Cursor [11] can manage arbitrary 3D geometry. We may consider these approaches in the future.
6.3 Reverse-Engineering Interfaces
Our work is based on reverse-engineering web applications to extract view state information. This is closely related to prior work that uses similar DOM-based reverse engineering, such as d.mix [7], or the early Multibrowser [10], which moved web content across multiple displays. To facilitate the work of meta-application developers, HydraScope could leverage existing tools that simplify or automate access to web applications, such as ChickenFoot [3].
Other approaches use pixels instead of the DOM structure. For example, Sikuli [15] monitors application state by applying computer vision to screen pixels. Such approaches could be used to create meta-applications without access to the application source code nor the introspection facilities of web applications, enhancing the scope of HydraScope.
Another way to modify existing applications without access to their source code is code injection. Scotty [4] combines this approach with reflection in Objective-C to programmatically query the state of desktop applications. Scotty has been used to remote control applications and to teleport their display to a remote computer, and could be used by HydraScope to create meta-applications on Mac OS X.
7. CONCLUSION
Today’s applications do not readily scale to multi-surface environments in which collections of display surfaces are run by different computers. Rather than rewriting applications from scratch, we introduce the concept of a meta-application: a collection of application instances with coordinated contents and views that are accessible to multiple users via mobile interfaces. We present HydraScope, a first step towards building and deploying meta-applications from existing web applications and demonstrate its effectiveness through five meta-applications.
Realizing the full potential of meta-applications requires important future work. First, we need to expand beyond multiple view interfaces and improve the tools used by developers to create meta-applications. Second, we need to better understand how meta-applications can meet user needs by deploying them in real settings, including remote collaboration scenarios. Finally, we need to investigate meta-applications that include native as well as web applications.
8. ACKNOWLEDGMENTS
We thank Viraj Kulkarni, Yun Jin, and Hong Wu for their contributions. This work was supported by NSF award OISE-1157574.
9. REFERENCES
|
{"Source-Url": "https://hal.archives-ouvertes.fr/hal-00931142/PDF/hartmann.pdf", "len_cl100k_base": 5506, "olmocr-version": "0.1.50", "pdf-total-pages": 7, "total-fallback-pages": 0, "total-input-tokens": 21160, "total-output-tokens": 7105, "length": "2e12", "weborganizer": {"__label__adult": 0.0003573894500732422, "__label__art_design": 0.0016603469848632812, "__label__crime_law": 0.0002713203430175781, "__label__education_jobs": 0.0012979507446289062, "__label__entertainment": 0.00018978118896484375, "__label__fashion_beauty": 0.00020825862884521484, "__label__finance_business": 0.00022280216217041016, "__label__food_dining": 0.0003223419189453125, "__label__games": 0.0006861686706542969, "__label__hardware": 0.00301361083984375, "__label__health": 0.0004405975341796875, "__label__history": 0.0005183219909667969, "__label__home_hobbies": 0.00010192394256591796, "__label__industrial": 0.00044465065002441406, "__label__literature": 0.0003478527069091797, "__label__politics": 0.00020968914031982425, "__label__religion": 0.0004911422729492188, "__label__science_tech": 0.1480712890625, "__label__social_life": 0.00010454654693603516, "__label__software": 0.033416748046875, "__label__software_dev": 0.806640625, "__label__sports_fitness": 0.0002294778823852539, "__label__transportation": 0.0005426406860351562, "__label__travel": 0.0002332925796508789}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 31972, 0.02891]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 31972, 0.32119]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 31972, 0.83056]], "google_gemma-3-12b-it_contains_pii": [[0, 1141, false], [1141, 5124, null], [5124, 9242, null], [9242, 14253, null], [14253, 19691, null], [19691, 25440, null], [25440, 31972, null]], "google_gemma-3-12b-it_is_public_document": [[0, 1141, true], [1141, 5124, null], [5124, 9242, null], [9242, 14253, null], [14253, 19691, null], [19691, 25440, null], [25440, 31972, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 31972, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 31972, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 31972, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 31972, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 31972, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 31972, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 31972, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 31972, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 31972, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 31972, null]], "pdf_page_numbers": [[0, 1141, 1], [1141, 5124, 2], [5124, 9242, 3], [9242, 14253, 4], [14253, 19691, 5], [19691, 25440, 6], [25440, 31972, 7]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 31972, 0.0]]}
|
olmocr_science_pdfs
|
2024-11-30
|
2024-11-30
|
5834054eb751e6c209c47ad260ed4dda9ab651fa
|
Scade 6: from a Kahn Semantics to a Kahn Implementation for Multicore
Jean-Louis Colaço, Bruno Pagano, Cédric Pasteur, Marc Pouzet
To cite this version:
Jean-Louis Colaço, Bruno Pagano, Cédric Pasteur, Marc Pouzet. Scade 6: from a Kahn Semantics to a Kahn Implementation for Multicore. Forum on specification & Design Languages (FDL), Sep 2018, Munich, Germany. hal-01960410
HAL Id: hal-01960410
https://hal.science/hal-01960410
Submitted on 19 Dec 2018
HAL is a multi-disciplinary open access archive for the deposit and dissemination of scientific research documents, whether they are published or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.
L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.
Scade 6: from a Kahn Semantics to a Kahn Implementation for Multicore
Jean-Louis Colaco
ANSYS SBU
Toulouse, France
Jean-Louis.Colaco@ansys.com
Bruno Pagano
ANSYS SBU
Toulouse, France
Bruno.Pagano@ansys.com
Cédric Pasteur
ANSYS SBU
Toulouse, France
Cedric.Pasteur@ansys.com
Marc Pouzet
École normale supérieure
Paris, France
Marc.Pouzet@ens.fr
Abstract—SCADE is an environment for developing critical embedded software that is used for more than twenty years in various application domains like avionics, nuclear plants, transportation, automotive. It comes with a language and a code generator which complies with the highest safety standards like DO-178C, IEC 61508, EN 50128, IEC 60880 and ISO 26262.
The language has been founded on the pioneering work by Caspi and Halbwachs on Lustre. In 2008, a major revision of the language and compiler, named ‘Scade 6’, was released. One of its novelty was a smooth integration of the traditional data-flow style of Lustre with control-structures inspired from those of Esterel and SyncCharts, with static/dynamic semantics and a compilation inspired from Lucid Synchrone. In particular, it relies on four dedicated type systems — typing, clock calculus, causality analysis, initialization analysis — and a compilation through source-to-source transformations into a minimal clocked data-flow language, based on a Kahn semantics, that is translated to imperative code.
One ongoing work is the generation of code for multi-core architectures. Because of the intrinsic deterministic parallelism of Scade, we propose a solution that relies on annotations that specify what must be executed concurrently but do not change the semantics.
The paper is a survey of past to ongoing work on Scade 6 language definition and implementation.
Index Terms—synchronous languages, compiler, multi-core.
I. INTRODUCTION
Synchronous languages were introduced about thirty years ago by the works on three academic languages: SIGNAL [1], ESTEREL [2] and LUSTRE [3]. These domain-specific languages were targeted at real-time control software, allowing users to write modular and mathematically precise system specifications, to simulate, test and verify them, and to automatically translate them into embedded code.
These languages were all founded on the synchronous approach [4] where a system is modeled ideally, with communications and computations supposed to be instantaneous, with (1) a priori guaranteed important safety properties (determinism, deadlock freedom, bounded execution time and space) and (2) an a posteriori verification that the generated implementation is fast enough.
These foundations immediately raised interest in industries having to deal with safety-critical applications implemented in software or hardware, and in particular, those assessed by independent authorities and following certification standards [5].
This is the context in which SCADE\(^1\) was initiated in the mid nineties, with the support of two companies, Airbus and Merlin Gerin, and in collaboration with the research laboratory VERIMAG in Grenoble, and the software publisher VERILOG [6]. Since 2000, SCADE is developed by ANSYS/ESTEREL-TECHNOLOGIES.\(^2\)
SCADE is an integrated development environment (IDE) with a graphical block diagram editor and tool support to represent synchronous programs. In the first versions, the underlying language of the SCADE tool was essentially LUSTRE V3 [7], augmented with a few specific features requested by users but minor in terms of expressiveness. This situation persisted until version 5 of SCADE. To support the development of critical applications without having to verify the consistency between the model and the generated code, a ‘qualified code generator’ called KCG was developed. Its first version was released in 1999 and has been used, since then, in software projects with the most demanding safety levels of many standards (DO-178C, IEC 61508, EN 50128, IEC 60880 and ISO 26262), where high confidence in automation is expected. It is unique in the field of safety critical embedded software and contributed to the industrial success of SCADE. It also demonstrates the interest of a semantically well-defined language in the context of qualification processes.
In 2008, a new language named ‘SCADE 6’ and its compiler were released \(^3\). The objective was to widen the scope of applications developed with SCADE, yet keeping the ability to certify its code generator with the highest standards. SCADE 6 introduced several new language features, like the mix of data-flow equations and hierarchical state machines, new compile-time checks expressed by four different dedicated type systems, and a compilation through a sequence of source-to-source transformations into a minimal clocked data-flow language. The language features and its design are described in [8]. The qualified code generator (KCG) for this new version of the language was developed from scratch using state-of-the-art techniques in language design and implementation.
\(^1\)SCADE stands for Safety-Critical Development Environment
\(^2\)http://www.ansys.com/products/embedded-software/ansys-sCADE-suite
\(^3\)To distinguish between the environment and its underlying programming language, we write SCADE for the former and SCADE (with small capitals) for the later.
On the embedded target side, the use of multi-core architectures is now considered for safety critical systems and there is a pressing demand for a SCADe compiler that targets those architectures. The implicit (deterministic) parallelism of synchronous block diagrams makes them good candidates for a parallel implementation. This is not at all a new observation: several works have addressed the automatic distribution of synchronous programs [9], the implementation of synchronous models on a multi-task OS either running on a single core [10], [11] or multi-core [12] to cite a few.
In this paper, we informally go through the main design decisions of SCADe and show how they were used in the development of KCG. We then report on an approach we have followed for targeting a multi-core platform. Its principle is to rely on annotations on the model that no not affect the semantics but tells the compiler to generate independent tasks that communicate through channels. The generated set of tasks form a Kahn process network (KPN) [13] which computes the very same streams as the source model. The actual implementation of this set of tasks on the final platform, as well as its timing analysis, is done afterwards and outside of the language.
The paper is organized in the following way. Section II reminds the Kahn semantics of the core data-flow kernel of SCADe and the purpose of the type-based static checks. Section III presents the qualified compiler KCG. Section IV presents the way we propose to address multi-core programming in SCADe. We conclude in Section V.
II. SCADe 6 INTUITIVE SEMANTICS
The main extension introduced in SCADe 6 compared to LUSTRE is the mix of dataflow equations and hierarchical state-machines [14]. Its design goes further with the definition of all the static and sufficient conditions for a program to be correct, conditions that are expressed as type systems, in the style of LUCID SYNCHRONE [15]. Code generation is done when all static conditions are fulfilled. The language is built on top of a small dataflow language kernel, reminiscent of LUSTRE. High level constructs are progressively rewritten into this language kernel which is then compiled into sequential code.
The type systems have been formalized for the whole SCADe 6 language but their correction has been proved only on the dataflow kernel. These proofs can be found in the related papers quoted below.
In this section we remind the reader of the stream semantics of the dataflow kernel of SCADe 6, we give some insights of the way we defined the state machine semantics, and then go through its four type systems.
A. A dataflow kernel
The kernel language used in SCADe 6 is essentially that of [16]. It is a variant of LUSTRE, with the operator current replaced by merge and extended with a reset construct. Here, we consider a simpler version to remind its semantics over streams.
\[ e ::= i \mid x \mid \text{op}(e, ..., e) \mid f(e, ..., e) \]
\[ \text{pre}(e) \mid e \rightarrow> e \]
\[ e \text{ when } e \mid \text{merge}(e, e, e) \]
The language of expressions (e) is made of constants (i) like integers or Booleans, identifiers (x), imported operator (op) (e.g., arithmetic operators like +, −) applied point-wise to streams, the application of an operator (f), an uninitialized unit delay (pre) and a stream initialization operator (→), the filtering of a stream according to a Boolean stream (when) or the combination of two streams according to a boolean condition (merge). Note that these Boolean conditions appearing in when and merge are called clocks.
A system is defined by an operator (denominated a ‘node’ in LUSTRE and SCADe), that is, a function that transforms a set of input streams into a set of output streams. The body of the function is made of a set of equations of the form \( x = e \) where defined variables are either outputs of the function or local to the function. E.g., the following definition computes the cumulative function of input \( u \), that is, its \( n \)-th value is the number of true values of input \( u \) up to instant \( n \). Expression \( 0 \rightarrow \text{pre} \circ \) is a unit delay \( \circ \) whose first output is \( 0 \) and its \( n \)-th value is the \( n-1 \)-th value of \( \circ \). The conditional if/then/else and + apply point-wise.
\[ \text{node} \text{ counting_events}(u: \text{bool}) \]
\[ \text{returns} \circ: \text{bool} \]
\[ \text{var} \circ: \text{int}; \]
\[ \text{let} \]
\[ v = \text{if} u \text{ then} 1 \text{ else} 0; \]
\[ o = v + (0 \rightarrow \text{pre} \circ); \]
\[ \text{tel}; \]
There are several useful semantics for LUSTRE and its variants. The simplest one is based on the semantics for dataflow networks given by Kahn in his seminal paper [13] that we remind below. Let \( T \) be a set, \text{nil} a particular value of this set. Let \( T^n \) be the set of sequences of length \( n \) made by concatenating elements from \( T \). \( \epsilon \) is the empty sequence. \( T^* = \cup_{n=0}^\infty T^n \) is the Kleene star operation. We write \( v.s \) for a sequence whose first element is \( v \) and tail is \( s \). \( T^\infty \) is the set of finite and infinite sequences of type \( T \), that is, \( T^\infty = T^* \cup T^\omega \). The set \( (T^\infty, \leq, e) \), with \( \leq \) the prefix order between sequences, \( e \) the minimum element, is a complete partial order (cpo). Then the Kleene theorem applies: if \( f : T^\infty \rightarrow T^\infty \) is a continuous function, an equation \( x = f(x) \) defines the sequence \( x^\infty = \lim_{n \rightarrow \infty} (f^n(e)) \) which is the smallest fixpoint of \( f \). This construction generalizes to the case of mutually recursive equations. Hence, a function from sequences to sequences whose outputs are defined by a set of mutually recursive equations over sequences is also continuous, provided all the functions it calls are continuous.
An expression \( e \) with (free) variables \( x_1, ..., x_n \) that are sequences is interpreted as a continuous function of these variables [17]. For that, we define the semantics of primitives in Figure 1. They are all continuous functions. A constant \( i \) is
lift^0(v) = v.lift^0(v)
lift^1(op)(v.s) = op(v).lift^1(op)(s)
lift^2(op)(v) = \epsilon
lift^2(op)(v_1.s_1, v_2.s_2) = op(v_1, v_2).lift^2(op)(s_1.s_2)
(\epsilon, s_1) \rightarrow (v_2.s_2) = v_1.s_2
(s_1) \rightarrow (s_2) = \epsilon
pre(s) = nil.s
when(v,s.true,c) = v.when(s,c)
when(v,s.false,c) = when(s,c)
when(s_1.s_2) = \epsilon
merge(true.c, v_1.s_1, s_2) = v.merge(c, s_1.s_2)
merge(false.c, v_1.s_1, s_2) = v.merge(c, s_1.s_2)
merge(true.c, s_1.s_2) = \epsilon
merge(false.c, s_1.s_2) = \epsilon
merge(\epsilon, s_1.s_2) = \epsilon
Fig. 1. The stream interpretation for primitives
interpreted as an infinite sequence made of that constant, that we write lift^0(i). Function lift^1(op)(\_\_\_\_) defines the semantics of the pointwise application of a unary operator op; lift^2(op)(\_\_\_\_) defines the case for a binary operator. Function pre(\_\_\_) defines the semantics of the un-initialized unit delays. Function (\_\_\_) \rightarrow (\_\_\_) defines the semantics of the stream initialization. Function when(\_\_\_, \_\_\_, \_\_) defines the semantics of the filtering operator when; merge(\_\_\_, \_\_\_, \_\_) defines the semantics of the operator merge.
The interest of this semantics is its simplicity: a system is a function over sequences, hiding implementation details. However it is not well-adapted to express operational properties like the existence of an execution with bounded memory, synchronization issues and the actual size of a buffer and the ability to produce statically scheduled code. 4 To address those questions, the Kahn semantics can be turned into a synchronous Kahn semantics that use explicit present/absent values [18]–[20].
B. The hierarchical state machines of SCADE 6
In the language kernel we have considered, the body of a function is defined by a set of equations. In SCADE 6, those equations can be arbitrarily composed with state machines. A state machine is a special form of equation: it is defined by a set of states, each of them containing a set of equations (possibly containing state machines themselves) and conditions to go from an active state to an other one. The variables defined in one state can either be local to the state or global to the automaton. The full language preserves the static single assignment (SSA) property of the language kernel: only one state is active per synchronous cycle. If a variable is defined in two different states, only one equation defines its value for a given cycle. Moreover, an automaton introduces a set of
4Using length arguments, it is enough to justify the so-called clock calculus of LUSTRE to ensure that the composition of two bounded memory networks is a bounded one [17].
scopes, one per state allowing to define variables that only exist when this state is active. 5
The semantics of state machines is defined by their translation to the dataflow kernel. This is done by capturing the structure of scopes with clocks based on an enumeration: one enumerated value per state and one enumerated type per state machine. The exclusivity between states is ensured by a simple encoding: the stream that defines the current active state has a single value at every reaction. Its current value depends on the previous active state and the transitions in the current state.
The merge operator generalizes to n streams on n clocks derived from the same enumeration. Once these items are introduced, each local variable declared in a scope becomes a variable (with the appropriate renaming to avoid collisions) declared at the top level of the encompassing operator with the clock introduced for its scope. Then all the right-hand sides of the different exclusive definitions are on exclusive clocks and can be merged. A bottom up application of this principle allows to translate arbitrary nested scopes.
These translation principles shows that scopes and their activation are, in SCADE 6, just an alternative way to manipulate clocks. This specification is given in [14] with all the necessary details for an implementation.
C. Static semantics
The static semantics encompasses the invariants that a program must satisfy before considering its execution. For SCADE 6 we express them as typing problems so that, quoting Robin Milner, “well-typed programs cannot go wrong” [21]. Without going into the details of the types, we give for each of them what “going wrong” means. The type systems are applied in the order they are presented below.
1) Type checking: This analysis checks types, in the usual sense. For SCADE 6, the following design choices have been taken:
- The type of variables must be declared; a type is either an enumerated set of values, a record, an array parameterized by a size expression whose value has to be known at compile time, or an abstract type.
- Type equivalence is based on structural equality.
- The language provides a number of built-in type classes, like numeric and integer. E.g., int8, int16, int32, etc., are elements of the class integer.
- Types can be polymorphic and possibly constrained by the type classes numeric, float, integer, signed, or unsigned.
- Functions may be parameterized by a size. This parameter can be used in an array type, for example.
Well-typed programs satisfy the following properties:
- function arguments have the expected type so that the program does not have type errors at run-time;
- array accesses are within array bounds.
5Remember that only the body of a node introduce a scope in LUSTRE.
2) Clock checking: The clock analysis ensures that programs can be executed synchronously, that is, the corresponding Kahn process network does not need any, possibly unbounded, buffering mechanism. Said differently, the implementation of a stream of values of type \( t \) only needs to store the current value. As SCADE 6 forbids recursion (e.g., the Kahn process network defining the sieve of Eratosthene [13] is forbidden), then a well-clocked program defines a network that can be implemented with a bounded memory, provided that functions (imported or not) applied point-wise to a stream also run in bounded memory.
This property can be formulated as:
- a well-clocked program can be implemented in bounded memory, provided that all the imported functions it uses do so.
This property is fundamental for safety-critical embedded applications.
3) Causality analysis: The purpose is to ensure that the synchronous Kahn process network does not deadlock. SCADE 6 adopts the same simple policy as LUSTRE: all cycles defined by the read/write dependences between variables must cross a unit delay (∼) [22]. This dependence relation is syntactical, in the sense that it does not depend on actual values of signals or their clock, contrary to ESTEREL [23] and SIGNAL [24], for example. The main property the analysis ensures is:
- The streams in a causally correct SCADE 6 program are such that the definition of the value of a stream neither depends on itself nor on values that appear after in this stream.
The causality implemented by the compiler is actually a bit stronger and is such that the stream definitions can be evaluated in a statically chosen order. This leads to the corollary that:
- A causally correct program can be compiled into statically scheduled sequential code that runs in bounded time provided that all imported functions do so.
As for clock checking, the causality analysis guarantees the existence of an upper bound on the time necessary to compute a reaction also known as Worst Case Execution Time (WCET).
4) Initialization analysis: In LUSTRE, the unit delay operator ∼ returns a sequence that is un-initialized at the first instant. The un-initialized delay is used in combination with the initialization operator → which allows to define the first value for a stream. A typical use being in an equation:
\[
x = x_0 \rightarrow f(\text{pre } x)
\]
which defines the stream \( x \) whose first value is the first value of \( x_0 \) and following values (non-first ones) are equal to the corresponding values of \( f(\text{pre } x) \) i.e. all the values but the first.
The un-initialized delay is thus a source of non determinism in the program since the actual implementation for a \( \text{nil} \) is not defined by the language. The purpose of the initialization analysis is to ensure that the outputs of the main operator\(^6\) never depend on those values. The analysis is also expressed as a dedicated type system, applied modularly to every function definition and computing a type signature for each of them.
- A main SCADE 6 program that has passed the initialization analysis is deterministic, i.e., applied to two equal sequences of inputs, it returns two equal sequences of outputs
This property focuses on the main operator outputs because this is where determinism matters; the property is weaker for internal flows to allow the use of operator (like ∼) able to produce a \( \text{nil} \). Determinism is an important property for critical systems, certification standards require in general to provide evidence of the determinism of the software. The KCG compiler of SCADE guarantees this property.
III. SCADE 6 Compiler
The SCADE 6 code generator is qualified for the main standards of safety critical industry (DO-178C, IEC 61508, EN 50128, IEC 60880 and ISO 26262). This means that it can be used in the software development of a safety critical system without having to verify that the code produced actually implements the SCADE model. The present section gives a few facts about this code generator and its development as a qualified tool.
A. Compiler Organization
The organization of the compiler (KCG) is rather classic. Static analyses are applied in sequence right after parsing, in the order they have been presented in section II-C. If they all succeed, code generation starts with a sequence of source-to-source transformations that progressively rewrite high-level constructs (e.g., hierarchical state machines, activation conditions) into the clocked data-flow kernel. Then, the data-flow kernel is translated into an intermediate sequential language. Finally, target imperative code (C or Ada) is emitted. Figure 2 summarizes these steps at a high level; bibliographic references are given on the arrows.
Within the transformations, many optimizations are performed on the data-flow form (dead-code elimination, constant propagation, common sub-expression elimination, etc.). The scheduling in the data-flow compilation implements heuristics aiming at minimizing memory size. Control structures are merged in the sequential representation.
B. Qualified Development
Qualification is based on traceability between a specification and implementation. The source and intermediate languages have been formally specified together with the static semantics (defined by inference rules) and source-to-source transformations (defined by rewrite rules). Those specifications are used by the development team to implement the compiler and by an independent verification team to test it.
\(^6\) The main of a SCADE application is also called root node.
For the implementation, we chose OCAML [27] which in 2005 presented quite a challenge for a qualified tool. Indeed, certification standards often push companies to use well established technologies. We thus had to provide convincing evidence that OCAML was well adapted to write a compiler. The argumentation was built on the small distance between the formal specification and its implementation in OCAML. This industrial use of OCAML in a certified context is detailed in [28] and [29].
The current version of SCADE KCG comprises approximately fifty thousands lines of code (50 KLoC) and uses a simplified OCAML runtime to satisfy the objectives of the standards. The formalized static semantics for the whole input language is about one hundred pages long and has been updated over more than ten years to integrate new language features. The detailed design is more than one thousand pages long.
IV. CODE GENERATION FOR MULTI-CORE TARGETS
Multi-core targets are starting to be considered for safety-critical applications because of their better power efficiency, the limited availability of single-core targets and the need for more computing power.
This section describes a flow to generate a code that can be integrated on a multi-core target. We only give here an overview of the flow adopting a SCADE user point of view. The details of this code generation will be the subject of a future communication.
As a first step, we have decided not to extend the language with dedicated constructs and just provide some compiler pragmas to exploit the intrinsic parallelism of SCADE programs. The main advantage of this approach is that it applies on legacy SCADE 6 models. On the target side, we generate C code and make no hypothesis on the architecture. Our goal is to allow SCADE users to take their model and generate a code structured to exploit computational resources of their target.
A. Overview
The objective of this ongoing work is to:
- generate code that can be executed efficiently on multi-core or many-core targets;
- preserve the deterministic semantics of the language;
- be target-independent since the hardware and software architectures used in critical embedded systems differ widely from one domain to another (with or without OS, with or without shared memory, number of cores, ...).
Note that this work focuses on the structure of the generated code to satisfy these objectives, in the vein of the work on automatic distribution of synchronous programs [9]. We are not looking at performance issues (like scheduling or efficient implementation of communications). We are also not focusing on memory interferences [30], which can impact the ability to compute the Worst Case Execution Time (WCET) of the code, as they are specific to a platform. Our goal is to provide a flow to make sure that these issues can be dealt with at integration level, with no impact on the functional model. This is important for industrial use, where, in general, the team in charge of the design is different than the team in charge of the integration on the target platform.
The proposed flow is the following:
1) The user designs the SCADE model or reuses an existing model.
2) The user annotates the model to express potential parallelism. An operator instance is annotated with a dedicated pragma to indicate that it should be extracted into a task. The call to this operator will be replaced with channel operations, so that this instance can be executed separately, e.g. in another thread. Note that this annotation does not change the semantics of the model, only the shape of the generated code.
3) The Multicore Code Generator (MCG) generates C code for each task as well as traceability information mapping the C code to the input model and a complete description of the generated KPN.
4) A target-specific integration script generates code (based on the generated KPN) to allocate and schedule the generated tasks to threads/cores and to implement communications.
Steps 2 to 4 are done during integration.
Tasks can be extracted from any instance in the model. For instance, it is possible to extract instances inside an activate block or a state machine. Tasks are not restricted to instances in the root operator. Tasks can also be nested, meaning that a task can be extracted from an instance inside an operator which is already itself a task.
This flow ensures a clear separation of concerns between the different activities involved in running the code on a multi-core target. In particular, the functional architecture of the model can remain independent of target integration matters, in the sense that its organization does not need to know about the final code mapping to available cores.
The model focuses on what is the function to implement,
not where the necessary computation takes place. The code
generator takes care of splitting parts of the model into tasks
ready for integration on the target.
B. Generated code
MCG generates tasks that communicate via one-to-one
channels, that is, a Kahn process network [13]. One task
executes the root operator of the SCADE model. One task
is generated for each operator instance annotated in the input
model. This task receives data on an input channel, calls the
operator and then sends the result on an output channel.
Tasks are similar to the objects described in [16]. Each task
has a context, containing its memories and several methods:
• a reset method to initialize the memories;
• one or several cycle methods.
The main difference with KCG generated code and [16] is
that the cycle method can be split into several methods. The
objective of this splitting is to reject communication out of
the sequential code and to not over-constrain the possible
schedules. A contribution of MCG is to preserve the possible
schedules in order not to interfere with the efficiency of
the multi-core integration. This problem is similar to the
issue of modular compilation discussed in LUSTRE [31]. The
methods of the same task can communicate directly through
the context. Each cycle method has input and output channels
to communicate with other tasks. The body of each method
contains sequential code, generated as usual from the SCADE
model.
Figure 3 shows a SCADE version of the ROSACE case
study [12]. Annotated instances, that is, specifying that an
independent task must be generated, are colored in blue. The
corresponding generated KPN is depicted in Figure 4. One
task is created for each annotated instance. The root task
is made of three methods (root_1, root_2 and root_3). The
channels to implement are identified (c1 to c9) with their
source and destination. Figure 5 shows a possible schedule
for the thread implementing the root node; the communications
(green boxes) are part of the integration code to be written by
the user (may be automated by platform specific scripts).
The KPN model, or more generally the usage of isolated
tasks communicating through message passing, is pretty com-
mon for multi-core execution, especially for safety-critical
system. It guarantees isolation between tasks, which only
communicate through channels. Communication points be-
tween cores are also well-identified and separated from regular
computations. This allows for more control over memory
interferences.
MCG itself does not provide a solution to mitigate memory
interferences. It does however make sure that it remains an
integration problem, with no impact on the functional model.
Properties such as isolation are guaranteed provided that
the integration code respects the usage conditions of MCG
generated code.
C. Target integration
The target integration consists in allocating the tasks gener-
ated by MCG to threads/cores and to implement communica-
tions. The KPN is described in the traceability information
generated by MCG. [32] describes an implementation for
the PXROS operating system on Infineon Aurix platform. It
is also straightforward to implement communications using
traditional data structures like semaphores or C11 atomics.
The KPN model gives a formal model of the code generated
by MCG. It is used to specify the usage conditions of this code,
for instance how communications should be implemented or
the dependencies between tasks. The target integration must
ensure that these conditions are verified, to ensure that the
behavior of the code is the same as the sequential code. For
instance, we guarantee that the generated KPN only needs
buffers of size one. We can also rely on the literature for
scheduling and allocation algorithms for KPNs [33].
D. Impact on the code generator
As we said above, the language considered by MCG and its semantics is SCADE 6, thus all the front-end is shared with KCG. The only additional checks are relative to the added pragmas and their compatibility with other compiling directives like operator inlining.
The communication channels are then introduced in the core dataflow form. The splitting of the operator bodies is done in a new intermediate language that allows several cycle methods per operator; this is a kind of declarative version of the imperative simple object-based language introduced in [16]. The algorithm that implements this step is inspired by the modular compilation of LUSTRE proposed in [31].
The sequential parts of the code i.e. the body of the different methods that implement an operator are scheduled and generated the same way KCG does.
E. An extension: pipelining
In some cases, it may not be possible to parallelize an existing SCADE model because of the sequentiality of the computations. A classic solution in that case is to use pipelining and to add memories between the different parts of the computation. It takes more steps to compute the result, but the different parts of the pipeline can be executed in parallel.
Pipelining can be achieved in the same way in SCADE, by adding a unit delay (esty), between different operators. This results in a channel with an initial token, containing the initial value of the esty operator. It is interesting to note that for this extension the KPN model once again allows to describe the generated code using existing concepts and algorithms.
V. CONCLUSION
This paper illustrates the relevance of Kahn process networks to address parallelism; it is used here for both language design and as an execution model used to abstract multi-core architectures. These two parallelisms correspond to different phases of a system design:
- its functional definition with SCADE 6 and
- its implementation on a multi-core architecture with the help of MCG.
When designing a function it is good to concentrate on what has to be computed regardless on when it has to be scheduled; that is what synchronous languages allow. And when implementing on a multi-core it is not necessary to know what the pieces of code to integrate are computing but only timing aspects (worst-case execution time, worst-case communication time) to make the placement choices.
The originality of the proposition is to not correlate these two steps and allow to have a functional architecture that differs from the implementation one.
Another interesting point is the preservation of the semantics. The language itself is not changed to adapt to multi-core targets; it is still the same and thus deterministic with all the appreciated properties when it comes to verification or
maintenance. The annotations introduced to identify the tasks are just compiler directives that affect the organization of the generated code, not the behavior of the model.
This separation is also interesting from an industrial point of view because it allows to have different implementation strategies depending on the actual hardware. It often happens that a given embedded function is implemented on different micro-controllers with different number of cores and different computation power per core. In automotive for instance, top-end cars can have more expensive hardware and share some functions with lower-end ones.
MCG will be part of the next release of SCADE. It is not qualified yet and the use of multi-core on the most critical systems is still a work in progress for both industry and certification authorities. This work is a contribution to this reflection. It provides a partial answer to the questions raised by these architectures when used in a safety critical context.
REFERENCES
|
{"Source-Url": "https://hal.science/hal-01960410/file/paper.pdf", "len_cl100k_base": 7829, "olmocr-version": "0.1.50", "pdf-total-pages": 9, "total-fallback-pages": 0, "total-input-tokens": 29783, "total-output-tokens": 10648, "length": "2e12", "weborganizer": {"__label__adult": 0.0004184246063232422, "__label__art_design": 0.00036025047302246094, "__label__crime_law": 0.00032639503479003906, "__label__education_jobs": 0.00034499168395996094, "__label__entertainment": 6.395578384399414e-05, "__label__fashion_beauty": 0.00017893314361572266, "__label__finance_business": 0.0002104043960571289, "__label__food_dining": 0.0003902912139892578, "__label__games": 0.0006127357482910156, "__label__hardware": 0.002117156982421875, "__label__health": 0.0004584789276123047, "__label__history": 0.0002510547637939453, "__label__home_hobbies": 0.00010693073272705078, "__label__industrial": 0.0006008148193359375, "__label__literature": 0.0002167224884033203, "__label__politics": 0.00030612945556640625, "__label__religion": 0.0005922317504882812, "__label__science_tech": 0.0222930908203125, "__label__social_life": 6.335973739624023e-05, "__label__software": 0.0040130615234375, "__label__software_dev": 0.96484375, "__label__sports_fitness": 0.0003552436828613281, "__label__transportation": 0.000835418701171875, "__label__travel": 0.00021839141845703125}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 42791, 0.01863]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 42791, 0.565]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 42791, 0.88714]], "google_gemma-3-12b-it_contains_pii": [[0, 1000, false], [1000, 6359, null], [6359, 12566, null], [12566, 18053, null], [18053, 23678, null], [23678, 28461, null], [28461, 32259, null], [32259, 35077, null], [35077, 42791, null]], "google_gemma-3-12b-it_is_public_document": [[0, 1000, true], [1000, 6359, null], [6359, 12566, null], [12566, 18053, null], [18053, 23678, null], [23678, 28461, null], [28461, 32259, null], [32259, 35077, null], [35077, 42791, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 42791, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 42791, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 42791, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 42791, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 42791, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 42791, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 42791, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 42791, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 42791, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 42791, null]], "pdf_page_numbers": [[0, 1000, 1], [1000, 6359, 2], [6359, 12566, 3], [12566, 18053, 4], [18053, 23678, 5], [23678, 28461, 6], [28461, 32259, 7], [32259, 35077, 8], [35077, 42791, 9]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 42791, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-01
|
2024-12-01
|
25de67b43d6c5654663d8b3767c25826ceaab1ca
|
1993-06-04
Using Warp to Control Network Contention in Mermera
https://hdl.handle.net/2144/1470
Boston University
Using Warp to Control
Network Contention in Mermera*
Abdelsalam Heddaya Kihong Park† Himanshu Sinha‡
heddaya@cs.bu.edu park@cs.bu.edu hss@cs.bu.edu
BU-CS-93-007
June 4, 1993
Revised September 25, 1993
To appear in Proc. 27th Hawaii Int’l Conf. on System
Abstract
Parallel computing on a network of workstations can saturate the communication network,
leading to excessive message delays and consequently poor application performance. We examine
empirically the consequences of integrating a flow control protocol, called Warp control [Par93],
into Mermera, a software shared memory system that supports parallel computing on distributed
systems [HS93].
For an asynchronous iterative program that solves a system of linear equations, our measure-
ments show that Warp succeeds in stabilizing the network’s behavior even under high levels of
contention. As a result, the application achieves a higher effective communication throughput,
and a reduced completion time. In some cases, however, Warp control does not achieve the
performance attainable by fixed size buffering when using a statically optimal buffer size.
Our use of Warp to regulate the allocation of network bandwidth emphasizes the possibility
for integrating it with the allocation of other resources, such as CPU cycles and disk bandwidth,
so as to optimize overall system throughput, and enable fully-shared execution of parallel
programs.
Keywords: Distributed non-coherent shared memory, network contention, flow control, iterative
methods, Isis.
*This research was supported in part by NSF under grants IRI-8910195, IRI-9041581 and CDA-8920936.
†This author was additionally supported by NSF grant CCR-9204284.
‡Present address: GTE Laboratories, 40 Sylvan Road, Waltham MA 02254.
1 Introduction
Today’s high performance networked workstations are increasingly used for parallel computing. Such systems are connected by networks (e.g., Ethernet, FDDI) that are proportionately slower than parallel computer interconnection networks, in terms of latency and bandwidth. Consequently, parallel programs can place very high sustained communication loads on workstation networks, causing congestion and high communication delays. This phenomenon severely limits the number of workstations that can participate fruitfully in parallel when running communication-intensive applications.
Mermera is an example of a system that encourages applications to generate high traffic volumes, causing network congestion. It is a software shared memory system that has been developed to support parallel computing on a workstation network [HS93, Sin93]. Processes that comprise a parallel program communicate through read and write operations to the shared memory provided by Mermera. Several different memory behaviors are supported, including one coherent\(^1\), and three non-coherent (Pipelined Random Access Memory [LS88], Slow Memory [HA90], and Local Consistency [HS93]).
A key property of non-coherent memory operations supported by Mermera is that they are “asynchronous” in that they do not wait for any communication to be performed before they return. This allows the application program to issue as many shared memory operations as the processing power of the CPU allows, potentially flooding the network with communication requests. By contrast, coherent write operations are inherently “synchronous” in that they do not return until some message is successfully sent and received. Applications such as asynchronous iterative algorithms [BT89] and oblivious computations [LS88], are thus capable of causing high and sustained network contention. Operating systems that aim to support parallel computing, must therefore offer mechanisms for controlling network contention to a higher degree than is available today. To study the question, and to try to formulate requirements for the likely candidate mechanisms for this purpose, we implemented, tested and measured the Warp control protocol under Mermera.
Warp control [Par93] is a distributed end-to-end flow control protocol which uses a timestamp based estimator of network state to adaptively throttle arrival rates so as to optimize network throughput. It consists of a protocol suite, of which rate adjustment protocol (RAP) is the basic one used in the experiments. The network estimator is called warp, and it uses time-stamps to
\(^1\)Our definition of coherence, first advanced in [HS92] is equivalent to that of sequential consistency [Lam79].
estimate relative change in network delay. We will often use "Warp" (capitalized) to refer to the protocol itself. In case of single server queues, \( \text{warp} \approx \rho \) where \( \rho \) is the network utilization (i.e., throughput). Warp control has the desirable property of being asymptotically stable, although for networks characterized by unimodal load–service rate functions\(^2\), additional controls are needed to ensure stability. Warp is particularly suited for steady, high-bandwidth traffic, a communication pattern supported by non-coherent writes in Mermera. Although the ideal place for Warp to reside is in the network interface unit (e.g., network layer in the ISO-OSI hierarchy or lower), in the current implementation it was applied at the level of Mermera which itself runs on top of Isis. Due to Isis' own flow control algorithm and Ethernet's exponential back-off mechanism, Warp was receiving highly filtered information, but nevertheless achieving improved performance when running a communication-intensive application. In order to harness the computational resources of large networks of workstations effectively, we believe that the network must be treated as an integral part of the distributed system, to be managed in tandem with other resources. We elaborate on this point in sections 3 and 7.
In the next two sections, we describe the essential details of Mermera and Warp. Section 4 specifies our experimental set-up, and section 5 provides basic measurements that characterize the communication underlying Mermera with, and without, Warp. Preliminary measurements that exemplify the application performance improvements obtainable with Warp are given and interpreted in section 6. Section 7 discusses our conclusions.
2 Mermera
Mermera supports several different memory behaviors, including:
- **Coherent Memory**: All processes agree on the order of all writes, a definition that can be shown to be equivalent to sequential consistency [Lam79]. More precisely, if a process observes some writes in a certain order then no other process observes those writes in a different order. A process \( i \) is said to observe a write \( x.w \) to location \( x \), if the value returned to process \( i \) by a read operation is the value written by \( x.w \), or is a value written by a process that observed \( x.w \).
\(^2\)One method for modeling network congestion is to assume a functional relationship between network load and service rate that has a unimodal shape [Par93].
• **Pipelined RAM (PRAM):** This behavior shares only the acronym with the Parallel Random Access Machine, a theoretical model of parallelism often used to design simple parallel algorithms. PRAM requires that the order of all writes by the *same* process is respected by all processes, *i.e.*, if a process performs two writes, \( w_1 \) followed by \( w_2 \), then no process can read them in the reverse order. Writes by different processes may be interleaved in different orders by different processes.
• **Slow Memory:** All writes by the *same process to the same location* are ordered by all processes in the order they were written. Writes to different locations by the same process may be ordered differently by different processes.
Our current implementations\(^3\) support the above behaviors using full replication of the shared memory. The interface consists of one read operation, and several write operations, one for each type of memory behavior. A read operation returns the value stored in the local copy of shared memory, and hence takes the same time as an ordinary memory reference. This time is typically 0.1–1.0 microseconds. Each write operation causes Mermera to enqueue the new value for broadcast over the network. A coherent write operation returns only after the message has been sent and received back by the writer.
Slow and Pipelined RAM write operations do not wait for any communication to complete; once their request for communication is recorded locally, the operation can return. These updates can be enqueued for later transmission when an appropriate number of them can be batched together for efficiency. We can say that these operations are asynchronous with respect to communication, and computations that use them can, in principle, submit new values for transmission at a sustained rate greater than the network capacity.
Writes are propagated by broadcasting the values to other processes. We use the Isis toolkit [BJ87, BSS91] for our implementation because it provides a suite of multicast protocols that satisfy different ordering properties. The broadcasts of interest to us are \( abcast() \), \( fbcast() \) and \( mbcast() \). These primitives have different constraints on the order in which the messages are delivered to their destinations.
*All* messages sent using \( abcast() \) are delivered in the same order at all destinations, *i.e.*, the order in which these messages are delivered is the same for all processes. This is exactly the property we want for *CO-Wide*. The \( fbcast() \) messages obey a weaker constraint: messages sent by the
\(^3\)Mermera has been implemented on a BBN Butterfly, on a CM-5, and on a workstation network. Congestion control is applicable only in the latter.
same process are delivered to all processes in the order they were sent. However, \textit{fcasts} sent by different processes may be interleaved in different orders at different recipients. This suffices for \textit{PRAM.Writes}, so we use \textit{fcasts} to propagate them. No ordering constraints are guaranteed among \textit{mbcast()} messages. We use this primitive for propagating \textit{Slow Writes}.
Isis offers no ordering guarantees among messages sent using different primitives, \textit{e.g.}, if two messages are sent one after the other using \textit{abcast()} and \textit{fmbcast()}, respectively, they are not necessarily delivered in the order they were sent. Our implementation enforces this ordering explicitly via sequence numbers, and by careful control of the order in which received updates are applied.
Isis employs the UDP transport protocol, which, in turn, runs on top of IP and Ethernet's CSMA/CD protocol. Both Isis and the Ethernet, but not UDP, have built-in flow control whose effect can be discerned in our measurements presented in sections 5 and 6.
Numerous software shared memory systems have been proposed in the literature, but most of them provide coherence at the level of sequential consistency or stricter. Recently, some systems started to allow weaker conditions. Examples include the DASH multiprocessor [LLJ+93], the Minin software shared memory system [CBZ91], and transactional memory [HM92], which allow sequential consistency to be broken, but only during the execution of code blocks explicitly marked by the programmer. These systems, as well as Mermera, stand to benefit from network contention control protocols.
3 Warp Control
Warp control is a distributed end-to-end flow control protocol that uses a time-stamp based scheme to throttle arrival rates at active message sources to achieve optimal network utilization. For a related discussion of flow control algorithms, see [GK80, HW91]. Let $N$ be the network, and let $p_1, p_2, \ldots, p_n$ be the network nodes. Let $\mu$ be the service rate of the network, and let $\lambda_1, \lambda_2, \ldots, \lambda_n$ be the arrival rates of $p_1, p_2, \ldots, p_n$, respectively. Thus the total arrival rate of the network is given by $\lambda = \sum_{i=1}^{n} \lambda_i$, and the utilization can be defined as $\rho = \lambda/\mu$. For simplicity of exposition, assume that every node $p_i$ has access to the same global clock\footnote{In general, this assumption can be relaxed so that, not only do the network nodes need not have access to the same absolute time, but their local clocks may also run at different speeds.}. Assume at time $t_1$, node $p_i$ wants to send a message $m_{ij}$ to node $p_j$. The following protocol is executed at the sender $p_i$:
**Message encoding protocol (MEP):**
1. Create a header containing $i, j$, and time stamp $t_1$, that is, $m_{ij}.time\_stamp := t_1$.
2. Attach the header to the data section of $m_{ij}$ and submit to network $N$.
For all $k \in \{1, 2, \ldots, n\}\setminus\{j\}$, $p_j$ maintains a data structure $\text{hist}[k]$ containing two fields $\text{hist}[k].last\_in$ and $\text{hist}[k].last\_out$. In $\text{hist}[k].last\_in$ is recorded the time at which the last message from $p_k$ arrived at $p_j$, and $\text{hist}[k].last\_out$ records the time at which it was sent out from $p_k$. When $p_j$ receives $m_{ij}$, it executes the following protocol, in which $t_2$ denotes the message arrival time.
**Message decoding protocol (MDP):**
1. $\text{warp} := \frac{t_2}{m_{ij}.time\_stamp - \text{hist}[i].last\_out}$
2. $\text{hist}[i].last\_in := t_2$
3. $\text{hist}[i].last\_out := m_{ij}.time\_stamp$
It can be shown [Par93], under the assumption of $N$ being a FCFS single-server queue and $|d\lambda/dt| \ll 1$, that $\text{warp} \approx \rho$. Therefore, to achieve and maintain maximum utilization, the following control law can be employed,
$$\frac{d\lambda}{dt} = \epsilon(1 - \text{warp})$$
(1)
where $\epsilon > 0$ is a constant adjustment factor. If $\tau$ is the network delay, one can further show that the resulting system is asymptotically stable if
$$0 < \frac{\epsilon}{\bar{\mu}} < \frac{\pi}{2}$$
(2)
where $\bar{\mu}$ is the mean service rate. Thus to attain maximum utilization in a stable manner, it suffices to set $\epsilon$ very small. In practical terms, this translates to an initial transient period at start-up time, and a lagged response to sudden structural changes (e.g., 30% of the nodes going down at once). On the positive side, this makes the system robust with respect to noise, guaranteeing asymptotic stability even under dynamic perturbation. The issues of better responsiveness, fairness and stability under unimodal load-service rate functions are discussed in [Par93].
Distributed control is achieved by noting that $\lambda = \sum_{i=1}^{n} \lambda_i$. That is, at every $p_j$, the following update protocol is executed after performing MDP:
**Rate adjustment protocol (RAP):**
1. $\lambda_j(t) := \lambda_j(t - 1) + \epsilon_j(1 - \text{warp})$.
5
2. If \( \lambda_j(t) < 0 \), then \( \lambda_j(t) := 0 \).
A straightforward way of implementing message submission rate control at every \( p_i \) using a buffering scheme is to maintain a large message queue \( B \), and enqueue message submissions in \( B \). The network interface unit at \( p_i \) periodically examines \( B \), and at every such instant dequeues \( \lambda_i b \) messages from \( B \). It executes MEP on the dequeued messages and sends them off. The parameter \( b > 0 \) is system dependent, and affects the quantization range of \( \lambda_i \). Information regarding the current state of \( B \) and \( \lambda_i b \) can be made available to the application running at \( p_i \), so that it can better manage its communication needs should its computation allow it to do so. For example, in asynchronous iterative algorithms that solve fixed-point problems arising in various applications [BT89], convergence rate is enhanced if the application can keep its computation/communication ratio, which is variable, compatible with \( \lambda_i b \). This way, no time is wasted in generating messages that may get delayed due to unnecessary buffering. For applications that do not have controllable computation/communication ratios, this benefit cannot be harnessed.
Nevertheless, from an operating systems point of view, if the operating system is managing a set of processes each with its own nonvariable computation/communication ratio, the operating system itself may schedule the processes so that the system as a whole stays as compatible as possible with \( \lambda_i b \). For example, if \( \lambda_i b \) is small, then it is wasteful for the operating system to allocate CPU cycles to processes having a small computation/communication ratio (i.e., communication intensive) if it has a choice. Not only will the delay be large due to the growing queue, but in the extreme case when \( B \) is full, CPU cycles will be wasted trying to write to a buffer that is already full. These speculative scenarios illustrate the close relationship between various resources such as computation (CPU) and communication (network) in networked workstations that share them. Thus, the possibility clearly exists for an operating system to enhance system performance by allocating CPU and network resources in tandem.
In the current implementation, due to issues specific to the present design of Mermera, a simplified scheme is being used. A buffer \( B \) is maintained between Mermera and Isis, and if \( |B| > \Lambda_i b \), where \( |B| \) denotes the queue length, the buffer is flushed to Isis. \( \Lambda_i \) is a quantity that has the opposite effect of \( \lambda_i \), in the sense that, if \( \Lambda_i \) increases, the message submission rate decreases due to less frequent flushing. This modified implementation is easily accommodated by changing the sign of \( e \) in equation (1) from positive to negative. The value referred to as "lambda" in this paper is actually \( \Lambda_i \), and should not be confused with the arrival rate \( \lambda \).
One can view \( \Lambda \) as a parameter that controls the amount of bandwidth allocated to the com-
Figure 1: In the absence of background traffic, *warp* values indicate that the network is well behaved both without Warp (left) or with it (right). The explosion in delay represented by the high warp peaks toward the end of the computation signify the extra communication our example application needs to detect termination.
To avoid the problem whose messages are “throttled” according to the value of $\Lambda$. Under this interpretation, mechanisms that tie CPU scheduling to network bandwidth allocation can be exemplified by the following scheme. Whenever a process attempts to send a message, and finds that its message will have to be queued for a long time because $|B| \gg A\rho$, the system gives the process the following choice. It can either give up the CPU in favor of other processes that may have some spare communication bandwidth allocated to them, or it can abort the sending of its message, hoping to generate another message with more current or complete information by the time its share of bandwidth permits the transmission of the message. This scheme has meaning under a more general Warp Control system than is implemented in this paper, one that allocates bandwidth among different parallel programs that share the system’s communication facility.
4 Experimental Set-up
We conducted our measurements on a network of six dedicated Sun Sparc 1+ workstations and a server, each equipped with 660 MByte individual disks, and connected via a private 10 Mbit Ethernet. The workstations all run SunOS version 4.1.1, and the Isis Toolkit version 2.2.5. We ran NetMetrix version 3.0.1 on the server and one of the workstations, to generate background traffic.
Figure 2: At 65% background traffic, \textit{warp} values exhibit numerous high spikes (above 10) without Warp control (left). Warp control (right) effectively eliminates them, once it stabilizes. Spikes above 100 are clipped to preserve scale.
in order to increase contention for the Ethernet.\footnote{We are grateful to Metrix Network Systems, Inc., for free use of their software.} The remaining five workstations were dedicated to running the parallel equation solver on top of Mermera and Isis.
We measured the completion time of the equation solver on a system of linear equations $Ax + b = 0$ in 1000 variables, generated pseudo-randomly. The level of traffic infused by NetMetrix on each of the two machines, given as an uninterpreted percentage, was varied between 0\% to 65\%. We also measured the input and output quantities for Warp control, \textit{warp} and $A$, defined in the previous section.
Warp was implemented as a function call from Mermera, invoked each time a message is received. The corresponding message rate control is incorporated as a conditional check, tested at every message enqueue, flushing the buffer to Isis if $|B| > A \delta$. This places Warp control at an inefficiently high level, acting on data that is filtered through lower layer protocols. For operating system support purposes, Warp should be moved to the transport/network layer of the ISO-OSI reference model.
5 Network Performance
Figure 1 shows the variations in network delay (as measured by \textit{warp}) during a typical run of the equation solver on top of Mermera. With only five workstations, the network is clearly operating
well within its capacity, and therefore is very well behaved.\footnote{The very large spikes at time 1800 are caused by a barrier mechanism that checks for a global termination condition.} Turning on Warp control does not lead to any noticeable performance improvement. In order to see what might happen if the network contention was high, for example, caused by having 100 workstations instead of only five, we used a traffic generation program that is part of the NetMetrix software. We ran the traffic generator on two dedicated workstations, other than the five that run the equation solver, and obtained the results shown in figure 2.
Compared to figure 1, \textit{warp} values in figure 2 are far higher, with many spikes exceeding 5, some exceeding 50, and a few exceeding 500. A value of 5 means that a Mermera internal message took five times longer to reach its destination than the immediately preceding message from the same source to the same destination. Since Mermera messages, which are sent via Isis, take roughly 10-50 ms on average to reach their destination, our measurements suggest that some messages are taking 0.5-2.5 seconds—an extremely long delay. Such large differences in message delay can be explained by looking at the flow control mechanisms used by Isis and the underlying Ethernet. Isis uses several schemes, among them a simple heuristic that, based on the number of buffered messages at a node, determines whether congestion exists or not. Once Isis decides that congestion exists, it stops sending messages for a long period of time (1 second) [Bir93], thus causing a large spike in \textit{warp}. Smaller spikes may be explained by the Ethernet’s back-off mechanism when collisions occur [Tan88].
Figure 2 offers empirical insight into the behavior of Warp: it slowly but effectively squelches large spikes in \textit{warp}, and consequently in message delay. We see in the right hand plot that the spikes subside after a thousand messages or so have been delivered. Warp’s success in smoothing the network’s behavior reduces the total number of messages needed to run the application to completion, from $\sim 3500$ to $\sim 2500$. Both of these observations are further elaborated in the next section.
6 Application Performance
6.1 Six-Workstation Experiments
Our preliminary measurements suggest that Warp control can improve application performance by enabling it to extract a higher communication throughput, with a correspondingly smaller delay,
from the network. In this section we present evidence to support this conclusion, and empirically analyze the behavior of Warp control in order to explain the precise nature of the performance improvement it affords. In particular, we seek to illuminate the relationship between performance under statically optimal buffer size, and that under dynamically optimal buffer size, controlled by the Warp protocol.
Consider the two different views of the completion time versus the buffer size (initial buffer size when Warp is active), found in figures 3 and 4. Figure 3-left illustrates the detrimental effect network contention can have on the equation solver’s completion time, which is manifested as a shift in the completion time curve. When there is high background traffic and Warp is turned off, simply increasing the fixed buffer size causes a reduction in network contention that is sufficient to decrease the completion time drastically (from about 250 seconds to less than 50 seconds). The vertical separation between the two curves in the same plot (figure 3-left) indicates the impact of background traffic on completion time, which can also be very high when the solver is itself generating high traffic (small buffer size). Warp, when activated, reduces the sensitivity of completion time to the amount of background traffic that exists on the network, suggesting that Warp helps the equation solver extract sufficient throughput from the network even in the presence of 55% background traffic. That is, Warp is able to insulate the system, to a significant degree, from the otherwise harmful effects of increased traffic.
Figure 4 allows us to quantify the performance gains obtained with Warp. The graphs are self-
Figure 4: Completion time with five compute processors and two traffic generation processors with and without Warp control. Left and right graphs reflect 0% and 55% background traffic levels, respectively.
Explanatory, showing that Warp can relieve the application programmer, or Mermera’s designer, from the need to choose a buffer size appropriate to the particular level of contention that happens to be in effect on the network. Furthermore, in an ever-changing environment, Warp provides a simple means for effective adaptation. This suggests the need for operating system tools supportive of such a mechanism, to insulate the programmer from system-dependent communication effects.
However, a very revealing measurement is not apparent in these graphs. Consider the case for an (initial) buffer size of 10, and background traffic level of 65% (only slightly different from the 55% case shown in figure 4-right). The no-Warp run exchanges 34,436 messages, and completes in 95,2 seconds, for a communication throughput of 3,625 updates/second. By contrast, the run under Warp transmits 27,135 messages, and finishes in 52.6 seconds, achieving the much higher throughput of 5,276 updates/second. In effect, by reducing the variation in network delay, via controlling excessive traffic, effective throughput is increased, which leads to faster overall performance.
One obvious remaining question is: why does Warp control fail to achieve the best completion time, when it starts with an initial buffer size that is far from optimal? To answer this question, and offer additional insight into the network dynamics under Warp, we present the results in figure 5, which show the actual buffer sizes computed by Warp control throughout two executions. The left hand side pair of graphs correspond to an initial buffer size of 1, while the right hand side pair depict the case for initial buffer size of 10. Clearly, Warp control stabilizes much more slowly when it starts farther from its eventual operating neighborhood. In the first case, it takes about 3000 messages for
Warp to stabilize, while in the second case, it does so after only 1000 messages. The general slowness with which Warp react has the advantage of ensuring its long term stability, but, for applications running for short durations, the initial transient period may not get sufficiently amortized to yield significant performance enhancement. On the other hand, for very large problem sizes or when Warp is under the direct control of the operating system, the transient effect will be amortized across multiple applications, yielding an even more pronounced difference in performance.
Figure 5: $\Lambda$ (upper graphs) and $\text{warp}$ (lower graphs) for background traffic level of 55% with initial $\Lambda = 0.05$ (left graphs); and traffic 65% with initial $\Lambda = 0.5$ (right graphs). Buffer size used for each message sent is $20\Lambda$, hence the smallest effective change in $\Lambda$ is 0.05.
Figure 6: Simulation of a 10 node system under Warp without (left), and with (right), fairness protocol added.
6.2 Large-scale Predictions
A relevant phenomenon that is specific to our particular environment concerns the general flatness of the completion time versus buffer size curve, shown in figure 3. The flatness of the curve above a buffer size of 20 indicates the noncritical nature of selecting a near optimal buffer size for the present system, the only requirement being that it not be too small. The flatness is caused in part by the private Ethernet (no routing) and its CSMA/CD collision control mechanism which favors long packets for achieving high throughput. When the number of workstations participating in the parallel computation is large, then the statically optimal buffer size may be much more narrowly defined, making the selection of the optimal buffer size a more challenging task.
A principal reason for this lies with the issue of fairness of bandwidth allocation among participating processors. The completion time of an application distributed over \( n \) nodes depends on the completion time of the slowest component. Hence to ensure timely and sufficient progress over all nodes, bandwidth fairness needs to be imposed, which in turn can be effected by minimizing the variation of \( \Lambda_i, E_i (\Lambda_i - \bar{\Lambda})^2 \), in time where \( \bar{\Lambda} = \sum_i \Lambda_i / n \). Figure 6 shows a simulation run of a 10 node system without a fairness protocol (left figure), and with one (right figure). The output is taken from [Par93] and shows the variation in bandwidth allocation when fairness is not regulated. The message generation rates of the first 5 nodes are shown, and the drift in individual arrival rates is clearly visible. For a discussion of the fairness protocol, see [Par93].
A prerequisite for reducing variation and maintaining even progress in computation over all
participating nodes is that packets sent out from the nodes not be too long. This implies a more sensitive dependence of completion time on buffer size which increases the need for a dynamic control mechanism such as Warp.
Furthermore, one can define communication uniformity as the level of uniformity of the communication pattern among processors; for example, the higher the locality of communication, the lower the uniformity. Communication uniformity, which grows quadratically in the number of nodes for applications such as asynchronous fix-point iterative algorithms, necessitates shorter packets leading to a more convex-shaped completion time vs. buffer size curve. Due to these aggregate effects, we believe that the role of network bandwidth management for implementing parallel computations on distributed systems will become more critical as the system is scaled up.
7 Discussion
This paper deals with a central phenomenon that was brought to our attention through experience with parallel applications running on top of Mermera, namely, extreme changes in message delay and degradation in communication throughput as a result of network contention. Clearly, this phenomenon should not be left to application programmers, or even presentation layer developers, to contend with. For example, neither the equation solver programmer, nor the Mermera designer, have the necessary information to be able to dynamically adjust their software's communication requirements to the levels that would optimize network performance in a changing shared environment. Unfortunately, in the absence of specific operating system support for a flow control protocol such as Warp at lower layers of the ISO-OSI hierarchy, these programmers are left with no other alternative but painstakingly tune their applications by hand, and live with performance that can be optimal only under very restricted circumstances, if at all.
We have shown that in systems like Mermera, with a pronounced need for flow control as a result of the “asynchrony” of their communication, that Warp can help smooth network behavior, and deliver enhanced performance to applications. Our measurements also give experimental insight into the dynamic behavior of Warp itself, confirming the theoretical predictions and large-scale simulations of [Par93], given for a general packet or circuit-switched queueing system. Furthermore, our data revealed to us an undocumented aspect of the Isis toolkit, which is the technique it uses to control congestion. It was instructive for us to note that in every run, Warp was able eventually to smooth network traffic enough to prevent Isis' own mechanism from kicking in.
One can think of Warp control as a bandwidth allocation mechanism. This raises many questions, briefly touched upon in section 3, including the possibility of tying CPU scheduling to network bandwidth allocation in order to improve total system throughput. Such a “holistic” perspective has obvious benefits for applications other than parallel computing on distributed systems. For example, multimedia applications could benefit from coordinated scheduling of disk I/O, CPU cycles, and network bandwidth.
References
|
{"Source-Url": "https://open.bu.edu/bitstream/handle/2144/1470/1993-007-mermera-warp%202.pdf?sequence=1&isAllowed=y", "len_cl100k_base": 7171, "olmocr-version": "0.1.53", "pdf-total-pages": 18, "total-fallback-pages": 0, "total-input-tokens": 95513, "total-output-tokens": 9172, "length": "2e12", "weborganizer": {"__label__adult": 0.0003209114074707031, "__label__art_design": 0.0003390312194824219, "__label__crime_law": 0.0003688335418701172, "__label__education_jobs": 0.0007567405700683594, "__label__entertainment": 0.00016438961029052734, "__label__fashion_beauty": 0.00016987323760986328, "__label__finance_business": 0.0003809928894042969, "__label__food_dining": 0.0003960132598876953, "__label__games": 0.000652313232421875, "__label__hardware": 0.003873825073242187, "__label__health": 0.0007429122924804688, "__label__history": 0.0004127025604248047, "__label__home_hobbies": 0.0001214146614074707, "__label__industrial": 0.0007886886596679688, "__label__literature": 0.0003428459167480469, "__label__politics": 0.00032138824462890625, "__label__religion": 0.0006155967712402344, "__label__science_tech": 0.46923828125, "__label__social_life": 0.00012958049774169922, "__label__software": 0.030120849609375, "__label__software_dev": 0.488037109375, "__label__sports_fitness": 0.00034737586975097656, "__label__transportation": 0.001007080078125, "__label__travel": 0.00026297569274902344}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 37084, 0.05278]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 37084, 0.36627]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 37084, 0.9091]], "google_gemma-3-12b-it_contains_pii": [[0, 365, false], [365, 2177, null], [2177, 4902, null], [4902, 7425, null], [7425, 10184, null], [10184, 12991, null], [12991, 15266, null], [15266, 18460, null], [18460, 20142, null], [20142, 21782, null], [21782, 24277, null], [24277, 26008, null], [26008, 28083, null], [28083, 28991, null], [28991, 30928, null], [30928, 33613, null], [33613, 35467, null], [35467, 37084, null]], "google_gemma-3-12b-it_is_public_document": [[0, 365, true], [365, 2177, null], [2177, 4902, null], [4902, 7425, null], [7425, 10184, null], [10184, 12991, null], [12991, 15266, null], [15266, 18460, null], [18460, 20142, null], [20142, 21782, null], [21782, 24277, null], [24277, 26008, null], [26008, 28083, null], [28083, 28991, null], [28991, 30928, null], [30928, 33613, null], [33613, 35467, null], [35467, 37084, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 37084, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 37084, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 37084, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 37084, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 37084, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 37084, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 37084, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 37084, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 37084, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 37084, null]], "pdf_page_numbers": [[0, 365, 1], [365, 2177, 2], [2177, 4902, 3], [4902, 7425, 4], [7425, 10184, 5], [10184, 12991, 6], [12991, 15266, 7], [15266, 18460, 8], [18460, 20142, 9], [20142, 21782, 10], [21782, 24277, 11], [24277, 26008, 12], [26008, 28083, 13], [28083, 28991, 14], [28991, 30928, 15], [30928, 33613, 16], [33613, 35467, 17], [35467, 37084, 18]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 37084, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-08
|
2024-12-08
|
260b879ebb1e86423f9bb5deaa9a11109ccb47b7
|
C++ Resource Intelligent Compilation for GPU Enabled Applications
David J. Skudra
Universities Space Research Association, 615 National Ave, Mountain View, CA 94043
George E. Gorospe
SGT Inc., NASA Ames Research Center, Moffett Field, CA, 94035, USA
Since its founding, NASA has been dedicated to the advancement of aeronautics and space science. The NASA scientific and technical information (STI) program plays a key part in helping NASA maintain this important role.
The NASA STI Program operates under the auspices of the Agency Chief Information Officer. It collects, organizes, provides for archiving, and disseminates NASA’s STI. The NASA STI Program provides access to the NASA Aeronautics and Space Database and its public interface, the NASA Technical Report Server, thus providing one of the largest collection of aeronautical and space science STI in the world. Results are published in both non-NASA channels and by NASA in the NASA STI Report Series, which includes the following report types:
- **TECHNICAL PUBLICATION.** Reports of completed research or a major significant phase of research that present the results of NASA programs and include extensive data or theoretical analysis. Includes compilations of significant scientific and technical data and information deemed to be of continuing reference value. NASA counterpart of peer-reviewed formal professional papers, but having less stringent limitations on manuscript length and extent of graphic presentations.
- **TECHNICAL MEMORANDUM.** Scientific and technical findings that are preliminary or of specialized interest, e.g., quick release reports, working papers, and bibliographies that contain minimal annotation. Does not contain extensive analysis.
- **CONTRACTOR REPORT.** Scientific and technical findings by NASA-sponsored contractors and grantees.
- **CONFERENCE PUBLICATION.** Collected papers from scientific and technical conferences, symposia, seminars, or other meetings sponsored or co-sponsored by NASA.
- **SPECIAL PUBLICATION.** Scientific, technical, or historical information from NASA programs, projects, and missions, often concerned with subjects having substantial public interest.
- **TECHNICAL TRANSLATION.** English-language translations of foreign scientific and technical material pertinent to NASA’s mission.
Specialized services also include organizing and publishing research results, distributing specialized research announcements and feeds, providing information desk and personal search support, and enabling data exchange services.
For more information about the NASA STI Program, see the following:
- Access the NASA STI program home page at [http://www.sti.nasa.gov](http://www.sti.nasa.gov)
- E-mail your question to help@sti.nasa.gov
- Phone the NASA STI Information Desk at 757-864-9658
- Write to: NASA STI Information Desk Mail Stop 148 NASA Langley Research Center Hampton, VA 23681-2199
C++ Resource Intelligent Compilation for GPU Enabled Applications
David J. Skudra
Universities Space Research Association, 615 National Ave, Mountain View, CA 94043
George E. Gorospe
SGT Inc., NASA Ames Research Center, Moffett Field, CA, 94035, USA
April 2018
The use of trademarks or names of manufacturers in this report is for accurate reporting and does not constitute an official endorsement, either expressed or implied, of such products or manufacturers by the National Aeronautics and Space Administration.
Available from:
NASA STI Program / Mail Stop 148
NASA Langley Research Center
Hampton, VA 23681-2199
Fax: 757-864-6500
Contents
1 Introduction ................................................. 2
2 Background .................................................. 2
2.1 Prior GPU Work ........................................... 2
2.2 Inspiration for RIC ......................................... 3
3 RIC Toolbox ................................................ 4
3.1 Preprocessor Definitions ................................. 4
3.2 Qualifiers ................................................ 5
3.3 Wrappers ................................................ 7
4 Compilation ................................................. 8
4.1 CUDA Compilation for RIC ............................... 8
4.2 Adding CMake Support with FindCUDA ................. 8
4.3 Setting up a project for RIC and CMake ............... 9
5 Results ....................................................... 12
5.1 Example Software: Stock Price Model .................. 12
5.2 Performance ............................................. 12
6 Summary ..................................................... 12
1 Introduction
We are nearing the limits of Moore’s Law [1] with current computing technology. As industries push for more performance from smaller systems, alternate methods of computation such as Graphics Processing Units (GPUs) should be considered. Many of these systems utilize the Compute Unified Device Architecture (CUDA) to give programmers access to individual compute elements of the GPU for general purpose computing tasks. Direct access to the GPU’s parallel multi-core architecture enables highly efficient computation and can drastically reduce the time required for complex algorithms or data analysis. Of course not all systems have a CUDA-enabled device to leverage, and so applications must consider optional support for users with these devices. Resource Intelligent Compilation addresses this situation by enabling GPU-based acceleration of existing applications without affecting users without GPUs.
Resource Intelligent Compilation (RIC) creates C/C++ modules that can be compiled to create a standard CPU version or GPU accelerated version of a program, depending on hardware availability. This is accomplished through a toolbox of programming strategies based on features of the CUDA API. Using this toolbox, existing applications can be modified with ease to support GPU acceleration, and new applications can be generated with just a few simple modifications. All of this culminates in an accelerated application for users with the appropriate hardware, with no performance impact to standard systems. This memorandum presents all the important features involved in supporting RIC and an example of using RIC to accelerate an existing mathematical model, without removing support for standard users. Through this memorandum, NASA engineers can acquire a set of guidelines to follow for RIC-compliant development, seamlessly accelerating C/C++ applications.
A basic knowledge of CUDA and it’s compilation pipeline is assumed, and some CMake familiarity.
2 Background
2.1 Prior GPU Work
Researchers at the NASA Ames Research Center have shown that many parallel applications implemented in CUDA outperform their CPU equivalents by multiple orders of magnitude [2]. In this research, parallelized Monte Carlo algorithms were used to demonstrate the application of GPUs towards computationally expensive algorithms and the expected performance increase. Furthermore, researchers hoped to leverage this technology to improve algorithm resolution (through more samples) and run-time. Simulation techniques like Monte Carlo algorithms are perfect candidates for GPU implementations, as they satisfy the optimal attributes within a CUDA program:
1. Algorithm operations may be easily parallelized
2. Parallelized operations follow the same instructions (no divergence)
3. Require an immense amount of resources to solve
2.2 Inspiration for RIC
Consider a case where a large pre-existing C++ library with thousands of users is found to be a good candidate for GPU acceleration, as it has computationally demanding components that can be easily parallelized. Pulling the rug out from the userbase and suddenly introducing CUDA-enabled devices as a hard requirement for using the library is not ideal, as not all users may possess the necessary hardware.
An alternative approach is to maintain a separate project that implements a GPU accelerated version of the demanding functions. The problem with this strategy is that this now requires additional support, as a second copy of the library must now be maintained and kept in stream with the original.
This problem is the inspiration for RIC. The ideal GPU accelerated program has all changes made inline with the original program, avoiding code duplication that requires extra maintenance, but at the same time does not impact users that don’t have CUDA-enabled devices to leverage. RIC enables the acceleration of code within their original models by dynamically generating the code based on the available hardware. This is accomplished using a small set of tools and design strategies for seamless GPU acceleration.
3 RIC Toolbox
3.1 Preprocessor Definitions
As indicated in the background, RIC aims to dynamically generate the code needed to build a program based on the available hardware. This implies deciding what code to compile in advance, which can be accomplished using the preprocessor and different CUDA compilation pipelines. When compiling CUDA applications, the NVIDIA CUDA Compiler (nvcc) is used in place of gcc/g++. This allows applications to be built that include any CUDA host code (code executed on the CPU) and CUDA device code (code executed on the GPU).
Preprocessor definitions can be used to make code generation decisions, as the preprocessor resolves them before code is sent to the compiler. Fortunately, CUDA provides some useful definitions that can be used to help make these preprocessor decisions when compiled with nvcc. Below are two important preprocessor definitions, which serve similar purposes with a subtle difference between the two.
1. **__CUDACC__**
This macro is used by source files executed on the host to determine if they are currently being compiled by nvcc. If it isn’t being compiled by nvcc, it’s left undefined which enables the definition to be used to dictate which blocks of code on the host should be compiled. This is very useful as most of the work with CUDA is not in writing the kernels themselves, but the setup and cleanup required outside of the kernel call.
Below shows an example of when CUDACC is necessary, by using it to decide if device memory or host memory should be allocated for some histogram to be populated later.
```c
// CUDA/C++ host code
// Code that is executed on the host but affects a possible kernel call
// ifdef __CUDACC__
#ifdef __CUDACC__
cudaMalloc((void **)&dayHistogram, sizeof(int) * timeHorizon));
cudaMemcpy((void *)dayHistogram, 0, sizeof(int) * timeHorizon));
#else
dayHistogram = (int *)calloc(timeHorizon, sizeof(int));
#endif
```
2. `__CUDA_ARCH__`
This macro is used to identify in device code what virtual architecture it is currently being compiled for. For RIC purposes, it is simply used as an indication of whether or not code is currently being compiled on a device, as it’s otherwise undefined. Note that absolutely no host code can be dependent on the existence of `__CUDA_ARCH__`.
Below shows an example of when ARCH is necessary, using it to decide how to update a histogram that might be executed on the host or a device.
```cpp
// CUDA/C++ device code
// Code that is executed on either the host or device
if (someCondition) {
#ifdef __CUDA_ARCH__
atomicAdd(&dayHistogram[t], 1); // Avoid race conditions in threads
#else
dayHistogram[t] += 1;
#endif
}
```
Formally, the difference between these two definitions is that `__CUDA_ARCH__` should exclusively be used to decide if code is being compiled to execute on a device, while `__CUDACC__` should be used to check what compiler is being used for the current source file. This is important as any CUDA program includes more than just the kernel that executes on the device, but the handler that is executed on the host. Simply put, decisions that will be made on the GPU must use CUDA_ARCH, while decisions made on the CPU must use CUDACC.
### 3.2 Qualifiers
Another set of critical tools used in RIC are function qualifiers. These are common tools used in most CUDA programs, but they are critical to RIC in order to support multiple compilation pipelines.
1. `__host__`
This qualifier is implicitly declared for any function that doesn’t already own a qualifier. It simply states that the function is to be compiled for execution on the host. The existence of this qualifier is important later.
2. `__global__`
This qualifier indicates that a function is to be executed on the device and therefore must be put in the device compilation pipeline. Functions with this
qualifier can be invoked directly from host code, which is essentially where execution is transferred from host to device.
3. **__device__**
Device qualified functions are similar to global qualified functions in that they must be executed on the device, and compiled in the device pipeline. An additional requirement for device qualified functions is that they can only be invoked while already on the device (so within the scope of another device function, or a kernel function).
A neat trick with CUDA is that it allows functions to carry both a **__host__** and **__device__** qualifier at the same time, which puts a copy of the function into the host compilation pipeline and another into the device compilation pipeline. This is extremely useful in the context of RIC as this combined qualifier essentially eliminates the need to duplicate code that otherwise would require near identical computation steps. Combined, the definitions described earlier and these qualifiers create a powerful set of tools.
The example below shows how using a combination of preprocessor definitions and qualifiers, a few small modifications can be made to an existing CPU-implemented model to now support GPU accelerated. Of course, users who don’t leverage a CUDA-enabled device won’t see any difference while compiling this module as the preprocessor definitions protect their host compiler from any unfamiliar code.
```
// CUDA/C++ host OR device code
// Necessary to prevent qualifiers from getting in host pipeline
#ifndef __CUDACC__
#define HOSTDEVICEQUALIFIER __host__ __device__
#else
#define HOSTDEVICEQUALIFIER
#endif
HOSTDEVICEQUALIFIER void someModel(int particles) {
#ifndef __CUDARCH__
int index = threadIdx.x + blockIdx.x * blockDim.x;
int stride = blockDim.x * gridDim.x;
for (int i = index; i < particles; i += stride) {
#else
for (int i = 0; i < particles; i++) {
#endif
// 50 lines of common computation here
}
}
```
Again, in order to support compilation on machines without CUDA, code such as
the CUDA qualifiers cannot be present as it will cause errors. The preprocessor
definitions described in the prior section are therefor used to create the proper def-
ition, depending on what type of system the program is being compiled for. On
a system with a CUDA-enabled device the HOSTDEVICEQUALIFIER is popu-
lated and therefor the function someModel is placed in both the GPU and CPU
compilation pipelines. On a system without a CUDA-enabled device the HOSTDE-
VICEQUALIFIER is left blank, so it is ignored when resolved by the preprocessor.
3.3 Wrappers
In section 4.2, it was indicated that functions with the \_\_device\_\_ qualifier pre-
fixing them can only be called from other device or kernel functions. The simple
solution here is to create a kernel function that simply passes on any necessary argu-
ments to the host-device qualified code. This also means that a kernel function must
be launched to call the device code, if being compiled for a GPU. This results in a
second layer of wrapper functions that is required when using the GPU model. An
example below shows example wrappers that would be required to launch a model
in parallel using CUDA.
```c
// CUDA/C++ host OR device code
#ifdef __CUDACC__
#define KERNEL __global__
#else
#define KERNEL
#endif
KERNEL void modelCallKern (int particles) {
someModel(particles);
}
// Again, only exists in device compilation pipeline. Transfers program
// from host to device.
#ifdef __CUDACC__
void someModelGPU(int particles, int threadsPerBlock, int blocksPerThread)
{
modelCallKern<<<blocksPerGrid, threadsPerBlock>>>(particles);
}
#endif
void someModelCPU(int particles) {
someModel(particles);
}
```
Using `__CUDACC__` it is ensured that compilation is unaffected on systems without CUDA-enabled devices. Above there are two nearly identical functions, `someModelGPU` and `someModelCPU`, which both cause `someModel` to eventually be invoked. The key difference is that a second wrapper, `modelCallKern`, exists for device compilation. It serves as the entry point to the device as it is prefixed with `KERNEL`, and is launched using CUDA notation, initiating all `modelCallKern` calls in parallel.
In summary, one of `someModelGPU` or `someModelCPU` will get invoked directly, but both end up making a call to `someModel` in their pipeline. The difference between the two is the extra layer of abstraction caused by `someModelGPU` launching a wrapper in parallel, with each parallel thread making a call to `someModel`.
### 4 Compilation
#### 4.1 CUDA Compilation for RIC
An important component of RIC is the management of file extensions for source files. Files that include CUDA code are expected to have the “.cu” file extension, which can only be compiled by `nvcc`. Supporting multiple compilation modes presents a significant problem: if host-only compilation is to be supported, all the files must have “.cc” or “.cpp” as their file extension. In doing this, `nvcc` believes all source files to be standard C++ and won’t compile for device usage. Fortunately, CUDA provides a compilation flag to get around this, `-x`, which indicates that the source file being compiled is to be treated as if it was a CUDA module and had the “.cu” file extension.
Example: A model that supports RIC exists as “someModel.cpp”. The following two lines demonstrate how to compile `someModel` if only the CPU is to be used, and how to compile if there is a CUDA-enabled device is available.
```
g++ -c someModel.cpp // Compile for standard C++
nvcc -c -x cu someModel.cpp // Compile for CUDA
```
Using this feature, existing libraries can conveniently be left in their existing cpp/cc modules. At this point, a simple makefile could be created to build a RIC-compliant application. The only additional requirements would be to have two possible targets, one for a CPU build and the other for a GPU build, where the GPU target compiles using `nvcc` in place of `gcc/g++`, and the `-x cu` flag is passed.
#### 4.2 Adding CMake Support with FindCUDA
Instead of using the same makefile and defining multiple targets for each form of compilation (CPU and GPU targets), it’s worth utilizing CMake to generate buildsystems. CMake provides full support for CUDA, in the form of the FindCUDA toolset [3]. This means almost all of the legwork with CUDA is done for us,
and only a few extras are required to get CMake to support RIC.
The first step to incorporating CUDA to a CMake file is to add the FindCUDA project with a quick find_package call. This adds in a bunch of CMake functionalities and populates variables with useful CUDA related information.
```
# CMake code
# Grab the CUDA package
find_package(CUDA)
set(GPU_ACCELERATED ${CUDA_FOUND})
```
CMake provides a useful functionality where the variable CUDA_FOUND is automatically populated with the result of attempting to find CUDA on a system. This can be used hereafter for all decision related problems in the CMakeLists file that depend on whether or not a GPU can be leveraged. FindCUDA also populates numerous other variables, which get used for other commands [4]. A great example is CUDA_NVCC_FLAGS, which can be populated with any additional flags to pass to NVCC. This means it can hold the virtual architecture parameters to compile with, and more. Another useful flag is CUDA_PROPAGATE_HOST_FLAGS, a boolean value indicating if all host compiler flags (the ones passed to C++) should also be passed to NVCC. This can cause compilation issues, so it is best to disable flag passing and exclusively indicate what flags need to be turned on for NVCC.
```
# CMake code
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -gencode
arch=compute_53,code=sm_53; -gencode arch=compute_53,code=compute_53;
-std=c++11;")
set(CUDA_PROPAGATE_HOST_FLAGS off)
```
### 4.3 Setting up a project for RIC and CMake
Some modules in a project may only be necessary for specific compilation modes (GPU or CPU). Using some FindCUDA populated flags, it is possible to optionally include user created directories as needed. A good example of this is including a random number generation model that operates in parallel on GPUs, in place of using the standard <random> library. For a typical project that has ‘inc’ and ‘src’ directories setup, it’s worth creating a new pair of directories ‘incGPU’ and ‘srcGPU’ to store all GPU-only modules.
Continuing with this example, GPU only files prng.cu and prng.h, would be stored in the GPU directories and then only included if the variable from the previous section, GPU_ACCELERATED, was defined.
```cmake
# CMake code
# Add directories
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/inc/)
if (${GPU_ACCELERATED})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/incGPU/)
endif()
# Setup environments, depending on GPU accel. status
set(SRCS src/main.cpp src/callModels.cpp)
set(INCS inc/callModels.h)
if (${GPU_ACCELERATED})
set(SRCS ${SRCS} srcGPU/prng.cu)
set(INCS ${INCS} incGPU/prng.h)
endif()
```
Another important feature described in section 5.1 was how to compile files with the ‘cpp’ extension as CUDA files in place of C++. This is accomplished using the ‘-x cu’ compilation option when generating the binary for a source file. With CMake, this option can’t be passed directly through CUDA_NVCC_FLAGS, and instead set_source_file_properties must be used. This way when compilation time comes around, the file extension is ignored and, source files such as callModels.cpp can be treated as CUDA sources.
This feature was added in CMake version 3.3.0 (2015-07-23 release) [5], so RIC requires a modern version of cmake. The additional variable, ‘GPU_SUPPORTED’ above, gets manually populated as a boolean value indicating whether or not the version of CMake used is 3.3.0 or above. This is because the ‘-x cu’ compile option to compile cpp files as cu files isn’t supported in lower versions of CMake.
The final requirement of CMake is to indicate how to actually make the executable. FindCUDA has its own version of add_executable, named cuda_add_executable. It operates in the same manner as it’s predecessor, but instead uses NVCC. Note that cuda_add_executable will still attempt to use g++ when compiling modules unless they have the CUDA_SOURCEPROPERTY indicated, which is enabled by default for '.cu' files, or enabled manually as performed in this section.
As before, the flags set to determine what target is being compiled for are used to decide if add_executable is used, or it’s CUDA equivalent. An extra line is also used to link a standard CUDA library, ‘curand’. This can also be extended to any other members of the standard library such as cudart. FindCUDA operates in an interesting manner as it verifies the existence of the CUDA standard library when find_package is initially called, but doesn’t add it to the known paths for the linker to search through. Hence, it must be manually indicated for any CUDA libraries to be linked.
5 Results
5.1 Example Software: Stock Price Model
Most of the code samples provided throughout this memorandum have been lifted from a Monte Carlo simulation involving stock prices created as a demonstration of RIC properties.
The sample code uses the Monte Carlo method to simulate stock prices over time, attempting to come up with an approximate amount of time in which a specific price boundary (upper or lower) on the stock is hit. Because this simulation uses the Monte Carlo method, it is a prime candidate for GPU acceleration by making the numerous samples in the simulation operate in parallel. Of course, this simulation might still need to support systems which do not have CUDA-enabled devices, making RIC design principles crucial.
5.2 Performance
The culmination of all previous sections is that the application has been seamlessly updated to support accelerated compilation, without abandoning architectures by introducing a new hard dependency. Testing for the stock model is conducted on an NVIDIA Jetson TX1 (Maxwell GPU with 256 CUDA cores), and a 2013 Macbook Air (Haswell i7 @ 1.7 GHz). Below are the results of running the same program on the two different systems; the former with a CUDA-enabled device, the latter without.
<table>
<thead>
<tr>
<th>Macbook Air 2013, Intel i7 1.7 GHz</th>
<th>NVIDIA Jetson TX1 (CUDA enabled)</th>
</tr>
</thead>
<tbody>
<tr>
<td>$ cd build</td>
<td>$ cd build</td>
</tr>
<tr>
<td>$ cmake ..</td>
<td>$ cmake ..</td>
</tr>
<tr>
<td>$ make</td>
<td>$ make</td>
</tr>
<tr>
<td>$ ./stockModel 32 128 1000000 1 200</td>
<td>$ ./stockModel 32 128 1000000 1 200</td>
</tr>
<tr>
<td>Calling CPU version of model!</td>
<td>Calling GPU version of model!</td>
</tr>
<tr>
<td>Mean day boundary hit: 84</td>
<td>Mean day boundary hit: 84</td>
</tr>
<tr>
<td>Duration: 8.36235</td>
<td>Duration: 0.003602</td>
</tr>
</tbody>
</table>
The most important take away from these results, aside from the clearly superior performance of a GPU accelerated program, is that the pipeline from compilation to output is the exact same. RIC has permitted seamless introduction of GPU acceleration as the 1st column, a system without a CUDA-enabled device, is still able to build and run the same application without issue.
6 Summary
Using RIC, many existing applications can easily be modified to support GPU accelerated programs, with no impact whatsoever to a standard user who doesn’t have a CUDA-enabled device to leverage. This methodology only requires a small fixed initial cost when modifying existing application and has next to no variable cost as the application is updated over time. New applications can also be created with
ease that support RIC using the toolbox described in this memorandum.
This memorandum covered a brief background on GPU acceleration, the inspiration for RIC, the toolbox that makes this design paradigm possible, and results from applying it to an existing software model.
References
3. FindCUDA Documentation
https://cmake.org/cmake/help/v3.0/module/FindCUDA.html
4. FindCUDA Flags
https://cmake.org/cmake/help/v3.0/module/FindCUDA.html
5. CMake 3.3
https://github.com/Kitware/CMake/blob/v3.3.0/Modules/FindCUDA.cmake#L1311
<table>
<thead>
<tr>
<th>1. REPORT DATE (DD-MM-YYYY)</th>
<th>01-04-2018</th>
</tr>
</thead>
<tbody>
<tr>
<td>2. REPORT TYPE</td>
<td>Technical Memorandum</td>
</tr>
<tr>
<td>3. DATES COVERED (From - To)</td>
<td></td>
</tr>
<tr>
<td>4. TITLE AND SUBTITLE</td>
<td>C++ Resource Intelligent Compilation for GPU Enabled Applications</td>
</tr>
<tr>
<td>5a. CONTRACT NUMBER</td>
<td></td>
</tr>
<tr>
<td>5b. GRANT NUMBER</td>
<td></td>
</tr>
<tr>
<td>5c. PROGRAM ELEMENT NUMBER</td>
<td></td>
</tr>
<tr>
<td>5d. PROJECT NUMBER</td>
<td></td>
</tr>
<tr>
<td>5e. TASK NUMBER</td>
<td></td>
</tr>
<tr>
<td>5f. WORK UNIT NUMBER</td>
<td></td>
</tr>
<tr>
<td>6. AUTHOR(S)</td>
<td>David J. Skudra, George E. Gorospe</td>
</tr>
<tr>
<td>7. PERFORMING ORGANIZATION NAME(S) AND ADDRESS(ES)</td>
<td>NASA Ames Research Center Moffett Field, CA</td>
</tr>
<tr>
<td>8. PERFORMING ORGANIZATION REPORT NUMBER</td>
<td></td>
</tr>
<tr>
<td>9. SPONSORING/MONITORING AGENCY NAME(S) AND ADDRESS(ES)</td>
<td>National Aeronautics and Space Administration Washington, DC 20546-0001</td>
</tr>
<tr>
<td>10. SPONSOR/MONITOR’S ACRONYM(S)</td>
<td>NASA</td>
</tr>
<tr>
<td>11. SPONSOR/MONITOR’S REPORT NUMBER(S)</td>
<td>NASA/TM–2018–219897</td>
</tr>
<tr>
<td>12. DISTRIBUTION/AVAILABILITY STATEMENT</td>
<td>Unclassified-Unlimited Subject Category 64 Availability: NASA STI Program (757) 864-9658</td>
</tr>
<tr>
<td>13. SUPPLEMENTARY NOTES</td>
<td>An electronic version can be found at <a href="http://ntrs.nasa.gov">http://ntrs.nasa.gov</a>. Point of contact: <a href="mailto:dskudra@gmail.com">dskudra@gmail.com</a> or <a href="mailto:george.e.gorospe@nasa.gov">george.e.gorospe@nasa.gov</a></td>
</tr>
<tr>
<td>15. SUBJECT TERMS</td>
<td>RIC, CUDA, C++, GPU</td>
</tr>
<tr>
<td>16. SECURITY CLASSIFICATION OF:</td>
<td></td>
</tr>
<tr>
<td>a. REPORT</td>
<td>U</td>
</tr>
<tr>
<td>19a. NAME OF RESPONSIBLE PERSON</td>
<td>STI Information Desk (<a href="mailto:help@sti.nasa.gov">help@sti.nasa.gov</a>)</td>
</tr>
<tr>
<td>19b. TELEPHONE NUMBER (Include area code)</td>
<td>(757) 864-9658</td>
</tr>
</tbody>
</table>
|
{"Source-Url": "https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/20180003378.pdf", "len_cl100k_base": 6516, "olmocr-version": "0.1.53", "pdf-total-pages": 20, "total-fallback-pages": 0, "total-input-tokens": 37246, "total-output-tokens": 7278, "length": "2e12", "weborganizer": {"__label__adult": 0.0004227161407470703, "__label__art_design": 0.0004215240478515625, "__label__crime_law": 0.0003795623779296875, "__label__education_jobs": 0.0005826950073242188, "__label__entertainment": 8.612871170043945e-05, "__label__fashion_beauty": 0.00019872188568115232, "__label__finance_business": 0.00021314620971679688, "__label__food_dining": 0.000354766845703125, "__label__games": 0.0009050369262695312, "__label__hardware": 0.004383087158203125, "__label__health": 0.0005292892456054688, "__label__history": 0.0003349781036376953, "__label__home_hobbies": 0.00012063980102539062, "__label__industrial": 0.0008001327514648438, "__label__literature": 0.0001977682113647461, "__label__politics": 0.00028824806213378906, "__label__religion": 0.0006451606750488281, "__label__science_tech": 0.1043701171875, "__label__social_life": 8.26716423034668e-05, "__label__software": 0.009613037109375, "__label__software_dev": 0.87353515625, "__label__sports_fitness": 0.0004096031188964844, "__label__transportation": 0.0008487701416015625, "__label__travel": 0.00021970272064208984}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 28716, 0.02899]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 28716, 0.56202]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 28716, 0.85768]], "google_gemma-3-12b-it_contains_pii": [[0, 252, false], [252, 2923, null], [2923, 3187, null], [3187, 3562, null], [3562, 4645, null], [4645, 7316, null], [7316, 8741, null], [8741, 10703, null], [10703, 12636, null], [12636, 14600, null], [14600, 16374, null], [16374, 19031, null], [19031, 21057, null], [21057, 22190, null], [22190, 23638, null], [23638, 26266, null], [26266, 27038, null], [27038, 28716, null], [28716, 28716, null], [28716, 28716, null]], "google_gemma-3-12b-it_is_public_document": [[0, 252, true], [252, 2923, null], [2923, 3187, null], [3187, 3562, null], [3562, 4645, null], [4645, 7316, null], [7316, 8741, null], [8741, 10703, null], [10703, 12636, null], [12636, 14600, null], [14600, 16374, null], [16374, 19031, null], [19031, 21057, null], [21057, 22190, null], [22190, 23638, null], [23638, 26266, null], [26266, 27038, null], [27038, 28716, null], [28716, 28716, null], [28716, 28716, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 28716, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 28716, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 28716, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 28716, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 28716, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 28716, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 28716, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 28716, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 28716, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 28716, null]], "pdf_page_numbers": [[0, 252, 1], [252, 2923, 2], [2923, 3187, 3], [3187, 3562, 4], [3562, 4645, 5], [4645, 7316, 6], [7316, 8741, 7], [8741, 10703, 8], [10703, 12636, 9], [12636, 14600, 10], [14600, 16374, 11], [16374, 19031, 12], [19031, 21057, 13], [21057, 22190, 14], [22190, 23638, 15], [23638, 26266, 16], [26266, 27038, 17], [27038, 28716, 18], [28716, 28716, 19], [28716, 28716, 20]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 28716, 0.12268]]}
|
olmocr_science_pdfs
|
2024-12-09
|
2024-12-09
|
973f5dbea429e4c8588042a2f3785c88cda11443
|
Merging of Use Case Models:
Semantic Foundations
Stephen Barrett, Daniel Sinnig, Patrice Chalin, Greg Butler
Faculty of Engineering and Computer Science
Concordia University, Montreal, Quebec, Canada
Email: {ste_barr, d_sinnig, chalin, gregb}@encs.concordia.ca
Abstract—Use case models are the artifact of choice for capturing functional requirements. This typically collaborative activity makes merging a necessity. Use cases however, are often neglected when it comes to model merging, since they are commonly treated as text only items. By defining a formal syntax and semantics for use case models, manipulated within a generic metamodel for operation-based merging, we show how use case models can be effectively merged. This formal foundation allows for the modeling of use cases; defining meaningful change operations on them; and for detecting modeling inconsistencies, inconformities, and conflicts. Several practical examples validate the concepts presented: existing and planned tool support is introduced.
Index Terms—Model merging, use case model, operation-based merging, inconsistency, inconformity, conflict, finite state machine, model transformation, change plane.
I. INTRODUCTION
Since their introduction by Jacobson [1] in the early 90s, creating use cases has become a key software development activity. Meanwhile, model-driven engineering (MDE) has been shifting the focus of the development process from code to models. Thus in a collaborative MDE setting, the group goal, instead of one of refining code, becomes one of moving incomplete or abstract models to more complete or concrete models. Growing evidence suggests that the adoption of use case modeling leads to significant benefits for customers and developers alike, through clearer requirements understanding, and through greater programming automation [2]–[4].
With developers making contributions in parallel models naturally diverge. It then becomes the task of model merging to bring these evolved replicas into agreement. This is a concern for all models, which to our knowledge has not been addressed for use cases in any formal way. Too often use cases are viewed as textual artifacts to be merged using traditional line-by-line approaches, or by forming the union of all contributions. By providing a formalization for use case models we are able to map them into finite state machines, and with this semantic underpinning, able to merge them under the detailed metamodel. As well as analyze them for modeling and merging errors, with in some cases, automatic resolution.
In this paper we define a semantic operation-based merge process for use case models. Section II touches on merge types and approaches before presenting our metamodel for merging, formed around model transformations. In Section III the syntactic and semantic rules and definitions for formalizing use case models as finite state machines are provided, and a sample use case mapping is presented. Using this example, Section IV demonstrates the application of our formalisms for detecting model and merge errors, while highlighting the differences between error types. Existing and planned tool support is discussed in Section V, related work in Section VI, and our conclusions and future plans in Section VII.
II. MODEL MERGING METAMODEL
A simple, intuitive, and yet mathematically founded merging metamodel is highly useful as a means of understanding model merging in general, and when coupled with the semantics of Section III, use case model merging in particular.
A. Merge Types and Approaches
The merge of two replica models (i.e., initially identical copies \(M_L\) and \(M_R\) of some source model) that have evolved from a common ancestor \(M_A\) is shown in Fig. 1, in which the diverged replicas are combined into a final merged model \(M_F\). Since three-way merging as it is known, can automatically avoid inconsistencies by rearranging changes, as well as resolve some conflicts by referencing the common source, merge tools make extensive use of it [5], as do we.
The need for merging is brought about by changes being made to an artifact’s replicas. Since it follows an operation-based merging approach, our metamodel takes these changes into account, whereas the other broad approach, state-based merging, does not [6]. By analyzing the dynamic traces of model-altering user actions gathered during replica modification, operations may be selected, interleaved, reordered, and simplified in order to create a merged trace of model changes.
Fig. 1. Merging two replicas derived from a common ancestor model.
B. The Change Plane
Each change made to a model replica potentially transforms it into a new model. In this way model changes act as atomic operations which can be treated as functions on models. Doing so allows us to use functional composition to define an endogenous transformation $T_e$ that takes as its input some initial model $M_a$ conforming to the replica’s metamodel, and produces as its output a final model $M_f$ conforming to the same: $T_e(M_a) = (T_{e_n} \circ T_{e_{n-1}} \circ \ldots \circ T_{e_1})M_a = M_f$ where $T_{e_1}$ is a subtransformation of $T_e$.
Two transformations are involved in a three-way merge: one that it is convenient to think of as taking place on the left, $T_L$ that transforms a replica of the ancestor model $M_A$ into model $M_L$; and one on the right, $T_R$ that transforms another replica into model $M_R$. The essence of merging is to blend $T_L$ and $T_R$ into one transformation that will transform $M_A$ into a final merged model $M_F$. In the absence of conflicts the transformations may be combined tip-to-tail fashion—as is done with vectors—otherwise they must be cobbled together piecemeal, subtransformation by subtransformation.
We orient the transformation grid of [7] in Fig. 2 to mimic the classic merge diamond. With model $M_A$ situated at the origin, its axes represent the left and right transformations; each made up of subtransformations (directed segments). To traverse a path from the origin to another node is to execute the sequence of elementary change operations that lie on the path, transforming $M_A$ in the process. Hence, every grid point hosts the set of models produced by all paths that reach that point. We term the resulting two-dimensional surface of model subtransformations and potential models, the change plane.
From a transformational point of view, to move forward (i.e., out from the origin) over an edge is to accept the change that the edge represents, while to avoid traversing an edge is to reject its change. The sequence of changes represented by a path of subtransformations in the plane produces a new version of the ancestor model. An inconsistency occurs if any operation in the path fails (e.g., referencing a nonexistent element). A syntactic inconformity results when an operation produces a model that is not well-formed (e.g., a nonunique ID). A semantic conflict is a contradictory pair of operations (e.g., naming the same element differently). Inconsistencies can often be avoided, and inconformities at times resolved by reordering the change sequences, while some conflicts can be eliminated by referring to the common ancestor. Conflicts that remain are resolved by arbitrarily selecting one change over the other, employing heuristics, or by appealing to the user.
C. Commutation and Conflict Resolution
Paths that respect the original ordering of their operations relative to a given change plane (that is, $T_L$ comes before $T_{L,i+1}$, even if interleaved by $T_{R,i}$), and result in a consistent model are known as weaves. A path with an operation whose specification cannot be met will fail, and thus is not a weave: The path is prevented from reaching its target node due to an inconsistency. Weaves that terminate at the same node, but produce different outcomes are in conflict: A choice as to which weave to follow must be made, generally with knowledge a tool will not possess.
Noncommutative operations across merge transformations are at the root of conflicts, because a node’s weaves differ only in the order of their subtransformations. If operations $T_1$ and $T_2$ commute globally, i.e., $T_1 \circ T_2 = T_2 \circ T_1$, then they will not conflict. Additionally, transformations that do not commute globally may commute locally when operating on mutually removed sections of a model, i.e., $(T_1 \circ T_2)M = (T_2 \circ T_1)M$, and consequently do not conflict when transforming $M$ [7]. Checking for operation commutation then is an appropriate way of determining if transformations are capable of being merged, and for isolating the causes of conflicts for purposes of deletion or modification. Similarly, inconsistencies can often take advantage of commutativity to find another path in which the circumstance that causes the inconsistency does not occur.
A node that hosts the same model for every one of its weaves is said to be single-valued. If any of the subtransformations are not at least locally commutative, then the node hosts more than one model and is said to be multiple-valued. The multiple-valued points that border the plane’s single-valued nodes is called the frontier set [7]. It represents the boundary at which conflicts occur, and at which operation-based merging cannot automatically acquire more transformations. It is clear that the further the frontier set can be pushed out from the origin, the fewer decisions the user will need to be confronted with.
Consider a simple class model consisting of classes $A$ and $B$. In part a of Fig. 3 the ancestor model is modified by the left transformation to initialize a member of $A$ and $B$ to 0, while the right transformation sets $A.x$ to 1 before deleting $B$. All of the points along the axes are single-valued since there is only
---
**Fig. 2.** Model change operations projected onto the merge change plane.
**Fig. 3.** Using operation commutation to push back the frontier set.
one path that reaches any one of them (Disallowing backward travel). Because $A.x \leftarrow 0$ and $A.x \leftarrow 1$ do not commute the two weaves that terminate at the center node produce different models, making the node multiple-valued. The two mid-border points are multiple-valued for similar reasons—modifying $B.y$ and deleting the class do not commute. Some of the paths going to the outermost node cause an inconsistency, because attempting to access $B$ after it has been deleted violates a precondition of assignment, namely that the target exist. Thus for this structuring of transformations, the frontier set consists of only those nodes that lie on the axes.
Swapping the position of the right hand subtransformations as is done in part $b$, eliminates the conflict, thereby turning two more nodes into single-valued points. The frontier set has thus been expanded slightly: Whereas the first structuring could only incorporate two changes that came from the same side (i.e., no merge), the second can incorporate one entire side and half of the other. This comes at the negligible expense of another inconsistency.
### III. USE CASE MODELING
A use case model captures the “complete” set of use cases for an application. Each use case specifies possible usage scenarios for some particular functionality offered by the system. Every use case of a model starts with a header section consisting of various properties (e.g., primary actor, goal, goal-level, etc.). The core of a use case is its **main success scenario**, which lays out the most common way for the primary actor to reach the goal when using the system. Use case **extensions** define alternative scenarios which may, or may not lead to fulfillment of the use case goal.
#### A. Syntax of a Use Case Model
Notations of varying degrees of formality have been suggested for expressing use cases. They range from purely textual constructs [2], to entirely formal specifications in Z [8], to abstract state machines [9], [10], to graph structures [11]. While modeling in prose facilitates communication among stakeholders, its informal nature is prone to ambiguities, leaving little room for tool support. In this article we adopt textual constructs [2], to entirely formal specifications in Z [8], to abstract state machines [9], [10], to graph structures [11].
We define a DSRG-style use case model (UCM) as a set of interconnected use cases, with one acting as the root. As shown in Fig. 4, a use case consists of: a property section, a main success scenario, and a set of extensions. The main success scenario, as well as each extension consists of a sequence of **use case steps**, which are one of seven different kinds: **Atomic** steps are performed either by the primary actor or the system, and contain no sub-steps; **Choice** steps provide the primary actor with a choice between several interactions, each interaction being in turn defined by a sequence of steps; **Concurrent** steps define a set of steps the primary actor may perform in any order; **Goto** steps denote jumps to other steps within the same use case; **Include** steps define the inclusion of a sub-use case; and **Success** and **Failure** denote respectively, the successful or unsuccessful termination of the use case. We note that each use case, use case step, and extension is assigned an ID for use as a reference (e.g., for Goto or Include steps).
A DSRG-style use case model is well-formed iff:
1) All use case, use case step, and extension IDs are unique.
2) For every Goto step or extension reference there exists respectively, a corresponding use case step or use case extension within the same use case.
3) Every use case in the use case model, except for the designated root, must be directly or indirectly included in the root use case.
4) For every Include step, the included sub-use case must exist, and the inclusion must not be circular.
5) The last element of every use case step sequence is either a Goto, Success, or Failure step.
Consult [12] for the full list of well-formedness rules.
The abbreviated use case of Fig. 5 captures interactions for the “Order Product” functionality of an invoicing system. The main success scenario describes the situation in which the primary actor directly accomplishes their goal of ordering a product. The reduced collection of extensions specify alternative scenarios which, in this case lead to the abandonment of the use case goal. For convenience, each use case step has been further attributed with a mnemonic label.
#### B. Formal Semantics
By establishing a formal semantics for use cases in terms of finite state machines (FSMs), we are able to define an equivalence relation for use case models with which we can determine whether two model changes are in conflict.
**Def. 1. (Finite State Machine):** A finite state machine is defined by the tuple: $M = (Q, \Sigma, \delta, q_0, F)$, where $Q$ is a finite set of states, $\Sigma$ a finite set of events, $\delta : Q \times \Sigma \rightarrow Q$ the
Use case: Order Product
Properties
Primary Actor: Customer
Goal: Primary Actor places an order for a specific product.
Goal Level: User goal
Precondition: Primary Actor is logged into the system.
Main Success Scenario
1. Primary Actor specifies desired product category. [spCA]
2. System displays products matching category criteria. [diSR]
3. Primary Actor selects a product in desired quantity. [slPQ]
4. System verifies that product is available in requested amount. [vaPQ]
5. System displays the purchase summary. [diPS]
6. Primary Actor submits payment information. [sbPI]
7. System carries out payment. [caPA]
8. System provides a confirmation number. [prCN]
Use case ends successfully.
Extensions
4a. Desired product is not available.
4a1. System informs Primary Actor of unavailability. [inPU]
Use case ends unsuccessfully.
7a. The Payment was not authorized.
7a1. System informs Primary Actor payment is not authorized. [inPD]
Use case ends unsuccessfully.
Fig. 5. “Order Product” use case at an early stage of development.
Fig. 6. Sequential composition of FSMs.
transition function, \( q_0 \) the initial state with \( q_0 \in Q \), and \( F \subseteq Q \) the set of final states. We also define the extended transition function \( \delta^* : Q \times \Sigma^* \rightarrow Q \) in the standard way as \( \delta^*(q_i, w) = Q_j \), where \( Q_j \) is the state of the FSM, having started in state \( q_i \) after accepting the sequence of events \( w \).
Def. 2. (Accepted Language of an FSM): Let \( M = (Q, \Sigma, \delta, q_0, F) \) be an FSM. We define the accepted language of \( M \) as follows: \( L(M) = \{w \in \Sigma^* \mid \delta^*(q_0, w) \in F\} \)
The semantic mapping from a DSRG-style use case model into an FSM is defined in a bottom-up manner, starting with the mapping of individual use case steps (see [12] for details). Each of the seven kinds of use case steps enumerated in Fig. 4 has its own specific mapping to an FSM. Atomic steps map to elementary FSMs consisting of only an initial state and a set of final states, connected by a transition that represents the use case step. A Choice step maps to a composite FSM consisting of the initial states of each choice’s FSM. A Concurrent step is the product machine of its constituent FSMs. Goto steps map to an FSM with a single state defined to be equivalent to the initial state of the FSM representing the target of the jump. The complement FSM of an Include step consists of two states: one identified with the initial state of the FSM of the main success scenario of the invoked sub-use case, and the other identified with all final states of the sub-use case’s FSM. For both Success and Failure, the coinciding FSMs consist of only a single final state.
Fig. 7. FSM representation of “Order Product” use case.
Now that individual use case steps can be formally represented by FSMs, we can link arbitrary sequences of steps with the sequential composition operator \((\bullet)\), as schematically portrayed in Fig. 6. The operator unifies the final state, or states of its first operand with the initial state of its second. The FSMs thus obtained—representing the use case’s main success scenario and its extensions—are then related together under a single FSM. Similarly, an entire use case model is mapped to an all-encompassing FSM that relates the individual use case FSMs via inclusion relationships, in accordance with well-formedness rule 3.
Semantic mapping of the “Order Product” use case (Fig. 5) produces the FSM depicted in Fig. 7. The resulting FSM has three final states: \( q_9 \) denoting the successful outcome of the use case (i.e., acceptance of the placed order), \( q_{10} \) denoting the unavailability of a product, and \( q_0 \) denoting that the payment was not authorized.
We now define an equivalence relation for use case models based on FSM language equivalence—since nondeterminism is not a possibility, the criterion is sufficiently strong. The relation will be used in Section IV for uncovering conflicts between model change operations. Note that the equivalence relation only considers the behavioral parts of a use case (i.e., main success scenario and extensions), and abstracts away the static property section.
Def. 3. (Equivalence Relation for Use Case Models): Let \( UCM_1 \) and \( UCM_2 \) be well formed DSRG-style use case models, and \( M_1 \) and \( M_2 \) their respective FSM representations. Then the equivalence relation \( (\equiv) \) between use case models is defined as:
\[
UCM_1 \equiv UCM_2 \iff L(M_1) = L(M_2)
\]
IV. MERGING OF USE CASE MODELS
As mentioned in the introduction, use cases are usually treated as text-only work products to be merged via line-based tools. What attention that is given to structure is usually confined to simple figures having perhaps some cumbersome linkage to text blocks. Merging is limited to visual details such as element placement, size, and labels. But as Section III makes clear, use cases are highly structured, and as such are amenable to more sophisticated techniques than line-by-line text merging [5], [13].
With an ability to map use cases into a formal domain, and a means for expressing model merging, we are now in a position to consider how the merging of use case models as they are refined over the course of a project might proceed.
A. An Example of Text Merge Shortcomings
Consider a use case consisting of only a main success scenario. Suppose modeler Left adds an extension that ends with, “Use case resumes with step 9.” Now suppose that in the same modeling cycle modeler Right inserts a step in the use case’s main scenario, say after step 2. In a modest modeling tool this has the effect of, let us assume, automatically bumping up the count of all the steps that follow, thereby breaking Left’s change.
As new functionality, both changes need to be accepted by the merger, but one is now in error. Line-based merging will not make the link between the changes explicit, and with enough changes the resulting “cognitive noise” is apt to bury the merger’s ability to divine one. By assigning the use case steps of the UCMs unique IDs in accordance with the DSRG style, the merge’s matching strategy will be able to properly relate the changes, thereby avoiding the error.
The remainder of this section details how the merging meta-model can take advantage of the formal use case semantics to detect and resolve the errors of Section II-B as encountered during a model merge session.
B. Use Case Model Change Operations
Having defined a formal structure for use case models (Section III) we are now able to identify the operations that can be executed against its elements to effect changes. Operations have different scope, ranging from those that affect only a single use case step, to those that affect an entire use case. We distinguish between three kinds of operations:
- **Addition.** Creates a new entity in the use case model with a unique ID, e.g., add a step.
- **Deletion.** Removes an entity and its identity from the use case model, e.g., delete a use case.
- **Modification.** Alters an entity while preserving its identity, e.g., modify an extension’s condition.
The granularity of the operations is in stark contrast to those that have to be defined if use cases are regarded as text-only documents (e.g., the addition or deletion of words and characters).
C. Inconsistency
On the change plane, an inconsistency is manifest when a weave contains a failing operation, preventing further progress along the path. An example of how this could come to be is when modeler Left deletes a use case step that modeler Right modifies. A merged sequence that places Left’s change first will introduce an inconsistency when executed, because it is not possible to alter a step that has been removed from the model.
Rearranging the operations of a merged sequence, or in effect, following a different path on the change plane, can often bypass an inconsistency; however, only at the expense of losing a change—in this case Right’s step modification. In truth, depending on if Left’s deletion is legitimate, it might not be an important loss. Something a tool might be able to ascertain by examining the operations that come afterwords.
D. Inconformity
Models that do not conform to the use case well-formedness rules of Section III are in violation of its syntax, and will exhibit what we have termed inconformities. A model that is not well-formed cannot be mapped into an FSM, a transformation we rely on for conflict detection between use case models.
Our merging framework does not presume completeness: in a cooperative environment it is normal for inconformities to exist temporarily in isolation. However, upon merging all inconformities must be resolved. For instance, if modeler Left inserts an Include step that depends on the existence of a sub-use case that modeler Right is supposed to supply, then both models will run afoul of well-formedness rules: rule 4 for the left model because it references a nonexistent use case, and rule 3 on the right because it contains an unreferecenced “dead” use case. Presumably, when a tool like our Syntactic Analyzer (Section V) points out these inconformities, the modelers will know that they are only temporary, to be resolved at merge time. If modeler Right for some reason fails to carry out his task, the merge will suffer from a “permanent” inconformity, thereby halting further conflict analysis which we discuss next.
E. Conflict
Consider two developers working on the “Product Unavailable” extension of Fig. 5 who make the changes underlined in Fig. 8. The left modeler qualifies the extension’s condition to make an instock product unavailable if there are too few to satisfy the order. Realizing that product unavailability is not a sufficient reason to abort the entire use case, he also replaces the extension’s termination with a jump back to the start of the use case. Making the same observations, the right modeler also alters the condition, but decides that branching back to the list of products at step 3 is best. In addition, she decides that the customer should be notified when the item becomes available, and so inserts a step into the extension to request that the external Customer Management system see to this.
Assume that the model changes are brought about by these two sequences of operations. Left: modify terminating step (~step), modify extension condition (~cond); and Right:
modify extension condition (∼cond), modify terminating step (∼step), add step 4a2 (+step). For reasons of rolling back the frontier set, we choose to distribute the operations along the axes of the change plane as shown in Fig. 9. This is possible because the operations on either side commute with all of the others on that same side.
Recall from Section II that conflicts are revealed by weaves producing different models for the same change plane node. Accordingly, for each node we attempt to construct the DSRG-style use case model of every path that terminates at that node, by executing the path’s sequence of change operations against the ancestor. Paths that fail (inconsistencies), or that produce nonwell-formed models (inconformities) are not weaves and are handled as described in the preceding subsections.
What remains are weaves that produce models which may, or may not be equivalent. Formalizing these models by mapping them to finite state machines makes it possible to test their equivalence according to Def. 3 of Section III-B. The results for the example can be seen in Fig. 9, where a conflict is signified by the presence of a solitary multiple-valued node. This node actually hosts two models: one being generated by a weave that executes all of the changes on the right before those on the left (RtL), and the other by executing the left changes then the right changes (LtR). The node’s other weaves can be ignored since they produce the same models as RtL or LtR.
The models produced by RtL and LtR are not equivalent. Though a textual comparison of the use cases might make the conflict apparent, in more involved cases this cannot be guaranteed. Mapping the UCMs to FSMs guarantees detection through equivalence checking.
A composite drawing of the two merged models as an FSM is given in Fig. 10. Here the solid lines represent elements resulting from merging together the nonconflicting operations of the change sequences. Only the jump targets of the extension terminators are in conflict: RtL returns to state $q_0$, while LtR returns to $q_2$. At this point a decision as to which change to accept must be made, either interactively with the merger, or by means of some heuristic. Maximizing single-valued nodes has resulted in a more complete merged model than if no operation rearrangement had taken place, providing a larger context on which to base merge decisions.
It must be pointed out that our Equivalence Checker is able to determine that the left and right changes affect the same elements only due to the well-formedness rule that requires unique IDs for every element. If a “Product Unavailable” extension had been newly added on each side, correspondence could not have been so easily established. Our merging meta-model uses a third dimension to address this issue of matching strategies, and we refer the reader to [6] for the details.
Another complication we wish to note is the textual conflict that arises due to both modelers changing the same extension’s condition (see Fig. 8). The three nodes adjacent to the multiple-valued node of Fig. 9 all suffer from this “conflict.” The nodes are single-valued because their generated models do not differ semantically with respect to the use case formalization structure, but only syntactically with respect to textual content. We consider this further in the conclusion.
V. TOOL SUPPORT
The formal semantic use case foundation and merging meta-model presented in the previous sections form a theoretical basis for developing sophisticated support for the merging of use cases. We envision a “Use Case Merger” as having the following components:
- Syntactic Analyzer
- Equivalence Checker
- Operation Recorder
- Sequence Merger
- Conflict Visualizer
Thus far we have completed the development of the Syntactic Analyzer and the Equivalence Checker components. The others are still in the conception or architecting stages. Each component is overviewed below.
a) Syntactic Analyzer: Given a DSRG-style use case model expressed in XML, the Syntactic Analyzer processes the input to: 1) generate a print-friendly presentation of the use case model in HTML using XSLT technology, and 2) verify that the well-formedness properties summarized in Section III-A are satisfied.
b) Equivalence Checker: Two purposes are served by the Equivalence Checker: 1) mapping a well-formed DSRG-style use case model to an FSM representation, in accordance with the semantics of Section III-B; and 2) verifying whether two FSMs accept the same language and hence should be deemed equivalent, as stated in Def. 3 of Section III-B.
The stand-alone Java implementation of the algorithm for equivalence checking is similar to that used by the CSP model-checker FDR [14]. Equivalence is proved through pairwise comparison of the events accepted by “trace equivalent” states of the base and refining FSMs [15].
c) Operation Recorder: Model change operations provide the raw material for operation-based merging. The Operation Recorder will serve to capture the user actions (as outlined in Section IV-B) taken against a DSRG-style UCM during edit sessions. Tight coupling of the recorder to a particular modeling tool is to be avoided. Adherence to standards will help with this concern—the OMG’s proposed distributed versioning model [16] for tracking model change history, and facilitating model element identity across versions holds some promise in this regard.
d) Sequence Merger: Given two DSRG-style UCMs, and the traces of operations by which they were derived from a common ancestor, the Sequence Merger will blend the traces into a single sequence of change operations. This sequence, when played against the ancestor model, will generate the merged UCM. Following the methods outlined in this paper, the Merger will rearrange operations to bypass inconsistencies, and put off conflicts as long as possible by pushing out the frontier set. Inconformities too, must be guarded against lest they be introduced by the merge. The Sequence Merger will depend on the Operations Recorder for its input of operational traces, the Equivalence Checker for conflict detection, and the Syntactic Analyzer for spotting inconformities.
This tool is likely to be built around one of the conflict detection algorithms proposed by Lippe and Oosterom [7]. We are still assessing the computational complexity involved, and looking for ways to shortcut the process. Heuristics to be employed for automatic conflict resolution will also be part of the core. Currently the architecture is taking form, and various platforms are being considered for the tool’s implementation.
e) Conflict Visualizer: The last component slated for development is the Conflict Visualizer which will be used to elicit conflict resolution decisions from the user in those cases where the heuristics of the Sequence Merger are found lacking. Since the Merger strives to maximize conflict-free merging, its use of the Visualizer will be minimized, requiring less user involvement. Still, the tool will need to present partially merged UCMs in which the conflicting sections are clearly demarcated, and in which the ramifications of merge decisions are made visible.
What form the Visualizer’s presentation will take is not known at this time. Rather than develop our own framework we would ideally like to build atop the existing visualization capabilities of a tool like IBM’s Rational Software Architect, which in turn is built on the compare and visualization capabilities of Eclipse [17].
VI. Related Work
To our knowledge, this is the first work to propose a semantic foundation for the merging of textual use case models. In traditional use case analysis a great deal of what passes for “merging” happens when bringing together inherently ambiguous natural language descriptions of use cases, scenarios, steps, and goals. This situation results from a broad spectrum of stakeholders making use of natural language during the requirements elicitation phase.
The formal syntax and semantics for use case models presented in this paper are part of a larger project involving the formalization of use case and task models [18], [19]. The definition of formal semantics for UCMs has been attempted by various researchers. Fröehlich and Link [20] present a transformation algorithm that derives a UML state chart model from a given set of textual use cases. Rui, et al. suggest a process algebraic semantics for use case models, with the overall goal of formalizing use case refactorings [21]. They represent scenarios as basic message sequence charts (MSC), partially adapted from the ITU MSC semantics [22].
Starting with use cases represented as UML sequence diagrams, Fernandes, et al. [23] demonstrate how to translate them into colored Petri net models. The translation is performed in a top down manner: first the use case model is mapped into a global Petri net containing a placeholder for each individual use case, then each placeholder is replaced by a sub-Petri net capturing the various scenarios of the use case. Probably the most comprehensive approach has been defined by Somé [24]. He proposes execution semantics for use cases by defining a set of mapping rules from well-formed use cases to basic Petri nets. Similar to our approach, a use case model is deemed well-formed if it conforms to a metamodel and satisfies a set of static well-formedness rules.
Difficulties with model merging tools are described in our evaluation of the state of the art [17]. Findings that have influenced our work here are the heavy demand for knowledgeable human input during the merge, and the level of “cognitive noise” associated with conflict presentation. Model merging has yet to be adequately defined; Brunet, et al. [25] attempt to put it on solid footing by treating a merge as an algebraic operator over models and model relationships. In [26] they describe a fully automated merge of behavioral models based on their model transition system formalism. Unlike our approach, however, it assumes that the replicas to be merged are fully compatible—conflicts, contradictions, and inconsistencies are not considered.
While reliance on unique element identifiers in the UCMs frees us from concerns over other matching strategies, it provides less flexibility when it comes to entity correspondence. More is offered by Xing and Stroulia [27] who heuristically measure name and structural-similarity in order to establish correspondence, or Kolovos, et al. [28] who furnish a general comparison language.
We make use of the work of Lippe and Oosterom [7] on operation-based merging. They describe a transformation grid in which merges of object-oriented database changes are weaves of primitive grid transformations. They relate operation commutation to conflict detection, and propose three merge algorithms. Ivkovic and Kontogiannis [29] define a graph metamodel for model synchronization which they apply to
UML class diagrams, establishing model equivalence through a set of dependency relations between model elements.
VII. CONCLUSION AND FUTURE WORK
In this paper, a merging metamodel based on model change operations has been used to develop a framework for merging use case models. We have distinguished three types of modeling and merging errors: inconsistencies, inconformities, and conflicts, which we have consolidated under one theory. A means for detecting, and in some cases, automatically resolving these errors has also been provided.
A necessary precondition for the merging of use case models is their formalization. We accomplish this by imposing a formal syntactical structure on the UCM, complete with well-formedness rules, using finite state machines to give the model a formal semantics. Finally, an equivalence operator for FSMs is defined in order to aid in the detection of conflicts in accordance with the merging metamodel. The applicability of our approach is demonstrated through an example “Order Product” use case. Our formal theory has set the stage for development of the Use Case Merger outlined in Section V.
As for future work, besides continuing with implementation of the Merger tool, we are searching for efficient ways to incorporate textual conflict detection and merging into our framework. This is so as not to miss model changes similar to those made to the extension conditions of Fig. 8. Pushing this idea further, we hope to eventually add semantics to those textual areas that represent use case state information. A prerequisite for this is the extension of the semantic model in a way that provides the means for capturing the state system (e.g., using Kripke structures [30]), and also is able to map the occurrence of events (representing use case steps) to a set of allowed system states.
REFERENCES
|
{"Source-Url": "http://www.dsinnig.com/publications/TASE2009_Barrett_et_al_cameraReady.pdf", "len_cl100k_base": 8111, "olmocr-version": "0.1.50", "pdf-total-pages": 8, "total-fallback-pages": 0, "total-input-tokens": 27534, "total-output-tokens": 10593, "length": "2e12", "weborganizer": {"__label__adult": 0.00029015541076660156, "__label__art_design": 0.00036025047302246094, "__label__crime_law": 0.00028705596923828125, "__label__education_jobs": 0.00107574462890625, "__label__entertainment": 4.89354133605957e-05, "__label__fashion_beauty": 0.00014293193817138672, "__label__finance_business": 0.0001883506774902344, "__label__food_dining": 0.00026345252990722656, "__label__games": 0.000396728515625, "__label__hardware": 0.0004181861877441406, "__label__health": 0.0003502368927001953, "__label__history": 0.0002281665802001953, "__label__home_hobbies": 8.022785186767578e-05, "__label__industrial": 0.0003025531768798828, "__label__literature": 0.00030541419982910156, "__label__politics": 0.00021827220916748047, "__label__religion": 0.0003654956817626953, "__label__science_tech": 0.0118408203125, "__label__social_life": 8.922815322875977e-05, "__label__software": 0.00588226318359375, "__label__software_dev": 0.97607421875, "__label__sports_fitness": 0.00023615360260009768, "__label__transportation": 0.0003919601440429687, "__label__travel": 0.00017821788787841797}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 44067, 0.01576]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 44067, 0.32794]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 44067, 0.90466]], "google_gemma-3-12b-it_contains_pii": [[0, 4600, false], [4600, 10003, null], [10003, 15040, null], [15040, 20176, null], [20176, 25565, null], [25565, 30183, null], [30183, 36539, null], [36539, 44067, null]], "google_gemma-3-12b-it_is_public_document": [[0, 4600, true], [4600, 10003, null], [10003, 15040, null], [15040, 20176, null], [20176, 25565, null], [25565, 30183, null], [30183, 36539, null], [36539, 44067, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 44067, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 44067, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 44067, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 44067, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 44067, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 44067, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 44067, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 44067, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 44067, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 44067, null]], "pdf_page_numbers": [[0, 4600, 1], [4600, 10003, 2], [10003, 15040, 3], [15040, 20176, 4], [20176, 25565, 5], [25565, 30183, 6], [30183, 36539, 7], [36539, 44067, 8]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 44067, 0.0]]}
|
olmocr_science_pdfs
|
2024-11-28
|
2024-11-28
|
356dfcfc0fca49e7b61afa2c200c21675561fd46
|
Binary Classification
Given training data \((x_i, y_i)\) for \(i = 1 \ldots N\), with \(x_i \in \mathbb{R}^d\) and \(y_i \in \{-1, 1\}\), learn a classifier \(f(x)\) such that
\[
\begin{align*}
f(x_i) \geq 0 & \quad y_i = +1 \\
f(x_i) < 0 & \quad y_i = -1
\end{align*}
\]
i.e. \(y_i f(x_i) > 0\) for a correct classification.
Slide from: Lecture 2: The SVM classifier
C19 Machine Learning Hilary 2013 A. Zisserman
Linear separability
- linearly separable
- Example 1
- Example 2
- not linearly separable
- Example 3
- Example 4
Slide from: Lecture 2: The SVM classifier
C19 Machine Learning Hilary 2013 A. Zisserman
Linear classifiers
A linear classifier has the form
$$f(x) = w^T x + b$$
- in 2D the discriminant is a line
- $w$ is the normal to the line, and $b$ the bias
- $w$ is known as the weight vector
What is the best $w$?
- maximum margin solution: most stable under perturbations of the inputs
Support Vector Machine
Linearly separable data
\[ f(x) = \sum_i \alpha_i y_i (x_i^T x) + b \]
where
- \( f(x) \) is the decision function.
- \( \alpha_i \) are the Lagrange multipliers.
- \( y_i \) are the class labels (1 or -1).
- \( x_i \) are the data points.
- \( x \) is the input vector.
- \( b \) is the bias term.
- \( (x_i^T x) \) is the inner product of \( x_i \) and \( x \).
The margin is defined by the distance of the support vectors to the decision boundary.
The SVM classifier maximizes the margin between the two classes.
SVM – sketch derivation
- Since $w^T x + b = 0$ and $c(w^T x + b) = 0$ define the same plane, we have the freedom to choose the normalization of $w$
- Choose normalization such that $w^T x_+ + b = +1$ and $w^T x_- + b = -1$ for the positive and negative support vectors respectively
- Then the margin is given by
$$\frac{w}{\|w\|} \cdot (x_+ - x_-) = \frac{w^T (x_+ - x_-)}{\|w\|} = \frac{2}{\|w\|}$$
Support Vector Machine
linearly separable data
Margin = \frac{2}{||w||}
\( w^T x + b = 1 \)
\( w^T x + b = 0 \)
\( w^T x + b = -1 \)
Slide from: Lecture 2: The SVM classifier
C19 Machine Learning Hilary 2013 A. Zisserman
SVM – Optimization
- Learning the SVM can be formulated as an optimization:
\[
\max \frac{2}{||w||} \quad \text{subject to} \quad \begin{cases}
w^\top x_i + b \geq 1 & \text{if } y_i = +1 \\
\leq -1 & \text{if } y_i = -1
\end{cases} \quad \text{for } i = 1 \ldots N
\]
- Or equivalently
\[
\min ||w||^2 \quad \text{subject to } y_i \left( w^\top x_i + b \right) \geq 1 \quad \text{for } i = 1 \ldots N
\]
- This is a quadratic optimization problem subject to linear constraints and there is a unique minimum.
Linear separability again: What is the best $w$?
- the points can be linearly separated but there is a very narrow margin
- but possibly the large margin solution is better, even though one constraint is violated
In general there is a trade off between the margin and the number of mistakes on the training data.
Introduce “slack” variables
\[ \xi_i \geq 0 \]
- for \( 0 < \xi \leq \frac{1}{||w||} \) point is between margin and correct side of hyperplane. This is a margin violation
- for \( \xi > \frac{1}{||w||} \) point is misclassified
\[ w^T x + b = 1 \]
\[ w^T x + b = 0 \]
\[ w^T x + b = -1 \]
“Soft” margin solution
The optimization problem becomes
\[
\min_{w \in \mathbb{R}^d, \xi_i \in \mathbb{R}^+} ||w||^2 + C \sum_{i=1}^{N} \xi_i
\]
subject to
\[
y_i \left( w^T x_i + b \right) \geq 1 - \xi_i \text{ for } i = 1 \ldots N
\]
- Every constraint can be satisfied if \( \xi_i \) is sufficiently large
- \( C \) is a **regularization** parameter:
- small \( C \) allows constraints to be easily ignored \( \rightarrow \) large margin
- large \( C \) makes constraints hard to ignore \( \rightarrow \) narrow margin
- \( C = \infty \) enforces all constraints: hard margin
- This is still a quadratic optimization problem and there is a unique minimum. Note, there is only one parameter, \( C' \).
Loss function
\[
\min_{w \in \mathbb{R}^d} \|w\|^2 + C \sum_{i}^{N} \max(0, 1 - y_i f(x_i))
\]
Points are in three categories:
1. \(y_i f(x_i) > 1\)
- Point is outside margin.
- No contribution to loss.
2. \(y_i f(x_i) = 1\)
- Point is on margin.
- No contribution to loss.
- As in hard margin case.
3. \(y_i f(x_i) < 1\)
- Point violates margin constraint.
- Contributes to loss.
SVM – review
- We have seen that for an SVM learning a linear classifier
\[ f(x) = \mathbf{w}^\top x + b \]
is formulated as solving an optimization problem over \( \mathbf{w} \):
\[
\min_{\mathbf{w} \in \mathbb{R}^d} ||\mathbf{w}||^2 + C \sum_{i} \max (0, 1 - y_i f(x_i))
\]
- This quadratic optimization problem is known as the **primal** problem.
- Instead, the SVM can be formulated to learn a linear classifier
\[ f(x) = \sum_{i}^{N} \alpha_i y_i (x_i^\top x) + b \]
by solving an optimization problem over \( \alpha_i \).
- This is know as the **dual** problem, and we will look at the advantages of this formulation.
Primal and dual formulations
$N$ is number of training points, and $d$ is dimension of feature vector $\mathbf{x}$.
**Primal problem:** for $\mathbf{w} \in \mathbb{R}^d$
$$\min_{\mathbf{w} \in \mathbb{R}^d} \|\mathbf{w}\|^2 + C \sum_{i}^{N} \max(0, 1 - y_if(x_i))$$
**Dual problem:** for $\alpha \in \mathbb{R}^N$ (stated without proof):
$$\max_{\alpha_i \geq 0} \sum_{i} \alpha_i - \frac{1}{2} \sum_{jk} \alpha_j \alpha_k y_j y_k (x_j^\top x_k) \text{ subject to } 0 \leq \alpha_i \leq C \text{ for } \forall i, \text{ and } \sum_i \alpha_i y_i = 0$$
- Need to learn $d$ parameters for primal, and $N$ for dual
- If $N << d$ then more efficient to solve for $\alpha$ than $\mathbf{w}$
- Dual form only involves $(x_j^\top x_k)$. We will return to why this is an advantage when we look at kernels.
Support Vector Machine
\[ f(x) = \sum_i \alpha_i y_i (x_i^\top x) + b \]
\[ w^\top x + b = 0 \]
Dual Classifier in transformed feature space
Classifier:
\[ f(x) = \sum_{i}^{N} \alpha_i y_i x_i^\top x + b \]
\[ \rightarrow f(x) = \sum_{i}^{N} \alpha_i y_i \Phi(x_i)^\top \Phi(x) + b \]
Learning:
\[ \max_{\alpha_i \geq 0} \sum_{i} \alpha_i - \frac{1}{2} \sum_{jk} \alpha_j \alpha_k y_j y_k x_j^\top x_k \]
\[ \rightarrow \max_{\alpha_i \geq 0} \sum_{i} \alpha_i - \frac{1}{2} \sum_{jk} \alpha_j \alpha_k y_j y_k \Phi(x_j)^\top \Phi(x_k) \]
subject to
\[ 0 \leq \alpha_i \leq C \text{ for } \forall i, \text{ and } \sum_{i} |\alpha_i y_i| = 0 \]
Dual Classifier in transformed feature space
- Note, that $\Phi(x)$ only occurs in pairs $\Phi(x_j)^T \Phi(x_i)$
- Once the scalar products are computed, only the $N$ dimensional vector $\alpha$ needs to be learnt; it is not necessary to learn in the $D$ dimensional space, as it is for the primal
- Write $k(x_j, x_i) = \Phi(x_j)^T \Phi(x_i)$. This is known as a Kernel
Classifier:
$$f(x) = \sum_{i}^{N} \alpha_i y_i k(x_i, x) + b$$
Learning:
$$\max_{\alpha_i \geq 0} \sum_{i} \alpha_i - \frac{1}{2} \sum_{jk} \alpha_j \alpha_k y_j y_k k(x_j, x_k)$$
subject to
$$0 \leq \alpha_i \leq C$$ for $\forall i$, and $\sum_{i} \alpha_i y_i = 0$
Special transformations
\[ \Phi: \begin{pmatrix} x_1 \\ x_2 \end{pmatrix} \rightarrow \begin{pmatrix} x_1^2 \\ x_2^2 \\ \sqrt{2}x_1x_2 \end{pmatrix} \quad \mathbb{R}^2 \rightarrow \mathbb{R}^3 \]
\[ \Phi(x)^\top \Phi(z) = (x_1, x_2, \sqrt{2}x_1x_2) \begin{pmatrix} z_1^2 \\ z_2^2 \\ \sqrt{2}z_1z_2 \end{pmatrix} \]
\[ = x_1^2z_1^2 + x_2^2z_2^2 + 2x_1x_2z_1z_2 \]
\[ = (x_1z_1 + x_2z_2)^2 \]
\[ = (x^\top z)^2 \]
Kernel Trick
- Classifier can be learnt and applied without explicitly computing \( \Phi(x) \)
- All that is required is the kernel \( k(x, z) = (x^\top z)^2 \)
- Complexity of learning depends on \( N \) (typically it is \( O(N^3) \)) not on \( D \)
Example kernels
- **Linear kernels** $k(x, x') = x^\top x'$
- **Polynomial kernels** $k(x, x') = (1 + x^\top x')^d$ for any $d > 0$
- Contains all polynomials terms up to degree $d$
- **Gaussian kernels** $k(x, x') = \exp \left(-\|x - x'\|^2 / 2\sigma^2 \right)$ for $\sigma > 0$
- Infinite dimensional feature space
LIBSVM FOR MATLAB
LibSVM
• **LIBSVM** is an integrated software for support vector classification, (C-SVC, nu-SVC), regression (epsilon-SVR, nu-SVR) and distribution estimation (one-class SVM). It supports multi-class classification.
• [Python](https://www.python.org), [R](https://www.r-project.org), [MATLAB](https://www.mathworks.com), [Perl](https://www.perl.org), [Ruby](https://www.ruby-lang.org), [Weka](https://www.cs.waikato.ac.nz/ml/weka), [Common LISP](https://www.lispworks.com), [CLISP](https://www.clisp.org), [Haskell](https://hackage.haskell.org), [OCaml](https://ocaml.org), [LabVIEW](https://www.labview.com), and [PHP](https://www.php.net) interfaces. [C# .NET](https://www.microsoft.com/en-us/net) code and [CUDA](https://www.nvidia.com/en-gb/cuda/) extension is available.
LibSVM installation
• Download from: http://www.csie.ntu.edu.tw/~cjlin/libsvm/
• Un-compress the folder
• Go to MATLAB subfolder
• Compile using make command (Apply for Linux and Mac users; Windows binaries are already built in windows folder)
• Copy binaries in the work directory
The magic commands (svmtrain, svmpredict)
```matlab
model = svmtrain(training_label_vector, training_instance_matrix [, 'libsvm_options']);
- training_label_vector:
An m by 1 vector of training labels (type must be double).
- training_instance_matrix:
An m by n matrix of m training instances with n features.
It can be dense or sparse (type must be double).
- libsvm_options:
A string of training options in the same format as that of LIBSVM.
[predicted_label, accuracy, decision_values/prob_estimates] = svmpredict(testing_label_vector, testing_instance_matrix, model [, 'libsvm_options']);
- testing_label_vector:
An m by 1 vector of prediction labels. If labels of test
data are unknown, simply use any random values. (type must be double)
- testing_instance_matrix:
An m by n matrix of m testing instances with n features.
It can be dense or sparse. (type must be double)
- model:
The output of svmtrain.
- libsvm_options:
A string of testing options in the same format as that of LIBSVM.
```
LibSVM options (svm-train)
options:
- `svm_type`: set type of SVM (default 0)
- 0 -- C-SVC (multi-class classification)
- 1 -- nu-SVC (multi-class classification)
- 2 -- one-class SVM
- 3 -- epsilon-SVR (regression)
- 4 -- nu-SVR (regression)
- `kernel_type`: set type of kernel function (default 2)
- 0 -- linear: u'*v
- 1 -- polynomial: (gamma*u'*v + coef0)^degree
- 2 -- radial basis function: exp(-gamma*|u-v|^2)
- 3 -- sigmoid: tanh(gamma*u'*v + coef0)
- 4 -- precomputed kernel (kernel values in training_set_file)
- `degree`: set degree in kernel function (default 3)
- `gamma`: set gamma in kernel function (default 1/num_features)
- `coef0`: set coef0 in kernel function (default 0)
- `cost`: set the parameter C of C-SVC, epsilon-SVR, and nu-SVR (default 1)
- `nu`: set the parameter nu of nu-SVC, one-class SVM, and nu-SVR (default 0.5)
- `epsilon`: set the epsilon in loss function of epsilon-SVR (default 0.1)
- `cache_size`: set cache memory size in MB (default 100)
- `epsilon`: set tolerance of termination criterion (default 0.001)
- `shrinking`: whether to use the shrinking heuristics (default 1)
- `probability_estimates`: whether to train a SVC or SVR model for probability estimates, 0 or 1 (default 0)
- `weight`: set the parameter C of class i to weight*C, for C-SVC (default 1)
- `n`: n-fold cross validation mode
- `quiet`: quiet mode (no outputs)
The k in the -g option means the number of attributes in the input data.
option -v randomly splits the data into n parts and calculates cross validation accuracy/mean squared error on them.
LibSVM options (svm-predict)
'svm-predict' Usage
Usage: svm-predict [options] test_file model_file output_file
options:
-b probability_estimates: whether to predict probability estimates, 0 or 1 (default 0); for one-class SVM only 0 is supported
model_file is the model file generated by svm-train.
test_file is the test data you want to predict.
svm-predict will produce output in the output_file.
Example 1. Linear SVM
% read the data set
[heart_scale_label, heart_scale_inst] = libsvmread(fullfile(dirData,'heart_scale'));
[N D] = size(heart_scale_inst);
% Determine the train and test index
trainIndex = zeros(N,1); trainIndex(1:200) = 1;
testIndex = zeros(N,1); testIndex(201:N) = 1;
trainData = heart_scale_inst(trainIndex==1,:);
trainLabel = heart_scale_label(trainIndex==1,:);
testData = heart_scale_inst(testIndex==1,:);
testLabel = heart_scale_label(testIndex==1,:);
% Train the SVM
model = svmtrain(trainLabel, trainData, '-c 1 -g 0.07 -b 1');
% Use the SVM model to classify the data
[predict_label, accuracy, prob_values] = svmpredict(testLabel, testData, model, '-b 1');
Example 2. Multi-Class SVM
% Train the SVM in one-vs-rest (OVR) mode
model = svmtrain(trainLabel, trainData, '-s 0 -t 2 -c 1.5 -h 1 -b 1');
% Classify samples using OVR model
[predict_label, accuracy, prob_values] = svmpredict(testLabel, testData, model, '-b 1')
fprintf('Accuracy = %g%%\n', accuracy * 100);
|
{"Source-Url": "http://www.cs.ucf.edu/~gvaca/REU2013/p3_SVM.pdf", "len_cl100k_base": 4355, "olmocr-version": "0.1.53", "pdf-total-pages": 28, "total-fallback-pages": 0, "total-input-tokens": 33316, "total-output-tokens": 5609, "length": "2e12", "weborganizer": {"__label__adult": 0.0003018379211425781, "__label__art_design": 0.0005669593811035156, "__label__crime_law": 0.00043845176696777344, "__label__education_jobs": 0.0031890869140625, "__label__entertainment": 9.608268737792967e-05, "__label__fashion_beauty": 0.00019180774688720703, "__label__finance_business": 0.0003349781036376953, "__label__food_dining": 0.0004580020904541016, "__label__games": 0.0006761550903320312, "__label__hardware": 0.0017185211181640625, "__label__health": 0.0010623931884765625, "__label__history": 0.00024890899658203125, "__label__home_hobbies": 0.0002048015594482422, "__label__industrial": 0.0006480216979980469, "__label__literature": 0.0001964569091796875, "__label__politics": 0.0003101825714111328, "__label__religion": 0.0004973411560058594, "__label__science_tech": 0.16943359375, "__label__social_life": 0.00017535686492919922, "__label__software": 0.03802490234375, "__label__software_dev": 0.7802734375, "__label__sports_fitness": 0.0004353523254394531, "__label__transportation": 0.00040531158447265625, "__label__travel": 0.0002510547637939453}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 13253, 0.01756]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 13253, 0.72096]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 13253, 0.67197]], "google_gemma-3-12b-it_contains_pii": [[0, 0, null], [0, 426, false], [426, 639, null], [639, 836, null], [836, 932, null], [932, 1477, null], [1477, 1882, null], [1882, 2107, null], [2107, 2639, null], [2639, 2955, null], [2955, 3247, null], [3247, 3962, null], [3962, 4369, null], [4369, 5009, null], [5009, 5813, null], [5813, 5911, null], [5911, 6467, null], [6467, 7114, null], [7114, 7784, null], [7784, 8106, null], [8106, 8124, null], [8124, 8902, null], [8902, 9185, null], [9185, 10207, null], [10207, 11853, null], [11853, 12255, null], [12255, 12944, null], [12944, 13253, null]], "google_gemma-3-12b-it_is_public_document": [[0, 0, null], [0, 426, true], [426, 639, null], [639, 836, null], [836, 932, null], [932, 1477, null], [1477, 1882, null], [1882, 2107, null], [2107, 2639, null], [2639, 2955, null], [2955, 3247, null], [3247, 3962, null], [3962, 4369, null], [4369, 5009, null], [5009, 5813, null], [5813, 5911, null], [5911, 6467, null], [6467, 7114, null], [7114, 7784, null], [7784, 8106, null], [8106, 8124, null], [8124, 8902, null], [8902, 9185, null], [9185, 10207, null], [10207, 11853, null], [11853, 12255, null], [12255, 12944, null], [12944, 13253, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 13253, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, true], [5000, 13253, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 13253, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 13253, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 13253, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 13253, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 13253, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 13253, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 13253, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 13253, null]], "pdf_page_numbers": [[0, 0, 1], [0, 426, 2], [426, 639, 3], [639, 836, 4], [836, 932, 5], [932, 1477, 6], [1477, 1882, 7], [1882, 2107, 8], [2107, 2639, 9], [2639, 2955, 10], [2955, 3247, 11], [3247, 3962, 12], [3962, 4369, 13], [4369, 5009, 14], [5009, 5813, 15], [5813, 5911, 16], [5911, 6467, 17], [6467, 7114, 18], [7114, 7784, 19], [7784, 8106, 20], [8106, 8124, 21], [8124, 8902, 22], [8902, 9185, 23], [9185, 10207, 24], [10207, 11853, 25], [11853, 12255, 26], [12255, 12944, 27], [12944, 13253, 28]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 13253, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-07
|
2024-12-07
|
c23c404ec452131b0e8ad20d7743de46834396d4
|
Designing Hypertext and the Web with the Heart and the Mind
Yin Leng Theng
Nanyang Technological University, Singapore
ABSTRACT
This chapter reviews continuing usability problems with hypertext and Web applications and highlights new issues, in particular, cultural and ethical, brought about due to internationalisation. It argues for a move away from treatment to prevention, from treating the end-user’s symptoms — themselves a reaction to bad design — to avoiding the bad design. Therefore, the way hypertexts and the Web are designed and built needs to be re-examined. It suggests that new approaches to Web modelling are required to address usability issues that might be due to human errors or design problems. This chapter concludes by suggesting several practical and theoretical contributions to address the deficiencies in current hypertext and Web design.
This chapter appears in the book, Information Modeling for Internet Applications, edited by Patrick van Bommel. Copyright © 2003, Idea Group Inc. Copying or distributing in print or electronic forms without written permission of Idea Group Inc. is prohibited.
BRIEF HISTORY OF HYPERTEXT AND THE WEB
When Vannevar Bush (1945) envisioned his hypertext “memex,” he dreamed of a personal microfiche-based system that would help him tackle the problem of information overload at that time. His vision of the “memex” heralded the beginning of a search for a system that mimics the human mind to access information quickly and intuitively by reference. In 1965, Ted Nelson (1987) coined the term “hypertext” and presented it as a radical new way of structuring textual information into nonsequential format, a computer-based incarnation of Bush’s dream “memex” (Berk & Devlin, 1991). Even though the technology in the “early” years of the hypertext history (for example, Conklin, 1987; Nielsen, 1995; etc.) was not sophisticated enough for many of the ideas to be realised, hypertext pioneers staunchly believed that hypertext technology had something special to offer. The hypertext systems that have evolved over the past five decades give us some clues on the different perspectives taken by hypertext authors with regard to what they think hypertext is, what hypertext could be used for, and the then available technology that supported its implementation (Theng, 1997).
Not surprisingly, as the years roll by, hypertext systems grow more sophisticated and computer is the technology that has enabled the concept of hypertext to be seen and not just heard. For example, computers have greater processing power than before to adequately support complex hypertext systems running into thousands of nodes. Technological advancements in hardware, etc., enable high-resolution screens to be produced, thus make reading easier and more pleasant than earlier character-based ones.
The growing popularity of the Internet and advancements in networking saw the birth of networked hypertext systems, such as the Web. The Web project initiated in 1990 was originally created as an online information tool for high-energy physics research at CERN (the European Center for Nuclear Physics Research in Geneva, Switzerland). Tim Berners-Lee and colleagues, the originators of the Web, built it based on the hypertext paradigm. Information is organised as a series of documents referring to each other with links of search and retrieval of text, images, sound and video. Link in a document may go to other server machines containing the actual information. Based on its likeness to a spider’s web, this world of hypertext links is also called the Web.
Although the Web was first made available in 1991, it was only after the release of Mosaic by the National Center for Supercomputing Applications (NCSA) in January 1993 that it really gained prominence. Mosaic, NCSA’s
Web client, made the Web accessible to a wide and diverse user community because of its easy-to-use, graphical interface. Mosaic and the Web succeeded in establishing a universal hypertext. With the release of Netscape Navigator in 1994 by a commercial company co-founded by the original author of Mosaic, the number of end-users on the Internet escalated to a phenomenal figure. Today, the Web is used by millions across the world. It has changed the Internet to the extent that it has become almost synonymous with the modern use of the Internet.
CONTINUING USABILITY PROBLEMS WITH HYPERTEXT AND THE WEB
Organisational principles for writing books took centuries to develop (Thimbleby, 1992), and we take for granted many organisational structures in books, like page numbers and alphabetical orders in reference books. Yet, writing a good book is difficult. Creating good hypertext is even more difficult. In hypertext systems, we are provided with a powerful and flexible mechanism to browse non-sequentially via a network of richly connected nodes and links, and extract only that part of information relevant to us. Hypertext authors are faced with a vast range of potential structures and an astronomically large number of choices when creating a hypertext document (Thimbleby, 1995). The central organising principles in books cannot be used in hypertext, otherwise we end up with an electronic, conventional book. How can we find better organisational principles for hypertext?
With the exponential growth of the Web in 1994 and 1995, the problem of finding resources on the Internet became particularly acute, and this is made even worse by the Web’s reliance on hypertext links, and its lack of metasearch facilities (Maurer, 1996). As the use of the Internet and the Web grows, scalability not only refers to the handling of the increased number of servers, but also of handling many and large applications with more and more people using them.
Much work has been done to address problems on the Web. Some solutions are aimed at helping hypertext and Web end-users, others are aimed at helping hypertext and Web designers (Theng, 1998).
Although much effort has been invested to address problems faced by end-users in using hypertext systems or the Web, we are still not producing better, usable hypertext and Web applications.
The question we want to ask is:
Could it be possible that these well-intentioned efforts are not achieving their aims because wrong or inappropriate solutions are being sought based on incorrect or incomplete assumptions?
If it is a psychological problem, then it may be entirely due to end-users’ inability to exploit computer screens, complex information structures, and that nothing in the design is going to ameliorate this. Thus, as a psychological problem, it can be alleviated but not solved by better design.
If, it is an engineering problem, it can be attributable to bad systems design, and poor design causes psychological problems. The “blame,” therefore, should not rest on end-users alone. Design failures could be prevented if designers were to take explicit consideration of human producing characteristics in the context of the task, a view taken in Cognitive Engineering (Roth, Patterson, & Mumaw, 2001).
The next section explores solutions sought based on assumed end-users’ supposed failings, and examines factors that might have contributed to poorly designed systems.
Since the same usability issues arise in multimedia, hypermedia and the World Wide Web, we will call them all “hypertext/Web” for conciseness.
User Problem
Most solutions addressing problems in hypertext and the Web assume end-users’ supposed failings. Not surprisingly, therefore, many research solutions involve the use of graphical browsers and query/search mechanisms. They seem to make the following assumptions in the context of human-machine environments:
- End-users have a wrong or incomplete conceptual model of how information is structured and linked within the hypertext (Elm & Woods, 1985).
- End-users experience “lack of closure” because they are not able to tell the extent of a network or what proportion of relevant items remains to be seen (Shneiderman & Kearsley, 1989).
- End-users face the “embedded digression problem” where they lose track of digression, because they are distracted from the main tasks by lots of interesting information (Foss, 1989).
- End-users generally lack the experience in using hypertext for learning, and this makes it difficult for them to remember, consolidate and understand the semantic content of nodes, resulting in a lack of detailed memory of any particular item and an inability to summarise what has been covered (Foss, 1989).
Design Problem
Though failings can arise in conceptual space (within the end-user’s mind), which most research findings support, this chapter argues that the “blame” should not rest on end-users alone. It may be an engineering problem, implying that problems faced by end-users could perhaps be attributable to bad system design, and poor design causes psychological problems too (Theng, 1997).
Many hypertexts are, however, poorly designed and built in terms of how information is structured and displayed. When Brown (1990) conducted an assessment on the quality of hypertexts designed by 70 student authors, some prevalent faults identified were poor design of the visual appearance of material, overuse of technology with lots of clever effects but no attempt made to redesign for the new medium, and lack of a coherent overall structure and presentation style.
Nielsen (1996) listed the top ten mistakes in Web design, and these include the use of the following: (1) frames; (2) bleeding edge technology; (3) scrolling text, marquees, constantly running animations; (4) complex URLs; (5) orphan pages; (6) long scrolling pages; (7) lack of navigation support; (8) non-standard link colours; (9) out-dated information, and (10) overly long download times. When Nielsen (1999) revisited these mistakes three years later, he concluded that all the ten mistakes are still mistakes in 1999. Apart from scrolling long pages which is causing fewer navigation problems, the other nine
mistakes still cause significant usability problems and should be avoided in modern Web sites.
A survey of current work (e.g., Wu et al., 2001; Park, 1998; Li et al., 1998; Jones et al., 1998; Perkowitz & Etzioni, 1998; etc.) presented at recent Hypertext/Hypermedia and World Wide Web conference publications seem to suggest that hypertext/Web applications still have one or more of the following problems: (a) structured search for documents is not sufficiently supported; (b) proving properties of Web sites is difficult or impossible; (c) maintenance is not supported by formal mechanisms; and (d) personalising of information, or adaptation to user groups, is difficult or impossible.
**NEW USABILITY PROBLEMS SURROUNDING HYPERTEXT AND WEB APPLICATIONS**
The world is becoming a global marketplace with end-users from across the world. However, according to Galdo and Nielsen (1996), this heightened interest in internationalisation and localisation has not yet been translated into increased usability for international end-users. “International end-users” refer to end-users from countries other than the one where the product was designed (Galdo & Nielsen, 1996).
**Coping with Internationalisation**
The revolutionary nature and global character of digital technology has generated a new lifestyle, new standards of human behaviour, new values, giving rise to a new culture/civilisation (Gorniak-Kocikowska, 2001). Globalisation brings with it new issues relating to culture and ethics. With respect to design, standard HCI guidelines may not be adequate. They may need to be modified, extended, or restricted.
To address the problem of producing international user interfaces, Galdo and Nielsen (1996) propose work at three levels: (1) processing and displaying the user’s native language, character set, notations and formats; (2) producing a user interface and user information that is understandable and usable in user’s native language; and (3) producing systems that will accommodate end-users’ cultural characteristics.
**Culture and Design**
Two pilot studies were carried out at Middlesex University to highlight the need to address cultural issues in the design of interactive applications. Culture
is defined as “learned behaviour consisting of thoughts and feelings” (Galdo & Nielsen, 1996).
The first pilot study was carried out to evaluate the usability of digital libraries (Theng et al., 1999). Although there is no general consensus to the definition of digital libraries, they are generally regarded as interactive applications with subject-focussed collections and more powerful search engines. In this study, ten computing staff and students were selected to evaluate three sample digital libraries: the Networked Computer Science Technical Reference Library (NCSTRL), the New Zealand Digital Library (NZDL) and the ACM Digital Library (ACMDL). These three digital libraries were chosen because they are available to the general public and are some of the better examples of digital libraries found on the Web in terms of information and coverage.
The findings suggest that there is little provision on the interface to cater to end-users’ browsing and intercultural needs. Lack of consideration for end-users’ browsing needs ranges from 30% (ACMDL) to 80% (NZDL). The subjects also indicated that the digital libraries have not taken cultural needs into consideration, ranging from 30% (NZDL) to 90% (NCSTRL and ACMDL).
One reason for the neglect of cultural aspects as indicated in our study may be that usability failure is rather commonplace, and cultural usability issues are hard to recognise as such, more so since designers cannot help but see the world from their particular cultural point of view. Designers also typically invest a lot of effort getting systems to work at all, and may be defensive about their work. This usually bolsters another cultural barrier, one between professional designers and computer illiterate users or what system designers perceive as such. Thus, cultural usability issues for system designers may come disguised as illiteracy problems or simply as “user faults,” rather than as cultural differences. This pilot study seems to suggest that the state-of-the-art digital library interfaces are not yet prepared to fully meet the culturally specific needs of their international users.
In another pilot study conducted by Duncker et al. (1999, 2000), a class of 60 second-year undergraduates from various cultural backgrounds took part in the experiment. About one quarter of the class were British English, while three-quarters of the students came from 13 countries distributed over several continents. The participants were also part of many different subcultures of Greater London. One interesting finding that came out of this pilot study is that students with different cultural backgrounds have different colour preferences. British English students preferred pastel colours with a lot of grey and low contrast. Scandinavian students tended to like dark colours with low contrast, whereas students with a Jamaican background preferred strong and
bright colours with high contrasts. African students usually chose black background with bright foreground objects. American students chose a bright background, black text and moderately colourful objects. Asian students did not have a particular preference for colours.
Apart from colours, cultural factors that can influence the design of interactive interfaces for international end-users include the following: spoken and written languages; the reading/writing direction; meanings and preferences of colours; interpretations of signs, pictures, symbols used; etc. (Galdo & Nielsen, 1996).
As current hypertext and Web applications become more complex, the facilities provided by them will increase, and the difficulty of learning associated with the complexity of using these facilities will also increase. In order to produce usable and useful interactive systems, designers need to ensure that good design features are incorporated into the systems, taking into consideration end-users’ cultural preferences.
**Ethics and Design**
This section discusses how an understanding of ethics would encourage more responsible, usable, and useful systems.
According to the Oxford Dictionary, ethics is the “study of right and wrong in human behaviour.” The notion of the code of ethics and professional conduct is not new. The general moral imperatives in the ACM code of Ethics and Professional Conduct (adopted by ACM Council 16/10/1992) include one’s contribution to society and human well-being, avoidance of harm to others, honesty and trustworthiness, fairness and non-discriminate actions, respect for property rights, privacy, and confidentiality. A specific professional responsibility in ACM Code of Ethics is to “give comprehensive and thorough evaluations of computer systems and their impacts, including analysis of possible risks.” “Ensuring that users have their needs clearly articulated during assessment and design of requirements” is one of the organisational leadership moral imperatives.
The Internet is a global network of computers speaking the same language that makes use of the same protocols to send and receive information (Gringras, 1997). Many applications have sprung up over the years to encourage human–human communication. For example, e-mails, teleconferencing, voicemail, bulletin boards, conferences, usenet groups, ftp, gopher, the Web, and digital libraries. Apart from ensuring that the technical aspects of the Internet are taken care of, designers need also to consider the ethical and legal issues that may arise owing to the increase in the use of computer-mediated communication.
Some pressing questions of concern include the following (see Table 1).
*These questions present many areas considered good and acting for the good toward users, supporting a central focus in user-centred design.*
In recent years, Cyberethics, a growing area of research, explores the application of classical ethics to the latest information communication technologies, including the Internet. The fundamental principles of Cyberethics are privacy, property, access, and accuracy (Barroso, 2001). They imply a new set of responsibilities for professionals and users of the Internet, and have implications for the design of safe, usable, and useful systems.
Duquenoy and Thimbleby (1999) explore the idea of justice to aid improved design. John Rawls’ classic “A Theory of Justice” is used to explain why design needs to consider these two principles: liberty and equality (Rawls, 1972). Applying the Principle of Liberty, designers should ask themselves whether their designs persecute, discriminate, and oppress users (Duquenoy & Thimbleby, 1999). The Principle of Equality advocates that design should address issues of equal access/opportunity use. But there are difficulties taking Rawls seriously. For example, could designers imagine all possible users so they designed under an unbiased veil of ignorance, providing equal access/opportunity use?
**Table 1: Some Pressing Ethical Questions of Concern**
<table>
<thead>
<tr>
<th>Question</th>
</tr>
</thead>
<tbody>
<tr>
<td>Who is morally responsible if the information is poorly designed?</td>
</tr>
<tr>
<td>Who owns the copyrights of program codes/text/graphics & images?</td>
</tr>
<tr>
<td>Who is responsible for the outcome of the information system?</td>
</tr>
<tr>
<td>Who can make use of database of data?</td>
</tr>
<tr>
<td>Who is responsible for ensuring that the end-users with special needs are</td>
</tr>
<tr>
<td>considered?</td>
</tr>
<tr>
<td>What are the requirements for a binding contract to be made over the</td>
</tr>
<tr>
<td>Internet?</td>
</tr>
<tr>
<td>How may someone be liable for damage caused from accidentally spreading</td>
</tr>
<tr>
<td>a computer virus?</td>
</tr>
<tr>
<td>What is the level of copyright protection for works on the Internet?</td>
</tr>
<tr>
<td>When does one commit the computer misuse crime of unauthorised access</td>
</tr>
<tr>
<td>using the Internet?</td>
</tr>
<tr>
<td>With the Internet lacking security, what are the principles for adequate</td>
</tr>
<tr>
<td>data security over the Internet?</td>
</tr>
<tr>
<td>How do business rules apply to the Internet? Who are the regulators and</td>
</tr>
<tr>
<td>what activities do they regulate?</td>
</tr>
</tbody>
</table>
devices (Gringras, 1997).
NEW APPROACHES TO HYPERTEXT AND WEB DESIGN
Brown (1990) argues that “although getting lost is often claimed to be a great problem, the evidence is largely circumstantial and conflicting. In smallish applications, it is not a major problem at all.” Brown’s remark raises an important issue: when we speak of documents being so small that end-users cannot get “lost” in them or so large that navigation aids are required to use them effectively, the implication is that information occupies “space” through which end-users “travel” or “move” (McKnight, Dillon, & Richardson, 1991).
Hypertext provides more locations in which to store information and more dimensions in which to travel compared with traditional linear text. There is thus greater potential for becoming disoriented using hypertext. When examining a book, readers can look for orientation cues in the form of overviews, summaries, contents-pages, etc. However, if these cues are not present in hypertext, as in most cases, end-users may lose track of the context through an external interruption or in the course of pursuing momentarily interesting links which prove to be dead ends (Bernstein, 1988).
Regardless of the putative constraints of hypertext and Web applications, it seems certain that end-users possess some knowledge that provides information on the probable structure and organisation of the elements in hypertext and Web applications. End-users build models of how the hypertext is organised, and they use these “mental models” in their interactions, for example, to set up expectations or to guide. To proceed in their interactions with hypertexts and the Web, end-users expect it to give them cues, otherwise they will need to rely on their prior experiences with hypertexts and computer systems. This in itself is not bad. However, there are occasions when end-users’ prior experiences interfere with their understanding and interactions with the current hypertext and the Web they are navigating.
Need for a Cognitive Engineering Approach
But, designing good, usable interfaces is not an easy task. Dix et al. (1993) argue that even if one has used the best methodology and model in the design of a usable interactive system, one still needs to assess the design and test the system to ensure that it behaves as expected and meets end-users’ requirements. Landauer (1995) points out that it is impossible to design an optimal user interface in the first try. If information access systems are to provide good, usable interfaces, designers must conduct some form of testing on the interface. However, without knowing where in a system users run into problems, one has little hope of improving the system.
We need to take explicit consideration of characteristics of the users and the domain tasks that they will be performing to prevent design failures (Roth, Patterson, & Mumaw, 2001). Past solutions to address hypertext problems failed to take into consideration the context of use of the systems. It is equally important to understand that surrounding circumstances could also affect end-users’ course of action, thus the perceived usability of the systems, a phenomenon highlighted by Suchman (1987) in her work on situated actions.
New approaches to hypertext/Web modelling are required. Discussions of improved design should be situated within the context of a cognitive system, which is composed of human and machine agents in a work domain that is delineated by roles, work and communication norms, artefacts, and procedures.
We also propose a shift in mindset to embrace a conscientious attempt designing with the heart to put end-users at the centre of design incorporating new issues arising from cultural and ethical perspectives as well as an engineering approach involving the mind working with end-users.
**Designing with the Heart**
Designers need to provide efficient ways to structure information and represent them digitally using computers. To design good, usable hypertext and Web documents, one requires knowledge about who will use them, what they will be used for, the work context and the environment in which they will be used, and what is technically and logistically feasible.
Although information in hypertext and Web applications is supposed to be available globally, its design, content provision, and use have remained local. This cultural diversity raises a number of questions regarding the cross-cultural usability of hypertext and Web applications. This complexity is further compounded by the fact that designers, content providers, and users can have different cultural backgrounds.
To provide multicultural interfaces to hypertext and Web applications, we envisage the development of “boundary objects” between different cultures accessing shared information resources. “Boundary objects,” from a social science perspective, are used by different communities without presupposing a fully shared definition of an object. They are flexible enough, such that each community can read a specific meaning from a boundary object sufficient to its needs. Simultaneously, they are “robust enough to maintain a common identity across sites” (Star & Griesemier, 1989). As such, they enable collaboration and communication across cultural boundaries on equal terms, for example, without recourse to a single-sided dominant mode of symbolisation.
To achieve the emergence of intercultural boundary objects in hypertext and Web applications, cooperative and communicative features need to be introduced that allow negotiation and articulation across sites. We offer some ideas for implementation of boundary objects in three areas to create culturally sensitive user interfaces:
- **Creation of boundary objects as part of the hypertext and Web interface**: Actually, a hypertext and Web application system with perfectly localised interfaces could function as a joint composite boundary object. However, small boundary objects and shared resources could start off a process of mutual cultural education between users, designers, and content providers. The introduction of asynchronous message systems, repositories, and frequently asked questions (FAQs) could serve such a function, because it allows users, designers, and content providers to quickly exchange information. Another idea is to build **graphical browsers** that rely on dynamically generated structure maps that adapt to end-users’ needs and come in various forms: global maps show the entire hyperspace; local maps show the vicinity of the current node in terms of hyperlinks to and from other related nodes; and fisheye views focus attention on important nodes by deliberately distorting the view.
- **Creation of a learning environment**: The emergence of boundary objects depends on mutual education of the participants. Therefore, in hypertext and Web application interfaces, a learning environment is necessary. In order to create a learning environment, we need to provide additional facilities that help end-users, content providers, and designers in fulfilling their tasks or even to provide intelligent intermediaries to do the tasks for them. More experienced users can offer informal help and advice to novice users. To create such a learning environment for end-users, we should provide suitable support features when collaboration between users is most effective. The construction of Community Memory Support Systems like Answer Garden and FAQ lists will allow end-users to gain an understanding of how systems can be used.
- **Creation of opportunities to create boundary objects by users**: Even the best designer cannot foresee all cultural problems and possibilities. The idea, therefore, is to create opportunities for end-users to create boundary objects. Giving end-users the opportunity to articulate and exchange their ideas and problems with regard to a particular hypertext and Web application may also provide surprising ideas that could be taken up by designers. Awareness mechanisms have to be developed that will allow end-users to be aware of when others are accessing the same
resource. The use of synchronous cooperative support tools like Chat Rooms and Meeting Rooms will allow end-users to discuss and debate different approaches to accessing the online resources. The core use of these tools is to support the cooperation and debate needed to resolve decisions. To help end-users tackle the problem of information overload as well as not to be lost in the wealth of information available, we suggest the use of interface agents in hypertext and Web applications to make them more adaptive to end-users’ needs. Interface agents make software more active and work autonomously without waiting for end-users’ command. One example of the use of software agents in hypertext and Web applications is the investigation of personalised information filtering systems to help end-users to eliminate irrelevant information and bring relevant information to end-users’ attention (Maes, 1994).
To enable equal access/opportunity/use, we suggest some ideas for implementation to create ethically sensitive user interfaces:
- **Provide adaptive and adaptable interfaces for users**: If systems are to be user-centred and provide equal access to all users, there is a need to make them adaptive and adaptable, taking into consideration end-users’ needs and browsing patterns (Brusilovsky, 1996). Cockburn and Jones (1995) propose building a graphical browser that dynamically adapts to, and reinforces, end-users’ browsing actions and mental models.
- **Provide workspace and equal opportunity for search results**: A comparison can easily be drawn between work patterns and the Principle of Equal Opportunity introduced as a heuristic for human–computer interaction (Runciman & Thimbleby, 1986). Here, the user can exploit the prior output of the computer as input to a further stage in interaction, with or without modification. For example, a “desk” for interaction on the basis of Equal Opportunity could be introduced. Discovered items could be collected, ordered, prioritised, remembered, etc., within the hypertext/Web space.
- **Integrate technology into social environment**: Nardi and O’Day (1999) call for responsible, informed engagement with technology in local settings, which they call information ecologies. According to Nardi and O’Day (1999), an information ecology is a system of people, technologies and values in a local environment. Hypertext/Web systems should be designed and integrated into a social environment where the human factor is not ignored.
Designing with the Mind
Knowing design guidelines is one thing, but applying them is another matter. How can designers be certain that they have considered essential dimensions necessary to ensure effective design and development of hypertext and Web applications? To address limitations in current research in hypertext and Web applications, a framework for an application development model to build user-centred hypertext and Web applications is proposed taking into consideration the matters that concern the mind, taking a systematic, engineering approach to design. The essential issues to be investigated in this framework include addressing these fundamental design and usability questions adapted from Theng (1999):
*What are hypertext and Web applications?*
We can think of a hypertext/Web application as being made up of four components: (i) information referring to the content of the hypertext/Web; (ii) structure referring to the metadata of objects described in the hypertext/Web collection; (iii) interaction elements referring to the dynamics of searching and browsing, screen design, dialogue between end-users and the hypertext/Web systems; and (iv) propriety referring to security, ethical, copyright issues, etc.
What appears on the interface design should reflect accurately the underlying structure of links and digital objects and their relationships with each other within the hypertext and Web structure. An experiment by Allinson and Hammond (1989) confirms that end-users’ lack of overview information or wrong understanding of the hypertext structure make them more prone to losing their orientation. In viewing structure in hypertext and Web applications, the conceptualisation emerges of information as space and the user as a navigator. There is a need to organise space to help end-users find their way in them. Designers should try to communicate the design model of hypertext and Web applications so that the mental models end-users form when using hypertext, and Web applications would match the design model. A good understanding of these interaction elements is important in helping end-users navigate around hypertext and Web applications without getting “lost” (Theng, 1997).
*For what purpose?*
Most hypertext and Web applications are used for diverse purposes by a wide range of people, and this lack of sharp focus may lead designers to ignore end-users as an unmanageably broad spectrum. Therefore, it is important that designers need to identify the goals of a hypertext and Web application from the perspectives of the author/developer as well as from the reader/end-user.
Author/developer goals refer to authoring strategies to consistently apply basic Web document design principles on every page in the hypertext and Web applications designers create (see Table 2).
Reader/end-user goals refer to the tasks readers/end-users commonly perform when using hypertext and Web applications. Designers should also bear in mind the different types of end-users in terms of their domain knowledge and experience with hypertext and Web applications. Central to any successful interaction is the idea that end-users must have an adequate understanding of the state of the hypertext and the Web. End-users should be given full and continuous feedback about the results of actions. At any point, there should be sufficient information to orientate end-users.
“Global maps” or “overview diagrams” have been introduced to give end-users an overview of the system and the documents and links between them. “Local maps” or “document finders” are used to provide end-users with information on what documents are linked to current user-defined document.
These maps aim to provide end-users with as much context information as possible so that end-users are able to answer questions like: Where am I?; Where do I go from here?; How much information is there?; How did I arrive here?, etc.
Furnas (1986) proposes using fisheye maps to show details about matters at the focus of attention, but as the information moves away, less and less of the details should be shown. Conklin (1987) suggests using graphical document browsers to display the structure of the document and allow end-users to assess what is there. This is because much of the problem in navigation and, in particular, disorientation is the lack of understanding of the document structure and the inability of end-users to assess the amount and size of information available.
Other solutions include indices, tables of contents, screen headings, etc., as landmarks to provide end-users with information on where they are in the hypertext and the Web, just as signposts, buildings, and street names aid navigation in physical environments. Maps, tables of contents, etc., are more appropriate for smaller hypertext and Web applications. However, with larger hypertext and Web applications, solutions include investigations into controlling the amount of displayed information using fractal views (Kioke, 1995), mapping the full hierarchy onto a rectangular region through the efficient use of space using tree-maps (Johnson & Shneiderman, 1991), etc.
How to?
To design user-centred hypertext and Web applications, we need to involve end-users and their needs throughout the different stages in the well-accepted iterative development life cycle: feasibility study, conceptual design, building, implementation, integration, and maintenance. Continuous usability evaluation techniques will be investigated.
Continuous usability evaluation of hypertext and Web applications should be encouraged to ensure that usable and useful hypertext and Web applications could be achieved. These evaluation techniques are categorised under real user testing and non-human user testing (Theng, 1997). Real user testing includes observations, surveys, expert evaluation, and experiments, and should be carried out before the hypertext and Web application is ready for implementation so that qualitative results and impressions can be obtained. Non-human user (or analytic) testing methods are encouraged as a means to perform evaluation early enough to influence design while it can still change direction. Analytic techniques are some ways of evaluating without requiring the attendance of real end-users.
**With what?**
This refers to the resources available for the development and delivery environments. They include data, rules, and authoring tools. Data refers to digitised objects (e.g., text, images, sounds, videos, etc.) used to build hypertext and Web applications. They can also refer to existing collections of related information found, for example, in archives or on the Web. Rules are defined as ways in determining data structures of the digitised objects, that is, how data are to be captured and presented. Authoring tools refer to the authoring help and environment provided for designers/developers of hypertext and Web applications. These tools should make authoring as well as maintenance of hypertext and Web applications as easy as possible.
**Level of abstraction?**
The description of hypertext and Web applications can be at three levels: instance level which addresses specific application and domain needs; modelling level which addresses the issues of how models for specific domain are created; and meta-modelling level which addresses the issues of how to go about creating a model.
**CONCLUSION AND FUTURE WORK**
Many hypertext and Web applications are poorly designed and built in terms of how information is structured and displayed. We argue for a move from treatment to prevention, from treating the end-users’ symptoms to avoiding bad design. This chapter makes several theoretical and practical contributions to address the deficiencies in hypertext and Web design by designing with the heart and the mind.
Ongoing work includes developing, refining, and validating the application development model with different collections and different types of designers and end-users. One future research aim is to build a hypertext and Web authoring tool incorporating the application development model so that user-centred applications can be generated. If some design ideas could be automated so designers need not worry about their implementation, chances are that better applications could be produced, because designers would be freed to concentrate on other critical issues that cannot be automated.
**ACKNOWLEDGMENTS**
The work presented here was carried out as part of an EPSRC grant (GR/72098) and funding from Middlesex University for my PhD work. The author
would also like to thank colleagues and friends who had given me invaluable feedback and support: Harold Thimbleby, Cecile Rigny, Matthew Jones, Norliza Nasir, and Elke Duncker.
Many thanks also go to Paola Ameldi and two anonymous reviewers who gave me useful comments on the draft version of this chapter.
REFERENCES
Internationalization of Products and Systems (IWIPS '99), (133–142).
|
{"Source-Url": "https://ldc.usb.ve/~abianc/electivas/exposiciones/ThengUsabilidad.pdf", "len_cl100k_base": 7933, "olmocr-version": "0.1.53", "pdf-total-pages": 21, "total-fallback-pages": 0, "total-input-tokens": 43064, "total-output-tokens": 11345, "length": "2e12", "weborganizer": {"__label__adult": 0.0006113052368164062, "__label__art_design": 0.01375579833984375, "__label__crime_law": 0.0006203651428222656, "__label__education_jobs": 0.0222320556640625, "__label__entertainment": 0.0005512237548828125, "__label__fashion_beauty": 0.0003991127014160156, "__label__finance_business": 0.0008687973022460938, "__label__food_dining": 0.0005793571472167969, "__label__games": 0.0011348724365234375, "__label__hardware": 0.0017518997192382812, "__label__health": 0.0010576248168945312, "__label__history": 0.0013713836669921875, "__label__home_hobbies": 0.0002218484878540039, "__label__industrial": 0.0005578994750976562, "__label__literature": 0.00437164306640625, "__label__politics": 0.0006237030029296875, "__label__religion": 0.00102996826171875, "__label__science_tech": 0.324951171875, "__label__social_life": 0.0003380775451660156, "__label__software": 0.1083984375, "__label__software_dev": 0.51318359375, "__label__sports_fitness": 0.0002834796905517578, "__label__transportation": 0.0009026527404785156, "__label__travel": 0.0003919601440429687}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 47885, 0.0233]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 47885, 0.55936]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 47885, 0.90616]], "google_gemma-3-12b-it_contains_pii": [[0, 1131, false], [1131, 3826, null], [3826, 6171, null], [6171, 8557, null], [8557, 10042, null], [10042, 12268, null], [12268, 15175, null], [15175, 17803, null], [17803, 20697, null], [20697, 23389, null], [23389, 26064, null], [26064, 28793, null], [28793, 31285, null], [31285, 33909, null], [33909, 34976, null], [34976, 37579, null], [37579, 39880, null], [39880, 42011, null], [42011, 44124, null], [44124, 46319, null], [46319, 47885, null]], "google_gemma-3-12b-it_is_public_document": [[0, 1131, true], [1131, 3826, null], [3826, 6171, null], [6171, 8557, null], [8557, 10042, null], [10042, 12268, null], [12268, 15175, null], [15175, 17803, null], [17803, 20697, null], [20697, 23389, null], [23389, 26064, null], [26064, 28793, null], [28793, 31285, null], [31285, 33909, null], [33909, 34976, null], [34976, 37579, null], [37579, 39880, null], [39880, 42011, null], [42011, 44124, null], [44124, 46319, null], [46319, 47885, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 47885, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 47885, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 47885, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 47885, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 47885, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 47885, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 47885, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 47885, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 47885, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 47885, null]], "pdf_page_numbers": [[0, 1131, 1], [1131, 3826, 2], [3826, 6171, 3], [6171, 8557, 4], [8557, 10042, 5], [10042, 12268, 6], [12268, 15175, 7], [15175, 17803, 8], [17803, 20697, 9], [20697, 23389, 10], [23389, 26064, 11], [26064, 28793, 12], [28793, 31285, 13], [31285, 33909, 14], [33909, 34976, 15], [34976, 37579, 16], [37579, 39880, 17], [39880, 42011, 18], [42011, 44124, 19], [44124, 46319, 20], [46319, 47885, 21]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 47885, 0.10556]]}
|
olmocr_science_pdfs
|
2024-12-09
|
2024-12-09
|
3e971c645b402c3229d1a468d924b1e2b5cc2806
|
ScyFlow: An Environment for the Visual Specification and Execution of Scientific Workflows
Karen M. McCann*
Maurice Yarrow*
Adrian DeVivo*
Piyush Mehrotra³
ABSTRACT
With the advent of grid technologies, scientists and engineers are building more and more complex applications to utilize distributed grid resources. The core grid services provide a path for accessing and utilizing these resources in a secure and seamless fashion. However what the scientists need is an environment that will allow them to specify their application runs at a high organizational level, and then support efficient execution across any given set or sets of resources. We have been designing and implementing ScyFlow, a dual-interface architecture (both GUI and API) that addresses this problem. The scientist/user specifies the application tasks along with the necessary control and data flow, and monitors and manages the execution of the resulting workflow across the distributed resources. In this paper, we utilize two scenarios to provide the details of the two modules of the project, the visual editor and the runtime workflow engine.
INTRODUCTION
NASA's Earth and Space scientists are finding that the raw data being acquired and downloaded by satellites and deep-space missions is accumulating on data archive systems much faster than it can be transformed and processed for scientific experiments. In addition, scientists lack the visual tools that might allow them to rapidly design the appropriate transformation sequences for their data. The requirements for such a tool include: rapid visual prototyping of transformation sequences, the designation of processing pathology handling, the ability to automatically apply designated workflows to the processing of large sets of raw data files, the collation and post-processing of results, the advance and repeated scheduling of processing sequences, and the ability to easily modify these data transformation sequences: to accommodate changes in the intent of experiments, and to rapidly test new hypotheses. To provide scientists with a capability that addresses these needs, in this task we are building a GUI-enhanced tool, ScyFlow, that will allow flow-chart-like assembly of data acquisition and transformation steps, and will then instantiate this processing. This tool will support all stages: the automated acquisition of raw data, the distributed processing of this data, and the final archiving of results. In this paper, after a brief overview of the overall architecture, we describe two of the modules, the visual editor and the runtime engine, in more detail. We present two usage examples to describe the two modules.
³Computer Sciences Corporation
NASA Ames Research Center
Mail: MS T27A-1, NASA Ames Research Center, Moffett Field, CA 94035
Email: {mcann, yarrow, devivo, pm} @nas.nasa.gov
Motivating Scenarios
In this section, we present two scenarios that represent typical problems faced by scientists who need to process large amounts of information, and/or execute large programs, in a distributed environment that might range from workstations to supercomputers. These two cases are modeled in a ScyFlow chart; see Figures 1 and 2 below.
**Scenario 1: Parametric Study:** A CFD scientist wishes to vary the position of flaps on an aerospace vehicle geometry, and then apply a CFD flow solver code to the resulting geometry configurations for varying values of Reynolds number (aircraft speed) and alpha (angle of attack). The scientist may wish to run this workflow several times, changing configurations and parameter values; also, the scientist may wish to introduce some sort of test that will modify the parameter values themselves in order to “zero-in” on parameter sets of interest, or eliminate certain configurations that fail to meet specified criteria. Note that this represents 2 levels of parameterization: “i” geometry configurations, followed by (for each configuration) “j” (values of Reynolds number) times “k” (values of alpha), where total runs = i + (i * j * k); where there are i runs for the first level, then i * j * k runs for the second level, and the first level represents a meshing program that varies the flap positions, and the second level represents a computation-intensive CFD flow solver to be run on a supercomputer system. In our example, let i = 3, j = 3 and k = 4, producing a total of 36 input data sets and 36 jobs, one for each input set.
**Scenario 2: Processing of Mars data:** A scientist working on Mars mission data needs to download HDF files (latitude and longitude based) as they become available on agency web sites. These files typically contain some kind of gathered spectral data in two-dimensions; where the first dimension is radar, light, or heat, etc., and the second dimension is a lat-long location for each of the first dimension values. In general, there will be many small HDF files, and a significant proportion of these HDF files will have problems or errors: for example, misaligned “corners” of lat-long sections, non-numerical values in numerical fields, or errors in data values that can be discovered and eliminated by some mathematical method, etc. After downloading, the files need to be examined for errors, and then each file with a particular error will need to be processed by the appropriate “fixer” code. Then the corrected files are “stitched” together into a single large file of corrected spectral data, which is then subjected to a compute-intensive spectral processing method. Typically, the results of the processing will be displayed as contours, or color-mapping, overlaid on a map of the area of interest, which is delimited by the composited set of lat-long values.
**Overall Architecture**
We are developing ScyFlow as part of a larger set of component applications. In order to allow our component applications to “talk” to each other, we have created a “container” application called ScyGate that manages and coordinates the interactions between the components. Initially, these contained applications will be:
- **ScyFlow:** workflow editor, generator and execution engine (the focus of this paper);
- **ScyLab**: parameter study capability (next generation of ILab[1], with some additions so that it can be used by ScyFlow);
- **UniT**: (Universal File Translator) program that generates translation code for transforming one data format into another data format;
- **FileTester**: Perl/Tk utility that generates a Perl program that will parse any given ASCII data file and return designated values – can be used condition testing within a workflow.
- **ScySRB tool**: getting SRB files into Experiments and WorkFlows, and putting output files from Experiments and WorkFlows back into the SRB.
- Any additional modules: our architecture will allow additional component applications to be incorporated into the system at both an icon-based (data configuration) level and a programming-based level (use of a separate Registry API).
A ScyGate local server runs in the background and component applications open sockets to this server. Shared data is kept in a “Registry” (which is both an data tree object and a data file) and is managed by the background server. Our aim in creating this application environment is to provide a framework for the deployment of several related applications, and to extend this framework in two ways: first, allow users to attach their own icons to the ScyGate “icon corral” so that they can be launched from ScyGate (and, possibly, passed as input some file paths known to ScyGate); second, to allow developers to write code that attaches to the Registry server, so that the code produced by these developers can also “talk” to other ScyGate applications. The framework also makes it easy for us to handle the updating of individual codes, since version information is one of the things handled by the Registry.
**Architecture of ScyFlow**
ScyFlow is an environment that supports the specification, execution and monitoring of workflows. It consists of two major components:
- **ScyFlowVis** provides the visual interface for specifying workflows. It also translates the visual flow graph into internal formats (XML, dependency list, pseudo-code) for storing and for communicating with the other components. The GUI can also be used as a visual interface to monitor the execution of workflows.
- **ScyFlowEngine** provides the set of services required for the overall execution of the workflow across distributed grid resources, taking into account the specified control and data dependencies. A set of APIs will allow applications other than ScyFlowVis to also connect to the ScyFlowEngine in order initiate and monitor executions of workflows.
Definitions of ScyFlow Terminology
Below we define some terms that we use for data objects in the context of ScyFlow.
**Process:** Basic unit of execution in any workflow; can be any type of script, or any type of compiled file, or a single command. The Process Object contains the data necessary to execute any given process - the type of Process, paths to necessary files and any other required data: command line arguments, special queue directives, etc.
**Experiment:** A “railroad” sequence of processes (no control structures) that is to be executed sequentially. Any process in an Experiment can be parameterized by a sequence of input values. The cross product of the input values gives rise to a set of independent input parameters that can be executed independently, essentially as “job” units of an experiment in a parametric study. The Experiment Object contains pointers to the constituent Process objects, along with information about the parameterized inputs such as the input files, the locations within the files and the values to be used for these locations. For the purpose of explaining ScyFlow, an Experiment and a Process can be regarded as interchangeable, since an Experiment is just a set of Processes; we use the term "executable" to interchangeably refer to an Experiment or a Process.
**Workflow:** A set of Experiments and/or Processes along with any control structures and data dependencies necessary for executing the subtasks. Workflow objects are really “container” objects since they point to other Experiment and Process objects, but they also contain control flow information in the form of specific flow structures. All executable data, and control flow data, is represented as vertices in a directed graph, where each vertex is either an executable, or a control structure (SplitPath, Join, Cycle, or Pause).
**Job:** A Job object represents a single input data set, attached to an associated workflow graph or Experiment object. Thus, an Experiment will result in multiple Jobs, one for each execution of the parameterized data set. A Workflow will have at least one Job, and each Job represents one traversal through the Workflow directed graph. A Workflow that has no Experiments (parameterized processes) will give rise to one Job in which (some sub-set) of Processes will be executed only once; a Workflow with Experiments will have many Jobs, and each Job will execute (some sub-set of) Workflow executable vertices once. (Note that in each case the sub-set of executed Experiments or Processes may include all Workflow vertices.)
IMPORTANT: an Experiment object contains data flow information, i.e., information concerning parameterization, whereas a Process does not. ScyFlow's data flow specification - as far as parameterization goes - takes place at the Experiment level. However, SplitPath and Join control structures at the ScyFlow level can cause data sets (jobs) to be multiplied or joined; when the workflow is executing, the ScyFlow execution manager keeps track of the data set totals, applying control flow variants to parameterized set specifications, in a manner completely transparent to users. The ScyFlow monitor display will feature data set totals, since these are determined at run time if any control structures are present in the directed graph.
**SCYFLOW VISUAL INTERFACE: ScyFlowVis**
The ScyFlow system provides a visual interface for specifying the graph that represents the WorkFlow. Along with manipulating such graphs (e.g., creating, storing, modifying), a companion interface allows users to utilize the workflow graph to monitor the progress of the execution of the workflow. In this section we focus on the specification interface, providing details of the types of workflows that can be specified within ScyFlow.
At the top level, the directed graph in ScyFlow has been designed to model the flow of operations only; data specification appears within the context of the Processes and Experiments (see below.) There are only 5 types of vertex, one for executables (Experiments or Processes), and 4 for control operations: SplitPath, Join, Cycle, and Pause; these are represented within the directed graph display by different icons. There are no vertices representing data, only one type of vertex which can represent operations upon data. Arrows indicate the flow of operations.
**Data Dependencies**
In order to minimize user input, data dependencies are handled in the following ways. First, data dependencies between Processes are specified within ScyLab merely by the order in which Processes are entered (this order can be easily modified by user.) If Process B is entered after Process A, ScyLab code "assumes" that B is dependent on some files output by A, and the execution code handles output files from A accordingly. A similar model is followed by ScyFlow; whenever user adds a vertex to the directed graph, that vertex is either the first vertex (no dependencies), or is being added to a pre-existing vertex. For example, if user adds vertex B to vertex A, ScyFlow also assumes that B is dependent upon A, and that A must be executed before B can be executed.
Second, between executables in a Workflow, at the ScyLab level user must mark certain Process-specific files as "Input to Next Experiment ...". This information is used by the ScyFlow execution manager to assure that essential files are correctly copied and/or archived in the sequence of directed graph specified executions. For user's convenience ScyFlow will include a data-dependency modeling display that will allow user to easily view and edit the data dependencies between portions of a Workflow; ScyLab will include a similar feature. The APIs for both ScyLab and ScyFlow will include functions that will return or change this information.
**Control Vertices in ScyFlow**
The small number of types of vertices in ScyFlow was achieved by making the control vertex types represent sets of similar operations. For instance, there is only one Cycle vertex, but the Cycle Properties contains options which can be set to execute different kinds of loops: counter loops, "while" loops, and "do ... while" (or "do ... until") loops.
A SplitPath vertex has similar options. It can have no test at all: this is an "AND" condition that indicates that the output from the previous executable should be used as input for ALL the following executables. This option multiplies the Jobs (data sets) and may be set to execute simultaneously on different systems. Secondly, the SplitPath can
have a test based on either the return value of a program, or the existence or non-existence of a file; this is an "OR" condition. The return value of the specified OR condition test is then used to determine the following path, which will be the only path (out of all the possible paths) that gets executed for any given data set. Note that an "AND" SplitPath introduced at any point in a workflow – including the beginning of a Workflow - can also have the effect of starting up separate simultaneous path(s) of execution at that point.
The Join vertex is simpler: there are only two types of Join (1) an "AND" Join, where execution at the Join must wait for input from all previous paths in order to continue; (2) an "OR" Join, where input from any previous path can be passed to next executable, with no waiting. (Note in future we will probably add some Join options concerning file staging, depending on user requirements; for example, user may wish to copy/move/mark sets of files from previous executables in some way required by the executable following the Join vertex.)
The Pause vertex is procedural only; it is intended to provide for cases where some data examination has to be performed before continuing the execution of the Workflow, or to provide for pathological cases, etc. Pause options include email, beep, etc.; a special Pause pop-up display will be provided so that users can examine paused data sets (Jobs) and mark these for discarding or continuing through the workflow.
In ScyFlow, SplitPath and Join vertices are always labeled with their types: "OR" or "AND", appearing in different colors. This disambiguates the meaning of these vertices, as far as control flow is concerned, in any given display. An alternative to the "OR" and "AND" labels might have been to have different types of vertices, drawn in different shapes, representing the varieties of Split and Join operations; but, this would have made the display more confusing, and would probably have required (in order to carry out such a design decision to its "logical" conclusion) many more different shapes and types of icons in order to distinguish various operations.
The Data Train Analogy
The closest "real-life" analogy to ScyFlow's modeling notation is to compare the Workflow transit of the directed graph to the path a train would take through a series of railroad switches, while visiting several destinations before the end of its journey. Each separate train is a Job (or data set); each stop is an executable where data is unloaded and processed, and then different data is loaded back onto the train. SplitPath vertices are switches to several other tracks; Join vertices are switches that join two or more sets of tracks. Some options set by ScyFlow users can cause one train to get cloned (copied) into two or more trains; and, one or more trains can "wait" at Join vertices until other trains arrive, so that all Join-specified trains can merge back into one train. In the simplest SplitPath case, with only OR conditions in any SplitPath vertices, a train sets out on a journey but its exact path and destination are not determined until each SplitPath test is done and the train is sent down one path instead of another. (Note that this presumes an exclusive OR only; ScyFlow does not currently model an inclusive OR, but this will be added.)
Design Motivation
The motivation behind our design is as follows: it was important to create a notation system that was both easy to understand, and at the same time flexible and powerful enough to model complex workflows. As with most (if not all) directed graph problems, granularity is a very important issue; the ScyFlow design would not be successful if the ScyFlow workflow charts are ambiguous or too difficult to create and understand. The problem is that any representation of a complex real-life workflow problem will expand to be so visually complex as to be unsuitable for use and for visual "cues" about structure. Even simple workflows can be very difficult to model. In terms of programming implementation this is an ongoing problem, made even worse by the graphical difficulties of creating a display where two or more vertices do not overlay each other. Our aim was to create a more visually intuitive display by simplifying the workflow representation: we have no data vertices and the number of vertex types has been minimized. We make the assumption that users will impose their own complexity on any given problem; it is important to keep the basic design as simple as possible in order to accommodate this. The “collapse/expand” paradigm for a graphical interface needs to be used as much as possible, so that detail can be hidden in order to avoid a very large and overly complex display. ScyFlow implements this by allowing an executable vertex to “expand” into a ScyLab Experiment which can be edited/created separately in ScyLab, then collapsed back into a ScyFlow executable vertex.
ScyFlow Representations of the User Scenarios
We now describe how the two scenarios presented earlier would be represented using the ScyFlow notation.
Figure 1: ScyFlow CFD user scenario
Figure 1 shows the ScyFlow workflow representation of the first user scenario, multiple levels of parameterization. Note that this workflow is a “railroad”, that is, a straight line: this is because there are no control structures in this workflow; no decisions are made at run time, and all possible data sets (Jobs) will be executed since there will be no tests
executed to eliminate any of them. The first executable, labeled “Flaps”, would produce 3 geometries with varying flap positions; since this is not compute-intensive, user might run it locally, perhaps on a workstation. The following “Pre-Processing” might involve fixes and/or changes to the geometry grids; also, local. The FlowSolver would probably be executed on a supercomputer; and the post-processing and graphics might run on some set of graphical systems.
Figure 2: ScyFlow Mars data user scenario
Figure 2 illustrates the second user scenario. The user would construct a ScyFlow Workflow where the first executable is a “web scraper” that will automatically download files from a site according to some constraints (e.g., all new files since a certain date, all files in some directory, etc.). Note that the ScyGate suite of utilities will contain a program that will generate this sort of program or script, either in Perl or in Korn shell.) The second vertex in user’s workflow would be a SplitPath control structure vertex, that will run a program that will apply several tests to each downloaded file, and return certain values indicating the appropriate “fixer” program that should be run on each file. The SplitPath vertex will have several branches, one for each fixer program. Then, all paths leaving the SplitPath vertex will be followed by a Join control vertex with an “OR” condition, indicating that any data set processed by any of the paths following the SplitPath vertex can then be passed to the next processing node following the Join control vertex. Following the Join vertex, the user would add an executable that would take all “fixed” files as input, and use them to composite a large file. Adding another SplitPath test would determine whether the composition had accumulated a sufficient number of files to continue to the next executable. Once this test succeeds, the next executable would apply a compute-intensive spectral decomposition operation to the large data file, presumably on some available supercomputer resource. Finally, a graphics post-processor executable would get the results of the spectral program, and output graphics files for display. Each stage of this Workflow might or might not be accompanied by archiving instructions which will be performed at run-time by the Workflow execution manager. Note that the second SplitPath test has only one path, but, there is an “implied” first path
which is to do nothing unless the SplitPath test succeeds. The first “WebScraper” executable would continue to send data sets down the workflow, but the final spectral and graphics executables will not be executed until the final test succeeds.
GUI vs. API Operation of ScyFlow and ScyLab: Automated Scripting
Both ScyFlow and ScyLab will provide a data-file based API, plus the ability to generate this file from any GUI-constructed Workflow or Experiment object. This gives programmers/users the ability to “script” any given execution of a Workflow or Experiment, since the generated data file – which will be used as input for the API - can be parsed, and re-run, by other programming modules.
SCYFLOW RUNTIME SYSTEM: ScyFlowEngine
The workflow execution engine consists of two components. The first of these is the dependency handler, which expands compiled dependency data. The second component of the execution engine is the server/sub-server architecture, which spawns the work indicated by the directed graph and subsequently monitors the progress of jobs and determines which dependent work may be run from the completion-status information of finished dependencies.
![Diagram of Workflow Execution Process]
Figure 3: Operation of the WorkFlow Execution Manager
The workflow execution engine is a server/sub-server architecture. It utilizes socket communications for the transfer of job instructions from the server to the sub-servers and for transfer of job completion information from the sub-servers to the server. The sub-servers are basically “dumb” and do no dependency analysis or runtime decisions. The server contains the directed-graph compiler, which produces a dependency list. This list is used to determine which components of the user work may be processed (dependents) once any prior component (a dependency) has been successfully completed. Note that currently, control flow capability has been developed and is working, though both control and data flow specification are done in the GUI graph editing. Thus each graph traversal implies a single path of execution of user work through the graph. The server also contains the apparatus which spawns sub-servers onto user- or resource-broker-designated compute machines. The spawning of a process can be accomplished by either ssh, gsissh, or the NAS JobManager. Once a sub-server has been spawned onto a
designated resource, the sub-server will thereupon open a connection to the server's listener-socket and request from it the instructions to be performed. The server is based on a multiplexing architecture and can simultaneously handle any number of user jobs flowing through any number of graphs whose vertices can be partitioned onto any number of remote resources. At this time, each user job is serviced by one sub-server, but our architecture will permit a single sub-server to service multiple jobs running on its particular resource. Because the sub-servers communicate back to the server immediately with any vertex completion statuses, monitoring of job status is real-time.
![Workflow Life Cycle Diagram]
Here is a detailed look at the life cycle of a workflow graph in our server/sub-server architecture. Once the graph has been constructed (either by the GUI or API) and user-process attributes given appropriate values, the GUI/API will open a connection to the server listener-socket and pass to it a serialized graph object or graph file-package location. The server then compiles the graph and produces a dependency list for the graph vertices. Then, the first dependent with no dependencies is chosen and a "HostServer" is spawned onto the remote machine indicated for this vertex (chosen either by user designation or resource-broker). The HostServer opens a connection to the server, identifies itself by JobName and requests work to be performed. The server passes to it instruction(s) to perform. The sub-server chooses an appropriate "job handler" to perform the work and thereupon forks and execs this job handler, thereby allowing the sub-server to avoid blocking while the work is being performed. The sub-
server opens its own drop-down listener-socket loop and waits for either completion status from its job handler or for possible shutdown/discontinue requests from the server. When the job handler has completed the user work and notified the sub-server, the sub-server exits its listener loop and reports completion status for this job to the server. The server updates its job/vertex data object with completion or failure status for the vertex, and then determines, using the dependency list, which next dependent task may be run, if any. If the next valid dependent vertex is on the same machine as last, the reporting sub-server is given this work, otherwise the sub-server is given shutdown instructions, and a new sub-server is spawned onto the resource selected for this next vertex. Subsequently, this new sub-server will open a connection to the server and obtain the vertex work, etc.
Related Work
Some related projects are: SciRun, developed at the University of Utah and used for a variety of applications including molecular biology [2]; Cantata / Khoros, commercially developed in Utah and used for image processing[3]; UNICORE, developed in Germany as a generic workflow package[4]; and DAGman, part of the CONDOR project, developed by Myron Livny at the University of Chicago [5].
Conclusions
The new ScyFlow system presents two innovations: a new design for workflow modeling, and the ability to handle both control flow and data flow within any given workflow. This powerful and flexible system provides generic capability for creating and running workflows, without being domain-specific; in addition, ScyFlow requires absolutely no "instrumentation" of any participating codes, that is, users can run ScyFlow without doing any programming whatsoever. Our object oriented design restores state for workflow data sets, since WorkFlow objects are easily serialized to/from files, and transported over sockets. ScyFlow's "scripting" ability (the API, Applications Programming Interface) is not only convenient for users - since WorkFlow objects can be "dumped" to a script file and used to re-run the workflow - but is also usable by external programming modules for deployment in many distributed environments.
References
[2] software.sci.utah.edu/scirun.html
|
{"Source-Url": "https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/20040084570.pdf", "len_cl100k_base": 5940, "olmocr-version": "0.1.53", "pdf-total-pages": 11, "total-fallback-pages": 0, "total-input-tokens": 25562, "total-output-tokens": 6471, "length": "2e12", "weborganizer": {"__label__adult": 0.00030922889709472656, "__label__art_design": 0.0006647109985351562, "__label__crime_law": 0.0003604888916015625, "__label__education_jobs": 0.00212860107421875, "__label__entertainment": 0.00013589859008789062, "__label__fashion_beauty": 0.00018739700317382812, "__label__finance_business": 0.00039505958557128906, "__label__food_dining": 0.000347137451171875, "__label__games": 0.0005249977111816406, "__label__hardware": 0.002048492431640625, "__label__health": 0.0005707740783691406, "__label__history": 0.00046539306640625, "__label__home_hobbies": 0.00013959407806396484, "__label__industrial": 0.0009369850158691406, "__label__literature": 0.000293731689453125, "__label__politics": 0.000308990478515625, "__label__religion": 0.00052642822265625, "__label__science_tech": 0.337890625, "__label__social_life": 0.0001652240753173828, "__label__software": 0.04083251953125, "__label__software_dev": 0.609375, "__label__sports_fitness": 0.0003120899200439453, "__label__transportation": 0.0007185935974121094, "__label__travel": 0.00024771690368652344}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 29944, 0.00655]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 29944, 0.49965]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 29944, 0.91786]], "google_gemma-3-12b-it_contains_pii": [[0, 2855, false], [2855, 6167, null], [6167, 8753, null], [8753, 12072, null], [12072, 15300, null], [15300, 18660, null], [18660, 20826, null], [20826, 23272, null], [23272, 25660, null], [25660, 27394, null], [27394, 29944, null]], "google_gemma-3-12b-it_is_public_document": [[0, 2855, true], [2855, 6167, null], [6167, 8753, null], [8753, 12072, null], [12072, 15300, null], [15300, 18660, null], [18660, 20826, null], [20826, 23272, null], [23272, 25660, null], [25660, 27394, null], [27394, 29944, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 29944, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 29944, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 29944, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 29944, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 29944, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 29944, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 29944, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 29944, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 29944, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 29944, null]], "pdf_page_numbers": [[0, 2855, 1], [2855, 6167, 2], [6167, 8753, 3], [8753, 12072, 4], [12072, 15300, 5], [15300, 18660, 6], [18660, 20826, 7], [20826, 23272, 8], [23272, 25660, 9], [25660, 27394, 10], [27394, 29944, 11]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 29944, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-10
|
2024-12-10
|
48782cf945b8e3dae241a2dd014e492739a06e4c
|
The Hybrid Model of Broken Agile Transformation in Big Telco Corporations
Dragan Stankovski¹,², Tsvyatko Dobrinov Bikov¹ and Dimitar Ivanov Radev¹
¹University of Telecommunications and Posts, Sofia, Bulgaria
²EPAM Systems, Sofia, Bulgaria
Keywords: Agile Transformation, Waterfall, Hybrid Model, Scrum Transformation, Telecommunication Transformation.
Abstract: The “Technical depth” it's one of the major challenges leading most of the project to delays or failures. Implementation of the Agile approach in its pure form does not fit do needs of the big corporations providing services in the telecommunications branch. This paper aims to present a hybrid model of “Broken Agile” that will accommodate and increase with a significant level the software delivery and development. The approach is resolving and providing a formula for the improvement of already working solutions in Agile projects.
1 INTRODUCTION
The pure form of Agile usually is a perfect match for small projects and companies who are delivering portions and pieces of software, mostly graphical user interfaces (GUI) and they are delivering continuously and often. In the world of big players and corporations especially those who are operating in the field of telecommunication, delivering software in production is quite complex driving hidden risks and big rocks that should be identified, monitored in real-time to have a successful build to production. Have been saying that from the other side there is also complex work from the back-end which nature cannot fit into the same timelines or sprints defined and dedicated for the graphical user interfaces execution. Back-end usually is hiding more risks and resolves problems, including testing it's more complex and it needs more time. Both pieces of this software need to be delivered in production in working shape without any issues and bugs, this challenge of small-time to deliver front end part and long term of the back-end is leading Agile to not sophisticated and this is why the new approach of a hybrid model is needed to close the 360 degrees of the life cycle in lines of software delivery process.
2 THE CURRENT ORGANIZATION OF AGILE IN THE BIG TELCO CORPORATIONS
The approach with back-end and front-end delivering of software is just one example but it's also a small part of the chain in delivering process for one big corporation like telcos. The huge and heavy organizations compile different structures and the processes for delivering have their dependencies from each other. The most useful example of such departments in big telco corporations are marketing, sales, solution, delivery, testing, infra, etc. (This is the most common structure the companies usually are using, and in rare cases, the structure can be slightly different in some of the departments can be merged or also can be split, up to the needs of the current business and of course up to the resources that are involved into development). All of them have their involvements and tasks in the process of delivering the pieces of software.
The regular flow usually is starting from the marketing perspective and PoV (Point of View) and it's pretty connected with the sales team to provide the best solution that can fit do the business itself. Even when those two departments are operating independently, they're very connected with the...
solution team who is the main player to analyse the current situation and the view of the road map for further development and expansions. These analyses are known as “AS-IS” and “TO-BE”. The structure mentioned above is facing two major issues - the first one is usually when marketing and sales provide and promise solution of product which currently it's not developed or it's not working according to the customer needs, and this is only because there is a gap in the knowledge of the product or gap between the communication in the Agile workflow and life cycle between all departments (M., Fowler, and J. Highsmith, 2001). The second challenge is related to the lack of analysis end business knowledge about the current situation and future map of the business solution.
Figure 1: Common team organization in Agile structure and project delivering.
The challenges are continuing with implementation and execution that the delivery team needs to handle when handing the work from the solution team. In this case, a clear understanding of the creation of the content which is in the Epics and Featured (Torado, 2019) levels and main responsibility of Product owns (O’Connell, 2013) should be described in a way that will be clear for developers to organize and finish their work between the sprints without any impact or leftovers. The next on the queue is the real challenge to find all possible ways of work to test and complete the execution of the test cycles with minimum issues end maximum numbers of executed test cases. Last but not least place especially GO, NO-GO which is the trigger to the infra team to go on production.
As is described above most of the teams have their impact on the process of delivering and the artifacts as Epics and Features, and User Stories need to be clearly defined and connected into a workflow with dedicated owners and of course timelines in which they need to be executed. Till now the idea to deliver software in production is covered and answering the questions Who?, When?, and How? need to be delivered. Those 3 questions are the baseline on the structure in the real connection between the teams explained above. Therefore, in this paper, a new hybrid model is introduced to support and make stronger connections between teams avoiding or reducing dependencies and big rocks. In the next chapter with clear examples is explained how the teams need to be structured and how they need to communicate and manage their dependencies and tasks in different phases in the process of delivery.
3 CHALLENGES IN DELIVERY PROCESSES
The big telco corporations are facing a lot of issues and problems from different aspects, mostly they are related to the business understanding and lack of knowledge of the product road map and from the other hand, they’ve also related technical execution including processes that need to be established for the internal teams and third parties (3P). Described scenarios for the organization in the previous structure are the common between old and modern telcos providing services across the globe (O’Connell, 2014). In order to propose a suitable hybrid model that can increase and improve the process of delivering first need to identify what are the exact problems and how they can be resolved with our proposal.
- The biggest challenge for the telcos is the gap of knowledge in the structure and segmentation of the teams that need to be connected and work in Agile mode.
- The second but also very important problem is the ability and knowledge to identify, define and connect dependencies between different tasks that need involvement from different teams.
- Also, very important is to define the duration of the sprints and project increments for the product for delivery.
Those three problems separately but also went together can impact the deliverables not only in the timelines but also in the quality of the code that needs to be live on production.
The next chapter will cover the proposal for a solution in one hybrid model that is using the two of the most used methodologies Agile and Waterfall in a combination of proper organization in the timelines, structure, and execution.
4 THE HYBRID MODEL OF AGILE DELIVERY AND ORGANIZATION STRUCTURE
As was shown in the previous chapters, one of the main reasons for delays of the projects in delivering on time a piece of software into the telcos industry is related to the accommodation of technical depth. This result is mainly of those three problems described in chapter 3. The end goal is to provide a final definition for one complex and a hybrid model that can decrease those deviations, in the following part separate description will provide challenges and solutions for the final shape of the suggested hybrid model of Agile and Waterfall's methodology highlighting the most common steaks in delivering projects. Figure 1 presents the common organizational structure and the main players including domains in a project lifecycle, as is shared, the problems are based on good skills to organize domains into a very good connection and chain in the life cycle so they cannot break the movement end execution of the software (Wanner, 2019). The first challenge is related to understanding the scope of work for each part so they can be grouped in one segment (this will reduce the dependencies between them). Figure 2 is presenting a new way of grouping the subdomains that can act more or less independently when it's come to solving complex and long-term tasks.

This solution of segmentation is providing three main options where the marketing and sales are grouped in one subdomain that is named lead segment. The main tasks are to communicate and provide clear direction, not only to the customer but also to the next part of the queue who will develop the product. This is leading to the second part which here is named as an execution part where the agreed and signed Epics and Features are moved to Development, Delivery, and Testing for real work. In some structures of the big companies working in the field of telecommunications this part also is known as delivery but nowadays it's very common and fancy to use the terminology DevOps (Jennifer, 2016). This part also includes the major and critical decision makings in this structure which is called the Unit test and final GO decision to production. Last but not least part is connected with the support of all different activities across the team this is the main responsibility of the infra task and daily work.
The need for this segmentation in our proposal of the hybrid model is tidily connected with the organizational workflow on hand over the tasks. More detailed information is provided in Table 1., where the descriptions and rolls for each of those segments are presented and more detailed described.

<table>
<thead>
<tr>
<th>New Sub-domain</th>
<th>The hybrid structure</th>
<th>Old structure</th>
<th>Main Roles</th>
</tr>
</thead>
<tbody>
<tr>
<td>Lead</td>
<td>Sales and Marketing</td>
<td>Sales and Marketing Strategy and Roadmap</td>
<td></td>
</tr>
<tr>
<td>Execute</td>
<td>Delivery, Testing, Solution</td>
<td>Develop, Deliver and Test the product</td>
<td></td>
</tr>
<tr>
<td>Support</td>
<td>Infra / Deployment</td>
<td>Support Lead and Execute domains and own environments</td>
<td></td>
</tr>
</tbody>
</table>
4.1 First Break
The first break of Agile and place into the need of hybrid model exactly on those three levels. By the definition, all segments should work in an Agile mode, but in reality, marketing and sales cannot plan officially their work in the short term with sprints and product increments. The nature of this breaking is related to the fast market and huge competency that need to be a win and keep the place on a very huge and growing market. The worst-case scenario and unfortunately very often case is that in such segmentation and grouping sometimes sale promises “not existing” product with the only purpose to win the deal. Because of this reason the sales and marketing cannot work in the Agile framework so the combination of Agile and Waterfall is very acceptable.
This paper and the experimental results are based on real project implementation and execution in the period of September 2020 and June 2021 with 60 team members and participants split into the domains that are proposed in this hybrid model. With different proportions and combinations of agile and waterfall such as 10% waterfall 90% agile, 50% agile 50% waterfall, etc. most of the tasks are split and the
tracking marker is the technical dept. As a final result and the most valuable part of delivering and executing is presented into the combination of 20% Waterfall and 80% Agile – case 3 eq. Table 2.
<table>
<thead>
<tr>
<th>Methodology</th>
<th>Case study and results</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td>Agile</td>
</tr>
<tr>
<td>Case 1</td>
<td>90%</td>
</tr>
<tr>
<td>Case 2</td>
<td>50%</td>
</tr>
<tr>
<td>Case 3</td>
<td>80%</td>
</tr>
</tbody>
</table>
The conclusion of the case studies in the approach and experiments is that the work of the leading squads in most cases can be dictated from the road map of the product end also the official licensing part who is already with agreed and familiar or fixed dates. Thus can be very easily scheduled and placed into the different sprints when need to be executed. The 20% of the waterfall are fulfilled with the task-related and small delays and changes related to human resources, new requirements, and specific things that arrived from the customer during the pre-sales conversations including the last minute changes from the governments and other third parties impacting documents and requirement changes of product.
The execution part is also attempting to work in Agile mode and the planning is reserved 100% for Sprint and PI (Project Increment) scheduled work.
4.2 Second Break
The next break of agile methodology is coming with the solution for the second problem related to the Sprint organization and time frames in delivery. This second issue is related to the difference and complexity between pieces that can combine pieces of software delivery - meaning front-end development is fast, graphical, and easily can be changed during the frameworks defined by the Agile community. On the other hand, the backbone or simply said back-end who is the major driver and execution of all requests arriving from the front-end part including the connectivity and storage into databases of changes and services it's very complex and slow to fit into the timelines and align in the same framework as front-end. Those two differences and complexity in development and delivering are also the reason why the big telcos cannot work in real Agile and already defined sprints and project increments (PI).
The most common and already familiar way of structure for PIs is the direction of one month which includes 2 \( \Sigma \) (sprints) each with a duration of two weeks (Maric, Tumbas, 2016). In the same experiment, it was slightly changed and conducted with the execution team or delivery team as the received results show the best synergy and velocity into delivering is when the sprints are organized well like it's presented in equation 1.
\[
PI = \Sigma 1 + \Sigma 2 + \Sigma 3
\]
This means that one project increment for one software drop that needs to go on live in production should be with the duration of 8 weeks split into three different springs. The first two sprints will be with the duration of three weeks and the last one it's with only two weeks.
During our mini project, this proportion 3+3+2 was also tested because already known 2+2 is the most common way of working is unfortunately not good enough and doesn't fit the Backend and Frontend projects. With this, the technical depth of deliverables increased by eight times as is shown in Table 3.
<table>
<thead>
<tr>
<th>Approach</th>
<th>PI scope of Features (average)</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td>Committed</td>
</tr>
<tr>
<td>2+2</td>
<td>10</td>
</tr>
<tr>
<td>3+3+2</td>
<td>20</td>
</tr>
</tbody>
</table>
The last group on the chain is named supportive because he is the less Agile organized and only 30% of their work can be properly planned as upgrades, installations, etc. The rest of the 70% is a pure waterfall and it is picked up with priorities to serve other departments.
This break and proposal for the hybrid model is the style of work where those spirits especially the first two sprints with the duration of a total of 6 weeks are working in pure Agile mode and the last one it's reserved and free to work in Waterfall - 2 Sprints can be handled and transfer to the latest Sprint. This “buffer” or “bucket” is also useful in showing good results because the same can be used for additional testing, handle different emergencies that are always coming at the last moment. Fig. 4.
Figura 4: PI and Sprints organization in proposed Hybrid model.
Besides the support of those two breaks of the Agile methodology and provided modifications there is also one more problem to be solved to have a completed proposal for the hybrid model. In most of the projects, there is no differentiation between blockers and dependencies and continuously they're using the same terminology which is deviating the understanding of the urgencies and priority of deliverables. During project execution, there are different types of deviations and can be identified as outside of blockers' end dependencies. The different tasks in one project increment can be organized and easily can be linked with already familiar dependency structure:
- Finish-to-start (FS) - Task 2 can’t start until task 1 is completed. The most common type of dependency.
- Start-to-finish (SF) - Task 1 can’t finish until task 2 is started. The least common type of dependency.
- Start-to-start (SS) - Task 2 can’t start until task 1 has started, but task 1 does not have to be completed before task 2 can begin.
- Finish-to-finish (FF) - Task 2 can’t finish until task 1 is completed (Sara, 2020).
Mentioned attributes of deviations can be monitored and tracked into the different tools across the organization in the timeframes that the project need to accommodate, but the biggest challenge is to have only one task or artifact that can define end measure all of those dependencies, assumptions questions, links between themselves in one Risk assessment. New Artifact that will combine old deviations and measurements of the risk during the delivery is defined as “Initiative”. The final goal is to provide feedback for the current state or bring to escalation if the execution is delayed or it will fail. This is also known as the risk assessment and therefore the owner by defining the three different levels on track, needs attention and skill to orchestrate the risk including updating the feedback for the current state of all dependencies and deviations. It is already known not only for the Agile, but also for our hybrid model: “The goal of Agile teams shouldn’t be to eliminate dependencies entirely, but to reduce complexity, improve flow, and increase their ability to predict how dependencies will impact their ability to deliver work.” (Brook, 2020). Exclusions are possible in rare cases where the structure is very large there is also a need for one more level of monitoring and managing, this level can be on product or project level with the same marks as milestones.
This is why with this proposal of the hybrid model there is no aim to reduce the dependencies they are a good path for the correct organization and it’s showing the clear vision and the road map of developing of the product in the same time the most important with the Initiatives is to set the risk assessment and prevent from the big rocks, possible delays caused by the technical depth and possible cases of rollback after official upgrades to production.
5 CONCLUSION
The Hybrid model proposed in the chapters above is introduced in the real work environment and the real project implementation with the duration of nine months. Total participants, an average of 60 engineers such as developers, testers, salespeople, solution architects and managers, support engineers. All of them were divided into six streams with an average of ten people. Before implementing and modifying the agile methodology of the Hybrid model the velocity of the delivering it's measured to 65% delivered compared to planned work to be done. The rest of 35% it's mainly related to the increased technical depth and in some cases, the tasks and leftovers move between more than six sprints. In the total of four official releases, 1 is a complete rollback. Reporting hours of the engineers over exceed the normal working time related to catching up and delivering releases on time. The measurements register an average of 50 working hours per week, which is 25% overtime of the regular.
For the same timeframes - September 2020 till June 2021 with the same capacity and implementation of the hybrid model presented in this paper the final
results increase not only the level of delivery without failures but also the velocity. A percentage between committed and executed increased to 95% which is 30% more than the pure agile work style. The reason for the five percent is related to the aggressive market and changes that need to be implemented at the last minute. The working hours of the team members decrease to an average of 42 hours per week which is a significant improvement. Within this total working, time is reported not only as real working hours but also as a time for personal development and self-learning (Stankovski, 2022). In conclusion, the major problems described in chapter 2 and proper implementation of the proposed hybrid model between agile and waterfall schedule in the modified time frames and sprints is increasing the deliverables of the final software version in production and comparing with the previous style of work without rollbacks.
ACKNOWLEDGEMENTS
Terminologies mentioned in this paper as GO, and NO-GO in the real work environments meaning approval (GO) from the stakeholder and final decision to move the product to production or stop upgrades if the acceptance criteria are not covered (NO-GO). Terminology for AS-IS presents the current situation and environment that the company is following and working. TO-BE is a suggestion of how they should transform or work in order to achieve better results.
If any should be placed before the references section without numbering.
REFERENCES
|
{"Source-Url": "https://www.scitepress.org/Papers/2022/109856/109856.pdf", "len_cl100k_base": 4501, "olmocr-version": "0.1.53", "pdf-total-pages": 6, "total-fallback-pages": 0, "total-input-tokens": 17627, "total-output-tokens": 5258, "length": "2e12", "weborganizer": {"__label__adult": 0.0003113746643066406, "__label__art_design": 0.0002799034118652344, "__label__crime_law": 0.000301361083984375, "__label__education_jobs": 0.0017499923706054688, "__label__entertainment": 4.971027374267578e-05, "__label__fashion_beauty": 0.0001468658447265625, "__label__finance_business": 0.0019407272338867188, "__label__food_dining": 0.0003414154052734375, "__label__games": 0.0004754066467285156, "__label__hardware": 0.0004551410675048828, "__label__health": 0.0003905296325683594, "__label__history": 0.00022470951080322263, "__label__home_hobbies": 6.61611557006836e-05, "__label__industrial": 0.0004429817199707031, "__label__literature": 0.00021255016326904297, "__label__politics": 0.000225067138671875, "__label__religion": 0.0003039836883544922, "__label__science_tech": 0.005603790283203125, "__label__social_life": 7.87973403930664e-05, "__label__software": 0.007183074951171875, "__label__software_dev": 0.97802734375, "__label__sports_fitness": 0.0003733634948730469, "__label__transportation": 0.00048232078552246094, "__label__travel": 0.000213623046875}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 23777, 0.02908]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 23777, 0.11035]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 23777, 0.94839]], "google_gemma-3-12b-it_contains_pii": [[0, 3364, false], [3364, 7543, null], [7543, 11950, null], [11950, 15837, null], [15837, 20534, null], [20534, 23777, null]], "google_gemma-3-12b-it_is_public_document": [[0, 3364, true], [3364, 7543, null], [7543, 11950, null], [11950, 15837, null], [15837, 20534, null], [20534, 23777, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 23777, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 23777, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 23777, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 23777, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 23777, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 23777, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 23777, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 23777, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 23777, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 23777, null]], "pdf_page_numbers": [[0, 3364, 1], [3364, 7543, 2], [7543, 11950, 3], [11950, 15837, 4], [15837, 20534, 5], [20534, 23777, 6]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 23777, 0.18391]]}
|
olmocr_science_pdfs
|
2024-12-09
|
2024-12-09
|
3452531c2cb1228647b31ca1fb535117fe21c037
|
The Z Garbage Collector (ZGC) is a scalable low latency garbage collector. ZGC performs all expensive work concurrently, without stopping the execution of application threads for more than a millisecond. It is suitable for applications which require low latency. Pause times are independent of the heap size that is being used. ZGC works well with heap sizes from a few hundred megabytes to 16TB.
ZGC was initially introduced as an experimental feature in JDK 11, and was declared Production Ready in JDK 15. In JDK 21 was reimplemented to support generations.
At a glance, ZGC is:
- Concurrent
- Region-based
- Compacting
- NUMA-aware
- Using colored pointers
- Using load barriers
- Using store barriers (in the generational mode)
At its core, ZGC is a concurrent garbage collector, meaning all heavy lifting work is done while Java threads continue to execute. This greatly limits the impact garbage collection will have on your application's response time.
This OpenJDK project is sponsored by the HotSpot Group.
### Contents
- blocked URL
- Supported Platforms
- Quick Start
- Configuration & Tuning
- Overview
- Setting Heap Size
- Setting Concurrent GC Threads
- Returning Unused Memory to the Operating System
- Using Large Pages
- Enabling Large Pages On Linux
- Enabling Transparent Huge Pages On Linux
- Enabling NUMA Support
- Enabling GC Logging
- Change Log
- JDK 21
- JDK 19
- JDK 17
- JDK 16
- JDK 15
- JDK 14
- JDK 13
- JDK 12
- JDK 11
- FAQ
- What does the “Z” in ZGC stand for?
- Is it pronounced “zed gee see” or “zee gee see”?
### Supported Platforms
<table>
<thead>
<tr>
<th>Platform</th>
<th>Supported</th>
<th>Since</th>
<th>Comment</th>
</tr>
</thead>
<tbody>
<tr>
<td>Linux/x64</td>
<td></td>
<td>JDK 15 (Experimental since JDK 11)</td>
<td></td>
</tr>
<tr>
<td>Linux/AArch64</td>
<td></td>
<td>JDK 15 (Experimental since JDK 13)</td>
<td></td>
</tr>
<tr>
<td>Linux/PowerPC</td>
<td></td>
<td>JDK 18</td>
<td></td>
</tr>
<tr>
<td>macOS/x64</td>
<td></td>
<td>JDK 15 (Experimental since JDK 14)</td>
<td></td>
</tr>
<tr>
<td>macOS/AArch64</td>
<td></td>
<td>JDK 17</td>
<td></td>
</tr>
<tr>
<td>Windows/x64</td>
<td></td>
<td>JDK 15 (Experimental since JDK 14)</td>
<td>Requires Windows version 1803 (Windows 10 or Windows Server 2019) or later.</td>
</tr>
</tbody>
</table>
Quick Start
If you're trying out ZGC for the first time, start by using the following GC options:
```
-XX:+UseZGC -XX:+ZGenerational -Xmx<size> -Xlog:gc
```
For more detailed logging, use the following options:
```
-XX:+UseZGC -XX:+ZGenerational -Xmx<size> -Xlog:gc*
```
See below for more information on these and additional options.
Configuration & Tuning
ZGC has been designed to be adaptive and to require minimal manual configuration. During the execution of the Java program, ZGC dynamically adapts to the workload by resizing generations, scaling the number of GC threads, and adjusting tenuring thresholds. The main tuning knob is to increase the maximum heap size.
ZGC comes in two versions: The new, generational version and the legacy, non-generational version. The Non-generational ZGC is the older version of ZGC, which doesn't take advantage of generations (see Generations) to optimize its runtime characteristics. It is encouraged that users transition to use the newer Generational ZGC.
The Generational ZGC is enabled with the command-line options `-XX:+UseZGC -XX:+ZGenerational`
The Non-generational ZGC is enabled with the command-line option `-XX:+UseZGC`.
Overview
The following JVM options can be used with ZGC:
<table>
<thead>
<tr>
<th>General GC Options</th>
<th>ZGC Options</th>
<th>ZGC Diagnostic Options (-XX: +UnlockDiagnosticVMOptions)</th>
</tr>
</thead>
<tbody>
<tr>
<td>-XX:MinHeapSize, -Xms</td>
<td>-XX:ZAllocationSpikeTolerance</td>
<td>-XX:ZStatisticsInterval</td>
</tr>
<tr>
<td>-XX:InitialHeapSize, -Xms</td>
<td></td>
<td>-XX:ZVerifyForwarding</td>
</tr>
<tr>
<td>-XX:MaxHeapSize, -Xms</td>
<td>-XX:ZVerificationInterval</td>
<td>-XX:ZVerifyMarking</td>
</tr>
<tr>
<td>-XX:SoftMaxHeapSize</td>
<td>-XX:ZVerificationLimit</td>
<td>-XX:ZVerifyObjects</td>
</tr>
<tr>
<td>-XX:ConcGCThreads</td>
<td>-XX:ZVerification</td>
<td>-XX:ZVerifyRoots</td>
</tr>
<tr>
<td>-XX:ParallelGCThreads</td>
<td></td>
<td>-XX:ZVerifyViews</td>
</tr>
<tr>
<td>-XX:UseDynamicNumberOfGCThreads</td>
<td>-XX:ZVerificationObject</td>
<td>-XX:ZVerifyStoreBarriers</td>
</tr>
<tr>
<td>-XX:UseLargePages</td>
<td>-XX:ZVerificationPerformance</td>
<td></td>
</tr>
<tr>
<td>-XX:UseLargePages</td>
<td>-XX:ZVerificationDelay</td>
<td></td>
</tr>
<tr>
<td>-XX:UseNUMA</td>
<td>-XX:ZVerificationDetails</td>
<td></td>
</tr>
<tr>
<td>-XX:SoftRefLRUPolicyMSPerMB</td>
<td>-XX:ZMonitoringFramework</td>
<td></td>
</tr>
<tr>
<td>-XX:AllocateHeapAt</td>
<td>-XX:ZMonitoringFramework</td>
<td></td>
</tr>
</tbody>
</table>
In addition to these the following flags are available when the generational mode is enabled with `-XX:+UseZGC -XX:+ZGenerational`:
<table>
<thead>
<tr>
<th>General GC Options</th>
<th>ZGC Options</th>
<th>ZGC Diagnostic Options (-XX: +UnlockDiagnosticVMOptions)</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td>-XX:ZYoungGCThreads</td>
<td>-XX:ZYoungGCThreads</td>
</tr>
<tr>
<td></td>
<td>-XX:ZOldGCThreads</td>
<td>-XX:ZOldGCThreads</td>
</tr>
<tr>
<td></td>
<td>-XX:ZBufferStoreBarriers</td>
<td>-XX:ZBufferStoreBarriers</td>
</tr>
</tbody>
</table>
Setting Heap Size
The most important tuning option for ZGC is setting the maximum heap size, which you can set with the `-Xmx` command-line option. Because ZGC is a concurrent collector, you must select a maximum heap size such that the heap can accommodate the live-set of your application and there is enough headroom in the heap to allow allocations to be serviced while the GC is running. How much headroom is needed very much depends on the allocation rate and the live-set size of the application. In general, the more memory you give to ZGC the better. But at the same time, wasting memory is undesirable, so it’s all about finding a balance between memory usage and how often the GC needs to run.
ZGC has another command-line option related to the heap size named `-XX:SoftMaxHeapSize`. It can be used to set a soft limit on how large the Java heap can grow. ZGC will strive to not grow beyond this limit, but is still allowed to grow beyond this limit up to the maximum heap size. ZGC will only use more than the soft limit if that is needed to prevent the Java application from stalling and waiting for the GC to reclaim memory. For example, with the command-line options `-Xmx5g -XX:SoftMaxHeapSize=4g` ZGC will use 4GB as the limit for its heuristics, but if it can’t keep the heap size below 4GB it is still allowed to temporarily use up to 5GB.
Setting Concurrent GC Threads
**Note!** This section pertain to the non-generational version of ZGC. Generational ZGC has a more adaptive implementation and you are less likely to need to tweak the GC threads.
The second tuning option one might want to look at is setting the number of concurrent GC threads (`-XX:ConcGCThreads=<number>`). ZGC has heuristics to automatically select this number. This heuristic usually works well but depending on the characteristics of the application this might need to be adjusted. This option essentially dictates how much CPU-time the GC should be given. Give it too much and the GC will steal too much CPU-time from the application. Give it too little, and the application might allocate garbage faster than the GC can collect it.
**NOTE!!** Starting from JDK 17, ZGC dynamically scales up and down the number of concurrent GC threads. This makes it even more unlikely that you’d need to adjust the concurrent number of GC threads.
**NOTE!!!** In general, if low latency (i.e. low application response time) is important for you application, then *never* over-provision your system. Ideally, your system should never have more than 70% CPU utilization.
Returning Unused Memory to the Operating System
By default, ZGC uncommits unused memory, returning it to the operating system. This is useful for applications and environments where memory footprint is a concern, but might have a negative impact on the latency of Java threads. You can disable this feature with the command-line option `-XX:-ZUncommit`. Furthermore, memory will not be uncommitted so that the heap size shrinks below the minimum heap size (`-Xms`). This means this feature will be implicitly disabled if the minimum heap size (`-Xms`) is configured to be equal to the maximum heap size (`-Xmx`).
You can configure an uncommit delay using `-XX:ZUncommitDelay=<seconds>` (default is 300 seconds). This delay specifies for how long memory should have been unused before it's eligible for uncommit.
**NOTE!** Allowing the GC to commit and uncommit memory while the application is running could have a negative impact on the latency of Java threads. If extremely low latency is the main reason for running with ZGC, consider running with the same value for `-Xmx` and `-Xms`, and use `-XX:+AlwaysPreTouch` to page in memory before the application starts.
**NOTE!!** On Linux, uncommitting unused memory requires `fallocate(2)` with `FALLOC_FL_PUNCH_HOLE` support, which first appeared in kernel version 3.5 (for tmpfs) and 4.3 (for hugetlbfs).
Using Large Pages
Configuring ZGC to use large pages will generally yield better performance (in terms of throughput, latency and start up time) and comes with no real disadvantage, except that it's slightly more complicated to setup. The setup process typically requires root privileges, which is why it's not enabled by default.
### Enabling Large Pages On Linux
On Linux x86, large pages (also known as "huge pages") have a size of 2MB.
Let's assume you want a 16GB Java heap. That means you need 16GB / 2MB = 8192 huge pages.
The heap requires at least 16GB (8192 pages) of memory to the pool of huge pages. The heap along with other parts of the JVM will use large pages for various internal data structures (such as code heap and marking bitmaps). In this example you will reserve 9216 pages (18GB) to allow for 2GB of non-Java heap allocations to use large pages.
Configure the system's huge page pool to have the required number of pages (requires root privileges):
```bash
$ echo 9216 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
```
Note that the above command is not guaranteed to be successful if the kernel cannot find enough free huge pages to satisfy the request. Also note that it might take some time for the kernel to process the request. Before proceeding, check the number of huge pages assigned to the pool to make sure the request was successful and has completed.
```bash
$ cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
9216
```
**NOTE!** If you're using a [Linux kernel >= 4.14](https://www.kernel.org), then the next step (where you mount a hugetlbfs filesystem) can be skipped. However, if you're using an older kernel then ZGC needs to access large pages through a hugetlbfs filesystem.
Mount a hugetlbfs filesystem (requires root privileges) and make it accessible to the user running the JVM (in this example we're assuming this user has 123 as its uid).
```bash
$ mkdir /hugepages
$ mount -t hugetlbfs -o uid=123 nodev /hugepages
```
Now start the JVM using the `-XX:+UseLargePages` option.
```bash
$ java -XX:+UseZGC -Xms16G -Xmx16G -XX:+UseLargePages ...
```
If there are more than one accessible hugetlbfs filesystem available, then (and only then) do you also have to use `-XX:AllocateHeapAt` to specify the path to the filesystems you want to use. For example, assume there are multiple accessible hugetlbfs filesystems mounted, but the filesystem you specifically want to use it mounted on `/hugepages`, then use the following options.
```bash
$ java -XX:+UseZGC -Xms16G -Xmx16G -XX:+UseLargePages -XX:AllocateHeapAt=/hugepages ...
```
**NOTE!** The configuration of the huge page pool and the mounting of the hugetlbfs file system is not persistent across reboots, unless adequate measures are taken.
### Enabling Transparent Huge Pages On Linux
**NOTE!** On Linux, using ZGC with transparent huge pages enabled requires [kernel >= 4.7](https://www.kernel.org).
Use the following options to enable transparent huge pages in the VM:
```bash
-XX:+UseLargePages -XX:+UseTransparentHugePages
```
These options tell the JVM to issue `madvise(..., MADV_HUGEPAGE)` calls for memory it maps, which is useful when using transparent huge pages in `madvise` mode.
To enable transparent huge pages, you also need to configure the kernel by enabling `madvise` mode.
$ echo madvise > /sys/kernel/mm/transparent_hugepage/enabled
ZGC uses shmem huge pages for the heap, so the following kernel setting also needs to be configured:
$ echo advise > /sys/kernel/mm/transparent_hugepage/shmem_enabled
It is important to check these kernel settings when comparing the performance of different GCs. Some Linux distributions forcefully enable transparent huge pages for private pages by configuring /sys/kernel/mm/transparent_hugepage/enabled to be set to always, while leaving /sys/kernel/mm/transparent_hugepage/shmem_enabled at the default never. In this case all GCs but ZGC will make use of transparent huge pages for the heap. See Transparent Hugepage Support for more information.
Enabling NUMA Support
ZGC has NUMA support, which means it will try it's best to direct Java heap allocations to NUMA-local memory. This feature is enabled by default. However, it will automatically be disabled if the JVM detects that it's bound to only use memory on a single NUMA node. In general, you don't need to worry about this setting, but if you want to explicitly override the JVM's decision you can do so by using the -XX:+UseNUMA or -XX:-UseNUMA options.
When running on a NUMA machine (e.g. a multi-socket x86 machine), having NUMA support enabled will often give a noticeable performance boost.
Enabling GC Logging
GC logging is enabled using the following command-line option:
-XX:-UseNUMA
For general information/help on this option:
-XX:help
To enable basic logging (one line of output per GC):
-XX:-UseNUMA
To enable GC logging that is useful for tuning/performance analysis:
-XX:-UseNUMA
Change Log
JDK 21
- Support for generations (-XX:+ZGenerational) (JEP 439)
JDK 18
- Support for String Deduplication (-XX:+UseStringDeduplication)
- Linux/PowerPC support
- Various bug-fixes and optimizations
JDK 17
• Dynamic Number of GC threads
• Reduced mark stack memory usage
• macOS/aarch64 support
• GarbageCollectorMXBeans for both pauses and cycles
• Fast JVM termination
**JDK 16**
• Concurrent Thread Stack Scanning (JEP 376)
• Support for in-place relocation
• Performance improvements (allocation-initialization of forwarding tables, etc)
**JDK 15**
• Production ready (JEP 377)
• Improved NUMA awareness
• Improved allocation concurrency
• Support for Class Data Sharing (CDS)
• Support for placing the heap on NVRAM
• Support for compressed class pointers
• Support for incremental uncommit
• Fixed support for transparent huge pages
• Additional JFR events
**JDK 14**
• macOS support (JEP 364)
• Windows support (JEP 365)
• Support for tiny/small heaps (down to 8M)
• Support for JFR leak profiler
• Support for limited and contiguous address space
• Parallel pre-touch (when using -XX:+AlwaysPreTouch)
• Performance improvements (clone intrinsic, etc)
• Stability improvements
**JDK 13**
• Increased max heap size from 4TB to 16TB
• Support for uncommitting unused memory (JEP 351)
• Support for -XX:SoftMaxHeapSize
• Support for the Linux/AArch64 platform
• Reduced Time-To-Safepoint
**JDK 12**
• Support for concurrent class unloading
• Further pause time reductions
**JDK 11**
• Initial version of ZGC
• Does not support class unloading (using -XX:+ClassUnloading has no effect)
**FAQ**
**What does the “Z” in ZGC stand for?**
It doesn’t stand for anything, ZGC is just a name. It was originally inspired by, or a homage to, ZFS (the filesystem) which in many ways was revolutionary when it first came out. Originally, ZFS was an acronym for “Zetabyte File System”, but that meaning was abandoned and it was later said to not stand for anything. It's just a name. See Jeff Bonwick’s Blog for more details.
**Is it pronounced "zed gee see" or "zee gee see"?**
There’s no preferred pronunciation, both are fine.
|
{"Source-Url": "https://wiki.openjdk.org/download/export/pdfexport-20231220-201223-0608-1205/Main_cb973f527f6748388aae06d2a8804944-201223-0608-1206.pdf?contentType=application/pdf", "len_cl100k_base": 4271, "olmocr-version": "0.1.50", "pdf-total-pages": 6, "total-fallback-pages": 0, "total-input-tokens": 15572, "total-output-tokens": 4369, "length": "2e12", "weborganizer": {"__label__adult": 0.0002005100250244141, "__label__art_design": 0.0001747608184814453, "__label__crime_law": 0.00017559528350830078, "__label__education_jobs": 0.00017130374908447266, "__label__entertainment": 5.072355270385742e-05, "__label__fashion_beauty": 7.653236389160156e-05, "__label__finance_business": 0.00011104345321655272, "__label__food_dining": 0.00019240379333496096, "__label__games": 0.0003767013549804687, "__label__hardware": 0.0011873245239257812, "__label__health": 0.00018727779388427737, "__label__history": 0.00012290477752685547, "__label__home_hobbies": 5.835294723510742e-05, "__label__industrial": 0.00023066997528076172, "__label__literature": 9.888410568237303e-05, "__label__politics": 0.00012981891632080078, "__label__religion": 0.00025272369384765625, "__label__science_tech": 0.0092315673828125, "__label__social_life": 5.3048133850097656e-05, "__label__software": 0.0172119140625, "__label__software_dev": 0.96923828125, "__label__sports_fitness": 0.00015544891357421875, "__label__transportation": 0.00015234947204589844, "__label__travel": 0.00012290477752685547}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 16162, 0.03326]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 16162, 0.19496]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 16162, 0.83851]], "google_gemma-3-12b-it_contains_pii": [[0, 2462, false], [2462, 5119, null], [5119, 9057, null], [9057, 12376, null], [12376, 14232, null], [14232, 16162, null]], "google_gemma-3-12b-it_is_public_document": [[0, 2462, true], [2462, 5119, null], [5119, 9057, null], [9057, 12376, null], [12376, 14232, null], [14232, 16162, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, false], [5000, 16162, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 16162, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 16162, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 16162, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 16162, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 16162, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 16162, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 16162, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 16162, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 16162, null]], "pdf_page_numbers": [[0, 2462, 1], [2462, 5119, 2], [5119, 9057, 3], [9057, 12376, 4], [12376, 14232, 5], [14232, 16162, 6]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 16162, 0.13171]]}
|
olmocr_science_pdfs
|
2024-11-29
|
2024-11-29
|
903f690abbe3768b6e44aead9964e3cdb0ff4087
|
[REMOVED]
|
{"Source-Url": "http://nalag.cs.kuleuven.be/papers/ade/toolbox/preprint.pdf", "len_cl100k_base": 4860, "olmocr-version": "0.1.53", "pdf-total-pages": 10, "total-fallback-pages": 0, "total-input-tokens": 32686, "total-output-tokens": 5887, "length": "2e12", "weborganizer": {"__label__adult": 0.0004351139068603515, "__label__art_design": 0.0013751983642578125, "__label__crime_law": 0.0005688667297363281, "__label__education_jobs": 0.00043129920959472656, "__label__entertainment": 0.00016498565673828125, "__label__fashion_beauty": 0.00025153160095214844, "__label__finance_business": 0.0002639293670654297, "__label__food_dining": 0.0005278587341308594, "__label__games": 0.0005145072937011719, "__label__hardware": 0.004058837890625, "__label__health": 0.00119781494140625, "__label__history": 0.0004820823669433594, "__label__home_hobbies": 0.00014328956604003906, "__label__industrial": 0.0009670257568359376, "__label__literature": 0.0002684593200683594, "__label__politics": 0.00041294097900390625, "__label__religion": 0.0009098052978515624, "__label__science_tech": 0.369140625, "__label__social_life": 0.00011658668518066406, "__label__software": 0.026580810546875, "__label__software_dev": 0.58984375, "__label__sports_fitness": 0.00036716461181640625, "__label__transportation": 0.000537872314453125, "__label__travel": 0.00029921531677246094}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 22586, 0.02762]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 22586, 0.69662]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 22586, 0.89694]], "google_gemma-3-12b-it_contains_pii": [[0, 2084, false], [2084, 5049, null], [5049, 7550, null], [7550, 9818, null], [9818, 11735, null], [11735, 13579, null], [13579, 14319, null], [14319, 16981, null], [16981, 19886, null], [19886, 22586, null]], "google_gemma-3-12b-it_is_public_document": [[0, 2084, true], [2084, 5049, null], [5049, 7550, null], [7550, 9818, null], [9818, 11735, null], [11735, 13579, null], [13579, 14319, null], [14319, 16981, null], [16981, 19886, null], [19886, 22586, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 22586, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 22586, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 22586, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 22586, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 22586, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 22586, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 22586, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 22586, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 22586, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 22586, null]], "pdf_page_numbers": [[0, 2084, 1], [2084, 5049, 2], [5049, 7550, 3], [7550, 9818, 4], [9818, 11735, 5], [11735, 13579, 6], [13579, 14319, 7], [14319, 16981, 8], [16981, 19886, 9], [19886, 22586, 10]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 22586, 0.04132]]}
|
olmocr_science_pdfs
|
2024-12-09
|
2024-12-09
|
f73a57bbc487ec773d6c98d641d4773acd443bf4
|
Kyrix: Interactive Visual Data Exploration at Scale
Wenbo Tao
MIT CSAIL
wenbo@mit.edu
Xiaoyu Liu
Purdue University
liu1962@purdue.edu
Çağatay Demiralp
MIT CSAIL
cagatay@csail.mit.edu
Remco Chang
Tufts University
remco@cs.tufts.edu
Michael Stonebraker
MIT CSAIL
stonebraker@csail.mit.edu
ABSTRACT
Scalable interactive visual data exploration is crucial in many domains due to increasingly large datasets generated at rapid rates. Details-on-demand provides a useful interaction paradigm for exploring large datasets, where the user starts at an overview, finds regions of interest, zooms in to see detailed views, zooms out and then repeats. This paradigm is the primary user interaction mode of widely-used systems such as Google Maps, Aperture Tiles and ForeCache. These earlier systems, however, are highly customized with hardcoded visual representations and optimizations. A more general framework is needed to facilitate the development of visual data exploration systems at scale. In this paper, we present Kyrix, an end-to-end system for developing scalable details-on-demand visualizations. Kyrix provides the developer with a declarative model for easy specification of general visualizations. Behind the scenes, Kyrix utilizes a suite of performance optimization techniques to achieve a response time within 500 ms for various user interactions. We also report results from a performance study which shows that a novel dynamic fetching scheme adopted by Kyrix outperforms tile-based fetching used in traditional systems.
Keywords
Scalable visual analysis, interactivity with large data, query optimization.
1. INTRODUCTION
Interactive visual data exploration over massive datasets is becoming increasingly important. With the rapid generation of data across domains, it is not unusual for analysts in application domains to deal with datasets of sizes in the order of terabytes or petabytes. Since fluid interactions help allocate human attention efficiently over data [13], interactivity should not be compromised when exploring big datasets, which can easily overwhelm analysts.
Details-on-demand [21] is a common interaction pattern that arises from exploratory data analysis practices and can be particularly effective in exploring complex datasets, reducing the user’s information load. In this paradigm, the user starts with an overview of a dataset and then zooms into a smaller subset of interest within the dataset to examine this data patch [16], while querying details on items within the focused region as needed. The user repeats the same process after zooming further into or zooming out of the current region. However, most visual exploration systems cannot handle very large datasets, let alone enable details-on-demand interactions. Large datasets make it challenging to bound the interaction response times within 500 ms, which is required for sustaining an interactive user experience [13].
Several earlier details-on-demand systems address interactivity challenges at scale with highly-customized implementations. Google Maps and Aperture Tiles [8] precompute image tiles of the entire world map at multiple levels of details. Similarly, imMens [14] supports interactive brushing & linking in binned plots by precomputing tiled data cubes. ATLAS [7] uses predictive prefetching and level-of-detail management to improve the panning and zooming performance on large time-series datasets. ForeCache [2] also adopts predictive prefetching and data tiling to sustain interactive exploration of large amounts of satellite images. Although these earlier systems use similar approaches to scale to large datasets, they are one-off tools developed from scratch for specific datasets. The optimization techniques used in these systems are often inaccessible to visualization developers at scale, who are not necessarily experts in performance optimizations. Furthermore, current general-purpose data visualization tools [5, 18, 9] provide limited support for the
To accelerate the development of scalable visual data exploration systems, we need general-purpose tools that can help the developer handle large datasets by using effective optimization techniques (e.g., indexing, caching and prefetching). This warrants an integrative, end-to-end approach to visualization specification, where performance optimizations and data are pushed to the backend server and databases.
In this paper, we present the design of Kyrix, a novel system for the developer to build large-scale details-on-demand visualizations. Our goal is to achieve both generality and scalability. Figure 1 shows the architecture of Kyrix. On the developer side, we offer a concise yet expressive declarative language for specifying visualizations. Declarative designs enable the developer to focus on visual specification without being concerned with execution details (e.g., backend optimization and frontend rendering) [20]. On the execution side, there are three main components: the compiler, the backend server, and the frontend renderer. The compiler parses the developer’s specification and performs basic constraint checking. Based on the developer’s specifications, the backend server then builds indexes and performs necessary precomputation. The frontend renderer is responsible for listening to user activities, communicating with the backend server to fetch data and rendering the visualizations.
In the following, we first discuss a simple map visualization created using Kyrix, briefly demonstrating the use of its declarative language. We then introduce optimizations used by Kyrix that facilitate fluid details-on-demand interactions. Next we discuss useful extensions to the Kyrix system along with avenues of future research. We then put Kyrix in the context of earlier scalable visualization systems and visualization specification grammars. We conclude by summarizing our contributions and reiterating our vision on accelerating the development of interactive visualizations for massive datasets.
2. DEVELOPING INTERACTIVE VISUALIZATIONS WITH KYRIX
The goal of Kyrix is to provide an end-to-end solution for the developer to create details-on-demand visualizations. To this end, Kyrix offers a declarative language for easy visualization specification.
2.1 Kyrix Declarative Language
Kyrix’s declarative model has two basic abstractions: canvas and jump. A canvas is an arbitrary size worksheet with one or more overlaid layers, forming a single view showing a static visualization. A jump is a customized transition from one canvas to another. This model allows easy specifications of common details-on-demand interactions such as panning, geometric and semantic zooming. The Kyrix declarative language is data type agnostic and supports a myriad of specific visualizations. To render a layer, the developer specifies the following:
1. The data needed for the layer. This is specified using a SQL query to a DBMS along with a transform function postprocessing the query result. The developer can use existing visualization libraries (e.g., D3 and Vega) to specify a desired transform function (e.g., layout transforms, scaling, etc).
2. The location of each returned data item on the canvas. This is specified using a placement function.
3. A rendering function that converts a data object to shapes on the screen. A rendering function can be written using lower-level visualization specification libraries such as D3.
A jump transition can be established simply by specifying a source canvas, a destination canvas and a transition type (currently it can be geometric zoom, semantic zoom or both). It can also be customized in many ways. For example, the developer can specify a subset of objects on the source canvas that can trigger this jump. For more details on the language, interested readers can refer to our developer manual.
2.2 Example: Map of US Crime Rates
We now describe an interactive application created using Kyrix. The example visualizes the US crime rates per state and county (Figure 2). There are two canvases in this application. The initial canvas in Figure 2a shows a map of the state-level crime rates. The user can click on a state and zoom into a second, pannable canvas that shows the crime rates at the county level (Figure 2c). In the current implementation, the developer is expected to write specifications in Javascript. Figure 3 shows a snippet for this example.
Reference
1. Geometric zooming refers to scaling the visualization to show different levels of details. Data type and visual encoding are unchanged. Semantic zooming, in contrast, connects different views showing related data using smooth zoom-like transitions. Data type and visual encoding can both be changed.
2. https://github.com/tracyhenry/Kyrix/wiki/API-
// construct an application object
var app = new App("usmap", "config.txt");
// state map canvas
var stateMapCanvas = new Canvas("statemap");
app.addCanvas(stateMapCanvas);
// add transforms
stateMapCanvas.addTransform(transforms.emptyTransform);
stateMapCanvas.addTransform(transforms.stateMapTransform);
// static legend layer
var stateMapLegendLayer = new Layer("empty", true);
stateMapCanvas.addLayer(stateMapLegendLayer);
stateMapLegendLayer.addRenderingFunc(renderers.
stateMapRendering); return
// ========== state -> county ==========
// ========== county map canvas ==========
var stateBorderLayer = new Layer("stateMapTrans", false);
stateMapCanvas.addLayer(stateBorderLayer);
stateBorderLayer.addPlacement(placements.
stateMapPlacement);
stateBorderLayer.addRenderingFunc(renderers.
stateMapRendering); return
// ======== county map canvas ========
// state map canvas
Figure 3: A Javascript snippet of the US crime rate map example.
application. An application object (Line 2) is constructed by specifying the application name and a configuration file containing information such as the underlying DBMS. The state map canvas is specified in Lines 5–21. This canvas contains two overlaid layers: a static legend layer (lines 13–15) and a pannable state border layer (lines 18–21). Each layer is specified using an identifier of a data transform (lines 9 and 10) and a boolean value indicating whether this layer is static (Lines 13 and 18). Static layers do not need to be re-rendered as the user pans. So as the user browses within a canvas, the legend stays unchanged in the upper right-hand corner, overlaid on the state border layer. The county map canvas is similarly specified. In Figure 3 we leave out the specification of the county map canvas along with the transform, rendering and placement functions due to limited space.
A jump transition from the state canvas to the county canvas is defined in line 36. In the constructed jump object, the first two arguments are respectively the state and county canvases. The third argument specifies the jump type. The rest of the arguments are used to customize the jump transition. To complete specifying the application, the developer also specifies an initial canvas and a viewport location (line 39).
3. INTERACTIVITY IN KYRIX
In general, the interactivity problem in Kyrix is to achieve a 500 ms response time to the following user interactions: (1) A pan to a different location on the same canvas and (2) a jump to a different canvas.
In Section 3.1 we discuss how Kyrix fetches data in response to user interactions. Then in Section 3.2, we give some general guidelines that assist with achieving our goal. Lastly, Section 3.3 gives some end-to-end performance numbers. We discuss in Section 4 other performance options.
3.1 Data Fetching
As the user performs one of the operations (pan or jump), Kyrix’s frontend communicates with the backend to retrieve the data needed to render the viewport. Like previous systems (e.g., ForeCache [2]), Kyrix employs both a frontend cache and a backend cache. If there is a cache miss in both, Kyrix backend will talk to the backing DBMS to fetch data. In this data fetching process, we identify two important factors that can affect Kyrix’s performance: (1) fetching granularity and (2) database design and indexing. In the following, we describe these two factors in detail.
Fetching Granularity. The standard wisdom, as applied in Google Maps, ForeCache[2] and Aperture Tiles[8], is to decompose a canvas into fixed-size static tiles (Figure 4a). The frontend then requests the tiles that intersect with the given viewport. Every tile is individually fetched and rendered. Kyrix currently supports static tiling. Kyrix also contributes a novel fetching granularity, dynamic boxes, which amounts to requesting a box that encompasses the given viewport (Figure 4b). We call this enclosing box a dynamic box because its size and location changes dynamically. Whenever the viewport moves outside the current box, the frontend sends the current viewport location to the backend and requests a new box. There are numerous ways to calculate a box, e.g., a box centered at the viewport center having a width (height) 50% larger than the viewport width (height). We expect dynamic boxes to outperform static tiles for the following reasons:
1. compared to large tiles, dynamic boxes fetch less data;
2. compared to small tiles, dynamic boxes require fewer frontend-backend requests in general;
3. in cases where data is not uniformly distributed, dynamic boxes can adjust their sizes and locations based on data sparsity, incurring much fewer network and database trips than static tiles.
In Section 3.3, we use two simple box calculation algorithms to experimentally show that dynamic boxes are a more performant option than static tiles. We leave an in-depth performance study as future work.
Database Design and Indexing. We now describe two database designs along with two indexing schemes that we use to support static tiles and dynamic boxes. Our first database design maps tuples to static tiles and has two tables. The first table is a record table containing all raw data attributes in addition to an auto-increment tuple_id attribute. The second table contains two columns tuple_id and tile_id. Each record in this table indicates that a raw data tuple overlaps a tile. Kyrix backend uses placement functions specified by the developer to precompute the second
table. We then build Btree/hash indexes on the \( \text{tuple}_\text{id} \) column of the first table and the \( \text{tile}_\text{id} \) column of the second table. At runtime, tile queries are answered by joining these two tables on the \( \text{tuple}_\text{id} \) column.
Our second database design is based on spatial indexes in PostgreSQL. In addition to raw data attributes, we store a \( \text{bbox} \) attribute representing the bounding box of a tuple on a canvas.\(^3\) We then build a spatial index on the \( \text{bbox} \) column. Using this design, queries that request tuples whose bounding boxes intersect with a given rectangle should run fast. Therefore, this design can be used by both static tiles and dynamic boxes.
### 3.2 Performance Hygiene
**Parallelism.** Kyrix can apply parallelism to improve the data management in Kyrix. All data and metadata (canvas definitions, etc.) are stored in and retrieved from the DBMS. Although the performance experiments in the next section use PostgreSQL, it would be prudent to replace the DBMS with a parallel one if performance requirements warrant a switch. Currently, rendering is performed by a separate process on a separate CPU in the frontend. This operation can also be easily parallelized. Lastly, each concurrent Kyrix application is run in a separate process, since there is no interaction between them, except through the DBMS. Right now, Kyrix applications function like a read-only browser. Future releases will extend Kyrix to allow editing updates, which can be supported by DBMS concurrency control.
**Application Design.** Managing visual density on the screen, which can overwhelm users as well as the client (e.g., the browser) resources, is an important concern in visualization of large datasets. Application design must deal with what canvases exist and how to put data onto these canvases so that visual density is not too high.
**Separability.** Recall in Section 3.1, we describe how Kyrix precomputes database tables and indexes to ensure data fetching speed. However, when data is huge or the SQL query corresponding to a canvas layer is complex, this precomputation process can take a long time. We identify a common case where this precomputation process can be avoided: the \((x, y)\) placement of objects are directly raw data attributes, or some simple scaling of raw data attributes.
\(^3\)We assume records are generally rendered bigger than a single pixel. This bounding box information is derived from the placement functions specified by the developer.
---
**3.3 Initial Performance Results**
We conducted performance experiments on two synthetic datasets using three viewport movement traces. The goal of these experiments is to study the characteristics of the two fetching granularities when combined with different database designs. All experiments are done on an AWS EC2 m4.2xlarge instance with 8 cores and 32GB RAM. PostgreSQL 9.3 is the backing DBMS.
**Datasets.** We used two synthetic datasets, UNIFORM and SKewed. In UNIFORM, there are 100M random dots evenly distributed on a \(1\text{M}\times0.1\text{M}\) canvas. In SKewed, 80M dots lie in 20% of the canvas area (a \(0.4\text{M}\times0.05\text{M}\) rectangle) and 20M dots lie in the rest of the canvas. SKewed corresponds to the likely scenario when objects are distributed unevenly on a canvas.
**Viewport Movement Traces.** In our experiments we use three viewport movement traces illustrated in Figure 5.
(a) The viewport is always aligned with tile boundaries. It horizontally moves leftwards six steps (the length of a tile) then vertically up six steps.
(b) The viewport is never aligned with tiles. It also horizontally moves leftwards six steps (the length of a tile) then vertically upwards six steps.
(c) The viewport moves diagonally from bottom left to top right. There are six steps in total.
**Fetching schemes.** We evaluated the following fetching schemes.
- **Dbox:** Dynamic boxes with spatial index. The box fetched is exactly the viewport in each step.
- **Dbox 50%:** Dynamic boxes with spatial index. The box fetched is 50% larger than the viewport.
Results. We measured the average response time (per step) of all fetching schemes on three traces. Average results over three runs are shown in Figures 6 and 7. We have the following observations:
1. **Dbox** has the best overall performance on both **Uniform** and **Skewed**. The reasons are twofold. First, it fetches the least amount of data needed to render the viewport. Second, compared to small tiles, it issues fewer queries.
2. **Tile 1,024 spatial** has competitive performance on trace-a, and is even better than **Dbox 50%**. This is because the viewport completely aligns with tile boundaries in trace-a.
3. **Tile 4,096 and 256 spatial** have the worst performances. This is expected since the tile size 4,096 fetches more data than other fetching schemes and the tile size 256 issues more queries than other fetching schemes.
4. **DISCUSSION AND FUTURE WORK**
Previous work [2] has studied prefetching data ahead of the user’s interaction. Specifically, both momentum-based and semantic-based prefetching were considered in a tiling context. To determine what to prefetch, semantic-based prefetching uses the similarity to recently viewed data in data characteristics (e.g., distribution). Whereas, momentum-based prefetching takes the user’s recent movements (e.g., pan and zoom) into account to that end. We plan to evaluate the effectiveness of momentum-based prefetching in the context of dynamic boxes. Our future work will also study caching options for Kyrix. Caching and prefetching are challenging given the jump operation, and will be more challenging by the extension of Kyrix to support coordinated views.
Currently, we are collaborating with a neurology group at Massachusetts General Hospital (MGH), which we anticipate motivating various future extensions of Kyrix. Our collaborators want to be able to interactively explore 50 terabytes of electroencephalogram (EEG) data collected from sleeping subjects. They want three different views of the data, a temporal view, a spectral view and a composite clustering view, to be coordinated. For instance, movement in the temporal view should cause an appropriate change in the spectral view. Hence, Kyrix must be extended to support multiple canvases on the screen simultaneously and to have pan/zoom operations in one canvas cause desired actions in other canvases. In addition, MGH wants an update model for Kyrix so they can edit and tag relevant data. Fifty terabytes will require a parallel multi-node DBMS to achieve our performance goals.
Lastly, we envision Kyrix as an integrated environment for developing scalable visualization applications. To this end, e.g., we plan to work on an “application by example” interface, whereby a user can drag and drop screen objects, and Kyrix can learn to automatically generate the location function (and perhaps other parts of the application).
5. **RELATED WORK**
Kyrix is related to prior efforts in scalable visualization systems and declarative visualization specification.
5.1 Scalable Visualization Systems
Earlier research has proposed methods for scalable interactive data analysis that fall into one of the two categories in general: precomputation and sampling [10]. Precomputation, which traditionally referred to processing data into formats such as prespecified tiles or cubes, has been the prevalent approach to interactively answer queries via zooming, panning, brushing and linking. Google Maps precompute image tiles for multiple zoom layers to support scalable panning and zooming. Extending the tiling idea to structured data, imMens [14] computes multivariate data tiles in advance along with projections corresponding to materialized database and performs fast “roll ups” and rendering on the GPU. Nanocubes [12] stores and queries multi-dimensional aggregated data at multiple levels of resolution in memory for visualization. Hashedcubes [15] improves on the memory footprint and implementation complexity of Nanocubes with an incurred cost of longer query times. ForeCache [2] uses data tiling together with predictive prefetching and in-memory caching to enable scalable panning and zooming for visualizations of array-based datasets. When precomputation is not possible (e.g., queries are not known in advance),
sampling, often combined with precomputation, and online aggregation [11, 1, 3] are used to improve user experience.
Kyrix precomputes database indexes and uses novel data fetching mechanisms to efficiently respond to pan and zoom interactions. Kyrix’s new dynamic-box fetching together with spatial index outperforms tile-based fetching used in earlier systems. To ensure the 500ns response time, Kyrix also adopts predictive prefetching and caching techniques [7, 2].
5.2 Declarative Visualization Specification
Earlier research proposes declarative grammars over data as well as visual encoding and design variables to specify visualizations. In a seminal work, Wilkinson introduces a grammar of graphics [24] and its implementation (VizML), forming the basis of the subsequent research on visualization specification. Drawing from Wilkinson’s grammar of graphics, Polaris [22] (commercialized as Tableau) uses a table algebra, which later evolved to VizQL [9], the underlying representation of Tableau visualizations. Wickham introduces ggplot2 [23], a widely-popular package in the R statistical language, based on Wilkinson’s grammar. Similarly, Protovis [4], D3 [6], Vega [19], Brunel [25], and Vega-Lite [17] all provide grammars to declaratively specify visualizations.
Kyrix’s declarative grammar differs from these earlier efforts by providing constructs for specification of scalable interactive visualizations and integrating visualization specification with a server-side processing and scalable data management for performance optimization.
6. CONCLUSION
The current practice of purpose-built scalable visualization tools is itself not scalable under the fast growth of large datasets across domains. To accelerate the development pace of interactive visualization systems at scale, we need to make it easier for developers to access scalable data management models as well as performance optimizations needed for sustaining interactive rates. In this paper, we present the design of Kyrix, a novel end-to-end system for developers to build interactive, details-on-demand visualizations at scale. Kyrix enables developers to declaratively specify visualizations, while utilizing Kyrix’s suite of optimizations and data management model. Kyrix also contributes a novel dynamic fetching scheme that outperforms tile-based fetching common to existing systems.
7. REFERENCES
[21] B. Shneiderman. The eyes have it: A task by data type taxonomy for information visualizations. In
|
{"Source-Url": "http://hci.stanford.edu/~cagatay/projects/kyrix/Kyrix-CIDR19.pdf", "len_cl100k_base": 5132, "olmocr-version": "0.1.53", "pdf-total-pages": 7, "total-fallback-pages": 0, "total-input-tokens": 22362, "total-output-tokens": 6947, "length": "2e12", "weborganizer": {"__label__adult": 0.0004649162292480469, "__label__art_design": 0.001224517822265625, "__label__crime_law": 0.0004754066467285156, "__label__education_jobs": 0.000812530517578125, "__label__entertainment": 0.00017595291137695312, "__label__fashion_beauty": 0.00021314620971679688, "__label__finance_business": 0.0002963542938232422, "__label__food_dining": 0.0004184246063232422, "__label__games": 0.0007333755493164062, "__label__hardware": 0.0011911392211914062, "__label__health": 0.0008001327514648438, "__label__history": 0.0004458427429199219, "__label__home_hobbies": 8.296966552734375e-05, "__label__industrial": 0.0004532337188720703, "__label__literature": 0.0003554821014404297, "__label__politics": 0.00028133392333984375, "__label__religion": 0.0005135536193847656, "__label__science_tech": 0.1165771484375, "__label__social_life": 0.00011265277862548828, "__label__software": 0.0218658447265625, "__label__software_dev": 0.8515625, "__label__sports_fitness": 0.00029206275939941406, "__label__transportation": 0.0004680156707763672, "__label__travel": 0.00023794174194335935}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 29241, 0.02543]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 29241, 0.32012]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 29241, 0.83562]], "google_gemma-3-12b-it_contains_pii": [[0, 4017, false], [4017, 8819, null], [8819, 14312, null], [14312, 18466, null], [18466, 22740, null], [22740, 28655, null], [28655, 29241, null]], "google_gemma-3-12b-it_is_public_document": [[0, 4017, true], [4017, 8819, null], [8819, 14312, null], [14312, 18466, null], [18466, 22740, null], [22740, 28655, null], [28655, 29241, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 29241, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 29241, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 29241, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 29241, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 29241, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 29241, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 29241, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 29241, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 29241, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 29241, null]], "pdf_page_numbers": [[0, 4017, 1], [4017, 8819, 2], [8819, 14312, 3], [14312, 18466, 4], [18466, 22740, 5], [22740, 28655, 6], [28655, 29241, 7]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 29241, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-07
|
2024-12-07
|
856722370069792f583f83768b1a39ef2740c08f
|
GEMS: Graph database Engine for Multithreaded Systems
Alessandro Morari, Vito Giovanni Castellana, Antonino Tumeo, Jesse Weaver, David Haglin, Sutanay Choudhury, John Feo
Pacific Northwest National Laboratory
902 Battelle Blvd
Richland, WA 99354, USA
{alessandro.morari, vitoGiovanni.castellana, antonino.tumeo, jesse.weaver, david.haglin, sutanay.choudhury, john.feo}@pnnl.gov
Oreste Villa
NVIDIA Research
2701 San Tomas Expressway
Santa Clara, CA 95050, USA
ovilla@nvidia.com
Abstract—This paper presents GEMS (Graph database Engine for Multithreaded Systems), a software infrastructure that enables large-scale, graph databases on commodity clusters. Unlike current approaches, GEMS implements and explores graph databases by primarily employing graph-based methods. This is reflected in all the layers of the software stack. On one hand, this allows exploiting the space efficiency of graph data structures and the inherent parallelism of some graph algorithms. These features adapt well to the increasing system memory and core counts of modern commodity clusters. On the other hand, however, graph-based methods introduce irregular, fine-grained data accesses with poor spatial and temporal locality, causing performance issues with these systems that are, instead, optimized for regular computation and batched data transfers. Our framework comprises: a SPARQL to data parallel C++ compiler; a library of distributed data structures; and a custom, multithreaded, runtime system. We introduce our stack, motivate its advantages with respect to other solutions, and show how we solved the challenges posed by irregular behaviors. We evaluate our software stack on the Berlin SPARQL benchmark with datasets up to 10 billion graph edges, demonstrating scaling in dataset size and in performance as nodes are added to a cluster.
I. INTRODUCTION
Many fields require organization, management, and analysis of massive amounts of data; such fields include social network analysis, financial risk management, threat detection in complex network systems, and medical and biomedical databases. These are all examples of big data analytics in which dataset sizes increase exponentially. These application fields pose operational challenges not only in terms of sheer size but also in terms of time to solution because quickly answering queries is essential to obtain market advantages, avoid critical security issues, or prevent life threatening health problems.
Semantic graph databases seem a promising solution to store, manage, and query the large and heterogeneous datasets of these application fields. Such datasets present an abundance of relations among many elements. Semantic graph databases organize the data in the form of subject-predicate-object triples following the Resource Description Framework (RDF) data model. A set of triples naturally represent a labeled, directed multigraph. An analyst can query semantic graph databases through languages such as SPARQL in which the fundamental query operation is graph matching. This is different from conventional relational databases that employ schema-specific tables to store data and perform select and conventional join operations when executing queries. With relational approaches, graph-oriented queries on large datasets can quickly become unmanageable in both space and time due to the large sizes of immediate results created when performing conventional joins.
Graphs are memory efficient data structures for storing data that is heterogeneous or not itself rigidly structured. Graph methods based on edge traversal are inherently parallel because the system can potentially generate parallel activities for (single or group of) vertex or edge to be traversed. Modern commodity clusters – composed of nodes with increasingly higher core counts, larger main memory, and faster network interconnections – are an interesting target platform for in-memory crawling of big graphs, potentially enabling scaling in size by adding more nodes, while maintaining constant throughput. However, graph-based methods are irregular: they exhibit poor spatial and temporal locality, perform fine-grained data accesses, usually present high synchronization intensity, and have datasets with high data skew which can lead to severe load imbalance. These characteristics make the execution of graph exploration algorithms on commodity clusters challenging. In fact, modern clusters are optimized for applications that exhibit regular behaviors, high (floating point) arithmetic intensity, and have easily partition able datasets with high locality: they integrate multicore processors with high flop ratings and complex cache hierarchies, and networks that reach peak bandwidth only with large, batched data transfers. However, the parallelism of graph-based methods can be exploited to realize multithreaded execution models that create and manage an oversubscription of tasks to cores, allowing for toleration of data access latency, rather than reducing it through locality.
In this paper, we present GEMS (Graph database Engine for Multithreaded Systems), a complete software stack that
implements a semantic graph database for big data analytics on commodity clusters. Currently available semantic graph databases usually implement mechanisms to store, retrieve, and query triples on top of conventional relational databases, or still resort to relational approaches for some of their components. In contrast, GEMS approaches semantic graph databases primarily with graph-based methods at all the levels of the stack. GEMS includes: a compiler that converts SPARQL queries to data parallel graph pattern matching operations in C++; a library of parallel algorithms and related, distributed data structures; and a custom, multithreaded, runtime layer for commodity clusters.
We describe GEMS and its underlying runtime, discussing how we solved limitations of commodity clusters with applications that exhibit irregular behaviors to enable scaling in size and performance.
II. GEMS OVERVIEW
Figure 1 provides an overview of the architecture of our Graph database Engine for Multithreaded Systems (GEMS). As previously introduced, GEMS comprises: a SPARQL to C++ compiler; a Semantic Graph library (SGLib) of supporting data structures such as graph and dictionary with the related parallel Application Programming Interface (API) to access them; and a Global Memory and Threading (GMT) runtime layer.
The top layer consists of the compilation phases. The compiler transforms the input SPARQL queries into intermediate representations that are analyzed for optimization opportunities. Potential optimization opportunities are discovered at multiple levels. Depending on statistics of the datasets, certain query clauses can be moved, enabling early pruning of the search. Then, the optimized intermediate representation is converted into C++ code that contains calls to the SGLib API. SGLib APIs completely hide the low-level APIs of GMT, exposing to the compiler a lean, simple, pseudo-sequential shared-memory programming model. SGLib manages the graph database and query execution. SGLib generates the graph database and the related dictionary by ingesting the triples. Triples can, for example, be RDF triples stored in N-Triples format. The approach implemented by our system to extract information from the semantic graph database is to solve a structural graph pattern matching problem. GEMS employs a variation of Ullmann’s subgraph isomorphism algorithm [1]. The GMT layer provides the key features that enable management of the data structures and load balancing across the nodes of the cluster. GMT is co-designed with the upper layers of the graph database engine so as to better support the irregularity of graph pattern matching operations. GMT provides a Partitioned Global Address Space (PGAS) data model, hiding the distributed nature of the cluster. GMT exposes to SGLib an API that permits allocating, accessing, and freeing data in the virtual shared memory. Differently from other PGAS libraries, GMT employs a control model typical of shared-memory systems: fork-join parallel constructs that generate thousands of lightweight tasks. These lightweight tasks allow hiding the latency for accessing data on remote cluster nodes; they are switched in and out of processor cores while communication proceeds. Finally, GMT aggregates operations before communicating to other nodes, increasing network bandwidth utilization.
Figure 2 shows an example RDF dataset and a related query in different stages of compilation. Figure 2a shows the dataset in N-Triples format (a common serialization format for RDF), and Figure 2b shows the corresponding graph representation. Figure 2c shows the SPARQL description of the query, Figure 2d illustrates its graph pattern, and Figure 2e shows the pseudocode generated by the compiler and executed by GMT through SGLib.
GEMS has minimal system-level library requirements: besides Pthreads, it only needs MPI for the GMT communication layer and Python for some compiler phases and for glue scripts. Currently, GEMS also requires x86-compatible processors because GMT employs optimized context switching routines. However, this requirement may be removed by developing specific context switching routines for other architectures.
III. RELATED APPROACHES
Many commercial and open source SPARQL engines are available. We can distinguish between purpose-built databases for the storage and retrieval of triples (triplestores), and solutions that try to map triple stores on top of existing commercial databases, usually relational SQL-based systems. However, obtaining feature-complete SPARQL-to-SQL translation is difficult, and may introduce performance penalties. Translating SPARQL to SQL implies the use of relational algebra to perform optimizations, and the use of classical relational operators (e.g., conventional joins and selects) to execute the query. By translating SPARQL to graph pattern matching operations, GEMS reduces the overhead for intermediate data structures and can exploit optimizations that look at the execution plan (i.e., order of execution) from a graph perspective.
SPARQL engines can further be distinguished between solutions that process queries in-memory and solutions that store data on disks and perform swapping. Jena (with the ARQ SPARQL engine [2]), Sesame [3], and Redland [4] (aka librdf) are all example of RDF libraries that natively implement in-memory RDF storage and support integration with some disk-based, SQL backends. OpenLink Virtuoso [5] implements a RDF/SPARQL layer on top of their SQL-based column store for which multi-node, cluster support is available. GEMS
adapts in-memory processing: it stores all data structures in RAM. In-memory processing potentially allows increasing the dataset size while maintaining constant query throughput by adding more cluster nodes.
Some approaches leverage MapReduce infrastructures for RDF-encoded databases. SHARD [6] is a triplestore built on top of Hadoop, while YARS2 [7] is a bulk-synchronous, distributed, query answering system. Both exploit hash partitioning to distribute triples across nodes. These approaches work well for simple index lookups, but they also present high communication overheads for moving data through the network with more complex queries, as well as introduce load-balancing issues in the presence of data skew. More general graph libraries, such as Pregel [8], Giraph [9], and GraphLab [10] may also be exploited to explore semantic databases, once the source data have been converted into a graph. However, they require significant additions to work in a database environment, and they still rely on bulk-synchronous, parallel models that do not perform well for large and complex queries. Our system relies on a custom runtime that provides specific features to support exploration of a semantic database through graph-based methods.
YarcData [11] targeted at big data analytics. YarcData custom nodes with purpose-built multithreaded processors (barrel processors with up to 128 threads and a very simple cache) derived from the Cray XMT. Beside multithreading, which allows tolerating latencies for accessing data on remote nodes, the system has hardware support for a scrambled global address space and fine-grained synchronization. These features allow more efficient execution of irregular applications, such as graph exploration. On top of this hardware, YarcData interfaces with the Jena framework to provide a front-end API. GEMS, instead, exploits clusters built with commodity hardware that are cheaper to acquire and maintain, and which are able to evolve more rapidly than custom hardware.
IV. GMT: ADDRESSING LIMITATIONS OF COMMODITY CLUSTERS WITH IRREGULAR ALGORITHMS
The GMT runtime system enables GEMS to scale in size and performance on commodity clusters. GMT is built around three main “pillars”: global address space, latency tolerance through fine-grained software multithreading, and remote data access aggregation (also known as coalescing). Global address space (through PGAS) relieves the other layers of GEMS from partitioning the data structures and from orchestrating communication. Message aggregation maximizes network bandwidth utilization, despite the small data accesses typical of graph methods on shared-memory systems. Fine-grained multithreading allows hiding the latency for remote data transfers, and the added latency for aggregation, by exploiting the inherent parallelism of graph algorithms. Figure 3a shows the high-level design of GMT. Each node executes an instance of GMT. Different instances communicate through commands, which describe data, synchronization, and thread management operations. GMT is a parallel runtime with three types of specialized threads. The main idea is to exploit the cores of modern processors to support the functionalities of the runtime. The specialized threads are:
- **Worker**: executes application code, in the form of lightweight user tasks, and generates commands directed to other nodes;
- **Helper**: manages global address space and synchronization, and handles incoming commands from other nodes;
- **Communication Server**: endpoint for the network, it manages all incoming/outgoing communication at the node level in form of network messages, which contain the commands.
The specialized threads are implemented as POSIX threads, each one pinned to a core. The communication server employs MPI to send and receive messages to and from other nodes.
There are multiple helpers and workers per node (usually an equal number, although this is one of the tunable parameters depending on the target machine) and a single communication server.
SGLib contains data structures that are implemented using shared arrays in GMT’s virtual global address space. Among them, there are the graph data structure and the related dictionary. The dictionary is used to map vertex and edge labels (actually RDF terms) to unique integer identifiers. This allows us to compress the graph representation in memory as well as perform label/term comparisons much more efficiently. Dictionary encoding is common practice in database systems. The SPARQL-to-C++ compiler assumes to operate on a shared-memory system and does not need to reason about the physical partitioning of the database. However, as is common in PGAS libraries, GMT also exposes locality information, allowing reduction of data movements whenever possible. Because graph exploration algorithms mostly have loops that run through edge or vertex lists, GMT provides a parallel loop construct that maps loop iterations to lightweight tasks. GMT supports task generation from nested loops and allows specifying the number of iterations of a loop mapped to a task. GMT also allows controlling code locality, enabling to spawn (or move) tasks on preselected nodes, instead of to a task. GMT also allows controlling code locality, enabling to spawn (or move) tasks on preselected nodes, instead of moving data. SGLib routines exploit these features to better manage its internal data structures. SGLib routines access data through put and get communication primitives, moving them into local space for manipulation and writing them back to the global space. The communication primitives are available both with blocking and non-blocking semantics. GMT also provides atomic operations, such as atomic addition and test-and-set, on data allocated in the global address space. SGLib exploits them to protect parallel operations on the graph datasets and to implement global synchronization constructs for database management and querying.
A. Aggregation
Graph exploration algorithms present fine-grained data accesses: for-loops effectively run through edges and/or vertices represented by pointers, and each pointer may point to a location in a completely unrelated memory area. With partitioned datasets on distributed memory systems, expert programmers have to implement by hand optimizations to aggregate requests and reduce the overhead due to small network transactions. GMT hides these complexities from the other layers of GEMS by implementing automatic message aggregation.
GMT collects commands directed towards the same destination nodes in aggregation queues. GMT copies commands and their related data (e.g., values requested from the global address space with a get) into aggregation buffers, and sends them in bulk. Commands are then unpacked and executed at the destination node. At the node level, GMT employs high-throughput, non-blocking aggregation queues, which support concurrent access from multiple workers and helpers. Accessing these queues for every generated command would have a very high cost. Thus, GMT employs a two-level aggregation mechanism: workers (or helpers) initially collect commands in local command blocks, and then they insert command blocks into the aggregation queues. Figure 3b describes the aggregation mechanism. When aggregation starts, workers (or helpers) request a pre-allocated command block from the command block pool (1). Command blocks are pre-allocated and reused for performance reasons. Commands generated during program execution are collected into the local command block (2). A command block is pushed into aggregation queues when: (a) it is full, or (b) when it has been waiting longer than a pre-determined time interval. Condition (a) is true when all the available entries are occupied with commands, or when the equivalent size in bytes of the commands (including any attached data) reaches the size of the aggregation buffer. Condition (b) allows setting a (configurable) upper bound for the latency added by aggregation. After pushing a command block, when a worker or a helper finds that the aggregation queue has sufficient data to fill an aggregation buffer, it starts popping command blocks from the aggregation queue and copying them with the related data into an aggregation buffer (4, 5, and 6). Aggregation buffers also are pre-allocated and recycled to save memory space and eliminate allocation overhead. After the copy, command blocks are returned to the command block pool (7). When the aggregation buffer is full, the worker (or helper) pushes it into a channel queue (8). Channel queues are high-throughput, single-producer, single-consumer queues that workers and helpers use to exchange data with the communication server. If the communication server finds a new aggregation buffer in one of the channel queues, it pops it (9) and performs a non-blocking MPI send (10). The aggregation buffer is then returned into the pool of free aggregation buffers.
The size of aggregation buffers and the time intervals for pushing out aggregated data are configurable parameters that depends on the interconnection of the cluster on which GEMS resides. Buffers should be sufficiently large to maximize network throughput, while time intervals should not increase the latency over the values maskable through multithreading.
B. Multithreading
Concurrency, through fine-grained software multithreading, allows tolerance for both the latency for accessing data on remote nodes and the added latency for aggregating communication operations. Each worker executes a set of GMT tasks. The worker switches among tasks’ contexts every time it generates a blocking command that requires a remote memory operation. The task that generated the command executes again only when the command itself completes (i.e., it gets a reply back from the remote node). In case of non-blocking commands, the task continues executing until it encounters a wait primitive.
GMT implements custom context switching primitives that avoid some of the lengthy operations (e.g., saving and restoring signal mask) performed by the standard libc context switching routines. Figure 3c schematically shows how GMT executes a task. A node receives a message containing a spawn command (1) that is generated by a worker on a remote node when encountering a parallel construct. The communication server passes the buffer containing the command to a helper that parses the buffer and executes the command (2). The helper then creates an iteration block (ib). The ib is a data structure that contains the function to execute, the arguments of the function itself, and a counter of tasks that execute the same function. This way of representing a set of tasks avoids the cost
of creating a large number of function arguments and sending them over the network. In the following step, the helper pushes the iteration block into the itb queue (3). Then, an idle worker pops an itb from the itb queue (5), decreases the counter of t and pushes it back into the queue (6). The worker creates t tasks (6) and pushes them into its private task queue (7). At this point, the idle worker can pop a task from its task queue (8). If the task is executable (i.e., all the remote operations completed), the worker restores the task’s context and executes it (9). Otherwise, it pushes the task back into the task queue. If the task contains a blocking remote request, the task enters a waiting state (10) and is reinserted into the task queue for future execution (11).
This mechanism provides load balancing at the node level because each worker gets new tasks from the itb queue as soon as its task queue is empty. At the cluster level, GMT evenly splits tasks across nodes when it encounters a parallel for-loop construct. If, instead, a task creation addresses a specific node, the task is created on that node.
V. EXPERIMENTAL RESULTS
We evaluated GEMS on the Olympus supercomputer at Pacific Northwest National Laboratory’s Institutional Computing center, listed in the TOP500 [12]. Olympus is a cluster of 604 nodes interconnected through a QDR Infiniband switch with 648 ports (theoretical peak of 4GB/s). Each of Olympus’ node features two AMD Opteron 6,272 processors at 2.1 GHz and 64 GB of DDR3 memory clocked at 1,600 MHz. Each socket hosts eight processor modules (two integer cores, one floating point core per module) on two different dies, for a total of 32 integer cores per node. We configured the GEMS stack with 15 workers, 15 helpers, and 1 communication server per node. Each worker hosts up to 1,024 lightweight tasks. We measured the MPI bandwidth of Olympus with the OSU Micro-Benchmarks 3.9 [13], reaching a peak (around 2.8 GB/s) with messages of at least 64 KB. Therefore, we set the aggregation buffer size at 64 KB. Each communication channel hosts up to four buffers. There are two channels per helper and one channel per worker. We initially present some synthetic benchmarks of the runtime, highlighting the combined effects of multithreading and aggregation to maximize network bandwidth utilization. We then show experimental results of the whole GEMS infrastructure on a well established benchmark, the Berlin SPARQL Benchmark (BSBM) [14].
A. Synthetic Benchmarks
Figure 4 shows the transfer rates reached by GMT with small messages (from 8 to 128 bytes) when increasing the number of tasks. Every task executes 4,096 blocking put operations. Figure 4a shows the bandwidth between two nodes, and Figure 4b shows the bandwidth among 128 nodes. The figures show how increasing the concurrency increases the transfer rates, because there is a higher number of messages that GMT can aggregate. For example, across two nodes (Figure 4a) with 1,024 tasks each, puts of eight bytes reach a bandwidth of 8.55 MB/s. With 15,360 tasks, instead, GMT reaches 72.48 MB/s. When increasing message sizes to 128 bytes, 15,360 tasks provide almost 1 GB/s. For reference, 32 MPI processes with 128B messages only reach 72.52 MB/s. With more destination nodes, the probability of aggregating enough data to fill a buffer for a specific remote node decreases. Although there is a slight degradation, Figure 4b shows that GMT is still very effective. For example, 15,360 tasks with 16B messages reach 139.78 MB/s, while 32 MPI processes only provide up to 9.63 MB/s.
B. GEMS
BSBM defines a set of SPARQL queries and datasets to evaluate the performance of semantic graph databases and systems that map RDF into other kinds of storage systems. Berlin datasets are based on an e-commerce use case with millions to billions of commercial transactions, involving many product types, producers, vendors, offers, and reviews. We run queries one through six of the Business Intelligence use-case on datasets with 100M, 1B, and 10B triples. The subtables of Table I respectively show the build time of the database and the execution time of the queries on 100M (Subtable Ia), 1B (Subtable Ib), and 10B (Subtable Ic) triples, while progressively increasing the number of cluster nodes. Sizes of the input files respectively are 21 GB (100M), 206
VI. CONCLUSIONS
In this paper we presented GEMS, a full software stack for semantic graph databases on commodity clusters. Different from other solutions, GEMS proposes an integrated approach that primarily utilizes graph-based methods across all the layers of its stack. GEMS includes a SPARQL-to-C++ compiler, a library of algorithms and data structures, and a custom runtime. The custom runtime (GMT - Global Memory and Threading) provides to all the other layers several features that simplify the implementation of the exploration methods and makes more efficient their execution on commodity clusters. GMT provides a global address space, fine-grained multithreading (to tolerate latencies for accessing data on remote nodes), remote message aggregation (to maximize network bandwidth utilization), and load balancing. We have demonstrated how this integrated approach provides scaling in size and performance as more nodes are added to the cluster.
REFERENCES
|
{"Source-Url": "http://acs.ict.ac.cn/asbd2014/papers/ASBD_paper_Morari.pdf", "len_cl100k_base": 5226, "olmocr-version": "0.1.49", "pdf-total-pages": 6, "total-fallback-pages": 0, "total-input-tokens": 20537, "total-output-tokens": 6674, "length": "2e12", "weborganizer": {"__label__adult": 0.00030541419982910156, "__label__art_design": 0.00032806396484375, "__label__crime_law": 0.00034809112548828125, "__label__education_jobs": 0.0004794597625732422, "__label__entertainment": 9.167194366455078e-05, "__label__fashion_beauty": 0.00014162063598632812, "__label__finance_business": 0.0003478527069091797, "__label__food_dining": 0.0003364086151123047, "__label__games": 0.0005164146423339844, "__label__hardware": 0.0016918182373046875, "__label__health": 0.00046896934509277344, "__label__history": 0.0002880096435546875, "__label__home_hobbies": 8.7738037109375e-05, "__label__industrial": 0.000579833984375, "__label__literature": 0.0001939535140991211, "__label__politics": 0.00027561187744140625, "__label__religion": 0.00046443939208984375, "__label__science_tech": 0.10101318359375, "__label__social_life": 8.422136306762695e-05, "__label__software": 0.0181427001953125, "__label__software_dev": 0.873046875, "__label__sports_fitness": 0.0002453327178955078, "__label__transportation": 0.0005135536193847656, "__label__travel": 0.0002231597900390625}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 29916, 0.02684]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 29916, 0.49859]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 29916, 0.88302]], "google_gemma-3-12b-it_contains_pii": [[0, 5145, false], [5145, 10734, null], [10734, 14588, null], [14588, 21491, null], [21491, 25861, null], [25861, 29916, null]], "google_gemma-3-12b-it_is_public_document": [[0, 5145, true], [5145, 10734, null], [10734, 14588, null], [14588, 21491, null], [21491, 25861, null], [25861, 29916, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 29916, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 29916, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 29916, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 29916, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 29916, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 29916, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 29916, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 29916, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 29916, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 29916, null]], "pdf_page_numbers": [[0, 5145, 1], [5145, 10734, 2], [10734, 14588, 3], [14588, 21491, 4], [21491, 25861, 5], [25861, 29916, 6]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 29916, 0.0]]}
|
olmocr_science_pdfs
|
2024-11-24
|
2024-11-24
|
c549a4ce5524698c75cb0ade2dee1cc03b2ae34c
|
Declarative Process Mining for DCR Graphs
Debois, Søren; Hildebrandt, Thomas T.; Laursen, Paw Høvsgaard; Ulrik, Kenneth Ry
Published in:
Proceedings of the Symposium on Applied Computing
DOI:
10.1145/3019612.3019622
Publication date:
2017
Document version
Publisher's PDF, also known as Version of record
Citation for published version (APA):
Declarative Process Mining for DCR Graphs*
Søren Debois
IT University of Copenhagen
Copenhagen, Denmark
debois@itu.dk
Thomas T. Hildebrandt
IT University of Copenhagen
Copenhagen, Denmark
hilde@itu.dk
Paw Høvsgaard Laursen
IT University of Copenhagen
Copenhagen, Denmark
pawh@itu.dk
Kenneth Ry Ulrik
IT University of Copenhagen
Copenhagen, Denmark
kulr@itu.dk
ABSTRACT
We investigate process mining for the declarative Dynamic Condition Response (DCR) graphs process modelling language. We contribute (a) a process mining algorithm for DCR graphs, (b) a proposal for a set of metrics quantifying output model quality, and (c) a preliminary example-based comparison with the Declare Maps Miner. The algorithm takes a contradiction-based approach, that is, we initially assume that all possible constraints hold, subsequently removing constraints as they are observed to be violated by traces in the input log.
CSC Concepts
•Information systems → Data mining; •Theory of computation → Logic; •Computing methodologies →
Knowledge representation and reasoning;
Keywords
Declarative process mining; DCR graphs
1. INTRODUCTION
Business process management (BPM) technologies [32] support the management and digitalisation of workflows and business processes by employing explicit process models, following a cycle of process (re)design, validation, execution and monitoring.
Process mining algorithms [31] have been proposed for the identification of process models from process logs, supporting both process design and compliance monitoring.
Most industrial BPM tools and process miners describe processes as imperative flow diagrams such as BPMN. However, flow diagrams tend to get either too rigid or too complex, in particular for knowledge work processes having a high degree of variation [27]. Moreover, flow diagrams only describe how to perform a process, leaving a gap to the legal regulations and guidelines, that are often more declarative in nature, describing why the process must be performed in certain ways, not how exactly it must be performed. For instance, a clinical guideline may state, that a patient must consent to a blood transfusion [13]. It does not state exactly when such consent should be obtained, only “prior to the transfusion”.
For this reason, it is recommended to use flow diagrams only for routine processes, or for describing common standard practices and allow deviations [27]. It has been advocated that declarative notations should be used as output of process mining (e.g. [17]) and for run-time process support (e.g. [24, 23, 28]). For the former, one hopes to extract from a process log the rules obeyed in practice (the “why”) as opposed to a flow-diagram describing the usual executions (the “how”). For the latter, one hopes to guide knowledge workers to activities in conformance with rules and regulations.
Implementation techniques for most declarative models such as Declare [26] and DecSerFlow [30], rely on translating the declarative constraints to an imperative model (e.g., an automaton [20]) to enable execution. Such translation usually entail a state-space explosion, and run-time adaptation of constraints becomes more difficult, because the automaton must be recomputed when constraints change.
A notable exception is the Dynamic Condition Response (DCR) graphs process language [11, 29]. DCR graphs can be executed without intermediate transformation to an imperative model creating the entire transition graph, and more directly support run-time adaptive case management [23, 5]. DCR graphs are supported by industrial design and case management tools (see e.g. dcrgraphs.net and [5]).
In the present paper, we present the first process mining algorithm for DCR graphs.
2. DCR GRAPHS
In this Section, we briefly recall DCR graphs. For a formal introduction and applications, refer to [11, 22, 29, 3, 5, 6].
Dynamic Condition Response graphs is a declarative modelling notation describing at the same time a process and its run-time state. The core notation comprises activities, activity states, and four relations between activities. An activity state comprises three boolean, indicating respectively whether the activity has been executed, is included, and
is pending. Intuitively, activities that are not included are treated as temporarily absent from the workflow; activities that are pending must eventually be executed or excluded before the workflow may complete.
Relations between activities govern whether an activity can currently be executed and how executing one activity modifies the state of another. A condition \( A \bullet \leftarrow B \) means that the activity \( A \) cannot execute unless \( B \) was previously executed, i.e., the the executed-state of \( B \) is true. Executing an activity clears its pending-state and sets its execution-state. The response \( A \bullet \rightarrow B \) means that whenever \( A \) executes, the pending-state of \( B \) is set. An inclusion \( A \rightarrow B \) means that whenever \( A \) executes, the inclusion-state of \( B \) is set, and conversely, an exclusion \( A \rightarrow \overline{B} \) means that whenever \( A \) is executed, the inclusion-state of \( B \) is cleared.
Note that excluding an activity voids it as both a condition and a response: If \( A \bullet \leftarrow B \) and \( B \) is not executed but also not included, \( A \) is free to execute. Conversely, an activity which is pending but also not included does not prevent the workflow from being completed.
While the condition and response relations has the same meaning as the corresponding relations in DECLARE [25] or DecSerFlow [30], the inclusion and exclusion relations provide the ability to dynamically include and remove conditions and response obligations. They have no direct counterpart in other declarative notations.
3. MODEL METRICS
In this Section, we present quality measures quantifying the appropriateness of a DCR graph \( G \) for a given log \( l \). We take as starting point the already established metrics of fitness, precision, generality, and simplicity introduced in [1] in the context of (internally binary) process trees.
3.1 Fitness
Replay fitness is defined in [1] as the normalised ratio of how an alignment between the input process tree and the event log differs over the maximum possible alignment for the model given an arbitrary event log. A variant of this approach was successfully applied to declarative models in [2].
However, within Adaptive Case Management, the core application area of DCR graphs [3][4][5], we use declarative models specifically to encompass all admissible behaviours. In this context, we take the view that the appropriate notion of "replay fitness" is simply the ability of the model to replay the traces of the input log exactly. As such, we define fitness to be simply the ratio of input traces in the log \( l \) replatable by the DCR model \( G \):
\[
\text{fitness}(G, l) = \frac{\#\text{ReplayableTraces}(G, l)}{\#\text{Traces}(l)}
\]
3.2 Precision
Precision is defined in [1] essentially as a tally of the amount of behavioural options unused by the log. This idea is straightforward to apply to DCR graphs: replay the log and record, for each reached state in the graph, the activities that are executable in that state as well as how many of these executable activities were actually executed at some point.
We transfer this idea directly to DCR graphs, measuring for each visited state the number of enabled activities actually executed in that state:
\[
\text{precision}(G, l) = \frac{\sum_{s \in \text{VisitedStates}(l)} \#\text{ActivitiesExecuted}(G, s, l)}{\sum_{s \in \text{VisitedStates}(l)} \#\text{ExecutableActivities}(G, s, l)}
\]
As a technical note, "\#ActivitiesExecuted" is only counted up the first time an activity is seen executed in a certain state. If it is observed to be executed from the same state multiple times, we only count the one execution.
However, we question the usefulness of this measure in the context of Adaptive Case Management. One advantage of declarative models in this context is that they afford flexibility for case workers to handle infrequent outlier cases. By definition, these happen only seldom; we cannot expect all such cases to be represented in the input log. Encompassing them, then, entails supporting a very large amount of potential such outlier cases. So it would be the expectation and not the exception that a log uses only a tiny fragment of the options available in the model.
This thinking was confirmed in [6], where a commercial system based on DCR graphs supported at least five orders of magnitude more states than observed in actual logs.
3.3 Simplicity
Simplicity for process trees is defined in [4] (roughly) as the ratio of the size of the internal binary process tree to the amount of activities in the input log. This notion of simplicity was partly motivated by previous findings that size is the main driver of errors in process models [21].
However, these findings have to the best our knowledge not been replicated in the context of declarative process models [9][10][33], where key impediments to understandability appear to be the number of constraints as opposed to the number of activities. Moreover, measuring the number of activities in DCR graphs is not a proxy for semantic complexity the way measuring duplicate activity representation is in a process tree as—large graphs are not necessarily complex.
Accordingly, we measure the simplicity of a DCR graph by (1) the number of pairs of related activities (Relation Pairs: RP); (2) the total amount of relations. Note that (2) is greater than (1) when some activities are related by more than one relation. Under this measure, a simplest possible graph is any graph with no relations.
\[
\text{simplicity}(G) = \frac{(1 - \frac{\#\text{Relations}}{\#\text{PossibleRelations}})}{2} + \frac{(1 - \frac{\#\text{RPs}}{\#\text{PossibleRPs}})}{2}
\]
Note that because the number of activities in a declarative model is not necessarily correlated with its complexity, in contrast to [4], we can define simplicity without reference to the events in the particular log \( l \).
We have ignored in this measure (and in this paper) complexity of DCR graphs stemming from nesting [12]. While nesting generally enhance perceived understandability (see, e.g., [34][35]), it may also implicitly introduce more relations. We leave open the question of exactly what a good measure of simplicity in the presence of nesting might be.
3.4 Generality
The notion of generality is defined in [1] for process trees as the frequency with which each node of the process tree
must be visited in order to produce the given log. Infrequently visited nodes of the process tree decreases generality.
This notion is specific to the notion of process trees and, to a lesser extent, imperative models. DCR graphs have no notion resembling the “inner nodes” of a process tree that can be considered “visited” during executions.
Moreover, generalisation is intended to assess “the extent to which the resulting model will be able to reproduce future behaviour” [1, p. 2]. This is an extremely important quality for both declarative models in general and ACM models in particular. However, we contend that it cannot reasonably be measured without appeal to domain-knowledge: We cannot from the logs alone determine which are useful generalisations (e.g., swapping the order of obtaining authorisation signatures in a loan application) and which are not (e.g., swapping the order of granting the loan and obtaining authorisation).
Altogether, we leave the definition of a notion of generalisation for DCR graphs as future work.
4. DCR MINING
In this Section we present a mining algorithm for DCR graphs: Given a log \( t \), produce a DCR graph \( G \). We take a “contradiction-based” approach to mining for constraint-based modelling languages: Begin with the set of activities and all possible constraints, and remove a constraint whenever the input log has a trace violating it. This approach has proven successful for DECLARE [8, 16, 2, 18], although requiring non-trivial enhancements to curb combinatorial explosion because of the large number of possible DECLARE constraints; to avoid contradictory models [7], and to avoid unhelpful vacuously satisfied constraints [19]. DCR graphs have only 4 relations; checking those for each pair of activities across all input traces is a viable option.
Because include relations by definition trump exclude relations, we do not take as starting point a graph with every possible constraint. Rather, in the interest of beginning with the most restrictive possible graph, we retain exclusions and omit inclusions. Altogether, our initial, restricted over-approximation will have conditions, exclusions, and responses between any pair of events.
In DCR, we have to account not only for constraints, but also initial state. Following the principle behind contradiction-based mining, we opt for the most restrictive possible starting state: each activity is initially not executed, not included, and pending.
4.1 Algorithm
The core mining algorithm is given in Algorithm 1. We comment on specifics below. In the algorithm, for a given trace \( t \), we write \( t_0, t_1, \ldots \) for the sequence of activities in \( t \).
**Include- and exclude-relations.** When we observe an activity at the start of a trace, we set the initial included-state of that activity to true. When an activity is observed after the start of a trace, we replace the exclude-relation from the preceding event with an include, again to allow the two activities to be executed in succession.
**Response relations.** At the completion of a trace, we check that for each activity execution in that trace whether all the activities that had response relations installed have been executed later in the trace. If not, we remove the offending response relations. Moreover, we clear the initial pending-state for all activities not seen in that trace.
The latter of these rules is an over-approximation; pending activities may be discharged either by execution or by being excluded. We make the present choice partly to make an initially-pending state signal that the activity has to be executed in any and all traces, not just excluded, partly to facilitate dynamic mining, see Section 4.2.
**Condition relations.** When we observe an activity execution in a trace, we remove conditions from non-executed activities in the trace in question.
4.2 Correctness
Removal of a DCR constraint in general does not preserve admissibility of workflows. Here are two counterexamples:
1. The graph \( A \rightarrow A \) where \( B \) is initially excluded admits the traces \( A \rightarrow A \rightarrow A \rightarrow A \). Removing the inclusion relation reduces the set of admitted traces to \( A \).
2. The graph \( B \rightarrow A | C \rightarrow A \rightarrow A \rightarrow A \). Removing \( C \rightarrow A \) makes that trace inadmissible.
This non-monotonicity is a central difference between DCR and DECLARE; it was studied in [1]. It follows that in a naive DCR-miner, whenever we remove a constraint, we...
**Algorithm 1 Core DCR mining algorithm**
1. function \( \text{MINE}(log) \)
2. \( G := \text{activities}(log) \)
3. for all \( x \) where \( x \) activity of \( G \) do
4. set \( x \) excluded, pending, not executed in \( G \)
5. end for
6. for all \( (x, y) \) where \( x, y \) activities of \( G \) do
7. \( G := G \cup \{x \leftarrow y, x \rightarrow y, x \rightarrow \% \} \)
8. end for
9. for all \( t \in \text{traces}(log) \) do
10. set \( t_0 \) included in \( G \)
11. remove all conditions to \( t_0 \) from \( G \)
12. end for
13. for all \( t \in \text{traces}(log) \) do
14. \( p := t_0 \)
15. for \( i \) from 1 to \( |t| - 1 \) do
16. remove \( p \rightarrow \% t_i \) from \( G \)
17. add \( p \rightarrow+ t_i \) to \( G \)
18. for all \( x \) where \( t_i \rightarrow x \) do
19. if \( x \notin \{t_j \mid j < i \} \) then
20. remove \( t_i \rightarrow x \) from \( G \)
21. end if
22. end for
23. for all \( x \) where \( t_i \leftarrow x \) do
24. if \( x \notin \{t_j \mid j > i \} \) then
25. remove \( t_i \leftarrow x \) from \( G \)
26. end if
27. end for
28. \( p := t_i \)
29. end for
30. for all \( a \notin \log \) do
31. set \( a \) not pending in \( G \)
32. end for
33. end for
34. return \( G \)
35. end function
761
must re-check all previously processed traces to ensure that they are still admissible. Such a naïve approach would lead to practically unacceptable running-times.
Our mining algorithm rests on the observation that these two examples exemplify the only two ways removing a constraint from a DCR graph may reduce its set of accepted traces; Algorithm 1 does not remove such constraints when it is dangerous to do so. We use this insight to prove Algorithm 1 correct. Write $G \models t$ if a DCR graph $G$ accepts a trace $t$; write $L(G)$ for the set $\{ t \mid G \models t \}$.
**Proposition 4.1.** Let $G$ be a label-deterministic DCR graph, and let $G'$ be the DCR graph obtained by removing a single constraint $\gamma$ from $G$. Suppose $t$ is a trace s.t. $G \models t$. Then $G' \not\models t$ implies either
1. $\gamma = A \rightarrow B$ for some $A, B$, or
2. $\gamma = A \rightarrow C B$ and $C \cdashlearrow B$ for some $A, B, C$, and there exists $i$ s.t. $t_i = C$ but for no $j < i$ do we have $t_j = B$.
**Proof.** Suppose $G \not\models t$. We proceed by cases on $\gamma$. If $\gamma$ is a condition or a response, clearly $L(G) \subseteq L(G')$; contradiction. If $\gamma$ is an inclusion we are done. So suppose finally $\gamma = A \rightarrow C B$. If for no $C$ we have $C \cdashlearrow B$ it follows easily that $L(G) \subseteq L(G')$, so we must have $C \cdashlearrow B$ for some $C$. Suppose for a contradiction that for all such $C$, we have for all $t_i$ either $t_i \not= C$ or $t_i = C$ and for some $j < i$ we have $t_j = B$. In either case, it is straightforward to prove by induction on $i$ that $G' \models t$; contradiction.
**Lemma 4.2.** Let $G$ be the value of $G$ at line 16 and $G'$ the value of $G$ at line 28 in Algorithm 1 within the same iteration of the loop. Then $\forall t \in L(G) \models t \Rightarrow G' \models t$.
**Proof.** For the removed relations, by Proposition 4.1, it is sufficient to verify that we remove no constraint satisfying Items 1 and 2 of that theorem. By inspection, Algorithm 1 does not remove inclusions, and so cannot violate Item 1. By inspection, we see that when the algorithm removes an exclusion (line 16) it also removes conditions that would violate Item 2 (lines 18-22).
For the added inclusion at line 17, it is sufficient to note that adding inclusion may only lead to inadmissible traces if it includes a left-hand side of a condition; however, by line 18-22 only conditions that were executed are retained.
**Theorem 4.3 (Correctness).** Let $G$ be the output of Algorithm 1 on a log $l$. Then forall $t \in l$ we have $G \models t$.
**Proof.** Using Lemma 4.2, it is straightforward to verify by induction on each $t \in l$ that $t_i$ was enabled after $t_{i-1}$ in $G$ at line 28, and that $G$ is accepting for $t_{[i-1]}$ at line 32.
### 4.3 Weighing of constraints
Algorithm 1 does not take into account noise in the log, since we remove every violated constraint. Moreover, in some applications, we may desire not a completely fitting model, but rather one that characterises the “common execution”. We may want to trade off fitness for precision.
Following common approaches to process mining, we only remove a relation when our confidence in removing that constraint is above a certain threshold. Each constraint is therefore assigned two values: an invocation counter and a violation counter. The invocation counter tallies the number of traces in which the constraint was invoked, e.g., the number of traces where the source activity of an exclude-relation was executed. The violation counter simply tallies the number of traces in which the constraint was violated.
Exact criteria for invocations and violations are given in Table I. The ratio of violations to invocations define our confidence in the removal of a constraint. A threshold below 0% will remove all constraints, resulting in a flower model. A threshold of exactly 0% retains only constraints satisfied in every trace. A threshold of 100% will remove no constraints; the output model will allow no runs.
Experimentally, the desired trade-off between precision and fitness occurs in the 0-15 % range. A threshold larger than 20 % would result in a large amount of the log being unsupported by the resulting graph.
### 4.4 Post-processing
To improve simplicity of the core algorithm’s output, we remove redundant constraints, i.e., relations that never have an effect on what the output DCR-graph allows. Redundant relations are closely related to vacuous constraints in Declare mining [16][15][19], but turn out to be much easier to detect in DCR graphs.
This implementation does ad-hoc removal of redundant relations by replaying logs against the output of the core mining algorithm, removing those inclusion, exclusion and response relations that never modify the state of their target activities; as well as removing those conditions that never inhibit execution of their target activities.
To further improve simplicity, one might consider introducing nested graphs [29][12] when they reduce relations.
### 5. EXPERIMENTAL RESULTS
An implementation of Algorithm 1 with rudimentary redundancy removal is available at [14]. For an experimental comparison with the Declare Maps Miner, consider the log in Table 2. For the sake of clarity, the log consists of only ten traces and is based on a relatively simple regular expression. For a larger log, see the on-line results at [15].
The test log represents a basic process flow; parallels may be drawn to a real-world process where A is registration for an exam, B, C and D are answers to a multiple-choice question, and the student either passes (E) or fails (F). Failed students may retry if they wish, but if they pass, they can no longer re-take the exam.
Given the sample log, our algorithm, with a constraint-violation threshold of 15 %, returns the DCR-graph depicted in Figure 1. Because the log contains only a single occurrence of A followed by D, the exclusion constraint between them remains intact: the one in ten traces do not yield a sufficient statistical percentage of violation (10 < 15). Thus, as no other activity includes D, it is removed entirely from the result-graph as a result of redundancy removal.
The removal of activity D means that the trace A→D→F is no longer allowed; leaving the Fitness measure down at 90 %. This, however, an acceptable trade-off for an increase in precision from 72.73 % if the threshold were set below 10 % to the final 78.57 %, as the two measures are now closer to each other. The main cause for this effect on the precision measure is the observed state-space that the execution of D involved. This, along with the fact that paths involving executions of B and C are quite well-traversed, results in a slightly higher, final precision measure.
Table 1: Threshold-dependant constraint removal
<table>
<thead>
<tr>
<th>Constraint</th>
<th>Invocation</th>
<th>Violation</th>
<th>Result</th>
</tr>
</thead>
<tbody>
<tr>
<td>Excluded-state</td>
<td>Each trace</td>
<td>A is first in a Trace</td>
<td>A is Included</td>
</tr>
<tr>
<td>Exclude-relation</td>
<td>A is executed in a trace</td>
<td>B executed immediately after A</td>
<td>A → B exclude is changed to include</td>
</tr>
<tr>
<td>Condition-relation</td>
<td>B is executed in a trace</td>
<td>A is not executed before B</td>
<td>A → B condition is removed</td>
</tr>
<tr>
<td>Response-relation</td>
<td>A is executed in a trace</td>
<td>B is not executed after A</td>
<td>A → B response is removed</td>
</tr>
<tr>
<td>Pending-state</td>
<td>Each trace</td>
<td>A is not executed</td>
<td>A is not Pending</td>
</tr>
</tbody>
</table>
Table 2: Example log. Follows the regular expression
\((A(B+|C|D)F)*(A(B+|C|D)E)\)?
<p>| | | | |</p>
<table>
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>1</td>
<td>ABE</td>
<td>6</td>
<td>ACF</td>
</tr>
<tr>
<td>2</td>
<td>ACFABB</td>
<td>7</td>
<td>ABFACFACE</td>
</tr>
<tr>
<td>3</td>
<td>ACE</td>
<td>8</td>
<td>ABBF</td>
</tr>
<tr>
<td>4</td>
<td>ADF</td>
<td>9</td>
<td>ABBE</td>
</tr>
<tr>
<td>5</td>
<td>ABFABE</td>
<td>10</td>
<td>ACFACE</td>
</tr>
</tbody>
</table>
5.1 Result comparison: Declare Maps Miner
For comparison, we show the the result graph of running the Declare Maps Miner \[18\] on the same log (Table 2) in Figure 2. The result is computed using a Declare Maps Miner support of 85 %, i.e., any constraint must be supported by at least 85 % of traces. This corresponds to the constraint-violation threshold of 15 % used by our algorithm above, as the contradiction-based method uses the threshold to tell when to remove a constraint, while Declare uses support for when to include a constraint.
- In the Declare model a trace must begin with A, followed by either B or C and then possibly ending in E, after which it is not permitted to go back to A.
- If C is chosen after A, it is also possible to continue to F, instead of E, and then possible to return to A and start over.
- If B is chosen instead of C, it is then not possible to choose F, despite four instances of this succession in the log.
- The exclusive choice constraint between A and D, combined with A being the initial activity, means that it is not possible to ever execute D. This is similar to the DCR miner never including D.
- Additionally, the Declare model does not have a terminal state. If E is executed, A and F cannot subsequently occur, but the same does not seem to apply for B and C. Thus, these three can be executed arbitrarily after E, even though all traces in the log end in E.
This last point marks the primary difference between the two resulting models. Overall, the results seem to suggest that our miner is slightly better in terms of closely reflecting the underlying process of the test log (its regular expression).
We emphasise that these results are only for this single, simple example, and may not necessarily generalise.
6. CONCLUSIONS
We have presented the first process mining algorithm for DCR graphs and a set of metrics quantifying output model quality. The algorithm has been implemented and a preliminary example-based comparison with the Declare Maps Miner has been carried out. We plan as future work to extend the evaluation and use of the algorithm to real-time distributed process mining.
7. REFERENCES
|
{"Source-Url": "https://static-curis.ku.dk/portal/files/227990239/p759_debois.pdf", "len_cl100k_base": 6573, "olmocr-version": "0.1.50", "pdf-total-pages": 7, "total-fallback-pages": 0, "total-input-tokens": 25022, "total-output-tokens": 9367, "length": "2e12", "weborganizer": {"__label__adult": 0.0003802776336669922, "__label__art_design": 0.0005517005920410156, "__label__crime_law": 0.0005946159362792969, "__label__education_jobs": 0.002529144287109375, "__label__entertainment": 0.00012481212615966797, "__label__fashion_beauty": 0.0002551078796386719, "__label__finance_business": 0.0013103485107421875, "__label__food_dining": 0.0004811286926269531, "__label__games": 0.0008234977722167969, "__label__hardware": 0.0009665489196777344, "__label__health": 0.000904560089111328, "__label__history": 0.0004165172576904297, "__label__home_hobbies": 0.00017917156219482422, "__label__industrial": 0.0012187957763671875, "__label__literature": 0.0006489753723144531, "__label__politics": 0.0003814697265625, "__label__religion": 0.0005311965942382812, "__label__science_tech": 0.3330078125, "__label__social_life": 0.0001825094223022461, "__label__software": 0.0189361572265625, "__label__software_dev": 0.63427734375, "__label__sports_fitness": 0.0003204345703125, "__label__transportation": 0.0007543563842773438, "__label__travel": 0.0001971721649169922}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 33937, 0.0461]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 33937, 0.32664]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 33937, 0.87905]], "google_gemma-3-12b-it_contains_pii": [[0, 636, false], [636, 4899, null], [4899, 11365, null], [11365, 17316, null], [17316, 24147, null], [24147, 28337, null], [28337, 33937, null]], "google_gemma-3-12b-it_is_public_document": [[0, 636, true], [636, 4899, null], [4899, 11365, null], [11365, 17316, null], [17316, 24147, null], [24147, 28337, null], [28337, 33937, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 33937, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 33937, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 33937, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 33937, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 33937, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 33937, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 33937, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 33937, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 33937, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 33937, null]], "pdf_page_numbers": [[0, 636, 1], [636, 4899, 2], [4899, 11365, 3], [11365, 17316, 4], [17316, 24147, 5], [24147, 28337, 6], [28337, 33937, 7]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 33937, 0.06637]]}
|
olmocr_science_pdfs
|
2024-11-28
|
2024-11-28
|
413bdd74770673b93a1ef83e8b4c88df4b08808e
|
An Approach to the Introduction of Formal Validation in an Asynchronous Circuit Design Flow
Dominique Borrione, Menouer Boubekeur, Emil Dumitrescu (VDS group)
Marc Renaudin, Jean-Baptiste Rigaud, Antoine Sirianni (CIS group)
TIMA Laboratory, Grenoble, France
E-mail for all authors: Surname.Name@imag.fr
Abstract
This paper discusses the integration of model-checking inside a design flow for Quasi-Delay Insensitive circuits. Both the formal validation of an asynchronous behavioral specification and the formal verification of the synchronous synthesis result are considered. The method follows several steps: formal model extraction, model simplification, environment modeling, writing temporal properties and proof. The approach is illustrated on a small, yet characteristic, asynchronous selection circuit.
1. Introduction
Design flows are well established for synchronous designs, and supported with efficient synthesis, simulation and verification software, starting from the Register Transfer level. Asynchronous designs have long been neglected, due to their higher bit cost, and tuning difficulty. With the advent of large transistor budgets, physically distant circuit modules communicate through long interconnections, and the global synchrony hypothesis is no longer realistic. The tendency for systems on a chip design is the reuse of existing components, with a distributed control and asynchronous interfaces. One of the objectives of our on-going research is to investigate the verification of mixed synchronous and asynchronous circuits, starting from a high-level specification.
Typically, asynchronous circuits are specified at logic level, using a CCS or a CSP-like formalism [Mar90, Ber93]. In our work, we write the initial behavioral description in an extension of the CHP language (from Caltech). Following the works of A. Martin [MLM97, MLM99], most of the initial effort at TIMA has been devoted to identifying the conditions required on the initial description, and correctness preserving transformations, in order to synthesize asynchronous circuits, starting from a high-level specification.
In this paper, after discussing the design flow, we describe the main CHP communication and synchronization primitives, their Petri Net model, their “pseudo clocked” VHDL translation, and the verifications that could be performed on the model, before and after synthesis. We then propose a set of transformations to produce a more compact and efficient coding of the state machine. As a running example, we use a simple, yet characteristic, selector module, and show examples of safety and liveness properties that have been verified.
2. The TAST Design Flow
TAST (Tima Asynchronous Synthesis Tools) [DR02] is an open design framework devoted to asynchronous circuits. It mainly consists in three parts: a compiler, a synthesizer and a simulation-model generator (Fig. 1). TAST offers the capability of targeting several outputs from a high level, CSP-like, description language called CHP (Communicating Hardware Processes).
The compiler translates CHP programs into Petri Nets (PN) associated to Data Flow Graphs (DFG). Such a model has been used for years to describe synchronous circuits and systems, but is particularly adequate for asynchronous digital circuits and systems design.
The synthesizer generates asynchronous circuits from the PN representation of the CHP programs. It is based on a Data Transfer Level specification. It provides a set of rules to guarantee that PN-DFG graphs are synthesizable into one of these two kinds of asynchronous circuits: Micropipeline [Sut89] and Quasi Delay Insensitive [Mar90]. In the following, only QDI circuits are discussed.
Behavioral VHDL models of the CHP specification are generated to verify them by simulation (simulation model generator).
Figure 2: Formal verification flow
The introduction of a formal verification flow in TAST starts from the PN–DFG format. (Fig. 2). First, one chooses an appropriate communication protocol, and all communication primitives are expanded according to this protocol. A state encoding is associated to the resulting Petri Net, based on its global place marking. Then a Finite State Machine (FSM) interpretation of the Petri Net is constructed and implemented as a VHDL behavioral model, which can be directly fed to an industrial model-checking tool, accepting a standard VHDL entry. The formal verification task consists in modeling the environment of the description, and writing a set of temporal properties that need to be satisfied.
On the other hand, the asynchronous synthesis tool produces a VHDL gate level net-list, which can also be fed to a model-checker. Thus, the compliance of the synthesized model with respect to its specification can be checked, by proving the same set of temporal properties on the specification and the synthesis result.
3. From CHP to Petri Nets
There is no agreement today on a specification language that provides all the facilities to model and synthesize asynchronous circuits. However, CSP-like languages are widely used. Caltech University has proposed CHP [Mar93], Philips has defined Tangram [BKR91][VB93], the University of Utah has developed a tool based on Occam [BS89], and Manchester has defined BALSA [BE97]. All these languages use the basic concept of CSP : concurrent processes communicating with channels [Hoa78].
We have developed a proprietary high level description language derived from CHP with specific features to cope with communication protocols, data encoding, arbitrary precision arithmetic, non-deterministic data flow, hierarchy, project management and, traceability. All these features make our modified CHP a very practical system description language to develop with[DR02].
3.1. CHP syntax basics
The CHP language is now briefly introduced, to provide the minimum understanding of the examples in this paper.
Literals
Integers constants are noted in fixed precision, as a sequence of dot separated digits, with a base indication. Example :
"1.9.7.9"[10] is in base 10 number 1979.
"1.2.3"[4] = 1*4^2 + 2*4^1 + 3*4^0 = 27.
For usual bases such as 10 and 2, standard notations are also supported for integers and binary numbers.
Data types
MR[B] : Multi-Rail in base B
This type represents a number between 0 and (B–1), coded with the “1-of-n” delay insensitive code.
Example :
VARIABLE b : MR [B] ;
b := "x" [B] ; -- assign, with 0 <= x < B
MR[B][L] defines an array of L elements of type MR[B].
Based on these basic unsigned types, other types are defined to make the designers’ life easier, e.g.
DR: Dual Rail – equivalent to MR[2]
BIT, BOOLEAN: Binary – equivalent to MR[2]
All the types previously presented have a signed equivalent.
Operators
CHP provides the most common operators for comparison, arithmetic and logical operations. Language-specific operators describe sequential execution-“;” and parallel execution-“,”. Communication actions are described using the “!”(send), “?” (receive), “#” (probe) primitives.
Control structures
Deterministic selection. It waits for a unique guard to evaluate to true; it then executes the associated bloc and terminates the selection.
\[
\begin{cases}
\text{guard1 } => \text{ bloc1} \\
\text{guard2 } => \text{ bloc2} \\
\text{...}
\end{cases}
\]
Deterministic loop. While a unique guard is true, it executes the corresponding bloc. It terminates when none of the guard is true.
```
* [ guard1 => bloc1
@ guard2 => bloc2
@ ...
]
```
CHP also provides non-deterministic selection and loop structures. They are not used within this paper.
Program structure
A CHP COMPONENT is made of its communication interface, followed by a declaration part and its body. The communication interface is a directed port list, similar to VHDL. The declaration part declares local objects like channels and constants. The body is made of concurrent processes or component instances. They can all communicate with each other, and also with the component ports. Point to point communication only is allowed.
```
COMPONENT component_name
PORT (port_list)
{declaration part}
Begin
component body
End component_name;
```
A process is made of a port list, a declaration part and a body.
```
PROCESS process-name
PORT (port_list)
{declaration part}
[ instruction_list ]
```
Example
The program of Fig. 3 specifies a selector. Because there is only one process, the component and the process port lists are identical. Channel \( C \) is read in the local variable \( ctrl \) which is tested using a deterministic choice structure. The value read from channel \( E \) is propagated to channel \( S1 \) if \( ctrl \) is 0, to channel \( S2 \) if \( ctrl \) is 1, and to both \( S1 \) and \( S2 \) in parallel if \( ctrl \) is 3.
```
COMPONENT Selector
PORT ( E: in DR; C: in MR[3][1]; S1, S2 : out DR )
Begin
PROCESS main
PORT (C: in MR[3][1]; E: in DR; S1, S2 : out DR)
Variable x : DR;
Variable ctrl : MR[3][1];
[ *[ C ? ctrl ; [ ctrl = "0"[3] ] => E ? x; S1 ! x
@ ctrl = "1"[3] ] => E ? x; S2 ! x
@ ctrl = "2"[3] ] => E ? x; S1 ! x, S2 ! x
]
End Selector
```
Figure 3: CHP code of a Selector
3.2. Petri Net generation
The language control structures, the sequential and parallel operators have a corresponding Petri Net model, shown on Fig. 4 to 7. Other instructions and expressions are represented using Data Flow Graphs: instructions are associated to the PN places, whereas guards are associated to transitions.
For the sequential operator Figure 6a, statement \( C2 \) is executed after the completion of instruction \( C1 \). Conversely, in Figure 6b, statements \( C1 \) and \( C2 \) are executed concurrently.
```
Figure 4: Selection operator : [Gi => Ci]
```
```
Figure 5: Repetition operator : *[Gi => Ci]
```
```
Figure 6: a : Sequential operator : C1 ; C2
b : Parallel operator : C1 , C2
```
Example
Fig. 7 gives the Petri Net obtained from the CHP program of Fig. 3. Place \( P0 \) is the first place of the repetition. This repetition has a unique implicit guarded command which is \([True => C? ctrl…]\). Hence, when the command execution completes, the execution has to restart from place \( P0 \). Moreover, place \( Pi \) is the initial place at the beginning of the execution: \( Pi \) has to be initially marked.
The first statement to execute is “\( C ? ctrl \)”. This instruction is represented by a DFG and is associated to place \( P1 \). It is followed by a sequential operator, modeled with transition...
Then the next instruction is a selection starting from place P9. Within the third guarded command note that the parallel operator is represented by places P3, P4 and transitions T3 and T5.

### 4. From Petri Nets to gates
CHP programs have to be DTL-compliant (Data Transfer level) to ensure a quasi delay insensitive synthesis of the Petri Nets [DF02]. In order to derive a gate implementation from the Petri Net, channel and variable encoding as well as communication protocols have to be precisely defined.
#### 4.1. Data encoding
As discussed in section 3.1, all data are declared and built using the basic MR[B] type. For quasi delay insensitive hardware, a digit of type MR[B] is physically implemented with B rails, each wire or rail carrying out one of the B possible values between 0 and B-1 (one hot coding). For instance channels use the same encoding convention. In addition, an acknowledge signal is added to support handshaking communication protocols. Fig. 8 depicts the hardware representation of variable "ctrl" and channel E of the CHP program of Fig. 3.

#### 4.2. Communication protocols
The 4-phase handshaking protocol is chosen for implementing inter-process communications. Fig. 9 illustrates a data transfer along channel E (from CHP program of Fig. 3).

Initially, rail0 and rail1 are both zero and the acknowledge signal "ack" is one. In the first phase, the event on "rail0" indicates that a zero is ready in channel "E". In response to this transfer request, phase 2 acknowledges the data by falling down signal "ack". Phase 3 and 4 are necessary to return the signals back to their initial values. A read action from channel "E" using this protocol can be formally described using Petri Nets as shown in §5.2. This representation is called a "handshaking expansion" [Mar90].
#### 4.3. Synthesis
Generating a gate net-list from the Petri Nets is a difficult problem that is beyond the scope of this paper. The first step of the synthesis process consists in expanding all the communication actions associated to the places of the Petri Net. This is done according to the chosen protocol as illustrated in §5.2. Then, all the instructions and guards associated to places and transitions, and represented by DFG constructs, are translated into gates. Finally, the gate net-list is generated from the expanded Petri Net and the synthesized DFG’s. The circuit obtained for the Selector is described in Fig. 10. Gates denoted "C" and "Cr" are Muller C elements without and with reset.

### 5. Verification
Verifying the correctness of delay-insensitive circuits involves two steps: validation of the initial specification and checking the correctness of the synthesized circuit.
In the first step we construct a finite-state machine description for the Petri net representation. After modeling the circuit environment, the resulting FSM is checked by applying model-checking tools.
The second step verifies the preservation of the logical properties of the asynchronous circuit after synthesis, with regard to the properties checked on the initial specification.
5.1 Petri nets as finite-state machines
The CHP specification is translated into a safe PN, formalized as a quadruple \( \Sigma = (S, T, F, M_0) \), where
(i) \( S \) and \( T \) are finite, disjoint, nonempty sets of places and transitions,
(ii) \( F \subseteq (S \times T) \cup (T \times S) \) is a flow relation,
(iii) \( M_0 : S \rightarrow \text{Bool} \) is the initial marking.
The data-flow graph part of the CHP translation is associated to the PN. Actions are attached to places and conditions are attached to transitions. Places with communication actions have to be expanded, according to the selected protocol. The guards associated with the PN transitions model the internal control flow and the synchronization of the communications. Each place is represented as a Boolean state-holding object and each marking as a min-term on these objects. This allows a direct translation of the PN as a FSM, where the marking represents the global state of the system. Firing the enabled transition \( t \) at a marking \( M \) produces a new marking \( M' \) constructed by setting all input places of \( t \) to 0 and all output places to 1.
5.2 Translation of the PN to a verifiable model
In order to benefit from existing industrial tools, and fit in the design flow, our prototype translates the PN representation into a register transfer level, behavioral VHDL model suited for formal verification (i.e. compliant to the 1076.6 standard). The simulation-oriented VHDL model generated in the TAST flow (Fig. 1) contains timing and attribute directives that are essential to follow the propagation of the signals, but make this model improper as an input to model checking tools. Ignoring or removing all delays would alter the behavior of the model. The trick consists in replacing each unit delay by a tick of a fictitious clock, thus making visible the “delta” delay of a purely behavioral, non-timed, state transition model.
The translation of the CHP COMPONENT interface is straightforward. All the internally declared variables and PN places are made VHDL signals, which guarantees that all state transitions take at least one step. The overall PN for a component is translated as a single process synchronized by the fictitious clock, and not as a set of guarded blocks as in [ABO98]. The full process is executed, and all active transitions are fired, at each step.
a) Global Algorithm
Input: Petri Net (list of places and transitions)
Output : VHDL program.
Translation of declaration part :
- declare each variable according to its type and its parameters (Base and Digit).
- For each element of the global Petri net
IF (element is a place \( P \)) then
associate a signal \( P \) to the place;
IF (P is atomic)
Print : \( \text{if } P \text{ then action}(P) \ldots \text{ end if} \);
\(--\text{action}(P) : \text{Actions associated to place } P.\)
else \( \text{The place expresses a communication.} \)
\( \text{Put\_Com}() ; \)
ELSIF (element is a transition \( T \)) then
Print :
\( \text{if (And(\text{cond}(T), \text{places\_in}(T)))} \)
\(--\text{cond}(T) : \text{Condition associated to transition } T.\)
\( \text{places\_in}(T) \leq \text{false} ; \)
\(--\text{Input places of } T.\)
\( \text{places\_out}(T) \leq \text{true} ; \)
\(--\text{Output places of } T.\)
End IF
End For
Remark. Put\_com() implements the communication expansion of Read? or Write! actions, according to the 4-phase handshake protocol, by insertion of the corresponding sub-Petri Net in the global Petri Net.
b) Translation of communications
The communication actions are implemented with the handshake protocol.
Translation of Read actions: \( (C\ ?\ ctr\_l) \)
\[ ((C="001" \text{ Or } C="010") \text{ or } C="100") \]
\[ \begin{align*}
\text{C} &= \text{ctrl} ; \\
\text{C\_ack} &= '0' ; \\
\text{C} &= "000" \\
\text{C\_ack} &= '1' \\
\end{align*} \]
**CHP declaration:**
\( C : \text{IN} \text{MR}[3][1]; \)
\( \text{variable} \text{ctrl: MR}[3][1]; \)
**Translation into VHDL:**
\( C : \text{IN} \text{bit\_vector}(2 \text{ downto } 0); \)
\( \text{C\_ack} : \text{OUT} \text{bit}; \text{--Acknowledgement} \)
\( \text{signal} \text{ctrl : bit\_vector}(2 \text{ downto } 0); \)
Translation of Write actions: \( (S!x) \)
\[ S \leq x ; \]
\[ S\_ack = '0' ; \]
\[ S \leq "00" ; \]
\[ S\_ack = '1' \]
**CHP declaration:**
\( S1, S2 : \text{OUT} \text{DR} \)
\( \text{variable} \text{x: DR}; \)
**Translation into VHDL:**
\( S : \text{OUT} \text{bit\_vector}(1 \text{ downto } 0); \)
\( S\_ack : \text{IN} \text{bit}; \text{--Acknowledgement} \)
\( \text{signal} \text{x : bit\_vector}(1 \text{ downto } 0); \)
entity EX11_Ent is
port( C : in bit_vector(2 downto 0); E : in bit_vector(1 downto 0);
S1 : out bit_vector(1 downto 0); S2 : out bit_vector(1 downto 0);
C_a : out bit; E_a : out bit; S1_a : in bit; S2_a : in bit; clk, rst : in bit);
end EX11_Ent;
architecture EX11_a of EX11_Ent is
signal EX11_MAIN_X : bit_vector(1 downto 0);
signal EX11_MAIN_CTRL : bit_vector(2 downto 0);
signal Pi, P0, P9, P7, P8, P1, P5, P6, P2, P3, P4, P0_1, P0_2, P7_1, P7_2,
P8_1, P8_2, P5_1, P5_2, P6_1, P6_2, P2_1, P2_2, P3_1, P3_2, P4_1, P4_2 : boolean;
begin
process(clk, rst)
begin
if (rst='0') then -- initialization at Reset
S1 <= "00"; S2 <= "00"; C_a <= '1'; E_a <= '1'; Pi <= true;
elsif clk'event and clk='1' then -- fictitious clock edge
if P8 then S1 <= EX11_MAIN_X; end if; -- start of Write action at place P8
... -- same for P6, P3, P4
if P7_1 then EX11_MAIN_X <= E; E_a <= '0'; end if; -- start of Read action at place P7
... -- same for P7
if P7_2 then E_a <= '1'; end if; -- acknowledge hand-shake at Expansion of P7
if (P7_2) then P8 <= true; end if; -- Transition T13
if P8_1 then S1 <= "00"; end if;
if ((EX11_MAIN_CTRL = "001") and P9) then P7 <= true; end if; -- OR branch at P9
if ((EX11_MAIN_CTRL = "010") and P9) then P5 <= true; end if; -- OR branch at P9
if ((EX11_MAIN_CTRL = "100") and P9) then P2 <= true; end if; -- OR branch at P9
if ((E="00") and P7_1) then P8_1 <= true; end if; -- OR branch at P9
if ((S1_a='0') and P8) then P8_1 <= true; end if; -- OR branch at P9
... -- same for all other places and transitions
end if;
end process;
end EX11_a;
c) Application to the selector example
The above VHDL text gives excerpts from the automatic translation of the selector (Fig. 3), where many similar statements and line-feed characters have been deleted for space reasons. Comments were also manually added.
5.3 Verifying the asynchronous synthesis
Along the various synthesis steps, an erroneous procedure can produce an incorrect circuit description. It is thus useful to verify a synthesized circuit.
The circuit obtained after synthesis cannot be proven equivalent to its specification, because the synthesis process introduces optimizations and pipelines; thus the order of actions is not necessarily preserved. As a matter of fact, while the VHDL model for the specification is a single process per CHP process, the synthesized circuit is composed of many concurrent processes. We can only hope to prove that the essential safety properties, shown to hold for the initial specification, are preserved after synthesis.
entity MULLER2_R is
port ( resetb, clk, A, B : in bit; S : out bit);
end MULLER2_R;
architecture behaviour of MULLER2_R is
begin
S<= s_s;
s_s <= '0' after 1 ns when resetb = '0' else
'1' after 1 ns when A='1' and B='1' else
'0' after 1 ns when A='0' and B='0' else
s_s;
end behaviour;
Figure 13: VHDL models of a Muller-C gate for simulation and for formal verification
Here again, we meet the same problem that was raised for the specification validation: the VHDL simulation model of the synthesized circuits does not comply to the standard verifiable VHDL subset. The asynchronous synthesis tool is based on a library that has to be adapted:
- Muller-C elements contain delays and transparent latches; we changed them into flip-flops, introducing a fictitious clock, as in section 5.2
- All types are transformed into Boolean and Bit.
Fig. 13 gives the transformation of one library component.
5.4 Environment modeling
In order to obtain a correct behavior, a set of environment assumptions must be associated to each communication channel, to guarantee its compliance to a four-phase communication protocol. Following the direction of the request signal attached to a channel, we distinguish between active channels (the system sends the request) and passive channels (the system receives the request). Thus, a dual behavior must be defined for each communication channel. For active channels, the dual behavior must receive the request and send an acknowledgement within a finite amount of time. Then, it waits until the request falls and deactivates the acknowledgement within a finite amount of time. The dual behavior of a passive channel must initiate a transaction, by rising the request signal at some arbitrary, but finite time. The remaining behavior is obtained from the active dual behavior, by exchanging the roles of the request and acknowledgement signals.
Figure 14: Modeling the environment
A dual behavior can be modeled as a non-deterministic description, which is plugged to each channel. A fairness condition must be associated to each dual instance, in order to express the fact that it always reacts within a finite delay. It is also possible to express a dual behavior as a set of assumptions written in temporal logic. Fig. 14 displays the composition of a system with the dual behaviors attached to each communication channel. Wire and is a pseudo-input signals used to model non-determinism.
5.5 Application to the selector example
In the case of the selector example, the environment has been described by a set of temporal formulas, and the verification was performed using FormalCheck[Cad01].
Input channel constraints
C_Env1
After P1 = True
Eventually (C = x"1" or C = x"2" or C = x"4") and P1 = True
Meaning: Each time place P1 is active, an incoming control request will eventually occur.
C_Env2
After C_ack = 0
Eventually C = x"0"
Meaning: Each time the request is acknowledged (C_ack = 0), it will eventually return to 0 (C = x"0").
Stable_C
After C = x"1" or C = x"2" or C = x"4"
Always C = stable
Unless C_ack = 0
Meaning: A request is stable until it is acknowledged
Output channel constraints
S1_Env1
After S1(1) = 1 or S1(0) = 1
Eventually S1_ack = 0
Meaning: After a request on S (S1(1)=1 or S1(0)=1), an acknowledgement will eventually be received (S1_ack = 1).
S1_Env2
After S1 = x"0"
Eventually S1_ack = 1
Meaning: After the write transaction on channel S is finished (S = x "0"), the acknowledgement will eventually be deactivated (S_ack = 1).
The constraints on ports E and S2 are similar to those on C and S1.
Some verified properties
The expressed properties correspond generally to the Petri net branches, i.e. the reachability of certain places or Transitions by following a given path. Or they are used to express input-output relationships, as in our example. The characteristic behavior of the selector is described by the three properties A1 to A3 below. These same properties are verified on the circuit specification and on the synthesized circuit.
Meaning of property A1: If place P01 is active and an incoming request C = x"1" arrives, then a write will eventually occur on S1.
A1) After P01 = True and C = x "1"
Eventually : S1(1) = 1 or S1(0) = 1
A2) After P01 = True and C = x "2"
Eventually : S2(1) = 1 or S2(0) = 1
A3) After : P01 = True and C = x "4"
Eventually : (S1(1) = 1 or S1(0) = 1) and (S2(1) = 1 or S2(0) = 1)
5.6 Handling combinational explosion
Applying symbolic model checking to a FSM interpretation of a CHP program, obviously the verification of large descriptions faces combinational explosion. Two main directions are explored in order to handle this problem. First, reduce the FSM state space. Currently, a FSM state is associated to each possible Petri Net place marking. This representation is excessively expensive, due to the state encoding which associates one state variable to each place. Second, a verification strategy is required, to exploit the characteristics (symmetry, control and data path, etc.) of particular classes of designs [RQ02], such as the asynchronous selector.
Refining the state machine model
A first improvement to our method consists in associating to the initial PN a FSM model with a more compact state encoding. For instance, states should be represented as values over an enumerated data type. Moreover, the FSM states and transitions should match the PN places and transitions. This correspondence is not always straightforward. "Split – join" (SJ) parallel execution constructions need special processing: generate one separate PN for each parallel branch, as well as the re-synchronization "glue" which marks the end of the parallel execution.
Fig. 15 illustrates this transformation. The parallel branches are executed as soon as place \( a \) is active and transition \( T1 \) is true. Each parallel branch makes a signal assignment (S1//S3) and waits for an external event to occur (Req1 = 1//Req2 = 1) before making a second assignment (S2//S4).
By successive applications of this transformation, we obtain a collection of concurrent PN's which are free of parallel execution statements. Since only one place at a time may hold value 1 in each concurrent PN, one unsigned signal per concurrent PN can hold the number of the active place. However, further simplifications are still possible on the resulting representation. Petri Nets allow the simultaneous use of two modeling levels in a natural way: sequences of local computations can be mixed with operations that imply waiting for an external event. Moreover, infinite execution paths that do not contain a wait for an external event are prohibited. Thus, the actual evolution of a PN is only triggered by external events. Any sequence of local computations performed between two external events can be considered as part of the same place, which only records their result. Hence, it is useful to collapse all sequences of places, which only implement local computations. Such sequences are characterized as follows: simple actions like assignments are associated to places; conditions are associated to transitions; one transition may fire as soon as its incoming place is active and its associated condition true. Fig. 16a, b and c present a few PN transformation patterns, which perform simplifications according to this criterion. We note them Sa, Sb and Sc.
The global simplification procedure consists in applying rules Sa and Sc on each appropriate PN construction. Before applying transformations SJ (Fig. 15) or Sb on a parallel construct, a preliminary analysis must determine whether its parallel branches implement any waiting on external events. This analysis performs a recursive coloring of each parallel PN construct:
- each transition is colored if it waits for an external event;
- each parallel structure is colored if its branches contain colored transitions or colored parallel structures.
Transformation SJ must be recursively applied on all colored constructs. Uncolored constructs are treated by
transformation $S_b$.
The FSM model obtained consists of several concurrent state machines that can be represented following a usual coding style. This simplification technique brings two major improvements:
- The resulting FSM state encoding relies on state enumeration. Our initial implementation associates one state variable to each PN place. For a PN containing $N$ places, $N$ state variables are needed. Concurrent FSM's state encoding would only need $\log_2 N$ state variables;
- Irrelevant PN places and transitions (if any) can be suppressed.
### Formal verification strategy
In the selector example of Fig. 7, once a channel is selected, its data is read and sent through an output channel. This sequence, call it a transaction, is repeated each time a new command is received. A transaction cannot influence the execution of a subsequent transaction. Hence, we may simply focus on writing correctness criteria for a single transaction. According to the value of the control word $ctrl$, the arbiter follows a separate execution path. Hence, each property can be split into three proof sub-goals, one for each execution scenario (corresponding to $ctrl = 0$, $1$, $2$), following two steps:
- abstract away the logic driving the variable $ctrl$, so that it becomes an artificial primary input;
- write a property for each execution scenario, by constraining $ctrl$ to the corresponding constant value.
If all sub-goals of a property pass, then we may consider that the initial property is true. This strategy seems adequate for this particular class of designs. It allows important simplifications in the FSM representation, as each sub-goal constrains $ctrl$ to a constant value.
### 6. Related Works
The verification of asynchronous circuits may follow two important directions, according to the asynchronous design approach: untimed (delay insensitive), or timed design [Be99]. It is well known that the verification of timed systems faces serious complexity problems. Based on the use of concurrent processes for specifying an asynchronous behavior, two main directions have been explored: language-based and graph-based asynchronous design.
Synthesis methods for language-based specifications directly translate a program into a circuit. In [Mar90], a series of semantic preserving transformations are applied. Graph-based specifications stand at a conceptual level lower than language based methods; they rely on Petri net or State Transition Graphs formalisms [Ro97].
Asynchronous verification methods have been developed following these design approaches. CIRCAL was experimented to evaluate correctness and performance properties on micro-pipelines [CM00]: both the system and its properties are modeled as parallel processes, whose composition is compared to the initial system model. If the proof succeeds, the system satisfies the property. This method has proved the correctness of two four-phase asynchronous micro-pipelines. [Cla99] presents two semantic models for the formal verification of reactive systems; they are based on simultaneous or interleaving approaches. It is argued that the interleaving model is more adequate for modeling and verifying asynchronous behaviors. The verification uses special partial order reduction techniques [BN01] in order to handle combinatorial explosion.
In [RC96] both the circuit specification and its environment assumptions are modeled using Petri nets. A state encoding is associated to this representation, which allows the application of BDD symbolic model checking techniques. [YG01] suggests the use of the LOTOS [EV89] specification language together with the CADP [CACP] toolbox for asynchronous verification using model checking.
All these approaches are subject to state space explosion. A number of techniques, such as hierarchical verification [RC95], modular verification, abstraction techniques [Zh01] and PN unfolding [McM92], already deal with this problem. As for RTL systems, the verification of asynchronous circuits heavily relies on the construction of a compact verifiable model as well as on using an adequate verification strategy.
### 7. Conclusion
We have implemented an asynchronous circuit design flow based on CHP and VHDL, which includes automatic synthesis, simulation and formal verification. A variety of small circuits (in the category of multiplexors, arbiters, and the like) have been formally verified, by model checking techniques, using pre-existing property checking tools that were initially not intended for asynchronous circuit verification. However, the current prototype FSM generator is not efficient enough to serve the verification of large circuits. Our on-going works concern the development of algorithms for generating more compact state machines, and for finding verification strategies adapted to the known characteristics of various circuit types, as described in the section devoted to the handling of combinatorial explosion. The implementation of these algorithms will be progressively added to the TAST environment for asynchronous circuit designs.
### 8. References
|
{"Source-Url": "https://www.computer.org/csdl/proceedings/hicss/2003/1874/09/187490279b.pdf", "len_cl100k_base": 8107, "olmocr-version": "0.1.53", "pdf-total-pages": 10, "total-fallback-pages": 0, "total-input-tokens": 33160, "total-output-tokens": 10428, "length": "2e12", "weborganizer": {"__label__adult": 0.0007905960083007812, "__label__art_design": 0.0009832382202148438, "__label__crime_law": 0.0006384849548339844, "__label__education_jobs": 0.0010700225830078125, "__label__entertainment": 0.00017142295837402344, "__label__fashion_beauty": 0.00041556358337402344, "__label__finance_business": 0.000530242919921875, "__label__food_dining": 0.0007295608520507812, "__label__games": 0.0012941360473632812, "__label__hardware": 0.030029296875, "__label__health": 0.0012311935424804688, "__label__history": 0.0006241798400878906, "__label__home_hobbies": 0.0004036426544189453, "__label__industrial": 0.003002166748046875, "__label__literature": 0.00029969215393066406, "__label__politics": 0.0005640983581542969, "__label__religion": 0.001190185546875, "__label__science_tech": 0.382080078125, "__label__social_life": 0.00011551380157470704, "__label__software": 0.005664825439453125, "__label__software_dev": 0.564453125, "__label__sports_fitness": 0.0007524490356445312, "__label__transportation": 0.0026569366455078125, "__label__travel": 0.0003726482391357422}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 38731, 0.03701]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 38731, 0.54498]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 38731, 0.86908]], "google_gemma-3-12b-it_contains_pii": [[0, 2664, false], [2664, 7319, null], [7319, 10557, null], [10557, 13480, null], [13480, 18556, null], [18556, 21635, null], [21635, 25671, null], [25671, 29293, null], [29293, 35245, null], [35245, 38731, null]], "google_gemma-3-12b-it_is_public_document": [[0, 2664, true], [2664, 7319, null], [7319, 10557, null], [10557, 13480, null], [13480, 18556, null], [18556, 21635, null], [21635, 25671, null], [25671, 29293, null], [29293, 35245, null], [35245, 38731, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 38731, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 38731, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 38731, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 38731, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 38731, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 38731, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 38731, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 38731, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 38731, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 38731, null]], "pdf_page_numbers": [[0, 2664, 1], [2664, 7319, 2], [7319, 10557, 3], [10557, 13480, 4], [13480, 18556, 5], [18556, 21635, 6], [21635, 25671, 7], [25671, 29293, 8], [29293, 35245, 9], [35245, 38731, 10]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 38731, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-10
|
2024-12-10
|
99fc90af190e7a91037a4c2fbc3b5d3be216d6d9
|
Function Point Analysis FPA on A Team Planning Website Based on PHP and MYSQL
Lassen, Anders
Published in:
Journal of Information Technology and Software Engineering
DOI:
10.4172/2165-7866.1000237
Publication date:
2018
Document version
Publisher's PDF, also known as Version of record
Document license:
Unspecified
Citation for published version (APA):
Function Point Analysis FPA on A Team Planning Website Based on PHP and MYSQL
Lassen A*
Department of Computer Science, University of Copenhagen, Copenhagen, Denmark
Abstract
A function point analysis (FPA) has been carried out on a custom team planning website based on PHP and MYSQL. The FPA was done after the development was finished (retrospective) and a constructive cost model analysis (COCOMO) was carried out to assess source lines of code (SLOC). In the present study the function point analysis is based on entities of the relational database evaluated as internal logical files, and evaluation of PHP source code with dynamic SQL as either external input files or external inquiry files. The complexity for a custom team planning website was found to be 510 total adjusted function points (TAFP) (UAF=580 FP, TDI=23, VAF=0, 88, TAFP=510FP). The function point estimate was classified as an organic project in a COCOMO analysis, and it was concluded that the complexity corresponds to 27742 LOC (or 27, 4 KDSI). The estimate of 66-82 person-months project would correspond to a 4 crew team in 16-21 months. The estimate was compared to the actual source code count of 22300 LOC.
Keywords: Function point analysis; Dynamic SQL
Introduction
Function point analysis (FPA) is one way to determine the overall complexity of a system. In the current study a custom website is analyzed for complexity. Function point analysis is attributed to Allan Albright in 1979 [1] and JE Gaffney [2] and further developed in the MK2 report [3]. More recent work on function point analysis, a software tool (Unified code count (UCC)) [4,5]. Function point analysis can be evaluated using UML [6,7]. Made a literature review based on reported keywords identifying improvements to the accuracy of function point analysis [8]. They included 18 primary studies. The improvements were categorized into three categories: 1) "weights and complexities"; 2) 'technological in-dependence' of the method; and 3) calculating the 'adjusted functional size'. Literature review for productivity [9]. A study of Henderson and coworkers study perception of function point analysis from a manger viewpoint and a developer viewpoint based 13 desirable properties with 3 key findings: SLOC-count is less complicated than FP; developers better perceive the benefits of FP than Managers; the difference in values between managers and developers inhibit communication necessary to reach informed decisions [10].
The FPA Allows for quantifying different properties of the system, in LOW, AVERAGE or HIGH complexity, totaling the unadjusted function points (UAF). Use SIMPLE and COMPLEX, where SIMPLE and COMPLEX are well defined; and use an AVERAGE, MEDIAN, RANGE(LOW, HIGH) classification for complexity [2]. The unadjusted function points can then be adjusted for technical complexity as the total adjusted function points (TAFP). It is this measure that can be converted to project size in terms of man years based on lines of code (LOC) for the used programming language [11]. A function point measure for a list of languages. To assess PHP we use the LOC per function point for java and C++ [12].
The system examined is custom build website supporting planning tasks and in-site-postings for Danish yachtracing crews participating in international match race. The website domain myteam.dk was built and in operation in the years 2008-2014 by Hans Jacob Simonsen [13]. The system supports in-site blogging, planning, logging comments to training and events, handling expenses, sending out reminders by SMS.
The result of the function point analysis is further analyzed using constructive cost model (COCOMO) analysis by Boehm BW [14]. Bearing in mind that the COCOMO measure is the total lines of code delivered by the development team. Finally the result of the COCOMO-analysis is compared to a simple source code count of delivered source code. Comparing the Total Adjusted Function Points to Delivered Source Lines of Code (SLOC), similar to the two step work effort validation [2] (Figure 1).
Method
Persistent store
The website database was a relational database of type MYSQL version 5.3 (or lower). The tables were defined with primary keys, unique index and auto-increment. No foreign keys constraints, triggers or stored procedures. Web-tier. Most of the source files were PHP files with HTML, CSS - files and some libraries in java Script. PHP class definitions were part of the code so both structured programming and object-oriented programming was present. The model-layer was object-oriented.
The system is evaluated using function point analysis [12]. The metric is evaluated for: internal logical files (ILF), external interface files (EIF), external Input (EI), external output (EO) and external inquiry (EQ).
Internal logical files (ILF): Entity (Table 1) count in the relational database schema. The complexity of the entities graded initially as: below 8 attributes - (LOW), 8-16 attributes - (AVERAGE) and above 16 attributes (HIGH).
External interface files (EIF): Was not initially found relevant, but library calls could be considered. For example, the calendar functions.
External input (EI): PHP-files including DML-statements INSERT, UPDATE and DELETE executed as dynamic SQL. The search was a done by 'search in files' with notepad++, and visual inspection (Notepad++ 2007-2018). Server side code was considered and no stored procedures
Keywords: Function point analysis; Dynamic SQL
Received March 27, 2018; Accepted May 10, 2018; Published May 18, 2018
Citation: Lassen A (2018) Function Point Analysis FPA on A Team Planning Website Based on PHP and MYSQL. J Inform Tech Softw Eng 8: 237. doi:10.4172/2165-7866.1000237
Copyright: © 2018 Lassen A. This is an open-access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
or triggers found to include. The complexity was assessed by counting and weighing the DML statements found in each file.
**External inquiry (EQ):** PHP files with SELECT statements as Dynamics SQL. Files with INSERT, UPDATE and DELETE statements are not counted but treated as external input files.
**External output (EO):** These are reports, screens, messages. SMS messaging is an example of external output considered from these weighted measures according to unadjusted function points (UAF) was calculated [1]. General system characteristics (GSC) were evaluated for their degree of influence (DOI) summing to the total degrees of influence (TDI); data communication; distributed data processing; performance; heavily used configuration; transaction rate; on-line data entry; end-user efficiency; online update; complex processing; reusability; installation ease; operational ease; multiple sites; and facilitate change. Each GSC was rated for degree of influence (DOI) on a scale from 0 to 5: not present or no influence (0); incidental influence (1); moderate influence (2); average influence (3); significant influence (4); and strong influence (5). The value adjustment factor (VAF) was calculated as 0.01 times TDI + 0.65. The total adjusted function points (TAFP) was calculated as the unadjusted function points (UAF) times the value adjustment factor (VAF)
\[
VAF = (TDI \times 0.01) + 0.65
\]
\[
FP = UAF \times VAF
\]
Once calculated, the adjusted function points (FP) was used to assess the project size using the constructive cost model (COCOMO). The function point conversion table was examined and initially PHP was compared to java or C++ [1]. The conversion rate for java or C++ are the same. Average source LOC per function point is 53, and average source LOC for a 210 FP application is 11130 LOC. Since we have the source code [13], the actual LOC can be counted and compared to the estimated project size.
**Results**
The evaluation of the database relations was done in one pass. The evaluation of the PHP-files was done in several passes.
**Count-1:** Simple file count.
**Count-2:** Inspection of files for SELECT statements. Presence of Select in comments was disregarded and file Complexity was based on the number of SELECT-statements.
**Count-3:** Same evaluation based on inspection for INSERT-statements.
**Count-4:** Same evaluation based on inspection for UPDATE- and DELETE-statements.
**Internal logical files (ILF)**
Every relation in the database was considered. Some of the relations have media files. Media are implemented as attributes of type LONGBLOB or BLOB. All these relations are AVERAGE candidates.
**External measures**
**External Interface files (EIF):** No external interface files are determined at this point, unless the website configuration is to be considered. An external interface file must be generated or maintained by another system [1]. This measure is initially set to count 10 and weight AVERAGE (Table 1).
**External Input (EI):** These are input screen. Here the PHP code is inspected to determine input user. The initial file count done in Notepad++ by simple keyword search is tagged count-1 in Table 2. The result of the first count was 30 files with INSERT-statements, 49 files with UPDATE statements and 38 files with DELETE statements. Initially set to complexity AVERAGE.
Further passes are done with code inspection carefully. Keywords in comments and variable are discarded from counts. Files with several DML statements are judged for complexity and account for recurring files in the first count. A file with SELECT and DML modification statements (INSERT, UPDATE, DELETE) should only be classified as an external input file. EI should be reduced.
After the final pass, assessment of complexity is complete. Many overlaps of data manipulation statements are present in the same files and the total number of files included is 29. Files in the ‘classes’ folder are model-classes for the major relational entities and implement SELECT, INSERT, UPDATE and DELETE statements in various member functions. The final count is given in Table 2 (11 LOW, 7 AVERAGE, 11 HIGH).
**External output (EO):** These are reports, screens, messages. Here we know the SMS service is very important, but how many places are the SMS services called? Likewise we account for an email service. We estimate is 10 files, average complexity.
**External Inquiry (EQ):** Enquiry forms are listings; screens that are informational; SELECT statements. All files with keyword ‘SELECT’ were inspected using ‘find in files’ in Notepad++ (Notepad++ 2007-2018). The initial file count was 86. In the most cases SELECT’s would be simple, say 80%, so 86 files are divided into 16 files of AVERAGE complexity and 70 files with LOW complexity.
**SELECT-statements and dropdown html** are the vast candidates. Select is used in a HTML-tag for one option in a dropdown box. Select also is found in comments. Upload is a library used that is not included, even though some coding efforts must be done to facilitate upload (40 LOW, 13 AVERAGE, 5 HIGH).
Two further passes were done to inspect for data modifications statements. After inspection for INSERT, UPDATE and DELETE statements files initially classified External Inquiry (EQ) are classified as External input files and the EQ count reduced accordingly. In the last pass several UPDATE and DELETE-statements found and moved several EQ-AVERAGE and EQ-HIGH file to EI-files. The final assessment of complexity for External inquiry files (EQ) are
Table 1: Relations and their complexity. LOW 0-7. AVERAGE 6-15. HIGH 23-30 plus binary objects. SQL-DML reference in PHP code with table name. Cardinality is the number of tuples in each relation.
<table>
<thead>
<tr>
<th>Relation</th>
<th>Attributes</th>
<th>Complexity (low, Average, High)</th>
<th>Referred in code (notepad++)</th>
<th>Cardinality (tuples)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Availability</td>
<td>5</td>
<td>LOW</td>
<td>10 hits in 2 files</td>
<td>100</td>
</tr>
<tr>
<td>Comments</td>
<td>6</td>
<td>LOW</td>
<td>69 hits in 20 files</td>
<td>73</td>
</tr>
<tr>
<td>Contents (media, blob)</td>
<td>9</td>
<td>AVERAGE</td>
<td>112 hits in 23 files</td>
<td>318</td>
</tr>
<tr>
<td>Diary (media, blob)</td>
<td>5</td>
<td>AVERAGE</td>
<td>258 hits in 18 files</td>
<td>98</td>
</tr>
<tr>
<td>Equalizations</td>
<td>7</td>
<td>LOW</td>
<td>14 hits in 3 files</td>
<td>294</td>
</tr>
<tr>
<td>Events</td>
<td>15</td>
<td>AVERAGE</td>
<td>321 in 49 files</td>
<td>1175</td>
</tr>
<tr>
<td>Expenses</td>
<td>7</td>
<td>LOW</td>
<td>42 hits in 4 files</td>
<td>594</td>
</tr>
<tr>
<td>Expence ToPers</td>
<td>2</td>
<td>LOW</td>
<td>10 hit in 2 files</td>
<td>2454</td>
</tr>
<tr>
<td>Faqs</td>
<td>5</td>
<td>LOW</td>
<td>5 hits in 3 files</td>
<td>6</td>
</tr>
<tr>
<td>Gallery</td>
<td>8</td>
<td>AVERAGE</td>
<td>336 hits in 24 files</td>
<td>56</td>
</tr>
<tr>
<td>Help Table</td>
<td>2</td>
<td>LOW</td>
<td>2 hits in 2 files</td>
<td>6</td>
</tr>
<tr>
<td>Links</td>
<td>6</td>
<td>AVERAGE</td>
<td>44 hits in 15 files</td>
<td>119</td>
</tr>
<tr>
<td>Main Team (media, longblob)</td>
<td>23</td>
<td>HIGH</td>
<td>65 hits in 20 files</td>
<td>38</td>
</tr>
<tr>
<td>No SMS</td>
<td>2</td>
<td>LOW</td>
<td>12 hits in 4 files</td>
<td>1</td>
</tr>
<tr>
<td>Pers Category</td>
<td>4</td>
<td>LOW</td>
<td>12 hits in 6 files</td>
<td>123</td>
</tr>
<tr>
<td>Pics (media, longblob)</td>
<td>11</td>
<td>AVERAGE</td>
<td>51 hits in 13 files</td>
<td>981</td>
</tr>
<tr>
<td>Positions</td>
<td>11</td>
<td>AVERAGE</td>
<td>77 hits in 4 files</td>
<td>100</td>
</tr>
<tr>
<td>PosNeg</td>
<td>3</td>
<td>LOW</td>
<td>64 hits in 16 files</td>
<td>10127</td>
</tr>
<tr>
<td>Race Diary</td>
<td>15</td>
<td>AVERAGE</td>
<td>78 hits in 5 files</td>
<td>5</td>
</tr>
<tr>
<td>reminderLog</td>
<td>8</td>
<td>LOW</td>
<td>40 hits in 6 files</td>
<td>9218</td>
</tr>
<tr>
<td>Sponsor (media, blob)</td>
<td>8</td>
<td>AVERAGE</td>
<td>56 hits in 5 files</td>
<td>0</td>
</tr>
<tr>
<td>Stat</td>
<td>6</td>
<td>AVERAGE</td>
<td>613 hits in 61 files</td>
<td>382501</td>
</tr>
<tr>
<td>Team (media, blob x2)</td>
<td>30</td>
<td>HIGH</td>
<td>Common name 1949 hits in 99 files</td>
<td>209</td>
</tr>
<tr>
<td>Team To Member</td>
<td>5</td>
<td>LOW</td>
<td>67 files in 11 files</td>
<td>177</td>
</tr>
</tbody>
</table>
Table 2: DML modification statements (INSERT, UPDATE, DELETE). After the final pass many overlaps in files have been identified. The total number of files included is 29.
<table>
<thead>
<tr>
<th>DML</th>
<th>Complexity</th>
<th>Files</th>
</tr>
</thead>
<tbody>
<tr>
<td>IUD</td>
<td>LOW</td>
<td>11</td>
</tr>
<tr>
<td>IUD</td>
<td>AVERAGE</td>
<td>7</td>
</tr>
<tr>
<td>IUD</td>
<td>HIGH</td>
<td>11</td>
</tr>
<tr>
<td>SUM</td>
<td></td>
<td>29</td>
</tr>
</tbody>
</table>
Table 3: The complexity external inquiry, after four passes. summarized in Table 3 (31 LOW, 5 AVERAGE, 1 HIGH).
Table 4: Total unadjusted function points (UAF). After finished evaluation. Weights (w) applied [12].
The PHP-source code is less than twice as complex that the MYSQL data model of the two measures of complexity set EIF and EO, EO is to some extent reasonable. Of the two output modalities have been identified and styles emails can add to complexity. Taken together they are probably overestimated.
GSC and total adjusted function points
The unadjusted function points can now be weighted with a set of general system characteristics (GSC). The 14 system characteristics and the degrees of influence of each of the General system characteristics [10] are listed in Table 5 column “Degree of influence [1]”.
Add hoc setting for general system characteristics for this application was done. The unadjusted function point (UAF) of Table 5 was used to calculate the total adjusted function points. Generally the degree of influence have been reduced to a total of 23 degrees of influence. Only
one system characteristic (Multiple Sites) was set to average influence (3) as the application could be refurbished to several platforms, and the site give rise to 2 code bases. Seven system characteristics were set to moderate influence (2): Data Communication, On-line Data Entry, End User Efficiency, Online Update, Reusability, Installation Ease, and Operational Ease. Five system characteristics were set to incidental influence (1): Performance, Heavily Used Configuration, Transaction Rate, Complex Processing, and Facilitate Change. One system characteristic was set to not present or no influence (0): Distributed data processing.
The value adjustment factor for this study was found to be 0.88. A lower degree of influence than presented by Jack TM [12]. The total adjusted functions points (TAFP) for this project was 510 FP.
**COCOMO (Constructive cost model)**
The COCOMO analysis takes the total adjusted function point measure and converts to a measure of lines of delivered source code (LOC). In our case PHP and java script are taken as the java and C++ measure of 53 LOC per function point and 11130 average source LOC for a 210 FP application [12] (equation 4). My expectation for the current 510 FP measure for TAFP would be 2.4 * 11130 lines of code = 27442 LOC (when UAF = 580 and TAFP = 510), see equation 5. Which I hope will be found to be an over estimation for the original PHP site [13]. The estimated number of lines of code can then be converted to 27,4 KDSI (1000 delivered source instructions = 1000 LOC) by dividing by 1000 (equation 6).
\[
\text{Estimated LOC}_{\text{ad}} = (\text{TAFP} / 210 \text{ FP}) \times 11300 \text{ LOC}/53\text{FP} \quad (4)
\]
\[
\text{Estimated LOC}_{\text{ad}} = (510 \text{ FP}/210 \text{ FP} = 2.4) \times 11300 \text{ LOC} = 27442 \text{ LOC} \quad (5)
\]
\[
\text{Estimated KDSI}_{\text{ad}} = 27442 \text{ LOC} /1000 \text{ LOC} / \text{KDSI} = 27,4 \text{ KDSI} \quad (6)
\]
In COCOMO a man-month is 152 hours. In COCOMO first decide if the project is organic (expect few problems), Embedded (expect problems) or semi-detached (in-between). An embedded project scales to 3.6 \times \text{KDSI}^{1.20}. \text{KDSI} = 27.4 gives 191 Person-Months. I would go with the lower project classification (organic to semi-detached), 77-122 person-months. The estimate is 19-30 months for a 4 crew team, or 2+ years (Table 6).
The actual lines of code counted is about 43000 LOC including 20700 LOC for 3-party code. The KDSI measure of COCOMO is a measure of delivered source code instructions. This amounts to 43000-20700 = 22300 lines of delivered source code (22,3 KDSI). Compared to the result of the constructive cost model estimate of 27,4 KDSI, this is an overestimation by 23%.
**Discussion**
The first key question here is training. The subjective measure of complexity in a smaller custom website, compared to corporate wide. Does this lead to overestimation? Yes. In this function point analysis only the relational tables on their complexity was held against the PHP code as an external application. The function point analysis was calculated from a database standpoint. There are other factors that have only been touched.
It was surprising that function point analysis of a custom website developed by one programmer and operational over a period of 6 years had the estimation of 510 function points (FP) converting to an expected 27000 lines of code. I had expected less complexity. Experience with FPA will give more precise estimates for each parameter and even bring the FPA closer to the source code count. In this study the boundary elements considered were primarily entity- and transactional complexity. They seemed a tangible constraint on metrics explored. Other metrics could be considered. A metric for algorithmic complexity (AT) that also is an interesting metric, but may be more academic than operational even in systems of modest size [4].
The Java code calibration is a candidate for debate. In this study it worked out well, but I must also note some complex PHP and Java script-files were not included. This would only increase the measure. And training would cater for this. In the COCOMO analysis overestimation could also be biased by my ad hoc setting of the various degrees of influence.
A reason to retrospective make a function point analysis in this case was the author's lack of luck to debug and support the site after the creator passed away and the vendor upgraded the PHP-version, rendering the site down. This lack of skills can be attributed in some part to Fredric Brooks – “The mythical man month’[5] but also the teachings of Peter Naur, ‘Computing a human activity’ and ‘Programming as theory building’ [15-17]. In the section ‘program life, death and revival’ ties well into the problem not having access to programmers with working knowledge [16]. Barry Boehm [5]and others list issues with project estimation, also covers unfamiliarity with existing source code [3,5,15]. This is a real obstacle or spike if you will, in reviewing and debugging existing code. It is the author’s view that more frequently
The project type Person-months KDSI Person-months Team4-months
<table>
<thead>
<tr>
<th>Project type</th>
<th>Person-months</th>
<th>KDSI</th>
<th>Person-months</th>
<th>Team4-months</th>
</tr>
</thead>
<tbody>
<tr>
<td>Organic</td>
<td>2.4 * KDSI^{1.05}</td>
<td>27.4</td>
<td>77</td>
<td>19</td>
</tr>
<tr>
<td>Semi-detached</td>
<td>3.0 * KDSI^{1.20}</td>
<td>27.4</td>
<td>122</td>
<td>30</td>
</tr>
<tr>
<td>Embedded</td>
<td>3.6 * KDSI^{2.00}</td>
<td>27.4</td>
<td>191</td>
<td>48</td>
</tr>
</tbody>
</table>
Table 6: Calculating person months and team months for a four person team (person-month divided by 4) based on KDSI=27.4
than admitted; it is the wiser choice to re implement the code in face
of rejection of the initial strategy. Support for this argument can also
be in comparing computing as text production to theory building [16].
In this case the following observations contribute to understand the
current system down: Broken links. Possible missing URL resolutions;
Application state could not be debugged and restored; Vendor upgrade
coincided with mourning period.
Conclusion
The Internal Logical File complexity holds for the number of
files/entities, but the complexity (LOW; AVERAGE; HIGH) could be
overestimated for a smaller custom website.
Using DML (Data Manipulation Language) as a marker for EI
an EQ in a website seems operational in a retrospective study (where
the coding has been done). The initial keyword search identifies key
participating potential relevant external files. A code inspection is
necessary to as's complexity and relevance.
It was found that the “myteam” custom website consist UAF=580
FP unadjusted function points, TDI=23 Total degrees of influence,
Value adjustment factor, VAF=0.88; Total adjusted function points
TAFP=510FP.
The COCOMO analysis showed an estimated project size of
27.4 KDSI or 27442 LOC. Based on 27.4 KDSI the project type was
classified as organic to semi-detached, and project estimate of 66-
82 person-months or 16-21 team-months for a four person team.
An overestimation of 23% is found compared to the current count
of the actual lines of code. The function point analysis explained the
complexity quite well.
References
Proceedings of SHARE7GUIDE IBM Applications Development Symposium,
2. Albrecht AJ, Gaffney JE (1983) Software function, source lines of code and
development effort prediction: A software science validation. IEEE Transaction
4. Henderson GS (1992) The application of function points to predict source lines
of code for software development. Thesis.
ISESEM.
developers’ performance evaluation. 4th int. conf. on wireless communications,
networking and mobile computing pp:1-4.
point analysis method: A systematic literature review. IEEE Trans Engineering
management 62: 495-506.
development teams. Serbian journal of management 7: 65-75.
10. Sheetz SD, Henderson D, Wallace L (2012) Understanding developer and
manager perceptions of function points and source lines of code. The Journal
of systems and software 82: 1540-1549.
Danish yachtracing crews participating in national and international match race.
Domain www.myteam.dk.
5th Edition. Person prentice Hall.
engineering. Addison-Wesley.
microprogramming 15: 253-261.
|
{"Source-Url": "https://static-curis.ku.dk/portal/files/216974914/Function_point_analysis_fpa_on_a_team_planning_website_based_on_php_and_mysql_2165_7866_1000237.pdf", "len_cl100k_base": 6234, "olmocr-version": "0.1.53", "pdf-total-pages": 6, "total-fallback-pages": 0, "total-input-tokens": 17915, "total-output-tokens": 6889, "length": "2e12", "weborganizer": {"__label__adult": 0.0003306865692138672, "__label__art_design": 0.0002410411834716797, "__label__crime_law": 0.0002453327178955078, "__label__education_jobs": 0.0013484954833984375, "__label__entertainment": 4.89354133605957e-05, "__label__fashion_beauty": 0.0001271963119506836, "__label__finance_business": 0.0004982948303222656, "__label__food_dining": 0.0002830028533935547, "__label__games": 0.00042629241943359375, "__label__hardware": 0.0006589889526367188, "__label__health": 0.00045680999755859375, "__label__history": 0.00019121170043945312, "__label__home_hobbies": 0.00010120868682861328, "__label__industrial": 0.0002605915069580078, "__label__literature": 0.00024211406707763672, "__label__politics": 0.00012791156768798828, "__label__religion": 0.0002543926239013672, "__label__science_tech": 0.008758544921875, "__label__social_life": 0.00011467933654785156, "__label__software": 0.006862640380859375, "__label__software_dev": 0.9775390625, "__label__sports_fitness": 0.00024771690368652344, "__label__transportation": 0.0003952980041503906, "__label__travel": 0.00018465518951416016}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 26690, 0.05122]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 26690, 0.245]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 26690, 0.88976]], "google_gemma-3-12b-it_contains_pii": [[0, 574, false], [574, 6581, null], [6581, 12140, null], [12140, 17180, null], [17180, 22809, null], [22809, 26690, null]], "google_gemma-3-12b-it_is_public_document": [[0, 574, true], [574, 6581, null], [6581, 12140, null], [12140, 17180, null], [17180, 22809, null], [22809, 26690, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 26690, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 26690, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 26690, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 26690, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 26690, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 26690, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 26690, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 26690, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 26690, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 26690, null]], "pdf_page_numbers": [[0, 574, 1], [574, 6581, 2], [6581, 12140, 3], [12140, 17180, 4], [17180, 22809, 5], [22809, 26690, 6]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 26690, 0.18782]]}
|
olmocr_science_pdfs
|
2024-12-06
|
2024-12-06
|
21bbbd63522a0f2394dafdd18a31cb944a64aebc
|
Construction of an Owl Ontology with the Protégé Development Environment
Vanessa Tenopala Zavala¹, José Crispín Hernández Hernández¹, Perfecto Malaquias Quintero Flores¹, Oscar Atriano Ponce²
¹Tecnológico Nacional de México. Instituto Tecnológico de Apizaco
División de Estudios de Posgrado e Investigación, Avenida Instituto Tecnológico s/n C.P. 90300, Apizaco, Tlaxcala, México.
²Smartsoft America BA, Chiautempan 90802, Mexico; oatriano[at]smartsoftamerica.com.mx
Abstract: Today the internet has changed the way we communicate at all levels, including the professional who at the same time goes hand in hand with the staff. Every day it is more difficult to carry out some activity without the help of Internet search engines, so organizations must be at the forefront of technology and be able to meet the needs of users. The current web has some disadvantages in terms of the information that is published day by day, so the Internet intends to evolve giving way to the semantic web or web 3.0. The semantic web has as its main elements the "Ontologies". This article refers to a description for the development of OWL ontologies using the Protégé development environment as a tool.
Keywords: Internet, Semantic web, OWL Ontologies, Protegé
1. Introduction
The web content is designed only for human understanding and not for machines. However, as a result of the growth of web content, the efficiency of current search engines is greatly reduced and becomes a major problem on the web. The idea of the Semantic Web was presented by the inventor of the World Wide Web, Tim Berners-Lee. The Semantic Web is an extension of the current web where information receives well-defined meanings that improved interoperability between machines and humans [1].
The semantic web is a way in which the user could find answers to their questions more quickly and easily. The objective of W3C (World Wide Web Consortium) is to make semantics the main protagonist in the linguistic part for the study of lexical structures and mental processes since by means of these human beings we are able to make sense of linguistic expressions, in addition to being the main way of Human-Computer communication.
The ontologies are the main elements of the Semantic Web that act as semantic repositories between machines.
2. Ontologies
Ontology is a term taken from philosophy, but in computer science an ontology is the representation of a domain of knowledge, where a set of objects and their relationships are described by a vocabulary [2].
An ontology is a hierarchy of concepts with attributes and relationships that have an agreed terminology to define semantic networks of interrelated units of information. An ontology provides a vocabulary of classes and relationships to describe a domain. Ontologies are used to capture knowledge about some domain of interest. An ontology describes the concepts of the domain, as well as the relationships that exist between them. There are different languages for ontologies that provide various facilities; The most recent standard given by the W3C is the OWL (Web Ontology Language) [3].
An ontology must be able to provide a good understanding of the domain it represents. This includes relationships of terms and concepts, their definitions or meanings, their relationships with each of them and the characteristics of the domain. This helps in solving the differences between the models and the domain used by the available sources, which is done by mapping the available data of all the resources for all the domains from the local model used by the source for the model specified by of the ontology [4].
2.1 OWL ontology language
The OWL is designed to be used when the information contained in the documents needs to be processed by programs or applications, as opposed to situations where the content only needs to be presented to human beings. OWL can be used to explicitly represent the meaning of terms in vocabularies and the relationships between those terms. This representation of the terms and their relationships is called ontology. The web ontology language (OWL) is an extension of the Resource Description Framework (RDF) language. OWL has functions that can express the meaning and semantics that XML, RDF, and RDFS cannot, goes beyond what these languages offer, since OWL has the possibility to represent the content of the web so that it can be understood and interpreted by machine.
If the machines are capable of performing reasoning tasks on the documents in which a semantics are used that go further than the basic semantics of RDF Schema, the semantic web will be on track.
OWL has the following levels:
- OWL Lite: It has simple restrictions (cardinality only 0 or 1), it facilitates compatibility with other models/paradigms in addition to facilitating the development of authoring
tools. It has an efficient reasoning, facilitates the development of tools, compatibility with other models. It is the least expressive and is used in situations where there is only a simple hierarchy of classes and where few restrictions are needed.
- **OWL DL (Description Logics):** It is medium term in terms of expressiveness; it is based on descriptive logic, which is a logic based on first order; This is favorable for automatic reasoning, for ranking hierarchies and for detecting inconsistencies in ontologies. Use restrictions to ensure the existence of a reasonable reasoning procedure. There can be no cardinality restrictions (local or global) in transitive properties, neither its inverse nor its super properties. There can be missing definitions. The axioms of inequality can only be applied to named instances.
- **OWL Full:** It is the most expressive; it is used in situations where extreme expressiveness is more important than the ability to reason. Performs OWL and RDF syntax union (no restrictions).
OWL levels based on RDF explain that OWL Lite is contained in OWL DL and this is contained in OWL Full. OWL is expressed with RDF primitives, so that any valid OWL document is a valid RDF document. RDF is contained in OWL Full (the latter is an extension of RDF) so that a valid RDF document is a valid document in OWL Full.
3. **Protégé**
Protégé is an open source tool developed at Stanford Medical Informatics. Like many other modeling tools, Protégé is separated between a model part and a view part. The Protégé model is the internal representation mechanism of ontologies and knowledge bases. The components of the Protégé view provide the user with an interface to visualize and manipulate the model [5].
The Protégé model is based on a metamodeling comparable to object-oriented systems and frame-based systems. Protégé can represent ontologies that consist of classes, properties, characteristics of properties and instances, its advantage is that its metamodeling is a Protégé ontology. The structure of the Protégé metamodeling easily enables extension and adaptation to other representations.
Protégé is capable of generating user interfaces that support the creation of instances. In each class of the ontology the system creates a form with editing components for each property of the class [6].
Protégé can currently be used to load, edit and save ontologies in various formats such as CLIPS, RDF, XML, UML, OWL. Ontologies play an important role in semantic web applications. Protégé extensions can benefit from the general services provided by the core platform, to an event mechanism, undo capabilities and plugin mechanisms.
With the Protégé OWL plugin, you can allow many people to edit the same ontology at the same time. Protégé also provides a highly scalable database, which allows users to create ontologies with many classes [7].
The OWL plugin is a complex extension that can be used to edit OWL files and databases. The plugin includes a collection of features for components called widgets and provides access to services based on classification, consistent checking and testing.
Protégé OWL is a tool that makes possible the description of concepts and provides facilities such as: a rich set of operators (and, or and denial); it is based on a logical model that guarantees that the concepts are well described; complex concepts can be described, and the logical model allows the use of a reasoner that checks the consistency described in the ontology ensuring that the hierarchy is correct, known as the Racer reasoner.
3.1 **OWL ontology construction**
An OWL ontology is composed of individuals, properties and classes. Individuals represent domain objects of interest and are also known as instances. Properties are binary relationships on individuals and can be inverse, transitive or symmetric. OWL classes are understood as sets that contain individuals and can be organized within a hierarchy of classes and subclasses known as taxonomy. Classes are also known as concepts, as they are a concrete representation of them [8].
3.1.1 **Class**
When starting an OWL ontology there is an initial class called "owl:Thing" that will contain the ontology. To create a class, you must use the corresponding icon in the class browser window as shown in figure 1.

3.1.2 **OWL Properties**
OWL properties represent relationships between two objects or individuals. There are two types of properties in OWL: "ObjectProperties", which allows one individual to relate to another, and "DatatypeProperties", which relates an individual to an XML Schema Datatype value or an RDF literal [8]. The figure 2 shows a window that shows how to
add properties of the two types mentioned. The elements that
an ObjectProperty must have are name, domain and range,
where the domain refers to the initial class or classes and the
range to the final class or classes that relates that property.
3.1.3 Inverse properties
Any object property or "ObjectProperty" must have a
specified domain and range; properties link domain objects to
objects in the range, where the domain and range are classes
defined in the ontology.
Each ObjectProperty must have its corresponding inverse
property. If a property links an object A with another B, then
the inverse property links object B with A.
3.1.4 OWL property features
OWL allows the meaning of the properties to be enriched
with the characteristics of the properties, which are:
• **Functional properties**: If a property is functional given an
object, an object related to another can be at most by this
property. For example, if you have three objects that are A,
B and C and you have a functional property with Father,
then you could associate objects A and B through the
property and it would result in A having Father B. You
could also associate the objects A and C by means of the
property and would result in A Having Father C. Since
Father has functional property, it is concluded that B and C
are the same object.
• **Inverse functional properties**: If a property is inverse
functional, it indicates that an object related to another can
be at most by this property inversely to the original
functional property. For example, if you have three objects
that are A, B and C and you have a functional property
isFatherOf, then you could associate the object B and A
through the property and it would result in B isFatherOf A.
You could also associate the objects C and A by means of
the property and would result in C is Father A. As
isFatherOf is inverse functional property, it is concluded
that B and C are the same object.
• **Transitive properties**: If a property is transitive and
relates two objects A and B, and there is also a property
that relates object B to another C, then it can be inferred
that object A is related to object C through the transitive
property.
• **Symmetric properties**: If a property P is symmetric and
the property relates to objects A and B, then object B is
related by means of property P with object A.
3.2 Definition and description of CLASSES
Once several properties have been created, they can be used
to define and describe the behavior of classes [5].
3.2.1 Property restrictions
Properties are used to create restrictions on classes in an
OWL ontology. Usually the name of the property should
suggest the restrictions imposed on the objects of the class.
OWL restrictions are presented in the following three categories:
• Quantification restrictions.
• Cardinality restrictions.
• Value restrictions.
The quantification restrictions consist of the following
elements:
• Existential quantifier (\(\exists\)), which allows to indicate
the existence of at least one object.
• Universal quantifier (\(\forall\)), which allows to indicate
the existence of all objects.
Given the ontology shown in figure 3, which represents the
conceptualization of the university model, different
restrictions can be made using previously defined properties
and applying existential quantifiers.

3.3 Reasoning of the ontology
To perform the reasoning of an ontology it is necessary to acquire a tool that acts as a reasoner for Protégé. There is a tool called Racer that can be connected with Protégé for the analysis and reasoning of ontologies.
To start Racer, run the RacerPro program. A window will appear as shown in the figure 4 indicating that RacerPro is running on the IP address: localhost and on the port: 8088 previously configured.

It is necessary to configure the address where the RacerPro reasoner is running in Protégé. To do this, you enter the OWL Preferences window and set the address set in RacerPro.
Racer is used for three main activities that are:
- **Consistency check**: It allows checking that there is consistency between the properties of objects and restrictions assigned to the classes.
- **Taxonomic classification**: Find the ontology hierarchy of the ontology based on the assertion hierarchy, which is the classification obtained in the construction of the ontology.
- **Inferred type computing**: Allows computing the types of objects within the ontology
By executing the taxonomic classification that is Racer's most important operation, Protégé generates a hierarchy of inference in the ontology as shown in the figure 5.

3.4 OWLViz
OWLViz is a Protégé tool that is installed using a plugin. To make use of this plugin it is necessary to install a tool that allows graphic components of the ontology called Graphviz. Once OWLViz and Graphviz are installed, a tab is generated in the Protégé environment called OWLViz. There is a toolbar that provides different features to the plugin. In this bar there is an icon called options, which you need to access to indicate the path of the Graphviz application [9].
Once all the installed elements are found, the ontology can be generated graphically with the assertion hierarchy or inference hierarchy as shown in the figure 6.

4 Results
Based on the research and experiments performed for the preparation of this article, it has been possible to observe the great importance of ontologies in the different applications of solutions based on the semantic web. In addition, if the use of web services is considered for the implementation of the semantics described by the designed ontology, it is necessary to apply the concepts of orchestration and choreography in order to achieve in a synchronized way the correct flow of information between services and in this way obtain a product with a high level of abstraction from the problem domain.
Once the ontology has been prepared using the Protégé tool, the taxonomy that this ontology represents is generated using the RacerPro tool. This taxonomy is based on OWL properties raised in the designed ontology, allowing this process to show the results in terms of inferences generated by the model that describes the problem domain. Based on these results, we proceed to implement the model described with the help of a technological platform that allows the construction of web services, which, when built under a semantic model, become semantic web services.
However, the process of implementing this model implies the need to make use of existing technologies and paradigms, with a lower level of abstraction than ontologies. By performing this step, which becomes necessary in the process of executing a project, one can think that the power that semantic web models offer is simplified.
For the applications to implement all the semantics proposed by an ontology, it may be necessary to build a semantic interpretation platform for said ontology, that is, it is necessary to generate a very high level language that allows to directly encode the provided semantics of the domain represented. Considering this point of view, one might think that the features offered by OWL are not sufficient for the implementation of semantic web systems that provide the complete abstraction of the business logic of the model using the software development languages currently available.
5 Conclusions
The semantic web can be considered an extension of the web of today that allows to manage new technologies to improve the use and access of the resources of the web making use of concepts such as OWL and WSDL (Web Service Definition Language), which support an ontological language to define and classify concepts in a domain. These can be implemented through web services.
- An ontology is a hierarchy of concepts with attributes and relationships that creates a classification to define the semantics of interrelated units of information. Ontologies provide an understanding of a domain that can be communicated between people and heterogeneous systems.
- Protégé is an ontology development tool that allows the construction of OWL ontologies taking into account all the characteristics of the domain. Through Protégé the development of properties and restrictions allows to generate inference about the domain, generating conceptualization and knowledge of it.
- Racer allows you to quickly verify an ontology taking into account elements of consistency, in addition to performing the taxonomic classification called the inference hierarchy, derived from the model built in the ontology called the assertion hierarchy. Based on these elements, the importance of ontology within the concept of the semantic web becomes understandable.
- OWLVis is a Protégé tool that allows graphic representations of the ontology either in assertion or inference models.
References
Author Profile
Vanessa Tenopala Zavala: Graduated as a computer technician from the Colleges of Scientific and Technological Studies (CECyTE) Plantel 07 Ahuashuatepec., Obtained her career as a computer engineer at the Autonomous University of Tlaxcala and currently studies the master's degree in computer systems at the Technological Institute of Apizaco.
José Crispín Hernández Hernández: He obtained the title of Lic. In Computing by the Technological Institute of Apizaco (ITA), Apizaco, Tlax., Mexico, in 1993. The degree of M. in C. in Computational Sciences by the ITA, Apizaco, Tlax., Mexico, in 1998. And the degree of Doctorate in Informatique by the Université d'Angers, France in 2008. His areas of research include: metaheuristics optimization, bioinformatics, biomedicine, fuzzy logic, computer vision.
Perfecto Malaquías Quintero Flores: Industrial engineer in production (manufacture) by the Instituto Tecnológico de Apizaco (ITA), Apizaco, Tlaxcala, México. Master’s degree in computer science by the centro de graduados e investigación del Instituto Tecnológico de Toluca, Metepec, Edo. De México. PhD in computational sciences in the Université Montpellier 2 (UM2) in the laboratory for computational sciences, robotics and microelectronics of the Université Montpellier 2 and the national center for scientific research of France (LIRMM-CNRS) in Languedoc Roussillon, France. He obtained the certification in PSP, by Software Engineering Institute – Carnegie Mellon University, on June 2014.
Volume 8 Issue 8, August 2019
www.ijsr.net
Licensed Under Creative Commons Attribution CC BY
Paper ID: ART2020824 10.21275/ART2020824 2070
|
{"Source-Url": "https://www.ijsr.net/archive/v8i8/ART2020824.pdf", "len_cl100k_base": 4255, "olmocr-version": "0.1.50", "pdf-total-pages": 5, "total-fallback-pages": 0, "total-input-tokens": 27263, "total-output-tokens": 4995, "length": "2e12", "weborganizer": {"__label__adult": 0.0002944469451904297, "__label__art_design": 0.0005788803100585938, "__label__crime_law": 0.0004706382751464844, "__label__education_jobs": 0.0015592575073242188, "__label__entertainment": 0.0001145005226135254, "__label__fashion_beauty": 0.00017213821411132812, "__label__finance_business": 0.0003750324249267578, "__label__food_dining": 0.0003209114074707031, "__label__games": 0.0005216598510742188, "__label__hardware": 0.0006861686706542969, "__label__health": 0.0005784034729003906, "__label__history": 0.00030684471130371094, "__label__home_hobbies": 0.00011074542999267578, "__label__industrial": 0.00043320655822753906, "__label__literature": 0.0005288124084472656, "__label__politics": 0.0002913475036621094, "__label__religion": 0.0005536079406738281, "__label__science_tech": 0.10235595703125, "__label__social_life": 0.00016772747039794922, "__label__software": 0.051483154296875, "__label__software_dev": 0.83740234375, "__label__sports_fitness": 0.000225067138671875, "__label__transportation": 0.0004017353057861328, "__label__travel": 0.00022852420806884768}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 21676, 0.02182]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 21676, 0.84721]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 21676, 0.90798]], "google_gemma-3-12b-it_contains_pii": [[0, 4858, false], [4858, 9595, null], [9595, 13026, null], [13026, 17231, null], [17231, 21676, null]], "google_gemma-3-12b-it_is_public_document": [[0, 4858, true], [4858, 9595, null], [9595, 13026, null], [13026, 17231, null], [17231, 21676, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 21676, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 21676, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 21676, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 21676, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 21676, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 21676, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 21676, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 21676, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 21676, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 21676, null]], "pdf_page_numbers": [[0, 4858, 1], [4858, 9595, 2], [9595, 13026, 3], [13026, 17231, 4], [17231, 21676, 5]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 21676, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-01
|
2024-12-01
|
4660cadab2ccf73ce1b9703d1657af8edd89101e
|
Requirements of Software Visualization Tools: A Literature Survey
Holger M. Kienle and Hausi A. Müller
University of Victoria, Canada
hkienle@acm.org and hausi@cs.uvic.ca
Abstract
Objective: Our objective is to identify requirements (i.e., quality attributes and functional requirements) for software visualization tools. We especially focus on requirements for research tools that target the domains of visualization for software maintenance, reengineering, and reverse engineering.
Method: The requirements are identified with a comprehensive literature survey based on relevant publications in journals, conference proceedings, and theses.
Results: The literature survey has identified seven quality attributes (i.e., rendering scalability, information scalability, interoperability, customizability, interactivity, usability, and adoptability) and seven functional requirements (i.e., views, abstraction, search, filters, code proximity, automatic layouts, and undo/history).
Conclusions: The identified requirements are useful for researchers in the software visualization field to build and evaluate tools, and to reason about the domain of software visualization.
1. Introduction
The identification of requirements—explicitly documented or not—is an important part of each software development project. This is also true for the construction of software visualization tools, regardless whether the objective is building of an industrial-strength tool or a research prototype.
Software systems built for a certain domain often have to meet established “base-line” requirements of that domain. These base-line requirements emerge over time and are agreed upon by the domain’s experts. The goal of this paper is to identify base-line requirements for the domain of software visualization by means of a literature survey. We assume that requirements reported (independently) by several expert sources are a good indication that tools should meet them in order to be useful and fulfill the expectations of users. The survey’s requirements are objective in the sense that they are based on a comprehensive literature review that covers the opinions stated by many experts of the domain. For the literature survey, we have mostly focused on software visualization for software maintenance, reengineering, and reverse engineering.
Even though we chose the term requirements, it is not meant to be interpreted in an overly restrictive sense. As argued by Carney and Wallnau, the terms “preference” or “desire” might be more suitable [12]. Furthermore, builders of software visualization tools cannot expect to meet all requirements equally well. In the words of Bass et al., “no quality can be maximized in a system without sacrificing some other quality or qualities” [5, p. 75]. Following this line of thought, a software visualization tool that is missing some of the requirements identified can still be satisfactory.
The requirements exposed by our survey can contribute to advance software visualization in several ways. Firstly, builders of software visualization tools can use the survey’s requirements as a starting point for requirements elicitation of their tools. Specifically, the survey can be used as a checklist to make sure that no important requirements have been missed, thus increasing the confidence of the developers. Secondly, the survey can be used to pick suitable requirements for measuring and comparing tools. An evaluation can pick (and formally) assess a set of accepted requirements to convince fellow researchers of a tool’s adequacy or superiority compared to another tool. Lastly, (idealized) requirements can drive tool research. Storey et al. believe that “surveys in any research discipline play an important role as they help researchers synthesize key research results and expose new areas for research” [59]. This survey reflects the current state of tool requirements and thus can serve to identify open and new requirements for future research directions.
The paper is organized as follows. Sec. 2 describes the research approach that we followed when conducting the literature survey. Sections 3 and 4 discuss the requirements uncovered by the survey, separating them into quality attributes and functional requirements. Sec. 5 draws conclu-
sions and points out future work.
2. Followed Research Approach
Often surveys and reviews are conducted, or frameworks are proposed without explicitly stating the process of their creation. This makes it difficult for other researchers to judge their scope, applicability, and validity. The requirements in this survey have been identified following a process proposed by Kitchenham et al. called evidence-based software engineering (EBSE) [30].
<table>
<thead>
<tr>
<th>Step</th>
<th>EBSE [30]</th>
<th>Our survey</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Converting the need for information into an answerable question.</td>
<td>What requirements should software visualization tools satisfy?</td>
</tr>
<tr>
<td>2</td>
<td>Tracking down the best evidence with which to answer that question.</td>
<td>Literature search of selected publications (with authors’ domain knowledge).</td>
</tr>
<tr>
<td>3</td>
<td>Critically appraising that evidence for its validity, impact, and applicability.</td>
<td>Review and classification of requirements.</td>
</tr>
<tr>
<td>4</td>
<td>Integrating the critical appraisal with our software engineering expertise and with our stakeholders’ values and circumstances.</td>
<td>Application of the survey to assess several reverse engineering tools [29].</td>
</tr>
<tr>
<td>5</td>
<td>Evaluating our effectiveness and efficiency in executing Steps 1–4 and seeking ways to improve them both for next time.</td>
<td>Assessment of survey coverage, feedback from other researchers.</td>
</tr>
</tbody>
</table>
Table 1. The five steps of EBSE and how they are implemented by this paper’s survey
The five steps needed to practice EBSE are summarized in Table 1. Whereas the goal of EBSE is quite broad, its process is applicable to guide the survey. In the following, we briefly discuss each of EBSE’s steps and how it was implemented by our survey. A more detailed description can be found in the first author’s dissertation [29].
As the first step an answerable research question is defined. The question should be general enough so that a sufficient body of work applies. Our research question is: What (non-functional) requirements should software visualization tools satisfy? Step 2 involves identifying the relevant work that helps in answering the question posed in Step 1. The survey follows the ideas of systematic review, which defines an appropriate search method to ensure a sufficient coverage of the literature. To structure the survey, in step 3 the identified requirements of individual sources were grouped into suitable categories. At the top-level we distinguish between quality attributes and functional requirements. In step 4, we have so far applied the identified requirements to assess the quality of reverse engineering tools built from components [29]. Otherwise, the survey currently has no explicit stakeholders; we hope for other researchers to provide feedback and report on the usefulness of the survey for their own research.
It is difficult to evaluate literature surveys of this kind (step 5) because an exhaustive search is impossible. However, we believe that the survey’s coverage of sources is representative of the domain of software visualization research. Whereas the survey certainly has missed sources, it succeeded to identify the critical tool requirements. We encourage other researchers to identify missed sources and to critique the survey.
3. Quality Attributes
This section describes the seven quality attributes identified by the survey. Due to space constraints, we only report here a subset of the sources that our literature search identified.
Rendering Scalability A survey among users of software visualization tools has found that there is equal weight on the visualization of small, medium, and large target systems [6]. Thus, in order to accommodate typical user needs, a visualizer’s rendering speed should scale up to large amounts of data. This is especially the case for interactive systems that allow direct manipulation of graphs or diagrams. Storey et al., reporting on a user study with the SHriMP visualizer, found the following: “The single most important problem with SHriMP views was the slow response of the interface. Since SHriMP views are based on direct manipulation, users expecting immediacy were disturbed by the slow response” [62]. Armstrong and Trudeau state in their tool evaluation that “fast graph loading and drawing is essential to the usability of any visualization tool” [1]. Bellay and Gall use “speed of generation” of textual and graphical reports as an assessment criterion and experienced that “graphical views often need an unacceptable amount of time to be generated because of the layout algorithms” [7]. Bassil and Keller’s survey on software visualization tools includes “tool performance (execution speed of the tool)” as a practical aspect [6, P5].
Information Scalability Besides rendering speed, there is another scalability issue: cognitive overload of the user caused by “overplotting.” For example, hypertext navigation of reverse engineering information can suffer if the “information web” gets too large: “As the size of this web grows, the well-known “lost in hyperspace” syndrome limits navigational efficiency” [69, sec. 3.3.1]. The authors of the REforDI reengineering environment say, “very soon we recognized that due to the limited perceptivity of human beings it is very important to be able to reduce and extend the amount of visualized information on demand” [13]. Similarly, Reiss says that “practical program visualization must
provide tools to select and display just the information of interest” [49]. Examples of techniques to accomplish these goals are abstraction and filters (cf. Sec. 4). Koschke explicitly identifies both rendering and information scalability problems as major research challenges: “Scalability and dealing with complexity are major challenges for software visualization for software maintenance, reverse engineering, and re-engineering. Scalability concerns both the space and time complexity of visualization techniques, as, for instance, automatic layouts for large graphs, as well as the need to avoid the information overload of the viewer” [32].
**Interoperability** For tools to interoperate, they have to agree on a suitable interoperability mechanism in some form or another. As a consequence, research papers often directly address the question of how to achieve interoperability, without explicit stating it as a requirement first. Researchers that leverage software visualizations stress the importance of interoperability because it enables them to reuse existing functionality, for instance to (opportunistically) assemble a tool set that supports a particular reverse engineering task or process [9].
A lightweight interoperability mechanism used by many tools are (graph) exchange formats [28]. Exchange formats use simple files as a (temporary) repository for information transfer. The coupling between tools that exchange information is loose; an information producer need not to know its information consumers. Examples of popular formats to represent graphs for visualizing software structures are RSF, TA, and GXL.
Researchers have proposed different approaches to make tools more interoperable. For example, Panas et al. have implemented an object-oriented tools framework in Java [44]. Tools have to implement certain interfaces to plug into the infrastructure. The SHriMP tool uses a JavaBeans architecture [8]. This approach greatly reduced the effort to integrate it with the Eclipse framework and the Protege knowledge-management tool. Furthermore, new exchange formats can be supported by implementing a new instance of SHriMP's Persistent Storage Bean. The Common Object-based Reengineering Unified Model (CORUM) [77] and CORUM II [27] proposals strive to provide a common framework, or middleware architecture, for reverse engineering tools, encompassing standard APIs and schemas for ASTs, CFGs, call graphs, symbol tables, metrics information, execution traces, and so on. However, the more sophisticated the interoperability mechanism, the more standardization and agreement among tools is necessary.
**Customizability** Typically, tools enable customization of their functionalities via configuration files, built-in scripting support, or programmable interfaces [36]. Customizability enables to meet needs that cannot be foreseen by tool developers, for instance, if a tool is applied in a new context.
In Bassil and Keller's survey, 45% of the respondents rated the "possibility to customize visualization" as "absolutely essential" [5, F29]. The developers of the Sextant software comprehension tool say, "we conclude that software exploration tools should be extensible to accommodate for domain-specific navigation elements and relationships as needed" [17]. Even though customization seems important, tools are lacking in this respect [59]. Wang et al. conclude that "existing visualization tools typically do not allow easy extension by new visualization techniques" [72]. They have developed the EVolve software visualization framework, which "is extensible in the sense that it is very easy to integrate new data sources and new kinds of visualizations." A new visualization is realized by extending the EVolve Java framework, which already provides abstractions for bar charts, tables, dot-plots, and so on. Similarly, Reiss has analyzed why software understanding tools are often not used and concludes that "the primary reason was that they failed to address the actual issues that arise in software understanding. In particular, they provided fixed views of a fixed set of information and were not flexible enough" [50]. He also states that "since we cannot anticipate all visualizations initially, it should be easy to add new graphical objects to the system" [48]. Among the requirements that Favre states for his GSEE software exploration environment is the need for "customizable exploration" [18]. Tilley states that "users need to be able to impose their own personal taste on the user interface... The goal of environmental customizability includes modification of the system's interface components such as buttons, dialogs, menus, and scrollbars" [67, sec. 4.3.3.3].
**Interactivity** Many applications of software visualization are interactive and explorative in nature. For example, Marshall et al. state that tools that render graphs must allow the user “to manipulate it, in addition to navigate it” [38]. Wong states that tools supporting reverse engineering activities should “provide interactive... views, with the user in control” [74, Req. 15]. Koschke says that “the user needs the ability to control the logic used to produce the visualization in order to speed the process of trying different combinations of techniques” [32]. However, tool interactivity has to be balanced with suitable automation, otherwise significant reverse engineering tasks might suffer from the large number of required user interactions [13].
Among the tool features that Storey recommends for program comprehension tools are various forms of “browsing support” [57]. In her cognitive design framework, she also requires tools to “provide arbitrary navigation”[58, p. 149]. In the context of graph visualization, Herman et al. state that “navigation and interaction facilities are essential” [24].
Ducasse et al. say that “the exploratory nature of reverse engineering and reengineering demands that a reengineering environment does not impose rigid sequences of activ-
Usability Usability is a highly desirable requirement, but unfortunately very difficult to meet. In Bassil and Keller’s survey, the requirement “ease of using the tool (e.g., no cumbersome functionality)” was selected as the second most important practical aspect that software visualization tools should meet, which 72% rated as “very important” [6, P8]. The survey’s researchers report that “unfortunately, we found a disturbing gap between the high importance attached to the two aspects ease of use and quality of the user interface, and the ratings of these qualities in the software visualization tools in practical use” [6].
The evaluation of the usability of reverse engineering tools is often focused on the user interface. In Bassil and Keller’s survey, 69% believe that “quality of user interface (intuitive widgets)” is a very important requirement [6, P12]. Reiss, who has implemented many software engineering tools, believes that “having a good user interface is essential to providing a usable tool” [52]. He provides a rationalization for the user interface choices of the CLIME tool, but does not support his decisions with background literature. For the BLOOM software visualizer, Reiss emphasizes that both usefulness and usability are important: “While it is important to provide a wide range of different analyses and to permit these to be combined in order to do realistic software understanding, it is equally important to offer users an intuitive and easily used interface that lets them select and specify what information is relevant to their particular problem” [50].
Researchers have also suggested design heuristics to make a tool more usable. Storey’s cognitive framework emphasizes usefulness aspects for comprehension tools, but also has a design element that requires to “reduce UI cognitive overhead” [58, p. 149]. Storey et al. further elaborate on this design element, stating that “poorly designed interfaces will of course induce extra overhead. Available functionality should be visible and relevant and should not impede the more cognitively challenging task of understanding a program” [60]. According to Reiss, a tool’s usage should “have low overhead and be unintrusive” [51]. Especially, it should not interfere with existing tools or work practices. In order to keep reverse engineers motivated, tools should be enjoyable to use. Especially, “do not automate-away enjoyable activities and leave only boring ones” [35].
Adoptability Researchers have reported on many diverse factors—both technical and non-technical—that influence the chances of a tool to get adopted. Storey says, “although there are many software exploration tools in existence, few of them are successful in industry. This is because many of these tools do not support the right tasks” [58, p. 154]. Bull et al. state, “in any field, ease of use and adaptability to the tasks at hand are what causes a tool to be adopted” [11]. Wong believes that “lightweight tools that are specialized or adaptable to do a few things very well may be needed for easier technology insertion” [73]. He also says, “by making tools programmable, they can more easily be incorporated into other toolsets, thus easing an adoption issue of tool compatibility” [74, p. 94].
Zayour and Lethbridge point out that reverse engineering tools face an additional adoption hurdle because “their adoption is generally ‘optional’” [78] in the sense that they are not a necessity to complete, say, a maintenance task. They propose a method based on cognitive analysis to improve tool adoption, assuming that a tool that reduces the cognitive load will positively influence the users’ perception of ease of use and usefulness and thus improve tool adoption. The ACSE project (www.acse.cs.uvic.ca) identifies a number of factors that affect the adoption of reverse engineering tools, which are equally applicable to software visualizers [4]. Tilley et al. suggest that research tools might be more adoptable if they were more understandable, robust, and complete [68]. Reiss says that developers will adopt tools only if “the cost of learning that tool does not exceed its expected rewards and the tool has been and can easily shown to provide real benefits” [53].
Singer lists a number of desirable qualities for tools to improve their use; tools should be unobtrusive and lightweight; have subtle feedback and small real estate; and require no setup and training [56]. In contrast to most research tools that require some effort and expertise for installation, popular tools are easy installed or even already pre-installed [39]. Devanbu stresses that tools have to integrate smoothly into an existing process: “Software tools work best if their operation is well-tuned to existing processes. Thus, a tool that generates paper output may not be helpful in an email-based culture” [14]. Similarly, Wong says “software understanding techniques and tools need to be packaged effectively and made compatible with existing processes, users, and tools” [74, p. 93].
4. Functional Requirements
Researchers have also identified functional requirements for visualization tools. We summarize them briefly by
grouping them into the following seven requirements.
**Views** Software visualizers typically provide different views of the target software system (e.g., to satisfy the need of different stakeholders and to emphasize different dimensions of the data such as the time dimension or level of abstraction) [31] [55]. An example of integrated views is provided by Kazman’s SAAMtool, where “any node within any view can have links to nodes in one or more of the other views” [26].
Wong requires visualizers to provide views that are consistent and integrated [74, Req. 15]. He further requires to “integrate graphical and textual software views, where effective and appropriate” [74, Req. 20]. The developers of the Rigi system advocate dynamic views [75]. In contrast to static views, which only provide information that has been obtained at a certain point in time, dynamic views synchronize and recompute their information when the underlying data source changes. Blaine et al.’s software visualization taxonomy asks, “to what degrees can the system provide multiple synchronized views of different parts of the software being visualized?” [47, C.4]. Storey says, “programming environments should provide different ways of visualizing programs. . . orthogonal views, if easily accessible, can facilitate comprehension, especially when combined” [57]. Similarly, Meyers states that “there is a crucial need for programming environments that facilitate the creation of multiple views of systems” [40].
Koschke has conducted a survey about software visualization; he summarizes the responses as follows: “Most prominently, the need for multiple views in software maintenance, reverse engineering, and re-engineering is pointed out. Given multiple views, integration, synchronization, and navigation between these views while maintaining the mental map are important aspects” [32]. Bassil and Keller’s survey of software visualization tools consider “synchronized graphical and textual browsing,” which rated 62% of the respondent as “useful, but not essential” [6, F.7]. Hainaut et al. state the requirement that views should address different levels of granularity: “Multiple textual and graphical views, summary and fine-grained presentations must be available” [22].
**Abstraction** Most visualizations are based on an underlying graph model. Since the resulting graphs can become too complex to effectively visualize (cf. Sec. 5), even for small software systems, abstraction mechanisms are needed. Von Mayrhauser and Vans conclude from their studies that “maintenance programmers work at all levels of abstraction” [70] and consequently stress the “importance of the availability of information about the program at different levels of abstraction” [71]. Hierarchical graphs are a popular abstraction mechanism [25]. They allow grouping of nodes to create higher levels of abstractions, resulting in a layered view [7]. Ducasse and Tichelaar believe that “grouping several entities together is an important technique in reengineering, primarily to build higher-level abstractions from low-level program elements or to categorize elements with a certain property” [16]. According to Kazman, “a tool for software architecture should be able to aggregate architectural elements recursively” [26]. Rigi is an example of a tool that fulfills this requirement. It has “support for abstraction activities (grouping/collapsing) with an easy to use GUI” [54]. Similarly, the SHriMP tool fulfills the requirement to “provide abstraction mechanisms” by providing “subsystem nodes and composite arcs in the nested graph” [60, E3]. There are many more examples of tools that provide similar abstraction mechanisms (e.g., EDGE [43] [45], daVinci [21], and Balmas’ work [2] [3]). In Bassil and Keller’s survey about software visualization, “hierarchical representations (of subsystems, classes, etc.)” was the third-most useful functional aspect, rated by 57% of the respondents as “absolutely essential” [6, F.18]. Lastly, abstractions are also possible in the presentation of dynamic information. For instance, tools such as ISVis allow the reverse engineer to “view the trace content at different levels of abstraction (e.g., object interactions, class interaction)” [23].
**Search** Evidence of the importance of searching in software visualization is provided by a user study conducted by Storey et al., in which the authors observed that “in Rigi and SHriMP, the lack of a searching tool to find text strings in the source code definitely hindered the users” [63]. In Bassil and Keller’s survey, “search tools for graphical and/or textual elements” was rated as the most useful functional aspect of software visualization tools; 74% of the respondents classified it as “absolutely essential” [6, F.14].
However, visualization tools often have rather limited searching capabilities that go no further than searching for the labels of graph entities.² Storey et al. have surveyed a number of visualization tools and come to the conclusion that there is need for improved querying support [59].
**Filters** Filtering of information in visualization tools can be seen as a rudimentary form of (structural) querying [59]. It is an effective approach of graph visualizations to prune nodes or arcs (based on their types, or other criteria), and is supported by tools such as Rigi and SHriMP [63] [64]. According to Storey’s research, filtering helps to reduce disorientation effects by users [60, E14]. According to Riva’s experience, an important feature in Rigi is the “possibility to filter/unfilter information. This allows us to reduce the amount of visualized data and to limit our analysis” [54]. Maletic et al. describe requirements of visualization tools; one of these is to “filter out uninteresting items” [37]. Other
---
²Storey et al. report that whereas this “search on node labels was very useful” for the users of Rigi and SHriMP, there was also the problem that “some users mistakenly thought they were searching for strings in the code rather than searching for node labels in the graph” [63, sec. 6.3].
examples of filtering are pruning of traces or call trees based on specific categories [23].
**Code Proximity** Code proximity means the ability of the visualizer to provide easy and fast access to the original, underlying source code [33]. One of the criteria in Bellay and Gall's reverse engineering tool evaluation addresses code proximity as follows: "Point and click movement from reports to source code allows to access the source code representation of a specific entity in a report. The browsing of the source code can be seen as switching the abstraction level and is done often during code comprehension" [7]. Ducasse et al. state, "to minimize the distance between the representation of an entity and the actual entity in the source code, an environment should provide every entity with a direct linkage to its source code" [15].
Most reverse engineering and reengineering tools fulfill this requirement, but differ in their capabilities. For instance, Rigi supports the navigation from a node in the graph to a source file and line number, while SHriMP can visualize the source directly within the node. The TkSee search tool provides search results of different kinds (e.g., files, functions, variables, and lines in a file). For each kind of search result, the tool user has "instant access to the source code" [34, p. 78]. Code proximity is just a special case of a certain abstraction mapping. There are other mappings (e.g., between the application and implementation domains), which are also important but less well explored by researchers [41].
**Automatic Layouts** Bassil and Keller's survey asked for the importance of "automatic layout capabilities" as one of the functional aspects of visualization tools. About 40% of the survey's respondents rated this as absolutely essential [6, F10]. In fact, many visualization are less effective or practically impossible to construct without automatic layouts. Even if automatic layouts cannot be perfect, they provide a good starting point for further, manual refinement. Layouts often strive to optimize certain properties of the graph [42] [65]. Bellay and Gall say, "special layout algorithms can make a graph more readable; for example, minimizing the crossings of the arcs" [7]. The SHriMP layout adjustment algorithms allows to apply a layout without adversely affecting the layout of the original graph [58]. Different layout approaches can represent the same data quite differently (and influence their interpretation [46]).
For instance, hierarchical graphs can be visualized in a single window as a nested view (e.g., SHriMP), as a tree view (e.g., Rigi), or in separate views showing a single nesting only (e.g., Rigi). There are also 3D layouts such as Reiss' Plum framework [49].
In Koschke's survey, 78% of the users who visualize graphs are using automated layouts. This seems to support the claim that they constitute an important requirement. However, respondents complained about deficiencies such as "lack of incremental, semantic, and scalable layouts, bad space consumption, and lack of user control" [32]. Koschke also raises the issue that layout algorithms should take semantics of nodes and edges into account (e.g., in a UML class model one would expect that all inheritance links point in the same direction) [31]. Koschke recommends that the reverse engineering community should collaborate more actively with graph drawing researchers [32].
**Undo/History** Since users perform interactive manipulations that change the visualization, there should be an undo mechanism that allows them to revert to previous states. Ducasse et al. name a history mechanism, which should contain all previously performed steps of graph operations [15]. In the LSEdit graph editor, "any edit that can be done can be also undone. Any edit that has been undone can also be re-done" [64]. Maletic et al. say visualizers should "keep a history of actions to support undo, replay, and progressive refinement" [37]. Bassil and Keller's survey of software visualization tools consider both the "possibility to record the step of an arbitrary navigation" and the "possibility to return back to preceding navigation steps" [6, F22/23]. Based on their research in program comprehension, Mayrhofer and Vans believe that a tool should have a "history of browsed locations" [70].
**Miscellaneous** Other requirements mentioned by researchers are the use of colors [47] [6, F32], the ability to place annotations on graphical entities [59] [7] [60] or code [70], and to manipulate graphs, specifically zooming [6, F11] [15] [59] [37], panning [61] [24], deleting/editing of view entities [15] [7], and saving [6, F24] [37] [60].
## 5. Conclusions and Future Work
This paper has identified quality attributes and functional requirements for software visualization tools by means of a comprehensive literature survey. To our knowledge, this is the first attempt of a literature survey with the goal to arrive at a comprehensive list of requirements for this particular domain. Furthermore, the reported requirements are objectively derived in the sense that they represent the current consensus among researchers as reflected in the literature of the field.
This paper represents a snapshot of our work towards a comprehensive and complete set of requirements that is agreed on by domain experts. We plan to evolve our list of requirements by soliciting feedback from experts. This can be done, for example, with the help of an (online) questionnaire, which could point out requirements that have been missed or that are not universally agreed upon.
Furthermore, we believe it would be useful to expand this work towards construction of a domain-specific quality model for software visualization tools. Such a quality model would help us to elicit requirements as a starting point and augment them with metrics and benchmarks so that they can be quantified [19]. The resulting model can then be used for tool assessments and comparisons.
References
[56] J. Singer. Creating software engineering tools that are usable, useful, and actually used. Talk given at the University of Victoria, Dec. 2004.
|
{"Source-Url": "https://www.researchgate.net/profile/Holger_Kienle/publication/221193025_Dependencies_Analysis_of_Azureus_with_Rigi_Tool_Demo_Challenge/links/0fcfd50e72444ae5fe000000.pdf", "len_cl100k_base": 6659, "olmocr-version": "0.1.53", "pdf-total-pages": 8, "total-fallback-pages": 0, "total-input-tokens": 41393, "total-output-tokens": 11728, "length": "2e12", "weborganizer": {"__label__adult": 0.0002980232238769531, "__label__art_design": 0.0003063678741455078, "__label__crime_law": 0.00023603439331054688, "__label__education_jobs": 0.000682830810546875, "__label__entertainment": 4.273653030395508e-05, "__label__fashion_beauty": 0.00010657310485839844, "__label__finance_business": 0.00013697147369384766, "__label__food_dining": 0.0002263784408569336, "__label__games": 0.0004515647888183594, "__label__hardware": 0.0003695487976074219, "__label__health": 0.0002522468566894531, "__label__history": 0.00015401840209960938, "__label__home_hobbies": 4.285573959350586e-05, "__label__industrial": 0.00016987323760986328, "__label__literature": 0.00020194053649902344, "__label__politics": 0.0001608133316040039, "__label__religion": 0.00028896331787109375, "__label__science_tech": 0.003910064697265625, "__label__social_life": 6.687641143798828e-05, "__label__software": 0.006282806396484375, "__label__software_dev": 0.98486328125, "__label__sports_fitness": 0.00019359588623046875, "__label__transportation": 0.00023555755615234375, "__label__travel": 0.0001348257064819336}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 47176, 0.04496]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 47176, 0.50919]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 47176, 0.87747]], "google_gemma-3-12b-it_contains_pii": [[0, 4299, false], [4299, 9710, null], [9710, 15728, null], [15728, 20914, null], [20914, 27030, null], [27030, 32650, null], [32650, 39896, null], [39896, 47176, null]], "google_gemma-3-12b-it_is_public_document": [[0, 4299, true], [4299, 9710, null], [9710, 15728, null], [15728, 20914, null], [20914, 27030, null], [27030, 32650, null], [32650, 39896, null], [39896, 47176, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 47176, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 47176, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 47176, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 47176, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 47176, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 47176, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 47176, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 47176, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 47176, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 47176, null]], "pdf_page_numbers": [[0, 4299, 1], [4299, 9710, 2], [9710, 15728, 3], [15728, 20914, 4], [20914, 27030, 5], [27030, 32650, 6], [32650, 39896, 7], [39896, 47176, 8]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 47176, 0.04636]]}
|
olmocr_science_pdfs
|
2024-12-09
|
2024-12-09
|
64411640b8943dd6bb4dd09f8c9fad0632d26085
|
Moving Legacy Software and FOSS to the Cloud, Securely
Larry Llewellyn
Abstract
As more organizations consider the benefits of cloud adoption and use of legacy or free and open source software (FOSS) to lower the cost of software engineering and information technology projects, the security implications of this model take center stage. Cloud is not a one-size-fits-all solution and any effort to adopt distributed data services must integrate information assurance early in the project. Correspondingly, transitioning legacy software or FOSS into a cloud environment has the added disadvantage of potentially injecting serious security challenges incurred when the code was originally developed. This paper investigates existing methods, and proposes a practical approach, for mitigating risks associated with transition of legacy software and FOSS to the cloud.
1. Introduction
1.1. The Challenge
Frequently, organizations inherit source code written by a development team, which has long since moved on to other projects. Without fail, business requirements drive software modifications due to market evolution and developing competitive business strategies. One such example is the current trend by many industries and organizations realizing increased business value and decreased mission risk due to cloud adoption. In organizations which have determined distributed data services are the optimum business policy, the team responsible for application transition must analyze the environment pre-migration to determine the necessary plan of actions and milestones for secure transition. A post-migration analysis is then necessary to validate all associated information assurance controls.
For the case study considered in this paper, the transition team has access to the source code and some of the original documentation. The legacy software suite consists of an internally developed Java application front end, and Apache Tomcat 8 with a SQL Server backend which come together to provide a web application accessible to anyone who has a vetted and approved, password protected account and compatible web browser. The intent of the system is to receive anticipated satellite bandwidth usage data input from a base of users located around the world and produce automated reports documenting satellite throughput. The ultimate goal is to ensure effective use of satellite resources and project when additional satellites will be required to meet increased demand.
Additionally, during the threat analysis process (discussed in further detail in subsequent sections), the transition team responsible for moving the application to the cloud becomes aware that three new cybersecurity controls are required along with the cloud transition: multi-factor authentication, approved encryption algorithms for data storage/transmission, and validation by the application of input fields prior to submitting to the SQL database. For the purposes of this paper, multi-
factor authentication will be a two-factor capability implemented with a Common Access Card (CAC) supported by an existing Public Key Infrastructure (PKI).
1.2. COMMON SOFTWARE SOURCES AND DEVELOPMENT TRENDS
The term legacy means many things to different people. For the purposes of this paper, legacy means any software currently in use by a given information system, which has been in use for five or more years and was developed using techniques prior to current methodologies. Additionally, here the legacy software source code is available, documentation is limited, and the original developers are no longer available to provide continuity and design consultation.
*The Open Organization* defines open source software as “software whose source code is available for modification or enhancement by anyone” (“What is open source software? | Opensource.com,” n.d.). Source code is the human readable computer instructions written in a particular programming language (in this case C for Apache and Java for the web app), which is then compiled into machine executable files, or object code. In the traditional proprietary, closed-source software environment, it is the object code (or executable) that the consumer purchases. By comparison, object code of a program is very difficult to interpret by a human relative to its source code.
larry.llewellyn.ii@gmail.com
counterpart. Open source therefore facilitates modification whereas closed source software does not.
The typical open source software development model is decentralized compared to the model used by developers of proprietary software. More specifically, contributions to code development are less organized with open source software projects. Further, the way the software is patched, bundled, and the roles played by participants may also differ for each approach. There are even differences among the two philosophies. Every FOSS project has a slightly contrasting development model; however, in general the practice includes open sharing, modification (improvement), and redistribution. Many challenges are common in both FOSS and closed source (or proprietary) models. Quality is a concern in both development philosophies as is security.
1.3. COMMON SOFTWARE SECURITY CHALLENGES
All software exists to fulfill a specific task (e.g., write data to disk, read from input devices, start other programs, etc.) that it does only with the permission of the host operating system. In most existing computer programming models, the software is responsible for ensuring that the permitted actions only take place in the manner intended by its developer. History has shown that it is difficult to create software that always functions as intended. Complicating the problem further, most software must process data from external sources. It is this external interaction that exposes most security flaws. This section discusses a few of the most common, dangerous software errors. For a review of the “Top 25 Most Dangerous Software Errors”, please see The MITRE Corporation’s Common Weakness Enumeration effort (“CWE -2011 CWE/SANS Top 25 Most Dangerous Software Errors,” n.d.).
On the topic of security for closed-proprietary versus FOSS, this paper assumes Ross Anderson’s answer holds, that “for systems large and complex enough, the attack and defense are helped equally” (Anderson, 2006, p.10). In other words, for software sufficiently large enough, likelihood of exploitation is equal for both FOSS and closed-proprietary software.
The classic buffer overflow problem presents an example of how external interaction can cause an information system to behave unexpectedly. When accepting input from an external source, general programming practice dictates that the programmer ensure data received as input to the data structure is validated prior to load. When the buffer is over-filled, input data has potential to be written into a section of memory containing executable code resulting in unexpected system state upon execution. If the Operating System, application, and CPU programming model are well understood, a malicious actor could force the execution of instructions, which result in privilege escalation or compromise the confidentiality, integrity, or availability of the information system and associated data. Of course, buffer overflow errors are concerns in both FOSS and closed-source software and are the result of poor software coding techniques. The two primary methods of mitigating this type of attack are writing the code with the least privileges required and correct validation of all input.
A new survey from Ponemon Institute found that 84 percent of a respondents stated the most common gateway attack experienced over the past 12 months was SQL injection (“SQL injection has surfaced as the no. 1 attack in 2015,” n.d.). Similar to buffer overflow vulnerabilities, SQL injection attacks are the result of trusting non-validated input and granting the application privileges higher than required for successful execution. In this case study, since SQL Server provides the relational database back end, a primary security concern involves the ability of the legacy application to execute sanitization and correct validation of all input.
Broken or antiquated encryption algorithms are another serious software security problem. For example, the Data Encryption Standard or DES was once considered a strong encryption algorithm adopted by the U. S. Government as an official Federal Information Processing Standard. In 1998, a computer built by the Electronic Frontier decrypted a DES-encoded message in 56 hours (Electronic Frontier Foundation, 1998, p. 153); therefore, dependence upon DES for confidentiality of sensitive data is a serious security problem for any software project.
1.4. Legacy software modernization trends
It has been stated that software modernization is more challenging than most software engineers suspect; however, research by the Standish Group International, Inc. shows that only 8 percent of these projects fail (Modernization clearing a pathway to success, n.d., p. 4). Additionally, when compared with new application development and commercial-off-the-shelf (COTS) implementation, modernization of legacy code has the highest expected return on investment. It is for these reasons the case study discussed in this paper employs legacy software modernization versus other available options.
Figure 2
Figure 2 illustrates the information system life cycle (Seacord, Plakosh, & Lewis, 2003, p. 6). As business functionality requirements increase, the information system functionality must also trend upwards or become irrelevant. Less involved maintenance activities (i.e., small, incremental changes such as implementing a new font type) have the ability to improve functionality; however, modernization (i.e.,
extensive modifications such as taking advantage of parallel processing) is required to address functionality requirements. Here the application falls into the System 1 scenario at the modernization slope. As the team works to increase functionality in the application, business functionality requirements grow over time. This cycle continues for the current system until modernization efforts are unable to improve the system and a new system is developed and implemented from the ground up (System 2 in Figure 2).
Complexity is the single greatest challenge to software modernization. This is due to the size and lack of code clarity in most legacy systems. Additionally, modernization efforts must maintain backwards functionality (i.e., continue to satisfy the original set of business requirements while building in additional mission enabling capabilities). Frequent testing and stakeholder engagement will help to mitigate concerns associated with these risks.
2. Transitioning into the Cloud
2.1. Security challenges of the cloud environment
For the purposes of this paper, cloud Infrastructure as a Service (IaaS) is defined using the National Institute of Standards and Technology (NIST) definition found in Special Publication 800-145 dated September 2011. Figure 3 illustrates IaaS functionality and the traditional private/on-premise datacenter.
To date, only a scant few cloud data breaches have been noted. Jay Heiser, VP of research at technology consultant Gartner Inc., recently stated “Cloud providers put more emphasis on security than other entities. If they didn’t, they’d fall over” ("Cloud computing data breaches currently few | Business Insurance," n.d.). Similarly, as cloud increases in popularity and usage, so too will the motivation and innovation of perpetrators who wish to gain from exploiting cloud vulnerabilities.
In general, with few exceptions (e.g., satellite command and control, real-time communications, etc.) the “golden nuggets” or highest valued components of most information systems are the sensitive data repositories at the center of the larger information system. In the US, there is no single, comprehensive federal law regulating the collection and use of data. There are federal laws that regulate individual industries (e.g., the health industry’s Health Insurance Portability and Accountability Act of 1996 (HIPPA), the financial industry’s Gramm-Leach-Bliley Act (GLBA), the Federal Trade Commission Act, etc.) and state laws, which overlap and sometimes conflict with federal laws. Additionally, there are many guidelines developed by industry groups that are part of self-regulatory standards and frameworks that are considered best practices.
The key to successfully navigating these somewhat ambiguous waters lies in a risk based approach to information assurance. The approach starts with system owners fully understanding the mission, information types, network associated with the system, and the applicable laws. Next, the potential impact for each information type processed, stored or transmitted by the system should be assessed from a confidentiality, integrity, and availability perspective. Finally, an evaluation of the
threat sources, threat events, likelihood, and impact feeds into a risk assessment which guides where dollars should be spent to maximize return on information assurance investments.
Every information system has vulnerabilities. Information systems hosted by cloud providers are no different. A primary concern associated with cloud adoption for most candidate organizations is data security. More specifically, storing critical business data into services accessible over the public Internet means that crooks have a target of opportunity with potentially fewer technical challenges. Some additional key concerns which should be evaluated when considering cloud include shared access to cloud resources, virtual exploits, and information system availability.
One key way cloud providers are able to control costs and gain economies of scale is through shared access or multitenancy. Hardware multitenancy means multiple unrelated customers potentially have access to the same CPU, storage, and memory. The risk is that one customer could unintentionally or maliciously gain access to another customer’s sensitive data through a multitenancy related flaw. The degree of multitenancy is dependent upon the cloud provider (e.g., from hardware multitenancy to database and application multitenancy) and should be discussed and understood prior to procuring services. Researchers are just beginning to understand many multitenancy security concerns; however, there are many who believe the challenges of multitenancy will be significant as the cloud model matures. Information assurance professionals should pay close attention to this burgeoning field of research.
All cloud providers rely heavily upon virtualization. Virtualization allows cloud providers to maximize resources by abstracting away the underlying hardware and creating multiple Operating System instances on one physical piece of hardware. Virtualization software comes with its own vulnerabilities. According to TechTarget’s SearchSecurity.com E-Guide “Top Virtualization Security Risks and How to Prevent Them”, the following are the most common attack avenues in the virtual environment: trojaned virtual machines, improperly configured virtual firewalls/networking, improperly configured hypervisor, and data leakage through offline images. The primary defense against vulnerabilities associated with
virtualization is to patch virtualization software as patches become available. Since virtualization software configuration and maintenance is the responsibility of the IaaS provider, details of configuration and maintenance procedures for the virtualization software must be provided by the cloud vendor. Additionally, in most cases, virtualization software updates should be seamless to the customer; however, there are scenarios where virtual machine instances must be rebooted. These events are generally well publicized and in plenty of time ahead of execution to minimize impact to the customer.
Availability is a term often used by service providers to quantify the amount of time an information system is accessible during a given year. For example, 90% or “one nine” availability means the information system has the potential to be down 36.5 days a year. 99% or “two nines” means the information system has the potential to be down 3.65 days per year and so on. Amazon’s “Simple Storage Service” or S3 is advertised to provide 99.99% or 52.5 minutes of down time per year; whereas, the DISA milCloud claims 99.999% or 5.25 minutes of down time annually. Both providers’ Service Level Agreements back these values. Given that this availability is outside of the customer’s control, it’s easy to understand why it’s such a significant concern.
An even bigger concern is the possibility of critical business data loss due to either an internal cloud issue or a malicious attack. Amazon’s S3 claims 99.999999999% of durability (“Amazon S3 Frequently Asked Questions,” n.d.). According to Amazon, this translates into an average expected loss of one file every 10,000,000 years. This durability is accomplished by Amazon’s process of storing objects across multiple devices across multiple facilities. The service is designed to sustain concurrent datacenter failures by quickly detecting and repairing any lost redundancy. This availability and data durability is likely much better than most private/on-premise data centers; however, the fact that the vendor has primary control over these critical metrics raises concerns.
2.2. Best practices for operating in the cloud
Though there are many challenges of cloud, numerous benefits also exist. Amazon Web Services (AWS) provides many of the same security features traditional IT systems provide. System administration and monitoring keeps operating systems updated with the latest patches. Backup of critical data is a standard service offering among most cloud providers; however, the customer is generally responsible for deploying the necessary tools required by these services. Intrusion detection tools are available to monitor traffic. Some unique security features of cloud are:
- systems are remotely administered across the Internet (no physical access)
- systems are virtual (making procurement and reconstitution a relatively fast process)
- redundancy is often built-in (geographical diversity allowing data to be stored across multiple geographical locations)
2.2.1. Data Access and Encryption in the Cloud
As mentioned previously, unauthorized access to sensitive data is a primary concern in the cloud. One method of ensuring data in the cloud is secure is to encrypt prior to sending to cloud data storage. Using this philosophy, even if thieves were able to gain access to sensitive data, the information would be rendered useless since decryption would not be possible by the wrong doers.
Generally speaking, for encryption algorithms, the security strength is a measure of the difficulty in discovering the key. With a brute force attack (i.e., trying every possible key until the correct one is found), key length could mean the difference between decrypting an encoded message in 10 seconds or 10,000 years. The NIST Special Publication 800-131A recommends using encryption algorithms with key lengths of 112-bits or current FIPS 140-2 compliant encryption algorithms. This level of
encryption should provide the strength necessary to defend against current computing capabilities.
In addition to data encryption, a customer can secure data in the cloud by implementing fine-grained access control. Fine-grained access control is the ability to control who can access what discrete data items and attributes in the database tables and indexes along with the actions that can be performed on them. Using fine-grained access control features provided by AWS, the application can hide information in the database table in a horizontal fashion by matching user attributes with primary key values.
### 2.2.2. Two-Factor Authentication in the Cloud
Two-factor authentication is defined as something you have (e.g., a token or a Common Access Card (CAC)) and something you know (e.g., a personal identification number (PIN) or a password). As of the writing of this paper, AWS just released its multi-factor offering to its customers (“Multi-Factor Authentication,” n.d.). Amazon also offers multiple multi-factor authentication solutions (e.g., tokens, one-time-password via Short Messaging Service, etc). For the purposes of this paper, the two-factor authentication solution will use a CAC and a six digit PIN. More specifically, here two-factor implementation involves the Department of Defense (DoD) PKI solution. Two-factor authentication is neither a panacea nor invulnerable; the successful 2011 cyber-attack on RSA demonstrated this fact. Additionally, before resources are invested implementing two-factor, risk analysis should be performed to insure this authentication solution is warranted. For example, if the true mission risk is the insider threat, two-factor authentication by itself will do little to mitigate this particular risk.
Given that username and password is the most common authentication mechanism used to access cloud resources and the most trivial to hack, implementation of a multi-factor authentication solution increases the difficulty involved in gaining unauthorized access. Moreover, since the DoD PKI solution is a service provided by the milCloud, modifying the application
Moving Legacy Software and FOSS to the Cloud, Securely
to use the available PKI application programming interface is relatively straightforward and inexpensive requiring no purchase of additional hardware or software. Challenges do exist with migrating current users from username/password authentication to PKI. These challenges are primarily logistical not technical (i.e., communicating the migration with the users and ensuring users have the required CAC hardware, application, and middleware).
2.2.3. Data Input Sanitization and Validation
Sanitization involves running externally submitted input through a data parser that disallows all characters except those that are specifically relevant. As previously discussed, validation attempts to ensure that received data is in the form that is expected. These functions must be tested and verified prior to operational cloud deployment.
Though the application performs some data input sanitization and validation, additional rigor must be implemented to insure recently discovered threats are addressed and associated risks are mitigated. Moving forward, the application will implement a whitelist of acceptable input that strictly conform to predetermined conditions, and where possible prepared or parameterized statements will be used. For validation, all potentially relevant input will be considered which coincide with business rules. Additionally, the application will be run using the lowest privileges that are required to accomplish the necessary tasks.
2.2.4. Managing Cloud Adoption Risk
As previously discussed, transitioning legacy code from an on premise datacenter to the cloud has inherent risks. Due to code complexity and unknown system interdependencies, hidden technical challenges, which are not discovered until code is deployed into the cloud, are often a reality. To buy down this risk, cloud providers offer a “sandbox” which is analogous to the operational cloud except for the fact that non-authorized, external entities are unable to access the sandbox without explicit authentication credentials.
and required software (e.g., specific Virtual Private Network client software and unique soft-certs). This resource is where developers can learn, design the environment, and install/configure all necessary software so that functional and cybersecurity testing can be planned and executed. During this testing, technical challenges can be exposed and resource estimates developed. In summary, cost benefit analysis can be performed with very little investment to determine if cloud adoption of this particular application is feasible.
2.2.5. Cloud Service Level Agreement
A key piece of the overall security posture for cloud is the agreement, or Service Level Agreement (SLA), between the customer and the cloud provider. This agreement documents the services provided by the cloud vendor to include roles and responsibilities in support of information assurance and the logical and physical points of demarcation. The SLA should also document the Incident Response Plan used to report security incidents and outages and establish reporting channels and associated points of contact to help facilitate an appropriate and prompt response. It is also vitally important that this document be reviewed at least annually to determine if any modifications or amendments are necessary to reflect the customer’s requirements and the cloud provider’s services.
2.3. Assessing and Addressing Security challenges
The application in this scenario was developed for the benefit of the satellite communications community, as an integrated tool to synchronize the acquisition and deployment of satellite assets. It reduces the risk of systems being fielded in an uncoordinated manner by correlating schedules, budgets, satellite terminal fielding plans, and delivery plans. The system processes, stores, and disseminates the following information types: budget, strategic planning, system maintenance, information security, and system/network monitoring. All information types are sensitive but unclassified (SBU) and have been assessed by the stakeholders as low impact should confidentiality, integrity, or availability be compromised; however,
when aggregated with other SBU information (e.g., enterprise architecture, system capabilities, etc.) this data could be elevated to medium impact should confidentiality of strategic planning information be compromised.
Based on the system’s mission, associated information types, known and potential vulnerabilities, threat research, and analysis, it has been determined that the primary adversaries of system data are nation-state sponsored bad actors external to the United States. Out of an abundance of caution, based on data aggregation risk and the likely threat, it has been determined that Federal Information Processing Standard (FIPS) Publication 140-2 compliant encryption must be used for data storage and transmission. Additionally, to eliminate vulnerabilities incurred with username/password authentication, two-factor authentication shall be used to secure access to the application
2.4. “Cloudification” and the Security Implications
Along with the ability to transfer the cost of datacenter hardware technology purchase, installation, and sustainment; the cloud also brings the ability to quickly add or remove IT capacity to meet increasing or decreasing demand. The catch to taking advantage of cloud IT elasticity is that applications must be built to scale vertically or horizontally as resources become saturated. Horizontal scaling involves adding more instances of the virtual machine to the infrastructure. Vertical scaling involves standing up instances with more RAM and CPU capacity. This capability brings with it a significant weapon against distributed denial of service (DDoS) attacks.
2.4.1. Thwarting Distributed Denial of Service Attacks with Elasticity
The key to being prepared for Distributed Denial of Service (DDoS) attacks is to develop a response strategy. Most cloud providers offer multiple services that combine to significantly improve resiliency against this type of assault. The goal of DDoS attacks is to exhaust resources resulting in rendering the information system unusable to legitimate users. DDoS attacks can be categorized as application, protocol, or bandwidth exhausting. Identifying an attack is accomplished by first understanding the
systems baseline traffic metrics. Once this is established, alarms can be created to alert on potential attacks or other anomalies.
When an attack is believed to be underway, additional distributed server instances may be scaled up both horizontally and vertically to absorb the additional traffic. Note that most cloud providers will obviously charge for the addition of new server instances; however, the DDoS can be dispersed over a wider area forcing the attackers to expend additional resources. An example of this is the AWS Availability Zones (three in the Asian Pacific, two in the European Union, one in South America, and three in the US).
With this approach, it is possible to prevent loss of service to legitimate customers. Though this is a key cloud security feature that should be considered in the overall security design, threat analysis has shown the system is not a likely target of DDoS attacks; however, this option could be exercised in the future should the need arise.
2.5. Operational Transition (securely, and seamlessly moving users and data)
Having gained familiarity with cloud resources, installed/configured the application, implemented source code security improvements, and resolved all functionality issues, the next step is to transition operations from the on premise datacenter to the cloud. This part of the project requires careful planning and execution.
2.5.1. Migrating Data to the Cloud Securely
As discussed in the “Assessing and Addressing Security Challenges” section of this paper, moving sensitive data to the cloud securely requires understanding threats to confidentiality, integrity, and availability of the data. Adherence to the applicable data-related laws and regulations is also of the utmost importance. To work through these issues, one must first understand the content and context of the data to be moved. This requires listing all information types associated with the system and understanding the confidentiality, integrity, and availability (CIA) implications of each
Based on mission use cases, as previously discussed. Understanding who has access to what data and the CIA associations allows decision makers to balance risk with information assurance control investments for the movement of data to the cloud and for the overall operational system.
Protecting data as it moves into the cloud is a straightforward matter of implementing a data-in-motion encryption algorithm such as Secure Sockets Layer (SSL) or a Virtual Private Network (VPN) with Internet Protocol Security (IPSec). For the system in this scenario, since the milCloud requires a Cisco VPN client to access provisioned images, the Cisco client with FIPS 140-2 compliant encryption will be employed.
2.5.2. Validating Functionality
With the data securely in the cloud and the requisite software installed, the process of initial operational testing can begin. For the system in this scenario, the team has procured a sandbox with a server and several additional virtual machines which function as the operational user clients during initial testing. This configuration allows for functional testing without opening the application up to be accessible by the world prior to information assurance testing. The client virtual machines will execute all possible standard use cases to insure the system meets the intent, correctly responds to various inputs, and achieves the results operational stakeholders require. Upon completion of functional testing, the system’s virtual machine image can be saved for future security testing.
2.5.3. Validating Security Controls
To insure the system meets essential information assurance requirements, the system will be scanned and assessed using a tool which analyzes the registry, services, and file structure pre and post install. This way, a comparison can be made of the baseline operating system image before and after installation revealing any resulting registry vulnerabilities, added/modified or deleted services, added dynamically linked libraries, and the location of the installation. The WireShark network traffic packet
capture tool will be up and running prior to and after installation. This will allow for comparison of network traffic showing any new network connections or listening ports. Additionally, execution of WireShark during operational testing will allow validation of implemented encryption algorithms as well as PKI functionality.
A SQL Injection scanner will be used to verify effective sanitization and validation of all inputs. One such common tool is Hewlett Packard’s WebInspect. By creating a macro with valid logon credentials, WebInspect can access the web application under test and attempt to develop an initial analysis and fingerprint of the technologies used. Once verification of the initial analysis is complete, WebInspect is ready to run through a targeted set of the SQL Injector tool data injection and manipulation checks. Another common commercially available SQL inject scanner is Acunetix Ltd.’s Web Vulnerability Scanner. The Acunetix scanner functions similar to WebInspect; however, Acunetix provides additional details for each vulnerability found (e.g., dynamics of the test performed to discover the flaw, including the http headers exchanged during the test). Once SQL injection vulnerabilities are discovered, they should be verified, remedied, and rescaned to insure discovered flaws are resolved.
2.5.4. Operational Testing and Final Transition
With the data securely stored in the cloud, all initial functional testing complete, and information assurance controls validated, full functional testing from user clients outside of the sandbox can be accomplished. In this portion of the project, public access to the application will be tested for the first time. During operational testing, the focus will need to be on the performance of the application in the new environment when under various loads. Additionally, the capacity of supporting services (e.g., cloud bandwidth, disk input/output, PKI, etc.) to perform as required will also be established.
2.5.5. Risk Acceptance
Risk acceptance is the final stage in the cloud transition process. Having assessed known threats to system data, implemented mitigations against those threats, and tested the performance and security of the application in the cloud, a clear picture of likelihood and consequence for known risks can be achieved. With this risk picture, the leaders responsible can be confident in their decision to support the final product and have empirical data to back their position.
3. Conclusion
This paper investigates existing methods, and proposes a practical approach, for mitigating risks associated with transition of legacy and free and open source software to the cloud. This approach includes the following milestones:
<table>
<thead>
<tr>
<th>Item #</th>
<th>Milestone</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Mission System Identification</td>
<td>Understand the system’s purpose, hardware, software, configuration, applicable laws, and use cases.</td>
</tr>
<tr>
<td>2</td>
<td>System Information Assessment</td>
<td>List and assess the potential impact for each information type should confidentiality, integrity, or availability be compromised by known threats.</td>
</tr>
<tr>
<td>3</td>
<td>Assess Target Environment</td>
<td>Analyze vulnerabilities and security features associated with candidate cloud vendor.</td>
</tr>
<tr>
<td>4</td>
<td>Determine Information Assurance Controls</td>
<td>Based on the system information assessment and target environment analysis, perform cost benefit study of relevant information assurance controls.</td>
</tr>
<tr>
<td>5</td>
<td>Implement Necessary Security Controls</td>
<td>For the system in this scenario, this step involved employing two-factor authentication, FIPS 140-2 compliant encryption algorithms, and data input</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>---</td>
<td>---</td>
<td>---</td>
</tr>
<tr>
<td></td>
<td></td>
<td>sanitization and validation.</td>
</tr>
<tr>
<td>6</td>
<td>Data Migration</td>
<td>Data was transferred from the on-premise data center to the cloud using the Cisco AnyConnect VPN client with FIPS 140-2 compliant encryption.</td>
</tr>
<tr>
<td>7</td>
<td>Validation</td>
<td>To ensure the system meets the functional intent and achieves the required security goals, the application was first tested in the cloud sandbox environment with applicable mission threads. Then a method of test was developed and executed for the relevant security controls.</td>
</tr>
<tr>
<td>8</td>
<td>Risk Acceptance</td>
<td>Item #7 provides the system owner with empirical data supporting the acceptable information assurance risk posture of the application.</td>
</tr>
</tbody>
</table>
References
larry.llewellyn.ii@gmail.com
https://opensource.com/resources/what-open-source
|
{"Source-Url": "https://www.sans.org/reading-room/whitepapers/cloud/moving-legacy-software-foss-cloud-securely-36567", "len_cl100k_base": 6815, "olmocr-version": "0.1.49", "pdf-total-pages": 23, "total-fallback-pages": 0, "total-input-tokens": 47479, "total-output-tokens": 7981, "length": "2e12", "weborganizer": {"__label__adult": 0.0003974437713623047, "__label__art_design": 0.0004153251647949219, "__label__crime_law": 0.0019741058349609375, "__label__education_jobs": 0.0011425018310546875, "__label__entertainment": 0.00011593103408813477, "__label__fashion_beauty": 0.0001577138900756836, "__label__finance_business": 0.00255584716796875, "__label__food_dining": 0.00035643577575683594, "__label__games": 0.0008502006530761719, "__label__hardware": 0.001789093017578125, "__label__health": 0.0006499290466308594, "__label__history": 0.0002491474151611328, "__label__home_hobbies": 0.00015413761138916016, "__label__industrial": 0.0005865097045898438, "__label__literature": 0.000263214111328125, "__label__politics": 0.0003459453582763672, "__label__religion": 0.00027561187744140625, "__label__science_tech": 0.102783203125, "__label__social_life": 0.0001342296600341797, "__label__software": 0.09136962890625, "__label__software_dev": 0.79248046875, "__label__sports_fitness": 0.000213623046875, "__label__transportation": 0.0004265308380126953, "__label__travel": 0.00020205974578857425}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 38459, 0.01935]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 38459, 0.36259]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 38459, 0.92127]], "google_gemma-3-12b-it_contains_pii": [[0, 72, false], [72, 867, null], [867, 2971, null], [2971, 4344, null], [4344, 6481, null], [6481, 8763, null], [8763, 9822, null], [9822, 11678, null], [11678, 13020, null], [13020, 15392, null], [15392, 17525, null], [17525, 19360, null], [19360, 21487, null], [21487, 23573, null], [23573, 25710, null], [25710, 27913, null], [27913, 29950, null], [29950, 32029, null], [32029, 34018, null], [34018, 36190, null], [36190, 36883, null], [36883, 38339, null], [38339, 38459, null]], "google_gemma-3-12b-it_is_public_document": [[0, 72, true], [72, 867, null], [867, 2971, null], [2971, 4344, null], [4344, 6481, null], [6481, 8763, null], [8763, 9822, null], [9822, 11678, null], [11678, 13020, null], [13020, 15392, null], [15392, 17525, null], [17525, 19360, null], [19360, 21487, null], [21487, 23573, null], [23573, 25710, null], [25710, 27913, null], [27913, 29950, null], [29950, 32029, null], [32029, 34018, null], [34018, 36190, null], [36190, 36883, null], [36883, 38339, null], [38339, 38459, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 38459, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 38459, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 38459, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 38459, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 38459, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 38459, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 38459, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 38459, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 38459, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 38459, null]], "pdf_page_numbers": [[0, 72, 1], [72, 867, 2], [867, 2971, 3], [2971, 4344, 4], [4344, 6481, 5], [6481, 8763, 6], [8763, 9822, 7], [9822, 11678, 8], [11678, 13020, 9], [13020, 15392, 10], [15392, 17525, 11], [17525, 19360, 12], [19360, 21487, 13], [21487, 23573, 14], [23573, 25710, 15], [25710, 27913, 16], [27913, 29950, 17], [29950, 32029, 18], [32029, 34018, 19], [34018, 36190, 20], [36190, 36883, 21], [36883, 38339, 22], [38339, 38459, 23]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 38459, 0.10833]]}
|
olmocr_science_pdfs
|
2024-11-28
|
2024-11-28
|
12d425ac5d59b40e2d3e8c78ab02dcbb268e5787
|
Reputation as a Service
João C. Ferreira1,2, Porfírio P. Filipe1, and Paulo M. Martins1
1Instituto Superior de Engenharia de Lisboa, Lisbon, Portugal
2Centro Algoritmi, Universidade Minho, Guimarães, Portugal
{jferreira@deetc, pfilipe@deetc, paulo.martins@dec}.isel.pt
Abstract—In this research work, we introduce the concept of a reputation service to evaluate user collaboration towards community or system goal. Online reputation mechanisms allow members of a community to submit their opinions (feedback) regarding other community members and their publication activity. Submitted opinions are analyzed, aggregated with feedback posted by other members and made publicly available to the community in the form of member feedback profiles. We propose a conceptual system that can be used in several contexts, namely in our public transportation recommender system developed in the framework of the European Project START.
Keywords—Reputation; Recommender System; Public Transportation; Service
I. INTRODUCTION
Online reputation mechanisms allow members of a community to submit their opinions (feedback) regarding other community members. Submitted opinions are analyzed, aggregated with feedback posted by other members and made publicly available to the community in the form of member feedback profiles. Several examples of such mechanisms can already be found in a number of diverse online communities. Perhaps the best-known application of online reputation mechanisms are the trust system in electronic markets. The first Web sites to introduce reputation schemes were on-line auction sites such as eBay.com. They are now also used by company reputation rating sites such as BizRate.com, which ranks merchants on the basis of customer ratings. Consumer Reports Online’s eRatings rates merchants on the basis of test purchases carried out by Consumer Reports staff.
Online reputation systems have appeared as a viable instrument for encouraging cooperation among strangers in such settings by guaranteeing that the behavior of a player towards any other player becomes publicly known and may therefore affect the behavior of the entire community towards that player in the future. Knowing this, players have an incentive to behave well towards each other, even if their relationship is a one-time deal. The rise of online reputation systems is already indirectly changing people’s behavior. Circumstantial evidence suggests that people now increasingly rely on opinions posted on such systems in order to make a variety of decisions. The growing importance of online reputation systems in different subject areas new challenges in the study of participant’s behavior in the communities where they are introduced. We have developed several recommender systems for Electric vehicles [1], transportation system [2], electric market [3] and the study of user behavior was always created. This raise the question of a definition of a service that can be used for several systems (recommender or not) in order to evaluate user performance towards the system or community goal.
This work is divided eight sections. In Section I, we introduce the problem context. Section II describes the European project associated with our work. Section III describes the recommender engine used to send user relevant information. In Section IV, we present the collaboration system used by the registered users to create and share transportation related information. Section V presents the reputation system to motivate and evaluate user participation towards a common system goal. In Section VI, we describe the developed approach based on services. Section VII presents the system (Social Mobility Advisor) developed. Finally, conclusions are drawn in Section VIII.
II. START Project
This work describes ISEL (Instituto Superior Engenharia de Lisboa, Portuguese polytechnic) contribution of a reputation system applied for a public transportation recommender system for the Seamless Travel across the Atlantic regions using sustainable transport). START Project is a European Commission’s Transnational Territorial Cooperation Program with 14 partners from the UK, France, Spain and Portugal. Its mission is to establish a transnational network of regional and local authorities to promote enhanced accessibility, giving tools to make easy to travel to, from, and around the Atlantic regions using environmentally friendly, collective modes of transport greater interconnectivity between transport systems clearer information within regional gateways, airport hubs ports & rail interchanges. The focus on this work is aligned with the “Integra concept” [4], whose aim is to provide a single brand that links together and provides information on the different public transport operations across the Atlantic Area. So, the system should allow the query of multiple information sources through a unique interface. The queries and answers to them should reflect a single data model. The existence of this common data model takes the software applications with the difficult task of dealing with various technologies and their relational schemas. Different public transportation systems can be added from the end user point
of view. Also, this integration allows the creation of mobile systems oriented for tourism purposes, other main goal of Integra, where “low budget tourism” can be guided, to reach POI (Point of Interest) by public transportation.
III. RECOMMENDER ENGINE
The Recommender Engine (RE) is the same engine used for the recommendation of electric vehicles defined in [1]. This engine matches information dedicated to public transportation from web and our social network with the user profile to bring the right information to a mobile device. Applied to the reality of smart cities with increasing mobility and sustainability needs the proposed system integrates a diversity of functionalities. The main system modules are: (1) GPS module: The RE receives the information of the geographical positioning information on the current position of the vehicle and the features that enable the calculation of distances between two points; (2) Public transportation Information module: a system with public transportation routes, schedules. The reception of such information is through an exchange file in XML format that contains information prepared and compiled by different operators. The file includes the geographical location of sites where you can embark on public transport scheme. The public transport information is incorporated into items of candidate recommendation system by allocating an item property that indicates whether or not is close to public transport. This information is another dimension that enters the calculation of the usefulness of each item positively or negatively affects your score accordingly to the choices that have been made before by the driver; (3) collaboration system to handle user participation towards community goal.
IV. COLLABORATION SYSTEM
Users can also interact and collaborate among themselves to improve their knowledge, or by allowing them to express their needs, preferences and also create valuable information related to public transportation. The features presented below are created to keep users informed, motivated and with intention to collaborate more frequently:
- Cooperation Area: An area where users can ask or provide different kinds of knowledge to cooperate in Public transportation information;
- Helping Area: An area where users can post questions and answers and some sort of help of any topic. This space could be accessed and viewed by any registered user. The system gives credits to users that provide good helping answers to posted questions, based on the following modules;
- Abuses or Faults Reporting Area: An area provided to report abuses of different kinds, like comments or bad use of the System. The system manager can penalize the users for inappropriate behavior. The reason for providing this area is essentially for discouraging users to commit abuses or faults;
- Request: An area where users can ask for specific questions. The system manager can use those requests to tune the community;
- Reward: Created in order to promote and recognize outstanding behavior (for example, no changes in the profile). The awarded users increase their reputation;
- Community Newsletter: The system Manager publishes a digital newsletter with Community information and Public transportation related information;
- Users Reputation: User reputation represents the most valuable collaborators, see reputation system;
- Alerts Subscription: Users can subscribe to different kinds of alerts: notifications, comments or other Public Transportation interactions.
V. REPUTATION SYSTEM
A reputation system collects, distributes, and aggregates feedback about participants’ past behavior, helping users to decide whom to trust and encouraging trustworthy behavior [5]. There are many empirical studies reputation system, see Resnick et al. [6] for an overview. Various trust and reputation systems have been proposed or implemented in different areas. Some proposed classifications use their application areas [7], algorithms [5] or some combined characteristics [8] as criteria. These classifications allow looking at trust and reputation systems from different perspectives always from zero development phases. Since there are common modules and strategies among different systems, the idea is to build one based on a modular structure using a service approach.
The Reputation system implements a model that is generally composed of the main functions:
- AddPoints/SubPoints – Add or remove user points based on pre-defined criteria;
- DemoteUser/PromoteUser – Change user reputation level based on points criteria;
- GetReputationToLevel – input is the current user reputation and gives the points necessary to go to the next level;
- Rate/Vote – user item evaluation for other user annotation and gives as output the new rate for that annotation item.
Several reputation algorithms can be implemented. At this moment, we implemented binary rate and the start algorithm.
A. Reputation Level
The reputation levels system is inspired from videogames like World of Warcraft [9], which needs exponential requirements to level up. Equation 1 illustrates the adopted formula to generate reputation level requirements for the next level, supplying the current level.
\[ PN = (8 \times NX) \times (45 + (5 \times NX)) \] (1)
`PN` is the reputation for next user level
`NX` is the reputation for current user level
So, from the first to the second level, the user needs 400 points, from the second to the third level, 880 points, from the third to the fourth level, 1440 points, and from the fourth to the fifth level, 2080 points. The reputation level is an important issue in our reputation system, since it will define the weight of the user’s ratings, described below, as well as their role/privileges in Social Network.
### B. Ratings
Our system provides an input for users to express their opinion related to item’s information quality by rating it as being helpful or not helpful (+1, -1), as shown in Fig. 1. This range permits a less ambiguous evaluation, since it will influence the reputation of those who submitted the item. Using this schema, it is possible to filter and organize information by its quality and, at the same time, indirectly rate the user who submitted that information. This approach aims to decrease public reputation of those who submit poor information and, inversely, reward those who submit relevant information. Item’s information reputation is determined using the Equation 2, which consists on a summation of all positive and negative ratings weighted by rater’s reputation level. Rater’s reputation level is used to avoid unfair ratings [1], one of reputation systems known problem, in assumption that users with better reputation provide more reliable ratings. Therefore, if user A submits a new route and user B rates it as useful (+1), the user A gets two points of reputation as presented in Fig. 1.
$$A_i = a * b - (c' * d') + c' * d$$ (2)
- $a$ – Item i current reputation (in cache);
- $b$ – Summation of item i raters reputation (in cache);
- $c$ – New rating for item i of active user;
- $d$ – Item i active user reputation level (in cache);
Reevaluation factors:
- $c'$ – Old rating for item i of active user;
- $d'$ – Reputation level of active user when submitted the old evaluation (in cache);
In order to calculate the mobility item’s quality itself (e.g., how good is a gate, operator, transport, etc.), our system also provides an input for users to express their mobility experience quality by a quantitative rating from 1 to 5 stars, plus comment.
The item’s quality reputation is calculated by the Equation 3 and it consists in a weighted average between evaluations and raters reputation. Rater’s reputation level is used to avoid unfair ratings as mentioned before.
$$A_i = (a * b - (c' * d') + c' * d) / (b - d' + d)$$ (3)
- $a$ – Item i current rating (in cache);
- $b$ – Summation of item i raters reputation (in cache);
- $c$ – New rating for item i of active user;
- $d$ – Item i active user reputation level (in cache);
Reevaluation factors:
- $c'$ – Old rating for item i of active user;
- $d'$ – Reputation level of active user when submitted the old evaluation (in cache);
### C. User’s reputation
As mentioned before, users indirectly rate others by rating their submitted items as being helpful or not helpful, according to the Equation 4:
$$R = -(a' * r') + a' * r$$ (4)
**TABLE 1: POSSIBLE CONFIGURATION FOR INCENTIVES.**
<table>
<thead>
<tr>
<th>Action</th>
<th>Reputation</th>
</tr>
</thead>
<tbody>
<tr>
<td>Binary rating</td>
<td>+2</td>
</tr>
<tr>
<td>Start rating</td>
<td>+1</td>
</tr>
<tr>
<td>Mobility item submission,</td>
<td>+4</td>
</tr>
<tr>
<td>except route</td>
<td></td>
</tr>
<tr>
<td>Route submission</td>
<td>+6</td>
</tr>
<tr>
<td>Comment submission</td>
<td>+1</td>
</tr>
<tr>
<td>Collaboration action</td>
<td>+3</td>
</tr>
<tr>
<td>Reevaluation</td>
<td>0</td>
</tr>
</tbody>
</table>
For example, someone that submits a new gate will be rewarded with 4 reputation points.
We also adopted a badge reward system, used by systems like Stackoverflow [10] and Foursquare [11] with great acceptance by the community, where users are rewarded for reaching certain objectives.
In our context, we reward the users when they reach, for example, a pre-defined number of done routes or rated items.
### E. Moderation
In our approach, the information is strongly dependent on user’s collaborative interactions. Consequently, moderation actions are needed. To reduce the amount of necessary staff to keep the system, we included a role based moderation mechanism, inspired by Slashdot, which takes advantage of...
user’s reputation to delegate them moderation actions. This way, most reliable users are assigned to perform some moderation actions. Our mechanism has two moderation roles, where the first, called “collaborator”, are assigned to manage regular users by editing/hiding comments and item’s information. The second role, called “moderator”, was introduced to reduce the number of unfair collaborators, as described by Slashdot [5].
VI. Software Development
The concept normalization in public transportation area is achieved by the introduction of domain ontology. We use same recommender process to several problems in the transportation domain, such as a recommender engine for electric vehicle [1] and current proposal.
Ontologies are very powerful in the sense that they are developed with the human understanding of the domain in mind, instead of taking a pure application-oriented approach, as it is mostly done with database schemas. Ontologies can help bridge the gap between human understanding and machine understanding of a domain. We developed a domain ontology based on Web Ontology Language (OWL) and UML2 profile and a mapping process between different database schemas to a central Information Model or to other database schemas, and in that way enable better understanding of this information by the users in the organization. Public Transportation ontology (PTO) can play an important role providing mechanisms to handle automatically data integration among different Public transportation data and all related data acquired with user-participation. PTO is described in [2]. PTO is built on top of RDF, thus it inherits its concepts: resource, property, datatype and class: (1) resource is one of the bases of RDF, it represents all things described and is the root construction. It is an instance of MOF classes; (2) property, defines the relation between subjects and object resources and is used to represent relationships between concepts. Ontology class attributes or associations are represented through proprieties; (3) ontology is a concept that aggregates other concepts (classes, properties, etc). It groups instances of other concepts that represent similar or related knowledge; (4) classifier is the base class of concepts that are used for classification and is divided in: (i) datatype, a mechanism for grouping primitive data; (ii) abstract class; and (5) instance that is the base class and is divided in individuals and data values, for details see [2].
Taking into account a recommender system to be developed, in our approach, the system developer can use reputation service and chose the available reputation algorithms. To obtain that, it is necessary to use a Service-Oriented Architecture (SOA) [12], which is a component-based software architecture. This architecture defines the description of the services’ interface and implementation. The interface is defined in an unbiased way, independent of the hardware platform, operating system and programming language of the services implementation. For implementing service request software architecture, SOA changes the manner of the traditional software development. The usage of Web Services, the combination of the related technologies and the software architecture above are the basis for the implementation of the Web Services. This Web Services model is divided into three main parts: (1) Services Interface; (2) Services Mapping; and (3) Services Implementation. Services in SOA also include Services Contract, and Service Contract is the definition of the Services interface and Services Implementation. Services Interface in this model is realized by Web Services Definition Language (WSDL) [14], following the criterion of the WSDL. Services implementation follows the criterion of the special platform. Because of the universal property of WSDL, the services in this model own the universal property.
Representational State Transfer (REST) [15], describes a series of architectural constraints that exemplify how the web’s design emerged. Several implementations of these ideas have been created throughout time. As a set of design criteria, REST is very general. In particular, it is not tied to the Web. Nothing about REST depends on the mechanics of HTTP or the structure of URIs. So, Web Service is designed according to resource. Every Web Service represents a kind of resource, which is operated by the operations of Web Service. The Resource Oriented Architecture (ROA) is a way of turning a problem into a RESTful [16] web service: an arrangement of URIs, HTTP, and XML that works like the rest of the Web.
A new, rational structure, high consistency, low connection of SOA-based application architecture is constructed, which also follows ROA, implements services by encapsulation of the entity object and its operations using Web Services, implements the business processes in the client PC. Compared with the traditional software architecture, the new services layer is added between the entity object layer and business logic layer. In the new layer, data and its operations are packaged to Web Services. The implementation of services is based on the “Interface-First” principle, for sharing the data fully and safely. In the entity object layer, based on the OOP (Object-Oriented Principle), the entity objects and their operations are delivered to three parts: (1) Entity Class; (2) Interface of Data Access; and (3) Data Access [17]. An overview of this process is illustrated in Fig. 2.
According to ROA, Web Service is designed around the resource. To simplify the development, the extension of the resource’s definition is reduced, and the table of the database is a basic kind of resource. In the period of object oriented development, O/R mapping (Object/Relational mapping) is adopted to resolve the problem of Object-relational impedance mismatch [10]. This strategy combines business logic and data access for stripping. It increases the performance of the business logic for the persistence of the interaction between objects, instead of directly operating on the database tables and fields.
Web Service is used to disjoin the business logic and the operation of persistent object. The simple operation of the persistent object is packaged to Web Service, to share the resource commonly and easily.
According to the basic operations of the table, the operations of the Web Service are designed as list: (1) Add object to the database; (2) Delete object from the database;
(3) Edit the object, and save the result to the database; (4) Find object in the database; (5) Find a list of objects in the database.
<table>
<thead>
<tr>
<th>Software Architecture</th>
</tr>
</thead>
<tbody>
<tr>
<td>Represent Layer</td>
</tr>
<tr>
<td>Client</td>
</tr>
<tr>
<td>Client</td>
</tr>
<tr>
<td>Client</td>
</tr>
<tr>
<td>Business Logic Layer</td>
</tr>
<tr>
<td>BusinessLogic</td>
</tr>
<tr>
<td>...</td>
</tr>
<tr>
<td>BusinessLogic</td>
</tr>
<tr>
<td>Dynamic Proxy Framework</td>
</tr>
<tr>
<td>Services Layer</td>
</tr>
<tr>
<td>WebServices</td>
</tr>
<tr>
<td>...</td>
</tr>
<tr>
<td>WebServices</td>
</tr>
<tr>
<td>Entity Object Layer</td>
</tr>
<tr>
<td>Data Access Interface</td>
</tr>
<tr>
<td>...</td>
</tr>
<tr>
<td>Data Access</td>
</tr>
<tr>
<td>Entity</td>
</tr>
<tr>
<td>Database</td>
</tr>
</tbody>
</table>
Figure 2. Software Architecture Based on SOA [16].
VII. SOCIAL MOBILITY ADVISOR
Social Mobility Advisor (SMA), was our Public Transportation Recommender system developed for START project using a service oriented approach. The main services introduced are: (1) geo-location, based on HTML 5 – API, from the user IP address, is possible to know the approximate location; (2) historical navigation data based on Address.js [17]; (3) Public transportation data were imported based on a semantic approach developed [2]; (4) external information from Google Maps and Google Places (maps and points of interests [19]). Brighter Planet for CO2 calculation of carbon footprint taking into account trip start and end point [20], Wikipedia to get information not available in internal data base [21] and Facebook to get information about users (name, friends, e-mail, photo); (5) user authentication LDAP; (6) user reputation; (7) matching algorithm; and (8) user profile.
SMA main menu, illustrated in Fig. 3, is a collaborative solution that aims to assist travelers to share their experiences and find the best suitable mobility alternatives, bearing in mind the best sustainable options. Those actions are supported by the collaborative community interactions, in other words, under the social network concept. This approach leads to a credibility problem, which we took into account by assuring both users and information are cataloged by confidence levels. We also propose an automated moderation mechanism that tries to reduce the number of required staff to administer the system.
The SMA project aims to contribute to a more accessible, social and sustainable mobility across the Europe, dealing with reputation and recommender systems in order to build a social network.
VIII. CONCLUSIONS
The Integra social network, built from the experience of the SMA Project, has exceeded the testing phase, which counted with more than two hundred users. The present database includes more than ten thousand items (gates, transports, operators), covering mobility information in a worldwide context, and about one thousand rates and comments. This recommender system for public transportation was developed in a service based approach. Everyone can obtain more information using [22] and join the Integra social network accessing [23] and a full implementation description available at [24].
REFERENCES
Figure 3. SMA application screen (Integra Social Network).
|
{"Source-Url": "http://repositorium.sdum.uminho.pt/bitstream/1822/24615/1/Reputation%20as%20a%20Service.pdf", "len_cl100k_base": 5020, "olmocr-version": "0.1.53", "pdf-total-pages": 6, "total-fallback-pages": 0, "total-input-tokens": 21348, "total-output-tokens": 6020, "length": "2e12", "weborganizer": {"__label__adult": 0.0013408660888671875, "__label__art_design": 0.0009407997131347656, "__label__crime_law": 0.0009069442749023438, "__label__education_jobs": 0.0011529922485351562, "__label__entertainment": 0.0002624988555908203, "__label__fashion_beauty": 0.00045180320739746094, "__label__finance_business": 0.0006518363952636719, "__label__food_dining": 0.00118255615234375, "__label__games": 0.002109527587890625, "__label__hardware": 0.00299835205078125, "__label__health": 0.0015420913696289062, "__label__history": 0.0009832382202148438, "__label__home_hobbies": 0.00021135807037353516, "__label__industrial": 0.0010576248168945312, "__label__literature": 0.0009212493896484376, "__label__politics": 0.0008654594421386719, "__label__religion": 0.0009765625, "__label__science_tech": 0.087646484375, "__label__social_life": 0.00037217140197753906, "__label__software": 0.0177764892578125, "__label__software_dev": 0.828125, "__label__sports_fitness": 0.0009813308715820312, "__label__transportation": 0.045196533203125, "__label__travel": 0.0011358261108398438}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 27116, 0.01368]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 27116, 0.18026]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 27116, 0.90691]], "google_gemma-3-12b-it_contains_pii": [[0, 5216, false], [5216, 10598, null], [10598, 14936, null], [14936, 21442, null], [21442, 27058, null], [27058, 27116, null]], "google_gemma-3-12b-it_is_public_document": [[0, 5216, true], [5216, 10598, null], [10598, 14936, null], [14936, 21442, null], [21442, 27058, null], [27058, 27116, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 27116, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 27116, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 27116, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 27116, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 27116, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 27116, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 27116, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 27116, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 27116, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 27116, null]], "pdf_page_numbers": [[0, 5216, 1], [5216, 10598, 2], [10598, 14936, 3], [14936, 21442, 4], [21442, 27058, 5], [27058, 27116, 6]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 27116, 0.22628]]}
|
olmocr_science_pdfs
|
2024-12-07
|
2024-12-07
|
0bd4d800642b859f9324a3cc80d27e5795ec0efa
|
The Frame Problem in Situation Calculus
Holds(Result(Put_On(Block A, Block B), Situation_0), Black(Block A))?
Intuitively we know that moving an object Doesn’t effect its color, but in FOL we need to explicitly State that many actions do not effect many properties.
“Quick” fix to the frame problem, frame axioms m properties and n actions how many frame axioms?
Introduction to Planning – Differences b/w Uninformed and Informed Search.
- Plan: a **sequence of steps** to achieve a goal.
- Problem solving agent knows: **Actions, states, goals** and **plans**.
- Planning is a **special case** of problem solving: reach a **state** satisfying the **requirements** from the current state using **available actions**.
Search vs. planning
Consider the task *get milk, bananas, and a cordless drill*
Standard search algorithms seem to fail miserably:
After-the-fact heuristic/goal test inadequate
Search vs. planning contd.
Planning systems do the following:
1) open up action and goal representation to allow selection
2) divide-and-conquer by subgoaling
3) relax requirement for sequential construction of solutions
<table>
<thead>
<tr>
<th></th>
<th>Search</th>
<th>Planning</th>
</tr>
</thead>
<tbody>
<tr>
<td>States</td>
<td>Java data structures</td>
<td>Logical sentences</td>
</tr>
<tr>
<td>Actions</td>
<td>Java code</td>
<td>Preconditions/outcomes</td>
</tr>
<tr>
<td>Goal</td>
<td>Java code</td>
<td>Logical sentence (conjunction)</td>
</tr>
<tr>
<td>Plan</td>
<td>Sequence from $S_0$</td>
<td>Constraints on actions</td>
</tr>
</tbody>
</table>
Examples of Planning Systems
- Spacecraft assembly, integration and verification
- Job shop scheduling
- Space mission scheduling
- Building construction
- Operations on a flight deck of an aircraft carrier
- For demos: blocks world
Blocks World
- **PickUp(X)**
- X on table, hand empty, X free
- **PutDown(X)**
- X in hand
- **Stack(X,Y)**
- X in hand, y free
- **Unstack(X,Y)**
- X free, X on Y, hand free
Blocks World (cont)
Assumptions of the "Standard" AI Planning Paradigm
- There is a **single causal agent** and this agent is the planner.
- The planner is given a **well-defined goal** which remains **fixed** over the course of planning.
- The planner is assumed to have **functionally complete** and **accurate knowledge** of the starting situation.
- The planner is assumed to **possess** the **knowledge** required to accurately model the world.
- The planner is assumed to **possess** the **resources** (time and memory) required to use this model to reason about the possible worlds associated with different courses of action that might be pursued.
STRIPS - Linear Planner
- First planner developed by SRI, stands for STanford Research Institute Problem Solver.
- In STRIPS notation, a model of the world is just a list of variables free atomic propositions that hold in the world.
- Operators involving variables are called operator schemas.
- The following expresses an initial state in the block world:
\(<\text{on(a,t)}, \text{on(b,a)}, \text{clear(b)}, \text{on(c,t)}, \text{clear(c)}>)\>
- Don’t allow negative facts i.e. NOT\text{clear(b)}. Why? What’s this called.
The description of the goal state is again a list of atomic proposition where all variables are interpreted existentially.
The goal state of plan, for example, will be given by such a description (if we want an apple we usually do not refer to a particular apple). An example goal state in the block world is:
<on(X,c), on(c,t)>
This means that some block should be on c, which is itself directly on the table.
STRIPS (cont)
- The main element of the language is the operator description, which has **three parts**:
1. The **action** name, which may be parametrized
2. The **precondition**, which is a conjunction of positive literals
3. The **effect**, which is a conjunction of positive and/or negative literals
- The Preconditions consist of a **conjunctive logical expression** which is intended to describe the conditions that must be true in order to apply the operator.
- The **positive or additions** consist of a set of expressions that must be **added** to a model of the situation if the operator is applied.
- The **negative or deletions** consist of a set of expressions that must be **deleted** from a model of a situation if the operator is applied.
STRIPS (cont)
Figure 10.1. STRIPS representation for (1) opening a door (2) closing a door.
Why do we need deletions and additions?
STRIPS (cont)
Figure 10.1. STRIPS representation for (1) opening a door (2) closing a door.
Why do we need deletions and additions?
STRIPS (cont)
STRIPS representation for (1) opening a door (2) closing a door.
Why do we need deletions and additions?
STRIPS Example
Example of STRIPS Planning (Operator Schema & Initial Model).
STRIPS Example
Example of STRIPS Planning (Operator Schema & Initial Model).
STRIPS Example (cont)
Goal Wf's
\[ \text{G0: (3x) [BOX(x) \land INROOM(x,R1)]} \]
\[ \text{G1: INROOM(BOX,r1) \land INROOM(ROBOT,r1) \land CONNECTS(d,r1,R1)} \]
\[ \text{G2: INROOM(ROBOT,r1) \land CONNECTS(d,r1,R2)} \]
Plan
\[ \text{GOTHRU(D1,R1,R2)} \]
\[ \text{PUSHTHRU(BOX1,D1,R2,R1)} \]
M1: INROOM(ROBOT,R2)
CONNECTS(D1,R1,R2)
CONNECTS(D2,R2,R3)
BOX(Box1)
INROOM(Box1,R2)
\[
(\forall x \forall y \forall z) [\text{CONNECTS}(x,y,z) \Rightarrow \text{CONNECTS}(x,z,y)]
\]
M2: INROOM(ROBOT,R1)
CONNECTS(D1,R1,R2)
CONNECTS(D2,R2,R3)
BOX(Box1)
INROOM(Box1,R1)
\[
(\forall x \forall y \forall z) [\text{CONNECTS}(x,y,z) \Rightarrow \text{CONNECTS}(x,z,y)]
\]
Example STRIPS problem
**Init**($\text{At}(C_1, SFO) \land \text{At}(C_2, JFK) \land \text{At}(P_1, SFO) \land \text{At}(P_2, JFK)$
$\land \text{Cargo}(C_1) \land \text{Cargo}(C_2) \land \text{Plane}(P_1) \land \text{Plane}(P_2)$
$\land \text{Airport}(JFK) \land \text{Airport}(SFO)$)
**Goal**($\text{At}(C_1, JFK) \land \text{At}(C_2, SFO)$)
**Action**(Load($c$, $p$, $a$),
**PRECOND**: $\text{At}(c, a) \land \text{At}(p, a) \land \text{Cargo}(c) \land \text{Plane}(p) \land \text{Airport}(a)$
**EFFECT**: $\neg \text{At}(c, a) \land \text{In}(c, p)$)
**Action**(Unload($c$, $p$, $a$),
**PRECOND**: $\text{In}(c, p) \land \text{At}(p, a) \land \text{Cargo}(c) \land \text{Plane}(p) \land \text{Airport}(a)$
**EFFECT**: $\text{At}(c, a) \land \neg \text{In}(c, p)$)
**Action**(Fly($p$, from, to),
**PRECOND**: $\text{At}(p, \text{from}) \land \text{Plane}(p) \land \text{Airport}(\text{from}) \land \text{Airport}(\text{to})$
**EFFECT**: $\neg \text{At}(p, \text{from}) \land \text{At}(p, \text{to})$)
Expressiveness of STRIPS
STRIPS (STanford Research Institute Problem Solver) provides a “cut-down” first-order logic representation for planning:
- Preconditions and effects must be function-free
- Closed world assumption: Unmentioned literals are false
- Effect $P \land \neg Q$ : add $P$ and delete $Q$
- Only positive literals in states e.g.: $Poor \land Unknown$
- Only ground literals in goals e.g.: $Rich \land Famous$
- Goals and effects are conjunctions e.g.: $Rich \land Famous$
- No support for equality e.g. $x = y$ is not allowed
Note, the closed-world assumption avoids the frame problem
As an example, consider the following air transport problem involving loading and unloading cargo onto and off planes and flying it from place to place:
Planning as state-space search
Forward state-space search: As each action has an effect, planning can be solved using state-space search algorithms
This requires the following components:
An initial state: given in the STRIPS definition
Actions applicable for any given state that specify the successor state:
given by the STRIPS action effects
A goal test: given in the STRIPS definition
A step cost: each action is given a cost of one
Similarly, as each action has a precondition, we can search backwards from the goal using backward state-space search
In either case we can use heuristics to estimate the cost of reaching the goal and apply algorithms like $A^*$
Partially ordered plans
However, we can also attempt to find a plan by solving several sub-problems *simultaneously* and combining them - this can have the advantage of reducing the size of the search space and providing a more flexible answer:
*Partially ordered* collection of steps with
- *Start* step has the initial state description as its effect
- *Finish* step has the goal description as its precondition
- causal links from outcome of one step to precondition of another
- temporal ordering between pairs of steps
Open condition = precondition of a step not yet causally linked
A plan is complete iff every precondition is achieved
A precondition is achieved iff it is the effect of an earlier step and no possibly intervening step undoes it
Example
Start
At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.)
Have(Milk) At(Home) Have(Ban.) Have(Drill)
Finish
Example
Start
At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.)
At(HWS) Sells(HWS,Drill)
Buy(Drill)
At(x)
Go(SM)
At(SM) Sells(SM,Milk)
Buy(Milk)
Have(Milk) At(Home) Have(Ban.) Have(Drill)
Finish
Example
Planning process
Operators on partial plans:
add a link from an existing action to an open condition
add a step to fulfill an open condition
order one step wrt another to remove possible conflicts
Gradually move from incomplete/vague plans to complete, correct plans
Backtrack if an open condition is unachievable or
if a conflict is unresolvable
function POP(initial, goal, operators) returns plan
plan ← MAKE-MINIMAL-PLAN(initial, goal)
loop do
if SOLUTION?(plan) then return plan
$S_{\text{need}}$, c ← SELECT-SUBGOAL(plan)
CHOOSE-OPERATOR(plan, operators, $S_{\text{need}}$, c)
RESOLVE-THREATS(plan)
end
function SELECT-SUBGOAL(plan) returns $S_{\text{need}}$, c
pick a plan step $S_{\text{need}}$ from STEPS(plan)
with a precondition c that has not been achieved
return $S_{\text{need}}$, c
procedure CHOOSE-OPERATOR(plan, operators, S\textsubscript{need}, c)
choose a step $S\text{\_add}$ from operators or STEPS(plan) that has $c$ as an effect
if there is no such step then fail
add the causal link $S\text{\_add} \leftrightarrow c \rightarrow S\text{\_need}$ to LINKS(plan)
add the ordering constraint $S\text{\_add} \prec S\text{\_need}$ to ORDERINGS(plan)
if $S\text{\_add}$ is a newly added step from operators then
add $S\text{\_add}$ to STEPS(plan)
add $Start \prec S\text{\_add} \prec Finish$ to ORDERINGS(plan)
procedure RESOLVE-THREATS(plan)
for each $S\text{\_threat}$ that threatens a link $S_i \rightarrow c \rightarrow S_j$ in LINKS(plan) do
choose either
Demotion: Add $S\text{\_threat} \prec S_i$ to ORDERINGS(plan)
Promotion: Add $S_j \prec S\text{\_threat}$ to ORDERINGS(plan)
if not CONSISTENT(plan) then fail
end
Clobbering and promotion/demotion
A clobberer is a potentially intervening step that destroys the condition achieved by a causal link. E.g., Go(Home) clobbers At(Supermarket):
Demotion: put before Go(Supermarket)
Promotion: put after Buy(Milk)
Properties of POP
Nondeterministic algorithm: backtracks at choice points on failure:
– choice of $S_{add}$ to achieve $S_{need}$
– choice of demotion or promotion for clobberer
– selection of $S_{need}$ is irrevocable
POP is sound, complete, and systematic (no repetition)
Extensions for disjunction, universals, negation, conditionals
Can be made efficient with good heuristics derived from problem description
Particularly good for problems with many loosely related subgoals
Example: Blocks world
"Sussman anomaly" problem
Start State
\[ \text{Clear}(x) \text{ On}(x,z) \text{ Clear}(y) \]
\[ \text{PutOn}(x,y) \]
\[ \neg\text{On}(x,z) \neg\text{Clear}(y) \]
\[ \text{Clear}(z) \text{ On}(x,y) \]
Goal State
\[ \text{Clear}(x) \text{ On}(x,z) \]
\[ \text{PutOnTable}(x) \]
\[ \neg\text{On}(x,z) \text{ Clear}(z) \text{ On}(x,\text{Table}) \]
Example contd.
- On(C, A) on(A, Table) Cl(B) on(B, Table) Cl(C)
- On(A, B) on(B, C)
Example contd.
START
On(C,A) On(A,Table) Cl(B) On(B,Table) Cl(C)
Cl(B) On(B,z) Cl(C)
PutOn(B,C)
On(A,B) On(B,C)
FINISH
Example contd.
START
On(C,A) On(A,Table) Cl(B) On(B,Table) Cl(C)
PutOn(A,B) clobbers Cl(B) => order after PutOn(B,C)
Finish
Example contd.
```
START
On(C,A) On(A,Table) Cl(B) On(B,Table) Cl(C)
On(C,z) Cl(C)
PutOnTable(C)
Cl(A) On(A,z) Cl(B)
PutOn(A,B)
Cl(B) On(B,z) Cl(C)
PutOn(B,C)
On(A,B) On(B,C)
FINISH
```
PutOn(A,B) clobbers Cl(B) => order after PutOn(B,C)
PutOn(B,C) clobbers Cl(C) => order after PutOnTable(C)
Simple STRIPS BlocksWorld
Move(x,y,z) move x which is currently on y onto z
PC:
A:
D:
Start State
Goal State
Simple STRIPS BlocksWorld
Move(x, y, z) move x which is currently on y onto z
PC: \(PC: \text{On}(x, y) \land C(x) \land C(z)\)
A: \(D: \text{On}(x, y), C(z)\)
D: \(A: \text{On}(x, z), C(y), C(T)\)
Start State
\[
\begin{array}{c}
\text{B} \\
\text{C} \\
\text{A}
\end{array}
\]
Goal State
\[
\begin{array}{c}
\text{A} \\
\text{B} \\
\text{C}
\end{array}
\]
\[
\text{On}(C, A) \land \text{On}(A, T) \land \text{On}(B, T) \land C(B) \land C(C) \land C(T)
\]
\[
\text{On}(C, T) \land \text{On}(B, C) \land \text{On}(A, B) \land C(A) \land C(T)
\]
A Simple Plan
- Ontable (A)
- Ontable (B)
- On (D, A)
- On (C, D)
- Clear (C)
- Clear (B)
- Handempty
Init
- Ontable (B)
- Ontable (C)
- On (D, B)
- On (A, D)
- Clear (A)
- Clear (C)
- Handempty
- A
- D
- B
- C
Need Two Additional Rules
1. A block can always be moved onto the table, if it is clear.
\[ \forall x y [(\exists n(x, y) \in S) \land (C(x) \in S) \supset \text{Can}(\text{Move}(x, y, T))] \]
2. If anything, build towers bottom up, since we can only move one block at a time.
\[ \forall b_0, ..., b_n, y [(C(b_0) \land (\exists n(b_0, y) \in S) \land (y \neq b_1) \land (\exists n(b_0, b_1) \in G) \land (\exists n(b_0, b_1) \notin S) \land (\exists n(b_1, b_2) \in G \cap S) \land ... \land (\exists n(b_n, T) \in G \cap S)) \supset \text{Do}(\text{Move}(b_0, y, b_1))] \]
|
{"Source-Url": "http://www.cs.albany.edu/~davidson/courses/CSI535-05/planning.pdf", "len_cl100k_base": 4330, "olmocr-version": "0.1.53", "pdf-total-pages": 38, "total-fallback-pages": 0, "total-input-tokens": 47305, "total-output-tokens": 5806, "length": "2e12", "weborganizer": {"__label__adult": 0.0004124641418457031, "__label__art_design": 0.0008206367492675781, "__label__crime_law": 0.0008921623229980469, "__label__education_jobs": 0.00395965576171875, "__label__entertainment": 0.00015473365783691406, "__label__fashion_beauty": 0.0002446174621582031, "__label__finance_business": 0.0006165504455566406, "__label__food_dining": 0.000514984130859375, "__label__games": 0.0024547576904296875, "__label__hardware": 0.0013055801391601562, "__label__health": 0.0007100105285644531, "__label__history": 0.0006036758422851562, "__label__home_hobbies": 0.00040650367736816406, "__label__industrial": 0.001567840576171875, "__label__literature": 0.0007929801940917969, "__label__politics": 0.000518798828125, "__label__religion": 0.000629425048828125, "__label__science_tech": 0.322021484375, "__label__social_life": 0.00026535987854003906, "__label__software": 0.01593017578125, "__label__software_dev": 0.64306640625, "__label__sports_fitness": 0.0006346702575683594, "__label__transportation": 0.0014324188232421875, "__label__travel": 0.00024437904357910156}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 14112, 0.00719]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 14112, 0.60977]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 14112, 0.75833]], "google_gemma-3-12b-it_contains_pii": [[0, 366, false], [366, 723, null], [723, 902, null], [902, 1588, null], [1588, 1822, null], [1822, 2009, null], [2009, 2029, null], [2029, 2670, null], [2670, 3201, null], [3201, 3615, null], [3615, 4379, null], [4379, 4513, null], [4513, 4647, null], [4647, 4768, null], [4768, 4846, null], [4846, 4924, null], [4924, 5589, null], [5589, 6603, null], [6603, 7361, null], [7361, 8036, null], [8036, 8794, null], [8794, 8924, null], [8924, 9143, null], [9143, 9151, null], [9151, 9510, null], [9510, 10018, null], [10018, 10896, null], [10896, 11143, null], [11143, 11633, null], [11633, 12010, null], [12010, 12095, null], [12095, 12220, null], [12220, 12349, null], [12349, 12652, null], [12652, 12765, null], [12765, 13319, null], [13319, 13534, null], [13534, 14112, null]], "google_gemma-3-12b-it_is_public_document": [[0, 366, true], [366, 723, null], [723, 902, null], [902, 1588, null], [1588, 1822, null], [1822, 2009, null], [2009, 2029, null], [2029, 2670, null], [2670, 3201, null], [3201, 3615, null], [3615, 4379, null], [4379, 4513, null], [4513, 4647, null], [4647, 4768, null], [4768, 4846, null], [4846, 4924, null], [4924, 5589, null], [5589, 6603, null], [6603, 7361, null], [7361, 8036, null], [8036, 8794, null], [8794, 8924, null], [8924, 9143, null], [9143, 9151, null], [9151, 9510, null], [9510, 10018, null], [10018, 10896, null], [10896, 11143, null], [11143, 11633, null], [11633, 12010, null], [12010, 12095, null], [12095, 12220, null], [12220, 12349, null], [12349, 12652, null], [12652, 12765, null], [12765, 13319, null], [13319, 13534, null], [13534, 14112, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 14112, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 14112, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 14112, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 14112, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 14112, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 14112, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 14112, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 14112, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 14112, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 14112, null]], "pdf_page_numbers": [[0, 366, 1], [366, 723, 2], [723, 902, 3], [902, 1588, 4], [1588, 1822, 5], [1822, 2009, 6], [2009, 2029, 7], [2029, 2670, 8], [2670, 3201, 9], [3201, 3615, 10], [3615, 4379, 11], [4379, 4513, 12], [4513, 4647, 13], [4647, 4768, 14], [4768, 4846, 15], [4846, 4924, 16], [4924, 5589, 17], [5589, 6603, 18], [6603, 7361, 19], [7361, 8036, 20], [8036, 8794, 21], [8794, 8924, 22], [8924, 9143, 23], [9143, 9151, 24], [9151, 9510, 25], [9510, 10018, 26], [10018, 10896, 27], [10896, 11143, 28], [11143, 11633, 29], [11633, 12010, 30], [12010, 12095, 31], [12095, 12220, 32], [12220, 12349, 33], [12349, 12652, 34], [12652, 12765, 35], [12765, 13319, 36], [13319, 13534, 37], [13534, 14112, 38]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 14112, 0.01923]]}
|
olmocr_science_pdfs
|
2024-12-10
|
2024-12-10
|
461f04ab168d2d16770908b6d557f24a5371cd09
|
[REMOVED]
|
{"Source-Url": "http://embedded.cs.uni-saarland.de/literature/DeterministicExecutionModelOnCOTSHardware.pdf", "len_cl100k_base": 7554, "olmocr-version": "0.1.53", "pdf-total-pages": 13, "total-fallback-pages": 0, "total-input-tokens": 37138, "total-output-tokens": 9503, "length": "2e12", "weborganizer": {"__label__adult": 0.0007352828979492188, "__label__art_design": 0.0008244514465332031, "__label__crime_law": 0.0007925033569335938, "__label__education_jobs": 0.0006642341613769531, "__label__entertainment": 0.00015497207641601562, "__label__fashion_beauty": 0.0003490447998046875, "__label__finance_business": 0.0004892349243164062, "__label__food_dining": 0.0007205009460449219, "__label__games": 0.0016660690307617188, "__label__hardware": 0.032562255859375, "__label__health": 0.0011234283447265625, "__label__history": 0.0006937980651855469, "__label__home_hobbies": 0.00035452842712402344, "__label__industrial": 0.0021514892578125, "__label__literature": 0.00030350685119628906, "__label__politics": 0.0006494522094726562, "__label__religion": 0.0011281967163085938, "__label__science_tech": 0.365966796875, "__label__social_life": 8.982419967651367e-05, "__label__software": 0.007965087890625, "__label__software_dev": 0.57568359375, "__label__sports_fitness": 0.0007834434509277344, "__label__transportation": 0.0034942626953125, "__label__travel": 0.0004360675811767578}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 33071, 0.02929]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 33071, 0.56577]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 33071, 0.86713]], "google_gemma-3-12b-it_contains_pii": [[0, 2529, false], [2529, 5527, null], [5527, 7556, null], [7556, 10382, null], [10382, 12993, null], [12993, 15657, null], [15657, 18883, null], [18883, 22067, null], [22067, 24718, null], [24718, 26920, null], [26920, 29094, null], [29094, 32274, null], [32274, 33071, null]], "google_gemma-3-12b-it_is_public_document": [[0, 2529, true], [2529, 5527, null], [5527, 7556, null], [7556, 10382, null], [10382, 12993, null], [12993, 15657, null], [15657, 18883, null], [18883, 22067, null], [22067, 24718, null], [24718, 26920, null], [26920, 29094, null], [29094, 32274, null], [32274, 33071, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 33071, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 33071, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 33071, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 33071, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 33071, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 33071, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 33071, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 33071, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 33071, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 33071, null]], "pdf_page_numbers": [[0, 2529, 1], [2529, 5527, 2], [5527, 7556, 3], [7556, 10382, 4], [10382, 12993, 5], [12993, 15657, 6], [15657, 18883, 7], [18883, 22067, 8], [22067, 24718, 9], [24718, 26920, 10], [26920, 29094, 11], [29094, 32274, 12], [32274, 33071, 13]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 33071, 0.1044]]}
|
olmocr_science_pdfs
|
2024-12-07
|
2024-12-07
|
75cc3e63f65a90cb4592b6965ecf242b3776b8a7
|
Chapter 8: Application Design and Development
Chapter 8: Application Design and Development
- User Interfaces and Tools
- Web Interfaces to Databases
- Web Fundamentals
- Servlets and JSP
- Building Large Web Applications
- Triggers
- Authorization in SQL
- Application Security
User Interfaces and Tools
- Most database users do *not* use a query language like SQL.
- Forms
- Graphical user interfaces
- Report generators
- Data analysis tools (see Chapter 18)
- Many interfaces are Web-based
- Back-end (Web server) uses such technologies as
- Java servlets
- Java Server Pages (JSP)
- Active Server Pages (ASP)
The Web is a distributed information system based on hypertext.
Most Web documents are hypertext documents formatted via the HyperText Markup Language (HTML)
HTML documents contain
- text along with font specifications, and other formatting instructions
- hypertext links to other documents, which can be associated with regions of the text.
- forms, enabling users to enter data which can then be sent back to the Web server
### Acme Supply Company, Inc.
#### Quarterly Sales Report
**Period:** Jan. 1 to March 31, 2005
<table>
<thead>
<tr>
<th>Region</th>
<th>Category</th>
<th>Sales</th>
<th>Subtotal</th>
</tr>
</thead>
<tbody>
<tr>
<td>North</td>
<td>Computer Hardware</td>
<td>1,000,000</td>
<td></td>
</tr>
<tr>
<td></td>
<td>Computer Software</td>
<td>500,000</td>
<td></td>
</tr>
<tr>
<td></td>
<td>All categories</td>
<td></td>
<td>1,500,000</td>
</tr>
<tr>
<td>South</td>
<td>Computer Hardware</td>
<td>200,000</td>
<td></td>
</tr>
<tr>
<td></td>
<td>Computer Software</td>
<td>400,000</td>
<td></td>
</tr>
<tr>
<td></td>
<td>All categories</td>
<td></td>
<td>600,000</td>
</tr>
</tbody>
</table>
**Total Sales** 2,100,000
Web Interfaces to Databases
Why interface databases to the Web?
2. Web browsers have become the de-facto standard user interface to databases
● Enable large numbers of users to access databases from anywhere
● Avoid the need for downloading/installing specialized code, while providing a good graphical user interface
● Examples: banks, airline and rental car reservations, university course registration and grading, and so on.
1. Dynamic generation of documents
● Limitations of static HTML documents
▪ Cannot customize fixed Web documents for individual users.
▪ Problematic to update Web documents, especially if multiple Web documents replicate data.
● Solution: Generate Web documents dynamically from data stored in a database.
▪ Can tailor the display based on user information stored in the database.
– E.g. tailored ads, tailored weather and local news, ...
▪ Displayed information is up-to-date, unlike the static Web pages
– E.g. stock market information, ..
Uniform Resources Locators
■ In the Web, functionality of pointers is provided by Uniform Resource Locators (URLs).
■ URL example:
• The first part indicates how the document is to be accessed
‣ “http” indicates that the document is to be accessed using the Hyper Text Transfer Protocol.
• The second part gives the unique name of a machine on the Internet.
• The rest of the URL identifies the document within the machine.
■ The local identification can be:
‣ The path name of a file on the machine, or
‣ An identifier (path name) of a program, plus arguments to be passed to the program
HTML and HTTP
- HTML provides formatting, hypertext link, and image display features.
- HTML also provides input features
- Select from a set of options
- Pop-up menus, radio buttons, check lists
- Enter values
- Text boxes
- Filled in input sent back to the server, to be acted upon by an executable at the server
- HyperText Transfer Protocol (HTTP) used for communication with the Web server
Sample HTML Source Text
<html> <body>
<table border cols = 3>
<tr> <td> A-101 </td> <td> Downtown </td> <td> 500 </td> </tr>
…
</table>
<center> The <i>account</i> relation </center>
<form action="BankQuery" method=get>
Select account/loan and enter number <br>
<select name="type">
<option value="account" selected> Account
<option> value="Loan"> Loan
</select>
<input type=text size=5 name="number">
<input type=submit value="submit">
</form>
</body> </html>
Display of Sample HTML Source
<table>
<thead>
<tr>
<th>Account</th>
<th>Location</th>
<th>Number</th>
</tr>
</thead>
<tbody>
<tr>
<td>A-101</td>
<td>Downtown</td>
<td>500</td>
</tr>
<tr>
<td>A-102</td>
<td>Perryridge</td>
<td>400</td>
</tr>
<tr>
<td>A-201</td>
<td>Brighton</td>
<td>900</td>
</tr>
</tbody>
</table>
The `account` relation
Select account/loan and enter number
[Account] [ ] [submit]
Client Side Scripting and Applets
- Browsers can fetch certain scripts (client-side scripts) or programs along with documents, and execute them in “safe mode” at the client site
- Javascript
- Macromedia Flash and Shockwave for animation/games
- VRML
- Applets
- Client-side scripts/programs allow documents to be active
- E.g., animation by executing programs at the local site
- E.g. ensure that values entered by users satisfy some correctness checks
- Permit flexible interaction with the user.
- Executing programs at the client site speeds up interaction by avoiding many round trips to server
Client Side Scripting and Security
- Security mechanisms needed to ensure that malicious scripts do not cause damage to the client machine
- Easy for limited capability scripting languages, harder for general purpose programming languages like Java
- E.g. Java’s security system ensures that the Java applet code does not make any system calls directly
- Disallows dangerous actions such as file writes
- Notifies the user about potentially dangerous actions, and allows the option to abort the program or to continue execution.
Web Servers
- A Web server can easily serve as a front end to a variety of information services.
- The document name in a URL may identify an executable program, that, when run, generates a HTML document.
- When a HTTP server receives a request for such a document, it executes the program, and sends back the HTML document that is generated.
- The Web client can pass extra arguments with the name of the document.
- To install a new service on the Web, one simply needs to create and install an executable that provides that service.
- The Web browser provides a graphical user interface to the information service.
- Common Gateway Interface (CGI): a standard interface between web and application server
Three-Tier Web Architecture
Two-Tier Web Architecture
- Multiple levels of indirection have overheads
- Alternative: two-tier architecture
HTTP and Sessions
- The HTTP protocol is connectionless
- That is, once the server replies to a request, the server closes the connection with the client, and forgets all about the request
- In contrast, Unix logins, and JDBC/ODBC connections stay connected until the client disconnects
- retaining user authentication and other information
- Motivation: reduces load on server
- operating systems have tight limits on number of open connections on a machine
- Information services need session information
- E.g. user authentication should be done only once per session
- Solution: use a cookie
Sessions and Cookies
- A cookie is a small piece of text containing identifying information
- Sent by server to browser on first interaction
- Sent by browser to the server that created the cookie on further interactions
- part of the HTTP protocol
- Server saves information about cookies it issued, and can use it when serving a request
- E.g., authentication information, and user preferences
- Cookies can be stored permanently or for a limited time
Servlets
- Java Servlet specification defines an API for communication between the Web server and application program
- E.g. methods to get parameter values and to send HTML text back to client
- Application program (also called a servlet) is loaded into the Web server
- Two-tier model
- Each request spawns a new thread in the Web server
- thread is closed once the request is serviced
- Servlet API provides a getSession() method
- Sets a cookie on first interaction with browser, and uses it to identify session on further interactions
- Provides methods to store and look-up per-session information
- E.g. user name, preferences, ..
Example Servlet Code
Public class BankQuery(Servlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse result) throws ServletException, IOException {
String type = request.getParameter("type");
String number = request.getParameter("number");
...
...code to find the loan amount/account balance ...
...using JDBC to communicate with the database..
...we assume the value is stored in the variable balance
result.setContentType("text/html");
PrintWriter out = result.getWriter();
out.println("<HEAD><TITLE>Query Result</TITLE></HEAD>");
out.println("<BODY>");
out.println("Balance on " + type + number + "=" + balance);
out.println("</BODY>");
out.close();
}
})
Server-Side Scripting
- Server-side scripting simplifies the task of connecting a database to the Web
- Define a HTML document with embedded executable code/SQL queries.
- Input values from HTML forms can be used directly in the embedded code/SQL queries.
- When the document is requested, the Web server executes the embedded code/SQL queries to generate the actual HTML document.
- Numerous server-side scripting languages
- JSP, Server-side Javascript, ColdFusion Markup Language (cfml), PHP, Jscript
- General purpose scripting languages: VBScript, Perl, Python
Improving Web Server Performance
- Performance is an issue for popular Web sites
- May be accessed by millions of users every day, thousands of requests per second at peak time
- Caching techniques used to reduce cost of serving pages by exploiting commonalities between requests
- At the server site:
- Caching of JDBC connections between servlet requests
- Caching results of database queries
- Cached results must be updated if underlying database changes
- Caching of generated HTML
- At the client’s network
- Caching of pages by Web proxy
Triggers
■ A **trigger** is a statement that is executed automatically by the system as a side effect of a modification to the database.
■ To design a trigger mechanism, we must:
● Specify the conditions under which the trigger is to be executed.
● Specify the actions to be taken when the trigger executes.
■ Triggers introduced to SQL standard in SQL:1999, but supported even earlier using non-standard syntax by most databases.
Trigger Example
Suppose that instead of allowing negative account balances, the bank deals with overdrafts by:
- setting the account balance to zero
- creating a loan in the amount of the overdraft
- giving this loan a loan number identical to the account number of the overdrawn account
The condition for executing the trigger is an update to the `account` relation that results in a negative `balance` value.
create trigger overdraft-trigger after update on account referencing new row as nrow for each row
when nrow.balance < 0
begin atomic
insert into borrower
(select customer-name, account-number
from depositor
where nrow.account-number = depositor.account-number);
insert into loan values
(n.row.account-number, nrow.branch-name,
– nrow.balance);
update account set balance = 0
where account.account-number = nrow.account-number
end
Triggering Events and Actions in SQL
- Triggering event can be **insert**, **delete** or **update**
- Triggers on update can be restricted to specific attributes
- E.g. `create trigger overdraft-trigger after update of balance on account`
- Values of attributes before and after an update can be referenced
- referencing old row as : for deletes and updates
- referencing new row as : for inserts and updates
- Triggers can be activated before an event, which can serve as extra constraints. E.g. convert blanks to null.
```sql
create trigger setnull-trigger before update on r
referencing new row as nrow
for each row
when nrow.phone-number = ''
set nrow.phone-number = null
```
Statement Level Triggers
Instead of executing a separate action for each affected row, a single action can be executed for all rows affected by a transaction
- Use **for each statement** instead of **for each row**
- Use **referencing old table** or **referencing new table** to refer to temporary tables (called **transition tables**) containing the affected rows
- Can be more efficient when dealing with SQL statements that update a large number of rows
External World Actions
- We sometimes require external world actions to be triggered on a database update
- E.g. re-ordering an item whose quantity in a warehouse has become small, or turning on an alarm light,
- Triggers cannot be used to directly implement external-world actions, BUT
- Triggers can be used to record actions-to-be-taken in a separate table
- Have an external process that repeatedly scans the table, carries out external-world actions and deletes action from table
- E.g. Suppose a warehouse has the following tables
- inventory (item, level): How much of each item is in the warehouse
- minlevel (item, level): What is the minimum desired level of each item
- reorder (item, amount): What quantity should we re-order at a time
- orders (item, amount): Orders to be placed (read by external process)
create trigger reorder-trigger after update of amount on inventory
referencing old row as orow, new row as nrow
for each row
when nrow.level <= (select level
from minlevel
where minlevel.item = orow.item)
and orow.level > (select level
from minlevel
where minlevel.item = orow.item)
begin
insert into orders
(select item, amount
from reorder
where reorder.item = orow.item)
end
create trigger overdraft-trigger on account
for update
as
if inserted.balance < 0
begin
insert into borrower
(select customer-name, account-number
from depositor, inserted
where inserted.account-number = depositor.account-number)
insert into loan values
(inserted.account-number, inserted.branch-name,
- inserted.balance)
update account set balance = 0
from account, inserted
where account.account-number = inserted.account-number
end
When Not To Use Triggers
- Triggers were used earlier for tasks such as
- maintaining summary data (e.g. total salary of each department)
- Replicating databases by recording changes to special relations (called change or delta relations) and having a separate process that applies the changes over to a replica
- There are better ways of doing these now:
- Databases today provide built-in materialized view facilities to maintain summary data
- Databases provide built-in support for replication
- Encapsulation facilities can be used instead of triggers in many cases
- Define methods to update fields
- Carry out actions as part of the update methods instead of through a trigger
Authorization in SQL (see also Section 4.3)
Forms of authorization on parts of the database:
- **Read authorization** - allows reading, but not modification of data.
- **Insert authorization** - allows insertion of new data, but not modification of existing data.
- **Update authorization** - allows modification, but not deletion of data.
- **Delete authorization** - allows deletion of data.
Authorization (Cont.)
Forms of authorization to modify the database schema:
- **Index authorization** - allows creation and deletion of indices.
- **Resources authorization** - allows creation of new relations.
- **Alteration authorization** - allows addition or deletion of attributes in a relation.
- **Drop authorization** - allows deletion of relations.
Authorization and Views
- Users can be given authorization on views, without being given any authorization on the relations used in the view definition.
- Ability of views to hide data serves both to simplify usage of the system and to enhance security by allowing users access only to data they need for their job.
- A combination or relational-level security and view-level security can be used to limit a user’s access to precisely the data that user needs.
• Suppose a bank clerk needs to know the names of the customers of each branch, but is not authorized to see specific loan information.
● Approach: Deny direct access to the loan relation, but grant access to the view cust-loan, which consists only of the names of customers and the branches at which they have a loan.
● The cust-loan view is defined in SQL as follows:
```sql
CREATE VIEW cust-loan AS
SELECT branchname, customer-name
FROM borrower, loan
WHERE borrower.loan-number = loan.loan-number
```
The clerk is authorized to see the result of the query:
```
select *
from cust-loan
```
When the query processor translates the result into a query on the actual relations in the database, we obtain a query on `borrower` and `loan`.
Authorization must be checked on the clerk’s query before query processing replaces a view by the definition of the view.
Authorization on Views
- Creation of view does not require **resources** authorization since no real relation is being created.
- The creator of a view gets only those privileges that provide no additional authorization beyond that he already had.
- E.g. if creator of view cust-loan had only **read** authorization on borrower and loan, he gets only **read** authorization on cust-loan.
Granting of Privileges
- The passage of authorization from one user to another may be represented by an authorization graph.
- The nodes of this graph are the users.
- The root of the graph is the database administrator.
- Consider graph for update authorization on loan.
- An edge $U_i \rightarrow U_j$ indicates that user $U_i$ has granted update authorization on loan to $U_j$.
Authorization Grant Graph
- **Requirement**: All edges in an authorization graph must be part of some path originating with the database administrator.
- If DBA revokes grant from $U_1$:
- Grant must be revoked from $U_4$ since $U_1$ no longer has authorization.
- Grant must not be revoked from $U_5$ since $U_5$ has another authorization path from DBA through $U_2$.
- Must prevent cycles of grants with no path from the root:
- DBA grants authorization to $U_7$.
- $U_7$ grants authorization to $U_8$.
- $U_8$ grants authorization to $U_7$.
- DBA revokes authorization from $U_7$.
- Must revoke grant $U_7$ to $U_8$ and from $U_8$ to $U_7$ since there is no path from DBA to $U_7$ or to $U_8$ anymore.
Security Specification in SQL
- The grant statement is used to confer authorization
grant <privilege list>
on <relation name or view name> to <user list>
- <user list> is:
- a user-id
- public, which allows all valid users the privilege granted
- A role (more on this later)
- Granting a privilege on a view does not imply granting any privileges on the underlying relations.
- The grantor of the privilege must already hold the privilege on the specified item (or be the database administrator).
Privileges in SQL
- **select**: allows read access to relation, or the ability to query using the view
- Example: grant users $U_1$, $U_2$, and $U_3$ **select** authorization on the `branch` relation:
```sql
grant select on branch to $U_1$, $U_2$, $U_3$
```
- **insert**: the ability to insert tuples
- **update**: the ability to update using the SQL update statement
- **delete**: the ability to delete tuples.
- **references**: ability to declare foreign keys when creating relations.
- **usage**: In SQL-92; authorizes a user to use a specified domain
- **all privileges**: used as a short form for all the allowable privileges
Privilege To Grant Privileges
- **with grant option**: allows a user who is granted a privilege to pass the privilege on to other users.
Example:
```
grant select on branch to U₁ with grant option
```
gives \( U₁ \) the **select** privileges on branch and allows \( U₁ \) to grant this privilege to others
Roles
- Roles permit common privileges for a class of users can be specified just once by creating a corresponding “role”
- Privileges can be granted to or revoked from roles, just like users
- Roles can be assigned to users, and even to other roles
- SQL:1999 supports roles
```sql
create role teller
create role manager
grant select on branch to teller
grant update (balance) on account to teller
grant all privileges on account to manager
grant teller to manager
grant teller to alice, bob
grant manager to avi
```
Revoking Authorization in SQL
- The `revoke` statement is used to revoke authorization.
```sql
revoke <privilege list>
on <relation name or view name> from <user list> [restrict] cascade
```
- Example:
```sql
revoke select on branch from U_1, U_2, U_3 cascade
```
- Revocation of a privilege from a user may cause other users also to lose that privilege; referred to as cascading of the `revoke`.
- We can prevent cascading by specifying `restrict`:
```sql
revoke select on branch from U_1, U_2, U_3 restrict
```
With `restrict`, the `revoke` command fails if cascading revokes are required.
Revoking Authorization in SQL (Cont.)
- `<privilege-list>` may be all to revoke all privileges the revokee may hold.
- If `<revokee-list>` includes `public` all users lose the privilege except those granted it explicitly.
- If the same privilege was granted twice to the same user by different grantees, the user may retain the privilege after the revocation.
- All privileges that depend on the privilege being revoked are also revoked.
Limitations of SQL Authorization
- SQL does not support authorization at a tuple level
- E.g. we cannot restrict students to see only (the tuples storing) their own grades
- With the growth in Web access to databases, database accesses come primarily from application servers.
- End users don't have database user ids, they are all mapped to the same database user id
- All end-users of an application (such as a web application) may be mapped to a single database user
- The task of authorization in above cases falls on the application program, with no support from SQL
- Benefit: fine grained authorizations, such as to individual tuples, can be implemented by the application.
- Drawback: Authorization must be done in application code, and may be dispersed all over an application
- Checking for absence of authorization loopholes becomes very difficult since it requires reading large amounts of application code
Audit Trails
- An audit trail is a log of all changes (inserts/deletes/updates) to the database along with information such as which user performed the change, and when the change was performed.
- Used to track erroneous/fraudulent updates.
- Can be implemented using triggers, but many database systems provide direct support.
Application Security
- Data may be *encrypted* when database authorization provisions do not offer sufficient protection.
- Properties of good encryption technique:
- Relatively simple for authorized users to encrypt and decrypt data.
- Encryption scheme depends not on the secrecy of the algorithm but on the secrecy of a parameter of the algorithm called the encryption key.
- Extremely difficult for an intruder to determine the encryption key.
Data Encryption Standard (DES) substitutes characters and rearranges their order on the basis of an encryption key which is provided to authorized users via a secure mechanism. Scheme is no more secure than the key transmission mechanism since the key has to be shared.
Advanced Encryption Standard (AES) is a new standard replacing DES, and is based on the Rijndael algorithm, but is also dependent on shared secret keys.
Public-key encryption is based on each user having two keys:
- **public key** – publicly published key used to encrypt data, but cannot be used to decrypt data
- **private key** -- key known only to individual user, and used to decrypt data. Need not be transmitted to the site doing encryption.
Encryption scheme is such that it is impossible or extremely hard to decrypt data given only the public key.
The RSA public-key encryption scheme is based on the hardness of factoring a very large number (100's of digits) into its prime components.
Authentication
- Password based authentication is widely used, but is susceptible to sniffing on a network
- **Challenge-response** systems avoid transmission of passwords
- DB sends a (randomly generated) challenge string to user
- User encrypts string and returns result.
- DB verifies identity by decrypting result
- Can use public-key encryption system by DB sending a message encrypted using user’s public key, and user decrypting and sending the message back
- **Digital signatures** are used to verify authenticity of data
- E.g. use private key (in reverse) to encrypt data, and anyone can verify authenticity by using public key (in reverse) to decrypt data. Only holder of private key could have created the encrypted data.
- Digital signatures also help ensure **nonrepudiation**: sender cannot later claim to have not created the data
Digital Certificates
- Digital certificates are used to verify authenticity of public keys.
- Problem: when you communicate with a web site, how do you know if you are talking with the genuine web site or an imposter?
- Solution: use the public key of the web site
- Problem: how to verify if the public key itself is genuine?
- Solution:
- Every client (e.g. browser) has public keys of a few root-level certification authorities
- A site can get its name/URL and public key signed by a certification authority: signed document is called a certificate
- Client can use public key of certification authority to verify certificate
- Multiple levels of certification authorities can exist. Each certification authority
- presents its own public-key certificate signed by a higher level authority, and
- Uses its private key to sign the certificate of other web sites/authorities
End of Chapter
|
{"Source-Url": "https://www.cse.iitb.ac.in/~sudarsha/db-book/slide-dir/ch8.pdf", "len_cl100k_base": 5977, "olmocr-version": "0.1.53", "pdf-total-pages": 52, "total-fallback-pages": 0, "total-input-tokens": 84327, "total-output-tokens": 7874, "length": "2e12", "weborganizer": {"__label__adult": 0.00024235248565673828, "__label__art_design": 0.00021266937255859375, "__label__crime_law": 0.0002732276916503906, "__label__education_jobs": 0.0012407302856445312, "__label__entertainment": 3.784894943237305e-05, "__label__fashion_beauty": 8.481740951538086e-05, "__label__finance_business": 0.0005736351013183594, "__label__food_dining": 0.0001951456069946289, "__label__games": 0.0002551078796386719, "__label__hardware": 0.0006899833679199219, "__label__health": 0.00018274784088134768, "__label__history": 0.0001329183578491211, "__label__home_hobbies": 6.157159805297852e-05, "__label__industrial": 0.00031280517578125, "__label__literature": 0.00013959407806396484, "__label__politics": 0.0001125335693359375, "__label__religion": 0.00023305416107177737, "__label__science_tech": 0.00417327880859375, "__label__social_life": 5.424022674560547e-05, "__label__software": 0.0102691650390625, "__label__software_dev": 0.97998046875, "__label__sports_fitness": 0.00012117624282836914, "__label__transportation": 0.00027680397033691406, "__label__travel": 0.0001289844512939453}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 26296, 0.0064]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 26296, 0.45831]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 26296, 0.83528]], "google_gemma-3-12b-it_contains_pii": [[0, 46, false], [46, 280, null], [280, 630, null], [630, 1059, null], [1059, 1663, null], [1663, 2103, null], [2103, 2687, null], [2687, 3405, null], [3405, 3815, null], [3815, 4301, null], [4301, 4583, null], [4583, 5203, null], [5203, 5740, null], [5740, 6458, null], [6458, 6486, null], [6486, 6600, null], [6600, 7213, null], [7213, 7682, null], [7682, 8339, null], [8339, 9093, null], [9093, 9671, null], [9671, 10245, null], [10245, 10683, null], [10683, 11096, null], [11096, 11565, null], [11565, 12272, null], [12272, 12731, null], [12731, 13568, null], [13568, 13990, null], [13990, 14469, null], [14469, 15168, null], [15168, 15564, null], [15564, 15924, null], [15924, 16386, null], [16386, 16910, null], [16910, 17268, null], [17268, 17657, null], [17657, 18039, null], [18039, 18760, null], [18760, 19274, null], [19274, 19926, null], [19926, 20248, null], [20248, 20771, null], [20771, 21393, null], [21393, 21832, null], [21832, 22762, null], [22762, 23091, null], [23091, 23547, null], [23547, 24520, null], [24520, 25382, null], [25382, 26282, null], [26282, 26296, null]], "google_gemma-3-12b-it_is_public_document": [[0, 46, true], [46, 280, null], [280, 630, null], [630, 1059, null], [1059, 1663, null], [1663, 2103, null], [2103, 2687, null], [2687, 3405, null], [3405, 3815, null], [3815, 4301, null], [4301, 4583, null], [4583, 5203, null], [5203, 5740, null], [5740, 6458, null], [6458, 6486, null], [6486, 6600, null], [6600, 7213, null], [7213, 7682, null], [7682, 8339, null], [8339, 9093, null], [9093, 9671, null], [9671, 10245, null], [10245, 10683, null], [10683, 11096, null], [11096, 11565, null], [11565, 12272, null], [12272, 12731, null], [12731, 13568, null], [13568, 13990, null], [13990, 14469, null], [14469, 15168, null], [15168, 15564, null], [15564, 15924, null], [15924, 16386, null], [16386, 16910, null], [16910, 17268, null], [17268, 17657, null], [17657, 18039, null], [18039, 18760, null], [18760, 19274, null], [19274, 19926, null], [19926, 20248, null], [20248, 20771, null], [20771, 21393, null], [21393, 21832, null], [21832, 22762, null], [22762, 23091, null], [23091, 23547, null], [23547, 24520, null], [24520, 25382, null], [25382, 26282, null], [26282, 26296, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, false], [5000, 26296, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 26296, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 26296, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 26296, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 26296, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 26296, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 26296, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 26296, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 26296, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 26296, null]], "pdf_page_numbers": [[0, 46, 1], [46, 280, 2], [280, 630, 3], [630, 1059, 4], [1059, 1663, 5], [1663, 2103, 6], [2103, 2687, 7], [2687, 3405, 8], [3405, 3815, 9], [3815, 4301, 10], [4301, 4583, 11], [4583, 5203, 12], [5203, 5740, 13], [5740, 6458, 14], [6458, 6486, 15], [6486, 6600, 16], [6600, 7213, 17], [7213, 7682, 18], [7682, 8339, 19], [8339, 9093, 20], [9093, 9671, 21], [9671, 10245, 22], [10245, 10683, 23], [10683, 11096, 24], [11096, 11565, 25], [11565, 12272, 26], [12272, 12731, 27], [12731, 13568, 28], [13568, 13990, 29], [13990, 14469, 30], [14469, 15168, 31], [15168, 15564, 32], [15564, 15924, 33], [15924, 16386, 34], [16386, 16910, 35], [16910, 17268, 36], [17268, 17657, 37], [17657, 18039, 38], [18039, 18760, 39], [18760, 19274, 40], [19274, 19926, 41], [19926, 20248, 42], [20248, 20771, 43], [20771, 21393, 44], [21393, 21832, 45], [21832, 22762, 46], [22762, 23091, 47], [23091, 23547, 48], [23547, 24520, 49], [24520, 25382, 50], [25382, 26282, 51], [26282, 26296, 52]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 26296, 0.0282]]}
|
olmocr_science_pdfs
|
2024-12-11
|
2024-12-11
|
8c2860cc2f8b0c5d5a6cbe9549769c71ee07d044
|
Reasoning About a Simulated Printer Case
Investigation with Forensic Lucid
Serguei A. Mokhov Joey Paquet Mourad Debbabi
Department of Computer Science and Software Engineering
Faculty of Engineering and Computer Science
Concordia University, Montréal, Québec, Canada,
{mokhov,paquet,debbabi}@encs.concordia.ca
ICDF2C 2011, Dublin, Ireland
1 presented on behalf of the authors by Andrei Soeanu
Introduction
The Problem
Overview
Outline
Introduction
The Problem
Overview
Background
Intensional Cyberforensics
Lucid
Forensic Lucid
Higher Order Context
Outline
Introduction
The Problem
Overview
Background
Intensional Cyberforensics
Lucid
Forensic Lucid
Higher Order Context
Sample Case
ACME Manufacturing Printing Case
Gladyshev’s Printer Case State Machine
Case Specification in Forensic Lucid
Outline
Introduction
The Problem
Overview
Background
Intensional Cyberforensics
Lucid
Forensic Lucid
Higher Order Context
Sample Case
ACME Manufacturing Printing Case
Gladyshev’s Printer Case State Machine
Case Specification in Forensic Lucid
Conclusion
The first formal approach for cyberforensic analysis and event reconstruction appeared in two papers [GP04, Gla05] by Gladyshev et al. that relies on the finite-state automata (FSA) and their transformation and operation to model evidence, witnesses, stories told by witnesses, and their possible evaluation.
One of the examples the papers present is the use-case for the proposed technique – the ACME Printer Case Investigation. See [GP04] for the formalization using FSA by Gladyshev and the corresponding LISP implementation.
We aim at the same case to model and implement it using the new approach, which paves a way to be more friendly and usable in the actual investigator’s work and serve as a basis to further development in the area.
In this work we model the ACME (a fictitious company name) printer case incident and make its specification in Forensic Lucid, a Lucid- and intensional-logic-based programming language for cyberforensic analysis and event reconstruction specification.
The printer case involves a dispute between two parties that was previously solved using the finite-state automata (FSA) approach, and is now re-done in a more usable way in Forensic Lucid.
Our simulation is based on the said case modeling by encoding concepts like evidence and the related witness accounts as an evidential statement context in a Forensic Lucid program, which is an input to the transition function that models the possible deductions in the case. We then invoke the transition function (actually its reverse) with the evidential statement context to see if the evidence we encoded agrees with one’s claims and then attempt to reconstruct the sequence of events that may explain the claim or disprove it.
Intensional Cyberforensics I
- Intensional Cyberforensics project
- Cyberforensics
- Case modeling and analysis
- Event reconstruction
- Language and Programming Environment
- Forensic Lucid – functional intensional forensic case programming and specification language, covering:
- Syntax
- Semantics
- Compiler
- Run-time System
- General Intensional Programming System (GIPSY)
Intensional Cyberforensics II
- Operational aspects:
- Operators
- Operational Semantics
- Based on:
- Lucid
- Higher-Order Intensional Logic (HOIL)
- Intensional Programming
Lucid I
- Lucid [WA85, AFJW95, AW77b, AW76, AW77a] is a dataflow intensional and functional programming language.
- In fact, it is a family of languages that are built upon intensional logic (which in turn can be understood as a multidimensional generalization of temporal logic) involving context and demand-driven parallel computation model.
- A program written in some Lucid dialect is an expression that may have subexpressions that need to be evaluated at certain context.
Given the set of dimension $D = \{dim_i\}$ in which an expression varies, and a corresponding set of indexes or tags defined as placeholders over each dimension, the context is represented as a set of $<dim_i: tag_i>$ mappings and each variable in Lucid, called often a stream, is evaluated in that defined context that may also evolve using context operators [PMT08, Ton08, WAP05, Wan06].
The generic version of Lucid, GIPL [Paq99], defines two basic operators @ and # to navigate in the contexts (switch and query).
The GIPL was the first generic programming language of all intensional languages, defined by the means of only two intensional operators @ and #.
Lucid III
- It has been proven that other intensional programming languages of the Lucid family can be translated into the GIPL [Paq99].
- Since the Lucid family of language thrived around intensional logic that makes the notion of context explicit and central, and recently, a first class value [WAP05, Wan06, PMT08, Ton08] that can be passed around as function parameters or as return values and have a set of operators defined upon.
- We greatly draw on this notion by formalizing our evidence and the stories as a contextual specification of the incident to be tested for consistency against the incident model specification.
In our specification model we require more than just atomic context values – we need a higher-order context hierarchy to specify different level of detail of the incident and being able to navigate into the “depth” of such a context.
A similar provision by has already been made by the author [Mok08] and earlier works of Swoboda et al. in [Swo04, SW00, SP04b, SP04a] that needs some modifications to the expressions of the cyberforensic context.
Some other languages can be referred to as intensional even though they may not refer to themselves as such, and were born after Lucid (Lucid began in 1974).
Examples include hardware-description languages (HDLs, appeared in 1977) where the notion of time (often the only “dimension”, and usually progresses only forward), e.g. Verilog and VHDL.
Another branch of newer languages for the becoming popular is aspect-oriented programming (AOP) languages, that can have a notion of context explicitly, but primarily focused on software engineering aspect of software evolution and maintainability.
Forensic Lucid I
- A summary of the concepts and considerations in the design of the Forensic Lucid language, large portions of which were studied in the earlier work [MP08, MPD08].
- The end goal of the language design is to define its constructs to concisely express cyberforensic evidence as context of evaluations, which can be initial state of the case towards what we have actually observed (as corresponding to the final state in the Gladyshev’s FSM).
- One of the evaluation engines (a topic of another paper) of the implementing system [The12] is designed to backtrace intermediate results to provide the corresponding event reconstruction path if it exists.
The result of the expression in its basic form is either *true* or *false*, i.e. “guilty” or “not guilty” given the evidential evaluation context per explanation with the backtrace(s).
There can be multiple backtraces, that correspond to the explanation of the evidence (or lack thereof).
Gladyshev’s Meaning and Explanation Hierarchy
Higher Order Context
- HOCs represent essentially nested contexts, modeling evidential statement for forensic specification evaluation.
- Such a context representation can be modeled as a tree in an OO ontology or a context set.
Figure: Nested Context Hierarchy Example for Digital Investigation
This is one of the cases we re-examine from the Gladyshev’s FSA approach [GP04].
- The local area network at some company called ACME Manufacturing consists of two personal computers and a networked printer.
- The cost of running the network is shared by its two users Alice (A) and Bob (B).
- Alice, however, claims that she never uses the printer and should not be paying for the printer consumables.
- Bob disagrees, he says that he saw Alice collecting printouts.
- According to the manufacturer, the printer works as follows:
ACME Manufacturing Printing Case II
1. When a print job is received from the user, it is stored in the first unallocated directory entry of the print job directory.
2. The printing mechanism scans the print job directory from the beginning and picks the first active job.
3. After the job is printed, the corresponding directory entry is marked as “deleted”, but the name of the job owner is preserved.
4. The printer can accept only one print job from each user at a time.
5. Initially, all directory entries are empty.
ACME Manufacturing Printing Case III
The investigator finds the current state of the printer’s buffer as:
1. Job From B Deleted
2. Job From B Deleted
3. Empty
4. Empty
5. ...
Gladyshev’s Printer Case State Machine
Paths Leading to \((B_{\text{Deleted}}, B_{\text{Deleted}})\)
alice_claim @ es
where
evidential statement es = [ printer, manuf, alice ];
observation sequence printer = F;
observation sequence manuf = [ Oempty, $ ];
observation sequence alice = [ Oalice, F ];
observation F = ( ‘ ‘ B_deleted ’ ’ , 1, 0 );
observation Oalice = ( P_alice , 0, +inf );
observation Oempty = ( ‘ ‘ empty ’ ’ , 1, 0 );
// No ‘ ‘add_A’ ’
P_alice = unordered { ‘ ‘add_B’ ’ , ‘ ‘ take ’ ’ };
invpsiacme(F, es);
end;
Listing 1: Developing the Pinter Case Example 3
Transition Function” $\psi$ in Forensic Lucid
```
acmepsi(c, s, d) =
// Add a print job from Alice
if c == "add_A" then
if d1 == "A" || d2 == "A" then s;
else
if d1 in S then "A" fby.d d2;
else
if d2 in S then d1 fby.d "A";
else s;
// Add a print job from Bob
else if c == "add_B" then
if d1 == "B" || d2 == "B" then s;
else
if d1 in S then "B" fby.d d2;
else
if d2 in S then d1 fby.d "B";
else s;
// Printer takes the job per manufacturer specification
else if c == "take" then
if d1 == "A" then "A_deleted" fby.d d2;
else
if d1 == "B" then "B" fby.d d2;
else
if d2 == "A" then d1 fby.d "A_deleted";
else
if d2 == "B" then d1 fby.d "B_deleted";
end;
// Done
else s fby.d cod;
where
dimension d;
S = ["empty", "A_deleted", "B_deleted"];
d1 = first.d s;
d2 = next.d d1;
end;
```
Listing 1.5. “Transition Function” $\psi$ in Forensic Lucid for the ACME Printing Case
Inverse Transition Function $\psi^{-1}$ in Forensic Lucid
```plaintext
inverse($s$, $d$) = backtraces
where
backtraces = [A, B, C, D, E, F, G, H, I, J, K, L, M];
A = if $d1$ == "A\_deleted"
then $d2$ phy.d "A" phy.d "take" else end;
B = if $d1$ == "B\_deleted"
then $d2$ phy.d "B" phy.d "take" else end;
C = if $d2$ == "A\_deleted" && $d1$ == "A" && $d2$ == "B"
then $d1$ phy.d "A" phy.d "take" else end;
D = if $d2$ == "B\_deleted" && $d1$ == "A" && $d2$ == "B"
then $d1$ phy.d "B" phy.d "take" else end;
E = if $d1$ in S && $d2$ in S
then $s$ phy.d "take" else end;
F = if $d1$ == "A" && $d2$ == "A"
then
$d2$ phy.d "empty" phy.d "add_A",
$d2$ phy.d "A\_deleted" phy.d "add_A",
$d2$ phy.d "B\_deleted" phy.d "add_A"
else end;
G = if $d1$ == "B" && $d2$ == "B"
then
$d2$ phy.d "empty" phy.d "add_B",
$d2$ phy.d "A\_deleted" phy.d "add_B",
$d2$ phy.d "B\_deleted" phy.d "add_B"
else end;
H = if $d1$ == "B" && $d2$ == "A"
then
$d1$ phy.d "empty" phy.d "add_A",
$d1$ phy.d "A\_deleted" phy.d "add_A",
$d1$ phy.d "B\_deleted" phy.d "add_A"
else end;
I = if $d1$ == "A" && $d2$ == "B"
then
$d1$ phy.d "empty" phy.d "add_B",
$d1$ phy.d "A\_deleted" phy.d "add_B",
$d1$ phy.d "B\_deleted" phy.d "add_B"
else end;
J = if $d1$ == "A" && $d2$ == "A"
then $s$ phy.d "add_A" else end;
K = if $d1$ == "A" && $d2$ == "A"
then $s$ phy.d "add_B" else end;
L = if $d1$ == "B" && $d2$ == "A"
then $s$ phy.d "add_A" else end;
M = if $d1$ == "B" && $d2$ == "B"
then $s$ phy.d "add_B" else end;
where
dimension $d$;
S = ["empty", "A\_deleted", "B\_deleted"];
$d1$ = first.d $s$;
$d2$ = next.d $d1$;
end;
```
Listing 1.6. "Inverse Transition Function" $\psi^{-1}$ in Forensic Lucid for the ACME Manufacturing Printing Case.
Serguei A. Mokhov, Joey Paquet, Mourad Debbabi
Reasoning with Forensic Lucid in a Printer Case
We presented the basic overview of Forensic Lucid, its concepts, ideas, and dedicated purpose – to model, specify, and evaluate digital forensics cases.
The process of doing so is significantly simpler and more manageable than the previously proposed FSM model and its common LISP realization. At the same time, the language is founded in more than 30 years research on correctness and soundness of programs and the corresponding mathematical foundations of the Lucid language, which is a significant factor should a Forensic Lucid-based analysis be presented in court.
We re-wrote in Forensic Lucid one of the sample cases initial modeled by Gladyshev in the FSM and Common LISP to show the specification is indeed more manageable and comprehensible than the original and fits in two pages in this paper.
We also still realize by looking at the examples the usability aspect is still desired to be improved further for the investigators, especially when modeling $\psi$ and $\psi^{-1}$, as a potential limitation, prompting one of the future work items to address it further.
In general, the proposed practical approach in the cyberforensics field can also be used to model and evaluate normal investigation process involving crimes not necessarily associated with information technology.
Combined with an expert system (e.g. implemented in CLIPS [Ril09]), it can also be used in training new staff in investigation techniques. The notion of hierarchical contexts as first-class values brings more understanding of the process to the investigators in cybercrime case management tools.
Future Work
- Formally prove equivalence to the FSA approach.
- Adapt/re-implement a graphical UI based on the data-flow graph tool [Din04, MPD11] to simplify Forensic Lucid programming further for not very tech-savvy investigators by making it visual. The listings provided are not very difficult to read and quite manageable to comprehend, but any visual aid is always an improvement.
- Refine the semantics of Lucx’s context sets and their operators to be more sound, including Box and Range.
- Explore and exploit the notion of credibility factors of the evidence and witnesses fully.
- Release a full standard Forensic Lucid specification.
We augment the notion of observation to be formalized as:
\[ o = (P, \text{min}, \text{max}, w, t) \] \hspace{1cm} (1)
with the \( w \) being the credibility or trustworthiness weight of that observation, and the \( t \) being an optional wall-clock timestamp. With \( w = 1 \) the \( o \) would be equivalent to the original model proposed by Gladyshev.
We define the total credibility of an observation sequence as an average of all the weights in this observation sequence.
\[ W_{\text{naive}} = \frac{\sum(w_i)}{n} \] \hspace{1cm} (2)
A less naive way of calculating weights is using some pre-existing functions. What comes to mind is the activation functions used in artificial neural networks (ANNs), e.g.
\[ W_{ANN} = \sum \frac{1}{1 + e^{-nw_i}} \] (3)
The witness stories or evidence with higher scores of \( W \) have higher credibility. With lower scores therefore less credibility and more tainted evidence.
This research work was funded by NSERC and the Faculty of Engineering and Computer Science of Concordia University, Montreal, Canada.
We would also like to acknowledge the reviewers who took time to do a constructive quality review of this work.
Thanks to Andrei Soeanu for the last minute accommodation to be able to present this work at ICDF2C 2011 in Dublin, on behalf of the authors.
References I
*Multidimensional Programming.*
Edward A. Ashcroft and William W. Wadge.
Lucid – a formal system for writing and proving programs.
Edward A. Ashcroft and William W. Wadge.
Erratum: Lucid – a formal system for writing and proving programs.
Edward A. Ashcroft and William W. Wadge.
Lucid, a nonprocedural language with iteration.
Yimin Ding.
Automated translation between graphical and textual representations of intensional programs in the GIPSY.
Master’s thesis, Department of Computer Science and Software Engineering, Concordia University, Montreal, Canada, June 2004.
Pavel Gladyshev.
Finite state machine analysis of a blackmail investigation.
References III
Pavel Gladyshev and Ahmed Patel.
Finite state machine approach to digital event reconstruction.
Serguei A. Mokhov.
Towards syntax and semantics of hierarchical contexts in multimedia processing applications using MARFL.
Serguei A. Mokhov and Joey Paquet.
Formally specifying and proving operational aspects of Forensic Lucid in Isabelle.
Technical Report 2008-1-Ait Mohamed, Department of Electrical and Computer Engineering, Concordia University, Montreal, Canada, August 2008.
Serguei A. Mokhov, Joey Paquet, and Mourad Debbabi.
Formally specifying operational semantics and language constructs of Forensic Lucid.
In Oliver Göbel, Sandra Frings, Detlef Günther, Jens Nedon, and Dirk Schadt, editors, Proceedings of the IT Incident Management and IT Forensics (IMF’08), LNI140, pages 197–216. GI, September 2008.
Serguei A. Mokhov, Joey Paquet, and Mourad Debbabi.
On the need for data flow graph visualization of Forensic Lucid programs and forensic evidence, and their evaluation by GIPSY.
Short paper; full version online at http://arxiv.org/abs/1009.5423.
Joey Paquet.
Scientific Intensional Programming.
Joey Paquet, Serguei A. Mokhov, and Xin Tong.
Design and implementation of context calculus in the GIPSY environment.
Gary Riley.
CLIPS: A tool for building expert systems.
Paul Swoboda and John Plaice.
An active functional intensional database.
LNCS 3180.
Paul Swoboda and John Plaice.
A new approach to distributed context-aware computing.
References VIII
Paul Swoboda and William W. Wadge.
Vmake, ISE, and IRCS: General tools for the intensionalization of software systems.
Paul Swoboda.
*A Formalisation and Implementation of Distributed Intensional Programming*.
The GIPSY Research and Development Group.
The General Intensional Programming System (GIPSY) project.
Department of Computer Science and Software Engineering, Concordia University, Montreal, Canada, 2002–2012.
Xin Tong.
Design and implementation of context calculus in the GIPSY.
Master’s thesis, Department of Computer Science and Software Engineering, Concordia University, Montreal, Canada, April 2008.
William W. Wadge and Edward A. Ashcroft.
*Lucid, the Dataflow Programming Language.*
Kaiyu Wan.
*Lucx: Lucid Enriched with Context.*
PhD thesis, Department of Computer Science and Software Engineering, Concordia University, Montreal, Canada, 2006.
Kaiyu Wan, Vasu Alagar, and Joey Paquet.
Lucx: Lucid enriched with context.
|
{"Source-Url": "https://spectrum.library.concordia.ca/973949/4/flucid-printer-case-presentation.pdf", "len_cl100k_base": 4901, "olmocr-version": "0.1.53", "pdf-total-pages": 46, "total-fallback-pages": 0, "total-input-tokens": 65519, "total-output-tokens": 7408, "length": "2e12", "weborganizer": {"__label__adult": 0.0011091232299804688, "__label__art_design": 0.0008091926574707031, "__label__crime_law": 0.018798828125, "__label__education_jobs": 0.001956939697265625, "__label__entertainment": 0.00020599365234375, "__label__fashion_beauty": 0.0004076957702636719, "__label__finance_business": 0.0003905296325683594, "__label__food_dining": 0.0007143020629882812, "__label__games": 0.0012598037719726562, "__label__hardware": 0.0023479461669921875, "__label__health": 0.0015897750854492188, "__label__history": 0.0005445480346679688, "__label__home_hobbies": 0.00019931793212890625, "__label__industrial": 0.00116729736328125, "__label__literature": 0.001033782958984375, "__label__politics": 0.0010538101196289062, "__label__religion": 0.0007467269897460938, "__label__science_tech": 0.10614013671875, "__label__social_life": 0.0002677440643310547, "__label__software": 0.0129241943359375, "__label__software_dev": 0.84423828125, "__label__sports_fitness": 0.0004987716674804688, "__label__transportation": 0.0011386871337890625, "__label__travel": 0.0002428293228149414}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 20935, 0.02343]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 20935, 0.31781]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 20935, 0.85213]], "google_gemma-3-12b-it_contains_pii": [[0, 399, false], [399, 435, null], [435, 559, null], [559, 841, null], [841, 1126, null], [1126, 1656, null], [1656, 1870, null], [1870, 2313, null], [2313, 2846, null], [2846, 3244, null], [3244, 3431, null], [3431, 3910, null], [3910, 4576, null], [4576, 5207, null], [5207, 5814, null], [5814, 6252, null], [6252, 6921, null], [6921, 7211, null], [7211, 7257, null], [7257, 7487, null], [7487, 7554, null], [7554, 8086, null], [8086, 8608, null], [8608, 8786, null], [8786, 8825, null], [8825, 8887, null], [8887, 9369, null], [9369, 10389, null], [10389, 12384, null], [12384, 12955, null], [12955, 13463, null], [13463, 13973, null], [13973, 14619, null], [14619, 15164, null], [15164, 15547, null], [15547, 15937, null], [15937, 16416, null], [16416, 17035, null], [17035, 17496, null], [17496, 18176, null], [18176, 18724, null], [18724, 19161, null], [19161, 19554, null], [19554, 19957, null], [19957, 20546, null], [20546, 20935, null]], "google_gemma-3-12b-it_is_public_document": [[0, 399, true], [399, 435, null], [435, 559, null], [559, 841, null], [841, 1126, null], [1126, 1656, null], [1656, 1870, null], [1870, 2313, null], [2313, 2846, null], [2846, 3244, null], [3244, 3431, null], [3431, 3910, null], [3910, 4576, null], [4576, 5207, null], [5207, 5814, null], [5814, 6252, null], [6252, 6921, null], [6921, 7211, null], [7211, 7257, null], [7257, 7487, null], [7487, 7554, null], [7554, 8086, null], [8086, 8608, null], [8608, 8786, null], [8786, 8825, null], [8825, 8887, null], [8887, 9369, null], [9369, 10389, null], [10389, 12384, null], [12384, 12955, null], [12955, 13463, null], [13463, 13973, null], [13973, 14619, null], [14619, 15164, null], [15164, 15547, null], [15547, 15937, null], [15937, 16416, null], [16416, 17035, null], [17035, 17496, null], [17496, 18176, null], [18176, 18724, null], [18724, 19161, null], [19161, 19554, null], [19554, 19957, null], [19957, 20546, null], [20546, 20935, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 20935, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 20935, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 20935, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 20935, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 20935, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 20935, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 20935, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 20935, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 20935, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 20935, null]], "pdf_page_numbers": [[0, 399, 1], [399, 435, 2], [435, 559, 3], [559, 841, 4], [841, 1126, 5], [1126, 1656, 6], [1656, 1870, 7], [1870, 2313, 8], [2313, 2846, 9], [2846, 3244, 10], [3244, 3431, 11], [3431, 3910, 12], [3910, 4576, 13], [4576, 5207, 14], [5207, 5814, 15], [5814, 6252, 16], [6252, 6921, 17], [6921, 7211, 18], [7211, 7257, 19], [7257, 7487, 20], [7487, 7554, 21], [7554, 8086, 22], [8086, 8608, 23], [8608, 8786, 24], [8786, 8825, 25], [8825, 8887, 26], [8887, 9369, 27], [9369, 10389, 28], [10389, 12384, 29], [12384, 12955, 30], [12955, 13463, 31], [13463, 13973, 32], [13973, 14619, 33], [14619, 15164, 34], [15164, 15547, 35], [15547, 15937, 36], [15937, 16416, 37], [16416, 17035, 38], [17035, 17496, 39], [17496, 18176, 40], [18176, 18724, 41], [18724, 19161, 42], [19161, 19554, 43], [19554, 19957, 44], [19957, 20546, 45], [20546, 20935, 46]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 20935, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-06
|
2024-12-06
|
4fd54e4b7e5d7af28ae9102e4e4c52e421804d9d
|
Abstract
Truth maintenance systems provide caches of beliefs and inferences that support explanations and search. Traditionally, the cost of using a TMS is monotonic growth in the size of this cache. In some applications this cost is too high; for example, intelligent learning environments may require students to explore many alternatives, which leads to unacceptable performance. This paper describes an algorithm for fact garbage collection that retains the explanation-generating capabilities of a TMS while eliminating the increased storage overhead. We describe the application context that motivated this work and the properties of applications that benefit from this technique. We present the algorithm, showing how to balance the tradeoff between maintaining a useful cache and reclaiming storage, and analyze its complexity. We demonstrate that this algorithm can eliminate monotonic storage growth, thus making it more practical to field large-scale TMS-based systems.
1. Introduction
Over the past two decades basic research in Artificial Intelligence has resulted in an extraordinary wealth of enabling technologies. How these technologies will scale to address real-world problems has recently become an important new frontier for AI research. Truth maintenance systems (TMSs) [McAllester, 1978;1990], [Doyle, 1979], [McDermott, 1991] in particular hold out the promise of enabling the development of articulate and responsive environments for supporting people in learning, evaluating information, and making complex decisions.
TMSs provide valuable explanatory services to automated reasoners. However, this ability comes at the price of a monotonic increase in the size of the dependency network as new assumptions are added. We have found that this memory demand characteristic can result in performance degradation and even software crashes in fielded applications, when the dependency network expands to fill available memory. This was obviously possible in principle, but we were (unpleasantly) surprised at how quickly it could happen. In one fielded application (described below), the time taken to revise an assumption increased from less than a second for the first change to almost 15 seconds by the thirtieth change, and the application crashed on the forty-eighth. Such times are unacceptable for an intelligent learning environment where rapid response to changing assumptions is essential. While TMSs have been successfully applied to real problems (particularly in diagnosis), we suspect that this problem is preventing more widespread use of TMSs in large-scale applications.
Our solution to this problem is to take the metaphor of a TMS as a cache of inferences more seriously. Caches have update strategies that remove information unlikely to be useful in the future. TMSs already do this partially, by retracting beliefs in response to retracted assumptions. We make the stronger claim, that for many practical applications, it is critical to reduce the size of the dependency network itself in response to changing information. The key idea is to identify a class of facts that are (a) unlikely to be needed again once retracted and (b) almost as easy to rederive via running rules as they would via TMS operations. Deleting such facts and the clauses involving them will eliminate the storage cost associated with parts of the dependency network that are likely to be irrelevant. In essence, the TMS includes a fact garbage collector that implements an update strategy for the TMS, viewed as a cache for inferences.
Section 2 begins by describing the motivating application context. Section 3 describes the algorithm in detail. Section 4 analyzes the algorithm’s complexity and illustrates its performance empirically. Section 5 discusses related work, and Section 6 summarizes our results and points out avenues of future investigation.
2. The Problem
Intelligent learning environments (ILEs) are a class of applications that make extensive use of the explanatory capabilities of truth maintenance systems. The CyclePad system [Forbus and Whalley, 1994] is an example of an ILE for engineering thermodynamics. CyclePad can be thought of as a conceptual CAD system, handling the mechanics of solving equations so that students can focus on the thermodynamic behavior of a design. CyclePad utilizes qualitative physics to provide explanations that are grounded in natural, qualitative terms. To provide these services, CyclePad uses a customized version of the LTRE, a forward-chaining, pattern-directed inference system described in [Forbus and de Kleer, 1993], which contains a Logic-based truth maintenance system (LTMS) [McAllester, 1978]. All derivations are stored in the
LTMS, and the dependency network so formed provides the grist for a generative hypertext explanation system that lets students explore the consequences of their assumptions.
CyclePad is designed to shift the focus of the student from solving equations to developing better intuitions about thermodynamics. This requires that students explore the consequences of parametric changes to cycles they have designed, often via sensitivity analyses. As a consequence, the underlying LTRE may be called upon to make dozens or even hundreds of changes to assumptions involving numerical values during a typical student session. Each of these changes can have extensive consequences; the analysis of a complex cycle might require between 10 and 30 assumptions, which result in the derivation of hundreds of additional numerical values.
The large number of assume/retract cycles and the potentially large number of consequences affected by each cycle means that the cost of this operation dominates CyclePad’s performance. Observations of CyclePad in typical conditions suggest that the amount of memory consumed rises linearly with the number of assume/retract cycles, while the time taken for each cycle rises nonlinearly. There are two sources for the non-linear time increase: (1) there are more clauses to process on each iteration, because the dependency network has grown, and (2) as storage space begins to run out, the Lisp garbage collector and the virtual memory system require a much larger fraction of the total time.
3. Fact Garbage Collection
Our solution to this problem is to designate certain classes of facts as eligible for deletion when they become unknown. We preserve the integrity of the dependency network for producing explanations of current beliefs at the cost of greater reliance on the inference engine to rederive facts. This solution makes sense when one can identify classes of facts in which (1) it is unlikely that a particular fact will be believed again once it is retracted and (2) the cost of rederivation is small. Numerical assumptions in CyclePad fit both of these criteria. Using a fact garbage collector and designating statements of numerical values as collectible results in a significant improvement in CyclePad’s performance. Empirically, we have assumed and retracted 1000 consecutive values at an average time per assumption/retraction cycle of 3.1 seconds. In contrast, CyclePad with the conventional LTRE on the same example exhausted a 32MB memory space at 48 changes, at which point the average retraction was requiring 46 seconds.
The rest of this section describes the fact garbage collection algorithm, and a particular implementation of it, GC-LTRE. We begin with a brief overview of some relevant LTMS and LTRE concepts, and then describe the fact garbage collection algorithm in detail.
3.1 Overview of LTMS/LTRE
Like all TMSs, the LTMS consists of nodes and clauses, where nodes correspond to facts and clauses enforce belief relationships among those facts. The LTMS encodes clauses in disjunctive normal form. Although this encoding enables clauses to operate in all directions (i.e., not just from antecedent to consequent), any particular use of them in a derivation does identify a set of antecedents and a particular conclusion. Relationships between beliefs are maintained via Boolean constraint propagation (BCP).
The LTRE is a forward-chaining, pattern-directed rule system that uses the LTMS to maintain a database of facts related to one another via logical dependencies. Facts are assigned truth values, which may be true, false, or unknown, according to the label of the corresponding LTMS node. LTRE rules consist of a list of triggers and a body. Each trigger consists of a truth condition and a pattern. The body of a rule is executed for each combination of facts which both match the trigger patterns and whose truth values simultaneously satisfy the truth conditions of the triggers. Once their trigger conditions are satisfied, rules are exhaustively executed in an arbitrary order. The LTMS caches partially executed rules on the node of the trigger fact that failed to match its truth condition, and signals the inference engine to re-queue these rules when that node’s label changes appropriately.
Rule bodies interact with the LTMS by asserting new facts and logical relations, which in turn cause the LTMS to add corresponding nodes and clauses to its database. Changes in a fact’s label are thus automatically updated by the LTMS, rather than requiring repeated execution of rules. Because of this, the conventional LTRE guarantees that a rule will run exactly once on each set of facts to which it has matched, to avoid the wasted work and duplication of clauses that would result. One subtlety in making a fact garbage collector is ensuring that rules are re-executed in certain circumstances described below.
3.2 The FACT-GC Algorithm
To garbage-collect facts we must (a) be able to identify collectible facts, (b) ensure that all relevant structure is removed, and (c) cache information for restoring clause structure under certain circumstances (discussed below). We address the identification of collectible facts by requiring applications to provide a predicate gcable? that is true exactly when a fact is of a type that should be collected when it becomes unknown. (We discuss how to define gcable? in Section 3.4.) Ensuring the deletion of all relevant structure and the caching of clause information only requires modifications of the LTMS opera-
\(^1\) The simultaneity requirement is a modification to the LTRE presented in [Forbus & de Kleer, 1993]. As it results in a substantial performance improvement, all versions of the LTRE used in experiments described in this paper have this modification.
tions carried out when retracting an assumption. Here is the new LTMS retraction algorithm:
Retract-Assumption(n)
1. Label(n) = UNKNOWN
2. Queue = Propagate-Unknownness(n)
3. Find-Alternate-Support(queue)
4. Fact-GC(queue)
The first three steps of retract-assumption are identical to those of the LTRE described in [Forbus & de Kleer, 1993], with the exception of retaining the queue computed in propagate-unknownness for additional processing. Fact garbage collection is only attempted after seeking alternate support so that still-labeled TMS structure is not removed.
The fact-gc algorithm simply finds collectible nodes among those that were retracted and executes collect-node on them:
Fact-GC(queue)
1. For each node n in queue,
If label(n) = UNKNOWN and GCable?(n)
then Collect-Node(n)
Collect-Node(n)
1. For each clause c that n participates in,
A. Create-Restoring-Thunk(C)
B. Delete(C)
2. For each rule instance r which includes n in its bound triggers, Delete(r)
3. Delete(n)
Step 1 of collect-node, the caching of clause information, is somewhat subtle, so we describe it last. Step 2 ensures that every unexecuted rule instantiation formed in part by triggering on n is destroyed, both to avoid re-introducing collected nodes and to save the effort of executing moot rules. Step 3 deletes the node itself.
Steps 2 and 3 require processing at both the TMS and inference engine levels. In Step 2, partially-bound rules must be removed from the inference engine and from the TMS’s cache of partially-executed rules. This step has the desirable side-effect of a substantial reduction in memory usage, as the number of rules in a conventional CyclePad LTRE can be 2,000 at startup, and rises monotonically to five times that amount during a typical user session. In Step 3, the node and its corresponding inference engine fact are deleted from the TMS and inference engine respectively.
Step 1 caches information necessary to recreate the clause about to be deleted. This is necessary because the traditional contract between inference engine and TMS requires that rules are only run once. Since clauses are the product of rules, the deletion of a clause can cause permanent loss of information from the LTRE unless we take steps to ensure that its creating rule runs again.
An example will clarify this point. Suppose we have the simple database formed by the sequence of transactions:
\[ \text{Assume}(A) \]
\[ A \Rightarrow B \]
where both A and B are collectible, and \( A \Rightarrow B \) is installed by a rule that was triggered by A becoming true. Retracting A will cause B to be retracted, and both will be collected, along with the clause that linked them. This is both desirable and safe; if A is assumed again in the future, the same rule will execute to create another clause, and the system will again believe B as a result. But suppose that A were not collectible. Retracting A would cause B to be retracted. If we collected B, we would delete the clause linking A and B. But since A is still in the database, the rule which triggered on A will not be re-executed, and a valid inference is permanently lost.
The subtlety inherent in this step arises from the expressiveness of LTRE rules. Consider the set of literals which participate in the clauses that the execution of a particular rule generates. Generally some subset of these literals (e.g., the antecedents of an implication) will appear in the rule’s triggers. Call these trigger literals. Our GC algorithm generally requires all non-collectible literals of a rule to be trigger literals, in order to ensure the proper caching of a clause-restoring thunk.
A restoring thunk is needed exactly when a clause is being deleted because its consequent is being gc’d and when at least one of its antecedents is both unknown and not gc-able:
Create-Restoring-Thunk(C)
1. Retrieve rule instance r used to create C
2. Find antecedent M in C such that ¬GCable?(M) and Unknown(M)
3. If antecedent M found then schedule r to be executed when M receives the appropriate label.
The LTMS caches the environment of the rule instance in force with each clause when it is constructed. Create-restoring-thunk moves this information from the about-to-be-deleted clause to a cache associated with a non-gc-able and unknown antecedent. In the above example this antecedent would be the node corresponding to A. Should A become believed at some future time, the TMS will check this cache and signal the inference engine to schedule any rules found there for execution, thus ensuring that the clause implying B will be re-instantiated. This is merely an extension of the services that the TMS already provides in keeping track of partially executed rules.
For this algorithm to work correctly, any non-collectible literal which becomes unknown must be a trigger literal. Otherwise, there is no appropriate place to cache the thunk, and step 3 above will not execute. The exception to this is when a rule involves no collectible literals, for this reduces to the standard LTMS case.
There are also two cases in which it is possible that step 3 will not execute yet the LTRE will not permanently lose structure: (a) when the application bypasses the rule engine and installs clauses directly, and (b) when all trigger literals are either unknown and gc-able or known. In the first case, the onus for restoring the clause rests with the
application. The only responsibility of the TMS in this instance is to signal the application that a directly-installed clause is to be deleted and return that clause to the application. In the second case the clause will be replaced by a new clause when new gc-able facts corresponding to the trigger literals are inserted into the database because these new facts will match and cause the execution of the rule.
3.3 Applicability to Other Types of TMSs
Although we have implemented the fact-gc algorithm in an LTMS, all of our concepts and algorithms are directly applicable to Justification-based TMSs (JTMS) [de Kleer and Forbus, 1993] as well. It is less clear what the ATMS equivalent of Fact-GC would be, given that the ATMS does not retract assumptions. If one added the idea of particular assumptions (or environments) becoming irrelevant, it might be desirable to adapt something like these algorithms for weeding out irrelevant environments and justifications.
3.4 How and When to Use Fact-GC
Fact garbage collection requires that the system designer specify what classes of facts are subject to fact garbage collection, by supplying the procedure Gatable?. Candidates for collectible kinds of facts are those which
- Constitute a sizable fraction of the LTMS database
- Are unlikely to become valid again once unknown
- Are cheap to rederive
The first constraint determines how much storage fact garbage collection will save. The second constraint concerns the likelihood of needing to re-execute rules, and the third constraint concerns the cost of re-executing rules.
In the case of CyclePad, the two classes of facts we elected to garbage collect were
- (parameter> NVALUE <value>) which states that the continuous parameter<parameter> has as its (numerical) value <value>, a floating point number.
- (parameter> PROPOSED-NVALUE <value>) which states that <value> has been proposed by some rule as being an appropriate value for <parameter>.
The PROPOSED-NVALUE statements represent conclusions based on different possible methods for deriving a value, and the NVALUE statements represent the particular proposal chosen. (Conflicting PROPOSED-NVALUE statements represent a contradiction, since all methods should lead to the same answer.)
These choices satisfy all three constraints:
1. NVALUE and PROPOSED-NVALUE statements are the overwhelming majority of the facts derived by CyclePad.
2. While users sometimes revisit assumptions, the whole point of sensitivity analyses (a critical activity in building intuition about how thermodynamic cycles work) is to systematically vary input assumptions.
3. Given the off-line compilation of rules and equations into code, the cost of re-executing rules is small.
We suspect that many TMS applications have similar properties.
4. Analysis and Results
We begin by analyzing the complexity of the algorithm, and then illustrate its performance empirically.
4.1 Algorithmic Analysis
We assume that the cost of Gatable? is negligible. The first three steps are the standard LTMS retraction algorithm, which is worst-case linear in the number of nodes and clauses in the database. The complexity of Fact-GC is governed by the size of the queue Propagate-Unknownness returns, so we can guarantee that the number of nodes and clauses examined is bounded by the complexity of the normal retraction algorithm. If the operations carried out over each node and clause are of low complexity, then the whole algorithm is worst-case linear.
The operations carried out over each node and clause can be divided into two types, those operations that involve only the LTMS, and those operations that involve both the inference engine and the LTMS. The operations involving only the LTMS are trivial, involving at worst linear operations in the size of the term list of a clause, which is typically very small compared to the number of clauses in the database (e.g., 5 versus 10,000) and so they can be ignored. Those involving the inference-engine can all be implemented as constant-time operations if enough information is cached, or as linear operations (e.g., our current code implements the deletion of rules as a single pass through the entire set of nodes in the LTMS after the rest of the retraction is complete) quite easily. Therefore we conclude that the entire algorithm is linear in the size of the LTMS dependency network.
A more interesting complexity measure is the change in storage required as a function of the number of assume/retract cycles. We assume that the assumption being made is new, in that its statement does not appear in the TMS database until the assumption is made, and once it is retracted, it is never reassumed. In a standard TMS, storage requirements for the dependency network will grow monotonically with the number of such cycles, with the order of growth being linear if there are no interactions between consequences of distinct assumptions. In a fact GC’ing TMS, if the assumptions being made are collectible, there will in the best case be no growth in the size of the dependency network, no matter how many assume/retract cycles occur. However, in many cases there can still be growth, since a non-collectible fact can be introduced as a consequence of a collectible assumption, and such facts are never destroyed. (This growth may assumed to be modest, else one should consider making the non-collectible facts introduced collectible.) As the next section demonstrates, it is possible to approach the best case quite closely in a realistic application.
4.2 Empirical Results
We conducted our tests of the fact-gc algorithm on Pentium-based microcomputers equipped with 32MB of RAM. Times reported, therefore, are typical of those a user of the CyclePad system would experience.
Garbage collection provides little or no benefit to an LTRE in which there are few known facts, so one would expect such cases to reveal the additional cost of the GC operations. This cost turns out to be insignificant; in a CyclePad with the bare minimum of assumptions installed to establish the structure of the problem, the assumption and retraction of different numerical values requires 0.04 seconds at the outset from both the conventional and GC LTREs. However, by the fortieth retraction the conventional LTRE requires 0.14 seconds per assumption/retraction cycle, because it has been steadily adding nodes and clauses to the TMS, whereas the GC-LTRE still requires 0.04 seconds, and its LTRE has remained constant in size.
Worst-case assumption/retraction behavior occurs in CyclePad when the cycle is one assumption short of being fully constrained. This is, however, precisely the situation in which a user would find making and retracting assumptions most useful—when doing so provides lots of information. The results we present below therefore focus on this situation.
To generate the data presented in Table 1, we set up a simple refrigerator cycle example in CyclePad and iterated through 48 assume/retract cycles, incrementing the value of a particular numerical assumption each time. We have run the GC-LTRE for as many as 1000 iterations on several different CyclePad examples with no fundamental change in the results, but we cannot do more than 48 iterations.
<table>
<thead>
<tr>
<th>Trial</th>
<th>Execution</th>
<th>GC</th>
<th>Total</th>
<th>Facts</th>
<th>GC-able</th>
<th>Total</th>
<th>Clauses</th>
<th>Rules</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>0.73 / 0.63</td>
<td>0.16 / 0.22</td>
<td>0.89 / 0.85</td>
<td>288 / 288</td>
<td>1,014 / 1,014</td>
<td>1,301 / 1,301</td>
<td>2,547 / 2,547</td>
<td></td>
</tr>
<tr>
<td>2</td>
<td>0.88 / 0.66</td>
<td>0.27 / 0.27</td>
<td>1.15 / 0.93</td>
<td>441 / 288</td>
<td>1,167 / 1,014</td>
<td>1,629 / 1,301</td>
<td>2,949 / 2,547</td>
<td></td>
</tr>
<tr>
<td>3</td>
<td>0.96 / 0.68</td>
<td>0.38 / 0.27</td>
<td>1.34 / 0.95</td>
<td>594 / 288</td>
<td>1,320 / 1,014</td>
<td>1,957 / 1,301</td>
<td>3,351 / 2,547</td>
<td></td>
</tr>
<tr>
<td>4</td>
<td>0.94 / 0.63</td>
<td>1.04 / 0.28</td>
<td>1.98 / 0.91</td>
<td>747 / 288</td>
<td>1,473 / 1,014</td>
<td>2,285 / 1,301</td>
<td>3,753 / 2,547</td>
<td></td>
</tr>
<tr>
<td>5</td>
<td>0.99 / 0.64</td>
<td>1.27 / 0.28</td>
<td>2.26 / 0.92</td>
<td>900 / 288</td>
<td>1,626 / 1,014</td>
<td>2,613 / 1,301</td>
<td>4,155 / 2,547</td>
<td></td>
</tr>
<tr>
<td>6</td>
<td>1.13 / 0.71</td>
<td>1.16 / 0.22</td>
<td>2.29 / 0.93</td>
<td>1,053 / 288</td>
<td>1,779 / 1,014</td>
<td>2,941 / 1,301</td>
<td>4,557 / 2,547</td>
<td></td>
</tr>
<tr>
<td>7</td>
<td>1.24 / 0.65</td>
<td>1.81 / 0.27</td>
<td>3.05 / 0.92</td>
<td>1,206 / 288</td>
<td>1,932 / 1,014</td>
<td>3,269 / 1,301</td>
<td>4,959 / 2,547</td>
<td></td>
</tr>
<tr>
<td>8</td>
<td>1.35 / 0.69</td>
<td>1.15 / 0.22</td>
<td>2.50 / 0.91</td>
<td>1,359 / 288</td>
<td>2,085 / 1,014</td>
<td>3,597 / 1,301</td>
<td>5,361 / 2,547</td>
<td></td>
</tr>
<tr>
<td>9</td>
<td>1.45 / 0.67</td>
<td>2.63 / 0.22</td>
<td>4.08 / 0.89</td>
<td>1,512 / 288</td>
<td>2,238 / 1,014</td>
<td>3,925 / 1,301</td>
<td>5,763 / 2,547</td>
<td></td>
</tr>
<tr>
<td>10</td>
<td>1.56 / 0.67</td>
<td>1.65 / 0.22</td>
<td>3.21 / 0.89</td>
<td>1,665 / 288</td>
<td>2,391 / 1,014</td>
<td>4,253 / 1,301</td>
<td>6,165 / 2,547</td>
<td></td>
</tr>
<tr>
<td>20</td>
<td>2.73 / 0.66</td>
<td>2.96 / 0.22</td>
<td>5.69 / 0.88</td>
<td>3,195 / 288</td>
<td>3,921 / 1,014</td>
<td>7,533 / 1,301</td>
<td>10,185 / 2,547</td>
<td></td>
</tr>
<tr>
<td>30</td>
<td>4.01 / 0.65</td>
<td>10.18 / 0.38</td>
<td>14.19 / 1.03</td>
<td>4,725 / 288</td>
<td>5,451 / 1,014</td>
<td>10,813 / 1,301</td>
<td>14,205 / 2,547</td>
<td></td>
</tr>
<tr>
<td>40</td>
<td>5.53 / 0.66</td>
<td>15.18 / 0.22</td>
<td>20.71 / 0.88</td>
<td>6,255 / 288</td>
<td>6,981 / 1,014</td>
<td>14,093 / 1,301</td>
<td>18,225 / 2,547</td>
<td></td>
</tr>
<tr>
<td>48(a)</td>
<td>11.12 / 0.65</td>
<td>35.13 / 0.44</td>
<td>46.25 / 1.09</td>
<td>7,479 / 288</td>
<td>8,205 / 1,014</td>
<td>16,717 / 1,301</td>
<td>21,441 / 2,547</td>
<td></td>
</tr>
</tbody>
</table>
(a) Conventional LTRE failed after this trial on a machine with 32 MB of RAM.
erations in the standard LTRE on the simple refrigerator without causing CyclePad to crash due to an out-of-memory condition.
Table 1 shows the data for both the conventional and GC LTREs. Note that both execution and gc times for the conventional LTRE rise steadily. By the time the conventional LTRE exhausts memory (at 48 assumption/retraction cycles in this particular experiment), data structures have grown by an order of magnitude, and total processing time by two orders of magnitude. Also note that this growth in data structures is evenly distributed among nodes, clauses, and rules.
In contrast we find virtually no growth in data structures in the GC-LTRE, and total time remains virtually constant. The graph in Figure 1 compares the growth in total data structures. In Figure 2, note that the response times of the conventional LTRE are distinctly non-linear. These results indicate that one must be careful to consider the ecological effects of an algorithm as well as its inherent complexity, especially when attempting to scale-up a system.
5. Related Work
We are not aware of any previous paper describing TMS algorithms that reclaim nodes and clauses, nor do we know of any unpublished systems that do so. This may seem surprising at first, but recall that the permanence of the cache provided by a TMS is considered to be one of its defining features. We were only driven to this change by a pressing problem that arose while trying to field software. The term “fact garbage collector” was used by Stallman and Sussman [1977] for one of the first truth-maintenance systems, but their program, like all subsequent TMSs to our knowledge, maintained nodes and clauses indefinitely.
Making TMSs more efficient was a cottage industry in the late 1980s, with most of the attention focused on the Assumption-based TMS (ATMS). The primary advantage of the ATMS is its ability to rapidly switch among many different contexts, but this comes at the cost of an exponential node-label updating process. To address this inefficiency, Dixon and de Kleer [1988] implemented the ATMS algorithm in a massively parallel fashion. Forbus and de Kleer [1988] introduced the implied-by strategy, which enables the ATMS to explore infinite problem spaces by ensuring that the inference engine maintains firm control of the subspace the TMS is searching, although it does not directly address the label-updating problem. Dressler and Farquhar [1991] introduced a means of enabling the inference engine to exercise both local and global control over the consumers of an ATMS. Collins and DeCoste [1991] introduced a modification to the ATMS algorithm which compresses labels into single assumptions, while Koff, Flann, and Dietterich [1988] implemented a specialized version of the ATMS that efficiently computes equivalence relations in multiple contexts. None of these schemes attempted to reclaim storage.
LTMS-based research has focused on finding a practical means of making BCP logically complete for some situations. The issue here is that BCP on individual clauses does not infer all possible implications because logical formulas may require encoding as multiple clauses, and there is no explicit connection among these clauses within the conventional LTMS. Based on the work of Tison [1969], de Kleer [1990, 1992] has developed an algorithm for enabling BCP to operate at the formula rather than the clause level by utilizing prime implicates. In practice we have found that the relative efficiency of clausal BCP is essential in large-scale systems, and we rely on the inference engine to redress the incompleteness of the LTMS.
Of perhaps more interest in this context is the comparison to OPS5 type production systems [e.g., Brownston et al., 1985], which as a matter of course delete facts from working memory. The marriage of such systems with TMSs has not been particularly successful nor widespread. Morgue and Chehire [1991] have combined such a rule engine with an ATMS, and report several problems in controlling the instantiation of facts which are subsequently discovered to be inconsistent, provoking a costly label-updating process.
In contrast to the forward-chaining, pattern-directed inference system we employ, an OPS5 rule system does not run all queued rules, but instead employs either weak methods or domain-specific heuristics to select rules for firing. We believe that, for our task domains, the additional demands that this imposes on the rule author outweighs the additional control afforded.
These reservations aside, OPS5 systems have been shown to scale. Doorenbos has developed an OPS-5 production system that scales to encompass on the order of 100,000 rules [Doorenbos, 1993]. He shows that the Rete and Treat algorithms do not scale well in the matching phase. The solution presented is to augment the Rete algorithm’s shared structure efficiencies (which occur mostly at the top of the beta memory network) with a strategy of unlinking elements near the bottom of the tree from the alpha memory when they contain no beta memory elements. In lieu of garbage collecting, this approach emphasizes parsimony in space and allocation of processing time.
6. Conclusion
Experience with fielding software in an AI application forced us to go back and reexamine one of the fundamental issues of truth-maintenance systems, namely that dependency networks should grow monotonically over time. If we take the often-used metaphor of TMS as an inference cache seriously, it stands to reason that we must provide an update strategy for that cache, eliminating elements of it that are unlikely to be useful. The fact garbage collection algorithm presented here provides such a strategy. It is successful enough that we have incorporated it into the current release of CyclePad, which is in use at three universities on an experimental basis by engineering students.
In Proceedings of the 13th National Conference on Artificial Intelligence. 996
To be beneficial, fact garbage collection requires that a TMS application identify a class of facts that are commonly made as assumptions, that comprise a substantial fraction of the database, and are inexpensive to rederive. We have demonstrated that fact garbage collection indeed greatly benefits a specific application, an intelligent learning environment. We believe that many TMS applications have similar characteristics.
On the other hand, there may be applications where fact garbage collection provides minimal benefit or even harm. An application which creates a large cache of nogoods, each representing the result of considerable computation and intended to be heavily used in future computations, is unlikely to benefit from making the facts involved in such nogoods collectible. Applications which switch back and forth between a small number of sets of assumptions many times may be better off with a traditional TMS—if the available memory can support it. However, we suspect that for many applications, and especially those where the purpose of the TMS is to provide explanations rather than to guide search, the fact garbage collection algorithms provided in this paper can be very beneficial. This, however, is an empirical question.
We plan to try the GC-LTRE on other kinds of TMS-based applications, such as coaches for ILEs and qualitative simulators. Another research group at Northwestern University is currently using the LTRE as the basis for an educational simulator of predator-prey relationships [Smith, 1996].
Acknowledgments
This research was supported by the Computer Science Division of the Office of Naval Research and the Applications of Advanced Technologies Program of the National Science Foundation. We thank the anonymous reviewers for several helpful suggestions.
References
|
{"Source-Url": "http://www.qrg.cs.northwestern.edu:80/papers/Files/gc-final.pdf", "len_cl100k_base": 7806, "olmocr-version": "0.1.53", "pdf-total-pages": 7, "total-fallback-pages": 0, "total-input-tokens": 24418, "total-output-tokens": 9155, "length": "2e12", "weborganizer": {"__label__adult": 0.0003197193145751953, "__label__art_design": 0.00048828125, "__label__crime_law": 0.0004725456237792969, "__label__education_jobs": 0.002498626708984375, "__label__entertainment": 0.0001405477523803711, "__label__fashion_beauty": 0.0002371072769165039, "__label__finance_business": 0.000522613525390625, "__label__food_dining": 0.0004279613494873047, "__label__games": 0.0007429122924804688, "__label__hardware": 0.0020732879638671875, "__label__health": 0.0007281303405761719, "__label__history": 0.0004074573516845703, "__label__home_hobbies": 0.0001773834228515625, "__label__industrial": 0.0009517669677734376, "__label__literature": 0.0006299018859863281, "__label__politics": 0.0003807544708251953, "__label__religion": 0.0005178451538085938, "__label__science_tech": 0.436767578125, "__label__social_life": 0.00014543533325195312, "__label__software": 0.016937255859375, "__label__software_dev": 0.533203125, "__label__sports_fitness": 0.0002923011779785156, "__label__transportation": 0.000812530517578125, "__label__travel": 0.0001952648162841797}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 36273, 0.06563]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 36273, 0.31109]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 36273, 0.91464]], "google_gemma-3-12b-it_contains_pii": [[0, 4909, false], [4909, 10709, null], [10709, 16132, null], [16132, 21687, null], [21687, 25236, null], [25236, 31216, null], [31216, 36273, null]], "google_gemma-3-12b-it_is_public_document": [[0, 4909, true], [4909, 10709, null], [10709, 16132, null], [16132, 21687, null], [21687, 25236, null], [25236, 31216, null], [31216, 36273, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 36273, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 36273, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 36273, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 36273, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 36273, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 36273, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 36273, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 36273, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 36273, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 36273, null]], "pdf_page_numbers": [[0, 4909, 1], [4909, 10709, 2], [10709, 16132, 3], [16132, 21687, 4], [21687, 25236, 5], [25236, 31216, 6], [31216, 36273, 7]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 36273, 0.11348]]}
|
olmocr_science_pdfs
|
2024-12-09
|
2024-12-09
|
c96d66335c05dfd51381760a9b5db063bb86994b
|
Enhanced Critical Chain Project Management via Advanced Planning & Scheduling Technology
Annaka Kalton, Project Manager, Stottler Henke
Hilbert Robinson, Lead Consultant, Afinitus Group, LLC
Robert Richards, Project Manager, Stottler Henke
Abstract
In the late 1990s, a new project management methodology was developed to overcome many of the shortcomings of Critical Path Project Management (CPPM). This new methodology, Critical Chain Project Management (CCPM), is based on methods and algorithms derived from the theory of constraints. The Critical Chain is the sequence of both precedence- and resource-dependent tasks that prevents a project from being completed in a shorter time, given finite resources. If resources (labor/non-labor) are always available in unlimited quantities, then a project’s Critical Chain is identical to its critical path. Since the introduction of CCPM, its use has grown considerably and is being applied in more, and more challenging, project management environments.
The Critical Chain method, however, is still in its relative infancy and many limitations have been discovered with the current theory and implementation, especially as it has been applied to ever larger project management tasks. Limitations in theory and its current commercial implementations have limited its suitability for large, dynamic, and complex scheduling environments, such as those that have been the focus of advanced scheduling techniques in the past. Many of these limitations can be surmounted by combining the principles of the CCPM methodology with advanced scheduling techniques. This paper investigates how many of the perceived limitations of the Critical Chain method can be overcome and the results maximized by leveraging the power of advanced planning and scheduling.
By combining CCPM theory with a sophisticated scheduling technology that combines a variety of scheduling techniques and intelligent conflict resolution, a much more robust solution is possible. Resource constraints, including available equipment, space, and human resources, are very important to the implementation of the Critical Chain method because the greater the degree to which it can take these resources into account, the greater the potential improvement over CPPM.
Fortunately, advanced scheduling technology can take into account a variety of resource requirements, and can be adapted to pertinent domain knowledge. This is especially important during the initial Critical Chain analysis step (where the chain length is directly related to schedule quality), and in the execution phase of a CCPM plan, as real-time updates arrive regarding the status of the hundreds or thousands of tasks that make up the plan.
A more sophisticated underlying scheduling framework provides two important benefits: it results in a better Critical Chain (one that can potentially be worked in less time), and it is more flexible and better able to accommodate change. We have been able to greatly enhance the practicality and power of the Critical Chain method by leveraging advanced planning and scheduling techniques. By using sophisticated scheduling software as the underpinnings for Critical Chain reasoning, the Critical Chain method can be applied to projects encompassing thousands of heavily constrained tasks and requiring hundreds of different kinds of resources. Giving the Critical Chain method such a solid scheduling basis also allows it to more easily handle complex situations such as new tasks being inserted during the actual plan execution, as well as other radical changes to the situational model.
Introduction
Large organizations dealing with developing and building complex systems are highly reliant on schedules and project management techniques at almost every level. A number of tools, technologies, and methodologies have been put forward in an attempt to deal with these issues. CPPM emerged as an early leader in project management methodology, but it did not provide nearly as much gain in highly resource constrained domains; CCPM originally emerged to help fill this gap.
The Project Management community was broadly introduced to the Critical Chain Project Management (CCPM) by Eliyahu M. Goldratt’s book, *Critical Chain* (Goldratt, 1997). CCPM is further described in both *Project Management In the Fast Lane* (Newbold, 1998) and *Critical Chain Project Management, 2nd Edition* (Leach, 2005). CCPM considers resource constraints more heavily than does Critical Path Project Management. A Gantt chart of a small Critical Chain project is shown in Figure 1; CCPM has the concept of buffers as shown in the figure and further described in the above mentioned references. Many sources, including The Standish Group International, [www.standishgroup.com](http://www.standishgroup.com), and The Goldratt Institute, [www.goldratt.com](http://www.goldratt.com), have shown that over 50% of Critical Path base projects finish late with the average duration being more than 50% greater than originally planned; CCPM has shown much improved on-time performance.

**Figure 1. Gantt Chart showing Critical Chain in yellow**
Even though CCPM has shown great success to date, many limitations have been discovered with the current theory and implementation, especially as it has been applied to ever larger project management tasks. Because the critical chain takes into account resource contention, the quality of CCPM results are dependent on the underlying scheduling solution, even though the goal of CCPM is not to work to a schedule. The initial schedule length becomes the length of the critical chain - and this is central to the way in which CCPM will determine what should be worked when. Figure 2 illustrates the potential impact of different critical chains, as well as showing the advantages of using the critical chain in such a resource-constrained domain. It includes the critical path, for reference, and two different critical chains, each with elements driven by resource contention shown in a darker shade. Clearly the critical chains differ dramatically. If an inefficient scheduling method is used the unnecessarily long critical chain will give an erroneous impression of the time in which the project could potentially be completed, and so would not be managed as ambitiously as it could successfully be. Of equal importance is the ability to model accurately: a shorter critical chain is not helpful if it is not, in fact, possible to work the project in that time because a number of constraints were neglected or misrepresented.
The goal is the shortest accurate critical chain, because that will permit CCPM’s application to result in successful project completion in the shortest amount of time.
Both scheduling engine sophistication and modeling accuracy have historically been problematic when applying CCPM. Many projects can be modeled with labor and precedence dependencies, and these have been the main type handled via the CCPM method to date, because these can be readily modeled with many of the available tools. As the project becomes more resource dependent and the types of resources increase, the current solutions perform less
optimally, often because they lack the flexibility to accurately and effectively model and schedule these additional requirements. For example, many projects depend on certain operations occurring at specific locations (spatial resources), and being done with a certain set of equipment. There may be safety and environmental restrictions that vary depending on what else is occurring, and other domain specific constraints. What is more, there are often contradictory scheduling goals (e.g. to minimize manpower but also minimize flow time); handling these tradeoffs is an extremely domain-specific consideration. Finally, because a complex schedule can be so large (having to take thousands of elements, requirements, and constraints into consideration), the system must be able to use heuristics to render the schedule search feasible. Again, this is a highly domain-specific process.
Figure 2. Critical Chain Comparison
For all of these reasons it is important to have a high-quality scheduling engine - capable of handling the modeling complexity and scale - and ideally a scheduling engine which appropriately reflects the preferences for a given domain. In combination these aspects will result in a short, high-quality, workable schedule - which can then be used as the basis for critical chain analysis and the basis for far more flexible CCPM in execution.
Thus it is important to pair a sophisticated scheduling engine with CCPM methodologies to gain the best possible management results.
Current Limitations of CCPM Implementations
In general, larger projects have more constraints than simply labor and precedence. Eli Goldratt’s book, *Critical Chain* (Goldratt, 1997) presented Critical Chain using only these constraints; and thus most of the Critical Chain Implementations have focused (solely) on these types of constraints. However, the concepts and benefits of CCPM work just as well when other types of constraints are introduced.
Relationship complexity often goes beyond precedence and concurrency and non-concurrency. Often domain dependent relationships need to be handled correctly and efficiently if an efficient Critical Chain schedule is to be generated. Another concept that occurs in complex projects but is not normally handled is that of variable capacity by time interval; for example, repeating a pattern over a 24 hour cycle (e.g. standard factory staffing will vary from shift to shift), or a change in pattern for two days out of every seven (e.g. most organizations do not work over the weekend, or work to reduced hours). These are fairly standard variations, but some domains may vary in a number of additional ways.
In a domain such as spacecraft preparation, there are a number of additional safety considerations; or in a domain such as airplane assembly, there are a number of space-related issues (only so many workers will fit in a given space, and some actions may permanently eliminate possible work space). Many other domains, such as the building and maintenance of submarines, tanks, helicopters, and oil drilling platforms, offer yet more considerations that cannot be accurately considered in a basic scheduling system.
The challenge is increased when 24 hour operations are introduced, so that the orchestration of many activities with a high degree of variation and intense coordination must occur in near real time. Also near real time schedule maintenance needs to occur per adding and removing work statement components on an emergent basis, both to incorporate rework, as well as to accommodate late breaking changes in the engineering requirements.
Advanced Planning & Scheduling
To illustrate the benefits of advanced scheduling, the lessons learned from a particular scheduler, *Aurora*, are utilized. *Aurora* evolved out of the needs of NASA and later the United Space Alliance, and finally in application to industry. *Aurora* evolved over many generations, and the latest generation is the result of a major re-design, where Stottler Henke systematically looked at every planning and scheduling system Stottler Henke had ever developed, and looked at all the decisions that a planning and scheduling has to make and designed and implemented an architecture such that it was easy to customize every one of those decisions. This latest evolution has been chosen by the United Space Alliance as the onboard planner / scheduler for astronauts to use on the Crew Exploration Vehicle, and is also in operational use in other assembly scheduling and project support.
*Aurora* is used in the planning and scheduling of extremely complex processes involving thousands of operations. Each operation can require a combination of resources (facilities, equipment, personnel). *Aurora* is adaptable to different domains that each have their own set of additional constraints, examples include the safety limitations and floor plan layout coordination involved in preparing components for the space station; non-concurrency and offset constraints to allow necessary safety and practicality controls over scheduling astronaut time; and space constraints, including addition and removal of these constraints, involved in airplane assembly. Finally, *Aurora* has evolved to meet the real world challenges of endless changes to the schedule caused by late deliveries, other delays (e.g., launches), and malfunctioning equipment.
Some of the features that have evolved are listed below. Most, if not all, should be part of any advanced scheduler used in complex CCPM projects, because they result in greater inter-domain flexibility and more accurate modeling.
- **Tasks, Flows & Resources** – *Aurora* offers three main kinds of scheduling elements: 1) tasks (activities); 2) flows, which represent groups of tasks; and 3) resources. In addition to these primary types there are also resource sets, which can be used to group resources, and constraints, which allow the user to create relationships among elements. Constraints and Resource Sets are described in more detail below.
• Constraints – Aurora provides temporal, resource, capacity change, and spatial constraints to define the relationships among the scheduled elements. Temporal constraints specify what the temporal relationship of two elements should be. Resource constraints indicate that two elements should use the same resource. For example, one could specify that the same worker perform steps one and three of a processing procedure. Capacity change constraints indicate that a given task has an impact on a resource’s capacity (e.g. contributes capacity or removes capacity). Finally, spatial constraints allow the user to specify that two elements should (or should not) be next to each other, or in the same spot.
• Resource Sets – Aurora allows for the grouping of related resources into different sets to take advantage of all useful attributes. Aurora allows the user to group resources arbitrarily into resource sets. Elements can then request these sets as part of their resource requirements, reflecting the idea that any properly qualified resource could perform a corresponding task. This also gives the user the freedom to group one resource differently in different situations.
• Resource Requirements – Aurora allows the user to associate resource requirements with any task, flow, or resource. The first reflects the case where a single task requires a resource; the second reflects the case where a full set of tasks needs to use one resource (e.g., a project needs a project manager); the third reflects those occasions when a resource needs another resource to operate properly (a large, specialized piece of lab equipment needs lab space; an engine needs fuel). These requirements may be defined directly in terms of resources, when only one resource can satisfy the requirement; or in terms of resource sets, when any of a group of resources may satisfy the requirement. It also allows you to designate alternate ways in which the set of resources may be satisfied. For example, a training course might require an experienced instructor for the duration, or a regular instructor with half-time support from a specialist.
• Reports – Aurora allows the user to create various textual and graphical reports. For example, the resource display shows what tasks are using a given resource at any given time, see Figure 3. This permits easier analysis of results, which can motivate model correction and improvement, and possibly further domain-specific extension.

**Figure 3. Resource Display**
• Calendars – Aurora permits the user to associate a calendar with a task or resource to dictate its standard schedule, and any exceptions that schedule might have. These may include yearly holidays or one-time events. A “five day” activity will likely take very different amounts of calendar time if it is scheduled in late December than if it is scheduled in February. Aurora can dynamically cross-reference these calendars in the course of scheduling; for example, a task that requires a mechanic who is available for two shifts a day will inherit this calendar; if it itself had a daytime only calendar, it would be assigned a calendar reflecting the intersection of the daytime calendar and the mechanic’s shift calendar.
© 2007, Stottler Henke
Originally published as a part of PMICOS 2007 Annual Conference
• **Conflict Viewing** – Aurora can usually resolve all conflicts, but sometimes a schedule is over-constrained, resulting in a schedule with one or more conflicts. Any such elements are displayed in red, so the user can see and deal with them. However, there may be instances where they want a global view of all conflicts in the schedule. The user can see these using a conflict display window, see Figure 4. The conflicts are broken down first by resource, and then by time frame.
• **Ignoring Conflicts** – There are occasions when there is a conflict, but the user knows it is not a “real” conflict - they know that a vendor’s delivery is going to be late, or that two classes can, in this situation, use the same room intermittently. In such a situation, the user can specify that a conflict be “ignored”. It will no longer be displayed as a conflict, and the conflict manager will not try to resolve it.
• **Default Scheduling** – Aurora offers a default quality and prioritization scheme that has proven itself across a variety of domains. This works well in most cases, and is useful for those situations where it is undesirable or impossible to construct scheduling heuristics customized to the domain at hand. It considers all possible resource allocations before it begins scheduling, allowing it to pinpoint possible trouble spots - the resources with the most elements vying for their potential use. It then works around these bottle necks, scheduling the elements away from them as much as possible, and leaving only those elements that must use them.

For example, the user interaction (the GUI) is a separate component from the Aurora scheduling engine. This allows for a whole new front-end to be substituted. The front-end could be replaced with that of other commercial Critical Chain solutions, allowing the user to retain a user interface they are familiar with while benefiting from the Aurora scheduling engine. Figure 5 shows Aurora’s high-level architecture, revealing the module design and the separation of the front end from the scheduling engine.
• **Scheduling Heuristics** - In order to find a high-quality schedule quickly, it is necessary to use a battery of heuristics. These heuristics are usually tailored from one domain to another, to get the best solution for a given class of problems. For example, a more temporally-based model (with a lower resource requirement to temporal constraint ratio) can be scheduled effectively by taking the critical path into account, and scheduling elements on or near the critical path earlier in the process; however, this may be quite damaging in a more heavily resource-restricted model. Because of this the best scheduling systems will always require some degree of tuning, and a good engine should permit some degree of adaptation. In Aurora’s case, different heuristics impact each stage of the scheduling process, and may be changed independently for a new domain.
© 2007, Stottler Henke
Originally published as a part of PMICOS 2007 Annual Conference
To summarize, Aurora is a sophisticated scheduling system that combines a variety of scheduling techniques, intelligent conflict resolution, and decision support to make scheduling faster and easier. The software’s scheduling decisions take into account domain knowledge, any number of constraints, and resource requirements. Once Aurora has created a schedule, it displays it in a series of graphical displays that allow the user to see the resource allocations and the temporal relationships among the elements. Aurora focuses on resource requirements and temporal scheduling in combination.

**Combining CCPM and Advanced Planning & Scheduling**
The effects of the underlying scheduling engine on the Critical Chain are shown graphically in Figure 2 and Figure 6. Figure 6 shows the results of four (4) different programs’ determination of the Critical Chain elements. Note that every program correctly built a Critical Chain schedule in every regard except global optimality. For larger problems the problem of determining the globally optimal solution is computationally intractable, so all solutions try to find a good approximation of a global solution in a user-acceptable amount of time; this will not necessarily be the best possible solution.
Even in the small project shown in Figure 6, the duration difference between the shortest Critical Chain and the longest is 100 units of time versus 110 time units, already a 10% difference. As the size of the project increases the time for the project can differ by over 100% between tools. Furthermore, Aurora has been able to find project durations 50% shorter than other Critical Chain solutions, for the same data set.
This implies that much of the potential for improvements offered by the Critical Chain method are possibly being lost if the project is not being scheduled efficiently. These already important considerations are only for the earlier stages of CCPM. It can become even more important during CCPM execution.
In addition to the challenges of finding a good schedule solution during planning, it is often necessary to incorporated changes to the schedule during execution. In real world situations unexpected events occur during
execution, including insertion of new tasks, deletion of old tasks, and radical changes in the timing of specific tasks. Many of these events require partial re-scheduling as the basis for the next round of analysis, and if these reschedules could be improved, so could the overall execution of the living project.
Conclusions
In this paper we have shown that Critical Chain Project Management (described elsewhere) is greatly affected by the underlying scheduling engine - more so as the project becomes larger and includes larger numbers of resource requirements and other non-temporal constraints.
The results of applying the Aurora scheduling engine to Critical Chain problems was used to demonstrate the described effect; however, Aurora is just an example - the primary conclusion is that the underlying scheduling engine can greatly impact the results. History has proven that it is nearly impossible to build a scheduling solution that is best in all situations, so another potentially beneficial approach would be to maintain a pool of possible scheduling engines or engine configurations, and apply all of them to models in a new domain. Because of their differing strengths and weaknesses, some would perform more effectively on some domains than in others. Once all had been applied to a given model or set of models, the best engine for the purpose could then be selected for subsequent CCPM application. It is usually easy to select the best schedule, as it is generally the schedule with the shortest flow time. If possible, the best solution could then be further tailored to maximize the benefit, but the key point is that the scheduling system has a significant impact on the utility of applying CCPM to a given domain, and should be given corresponding weight.
References
|
{"Source-Url": "https://www.stottlerhenke.com/wp-content/uploads/2014/12/PMICOS_2007_CCPM_adv_planning_scheduling.pdf", "len_cl100k_base": 4465, "olmocr-version": "0.1.53", "pdf-total-pages": 8, "total-fallback-pages": 0, "total-input-tokens": 16743, "total-output-tokens": 4902, "length": "2e12", "weborganizer": {"__label__adult": 0.0005168914794921875, "__label__art_design": 0.0015316009521484375, "__label__crime_law": 0.0007433891296386719, "__label__education_jobs": 0.0130462646484375, "__label__entertainment": 0.00020503997802734375, "__label__fashion_beauty": 0.0003426074981689453, "__label__finance_business": 0.0167999267578125, "__label__food_dining": 0.0005555152893066406, "__label__games": 0.00106048583984375, "__label__hardware": 0.0015096664428710938, "__label__health": 0.001018524169921875, "__label__history": 0.0007338523864746094, "__label__home_hobbies": 0.0005121231079101562, "__label__industrial": 0.00785064697265625, "__label__literature": 0.0004851818084716797, "__label__politics": 0.0004401206970214844, "__label__religion": 0.0006546974182128906, "__label__science_tech": 0.294921875, "__label__social_life": 0.0003986358642578125, "__label__software": 0.236083984375, "__label__software_dev": 0.417724609375, "__label__sports_fitness": 0.0005106925964355469, "__label__transportation": 0.0017747879028320312, "__label__travel": 0.0005650520324707031}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 24046, 0.01314]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 24046, 0.54023]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 24046, 0.93661]], "google_gemma-3-12b-it_contains_pii": [[0, 4107, false], [4107, 7221, null], [7221, 8724, null], [8724, 13263, null], [13263, 16609, null], [16609, 19685, null], [19685, 21951, null], [21951, 24046, null]], "google_gemma-3-12b-it_is_public_document": [[0, 4107, true], [4107, 7221, null], [7221, 8724, null], [8724, 13263, null], [13263, 16609, null], [16609, 19685, null], [19685, 21951, null], [21951, 24046, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 24046, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 24046, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 24046, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 24046, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 24046, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 24046, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 24046, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 24046, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 24046, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 24046, null]], "pdf_page_numbers": [[0, 4107, 1], [4107, 7221, 2], [7221, 8724, 3], [8724, 13263, 4], [13263, 16609, 5], [16609, 19685, 6], [19685, 21951, 7], [21951, 24046, 8]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 24046, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-07
|
2024-12-07
|
b6f77bbc178c69f954975ecba6d48fbef739d17d
|
SMART ORDER DEVELOPMENT SOLUTIONS APPS IN E-BUSINESS ACTIVITIES
NGUYỄN VĂN HUÂN TS
Faculty of Economics Information Systems, University of Thai Nguyen Information and Communications Technology, Vietnam, Tel: 0904 101 008;
Email: nvhuan@ictu.edu.vn
Abstract
Today, the old manual system of information requires manpower from the restaurant from writing down of orders, saving copies of receipts, and summarizing business transactions. It is also time-consuming for the part of the customers because it requires them to fall in line, place their orders and settle their bill. Waiting for their orders to be served may also take some time that can either serve the customers positively or negatively. This article focuses on the study proposes a Smart Order Application (SOA) Development Solution to support e-business activities and help for the restaurant business units operate efficiently, serve customers quickly, promptly and in accordance with the tastes of customers in today's era. SOA will replace the old order process and allow restaurant to create more professional service style, customers do not have to fall in line and wait for their turn to order. Integrate marketing in SOA, SOA will include function "Log in Facebook" which will let the customers like, share or check in at Phở restaurant and get free drinks or food. With SOA will make restaurant's menu vivid visually appealing, make a more effective and efficient business, it mean SOA improves
the speed of service and create a new order style that benefits both the customers and the management. Customers will feel a comfortable and convenient dine-in experience, while restaurant will be able to reduce its expenses when it comes to manpower. Since then, SOA enables business unit’s profitable restaurant writing, profitability increased.
Keywords: Smart Order Application; E-Business; Ha Noi; Phở Restaurant
© Nguyễn Văn Huấn TS, 2016
INTRODUCTION
People live in the era of technology. The world has been changed by the continuous development of the technology. It can be observed that a lot of people turn to technology in order to accomplish their tasks. Technology plays vital roles in various fields of work such as communication, health, manufacturing, and science. Most fast food chains like Jollibee, KFC, and McDonald’s [1] use a POS system instead of a paper menu and other traditional order systems to make their services faster and more convenient. However, the existing order application system used by the aforementioned establishments still require manpower in the form of restaurant crew who directly take orders from the customers through a face-to-face interaction (Figure 1). Thus, the proponent thought of developing a smart menu application which enables the customers to choose their desired food and beverage using a non-paper menu - an electronic menu saved in a tablet which is considered as a popular and smart device that is widely used by everyone. The proponent believes that developing the smart menu application for Phở restaurant on Nguyen Chanh Street, Ha Noi will not only assist her friend, Congrad, but also help the entire company attain its mission and vision.
Figure 1: Statement of the Problem.
Figure 1 shows Like most restaurants, Phở restaurant [2] on Nguyen Chanh street, Ha Noi is also using the traditional order method which requires the customers to fall in line to wait for their turn. In two trial examines, the forecast got from Lewin's field hypothesis was tried. The studies uncover that customers who experience a postponement amid the pre-process and post-process period of an restaurant visit assess the administration gave more adversely than customers who encounter a deferral amid the in-procedure stage. It is further anticipated that the level of instability about the length of the postponement and an individual's need state would impact his or her impression of a deferral and assessment of the restaurant service.
Waiting can be tedious, irritating, and incredibly frustrating. Simply envision the quantity of hours which customers spent under wraps out lines in lodgings, or how eager they get to be while sitting tight in line for theater tickets or waiting to be stanned, seated in a restaurant. Maybe, everybody has their own share of waiting stories. Although some might review different events that were less inconvenient or situations when waiting was, in fact, a pleasant delay, establishments regardless of the kind of services they offer should always see to it that they provide their customers with faster and more convenient service. Depending on the context, a deferral might be experienced as an agreeable side interest or as a reprehensible inconvenience. It might pass rapidly or it might appear to keep going forever. How do customers react to different waiting situations? What are the determinants of their mental responses to such circumstances? Can a delay influence customers' overall evaluation of a product or service?
The study of waiting and delays is relevant, in particular, to services marketing. Delays undermine the efficiency with which these systems conduct their businesses; in turn, delays may affect consumers' perception of the quality of a service as well as their overall evaluation of the service. Although many delays are caused by inefficiencies in the service delivery process, waiting in some service situations seems to be almost unavoidable. For example, consumers often do not arrive at a restaurant at equal interval sequences but rather in a less predictable fashion. Moreover, some individuals may encroach upon the service time of others and cause them to wait. Managers may have difficulties regulating such waiting situations. Yet even in those situations, a service provider may be able to decrease the negative impact of such delays if he or she has some knowledge of the situational factors that influence consumers' reactions to delay. By uncovering the factors that influence psychological reactions to waiting and the contexts in which those factors occur, managers can have a significant impact upon consumers' satisfaction with the service encounter.
To overcome the above disadvantages, and help for the restaurant business units operate efficiently, serve customers quickly, promptly and in accordance with the tastes of customers in today's era. This paper study and propose a solution for the development of information technology applications to build a Smart Order Application (SOA), SOA will replace the old order process and allow restaurant to create more professional service style, customers do not have to fall in line and wait for their turn to
order. Integrate marketing in SOA, SOA will include function "Log in Facebook” which will let the customers like, share or check in at Phở restaurant on Nguyen Chanh street, Ha Noi and get free drinks or food. With SOA will make restaurant's menu vivid visually appealing, make a more effective and efficient business, it mean SOA improves the speed of service and create a new order style that benefits both the customers and the management (Figure 2). Customers will feel a comfortable and convenient dine-in experience, while restaurant will be able to reduce its expenses when it comes to manpower.
**Figure 2**: Demonstration Picture of the Idea.
---
**RELATED LITERATURE AND STUDIES**
*Review of Related Literature*
On the world, Azilen [3], the restaurant industry is an area which has remained behind the technical advances until recently, when the electronic menu (e-menu) started being used to improve catering services and increase revenue. Nowadays, the e-menu is becoming popular and changing the concept of food ordering by paper-based menus [1].
Lyle Bunn [1], the menu and promotion boards of quick serve and fast casual restaurants, bars, cafeterias, food courts and take out locations can deliver higher value to the establishment and its patrons. "Content" - the messages presented, primarily fulfill this goal based on suitable messaging technologies being in place. Menu boards typically include a product name, its image and multiple prices based on size.
By emenublog (February 24, 2015) "Digital Menu Trends 2015 – Revamp Your Airport Restaurant", has had an idea about a great e-menu which is used in airport. Many airport restaurants have already started being heavily value centric. Digital menu, being the medium of their value addition. Apart from an interactive menu that can help guests put forth their orders on their own”. Accordingly, there are a few rising integration
models that airport restaurants are increasingly utilizing for helping airport visitors, along with awesome lists of edibles such as: Integrated Language Translators, Airport Navigation, Flight Information, Games, Weather Teller, Multi-Restaurant Menu Surfer, and Availing Meal Vouchers (Figure 3).
**Figure 3:** Result of Research about Customers Waiting to Order.
In Vietnam, Quyen Hoang, "Implementing electronic menu through sales management software SAPO", many elements to the success of the business of a restaurant, there is good food, luxurious, clean, professional staff, good customer policy (Figure 4). Now, many restaurants are adopting an electronic menu to order food on tables.
**Figure 4:** The Waiters Uses Tablets to Collect Orders.
**Review of Related Studies**
On the world, Aptito's iPad restaurant menus bring to eye-catching images of each item. Regular, text-type menus simply do not draw the attention like digital ones do [4].
Aptito’s comprehensive cataloging of menu items and mouthwatering pictures introduce guests to delicious foods that would’ve otherwise gone unnoticed. Aptito provides an unparalleled dining experience with its digital menu to customer (Figure 5). With an iPad menu, customers are able to place orders, request a server’s attention, view nutritional info, send special instructions to the chef and pay electronically without the hassle of trying to flag down a server.
**Figure 5:** A Simple and Effective System to Manage Order and Payment.

Faith Merino, “Technology trends and news” (May 20, 2011), SmartCellar which allows users to select from among dry, sparkling wines, white wines, red wines, rose wines, or dessert wines, browse profiles, regions, maps, and read in any of 150 languages (Figure 6). SmartCellar is currently available in some of the most famous restaurants in the world, including Wolfgang Puck’s Cut in Las Vegas; Gordon Ramsay’s Claridges in London; Barbacco in San Francisco; and The Moorings in Newport, Rhode Island.
**Figure 6:** Digital Menu for Restaurant of Aptito.

In Vietnam, Instead of manually writing bills, Xoi Yen used tablet Nexus 7 to order food and export the bill for customers. It is can be consider as sale management software. Accordingly, every waiter is equipped with a Nexus 7 to receive requests from
customers. When customers choose the menu on the tablet, waiters simply click into cells, each cell corresponding to one dish or beverage. Immediately, that information will automatically transmit information via Wi-Fi on the server, to the coordinator for information about food, the number of the table of customer (Figures 7 and 8). Then, staff will bring food to there with the invoice along.
**Figure 7:** A restaurant Customer tries Out the Aptito App on A Digital Menu.

**Figure 8:** Interface of SmartCellar.

Similarly, at one famous Phở restaurant on Nguyen Chanh Street, Ha Noi, customers feel really interested in order style. Here every waiter has an Ipad. Customers need to look at the paper menu on the table to select items, then the waiter select items following the customers’ request but instead of manually recording order on paper like what other restaurants do, the waiter chooses items on Ipad, an automatic device will notify the computer at the kitchen and cashier to prepare food and export bill for
customer (Figures 9 and 10).
**Figure 9:** A Waiter is Equipped with an Ipad to Take Order.
CONCEPTUAL FRAMEWORK
**Existing System**
**Figure 10:** The Restaurant Process.

**Theoretical Framework of the Existing System**
Customers have to fall in line to order and pay for invoice at cashier, then they take their seats while waiting for their ordered food to be served. After eating, they leave the establishment. The problems here are: 1) Slow service and 2) Phở restaurant on Nguyen Chanh Street, Ha Noi is not yet well-known.
**PROPOSED SYSTEM**
**Theoretical Framework of the Proposed System**
First, the customers choose where their desired table. Then, they use the tablet to search and order food. Smart Menu Application displays the restaurant’s best sellers and other products in promo. This may attract the customers to order more. Besides the information about dishes, the customers can customize their order. While browsing the
menu to look for their desired food and/or waiting for their ordered food to be served, the customers can use Facebook to like, share or post picture taken in Phở restaurant. The restaurant's management may give free drinks or food to customers who capture and share the food’s photo on their Facebook walls. Consequently, both customers and restaurant owners benefit from the smart menu (Figure 11). The customers do not feel boredom as they wait for their food to be served, while the restaurant is also promoted through the said social networking site which is mostly used by people especially students (Figure 12). Once the ordered food is served, the customers just pay for their invoices.
**Figure 11:** The Proposal Process for Restaurant.

Conceptual Framework of the Study
**Figure 12:** Input-Process-Out (IPO) Chart.

METHODOLOGY
This section discusses the research design and methodology used in this study as well as data gathering instruments, preparation of instruments, retrieval of the instruments, software model used to develop the system and product evaluation.
Research Design
Research design is the framework that has been created to seek answers to research questions. The design of a study defines the study type, research question, hypotheses, experimental design, and, if applicable, data collection methods and a statistical analysis plan.
The purpose of the research design is to guide the proponent in the collection of data about the restaurant specifically its customers, cuisine, current system of taking and making orders, survey desires of customer and restaurant owner for this new project. After collecting all the necessary data, the proponent started designing a way to develop the project.
Respondents of the Study
To assess the system, the proponent purposely chose twenty respondents at Phở restaurant on Nguyen Chanh Street, Ha Noi. The respondents include five (5) co-founders, eight (8) staff, and random customers.
Data Gathering Instruments
Data gathering is an important aspect of any type of research study because data serve as foundation of any study. The data used in this study were collected using the following methods and instruments:
Observation: In this study, the proponent observed the restaurant’s order system which includes the time spent by the customers in ordering, the time spent by customers to pay their bills, and the time spent by the customers waiting for their orders to be served. After analyzing the procedure and techniques on how the proposed and existing system worked. The proponent created a new system which can solve the current problems of Phở restaurant. The proposed system aims to help Phở restaurant improve its service, hence satisfying its customers’ needs.
Questionnaire: A questionnaire is a research instrument consisting of a series of questions (the survey form) and other prompts for the purpose of gathering data from the respondents. The proponents used survey questionnaires to obtain a qualitative figure and observations of the prospective users of the proposed system. This
instrument was used to determine how the user evaluates the proposed system. The value of results depends heavily on the sincerity, truthfulness and objectivity of the respondents.
**Interview:** This method was used to get different opinions from the respondents of the study. It is considered another type of questionnaire in which the researcher gets the needed information from the interviewee verbally and directly in a face-to-face conversation. After that, the data gathered and information collected were analyzed, categorized, compared, interpreted and quantified.
**Evaluation form:** The proponent asked twenty (20) respondents to evaluate the services offered by Phở restaurant using the evaluation form made by the researcher.
**Preparation of the Instrument**
The proponent constructed a set of questions for an interview. The questions were answered and evaluated by the restaurant owner and staff and random customers.
**Retrieval of the Instrument**
Retrieval of instruments was made after its distribution and interview. In like manner, evaluation forms were retrieved after the development of the SOA framework.
**Method Used in Developing the System**
The proponent used Rapid Application Process with Prototyping in developing the system. This study aimed to design and develop a prototype of e-menu application for Phở restaurant.
Regarding literature evaluation, Agile and Rapid Application Development (RAD) are interactive software development methodologies to react to the problems with the traditional waterfall methodology [5-7]. Agile approach starts from analysis requirements and design specifications, then directly to code and test software, whereas the RAD approach uses a prototype to get feedback from customers in order to enhance the prototype until the users are satisfied. This continuous feedback loop enables an RAD prototype to correspond exactly with customer needs [6].
RAD is appropriate for a small project, which has a shorter delivery time, but Agile is suitable for a larger project [8]. Furthermore, the RAD approach can enhance the features of the prototype more rapidly to deliver a workable and satisfactory system. However, using RAD with prototyping may make a system inadequate for overall business needs if the system is accepted by only specific groups of users [9].
This research proposed RAD as a development methodology to develop a prototype for several reasons. Firstly, RAD is an incremental software development process model by
using customers’ feedback. Therefore, the quality of the prototype will be improved throughout the life cycle as shown in Figure 3 [10]. Secondly, Hoffer et al. [9] point out that system developed by the RAD model both spend shorter time and is closer to the business needs than that by the Agile and traditional models. As a result, the prototype fulfilled requirements can be and developed rapidly. Lastly, Gantthead [11] mentions that RAD is more effective than Agile for a narrow project scope with a small implementation team (Figures 13 and 14). Therefore, a prototype which implements only some features by one person is more suitable for implementation by RAD than Agile approach.
**Figure 13:** Rapid Application Development (RAD) and Prototyping Adapted from Sommerville.

**Order Management Model**
**Figure 14:** Context Diagram of Existing System.
This Figure 14 shows the context diagram of the manual system of Phở restaurant services. It can be seen that the customers go to cashier and look at the paper menu there to choose and order items that they want. The cashier confirms order, prints the bill in three copies, one for the customer, one for the kitchen and one for the manager. Afterwards, the customers pay the bill and take a seat. After receiving order details, the kitchen personnel cook and serve the food to the customers.
This Figure 15 shows the detailed representation of the work of each entity. The customers choose items from paper menu and order at the cashier. The cashier writes down the food order details given by the customers to the official receipt. Next, the cashier prints the bill, gets payment from the customer, and gives the order details to the kitchen. After paying, the customers take a seat and wait for their orders to be served. The kitchen personnel inform the cashier if the food is ready before serving it to the customers.
**Figure 15:** Diagram 0 of Existing System.

This Figure 16 shows the context diagram of the proposed system for Phở restaurant. It can be seen that the customers, as they enter the restaurant, simply need to choose their desired table and choose items from the menu on tablet. Once they have chosen the items to be ordered, they will be prompted to click "Pay". Next, the order details will be sent to the cashier to print the bill and give a copy to the kitchen (Figure 17). The administrator is the person who manages the backend of the application.
Figure 16: Context Diagram of Proposed System.
Figure 17: Diagram 0 of Proposed System.
This Figure 17 shows the detailed representation of the works of each entity. The customers use SOA to order food and pay bills at the table once the bill is brought to them by the waiter. The cashier is responsible of printing the bill upon recipient of the payment requirement. In addition, they can use Facebook on tablet and share the food’s photo to get a discount or free drink. The kitchen personnel who are sent a copy of the order will cook and prepare the items. The administrator, who is either the restaurant owner or manager can create and decentralize accounts that have the access to backend. Moreover, he or she can update the data of the application.
**STATISTICAL TREATMENT**
Statistical treatment of data is essential in order to make use of the data in the right form. Real data collection is only one aspect of any software; the organization of data is equally important so that appropriate conclusions can be drawn to compare the efficiency between the proposed system and the real system. Data were captured and estimated by weighted mean. The formula for that is: The average of a set of \( n \) data \( x_i \):
\[
\bar{x} = \frac{\sum x_i}{n}
\]
Where, \( \bar{x} \): Weighted mean; \( x_i \): Score; \( f \): Frequency; \( n \): Total frequency
The formula given above was used to evaluate the overall responses of the users about the system. Twenty respondents were selected from the restaurant including the restaurant’s manager and staff, and random customers. Concept of evaluation survey included content, functionality, usability, reliability, efficiency and security (Table 1). Each feature has point scale called satisfaction scale from 1-5 that stands for poor, fair, good, satisfaction and excellent.
**Table 1:** Satisfaction Rating Scale.
<table>
<thead>
<tr>
<th>Rating</th>
<th>Range</th>
<th>Verbal Interpretation</th>
</tr>
</thead>
<tbody>
<tr>
<td>5</td>
<td>4.51-5.00</td>
<td>Excellent</td>
</tr>
<tr>
<td>4</td>
<td>3.51-4.50</td>
<td>Satisfaction</td>
</tr>
<tr>
<td>3</td>
<td>2.51-3.50</td>
<td>Good</td>
</tr>
<tr>
<td>2</td>
<td>1.51-2.50</td>
<td>Fair</td>
</tr>
<tr>
<td>1</td>
<td>1.00-1.50</td>
<td>Poor</td>
</tr>
</tbody>
</table>
**Content:** The system includes useful features that enable the user to update of the system content.
**Functionality:** The proponent tested the system to find out whether it performs according to the intended functions.
**Usability:** The proponent ensured that the intended user of the system can carry out the intended tasks efficiently, effectively and satisfactorily.
**Reliability:** The proponent tested the reliability of the system by conducting some tests that helped discover many problems in the software design and functionality.
**Efficiency:** The proponent saw to it that all resources required by a program to perform a particular function are present to be able to satisfy the customers’ needs.
**Security:** The system is equipped with security to protect its data and maintain its functionality as intended.
**RESULTS AND DISCUSSION**
This section expresses the assessment and the statistical presentation of the data.
**Project Description**
This project aims to improve and market Phở restaurant’s service process. The project includes the application run on tablet and the backend run on web. The administrator, the owner or manager, can manage and update the date of the application. Customers may find this application convenient for its new order style which also allows them to access their Facebook account and share each food’s photo in exchange of a discount or a free drink.
**Project Capabilities**
**Backend:**
- The administrator can manage, create and centralize new accounts for anyone who needs to access or use the backend.
- The administrator can manage staff accounts.
- The administrator can update add, edit, and delete data for an application.
- The cashier can print bill.
**Application:** The customers can
- Choose items that they want.
- Make special requests for their food (e.g. less oil, more spicy)
- See the list of items that they chose and edit it if they want.
- Share the picture of the items they ordered with their friends by posting the photo on their Facebook account.
- Play games or use Facebook on tablet while waiting for the food to be served.
Click to "Pay" button to confirm their order and get the bill for payment.
Project Results
The system was evaluated objectively by taking conducting a survey about the restaurant’s current system among twenty (20) respondents that include the restaurant’s owner, cashier, staff and random customers. The survey was divided into three parts which aim to get accurate feedback from respondents. The items are as follows:
Items for the owner/manager who use and access the backend
1. The application is easy to manage, and new orders can easily be made.
2. The application is easy to use update menu
3. The application is cost-friendly.
4. The system backend is well-secure.
5. The backend provides different authority to different users.
6. The backend applies the accuracy and completeness of the data.
7. Consistency can be seen on the information needed.
8. The application contains a suited interface for the organization.
9. The application helps improve the business.
Items for the cashier/staff who may use the backend and application
1. The system backend is easy to use.
2. The application has a suited interface for the organization.
3. Application helps the staff work more effectively and conveniently.
Items for the customers who directly use the application
1. The application has a user-friendly interface.
2. The application contains pertinent and relevant graphical icons.
3. Color and overall design are pleasing to the eyes.
4. The system can be learned by users very quickly.
5. Orders can easily be made using the application.
6. The application allows the customers to make special requests for item.
7. Food’s picture can be shared using social networking sites.
Table 2 presents the respondents’ overall rating based on the system’s criteria. It shows that the respondents’ rate of satisfaction is 3.80. The system was evaluated by the individuals who work in the restaurant as well as the customers who will use it. With the similar weighted mean of 3.72 and 3.75 from owner, manager and staff of Phở restaurant, it can be inferred that the system satisfies the needs of the restaurant because it helps them manage and serve their customers more efficiently. Furthermore, the customers’ evaluation has the highest weighted mean of 3.92. This simply suggests
that the system meets the needs and standards of the customers. Besides, they can customize their order by making special requests, and they can even get a free drink or discount by sharing their favorite food via Facebook.
**Table 2: Summary of Assessment by the Respondents.**
<table>
<thead>
<tr>
<th>Criteria</th>
<th>Mean</th>
<th>Verbal Interpretation</th>
</tr>
</thead>
<tbody>
<tr>
<td>Owner/manager</td>
<td>3.72</td>
<td>Satisfied</td>
</tr>
<tr>
<td>Cashier/ staffs</td>
<td>3.75</td>
<td>Satisfied</td>
</tr>
<tr>
<td>Customer</td>
<td>3.92</td>
<td>Satisfied</td>
</tr>
<tr>
<td><strong>The average rating of satisfaction</strong></td>
<td><strong>3.80</strong></td>
<td><strong>Satisfied</strong></td>
</tr>
</tbody>
</table>
**CONCLUSIONS**
The old manual system of information requires manpower from the restaurant from writing down of orders, saving copies of receipts, and summarizing business transactions. It is also time-consuming for the part of the customers because it requires them to fall in line, place their orders and settle their bill. Waiting for their orders to be served may also take some time that can either serve the customers positively or negatively.
Using the Smart Order Application improves the restaurant’s services. It also helps the manager promote the establishment by incorporating the use of Facebook. This application meets the customers’ needs. It was evident in the survey and interview conducted that the use of this application garners positive perception and response from the respondents especially the restaurant’s manager and staff for they can manage and update the menu flexibly in a fast and convenient manner.
**ACKNOWLEDGEMENT**
Please thank the researchers at the Faculty of Economic Information systems, Information and Communications Technology University, University of Thai Nguyen, Vietnamese.
**REFERENCES**
1. [www.LyleBunn.com](http://www.LyleBunn.com)
2. [Http://phovietnv.com](http://Http://phovietnv.com)
4. Concept (2012) iPad eMenu for restaurant. [Link]
|
{"Source-Url": "http://www.icommercecentral.com/open-access/smart-order-development-solutions-apps-in-ebusiness-activities.pdf", "len_cl100k_base": 6184, "olmocr-version": "0.1.53", "pdf-total-pages": 19, "total-fallback-pages": 0, "total-input-tokens": 77426, "total-output-tokens": 7153, "length": "2e12", "weborganizer": {"__label__adult": 0.0012073516845703125, "__label__art_design": 0.0007901191711425781, "__label__crime_law": 0.00077056884765625, "__label__education_jobs": 0.003253936767578125, "__label__entertainment": 0.0001533031463623047, "__label__fashion_beauty": 0.00044918060302734375, "__label__finance_business": 0.004589080810546875, "__label__food_dining": 0.023651123046875, "__label__games": 0.0012483596801757812, "__label__hardware": 0.0016946792602539062, "__label__health": 0.00145721435546875, "__label__history": 0.0003781318664550781, "__label__home_hobbies": 0.00012028217315673828, "__label__industrial": 0.0010004043579101562, "__label__literature": 0.0006551742553710938, "__label__politics": 0.0004277229309082031, "__label__religion": 0.0006990432739257812, "__label__science_tech": 0.0060577392578125, "__label__social_life": 0.00012958049774169922, "__label__software": 0.01690673828125, "__label__software_dev": 0.93212890625, "__label__sports_fitness": 0.0002675056457519531, "__label__transportation": 0.001590728759765625, "__label__travel": 0.0005812644958496094}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 30649, 0.01876]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 30649, 0.03498]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 30649, 0.92532]], "google_gemma-3-12b-it_contains_pii": [[0, 1468, false], [1468, 3217, null], [3217, 6670, null], [6670, 8581, null], [8581, 9540, null], [9540, 10934, null], [10934, 12002, null], [12002, 12990, null], [12990, 13904, null], [13904, 16159, null], [16159, 18665, null], [18665, 19551, null], [19551, 21169, null], [21169, 21258, null], [21258, 23596, null], [23596, 25496, null], [25496, 27786, null], [27786, 29742, null], [29742, 30649, null]], "google_gemma-3-12b-it_is_public_document": [[0, 1468, true], [1468, 3217, null], [3217, 6670, null], [6670, 8581, null], [8581, 9540, null], [9540, 10934, null], [10934, 12002, null], [12002, 12990, null], [12990, 13904, null], [13904, 16159, null], [16159, 18665, null], [18665, 19551, null], [19551, 21169, null], [21169, 21258, null], [21258, 23596, null], [23596, 25496, null], [25496, 27786, null], [27786, 29742, null], [29742, 30649, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 30649, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 30649, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 30649, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 30649, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 30649, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 30649, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 30649, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 30649, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 30649, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 30649, null]], "pdf_page_numbers": [[0, 1468, 1], [1468, 3217, 2], [3217, 6670, 3], [6670, 8581, 4], [8581, 9540, 5], [9540, 10934, 6], [10934, 12002, 7], [12002, 12990, 8], [12990, 13904, 9], [13904, 16159, 10], [16159, 18665, 11], [18665, 19551, 12], [19551, 21169, 13], [21169, 21258, 14], [21258, 23596, 15], [23596, 25496, 16], [25496, 27786, 17], [27786, 29742, 18], [29742, 30649, 19]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 30649, 0.07065]]}
|
olmocr_science_pdfs
|
2024-12-08
|
2024-12-08
|
b504d0893dc4bcee432ff52fda1ad38e9c75d654
|
Homework 9: Countdown to the ICO
Due: Dec 4, 2018 6:00 PM (early)
Dec 7, 2018 6:00 PM (on time)
Dec 9, 2018 6:00 PM (late)
This is a partner homework as usual: work on all problems together; come to all office hours together; you are responsible for everything you and your partner submit and it is an academic code violation to submit something that is not yours. Check for your partner in the Google doc that was sent out. If you don’t have a partner, please let us know.
Make sure that you clearly indicate on each problem which track you’re in (either 1-credit, or full). 1-credit track: do problems 1, 3, 5 and indicate “1-credit” on each problem.
Problem 1
AR/VR applications galore! Color in this board! It’s like Magic Leap!
(15 points)
Consider a subset $S$ of squares on an $n \times n$ grid (you can think of $S$ as being some shape on a chessboard, for example). Your goal is to color as many squares in the shape $S$ as possible, subject to the constraint that in any row or column, at most $k$ squares can be colored.
Find a polynomial time algorithm for this problem (polynomial in $n$ and/or $k$).
Problem 2
Hey coder person! Help me design my 3d-printing algorithm now!
(15 points)
Consider the 3-dimensional version of the previous problem: the board consists of certain cubes from a 3-dimensional grid and a number $k$, and the challenge is to color as many cubes as possible subject to the condition that no more than $k$ cubes in any “$x$-slice”, “$y$-slice” or “$z$-slice” are marked—an “$x$-slice” is a 2-dimensional plane specified line specified an $x$ coordinate, and consists of all cubes with coordinates $(x,*,*)$ for any values of “$*$”; “$y$-slice” and “$z$-slice” are defined similarly.)
Your challenge: show this problem is in fact NP-hard.
We strongly suggest trying to prove this from the following NP-complete problem: “3-way matching”. Analogously to bipartite matching, there are now 3 sets that need to be matched up, and certain compatible triples. For example, a company has certain jobs that need to be done, certain employees to do them, and certain offices available for the employees to work in. Certain triples—given as input—are possible, for example: “Alice is willing to work job X if she gets office 101”, “Bob is willing to work job Y if he gets office 99”, etc. It is NP-complete, given such a list as input, to find the maximum number of triples you can match, where no person, job, or office can be matched more than once.
Problem 3
It’s like Tinder, but for TA hours!
1. (10 points) Consider a version of the “bipartite maximum matching” problem, where there are \( n \geq 100 \) people on the left, exactly 100 people on the right, certain pairs of them are willing to get married (“matched”), no one can get married twice, and we want to end up with 100 marriages (the “maximum matching”).
Recall from class that you can set this up as a max-flow problem, by considering the people as a graph with 1 unit of capacity along each edge connecting a person on the left to a person they are willing to marry on the right; additionally, each person on the left has an edge from the source \( s \) with capacity 1 (representing the constraint that each person on the left can have at most 1 marriage), and each person on the right has an edge going to the sink \( t \) with capacity 1 (representing the constraint that each person on the right can have at most 1 marriage). The algorithm works by first running one of the maximum flow algorithms we have seen, and then marrying any two people that have flow between them.
For this part, modify this construction so that it solves the problem with the additional constraint: the first 40 people on the left must get married. Prove that your construction is a correct algorithm.
Please include a diagram. Your proof should be sure to touch on the following points: 1) any assignment returned by your algorithm is a valid marriage plan; in particular, be sure to point out that integer capacities on edges implies that the flow returned by the algorithms from class will have integer values; 2) any marriage plan could be converted into a flow that satisfies the constraints you describe, proving that your algorithm does not “miss out” on any good marriage plans.
If you want to think about this problem without a hint, stop reading now. Otherwise: the point is that this graph flow terminology makes it is very easy to express upper bound constraints, just by adding capacities appropriately, however lower bound constraints, such as the constraint that the first 40 people must get married, seem hard to capture. The key insight is that lower bounds on those 40 people can be expressed as upper bounds somewhere else. \( 40 + 60 = 100 \). Namely, at most 60 marriages can occur among all the other people on the left.
2. (10 points)
Consider the (apparently very different though actually very similar) problem of scheduling weekly TA office hours in a course. The course has decided it must hold exactly \( H \) office hours every week. Suppose there are \( n \) TAs on the course staff and \( m \) non-overlapping one-hour slots throughout the week during which TAs may hold office hours; however, no more than one TA can be assigned to each hour. Each TA \( i \) is available only during some subset \( T_i \subseteq \{1, \ldots, m\} \) of the weekly slots; further, each TA has to hold at least 2 hours every week. Your task is to assign TA staff to TA hours in a way that satisfies all aforementioned constraints.
**Hint:** Design your algorithm as an adaptation of your algorithm for the previous part, using a max-flow algorithm as a subroutine (how do each of the elements of this problem correspond with elements from the problem of the previous part?). You might want to first consider the problem without the constraint that each TA must cover at least two hours.
Include a proof of correctness, though feel free to make use of concepts from the previous part to avoid repeating yourself.
Problem 4
It’s like Tinder, but for finding a job at a start-up!
(20 points total) At a job fair, there are $n$ students, and $m$ recruiters, and certain pairs of students and recruiters want to meet for an interview. There are 10 time slots in which interviews can occur, numbered 1 through 10, and we want to arrange a schedule of interviews so that every desired interview is on the schedule. Each student or recruiter can only be in 1 interview at once. If some student or recruiter has more than 10 interview requests, then scheduling interviews with only 10 interview times is clearly impossible; however if all students and recruiters have at most 10 people they each want to meet, then your task is to prove a) an interview schedule is possible, and b) you can find it in polynomial time.
1. (5 points) Prove that you can schedule a single round of interviews that gives every student an interview, if the following condition holds: there is no set $S$ of students such that the total set of recruiters they want to meet, across all their requested interviews, is smaller than $S$. (Hint: represent this as a max-flow problem, use the fact that “max-flow equals min-cut”, and then show that any cut of capacity less than $n$ can be transformed into a set of students $S$ where the total number of recruiters they want to meet is smaller than $S$.)
2. (8 points) Consider the simplified case where $n = m$ and every student and recruiter has exactly 10 interview requests. Show that there exists a “perfect matching” between students and recruiters, namely that in a single round of simultaneous interviews, you can schedule everyone an interview with no conflicts.
3. (2 points) Given the nice structural result you proved above for the simplified case where every student and recruiter has exactly 10 interview requests, now show how to transform the original problem to this case. Namely, given an arbitrary list of interview requests such that no one is involved in more than 10 interviews, describe a polynomial time algorithm that creates imaginary interview requests, and, optionally, imaginary students and recruiters, such that the new total number of interview requests for every (real or imaginary) person equals exactly 10. (Note/Hint: it is easier if you allow student-interviewer pairs to request multiple interviews with each other.)
4. (5 points) Fill in the remaining details of your algorithm and prove its correctness: show how to schedule interviews in the 10 slots so that every interview request is satisfied. (Do not write a maximum matching algorithm here; just refer to the max-flow algorithm from class. Fill in the details explaining how to use this algorithm to solve the interview scheduling problem.)
Problem 5
My bitcoin mining app isn’t fast enough! Help me make it faster—but you better not want equity!
(30 points total) In this problem you will be designing an algorithm to transpose a 4096×4096 ($2^{12} \times 2^{12}$) matrix of 4-byte entries on a graphics card. You will write pseudocode for this, and analyze it in enough detail to confidently predict its performance when run on thousands of threads in parallel on a detailed model of a modern Nvidia graphics card. See the slides from http://developer.download.nvidia.com/compute/cuda/1.1-Beta/x86_website/projects/reduction/doc/reduction.pdf as covered in lecture for examples.
The reason you cannot simply copy each entry $A[i + 4096 \cdot j]$ of the matrix to its location in the transpose $B[4096 \cdot i + j]$ is that if the input matrix is accessed in row-major order, the output matrix will be accessed in column-major order, and one of these two orders will be very wasteful of memory resources (remember homework 3 problem 2).
Finding the right way to do this on a graphics card requires understanding the different parameters of a graphics card’s performance and how they fit together. The basics are below; see the appendix at the end of this document for a more complete introduction to the graphics card model of computing.
**Important Time Constraints**
- **Global memory:** It takes 200 ns to access one 128-byte page of global memory.
- **Shared memory:** It takes 1 ns to access 4 bytes (one element) from one bank of shared memory.
- **Registers:** Registers are free.
**Important Size Constraints**
- There are 8 multiprocessors, each of which can process one thread block at a time. A block can have up to 32 warps. A warp contains exactly 32 threads, which all run in lockstep (each of the 32 threads in a warp runs the same code, at the same time, though possibly on different data). Each multiprocessor has 128 cores, and thus at each nanosecond, a multiprocessor can make progress on up to 4 warps at the same time.
- Each multiprocessor has 32 KB of shared memory, which is broken up into 32 interleaved (striped) banks of equal size.
- There is room for 64K ($2^{16}$) 4-byte registers per multiprocessor, though you should not need most of this.
**Questions**
1. (2 points) Suppose we used only 1 multiprocessor and only 1 thread. How long would it take to read in 128 bytes from global memory, assuming that each load request must be serviced before the next request can be made? How long would it take if we used 1 warp instead?
2. (2 points) If a block contains 32 warps, how many registers can each thread use? How much shared memory can we dedicate to each thread? (Shared memory is shared across all threads in a thread block, but it is often useful to think in terms of ratios like “memory per thread”.)
3. (a) (1 point) How long would it take for 1 warp to access 32 4-byte elements from the same bank of shared memory?
(b) (1 point) How long would it take for 1 warp to access 32 4-byte elements if each element is in a different bank?
4. (5 points) Write pseudocode to read in a $32 \times 32$ matrix from a $32 \times 32 \times 4 = 4096$ byte block of global memory $g_{I}$ to shared memory, and then output its transpose to a block of memory $g_{O}$. Your code must: 1) use 1 block of $32 \times 32 = 1024$ threads, 1 thread per entry of the matrix; 2) each time a warp of 32 threads reads or writes global memory, the 32 threads must collectively touch exactly one 128 byte block of global memory. (You may assume that the blocks $g_{I}$ and $g_{O}$ are aligned to 128-byte boundaries.)
You should write one function, which takes as input two locations in the graphics card’s global memory: the input array \( g_I \) of 1024 single-precision floating point numbers (each taking 4 bytes of memory), and an output array \( g_O \) of the same size.
**Hint:** You have to make use of shared memory; also, don’t forget to surround any shared memory writes with \texttt{syncthreads()} synchronization barriers, if you expect other threads to be reading from this location. See the appendix for more details on writing pseudocode for graphics cards.
5. (5 points) Write pseudocode as above but with the additional constraint that each time a warp of 32 threads reads or writes shared memory, the 32 threads must collectively touch each of the 32 banks of shared memory exactly once. (This should require a small but clever modification to your solution for the previous part, tweaking how you use shared memory, and possibly also how much you use.)
6. (4 points) Solve the original problem subject to the rules of the last two parts: modify the pseudocode of the last part to construct the transpose of a 4096 \( \times \) 4096 matrix. You should write one function, which takes as input two locations in the graphics card’s global memory: the input array \( g_I \) of 4096 \( \times \) 4096 (\( 2^{12} \times 2^{12} = 2^{24} \)) single-precision floating point numbers (each taking 4 bytes of memory), and an output array \( g_O \) of the same size.
You must specify the execution configuration, which consists of two numbers describing how the code should be run in parallel: the block size, which specifies how many threads are in a thread block, and the number of blocks.
7. (5 points) Motivate, explain, and analyze your pseudocode for the last three parts to convincingly demonstrate that you have solved the problem.
8. (5 points) Estimate how long your final matrix transpose code will take to run, using the following parameters:
- Any request to global memory will take at least 200ns (one nanosecond, abbreviated “ns”, is \( 10^{-9} \) seconds), though other warps on a multiprocessor may make progress while one warp is waiting for memory.
- The total bandwidth to global memory is 200GB/s across all multiprocessors.
- Each bank of shared memory can transfer one 4-byte element per nanosecond. (Recall that each multiprocessor has 32 banks of shared memory, and there are 8 multiprocessors.)
- Otherwise, assume that at each nanosecond, for each block of 32 (out of 128 total) cores in a multiprocessor, a warp of threads will start execution of a new instruction.
**Note:** Since there is a limit of 200GB/s on memory transfers, and our matrix takes 4096 \( \times \) 4096 \( \times \) 4(bytes per element) = 64MB of memory, and transposing this matrix involves both reading it, and writing its transpose, this cannot possibly happen in less than \( \frac{128MB}{200GB/s} = 0.00064 \) seconds. It would be nice if your code were close to this fast, though this question only asks you to accurately analyze the performance of the code you have written, whether or not it is fast. However, the fact that each warp of your pseudocode accesses both global and shared memory in the most efficient possibly way, combined with a high number of threads to help ensure that each multiprocessor always has something to do, means that your code should run very fast, or at least should be easy to tweak into code that runs very fast! (Recall that “MB” in some contexts means \( 10^6 \) bytes, in other contexts means \( 2^{20} = 1.048576 \cdot 10^6 \) bytes; we are not worried about this distinction in this assignment.)
Appendix
Memory model
Each group of 32 threads (a warp, as defined below) has its memory accesses dealt with separately. Global memory (“RAM”) can only be accessed in 128 byte chunks, which correspond to exactly 32 4-byte entries. Namely, if a warp of 32 threads simultaneously accesses memory locations 0 through 31 of a single-precision (4 bytes per element) array \( A \), then a single 128 byte memory transfer will occur; if these threads instead access locations 20 through 51, then two 128 byte memory transfers will occur, one for locations 0 through 31, a second for locations 32 through 63, even though half of these memory transfers are wasted. If these threads instead access locations 0, 100, 200, 300, ... 3100, then \( 32 \times 128 = 4096 \) bytes of memory must be transferred while the 32 threads only make use of 4 bytes of memory each, at an efficiency of \( \frac{32 \times 4}{4096} = \frac{1}{32} \).
Crucial parameters: each global memory access has a latency of at least 200ns (0.000 000 2 seconds) between when it is requested and when it is delivered to the thread. In addition, the total rate at which memory may be transferred, to and from all threads on the graphics card, is at most 200GB/s (gigabytes per second).
In addition to global memory, there is also shared memory, and registers (see below for definitions). Registers you may consider free to access.
Shared memory consists of 32 interleaved banks, storing 4 byte entries. If you are storing a single-precision (4 bytes per element) array \( A \) in shared memory, then entries 0, 32, 64, 96, ... are stored in bank 0; entries 1, 33, 65, 97, ... are stored in bank 1; entries 2, 34, 66, 98, ... are stored in bank 2, etc. Crucially, each bank of shared memory may transfer one 4-byte entry per nanosecond. Thus if a warp of 32 threads accesses entries 0 through 31, this can be completed in one nanosecond. However, if a warp of 32 threads accesses entries 0, 16, 32, 48, 64, 80, 96, ..., then this will make use of only banks 0 and 16, and each of these two banks will have to transfer 16 entries each, which will thus take at least 16 nanoseconds to finish.
Hardware model
Our graphics card consists of 8 multiprocessors, each of which contains 128 cores, each of which execute code at 1GHz (billion instructions per second). Each thread block is executed on a single multiprocessor. Each multiprocessor contains 32KB (\( 2^{15} \) bytes, or \( 2^{13} \) single-precision values) of shared memory, and \( 2^{16} \) 4-byte registers. Registers store values private to a single thread, including loop indices like \( i \) and \( j \), or intermediate values of computations. The number of registers used by your code times the number of threads in a block must be less than \( 2^{16} \) in order for your code to be able to run.
Global memory is visible to all threads; shared memory is visible to only those threads in the same thread block; registers are only visible to a single thread. Namely, if your code stores variable \( i \) in a register, then each of the threads will have a separate version of \( i \); if your code stores \( i \) in shared memory, then each thread block will have a separate version of \( i \); if your code stores \( i \) in global memory, then all threads will share the same \( i \).
The number of thread blocks can (and often will) be larger than 8 (the number of multiprocessors), in which case the thread blocks are executed in some order, one per multiprocessor, until all thread blocks have been processed.
A thread block is processed on a single multiprocessor, one instruction at a time, in groups of 32 threads known as a warp. The number of threads in a thread block may be as large as 1024 (2\(^{10}\)), and in particular may be larger than the number of cores on a multiprocessor (128). If the number of threads in a block is less than 128, then some cores in the multiprocessor will be idle. At each nanosecond, the multiprocessor chooses 4 warps of 32 threads, and starts the execution of the next instruction from each warp, in parallel on its 128 cores.
Some instructions, such as global memory accesses, will take a long time to return their value; this architecture makes efficient use of that time by allowing more warps to be executed while waiting for the results from instructions on other warps. Explicitly: if warp A executes a load from global memory into a register x, then execution of warp A cannot continue until register x (for each of the 32 threads in warp A) gets filled from memory, which will take at least 200ns; crucially, the graphics card will continue work despite the stalled warp A, by finding some other warp B that can execute an instruction, and executing its next instruction. All this happens every nanosecond. The converse situation, where warp A stores values to global memory does not stall the warp, because (even though memory may not be written for another 200ns) the processor does not need to wait for any new information to continue execution.
If the `syncthreads()` instruction appears, then all threads in the thread block will wait here at this “synchronization barrier” until every thread has reached this point and all memory accesses are complete. Synchronization is a vitally important part of parallel programming. CUDA makes it very easy to synchronize within a thread block (running on a single multiprocessor), but strongly discourages any attempt to synchronize across the 8 multiprocessors.
**Coding for graphics cards**
Your code should be standard pseudocode, to be run by each of the \( (\text{block size}) \times (\text{number of blocks}) \) threads, with the following additional abilities: your code can ask for the block size, it can ask for the number of blocks, it can ask for its thread number (a number between 0 and \( (\text{block size}) - 1 \)), and its block number (a number between 0 and \( (\text{number of blocks}) - 1 \)). Every variable must be stored either in global memory, shared memory, or in a register, and you must specify this in your pseudocode (anything you do not specify will be assumed to be stored in a register); arrays taken as input or output to your function will be located in global memory. Finally, there is exactly one synchronization primitive your code may call: `syncthreads()` “waits until all threads in the thread block have reached this point and all global and shared memory accesses made by these threads prior to `syncthreads()` are visible to all threads in the block.”
Recall the pseudocode for adding two vectors, one entry per thread.
```plaintext
vecAdd(A,B,out)
register i = getMyThreadIndex() + getMyBlockIndex() * getBlockSize();
out[i] = A[i] + B[i];
```
|
{"Source-Url": "http://cs.brown.edu/courses/csci1570/content/homeworks/9.pdf", "len_cl100k_base": 5375, "olmocr-version": "0.1.50", "pdf-total-pages": 7, "total-fallback-pages": 0, "total-input-tokens": 19349, "total-output-tokens": 5964, "length": "2e12", "weborganizer": {"__label__adult": 0.0005340576171875, "__label__art_design": 0.0006079673767089844, "__label__crime_law": 0.0005793571472167969, "__label__education_jobs": 0.0173797607421875, "__label__entertainment": 0.00012153387069702148, "__label__fashion_beauty": 0.0002963542938232422, "__label__finance_business": 0.0003478527069091797, "__label__food_dining": 0.00060272216796875, "__label__games": 0.0017004013061523438, "__label__hardware": 0.005870819091796875, "__label__health": 0.0004701614379882813, "__label__history": 0.0005087852478027344, "__label__home_hobbies": 0.0004024505615234375, "__label__industrial": 0.0012340545654296875, "__label__literature": 0.0004069805145263672, "__label__politics": 0.0003812313079833984, "__label__religion": 0.0007996559143066406, "__label__science_tech": 0.03802490234375, "__label__social_life": 0.00025725364685058594, "__label__software": 0.00800323486328125, "__label__software_dev": 0.91943359375, "__label__sports_fitness": 0.000518798828125, "__label__transportation": 0.001079559326171875, "__label__travel": 0.00029540061950683594}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 22751, 0.03733]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 22751, 0.25791]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 22751, 0.92537]], "google_gemma-3-12b-it_contains_pii": [[0, 2489, false], [2489, 6022, null], [6022, 9409, null], [9409, 12370, null], [12370, 16020, null], [16020, 19564, null], [19564, 22751, null]], "google_gemma-3-12b-it_is_public_document": [[0, 2489, true], [2489, 6022, null], [6022, 9409, null], [9409, 12370, null], [12370, 16020, null], [16020, 19564, null], [19564, 22751, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 22751, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 22751, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 22751, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 22751, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, true], [5000, 22751, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 22751, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 22751, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 22751, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 22751, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 22751, null]], "pdf_page_numbers": [[0, 2489, 1], [2489, 6022, 2], [6022, 9409, 3], [9409, 12370, 4], [12370, 16020, 5], [16020, 19564, 6], [19564, 22751, 7]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 22751, 0.0]]}
|
olmocr_science_pdfs
|
2024-11-28
|
2024-11-28
|
bbccccbb07d2d1e2344eb18b3dbc98cb8ae7359b
|
Applying MUPE Context Producers in Developing Location and Context Aware Applications
Kimmo Koskinen¹, Kari Heikkinen¹ and Jouni Ikonen¹
¹ Lappeenranta, University of Technology, Laboratory of Communications
P.O.Box 21, FIN 53850
Abstract. Location based services (LBS) and applications have recently emerged as a significant application area. However, location based services and application could also benefit of the dimensions of the contextual data. Multi-User Publishing Environment (MUPE) has a built-in context mediation capability that allows the application developer to concentrate on using contextual data and thus enabling rapid prototyping of location and context aware applications. In this paper MUPE context producers are applied so that the applications can exploit the different available context in a manner suitable to their logic. This paper purposes to demonstrate that context mediation is a powerful tool to speed up the prototyping process and to enable an efficient application development.
1 Introduction
Mobile devices have changed the way people use their time. These devices and the applications within them can react to various contexts with built-in sensors and contexts received through communication links. Thus, mobile devices are ideal terminals for e.g. location and context-aware services and applications due to possibilities they offer. However, applications development can be very time-consuming, as a lot of time is needed building the infrastructural support for the application and testing the application in real live test bed. This paper focuses on how the MUPE helps the developer in context mediation.
During the past few years, context and context awareness has raised a lot of research interest, especially within the Ubicomp (http://www.ubicomp.org) and Pervasive (http://www.pervasive.org) conferences. The different dimensions of the context have been quite extensively studied, e.g. in [1-3]. A good description of context computing and different layers of it is presented in [1]: context computing focuses both on identifying/collection the context and using the collected contextual information. In [2, 3], support for context provisioning on mobile devices is discussed. It is being suggested that the mobile devices would collect the context, but that can be highly resource consuming and thus context provisioning is highly important. However, context production relevant to the application logic is quite often omitted in these approaches. Furthermore, most of the approaches concentrate on the semantics and ontology for
different contextual raw data. In [4], guidelines for mediation of context-aware applications are presented. These guidelines are redundant mediation technologies to support more natural and smooth interactions, facilitators to support user input and feedback, defaults contexts to minimize user mediation and ambiguity should be retained until mediation is necessary. As [4] also points out, mainly time and location are widely used on context awareness studies. Applications could benefit more, if contexts could be added or mediated to the application logic. In [5], a context toolkit for aiding the development of context-enabled application is presented. In [6], a context broker is introduced that is able to mediate between different context sources, has built-in semantics etc. Such a task, semantically bullet proof, can be very ambiguous task.
Location is possibly the most common context used. Location information is used in games [e.g. 7], GIS Applications and systems [e.g. 8], location dependant applications in sensor networks [e.g. 9], a model for ambient intelligence [e.g. 10], in guiding systems [e.g. 11]. The Pervasive conference has an annual workshop dedicated to Location and Context Awareness, e.g. in 2005 http://loca2005.context-aware.org.
Thus, we have concentrated on applying a solid middleware framework (MUPE [12], Multi-User Publishing Environment) to ease the development of location and context-aware applications. MUPE contains an interface for context producers that are the most important components for the purpose of this paper. MUPE context producers provide an easy way to add contexts to application logic as context producers act as mediator of contextual raw data. Any single context producer can provide context information to any MUPE application.
This paper is further structured so that Chapter II will present the characteristics of the context sources and context mediation in more detail. The approach is demonstrated with a location and context-aware application (TRIX) in Chapter III. TRIX (Tribal Exchange) is a game that uses variation of contexts in the game play. Final chapter (Chapter V) will conclude the paper.
2 Producing and Mediating Context
Applying external context in applications can be complicated. Many different information sources can produce information that could be used as contextual information both in applications and in information systems. We examine few contextual information producers that relay the information to a MUPE application. For application development, five different context producers were implemented; 3 (three) different location information producers (LIS, Ekahau and RFID-tag), weather information (environmental context) and recumbent exercise device (physiological context). These context producers fetch the information from the following information systems and information sources (see table 1 for further details how the context information is fetched):
- LIS (Location Information System) is an information system that is a middleware platform built to collect and deliver positioning information in a wireless local area networks (WLANs).
Ekahau Positioning Engine is a commercial product that can provide coordinate based location information.
RFID (Radio Frequency IDentification) is a RFID-tag that were put in several places
FMI.FI is on-line weather information maintained by the Finnish meteorological institute that can provide environmental context such as temperature, air humidity, wind speed etc.
Recumbent exercise bike is an exercise bike that can provide physiological context such as heart rate and cycling speed
<table>
<thead>
<tr>
<th>Context Source</th>
<th>How the context is fetched?</th>
<th>Communication / Interface/Protocol</th>
</tr>
</thead>
<tbody>
<tr>
<td>LIS</td>
<td>Location information is based on a cell-id of an access point. The context producer (CP) is configured to follow selected hardware addresses of wireless network cards in use. The CP queries frequently the positions.</td>
<td>Communication is done through the SOAP interface.</td>
</tr>
<tr>
<td>EPE</td>
<td>EPE requires radio finger printing of the used area. The context provider acts as a client for EPE. Coordinate, floor, area and probability of a user being on that location area are recorded from the location observations provided by EPE. CEP atoms are formed from the received information and updated to MUPE applications on selected intervals.</td>
<td>The information is fetched through Java RMI interface in two second intervals</td>
</tr>
<tr>
<td>RFID</td>
<td>The ID of a passive RFID tag is read by a RFID reader. After the tag is detected, designated software reads the content of a passive RFID tag and acts as a TCP server for applications. The CP gets the information about the detection and changes the relevant CEP atom.</td>
<td>The reader had a serial interface which is used to inform that a tag is detected. TCP is used as a protocol to carry the context information.</td>
</tr>
<tr>
<td>FMI.FI</td>
<td>The weather context provider fetches information (once in hour) from the web pages and parses selected weather parameters from the page. The parsed results are sent to the MUPE application in a CEP atom format.</td>
<td>HTTP is used to obtain the information from the web pages.</td>
</tr>
<tr>
<td>Recumbent</td>
<td>A software component was implemented for reading exercise data from the bike and serving data over a TCP connection. A protocol for transferring exercise data over a TCP connection was also designed. This protocol enabled a client to request data from the recumbent. The context producer gets the exercise data via TCP and converts it to a CEP atom format.</td>
<td>This information is read via a serial interface in a format which is defined by the manufacturer. The exercise data is transferred via TCP to the context producer.</td>
</tr>
</tbody>
</table>
Table 1. More detailed information about the Context Producers.
Figure 1 show how contextual information is processed for a MUPE application. The context information is fetched from various sources by the context producer components. They relay the source specific context data to the context manager middleware.
component. This component stores the context data and maps the context source object id to a application specific object id. The most important functionalities are conditionally (if-then-else) structured XML scripts that can be used to make Java method calls in the MUPE server. The MUPE server is contained in the MUPE World Manager component. This component contains the Context manager object. This object contains methods for processing the received contextual information. Context information is given in the parameters of the method of the object.
Let us examine one context information source (LIS) and the context processing in more detail; Figure 2 presents a message scheme how location information is transferred from LIS to a MUPE application by using LIS context producer and MUPE context manager. First, a request (see Listing 1) by LIS Location Context Producer to the LIS system is made (the scheme also shows used parameters both for request and answer messages). Secondly, LIS answers to the request. See Table 2 for examples of implemented SOAP request methods and triggers. Other implemented SOAP requests were GetLocationInfo (about a specific cell id), GetLocationList (lists all cell ids). Other implemented SOAP triggers were DeleteTrigger (deletes the trigger) and FireTrigger (follows the user/device within LIS).
Fig. 1. Context Originating systems and MUPE context processing.
Fig. 2. Context Mediation sample from the Location Information System to the Application.
Table 2. Two Implemented SOAP methods and triggers.
<table>
<thead>
<tr>
<th>Method</th>
<th>Description</th>
<th>Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td>GetUserLocation</td>
<td>A SOAP request that obtains the last known location of a given MAC address.</td>
<td>target: target of a request<br>caller: caller of a request<br>service: the service that requests<br>password: service password<br>type: type of a target (e.g. mac-addr)<br>returnvalue: \textit{GetUserLocationResponse}, that contains cell-id and the timestamp</td>
</tr>
<tr>
<td>SetTrigger</td>
<td>A SOAP trigger that assigns the given trigger to a specific user.</td>
<td>target: the user to be followed<br>service: the service that requests<br>password: service password<br>uri: namespace for the trigger<br>proxy: URL address of the method<br>returnvalue: trigger ID-number</td>
</tr>
</tbody>
</table>
Listing 1 shows (below) an example of data that is received from the LIS and further converted into XML for CEP-protocol. A CEP-message informs that user defined with hardware address 00:08:02:F6:01:7F is located in a cell defined as LTY_6609. In addition the message includes the timestamps of the observation and the description of the cell.
```xml
<atom name='LISLocation' timestamp='2005-9-5 1:23:26,00 +1' source='http://gamesrv.wlpr.net:1234' userId='00:08:02:F6:01:7F'>
<string name='timestamp'>2005-10-04 19:15:35… </string>
<string name='location'>LTY_6609 </string>
<string name='description'>…building, 6th fl. </string>
</atom>
```
Listing 1. Cell information in CEP-XML format.
Thirdly, after getting the cell-id on a given time the context producers transforms the information into a CEP atom form and gives it to a MUPE context manager. The context manager can carry out actions based on the received information. Any application can use the same logic and so each application does not need a component of its own. Inside the MUPE context manager there is three phases; first the CEP atom object is converted into an ID identifiable by an application (see listing 2).
```xml
<addUserMap>
<userMap>
<contextProducerName>Wlan-positioningsystem</contextProducerName>
<contextProducerId>00:08:02:F6:01:7F</contextProducerId>
<serverId>Brian</serverId>
</userMap>
</addUserMap>
```
Listing 2. Conversion of a CEP atom.
This converted information is stored and a script engine component is informed about an arrival of a new context. This script engine component contains the if-then-else conditional functionalities. These conditions can reference the stored information inside the MUPE context manager. If these conditions are met, the actions can be carried out in the MUPE application (server). The MUPE middleware platform contains tools for making such scripts. Listing 3 shows an example script of a method call named clientSetLocation.
```xml
<?xml version="1.0" encoding="ISO-8859-1" ?>
<script id='lis' <-- namespace addresses (see list 4)
<if> <atomChanged>
<atomRef userId='*' name='LISlocation'> </atomRef>
</atomChanged>
<actions> <mupeCall>
<![CDATA[2::clientSetLocation ${userId} ${LISLocation::location}]]>
</mupeCall>
<actions>
</if>
</script>
```
Listing 3. Example of a triggered script.
The context sources were not optimal in many manners:
- Weather information can be updated more frequently than an hour to the MUPE server, but this is redundant as our context source (FMI.FI) updates the information only in hourly base. We could have different sensors of our own to provide similar and more frequent data.
- For production system, it would definitely be more efficient to make the recumbent reader programs to output CEP atoms directly. The server part for recumbent and context producer is not directly embedded to our system currently. In the next stage context producer should do this job directly. However, a separate context producer can handle a bigger load than the reader program (which could reside on a less powerful computer). Similar approach should be taken with RFID-information also.
- The Mobile Phone can also act as a reader by using NFC (Near Field Communication) shells inserted into a mobile phone. However, for the moment there is not open source software available for this purpose.
2.1 MUPE Analysis
This short subchapter purposes to compare the MUPE approach in both addressing context information (e.g., location) and technical details. This analysis is partially based on Korpipaa Ph.D. thesis (Blackboard-based software framework and tool for mobile device context awareness). Korpipaa introduces the definitions for context and context awareness (mostly Dey`s definitions) and furthermore, offers critique related to the context awareness research. Korpipaa lists three major areas:
• Determination of an appropriate set of canonical contextual states may be difficult or impossible. In MUPE use of context is application oriented, and thus this dynamic aspect of context can be overlooked as the handling of the collected context does not vary in the application logic unless the developer has designed it so.
• Determination of what information is necessary to infer a contextual state may be difficult. In MUPE this aspect is the same. However, yet again, it is up to developer to decide the level and the use of collected context. In the beginning, MUPE was built for mobile games, and thus the approximation of real context is enough. However, we can argue that MUPE is not an optimal solution for ‘real’ applications.
• Determination of an appropriate action from a given action may be difficult. In MUPE this is the Java action call. Dedication to Java may be in some cases a clear bonus, but for some application areas a disadvantage.
Korpipaa also compares different context frameworks (e.g. Dey’s context toolkit). Context toolkit consists of components that provide for applications the functionalities for handling the context. Korpipaa also lists a number of client-to-server models, blackboard-based context architecture models and models that are somewhat related to the context management. MUPE is listed in the last category. Comparing MUPE to other alternatives some aspects can be pointed out:
• MUPE has a networked blackboard-based context engine with some similar features to Korpipaa solution (e.g. support for context requests)
• MUPE context engine is designed differently, as the contexts come from outbound entities and thus MUPE does not need context to operate. However, the applications can directly benefit from various contexts
• The response times in MUPE are lower as the applications are in the server side (not in the client). However, the protocol support and security issues in MUPE need to much better, e.g. due to privacy reasons
• Context handling is different, as MUPE handles context in compound structures. However, sensors could send a lot of information and is not feasible to do all processing (and consume the battery) in the mobile device.
• MUPE does not directly support any databases. LIS system in this paper contains databases, but MUPE does not directly access those databases.
• MUPE does not address context recognition, customization of contextual information and context relevant application control
3 How Applications Benefit of Context Mediation
Applications may have very different type of use for context data. Still there are common operations that the context aware applications have to handle. When a new context data arrives from the context source, actions need to be done based on the data. To demonstrate the possibilities of a context use, a mobile game named Tribal Exchange (TRIX) was implemented. TRIX is a game, which combines virtual world and physical game environment together. Game world is constructed from a map, where
each tribe (player) has multiple houses. One of the houses acts as headquarters (village) and the other houses are housing quarters. Idea of the game is to protect houses from different nature catastrophes. Houses are protected by building walls around the houses. The game is divided into phases. If a tribe has successfully protected all their buildings in the end of the phase, they will get another building. Otherwise unprotected buildings are removed from the map. A wall can be built only on a flat ground. Rocks, forest and water prevents building.
Building of a wall requires tribes to collect codes from the game environment. Codes are free form text strings. Codes map to the utilities in the virtual word. These utilities can be pieces of wall or tools to remove obstacles like rocks. Wall pieces are owned by tribes and exchanging building blocks with other tribes plays an important part in the game. These game pieces can be searched by using location information. Code pieces have a location, which is available from the location context produced from LIS. The players define their device address and after that they can request codes in their location. A player can use only one code at a time, even if the current location would contain more codes. Another context used in TRIX is weather-related contextual data. These are temperature, humidity and wind speed. New weather input changes durability of different wall pieces. Example of a weather effect is that walls built of ice start melting if temperature rises above zero. When the durability points of a wall piece are used up, the wall breaks and must be replaced with a new wall piece. The durability changes are defined with context manager scripts. The rules (e.g. <![CDATA[2::clientDoDamage {$userId} {128} {-2}]]>) have different if conditions; in the sample above, if the value of humidity is between 80 and 100, the clientDoDamage function triggers an event in the game that decreases the properties of an wall piece (in this case, a straw, identified by the number 128) by two (which in a game logic decreases the durability of a straw by two). Other weather rules were temperature, air pressure, wind speed, wind direction and cloudiness. Furthermore, events (in the area) such as lightning strike(s), forest fire, earthquakes, flood, tsunami, meteorite rain etc. have their own rules. Mostly, the effects were scaled down, because some events (e.g. earthquakes in Finland need only 2.0 Richters) do not take place frequently.
4 Conclusions
This paper presented how MUPE application platform can be applied in developing location and context-aware applications. As the context production resides on the server side, the mobile terminal resources are not exhaustively consumed and leaving the scarce resources for the mobile device. The paper presented several context producer implementations that are an integral part of the application logic. The context production is implemented by creating special context producer components, which provide a uniform access to context data. This set-up allows the developer to concentrate on the application and content design. The applications can benefit from the context mediation because the trigger scripts can be reusable and can be part of any application logic.
References
10. I. Saitoh, Reconfiguration and location-based services: A location model for ambient intelligence, Proceedings of the Smart objects and ambient intelligence: innovative context-aware services (sOc-EUSAI ’05), October 2005.
|
{"Source-Url": "http://www.scitepress.org/Papers/2006/24862/24862.pdf", "len_cl100k_base": 4493, "olmocr-version": "0.1.50", "pdf-total-pages": 9, "total-fallback-pages": 0, "total-input-tokens": 19848, "total-output-tokens": 5382, "length": "2e12", "weborganizer": {"__label__adult": 0.0003650188446044922, "__label__art_design": 0.0004856586456298828, "__label__crime_law": 0.0005469322204589844, "__label__education_jobs": 0.0012111663818359375, "__label__entertainment": 0.00012922286987304688, "__label__fashion_beauty": 0.0002135038375854492, "__label__finance_business": 0.0002918243408203125, "__label__food_dining": 0.0003762245178222656, "__label__games": 0.0014276504516601562, "__label__hardware": 0.002872467041015625, "__label__health": 0.0007171630859375, "__label__history": 0.0004935264587402344, "__label__home_hobbies": 8.440017700195312e-05, "__label__industrial": 0.0005064010620117188, "__label__literature": 0.00033211708068847656, "__label__politics": 0.0003390312194824219, "__label__religion": 0.0004048347473144531, "__label__science_tech": 0.2471923828125, "__label__social_life": 0.00010859966278076172, "__label__software": 0.027679443359375, "__label__software_dev": 0.71240234375, "__label__sports_fitness": 0.000446319580078125, "__label__transportation": 0.0007824897766113281, "__label__travel": 0.00031447410583496094}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 23693, 0.02357]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 23693, 0.52311]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 23693, 0.89872]], "google_gemma-3-12b-it_contains_pii": [[0, 2589, false], [2589, 5744, null], [5744, 8729, null], [8729, 10227, null], [10227, 12711, null], [12711, 15177, null], [15177, 18200, null], [18200, 21495, null], [21495, 23693, null]], "google_gemma-3-12b-it_is_public_document": [[0, 2589, true], [2589, 5744, null], [5744, 8729, null], [8729, 10227, null], [10227, 12711, null], [12711, 15177, null], [15177, 18200, null], [18200, 21495, null], [21495, 23693, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 23693, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 23693, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 23693, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 23693, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 23693, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 23693, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 23693, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 23693, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 23693, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 23693, null]], "pdf_page_numbers": [[0, 2589, 1], [2589, 5744, 2], [5744, 8729, 3], [8729, 10227, 4], [10227, 12711, 5], [12711, 15177, 6], [15177, 18200, 7], [18200, 21495, 8], [21495, 23693, 9]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 23693, 0.10185]]}
|
olmocr_science_pdfs
|
2024-11-28
|
2024-11-28
|
60b4be298c78efa3aaaf7a3ef9823eb33436a341
|
An Iterative Contextualization Algorithm with Second-Order Attention
Diego Maupomé, Marie-Jean Meurs
Université du Québec à Montréal
maupome.diego@courrier.uqam.ca
meurs.marie-jean@uqam.ca
Abstract
Combining the representations of the words that make up a sentence into a cohesive whole is difficult, since it needs to account for the order of words, and to establish how the words present relate to each other. The solution we propose consists in iteratively adjusting the context. Our algorithm starts with a presumably erroneous value of the context, and adjusts this value with respect to the tokens at hand. In order to achieve this, representations of words are built combining their symbolic embedding with a positional encoding into single vectors. The algorithm then iteratively weights and aggregates these vectors using our novel second-order attention mechanism. Our models report strong results in several well-known text classification tasks.
1 Introduction
Until recently, encoding natural language utterances was based on some aggregation of the parts of the utterance where the representation of such parts was constant, independent of the utterance. Even non-symbolic representations, such as word embeddings, were not dependent on the utterance that they might comprise. That is, the context of each word only appeared a posteriori. This made the issue of polysemy difficult to address.
However, in the case of some neural encoders, such as Recurrent Neural Networks (RNNs) [Jordan 1986], one might argue that some notion of contextualization does exist. In RNNs, as the sequence is consumed, more information about the sequence becomes available to the hidden state updates. Obviously, this is highly dependent on the parsing order, and the significance of certain tokens has to be presupposed to some extent. For example, when reading a phrase one word at a time, the significance of the first word is at first supported only by prior beliefs. Without actually reading the entire phrase, one can only suppose what the role of the first word will be. The second and third word
will be better informed, but still somewhat dependent on prior beliefs. Only the last word of a sentence will be fully “aware” of its role, memory problems notwithstanding. Bidirectional RNNs (Schuster and Paliwal, 1997) mitigate these issues by offering two parsing orders to sequences. However, the contexts compiled by the hidden states of the forwards and backward RNNs are not aware of one another, they are not revisited.
By contrast, Transformer encoders (Vaswani et al., 2017) readjust the representation of words iteratively. The words in a sequence are compared against each other by the parametric Self-Attention mechanism (Cheng et al., 2016). From this process, a new representation for each word is produced. This is repeated a set number of times. In doing so, the word representations produced by this encoder are put into the context of the whole, ostensibly addressing issues of ambiguity or polysemy. As such, Transformers have achieved much success in various Natural Language Processing (NLP) tasks (Devlin et al., 2018; Cer et al., 2018; Clark et al., 2020). Nonetheless, the Self-Attention mechanism on which Transformers rely has two chief disadvantages. Firstly, because all word pairs are evaluated, the complexity is quadratic with respect to the length of the utterance. Secondly, the weighting provided by the Self-Attention mechanism is based on bilinear forms, mapping each pair of word vectors to a single scalar. As such, Transformers require multiple sets of Self-Attention parameters called heads, so that separate heads might focus on different features of the word vectors. To address these issues, we propose a novel architecture - the Contextualizer - based iteratively adjusting a context vector using a second-order attention mechanism.
This paper is organized as follows. Section 2 introduces the proposed approach. Section 3 describes experiments conducted in a few well-known document classification tasks and the results obtained. Finally, Section 4 concludes this paper.
2 Contextualizer
Contextualization is fundamentally difficult because it is a circular problem. One cannot recompose a whole by putting its tokens in the context of said whole without already knowing what the whole is. One potential solution to this is to iteratively adjust the context. That is, to begin with a presumably erroneous value of the context representation and adjust this value with respect to the tokens at hand.
In order to achieve this, representations of words are built combining their symbolic embedding with a positional encoding into single vectors. The algorithm then iteratively weighs and aggregates these vectors using our novel second-order attention mechanism. In broad terms, the algorithm we propose is presented in Algorithm 1.
We have established that our approach requires a contextualizing and an aggregating function. We use a variant of the attention mechanism to implement contextualization and simple addition for aggregation. We begin by describing
Algorithm 1: Contextualizer
**Input** $C$: a set of tokens to be contextualized,
$c_d$: a default context vector
**Output** $c$: a context vector
\[
c \leftarrow c_d
\]
**loop**
\[
C' \leftarrow \emptyset
\]
for all $t \in C$
do
\[
C' \leftarrow C' \cup \{\text{contextualize}(c, t)\}
\]
end for
\[
c \leftarrow \text{aggregate}(C')
\]
end loop
the representation of tokens as follows.
Let $w_1, \ldots, w_n$ be a sequence of tokens forming a document of length $n$. An encoding function, $e$, maps each token and its position to a single real vector, $x_i \in \mathbb{R}^m$
\[
e : (w_i, i) \mapsto x_i.
\]
This function can be learned or manually specified.
Suppose there are $K$ contextualization and aggregation steps, indexed by $k = 1, \ldots, K$. Each of these steps will produce a new context vector, $c^k$. As described by Algorithm 1, this context vector will contextualize the tokens, which will then be aggregated into a new context. An attention mechanism provides the contextualizing function called at every iteration. Using any of the various attention mechanisms in the literature, contextualizing each token would amount to producing a scalar weight, $\alpha_i$ for each token depending on its content and that of the attender (the context vector in our case). The contextualization of token $x_i$ at step $k$ with respect to the previous context, $c^{(k-1)}$, would then be
\[
(c^{(k-1)}, x_i) \mapsto \alpha_i^{(k)} x_i
\]
However, we would prefer to have the weight of each token be a vector, $\alpha_i$, rather than a scalar, $\alpha_i$. This would let each component of the token representation have a separate salience with regard to the current context. This is particularly important when using distributed token representations, where each component might carry a different semantic sense. Using a weighting vector, the previous mapping would become:
\[
(c^{(k-1)}, x_i) \mapsto \alpha_i^{(k)} \star x_i
\]
where $\star$ denotes the Hadamard product. This is an appealing alternative to the use of separate Self-Attention heads, as prevalent in Transformer models. Indeed, the use of scalar attention weights requires that each component in the operands interact only with its homologue, collapsing all information to a single
number. One must therefore compute several of these interaction with different parameters, heads, so that each of these heads may focus on different features. A second-order attention mechanism eliminates the need for several heads, as each feature can interact with each feature by a different parameter.
Nonetheless, this second-order attention weighting requires parametrization by a tensor of degree 3. This would take the parameter count of the model to $O(m^3)$, as both the input and the context vectors are of dimension $m$. For token representations of even modest size, this would result in a computationally intensive model that would ostensibly be prone to over-fitting. Instead, we can compose a degree 3 tensor of arbitrary rank $u$ by adding together $u$ degree 3 tensors of rank 1. These can be expressed by a three-way outer product of vectors (Rabanser et al., 2017; Sutskever et al., 2011; Maupomé and Meurs, 2020).
The candidate weighting of each token can therefore be computed as follows:
$$\tilde{\alpha}_i^{(k)} = W^{(k)}(U^{(k)} x_i * V^{(k)} c^{(k-1)})$$
where $U^{(k)}, V^{(k)} \in \mathbb{R}^{u \times n}$ and $W^{(k)} \in \mathbb{R}^{n \times u}$ are the matrices of parameters for the $k$th contextualization step.
This computation is illustrated in Figure 1.
These candidate weights can then be normalized across tokens to provide the true weights for each token:
$$\alpha_{ij}^{(k)} = \frac{\exp(\tilde{\alpha}_{ij}^{(k)})}{\sum_{l=1}^{n} \exp(\tilde{\alpha}_{lj}^{(k)})}$$
The context is then obtained by adding the weighted tokens together:
\[ c^{(k)} = \sum_{i=1}^{n} \alpha_{i}^{(k)} \ast x_{i} \]
The default context used at the first step of contextualization, \( c^{(0)} \), can be set to a constant, for example. Furthermore, we call \textit{recurrent contextualizers} models where the same matrices are used for all iterations:
\[ (W^{(k)}, U^{(k)}, V^{(k)}) = (W, U, V) \text{ for } k = 1, \ldots, K. \]
where \( K \) is the number of contextualization steps.
An alternate approach to recontextualization is to iteratively adjust the tokens with respect to one another. This algorithm is presented in Algorithm 2. It can be understood as the Encoder portion of the popular Transformer architecture (Vaswani et al., 2017), where several layers of self-attention are applied for each token in a sentence to arrive at a contextualized representation. It has the advantage of decentralizing the context. This allows for the context to be of variable size in a natural way.
**Algorithm 2** Token-wise Contextualizer
```
loop
for all \( t \in C \) do
\( C' \leftarrow \emptyset \)
for all \( t \in C \) do
\( C' \leftarrow C' \cup \{contextualize(t, t')\} \)
end for
\( t \leftarrow aggregate(C') \)
end for
end loop
```
The Contextualizer, on the other hand, has a fixed-size context and must additionally provide a default context. In return, the number of comparisons in one iteration of the Contextualizer algorithm grows linearly with respect to the number of tokens, as opposed to the square of it for the Transformer. Table 1 presents the complexities of these two algorithms as well as recurrent and convolutional layers. In addition, the Transformer has the drawback of losing sight of the original representation of the tokens, whereas the Contextualizer does not. In the next section, we present a few text classification experiments in order to analyze the proposed Contextualizer approach.
<table>
<thead>
<tr>
<th>Layer</th>
<th>Complexity</th>
</tr>
</thead>
<tbody>
<tr>
<td>Recurrent</td>
<td>$O(nm^2)$</td>
</tr>
<tr>
<td>Convolutional</td>
<td>$O(knm^2)$</td>
</tr>
<tr>
<td>Transformer Encoder</td>
<td>$O(hn^2m)$</td>
</tr>
<tr>
<td>Contextualizer</td>
<td>$O(num)$</td>
</tr>
</tbody>
</table>
Table 1: Complexities of common layers used in NLP. $k$ designates the kernel size, $h$, the number of attention heads, $n, m$ and $u$, designate the length of the sequence, the dimension of the word representations and the multiplicative dimension, respectively. For Transformers and Contextualizers, the complexity is for a single contextualization step.
3 Experiments and Results
We evaluate the Contextualizer approach on several text classification tasks. We begin with exploratory experiments and analysis on a well-known sentiment analysis dataset: asdf. We then present further results in other text classification benchmarks.
For all of these tasks, we opt for word-level tokenization. Words appearing fewer than 3 times are removed. As described by Equation (1), both the position and the value of a word are to be combined into a single real vector. The position of the word is encoded and integrated to the word embedding as described by Vaswani et al. (2017). In order to isolate the learning capabilities of the Contextualizer, we do not use pre-trained word embeddings or learn them during the task. Instead, each word is associated with a random vector, $w \sim U(-1, 1)$. Neither the value or the position vector encoding of words is trained. The Contextualizer must therefore learn to work with the word representations it is given.
The results reported issue from 5-fold cross-validation. Models are trained over 10 epochs in batches of 64 documents using the Adam optimizer (Kingma and Ba, 2014). Accuracy is used to measure the models performance, a natural choice given that all tasks are binary classification tasks with equal number of observations per class. We retain the models with the best performance on a development set constituting 10% of each training set fold. All data subsets are constructed randomly and respecting the balance between labels. Naturally, the results reported represent the test accuracy averaged across the folds.
3.1 Exploratory experiments
We begin with experiments on the well-known Rotten Tomatoes dataset (MR) (Pang and Lee, 2005). The dataset consists of 11k sentences from film reviews classified as either positive or negative in equal proportions. Removing words having fewer than 3 occurrences results in a vocabulary of about 5700 words. The documents are fairly short, with 95% of them being 45 words long or shorter.
Our first experiments compare how the number of contextualization steps, $K$,
Table 2: Test accuracy (%) on the MR task for varying number of contextualization steps (\(K\))
<table>
<thead>
<tr>
<th>(K)</th>
<th>recurrent</th>
<th>regular</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>57.9</td>
<td>57.8</td>
</tr>
<tr>
<td>5</td>
<td>72.4</td>
<td>70.7</td>
</tr>
<tr>
<td>10</td>
<td>72.8</td>
<td>72.1</td>
</tr>
<tr>
<td>20</td>
<td>72.3</td>
<td>71.4</td>
</tr>
</tbody>
</table>
Table 3: Test accuracy (%) on the MR task for different default context strategies
<table>
<thead>
<tr>
<th>(c^{(0)})</th>
<th>(K)</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>73.1</td>
</tr>
<tr>
<td>(c_d)</td>
<td>73.5</td>
</tr>
<tr>
<td>(U(-1,1))</td>
<td>57.9</td>
</tr>
</tbody>
</table>
affects performance in a Contextualizer. We train models with the aforementioned configurations with varying depth of contextualization. As such, \(K\) takes on the values 1, 5, 10 and 20. We train both recurrent and regular models with these settings.
Because the word representations are not trained, the actual number of parameters for recurrent Contextualizers is fairly small, counting only the three attention matrices and the parameters of the affine transformation mapping the final context to a binary decision for the document.
We set \(v\), the size of the word embeddings, to 500, and \(p\), the size of the position vector to 20. The rank of the This yields a total parameter count for the models to 157k. In the case of recurrent models, the choice of \(K\) does not affect the parameter counts because the same matrices are used for every step. For non-recurrent models, the parameter count goes up to 3M.
Results are presented in Table 2. The depth of contextualization appears to have little effect for \(K \geq 5\) for recurrent and non-recurrent models alike. Moreover recurrence seems to have no bearing on performance, suggesting that the resulting models are robust to over-fitting.
We then proceed with experiments measuring the effect on performance of the nature of the default context. All models share the same configurations except the default context, which is set to be either a constant, \(c^{(0)} = 1\), a vector of learned parameters, \(c^{(0)} = c_d\), or a random vector redrawn for every document, \(c^{(0)} \sim U(-1,1)\). We hypothesize that using a random default context will make the network more robust by reducing dependence on prior beliefs and therefore mitigating overfitting. For the same reasons, one could expect a learned default context to be more likely to overfit than a constant one. We run these experiments on recurrent models with \(K\) set to 1 and 5.
7
Table 4: Test accuracy (%) on several benchmark text classification tasks of our Contextualizer models compared to the Universal Sentence Encoder architectures (USE), Transformer-based (T) and Deep Averaging Network-based (D)
<table>
<thead>
<tr>
<th></th>
<th>MR</th>
<th>CR</th>
<th>SUBJ</th>
<th>MPQA</th>
</tr>
</thead>
<tbody>
<tr>
<td>Contextualizer</td>
<td>76.6</td>
<td>79.0</td>
<td>91.2</td>
<td>85.3</td>
</tr>
<tr>
<td>USE (T)</td>
<td>81.4</td>
<td>87.4</td>
<td>93.9</td>
<td>87.0</td>
</tr>
<tr>
<td>USE (D)</td>
<td>74.5</td>
<td>81.0</td>
<td>92.7</td>
<td>85.4</td>
</tr>
</tbody>
</table>
Table 3 summarizes the results. As one might expect, a random starting context vector hurts performance when contextualization is performed but once. The models are quick to adjust, as all choices of default context seem to arrive at very similar final accuracies.
3.2 Further results
We continue with experiments in binary document classification on other well-known datasets. The Customer Reviews dataset (CR), introduced by Hu and Liu [2004], comprises 3775 reviews roughly equally divided between positive and negative sentiment. The Subjectivity dataset (SUBJ) [Pang and Lee, 2004] groups 10k sentences as subjective or objective. Finally, the Multi-Perspective Question Answering classification dataset (MPQA) deals again in sentiments polarity, with 10,606k phrases.
Once words with fewer than 3 occurrences are removed, the largest vocabulary is that of SUBJ, with about 6.3k words, followed closely by MR, with 5.7k words. The two other datasets have much smaller vocabularies, with 1.7k and 1.5k words for CR and MPQA, respectively. The MPQA dataset is the most unbalanced in terms of labels found, having a ratio of 7 to 3 negative to positive sentences. Still, both cross-validation as well as the sampling of developments subsets are performed in a stratified manner, preserving the proportions between classes.
We also test the gains in performance offered by jointly learning the word embeddings. However, in order to offset the increase in parameter count learning these embeddings entails, we reduce the size of the word vectors by half, to 250. This results in models of size with about half a million parameters for CR and MPQA and a million and a half for SUBJ and MR. The default context is again random, with 5 contextualization steps adjusting it.
Test accuracy on several benchmark text classification tasks of our Contextualizer models compared to the Universal Sentence Encoder architectures (USE) [Cer et al., 2018], Transformer-based (T) and Deep Averaging Network-based (D) is shown in Table 4. The results of these experiments demonstrate that the Contextualizer architecture can perform competitively, even with small models and relatively small datasets. More importantly, the gains in performance of learning word representation are relatively small, suggesting that the heavy lifting is done by the higher-order attention function.
4 Conclusion
We have proposed an algorithm for constructing sentence representations based on the notion of iteratively adjusting a central context vector. This algorithm is closely related to the encoder part of the Transformer algorithm. One key difference is the use of the proposed second-order attention mechanism, replacing multiple attention heads. Our results suggest the approach is robust to different choices of the number of contextualization steps and default contexts. Furthermore, the Contextualizer can achieve competitive results in benchmark document classification tasks even with low parameter counts.
Transformer models have been the driving force behind the expansive use and development of large models such as BERT [Devlin et al. 2018] and GPT-2 [Radford et al. 2019], which are extensively trained by adapted language-modeling tasks. The reduced complexity of the Contextualizer model would be of use both in terms of pre-training and in terms of wielding these large models in downstream tasks. Further work will be conducted in this direction as well as in formally characterizing the conditions that stabilize the context vector as the number of contextualization steps increases.
Reproducibility
The Contextualizer source code is available under the GNU GPL v3 license to ensure reproducibility. It can be found in the following repository:
https://gitlab.ikb.info.uqam.ca/ikb-lab/nlp/contextualizer/Contextualizer_arXiv2021
Acknowledgements
This research was enabled in part by support provided by Calcul Québec [https://www.calculquebec.ca] and Compute Canada [https://www.computecanada.ca]. We acknowledge the support of the Natural Sciences and Engineering Research Council of Canada (NSERC) [MJ Meurs, NSERC Grant number 06487-2017], and the support of the Government of Canada’s New Frontiers in Research Fund (NFRF), [MJ Meurs, NFRFE-2018-00484].
References
|
{"Source-Url": "https://arxiv-export-lb.library.cornell.edu/pdf/2103.02190v1", "len_cl100k_base": 5002, "olmocr-version": "0.1.53", "pdf-total-pages": 10, "total-fallback-pages": 0, "total-input-tokens": 24404, "total-output-tokens": 6313, "length": "2e12", "weborganizer": {"__label__adult": 0.0007271766662597656, "__label__art_design": 0.0009627342224121094, "__label__crime_law": 0.0008268356323242188, "__label__education_jobs": 0.0014591217041015625, "__label__entertainment": 0.0005259513854980469, "__label__fashion_beauty": 0.0004107952117919922, "__label__finance_business": 0.0003592967987060547, "__label__food_dining": 0.0006556510925292969, "__label__games": 0.0012502670288085938, "__label__hardware": 0.0015287399291992188, "__label__health": 0.0020294189453125, "__label__history": 0.0004591941833496094, "__label__home_hobbies": 0.00013899803161621094, "__label__industrial": 0.0007729530334472656, "__label__literature": 0.0034122467041015625, "__label__politics": 0.0006742477416992188, "__label__religion": 0.00098419189453125, "__label__science_tech": 0.461181640625, "__label__social_life": 0.00023114681243896484, "__label__software": 0.0150604248046875, "__label__software_dev": 0.50439453125, "__label__sports_fitness": 0.0005812644958496094, "__label__transportation": 0.0009303092956542968, "__label__travel": 0.00025653839111328125}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 23670, 0.03857]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 23670, 0.36336]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 23670, 0.88609]], "google_gemma-3-12b-it_contains_pii": [[0, 2103, false], [2103, 5114, null], [5114, 7386, null], [7386, 8899, null], [8899, 10892, null], [10892, 13626, null], [13626, 16048, null], [16048, 18852, null], [18852, 21183, null], [21183, 23670, null]], "google_gemma-3-12b-it_is_public_document": [[0, 2103, true], [2103, 5114, null], [5114, 7386, null], [7386, 8899, null], [8899, 10892, null], [10892, 13626, null], [13626, 16048, null], [16048, 18852, null], [18852, 21183, null], [21183, 23670, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 23670, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 23670, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 23670, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 23670, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 23670, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 23670, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 23670, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 23670, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 23670, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 23670, null]], "pdf_page_numbers": [[0, 2103, 1], [2103, 5114, 2], [5114, 7386, 3], [7386, 8899, 4], [8899, 10892, 5], [10892, 13626, 6], [13626, 16048, 7], [16048, 18852, 8], [18852, 21183, 9], [21183, 23670, 10]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 23670, 0.14765]]}
|
olmocr_science_pdfs
|
2024-12-08
|
2024-12-08
|
f6f60dbef27cf8b4ed92cb55bd2e19fe5b54e3e2
|
[REMOVED]
|
{"Source-Url": "http://www.jeffreymbradshaw.net/publications/120804-MATES%20paper.pdf", "len_cl100k_base": 7252, "olmocr-version": "0.1.50", "pdf-total-pages": 15, "total-fallback-pages": 0, "total-input-tokens": 47649, "total-output-tokens": 9385, "length": "2e12", "weborganizer": {"__label__adult": 0.0003380775451660156, "__label__art_design": 0.0005507469177246094, "__label__crime_law": 0.0009479522705078124, "__label__education_jobs": 0.0011959075927734375, "__label__entertainment": 0.00015223026275634766, "__label__fashion_beauty": 0.0001983642578125, "__label__finance_business": 0.0007076263427734375, "__label__food_dining": 0.00029969215393066406, "__label__games": 0.0007524490356445312, "__label__hardware": 0.0013055801391601562, "__label__health": 0.000667572021484375, "__label__history": 0.0004122257232666016, "__label__home_hobbies": 0.00014293193817138672, "__label__industrial": 0.0007982254028320312, "__label__literature": 0.00042819976806640625, "__label__politics": 0.0006365776062011719, "__label__religion": 0.0003972053527832031, "__label__science_tech": 0.33544921875, "__label__social_life": 0.0002155303955078125, "__label__software": 0.05560302734375, "__label__software_dev": 0.59765625, "__label__sports_fitness": 0.0002987384796142578, "__label__transportation": 0.0005431175231933594, "__label__travel": 0.00020015239715576172}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 41355, 0.01261]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 41355, 0.28854]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 41355, 0.90397]], "google_gemma-3-12b-it_contains_pii": [[0, 2655, false], [2655, 5473, null], [5473, 8200, null], [8200, 11240, null], [11240, 14587, null], [14587, 16712, null], [16712, 18886, null], [18886, 21303, null], [21303, 24191, null], [24191, 26678, null], [26678, 29470, null], [29470, 32394, null], [32394, 35402, null], [35402, 37899, null], [37899, 41355, null]], "google_gemma-3-12b-it_is_public_document": [[0, 2655, true], [2655, 5473, null], [5473, 8200, null], [8200, 11240, null], [11240, 14587, null], [14587, 16712, null], [16712, 18886, null], [18886, 21303, null], [21303, 24191, null], [24191, 26678, null], [26678, 29470, null], [29470, 32394, null], [32394, 35402, null], [35402, 37899, null], [37899, 41355, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 41355, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 41355, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 41355, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 41355, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 41355, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 41355, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 41355, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 41355, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 41355, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 41355, null]], "pdf_page_numbers": [[0, 2655, 1], [2655, 5473, 2], [5473, 8200, 3], [8200, 11240, 4], [11240, 14587, 5], [14587, 16712, 6], [16712, 18886, 7], [18886, 21303, 8], [21303, 24191, 9], [24191, 26678, 10], [26678, 29470, 11], [29470, 32394, 12], [32394, 35402, 13], [35402, 37899, 14], [37899, 41355, 15]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 41355, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-02
|
2024-12-02
|
4420fffb11d797fc4fbfede1a9d44ac43f1461d7
|
BARÇA: Branch Agnostic Region Searching Algorithm
Daniel A. Jiménez Paul V. Gratz Gino Chacon Nathan Gober
Texas A&M University
Abstract
We introduce BARÇA\(^1\), a branch agnostic region searching algorithm for instruction prefetching. The technique is based on searching a control-flow graph. The nodes in the graph are fixed-sized regions of a number of cache blocks. Each edge is labeled with the number of times that edge was traversed in the control-flow of the program, allowing the probability of an edge being traversed to be calculated from among all the edges leaving a given node. To find candidate blocks to prefetch, the graph is searched to a given maximum depth, stopping when the product of probabilities from the source node to a given target reaches a minimum value defined for that depth. The algorithm is largely agnostic of branch instructions, inferring the flow of control from demand fetches to regions. A few optimizations are applied to improve space efficiency and performance, including using a spatial pattern within regions, handling returns specially, and compression of region addresses. BARÇA achieves a geometric mean speedup of 28.3\% over a baseline of no prefetching, comparing reasonably well to an optimistic 35.0\% speedup for an infinite-sized first-level instruction cache. This paper describes the algorithm, the optimizations, and the overhead.
1 The Algorithm
The prefetcher divides memory into multi-block groups called regions. The number of blocks per region is a parameter to the algorithm. Each region reached by the program becomes a node in the control-flow graph. When control leaves a source region for a target region, an edge is inserted or updated in the control-flow graph. On certain demand accesses, the prefetcher begins a limited-depth search at the region that includes that demand access. The nodes reached by that search become candidates for prefetching. Each node includes a spatial pattern, a BPR-bit array that indicates whether the corresponding cache block has ever been accessed; blocks that have never been accessed are not considered for prefetching.
The intuition behind the BARÇA algorithm is that, for large working set programs, we would like to store relatively few entries in the control-flow graph compared to a branch target buffer (BTB) based prefetcher. This is the same intuition behind Shotgun [4], but rather than using a hierarchical approach, we choose a simpler coarse-grained node. The algorithm is mostly agnostic of branch instructions within cache blocks or regions; a discontinuous fetch obviously implies a branch somewhere in the region but is represented simply as another edge in the control-flow graph. The one exception is returns, as returns have many targets but only one that will be fruitful on a given search, so they are handled as a special case.
1.1 Edges
Edges in the control-flow graph are weighted with a count of the number of times that edge was traversed. They are also augmented with a flag that indicates whether this edge can be traversed by a return instruction. The counts of every edge originating at a given node can be used to determine the probability that one of those edges will be traversed, which guides the search. The counts are 18 bits to conserve space. If incrementing a count would exceed 18 bits, all the counts in the control-flow graph are halved before the increment so the counts never overflow and continue to retain their proportional values.
1.2 The Control-Flow Graph
The control-flow graph is represented as a \(256 \times 64\) set-associative memory of edges. The tags are the source region addresses. On an access to a control-flow graph edge, multiple edges may match the tag, indicating multiple targets for the source. Many sources may share a single set, allowing an efficient adjacency-lists graph representation. Conflict misses in control-flow graph sets are handled by replacing edges using a least-frequently-used policy based on the edge count.
1.3 The Search
A search may be initiated from a demand fetch, an instruction cache fill or return instruction. When a new region is entered that has not recently been searched, a new search is initiated. The search is a depth-limited depth-first search. We find a maximum depth of 5 results in the best performance. Along each path from the source, the algorithm keeps a running product of the probabilities of each edge along the path. If the product fails to exceed a pre-determined per-depth threshold, the search along that path is terminated. When the search algorithm considers traversing an edge labeled as “is-return,” meaning that it had been traversed once before as a return of a return instruction, the edge is only traversed if the target region can be found on the return address stack.
\(^1\)FC Barcelona, the Barcelona football club, is colloquially known as Barça.
1.4 Shadow Cache
BARÇA keeps a shadow cache that mirrors the tags in the L1 i-cache. It is updated on every fetch as well as on every i-cache fill. The shadow cache is used to filter prefetch candidates as well as to identify useful and useless prefetches. For each block, it contains a tag, a valid bit, replacement state for the LRU policy, a bit indicating whether the block was prefetched but not yet used, and a pointer to the control-flow graph node responsible for issuing the prefetch if that block had been prefetched.
1.5 Selecting and Issuing Prefetch Candidates
For each region encountered along the search, BARÇA considers all the blocks in that region. If the block is not found in the shadow cache, it is added to a list of prefetch candidates. Then, the list is traversed in order of the probability of the node from which the candidate originated. Up to a fixed number of candidates are added to a prefetch queue (not ChampSim’s queue) on each search. On every cycle, a number of prefetch candidates will be dequeued and issued from the prefetch queue.
2 Optimizations
We employ a number of optimizations to improve performance and space efficiency of BARÇA:
2.1 Compression of Region Addresses
With 64-byte blocks and 2 blocks per region, distinctly identifying each region requires 57 bits. Each control-flow graph node has two region addresses: a source and a target. A naive representation would consume 114 bits per node just for region addresses. Thus, we use a compressed representation. We divide region numbers into 45 upper “area bits” and 12 lower “offset bits.” We keep a table called the “area table” of 128 distinct 45-bit areas. A compressed region number consists of the 7-bit index into the area table where the area bits can be found and the 12 offset bits, for a total of 19 bits per region address. The control-flow graph is indexed by taking the source address modulo the number of sets in the structure, i.e. 256, so the lower 8 bits of the source address need not be stored in a control-flow graph node. Thus, source addresses consume 11 bits and target addresses consume 19 bits.
The area table is initialized to contain an invalid value that has not been encountered in the traces. An area table entry is filled the first time a region from that area is encountered. If the table is full of valid entries, random replacement is used. The area table allows covering 64MB of program text simultaneously. In practice we find that area table never requires replacement. Similar address compression schemes were used in previous work on indirect branch prediction [8, 1].
2.2 Special Treatment of Returns
We tried a number of ways to improve the accuracy of the prefetcher. We found that, generally, letting it be as aggressive as possible led to better performance than trying to reduce useless prefetches. One exception was that following all possible targets of returns led to too many harmful useless prefetches. So we made an optimization to attempt to follow only the correct return target. We implemented a return address stack, pushing return addresses of calls and popping the stack on returns. We labeled edges originating from returns, discovered through the operation of branches, with an “is-return” flag. When searching the graph, we allow an “is-return” edge to be followed only if the target of that edge is on the return address stack.
We would have liked to have done the same sort of optimization for indirect branches, only following the correct target, but to do so would require implementing a highly accurate indirect branch predictor that could speculate through several levels of the search. We determined that doing that was not worth the extra hardware required.
2.3 “Would Be Nice” Queue
The results of the search are ordered by the probabilities of the associated edges. The algorithm only allows a certain number of these prefetches into the prefetch queue so as not to overwhelm the prefetcher and possibly delay subsequent prefetches. However, we find that during a large portion of most programs’ execution, the prefetch queue is empty. Thus, we maintain another queue of lower probability prefetches that “would be nice” to issue if there is available bandwidth. If the main prefetch queue filled by the search becomes empty on some cycle, this alternate prefetch queue is used to issue prefetches.
2.4 Recently Searched List
We keep a list of regions from which searches were recently initiated, maintained in first-in-first-out order. If a region is on this list, it is will not be searched. Thus, we avoid issuing some superfluous prefetches.
2.5 Tweaking Probability Counts
Each control-flow graph edge keeps a count of the number of times that edge was traversed. The count is used to compute the probability that a given edge will produce a fruitful prefetch. We bias these probabilities to produce more useful, fewer useless prefetches, and late prefetches.
Each time the shadow cache evicts a block that was prefetched but never accessed, the count for the edge responsible for that useless prefetch is decremented by 2. Each time the shadow cache accesses a prefetched block indicating the prefetch was useful, the count for the corresponding edge is incremented by 3. Each time a demand fetch misses but the
fetch block is recorded as prefetched in the shadow cache, indicating a late prefetch that was requested but has not yet found its way into the cache, the corresponding edge is incremented by 5. This way, the next time the same block is put onto the prefetch queue, it will have a higher probability and thus a more favorable position in the schedule of prefetches. Now the values computed no longer reflect the true probability of encountering an edge, but take into account the usefulness and timeliness of the edge together with its frequency.
### 2.6 Tuning of Parameters
We empirically explored the design space of parameters to the algorithm. Table 1 shows the values that resulted in the best performance. With the large control-flow graph afforded by the 128KB championship budget, we find that BPR=2 is a good trade-off between region granularity and prefetch accuracy. With a smaller budget we would likely use a coarser granularity.
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>Blocks per region</td>
<td>2 blocks</td>
</tr>
<tr>
<td># of prefetches to dequeue</td>
<td>4 per cycle</td>
</tr>
<tr>
<td>Prefetch queue size</td>
<td>14 entries</td>
</tr>
<tr>
<td>Max. # prefetches to queue per search</td>
<td>5</td>
</tr>
<tr>
<td>“Would be nice” queue size</td>
<td>10 entries</td>
</tr>
<tr>
<td>Edge counter width</td>
<td>18 bits</td>
</tr>
<tr>
<td>Recently searched list size</td>
<td>5 entries</td>
</tr>
<tr>
<td>Max. depth of search</td>
<td>4</td>
</tr>
<tr>
<td>“Real” maximum depth of search</td>
<td>5</td>
</tr>
<tr>
<td>Min. probability to search depth 1</td>
<td>0.046</td>
</tr>
<tr>
<td>Min. probability to search depth 2</td>
<td>0.001</td>
</tr>
<tr>
<td>Min. probability to search depth 3</td>
<td>0.0275</td>
</tr>
<tr>
<td>Min. probability to search depth 4</td>
<td>0.007</td>
</tr>
<tr>
<td>Counter increment on useful prefetch</td>
<td>3</td>
</tr>
<tr>
<td>Counter increment on late prefetch</td>
<td>5</td>
</tr>
<tr>
<td>Counter decrement on useless prefetch</td>
<td>2</td>
</tr>
</tbody>
</table>
Table 1: Best values of parameters to the algorithm
### 3 Overhead
#### 3.1 Space Overhead
There are several structures in the prefetcher:
The **area map** is a direct-mapped memory of 128 58-bit entries mapping areas of memory to regions to support compression of node numbers in the control-flow graph. The area map is 7,424 bits.
The **control-flow graph** is a 256 × 64 set-associative memory. Nodes in the graph use a compressed representation as a pair of 7-bit area number and 12-bit offset within the area, giving a region number. Each control-flow graph entry has the following fields: an 18-bit counter, a source node, a target node, a 2-bit spatial pattern, and an “is-return” bit that is true if this edge is traversed by a return instruction. Recall that compressed region addresses consume 19 bits, and that since the structure is indexed by source node using modulo indexing as in a set-associative cache, the lower 8 bits of the source node’s area offset need not be represented. Thus, total number of bits in the control-flow graph is 256 × 64 × (1 + 2 + 18 + 19 + 11 + 1) = 851,968 bits.
The **shadow cache** is a 64 × 8 set-associative memory. Each entry has the following fields: a 1-bit valid bit, a 1-bit prefetched bit indicating whether an entry has been prefetched but not yet demand-accessed, a 24-bit partial tag, a 3-bit LRU position, and a pointer to a control-flow graph edge that would consume an 8-bit row and 6-bit column in a real implementation. Thus, the total number of bits in the shadow cache is 22,016 bits.
The **recently-searched list** keeps recently searched regions that should not be searched again. It has 5 57-bit entries, consuming 285 bits.
The **prefetch candidates list** keeps prefetch candidates identified by the depth first search. It has 56 entries. Each entry has a 58-bit block address, a 64-bit probability, a 3-bit depth, and an 8+6 bit pointer to a control-flow graph edge. Thus the list consumes 7,784 bits.
The **prefetch queue** is a queue apart from ChampSim’s internal prefetch queue that stores candidate prefetches to be dequeued as most one per cycle. It has 14 entries, each the same size as the entries in the prefetch candidates list above. Thus it consumes 1,946 bits.
The **“would be nice” queue** has 10 entries the same size as the prefetch queue entries, so it consumes 1,390 bits.
The **search results map** of regions is filled by the depth-first search. The map contains up to 56 entries. The key is an 8+6 bit pointer to a control-flow graph edge, and the value is a pair of a 64-bit probability and a 3-bit depth, for a total of 4,536 bits. The **depth-first search frontier list** contains the contents of the search results map sorted by probability. It has 56 entries of the same type as the prefetch queue entries, so it consumes 7,784 bits.
The **distinct candidates map** is an associative map that aids in filling the prefetch candidates list by making sure there are no duplicate entries. It has 56 entries of 58-bit block addresses, consuming 3,248 bits.
The **return address stack** is a 64-entry memory of 64-bit return addresses maintained with stack discipline. It consumes 4,096 bits.
Adding the bits for all structures, we get 912,477 bits, or 111.4KB. There are various bits of state in the code the evaluators might wish to consider, e.g. scalar variables for counting etc. We are confident that these variables would form a negligible fraction of the 16.6KB we leave on the table.
4 Scalability
The idea of Barça is to give a compact metadata representation by aggregating multiple blocks into a single CFG node. It is hard to demonstrate the value of the idea with the contest’s large 128KB hardware budget. The optimal number of blocks per region (BPR) is only 2. Figure 1 shows the geometric mean speedup over no prefetching given at budgets from 10KB to 1671KB. The number of CFG sets ranges from 8 to 4,096, doubling the number of sets for each point on the x-axis. For each budget, we find the optimal number of blocks per region (BPR). At 10KB budget, the best BPR is 29, giving a region size of 1856 bytes. At this budget, Barça delivers a geometric speedup of 10.2%. At 33KB budget, about the same capacity as the L1 i-cache, Barça yields a speedup of 25.2% with a BPR of 10. Our IPC1 entry uses a hardware budget of 111KB, giving a 28.3% speedup. At larger budgets, there is not much improvement. At a 4KB budget, the speedup is 28.7%, only 1.4% better than the 111KB version.
4.1 Logical Complexity
The prefetcher state easily fits into the hardware budget of 128KB. The hardware structures used are well-understood in front-end microarchitecture: set-associative SRAM arrays and small fully-associative arrays. The most challenging task is the depth-first search. An efficient parallel depth-first search has been demonstrated in the network-on-chip literature [7]. That work showed a practical low-latency implementation of the Bellman-Ford algorithm that could be adapted for our work.
Although we focus on the algorithm in this paper, we believe a reasonable implementation is possible by pipelining the search and taking advantage of the slack time between prefetches. For example, we measured that, on average, ChampSim’s prefetch queue is empty for more than 50% of simulated cycles even with our “would be nice” list of potential prefetches. We limit the number of prefetches that will be inserted into our prefetch queue from the search to 5. However, on average far fewer prefetch candidates are generated per search. On average, each search results in 0.84 prefetch candidates over the 50 traces, with a maximum of 1.7 average prefetches candidates per search for one benchmark. We also limit the number of searches by only searching when entering a region that has not been recently searched, so most demand fetches do not result in invoking the search algorithm at all. We are aware of timing issues when e.g. accessing a large structure such as the control-flow graph and making several accesses to the shadow cache. Having worked with an industrial RTL team on very complex front-end designs, we believe that with clever pipelining and aggressive SRAM macros these issues can be resolved with minimal impact on performance.
5 Related Work
Our scheme bears strong resemblance to BTB-directed prefetching approaches. It is also similar to Markov-based prefetchers [2] as it uses a graph labeled with weights that represent probabilities that the next step in the graph will be reached. The idea of prefetching through branch targets began with Smith and Hsu [9]. Recently, BTB-directed prefetching has been enhanced by using a stream-based prefetcher to do both instruction and BTB prefetching [3]. A more efficient instruction prefetcher, Boomerang [5], reduces the metadata required for branch-predictor-directed BTB and instruction prefetching, followed up by Shotgun [4] which uses a hierarchical approach to further relieve the metadata problem. Our idea can be seen as a simplified take of Shotgun; rather than explicitly acknowledging program structure through procedures and branches, we divide the program into equal-sized coarse-grained regions. Our spatial patterns that indicate whether a given block in a region has been touched is inspired by spatial footprints [6], an idea that has found its way into several modern prefetchers including spatio-temporal streaming [10].
6 Acknowledgements
This paper is the result of research sponsored by the National Science Foundation through grants CCF-1912617, I/UCRC-1439722 and CCF-1823403, a contract from the Semiconductor Research Corporation, and generous gifts from Intel Corporation. Portions of this research were conducted with the advanced computing resources provided by Texas A&M High Performance Computing Research.
References
|
{"Source-Url": "https://research.ece.ncsu.edu/ipc/wp-content/uploads/2020/05/bar%C3%A7a.pdf", "len_cl100k_base": 4490, "olmocr-version": "0.1.53", "pdf-total-pages": 5, "total-fallback-pages": 0, "total-input-tokens": 16251, "total-output-tokens": 5401, "length": "2e12", "weborganizer": {"__label__adult": 0.0006122589111328125, "__label__art_design": 0.0007228851318359375, "__label__crime_law": 0.000732421875, "__label__education_jobs": 0.0005068778991699219, "__label__entertainment": 0.00016963481903076172, "__label__fashion_beauty": 0.0003216266632080078, "__label__finance_business": 0.0005006790161132812, "__label__food_dining": 0.00060272216796875, "__label__games": 0.0013580322265625, "__label__hardware": 0.0215606689453125, "__label__health": 0.0009984970092773438, "__label__history": 0.0006237030029296875, "__label__home_hobbies": 0.00025773048400878906, "__label__industrial": 0.0014667510986328125, "__label__literature": 0.00028634071350097656, "__label__politics": 0.00046706199645996094, "__label__religion": 0.0008025169372558594, "__label__science_tech": 0.356201171875, "__label__social_life": 7.849931716918945e-05, "__label__software": 0.010467529296875, "__label__software_dev": 0.5986328125, "__label__sports_fitness": 0.0007085800170898438, "__label__transportation": 0.0013742446899414062, "__label__travel": 0.00037384033203125}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 22300, 0.03998]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 22300, 0.28432]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 22300, 0.90379]], "google_gemma-3-12b-it_contains_pii": [[0, 4900, false], [4900, 10215, null], [10215, 15776, null], [15776, 20111, null], [20111, 22300, null]], "google_gemma-3-12b-it_is_public_document": [[0, 4900, true], [4900, 10215, null], [10215, 15776, null], [15776, 20111, null], [20111, 22300, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 22300, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 22300, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 22300, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 22300, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 22300, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 22300, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 22300, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 22300, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 22300, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 22300, null]], "pdf_page_numbers": [[0, 4900, 1], [4900, 10215, 2], [10215, 15776, 3], [15776, 20111, 4], [20111, 22300, 5]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 22300, 0.2]]}
|
olmocr_science_pdfs
|
2024-12-07
|
2024-12-07
|
bd077b311bf877fd5c470e75656494878eafa97b
|
1 Introduction
This style guide describes a style standard for CS 17’s subset of the language. All the ReasonML
code you write in CS 17 must follow all the guidelines in this document.
2 Naming
The following are the identifier naming guidelines that are followed by the ReasonML library. You
should abide by these conventions in CS 17:
<table>
<thead>
<tr>
<th>Identifier Type</th>
<th>Convention</th>
</tr>
</thead>
<tbody>
<tr>
<td>Constants, Procedures, and Type Names</td>
<td>Initial letter must be lower case.</td>
</tr>
<tr>
<td></td>
<td>Words after should start with a capital letter.</td>
</tr>
<tr>
<td></td>
<td>Example: computeCircleArea</td>
</tr>
</tbody>
</table>
### Predicates
You cannot end predicate names with a `?`. Instead, use `P`, like `memberP`. Or `is`, like `isEmpty`.
### Constructors
Initial letter must be upper case. Use embedded caps for multiword names. Historic exceptions are `true` and `false`.
Examples: `Node EmptyQueue`
### Modules, Module Types, Functors, and File Names
Initial letter must be upper case. Use embedded caps for multiword names.
Example: `PriorityQueue`
---
## 3 Formatting
In most sections of a ReasonML program, how you use white space is not mandated by the compiler. Its use, then, comes down to style.
### 3.1 Indenting
If you enable the `editor.autoIndent` feature in your VS Code settings, it indents your code for you, so you can gloss over this section. But if you use another text editor, you must follow the conventions set forth in this section.
- **Indent most lines by two spaces.** Lines that indent code should do so by two spaces more than the previous line of code. For example:
```reasonml
/* Bad */
let proc = (foo: int, bar: int): int => {
foo * bar
};
/* Good */
let proc = (foo: int, bar: int): int => {
foo * bar
};
```
Lines that wrap around should indent by two spaces and remain aligned. For example:
```reasonml
let x = {
"This is a really long string that is intentionally " ++
"longer than 80 chracters, and hence cannot possibly " ++
"fit on one, or even two, lines."
};
```
- **How to indent `switch` expressions.** Align `switch` expressions as follows:
switch (expr) {
| pat1 => ...
| pat2 => ...
};
Note: The *semicolon* is required at the end of every declaration.
- **Indenting long switch cases.** Long switch cases can be broken up into several lines. These lines should have equal indentation and be broken up in a way that makes the line more readable. For example, in the example below, breaking up the Node case by the three different parts of the or expression help us to see which three expressions are being included in the or.
let tContains17: tree(int) => bool = fun
| Leaf => false
| Node(v, left, right) => (v == 17) ||
tContains17(left)
tContains17(right);
- **How to indent if expressions.** Indent *if* expressions using one of these options, depending on the length of the expressions:
if (exp1) {exp2} else {exp3};
if (exp1) {exp2}
else {exp3};
if (exp1) {
exp2
} else {
exp3
};
In the first example, the expressions are short enough to all fit on one line. In the second example, the first two expressions are short enough to fit on the same line. In the third example, the expressions are too long to even fit two of them on the same line.
Here is an example of nested *if* expressions:
if (exp1) {exp2}
else if (exp3) {exp4}
else {exp5};
- **How to indent comments.** Comments should be indented to the level of the line of code to which the comment refers—usually, the line that follows the comment.
- **Auto-indentation.** If you’re using a different text editor, you can still take advantage of auto-indentation by going to [http://sketch.sh](http://sketch.sh) pasting your code in the box, and pressing Ctrl+Shift+I.
**Auto-indentation in VSCode.** VSCode’s reason-vscode package has an autoreformatter whose indentations might differ from the style described above. This is also considered acceptable CS17 style, but can be turned off if you wish (see the section on VSCode below).
3.2 Line Breaks
If you have a long line of code with parallel structure, breaking it up can improve readability. Pattern matching is a perfect example of this. The following is functional code, but it’s hard to read:
```reasonml
switch (aloi) {
| [] => -15
| [hd, ...tl] when hd > 0 => 17 * hd
| [hd, ...tl] => 0
};
```
This is much better:
```reasonml
switch (aloi) {
| [] => -15
| [hd, ...tl] when hd > 0 => 17 * hd
| [hd, ...tl] => 0
};
```
This same idea also arises when you are dealing with a compound data structure such as a tree. Understanding its form when it is written linearly instead of structurally can be difficult:
```reasonml
let myTree = { Node (17, Node (18, Node (19, Leaf, Leaf),
Node (22, Node (33, Leaf, Leaf), Leaf)), Leaf)
};
```
So breaking it up across multiple lines that reflect its structure is usually a good idea:
```reasonml
let myTree = { Node (17,
Node (18,
Node (19, Leaf, Leaf),
Node (22,
Node (33, Leaf, Leaf),
Leaf)),
Leaf)
};
```
3.3 Parentheses & Braces
- **Use parentheses sparingly.** As in math, and unlike in Racket, the following expressions are equivalent in ReasonML:
17
(17)
((17))
(((17)))
((((17))))
In these expressions, the use of parentheses is redundant. They do not change the semantics, and hence should be used sparingly (if at all).
But, as in Racket, parentheses in ReasonML often do have semantic content. They are used to construct tuples, to override built-in operator precedence, to delimit function arguments, and to group structures into functor arguments. In these cases, parentheses are necessary, and hence, must be used.
Here is an example of using parentheses to override built-in operator precedence:
```reason
/* Bad */
x + y * z + a
/* Good */
(x + y) * (z + a)
```
Spaces (and indentation) do not achieve the effect of parentheses. The former of these two expressions is interpreted as \( x + (y \times z) + a \), which does not appear to be what was intended.
- **Use braces to help indentation.** Automated indentation algorithms are often assisted by braces. Consider the following:
```reason
let x = "Long line..." ++
"Another long line."
let x = {"Long line..." ++
"Another long line."};
```
The latter informs an editor that the long line spills over onto another long line, so that the editor can indent it properly.
### 3.4 Spacing
*The space bar is your friend!* Don’t be afraid to press it. It is a nice big key, so it is easy to find. Use it.
1. Surround infix operators by spaces. Write this `hd, ...tl`, not this `hd, ...tl`, and `x + y`, not `x+y`.
2. Insert spaces after the `:` in type annotation: e.g., `(17: int)`.
3. Insert one space after a pipe in a type definition.
```reason
type season =
| Fall
| Winter
| Spring
| Summer;
```
On the other hand, just as you should not use too many parentheses, you should not insert too many spaces! For example, do not surround a procedure’s arguments by spaces.
4 Pattern Matching
- **Pattern matching should always follow the structure of the data.** Suppose you define a variant type, such as:
```reasonml
type trainCar =
| Engine
| Boxcar(int) /* capacity */
| Caboose;
```
When you pattern match on data of type `trainCar`, your `switch` expression should follow the structure of the data *in the same order*, like this:
```reasonml
switch (train) {
| Engine => ...
| Boxcar(n) => ...
| Caboose => ...
};
```
Also, your pattern matching should be exhaustive. This is not complete:
```reasonml
switch (train) {
| Engine => ...
| Caboose => ...
};
```
If your pattern matching is incomplete, the ReasonML compiler will issue a warning, as follows: “You forgot to handle a possible case here, for example...” *Treat such warnings as bugs!* In some cases the compiler will flag a switch as incomplete when actually it isn’t. This is because the compiler is not smart enough to infer that all possible cases have been covered. For example:
```reasonml
switch (t) {
| Leaf => Node (Leaf, datum, Leaf)
| Node (left, x, right) when (datum < x) => Node (insert datum left, x, right)
| Node (left, x, right) when (datum > x) => Node (left, x, insert datum right)
| Node (left, x, right) when (datum = x) => Node (left, x, right)
};
```
The *incorrect* way to eliminate this warning would be to simply add a `catch-all` case, as follows:
```reasonml
switch (t) {
| Leaf => Node (Leaf, datum, Leaf)
| Node (left, x, right) when (datum < x) => Node (insert datum left, x, right)
| Node (left, x, right) when (datum > x) => Node (left, x, insert datum right)
| Node (left, x, right) when (datum = x) => Node (left, x, right)
| _ => ...
};
```
Here, **EMF** stands for "Exhaustive Match Failure".
The correct way to eliminate an compiler warning that arises from a failure to pattern match exhaustively is to add an explicit *unguarded* match as follows:
```reasonml
| Leaf => Node (Leaf, datum, Leaf) |
| Node (left, x, right) when (datum < x) => Node (insert datum left, x, right) |
| Node (left, x, right) when (datum > x) => Node (left, x, insert datum right) |
| Node (left, x, right) when (datum = x) => Node (left, x, right) |
| _ => failwith "EMF" /* Good */
```
This latter approach is preferable because it preserves the ability of the compiler to flag unmatched cases, which is one of the key features of ReasonML.
In summary, never appease the compiler by inserting a "catch-all". Doing so negates the power of the compiler, and will impede your power to debug and extend your code.
- **Use pattern matching for selection.** Instead of using `fst` and `snd` to deconstruct a tuple, use pattern matching. For example:
```reasonml
type posn = (float, float);
/* Bad */
let p = somePosn;
let x = fst(p);
let y = snd(p);
x +. y;
/* Good */
let (x, y) = somePosn;
x +. y;
```
Similarly, records should be deconstructed using pattern matching:
```reasonml
type circle = {center : posn, radius : float};
/* Bad */
let circ = someCircle;
let c = circ.center;
let r = circ.radius;
let x = fst(c);
```
```reasonml
type posn = (float, float);
/* Bad */
let p = somePosn;
let x = fst(p);
let y = snd(p);
x +. y;
/* Good */
let (x, y) = somePosn;
x +. y;
```
```reasonml
type circle = {center : posn, radius : float};
/* Bad */
let circ = someCircle;
let c = circ.center;
let r = circ.radius;
let x = fst(c);
```
let y = snd(c);
r *. (x +. y);
/* Good */
let {center = (x, y); radius = r} = someCircle;
r *. (x +. y);
You should also steer away from using `List.hd` and `List.tl` in favor of pattern matching.
- **Pattern match using as few switch expressions as possible.** Rather than nest switch expressions, you can often pattern match against a tuple.
/* Bad */
switch (month) {
| Jan => switch (day) {
| 1 => "Happy New Year"
| _ => ""};
| Mar => switch (day) {
| 14 => "Happy Pi Day"
| _ => ""};
| Oct => switch (day) {
| 10 => "Happy Metric Day"
| _ => ""};
};
/* Good */
switch (month, day) {
| (Jan, 1) => "Happy New Year"
| (Mar, 14) => "Happy Pi Day"
| (Oct, 10) => "Happy Metric Day"
| _ => ""
};
- **Never use only one pipe in a switch expression.** There is never a need for only one pipe in a switch expression. In such cases, prefer `let`.
/* Bad */
switch (card) {
| Hearts(n) => ...
};
/* Good */
let Hearts(n) = card;
- **Pattern match a procedure’s formal arguments when possible.** In ReasonML, compound types are deconstructed via pattern matching, using `switch` expressions, `let` expressions, or by deconstructing a procedure’s formal arguments. You should use the latter option if you need only the constituents of a procedure’s formal arguments, and have no use for the arguments as a whole. In this example, the procedure’s formal arguments are tuples:
/* Bad */
let f = (arg1, arg2) => {
let x = fst(arg1);
let y = snd(arg1);
let z = fst(arg2);
};
/* Good */
let f = ((x, y), (z, _)) => {
...
};
There is no need to name arg1 and arg2 here, since all that is needed are their constituents. Likewise, in this example, where the procedure’s formal arguments are records:
/*@ Bad */
let f = (arg1, arg2) => {
let x = arg1.field1;
let y = arg1.field2;
let z = arg2.field3;
...
};
/*@ Good */
let f = ({field1 = x; field2 = y}, {field3 = z; field4 = _}) => {
...
};
5 Verbosity
- **Simplify if expressions.** There are a number of equivalent ways to express the same conditional logic. In almost all cases, shorter expressions are preferred:
<table>
<thead>
<tr>
<th>Verbose</th>
<th>Concise</th>
</tr>
</thead>
<tbody>
<tr>
<td>if (expr){true} else {false}</td>
<td>expr</td>
</tr>
<tr>
<td>if (expr){false} else {true}</td>
<td>!expr</td>
</tr>
<tr>
<td>if (expr){expr} else {false}</td>
<td>expr</td>
</tr>
<tr>
<td>if (!expr){x} else {y}</td>
<td>if (expr){y} else {x}</td>
</tr>
<tr>
<td>if (x){true} else {y}</td>
<td>x</td>
</tr>
<tr>
<td>if (x){y} else {false}</td>
<td>x && y</td>
</tr>
<tr>
<td>if (x){false} else {y}</td>
<td>x &&& y</td>
</tr>
<tr>
<td>if (x){y} else {true}</td>
<td>x !&& y</td>
</tr>
</tbody>
</table>
When an if expression is used for argument selection, it can be embedded within a procedure application to improve readability, as follows:
/*@ Duplication of f a b applications */
if (c) {f(a, b, x)}
else {f(a, b, y)};
/* Can be eliminated by embedding the if */
f(a, b, (if (c) (x) else (y)));
- **Don’t rewrap procedures.** When applying a procedure to another procedure, don’t rewrap the procedure if it already does what you need it to do. Here are two examples:
```reasonml
/* Verbose */
List.map((x => sqrt(x)), [1.0, 4.0, 9.0, 16.0]);
/* Concise */
List.map(sqrt, [1.0, 4.0, 9.0, 16.0]);
```
```reasonml
/* Verbose */
List.fold_left(((x, y) => x + y), 0);
/* Concise */
List.fold_left((+), 0);
```
- **Don’t misuse `switch` expressions.** Do not use `switch` when you mean `if`!
```reasonml
/* Bad */
switch (expr) {
| true => x
| false => y
};
/* Good */
if (expr) {x} else {y};
```
```reasonml
/* Bad */
switch (expr) {
| c => x /* c is a constant */
| _ => y
};
/* Good */
if (c == c) {x} else {y};
```
- **Don’t overuse `switch` expressions.** Do not bind expressions unnecessarily. For example, do not use `switch` to pattern match when `let` is enough:
```reasonml
/* Bad */
let x = {
switch (expr) {
| (y, z) => y
}
};
/* Good */
let (x, _) = expr;
```
• **Don’t reinvent the wheel.** Built in to the ReasonML library are a great number of ready-made procedures and data structures. You should use them, unless of course an assignment expressly forbids it!
For example, when writing a procedure that recursively walks down a list, think `fold`! Some other data structures have similar folding procedures; use them when they are available.
### 6 Type Signatures
Previously, in DrRacket, we defined our type signatures in the comments above our procedures. Although we are able to do this in Reason as well, Reason also provides us with a way to define them within our procedure definition itself, like so:
```reasonml
/* Do this */
let proc : int => int = x =>
x + 5;
```
which differs from what we used to do in Racket, which would look like this in ReasonML:
```reasonml
/* Don't do this */
/* proc : int => int */
let proc = x => x + 5;
```
Although ReasonML’s procedure definitions will work without these in-line type signatures, in CS17, we require them. This not only frees you from having to write type signatures in the comments, but it also serves a practical purpose, as well.
By telling ReasonML what types you expect your inputs and outputs to have, your program will fail to run if you include something in your procedure that will produce a typethat is different from what you were expecting. If you accidentally do so, you’ll get a hefty error from ReasonML about mismatched types once you compile.
### 7 Formatting in VSCode
If you download the reason-vscode package into your VSCode (see ReasonML setup guide for details), your code will automatically reformat itself upon save. We accept its indentation as proper style, but you may also format your code in the ways specified in the sections above. If you wish to take it upon yourself to properly indent your code, you can turn this feature off by doing the following:
1. Open up VSCode.
2. Open up your command pallette (Ctrl+Shift+P on Windows, Cmd+Shift+P on Mac).
3. In the search bar that appears, type or select 'Preferences: Open Settings (JSON)'. This will open a file called settings.json in your text editor.
4. In the settings.json file, find the following:
```json
"editor.formatOnSave": true,
```
and change it to
```json
"editor.formatOnSave": false,
```
5. Save and close the file. Now, when you save your ReasonML files, the lines should not automatically reformat.
Note that we accept VSCode's autoformatting as proper indentation, and VSCode will also add any missing semicolons to your lines automatically, so turn off this functionality at your own discretion. If necessary, you can always turn autoreformat on again by changing "editor.formatOnSave" to true again.
8 Acknowledgments
Much of this style guide is loosely based off of the CIS120 OCaml style guide at the University of Pennsylvania, which in turn copied much of its content of the CS312 OCaml style guide at Cornell University. Our content has been further adapted to ReasonML.
Please let us know if you find any mistakes, inconsistencies, or confusing language in this or any other CS 17 document by filling out the anonymous feedback form: [http://cs.brown.edu/courses/csci0170/feedback](http://cs.brown.edu/courses/csci0170/feedback)
|
{"Source-Url": "http://cs.brown.edu/courses/csci0170/content/docs/reasonml-style.pdf", "len_cl100k_base": 4877, "olmocr-version": "0.1.53", "pdf-total-pages": 12, "total-fallback-pages": 0, "total-input-tokens": 26656, "total-output-tokens": 5615, "length": "2e12", "weborganizer": {"__label__adult": 0.0002608299255371094, "__label__art_design": 0.0004775524139404297, "__label__crime_law": 0.00021779537200927737, "__label__education_jobs": 0.00165557861328125, "__label__entertainment": 7.319450378417969e-05, "__label__fashion_beauty": 0.0001169443130493164, "__label__finance_business": 0.00011348724365234376, "__label__food_dining": 0.0002601146697998047, "__label__games": 0.000492095947265625, "__label__hardware": 0.0003077983856201172, "__label__health": 0.0001577138900756836, "__label__history": 0.00011157989501953124, "__label__home_hobbies": 7.94529914855957e-05, "__label__industrial": 0.000194549560546875, "__label__literature": 0.0002677440643310547, "__label__politics": 0.0001386404037475586, "__label__religion": 0.000308990478515625, "__label__science_tech": 0.0016660690307617188, "__label__social_life": 0.00010859966278076172, "__label__software": 0.01084136962890625, "__label__software_dev": 0.9814453125, "__label__sports_fitness": 0.00020682811737060547, "__label__transportation": 0.00020885467529296875, "__label__travel": 0.0001437664031982422}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 17918, 0.01807]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 17918, 0.45487]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 17918, 0.82718]], "google_gemma-3-12b-it_contains_pii": [[0, 1005, false], [1005, 2533, null], [2533, 4440, null], [4440, 5813, null], [5813, 7460, null], [7460, 9143, null], [9143, 10822, null], [10822, 12255, null], [12255, 13555, null], [13555, 14632, null], [14632, 16632, null], [16632, 17918, null]], "google_gemma-3-12b-it_is_public_document": [[0, 1005, true], [1005, 2533, null], [2533, 4440, null], [4440, 5813, null], [5813, 7460, null], [7460, 9143, null], [9143, 10822, null], [10822, 12255, null], [12255, 13555, null], [13555, 14632, null], [14632, 16632, null], [16632, 17918, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, false], [5000, 17918, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 17918, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 17918, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 17918, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, true], [5000, 17918, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 17918, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 17918, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 17918, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 17918, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 17918, null]], "pdf_page_numbers": [[0, 1005, 1], [1005, 2533, 2], [2533, 4440, 3], [4440, 5813, 4], [5813, 7460, 5], [7460, 9143, 6], [9143, 10822, 7], [10822, 12255, 8], [12255, 13555, 9], [13555, 14632, 10], [14632, 16632, 11], [16632, 17918, 12]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 17918, 0.05141]]}
|
olmocr_science_pdfs
|
2024-12-10
|
2024-12-10
|
0511ff92481f0c636c3ff7f10184f46c7cfaeccc
|
6.830 Lab 3: SimpleDB Transactions
Assigned: Wed, October 20
Due: Tue, Nov 2
In this lab, you will implement a simple locking-based transaction system in SimpleDB. You will need to add lock and unlock calls at the appropriate places in your code, as well as code to track the locks held by each transaction and grant locks to transactions as they are needed.
The remainder of this document describes what is involved in adding transaction support and provides a basic outline of how you might add this support to your database.
As with the previous lab, we recommend that you start as early as possible. Locking and transactions can be quite tricky to debug!
0. Find bugs, be patient, earn candybars
It is very possible you are going to find bugs, inconsistencies, and bad, outdated, or incorrect documentation, etc. We apologize profusely. We did our best, but, alas, we are fallible human beings.
We ask you, therefore, to do this lab with an adventurous mindset. Don't get mad if something is not clear, or even wrong; rather, try to figure it out yourself or send us a friendly email. We promise to help out by sending bugfixes, new tarballs, etc.
...and if you find a bug in our code, we'll give you a candybar (see Section 3.3)!
1. Getting started
You should begin with the code you submitted for Lab 2 (if you did not submit code for Lab 2, or your solution didn't work properly, contact us to discuss options.) We have provided you with extra test cases for this lab that are not in the original code distribution you received. We reiterate that the unit tests we provide are to help guide your implementation along, but they are not intended to be comprehensive or to establish correctness.
You will need to add these new test cases to your release. The easiest way to do this is to untar the new code in the same directory as your top-level simpledb directory, as follows:
- Make a backup of your Lab 2 solution by typing:
```
$ tar -cvzf 6.830-lab2-submitted.tar.gz 6.830-lab2
```
- Change to the directory that contains your top-level simpledb code:
6.830 Lab 3: SimpleDB Transactions
$ cd 6.830-lab2
- Download the new tests and skeleton code for Lab 3 from [http://db.csail.mit.edu/6.830/6.830-lab3-supplement.tar.gz](http://db.csail.mit.edu/6.830/6.830-lab3-supplement.tar.gz):
$ wget http://db.csail.mit.edu/6.830/6.830-lab3-supplement.tar.gz
- Extract the new files for Lab 3 by typing:
tar -xvzf 6.830-lab3-supplement.tar.gz
This will not overwrite any existing files, but will just add new tests to the `test/simpledb` and `test/simpledb/systemtest` directories, as well as adding the new file `src/simpledb/Transaction.java`.
2. Transactions, Locking, and Concurrency Control
You do not need to write a great deal of code for this lab, but the code you do have to write is quite tricky. Before starting, you should make sure you understand what a transaction is and how strict two-phase locking (which you will use to ensure isolation and atomicity of your transactions) works.
In the remainder of this section, we briefly overview these concepts and discuss how they relate to SimpleDB.
2.1. Transactions
A transaction is a group of database actions (e.g., inserts, deletes, and reads) that are executed **atomically**; that is, either all of the actions complete or none of them do, and it is not apparent to an outside observer of the database that these actions were not completed as a part of a single, indivisible action.
2.2. The ACID Properties
To help you understand how transaction management works in SimpleDB, we briefly review how it ensures that the ACID properties are satisfied:
- **Atomicity**: Strict two-phase locking and careful buffer management ensure atomicity.
- **Consistency**: The database is transaction consistent by virtue of atomicity. Other consistency issues (e.
6.830 Lab 3: SimpleDB Transactions
- g., key constraints) are not addressed in SimpleDB.
- **Isolation**: Strict two-phase locking provides isolation.
- **Durability**: A FORCE buffer management policy ensures durability (see Section 2.3 below).
### 2.3. Recovery and Buffer Management
To simplify your job, we recommend that you implement a NO STEAL/FORCE buffer management policy. As we discussed in class, this means that:
- You shouldn't evict dirty (updated) pages from the buffer pool if they are locked by an uncommitted transaction (this is NO STEAL).
- On transaction commit, you should force dirty pages to disk (e.g., write the pages out) (this is FORCE).
To further simplify your life, you may assume that SimpleDB will not crash while processing a `transactionComplete` command. Note that these three points mean that you do not need to implement log-based recovery in this lab, since you will never need to undo any work (since you never evict dirty pages) and you will never need to redo any work (since you force updates on commit and will not crash during commit processing).
### 2.4. Granting Locks
You will need to add calls to SimpleDB (in `BufferPool`, for example), that allow a caller to request or release a (shared or exclusive) lock on a specific object on behalf of a specific transaction.
We recommend locking at page granularity, though you should be able to implement locking at tuple granularity if you wish (please do not implement table-level locking). The rest of this document and our unit tests assume page-level locking.
You will need to create data structures that keep track of which locks each transaction holds and that check to see if a lock should be granted to a transaction when it is requested.
You will need to implement shared and exclusive locks; recall that these work as follows:
- Before a transaction can read an object, it must have a shared lock on it.
- Before a transaction can write an object, it must have an exclusive lock on it.
- Multiple transactions can have a shared lock on an object.
- Only one transaction may have an exclusive lock on an object.
- No transaction may have a shared lock on an object if another transaction has an exclusive lock on it.
- If transaction $t$ is the only transaction holding a lock on an object $o$, $t$ may upgrade its lock on $o$ to an exclusive lock.
If a transaction requests a lock that it should not be granted, your code should block, waiting for that lock to become available (i.e., be released by another transaction running in a different thread).
You need to be especially careful to avoid race conditions when writing the code that acquires locks -- think about how you will ensure that correct behavior results if two threads request the same lock at the same time (you may wish to read about *Synchronizing Threads in Java*).
Exercise 1. Write the methods that acquire and release locks in BufferPool. Assuming you are using page-level locking, you will need to complete the following:
- Modify `getPage()` to block and acquire the desired lock before returning a page.
- Implement `releasePage()`. This method is primarily used for testing, and at the end of transactions.
- Implement `holdsLock()` so that logic in Exercise 2 can determine whether a page is already locked by a transaction.
You may find it helpful to define a class that is responsible for maintaining state about transactions and locks, but the design is up to you.
You may need to implement the next exercise before your code passes the unit tests in LockingTest.
2.5. Lock Lifetime
You will need to implement strict two-phase locking. This means that transactions should acquire the appropriate type of lock on any object before accessing that object and shouldn't release any locks until after the transaction commits.
Fortunately, the SimpleDB design is such that it is possible to obtain locks on pages in `BufferPool.getPage()` before you read or modify them. So, rather than adding calls to locking routines in each of your operators, we recommend acquiring locks in `getPage()`. Depending on your implementation, it is possible that you may not have to acquire a lock anywhere else. It is up to you to verify this!
You will need to acquire a `shared` lock on any page (or tuple) before you read it, and you will need to acquire an `exclusive` lock on any page (or tuple) before you write it. You will notice that we are already passing around Permissions objects in the BufferPool; these objects indicate the type of lock that the caller would like to have on the object being accessed (we have given you the code for the Permissions class.)
Note that your implementation of `HeapFile.addTuple()` and `HeapFile.deleteTuple()`, as well as the implementation of the iterator returned by `HeapFile.iterator()` should access pages using `BufferPool.getPage()`. Double check that these different uses of `getPage()` pass the correct permissions object (e.g., Permissions.READ_WRITE or Permissions.READ_ONLY). You may also wish to double check that your implementation of `BufferPool.insertTuple()` and `BufferPool.deleteTuple()` call `markDirty()` on any of the pages they access (you should have done this when you implemented this code in lab 2, but we did not test for this case.)
After you have acquired locks, you will need to think about when to release them as well. It is clear that you should release all locks associated with a transaction after it has committed or aborted, but it is possible for there to be other scenarios in which releasing a lock before a transaction ends might be useful.
Exercise 2. Ensure that you acquire and release locks throughout SimpleDB. Some (but not necessarily all) actions that you should verify work properly:
- Reading tuples off of pages during a SeqScan (if you implemented locking in
BufferPool.getPage(), this should work correctly as long as your HeapFile.iterator() uses getPage().
- Inserting and deleting tuples through BufferPool and HeapFile methods (if you implemented locking in BufferPool.getPage(), this should work correctly as long as HeapFile.addTuple() and HeapFile.deleteTuple() uses getPage()).
You will also want to think especially hard about acquiring and releasing locks in the following situations:
- Adding a new page to a HeapFile. When do you physically write the page to disk? Are there race conditions with other transactions (on other threads) that might need special attention at the HeapFile level, regardless of page-level locking?
- Looking for an empty slot into which you can insert tuples. Most implementations scan pages looking for an empty slot, and will need a READ_ONLY lock to do this. Surprisingly, however, if a transaction \( t \) finds no free slot on a page \( p \), \( t \) may immediately release the lock on \( p \). Although this apparently contradicts the rules of two-phase locking, it is ok because \( t \) did not use any data from the page, such that a concurrent transaction \( t' \) which updated \( p \) cannot possibly effect the answer or outcome of \( t \).
At this point, your code should pass the unit tests in LockingTest.
### 2.6. Implementing NO STEAL
Modifications from a transaction are written to disk only after it commits. This means we can abort a transaction by discarding the dirty pages and rereading them from disk. Thus, we must not evict dirty pages. This policy is called NO STEAL.
You will need the flushPage method BufferPool. In particular, it must never evict a dirty page. If your eviction policy prefers a dirty page for eviction, you will have to find a way to evict an alternative page. In the case where all pages in the buffer pool are dirty, you should throw a DbException.
Note that, in general, evicting a clean page that is locked by a running transaction is OK when using NO STEAL, as long as your lock manager keeps information about evicted pages around, and as long as none of your operator implementations keep references to Page objects which have been evicted.
**Exercise 3.** Implement the necessary logic for page eviction without evicting dirty pages in the evictPage method in BufferPool.
### 2.7. Transactions
In SimpleDB, a TransactionId object is created at the beginning of each query. This object is passed to each of the operators involved in the query. When the query is complete, the BufferPool method transactionComplete is called.
Calling this method either *commits* or *aborts* the transaction, specified by the parameter flag `commit`. At any point during its execution, an operator may throw a `TransactionAbortedException` exception, which indicates an internal error or deadlock has occurred. The test cases we have provided you with create the appropriate `TransactionId` objects, pass them to your operators in the appropriate way, and invoke `transactionComplete` when a query is finished. We have also implemented `TransactionId`.
**Exercise 4.** Implement the `transactionComplete()` method in `BufferPool`. Note that there are two versions of `transactionComplete`, one which accepts an additional boolean `commit` argument, and one which does not. The version without the additional argument should always commit and so can be implemented by calling `transactionComplete(tid, true)`.
When you commit, you should flush dirty pages associated to the transaction to disk. When you abort, you should revert any changes made by the transaction by restoring the page to its on-disk state.
Whether the transaction commits or aborts, you should also release any state the `BufferPool` keeps regarding the transaction, including releasing any locks that the transaction held.
At this point, your code should pass the `TransactionTest` unit test and the `AbortEvictionTest` system test. You may find the `TransactionTest` system test illustrative, but it will likely fail until you complete the next exercise.
### 2.8. Deadlocks and Aborts
It is possible for transactions in SimpleDB to deadlock (if you do not understand why, we recommend reading about deadlocks in Ramakrishnan & Gehrke). You will need to detect this situation and throw a `TransactionAbortedException`.
There are many possible ways to detect deadlock. For example, you may implement a simple timeout policy that aborts a transaction if it has not completed after a given period of time. Alternately, you may implement cycle-detection in a dependency graph data structure. In this scheme, you would check for cycles in a dependency graph whenever you attempt to grant a new lock, and abort something if a cycle exists.
After you have detected that a deadlock exists, you must decide how to improve the situation. Assume you have detected a deadlock while transaction $t$ is waiting for a lock. If you're feeling homicidal, you might abort all transactions that $t$ is waiting for; this may result in a large amount of work being undone, but you can guarantee that $t$ will make progress.
Alternately, you may decide to abort $t$ to give other transactions a chance to make progress. This means that the end-user will have to retry transaction $t$.
**Exercise 5.** Implement deadlock detection and resolution in `src/simpledb/BufferPool.java`. Most likely, you will want to check for deadlock whenever a transaction attempts to acquire a lock and finds another transaction is holding the lock.
(note that this by itself is not a deadlock, but may be symptomatic of one.) You have many design decisions for your deadlock resolution system, but it is not necessary to do something complicated. Please describe your choices in your writeup.
You should ensure that your code aborts transactions properly when a deadlock occurs, by throwing a `TransactionAbortedException` exception. This exception will be caught by the code executing the transaction (e.g., `TransactionTest.java`), which should call `transactionComplete()` to cleanup after the transaction. You are not expected to automatically restart a transaction which fails due to a deadlock -- you can assume that higher level code will take care of this.
We have provided some (not-so-unit) tests in `test/simpledb/DeadlockTest.java`. They are actually a bit involved, so they make take more than a few seconds to run (depending on your policy). If they seem to hang indefinitely, then you probably have an unresolved deadlock. These tests construct simple deadlock situations that your code should be able to escape.
Note that there are two timing parameters near the top of `DeadLockTest.java`; these determine the frequency at which the test checks if locks have been acquired and the waiting time before an aborted transaction is restarted. You may observe different performance characteristics by tweaking these parameters if you use a timeout-based detection method. The tests will output `TransactionAbortedExceptions` corresponding to resolved deadlocks to the console.
Your code should now should pass the `TransactionTest` system test (which may also run for quite a long time).
At this point, you should have a recoverable database, in the sense that if the database system crashes (at a point other than `transactionComplete()`) or if the user explicitly aborts a transaction, the effects of any running transaction will not be visible after the system restarts (or the transaction aborts.) You may wish to verify this by running some transactions and explicitly killing the database server.
### 2.9. Design alternatives
During the course of this lab, we have identified three substantial design choices that you have to make:
- Locking granularity: page-level versus tuple-level
- Deadlock detection: timeouts versus dependency graphs
- Deadlock resolution: aborting yourself versus aborting others
**Bonus Exercise 6. (10% extra credit)** For one or more of these choices, implement both alternatives and briefly compare their performance characteristics in your writeup.
You have now completed this lab. Good work!
3. Logistics
You must submit your code (see below) as well as a short (2 pages, maximum) writeup describing your approach. This writeup should:
- Describe any design decisions you made, including your deadlock detection policy, locking granularity, etc.
- Discuss and justify any changes you made to the API.
3.1. Collaboration
This lab should be manageable for a single person, but if you prefer to work with a partner, this is also OK. Larger groups are not allowed. Please indicate clearly who you worked with, if anyone, on your writeup.
3.2. Submitting your assignment
To submit your code, please create a 6.830-lab3.tar.gz tarball (such that, untarred, it creates a 6.830-lab3/src/simpledb directory with your code) and submit it. You may submit your code multiple times; we will use the latest version you submit that arrives before the deadline (before 11:59pm on the due date). If applicable, please indicate your partner in your writeup. Please also submit your individual writeup as a PDF or plain text file (.txt). Please do not submit a .doc or .docx.
3.3. Submitting a bug
Please submit (friendly!) bug reports. When you do, please try to include:
- A description of the bug.
- A .java file we can drop in the src/simpledb/test directory, compile, and run.
- A .txt file with the data that reproduces the bug. We should be able to convert it to a .dat file using PageEncoder.
If you are the first person to report a particular bug in the code, we will give you a candy bar!
3.4 Grading
50% of your grade will be based on whether or not your code passes the system test suite we will run over it. These tests will be a superset of the tests we have provided. Before handing in your code, you should make sure produces no errors (passes all of the tests) from both ant test and ant systemtest.
Important: before testing, we will replace your build.xml, HeapFileEncoder.java, and the entire contents of the test/ directory with our version of these files! This means you cannot change the format of .dat files! You should therefore be careful changing our APIs. This also means you need to test whether your code compiles with our test programs. In other words, we will untar your tarball, replace the files mentioned above, compile it, and then grade it. It will look roughly like this:
$ gunzip 6.830-lab3.tar.gz
$ tar xvf 6.830-lab3.tar
$ cd 6.830-lab3
[replace build.xml, HeapFileEncoder.java, and test]
$ ant test
$ ant systemtest
[additional tests]
If any of these commands fail, we'll be unhappy, and, therefore, so will your grade.
An additional 50% of your grade will be based on the quality of your writeup and our subjective evaluation of your code.
We've had a lot of fun designing this assignment, and we hope you enjoy hacking on it!
|
{"Source-Url": "https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-830-database-systems-fall-2010/assignments/MIT6_830F10_lab3.pdf", "len_cl100k_base": 4513, "olmocr-version": "0.1.53", "pdf-total-pages": 10, "total-fallback-pages": 0, "total-input-tokens": 19898, "total-output-tokens": 5020, "length": "2e12", "weborganizer": {"__label__adult": 0.0006632804870605469, "__label__art_design": 0.0003299713134765625, "__label__crime_law": 0.0006475448608398438, "__label__education_jobs": 0.00844573974609375, "__label__entertainment": 9.077787399291992e-05, "__label__fashion_beauty": 0.0002741813659667969, "__label__finance_business": 0.0002560615539550781, "__label__food_dining": 0.0007023811340332031, "__label__games": 0.0011348724365234375, "__label__hardware": 0.0007853507995605469, "__label__health": 0.000522613525390625, "__label__history": 0.0002846717834472656, "__label__home_hobbies": 0.0001952648162841797, "__label__industrial": 0.0005092620849609375, "__label__literature": 0.0004193782806396485, "__label__politics": 0.000415802001953125, "__label__religion": 0.0006508827209472656, "__label__science_tech": 0.002208709716796875, "__label__social_life": 0.000286102294921875, "__label__software": 0.0029506683349609375, "__label__software_dev": 0.9765625, "__label__sports_fitness": 0.0006389617919921875, "__label__transportation": 0.0007414817810058594, "__label__travel": 0.0003311634063720703}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 20590, 0.02843]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 20590, 0.28085]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 20590, 0.91414]], "google_gemma-3-12b-it_contains_pii": [[0, 2082, false], [2082, 3854, null], [3854, 6705, null], [6705, 9698, null], [9698, 12270, null], [12270, 15214, null], [15214, 17815, null], [17815, 20127, null], [20127, 20590, null], [20590, 20590, null]], "google_gemma-3-12b-it_is_public_document": [[0, 2082, true], [2082, 3854, null], [3854, 6705, null], [6705, 9698, null], [9698, 12270, null], [12270, 15214, null], [15214, 17815, null], [17815, 20127, null], [20127, 20590, null], [20590, 20590, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, false], [5000, 20590, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 20590, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 20590, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 20590, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, true], [5000, 20590, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 20590, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 20590, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 20590, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 20590, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 20590, null]], "pdf_page_numbers": [[0, 2082, 1], [2082, 3854, 2], [3854, 6705, 3], [6705, 9698, 4], [9698, 12270, 5], [12270, 15214, 6], [15214, 17815, 7], [17815, 20127, 8], [20127, 20590, 9], [20590, 20590, 10]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 20590, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-11
|
2024-12-11
|
fd4bcb3e636466a55f2d17cce60877af1ba671c5
|
Rendering in Blender Cycles Using Intel® Xeon Phi™ (Code Named Knights Landing)
IT4Innovations National Supercomputing Centre, Ostrava, Czech Republic
Milan Jaroš, Lubomír Říha
Outline
- Blender Cycles introduction
- Algorithm for image rendering
- CPU rendering in original code
- New OMP Device for rendering
- New MPI Device for rendering
- Embree integration
- Benchmarks
Blender Cycles
- **Blender** is an open source 3D creation suite. It has two render engines: Blender Internal and Cycles.
- **Cycles** is a raytracing based render engine with support for interactive rendering, shading node system, and texture workflow.
Cycles is internal plugin (Extending Python w. C++)
Blender start – register C++ modules into Python
1.) Write a C++ function for rendering
```
//blender/intern/cycles/blender/blender_session.cpp
void BlenderSession::render() {
//...
BL::RenderSettings r = b_scene.render();
//...
}
```
2.) Write a Python-callable function
```
//blender/intern/cycles/blender/blender_python.cpp
static PyObject *render_func(PyObject *self, PyObject *value) {
BlenderSession *session = (BlenderSession*)PyLong_AsVoidPtr(value);
//...
session->render();
//...
Py_RETURN_NONE;
}
```
3.) Include the Python module in the Blender GUI
```
//blender/intern/cycles/blender/blender_python.cpp
static struct PyModuleDef module = {
PyModuleDef_HEAD_INIT,
"cycles",
"Blender cycles render integration", -1,
methods,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
};
```
4.) Register this function within a module’s symbol table
```
//blender/intern/cycles/blender/blender_python.cpp
static struct PyModuleDef module = {
PyModuleDef_HEAD_INIT,
"cycles",
"Blender cycles render integration", -1,
methods,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
};
```
5.) Write an init function for the module
```
//blender/intern/cycles/blender/blender_python.cpp
void *CCL_initPython() {
PyObject *mod = PyModule_Create(&ccl::module);
//...
return (void*)mod;
}
```
Rendering Equation
\[
L_o(x, \omega_o) = L_e(x, \omega_o) + \int_{\Omega} L_i(x, \omega_i) f_r(x, \omega_i, \omega_o) (\omega_i \cdot n) \ d\omega_i
\]
- \( \omega_o \) is direction of outgoing ray
- \( \omega_i \) is direction of incoming ray
- \( L_o \) is spectral radiance emitted by the source from point \( x \) in direction \( \omega_o \)
- \( L_e \) is emitted spectral radiance from point \( x \) in direction \( \omega_o \)
- \( \Omega \) is the unit hemisphere in direction of normal vector \( n \) with center in \( x \), over which we integrate
- \( L_i \) is spectral radiance coming inside to \( x \) in direction \( \omega_i \),
- \( f_r(x, \omega_i, \omega_o) \) is distribution function of the image (BRDF) in point \( x \) from direction \( \omega_i \) to direction \( \omega_o \),
- \( \omega_i \cdot n \) is angle between \( \omega_i \) and surface normal.
Path tracing
- For each pixel a ray is cast into a scene.
- A ray from a camera hits a glossy surface (0), then a diffuse surface (1), and it bounces into a random direction.
- The color of the ray is calculated depending on all materials of the surfaces.
- This process is repeated by the value of samples.
- The mean value of all samples is used for the color of the pixel.
Bounding Volume Hierarchy (BVH)
The raytracing acceleration structure used is a bounding volume hierarchy. The original code is based on an implementation from Nvidia (BHV2, BHV4) and Embree (Hair BVH builder - oriented SAH, QBVH traversal, BVH nodes intersection, Triangles intersection).
- **BVH2**
- **BVH4 (QBVH)**
- **BVH8 (by maxim_d33)**
- **EMBREE (by Stefan Werner)**
Bounding Volume Hierarchy (BVH)
- **Dynamic BVH (interactive)** allows you to move objects around in the scene with quick viewport updates in rendered mode. But the image will take longer to clear up.
- **Static BVH (offline)** will create a completely new BHV tree whenever an object is moved around but the noise will clear up faster.
Original Blender parallelization
- POSIX Threads
- Communication via sockets
CPU rendering in original code (Pthreads)
- **KernelData**
- cam, background, integrator (emission, bounces, sampler), ...
- const_copy_to
- **KernelTextures**
- bvh, objects, triangles, lights, particles, sobol_directions, texture_images, ...
- tex_alloc
- tex_free
- **CPUDevice**
- decompose task to subtasks
- thread_run
- **Pthreads**
- MEM
- CPU
- **ONE NODE**
- mem_alloc
- mem_free
- mem_copy_from
- mem_copy_to
CPU rendering in original code (Pthreads)
The decomposition of synthesized image with resolution $x(r) \times y(r)$ to tiles with size $x(t) \times y(t)$ by original implementation. The one tile is computed by one POSIX thread on one CPU core for $x(t) \times y(t)$ pixels. This is an example of CPU4.
CyclesPhi
We have modified the kernel of the Blender Cycles rendering engine and then extended its capabilities to support the HPC environment. We call this version the CyclesPhi and it supports following technologies:
- OpenMP
- MPI
- Intel® Xeon Phi™ with Offload concept (KNC)
- Intel® Xeon Phi™ with Symmetric mode (KNC, KNL)
- And their combinations
Native, Offload and Symmetric modes
Native mode, Offload mode and Symmetric mode
**Distributed rendering**
Symmetric mode (KNC, KNL)
- Blender
- CPU
- MPI
- OpenMP
- MIC0
- MIC1
- Blender client
**Single node rendering**
Offload mode (KNC)
- Blender
- CPU
- MIC0
- MIC1
- OpenMP+Offload
Native mode (KNL)
- Blender
- MIC0
**Blender**
- Client
---
**OpenMP**
- MIC0
- MIC1
**MPI**
---
**General**
- OpenCL:
- Clip Alpha: 0.004
- Virtual Pixel Mode:
- Native
- Frame Server Port: 8080
- Console Scrollback: 256
- Selection:
- Automatic
- Anisotropic Filtering: 2x
- Window Draw Method:
- Automatic
- No Multisample
- Region Overlap
**ScreenCap**
- Compute Device: 10
- CPU
- Device No: 0, Device Name: mic0
- Device No: 0, Device Name: mic1
- Device No: 1, Device Name: mic1
- CPU+Device No: 0, Device Name: mic0
- CPU+Device No: 0, Device Name: mic1
- CPU+Device No: 1, Device Name: mic1
- Time Out: 120
- Collection Rate: 60
Parallelization using OpenMP
OMPDevice
KernelData
- cam, background, integrator
- (emission, bounces, sampler), ...
const_copy_to
KernelTextures
- bvh, objects, triangles, lights,
- particles, sobol_directions,
- texture_images, ...
tex_alloc
tex_free
OMPDevice
buffer, rng_state
mem_alloc
mem_free
mem_copy_from
mem_copy_to
ONE NODE
OpenMP+Offload(KNC)
OpenMP (KNL)
OpenMP (CPU)
OMPDevice
decompose task to subtasks
Pthreads
tile
thread_run
Parallelization using OpenMP
Rendering using OpenMP and MPI
Rendering using OpenMP and MPI
**KernelData**
- cam, background, integrator (emission, bounces, sampler), ...
- `const_copy_to` (1)
**KernelTextures**
- bvh, objects, triangles, lights, particles, sobol_directions, texture_images, ...
- `tex_alloc` (2)
- `tex_free`
**buffer, rng_state**
- `mem_alloc`
- `mem_free`
- `mem_copy_to` (3)
---
**OpenMP Render loop**
**7D Enhanced hypercube Infiniband network**
**Send **KernelData**(ex. camera properties) to all nodes with Bcast**
**Send **KernelTextures**(ex. triangles) to all nodes with Bcast**
**Send the information about the size of buffer (rendered pixels) and size of rng_state (random number generator state) to all nodes with Bcast**
**Send the initial values of rng_state to all nodes with Bcast**
**Start rendering with Bcast message**
**Read the current results from node and send the buffer to root with Gather**
**Send new jobs to clients with Scatter**
**View results in Blender**
Blender & Embree
Our modification is based on code from Stefan Werner:
https://github.com/tangent-animation/blender278/tree/master_cycles-embree
---
```cpp
// bvh_embree.h
class BVHEmbree : public BVH
{
RTCScene scene;
RTCDevice device;
BVHEmbree() { device = rtcNewDevice("verbose=1"); }
virtual ~BVHEmbree() {
rtcDeleteScene(scene);
rtcDeleteDevice(device);
}
void add_triangles(Mesh *mesh, int i, int &geom_id, int &geom_id_device)
{
RTCindices tri_indices = rtcNewTriangleMesh2(scene, RTC_GEOMETRY_DEFORMABLE, num_triangles, num_verts, num_motion_steps, i*2);
rtcSetTransform2(scene, geom_id, RTC_MATRIX_ROW_MAJOR, (const float*) &ob->tfm);
rtcSetUserData(scene, geom_id_device, (void*) instance_bvh->scene);
rtcSetMask(scene, geom_id, ob->visibility);
}
void BVHEmbree::add_instance(Object *ob, int i)
{
BVHEmbree *instance_bvh = (BVHEmbree*) (ob->mesh->bvh);
int geom_id = rtcNewInstance3(scene, instance_bvh->scene, num_motion_steps, i*2);
int geom_id_device = 0;
rtcSetTransform2(scene, geom_id, RTC_MATRIX_ROW_MAJOR, (const float*) &ob->tfm);
rtcSetUserData(scene, geom_id, (void*) instance_bvh->scene);
rtcSetMask(scene, geom_id, ob->visibility);
}
// bvh_embree.cpp
void BVHEmbree::add_object(Object *ob, int i)
{
Mesh *mesh = ob->mesh;
int geom_id = 0;
int geom_id_device = 0;
add_triangles(mesh, i, geom_id, geom_id_device);
rtcSetUserData(scene, geom_id, (void*) prim_offset);
rtcSetOcclusionFilterFunction(scene, geom_id, rtc_filter_func);
rtcSetMask(scene, geom_id, ob->visibility);
}
void BVHEmbree::add_instance(Object *ob, int i)
{
BVHEmbree *instance_bvh = (BVHEmbree*) (ob->mesh->bvh);
int geom_id = rtcNewInstance3(scene, instance_bvh->scene, num_motion_steps, i*2);
rtcSetTransform2(scene, geom_id, RTC_MATRIX_ROW_MAJOR, (const float*) &ob->tfm);
rtcSetUserData(scene, geom_id, (void*) instance_bvh->scene);
rtcSetMask(scene, geom_id, ob->visibility);
}
```
bool scene_intersect(KernelGlobals *kg, const Ray ray, const uint visibility, Intersection *isect, uint *lgc_state, float difl, float extmax) {
if(kernel_data.bvh.scene) {
isect->t = ray.t;
CCLRay rtc_ray(ray, kg, visibility, CCLRay::RAY_REGULAR);
rtcIntersect(kernel_data.bvh.scene, rtc_ray);
if(rtc_ray.geomID != RTC_INVALID_GEOMETRY_ID && rtc_ray.primID != RTC_INVALID_GEOMETRY_ID) {
rtc_ray.isect_to_ccl(isect);
return true;
}
return false; // ...
}
return false; // ...
}
void CCLRay::isect_to_ccl(ccl::Intersection *isect) {
const bool is_hair = geomID & 1;
isect->u = 1.0f - v - u;
isect->v = u;
isect->t = tfar;
if(primID != RTC_INVALID_GEOMETRY_ID) {
RTCScene inst_scene = (RTCScene) rtcGetUserData(kernel_data.bvh.scene, instID);
isect->object = instID/2;
} else {
isect->object = OBJECT_NONE;
}
isect->type = kernel_tex_fetch(__prim_type, isect->prim);
}
Benchmarks
- **IT4Innovations**
- Salomon
- Intel® Xeon™ E5-2680v3 (Haswell)
- Intel® Xeon Phi™ 7120P (KNC) (for MPI tests)
- NVIDIA® GeForce® GTX TITAN X
- Workstation
- NVIDIA® GeForce® GTX 970
- **Marconi-A2 CINECA**
- Intel® Xeon Phi™ 7250 (KNL)
The preprocessing for GTX 970 and for TITAN X is on CPU. This time includes the data transfers. EMBREE-BVH8 is used for Haswell and KNL.
Performance comparison - Rendering
GTX 970 and TITAN X use CUDA technology. KNL uses 4x Pthreads and 68x OpenMP threads. EMBREE-BVH8 is used for Haswell and KNL.
Performance comparison of building of BVH
Classroom | Fishy Cat | Koro | Pabellon Barcelona
---|---|---|---
Time in seconds
- BHV2 - 2x Haswell
- BHV4 - 2x Haswell
- BHV8 - 2x Haswell
- EMBREE - 2x Haswell
- BHV2 - KNL
- BHV4 - KNL
- BHV8 - KNL
- EMBREE - KNL
Performance comparison of BVH - Rendering

- **Classroom**: BHV2 - 2x Haswell (413), BHV4 - 2x Haswell (319), BHV8 - 2x Haswell (376), EMBREE - 2x Haswell (349), BHV2 - KNL (315), BHV4 - KNL (343), BHV8 - KNL (382), EMBREE - KNL (413)
- **Fishy Cat**: BHV2 - 2x Haswell (231), BHV4 - 2x Haswell (195), BHV8 - 2x Haswell (213), EMBREE - 2x Haswell (177), BHV2 - KNL (217), BHV4 - KNL (177), BHV8 - KNL (295), EMBREE - KNL (245)
- **Koro**: BHV2 - 2x Haswell (482), BHV4 - 2x Haswell (401), BHV8 - 2x Haswell (416), EMBREE - 2x Haswell (375), BHV2 - KNL (321), BHV4 - KNL (314), BHV8 - KNL (301), EMBREE - KNL (301)
- **Pabellon Barcelona**: BHV2 - 2x Haswell (379), BHV4 - 2x Haswell (376), BHV8 - 2x Haswell (349), EMBREE - 2x Haswell (247), BHV2 - KNL (217), BHV4 - KNL (177), BHV8 - KNL (122), EMBREE - KNL (122)
The Daily Dweebs: Performance comparison of w/o Motion Blur on 2x Intel® Xeon™ E5-2680v3 (Haswell)
Benchmark Worm: Strong Scalability MPI Test (offline)
- **The benchmark** was run on 64 computing nodes of the Salomon supercomputer equipped with two Intel® Xeon™ E5-2680v3 CPUs and two Intel® Xeon Phi™ 7120P.
- **Worm scene** has 13.2 million triangles.
- Resolution: 4096x2048, Samples: 1024
Benchmark Worm: Strong Scalability MPI Test (offline)
- OMP24
- Offload
- Symmetric
- linear
<table>
<thead>
<tr>
<th>Number of nodes</th>
<th>Time in seconds</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>16225</td>
</tr>
<tr>
<td>2</td>
<td>8436</td>
</tr>
<tr>
<td>4</td>
<td>4339</td>
</tr>
<tr>
<td>8</td>
<td>2210</td>
</tr>
<tr>
<td>16</td>
<td>1115</td>
</tr>
<tr>
<td>32</td>
<td>562</td>
</tr>
<tr>
<td>64</td>
<td>285</td>
</tr>
</tbody>
</table>
- 1 2 4 8 16 32 64
- 1 10 100 1000 10000 100000
Intel
Benchmark Tatra T87: Strong Scalability MPI Test (interactive)
- **The benchmark** was run on 64 computing nodes of the Salomon supercomputer equipped with two Intel® Xeon™ E5-2680v3 CPUs
- **Tatra T87** has 1.2 million triangles and uses the HDRI lighting.
- Resolution: 1920x1080, Samples: 1
Tatra T87 by David Cloete
Benchmark Tatra T87: Strong Scalability MPI Test (interactive)
Time in milliseconds vs. Number of nodes graph with data points:
- 1 node: 950 ms, 1 sample
- 2 nodes: 510 ms, 1 sample
- 4 nodes: 310 ms, 1 sample
- 8 nodes: 150 ms, 2 samples
- 16 nodes: 80 ms, 2 samples
- 32 nodes: 51 ms, 4 samples
- 64 nodes: 52 ms, 4 samples
Lines indicate:
- Offload
- Offload - weak scaling
- Linear
- Optimal weak
Real-time rendering achieved: we can increase samples per transfer.
FPS values:
- 950 ms ~ 1.9 fps
- 510 ms ~ 3.6 fps
- 310 ms ~ 6.3 fps
- 150 ms ~ 11.3 fps
- 80 ms ~ 20 fps
Overall performance highlighted with Intel branding.
Agent 327: Operation Barbershop
Agent 327: Operation Barbershop
References
- Frederik Steinmetz, Gottfriend Hofmann: The Cycles Encyclopedia
- https://wiki.blender.org
- https://cloud.blender.org/blog/cycles-turbocharged-how-we-made-rendering-10x-faster
- https://www.youtube.com/watch?v=mN0zPOpADL4 (Agent327)
- https://www.youtube.com/watch?v=RJnKaAtBPhA (The Daily Dweebs)
|
{"Source-Url": "https://software.intel.com/sites/default/files/managed/ca/3e/133007-Rendering-in-Blender-Cycles-Using-Intel-Xeon-Phi-Code-Named-Knights-Landing.pdf", "len_cl100k_base": 4515, "olmocr-version": "0.1.53", "pdf-total-pages": 32, "total-fallback-pages": 0, "total-input-tokens": 63723, "total-output-tokens": 6117, "length": "2e12", "weborganizer": {"__label__adult": 0.0005517005920410156, "__label__art_design": 0.0026645660400390625, "__label__crime_law": 0.0004019737243652344, "__label__education_jobs": 0.00034689903259277344, "__label__entertainment": 0.0002675056457519531, "__label__fashion_beauty": 0.00021195411682128904, "__label__finance_business": 0.00021278858184814453, "__label__food_dining": 0.0004813671112060547, "__label__games": 0.001285552978515625, "__label__hardware": 0.0084075927734375, "__label__health": 0.0004341602325439453, "__label__history": 0.0004448890686035156, "__label__home_hobbies": 0.000152587890625, "__label__industrial": 0.0008192062377929688, "__label__literature": 0.00024235248565673828, "__label__politics": 0.00020945072174072263, "__label__religion": 0.0006542205810546875, "__label__science_tech": 0.12335205078125, "__label__social_life": 8.475780487060547e-05, "__label__software": 0.02447509765625, "__label__software_dev": 0.8330078125, "__label__sports_fitness": 0.00039267539978027344, "__label__transportation": 0.0005865097045898438, "__label__travel": 0.0003025531768798828}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 15073, 0.02907]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 15073, 0.53584]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 15073, 0.58303]], "google_gemma-3-12b-it_contains_pii": [[0, 179, false], [179, 379, null], [379, 635, null], [635, 2200, null], [2200, 3080, null], [3080, 3457, null], [3457, 3836, null], [3836, 4175, null], [4175, 4322, null], [4322, 4773, null], [4773, 5076, null], [5076, 5433, null], [5433, 5469, null], [5469, 6408, null], [6408, 6901, null], [6901, 6932, null], [6932, 7890, null], [7890, 9915, null], [9915, 10922, null], [10922, 11196, null], [11196, 11333, null], [11333, 11496, null], [11496, 11758, null], [11758, 12676, null], [12676, 12775, null], [12775, 13073, null], [13073, 13566, null], [13566, 13888, null], [13888, 14522, null], [14522, 14554, null], [14554, 14586, null], [14586, 15073, null]], "google_gemma-3-12b-it_is_public_document": [[0, 179, true], [179, 379, null], [379, 635, null], [635, 2200, null], [2200, 3080, null], [3080, 3457, null], [3457, 3836, null], [3836, 4175, null], [4175, 4322, null], [4322, 4773, null], [4773, 5076, null], [5076, 5433, null], [5433, 5469, null], [5469, 6408, null], [6408, 6901, null], [6901, 6932, null], [6932, 7890, null], [7890, 9915, null], [9915, 10922, null], [10922, 11196, null], [11196, 11333, null], [11333, 11496, null], [11496, 11758, null], [11758, 12676, null], [12676, 12775, null], [12775, 13073, null], [13073, 13566, null], [13566, 13888, null], [13888, 14522, null], [14522, 14554, null], [14554, 14586, null], [14586, 15073, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 15073, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 15073, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 15073, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 15073, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 15073, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 15073, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 15073, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 15073, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 15073, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 15073, null]], "pdf_page_numbers": [[0, 179, 1], [179, 379, 2], [379, 635, 3], [635, 2200, 4], [2200, 3080, 5], [3080, 3457, 6], [3457, 3836, 7], [3836, 4175, 8], [4175, 4322, 9], [4322, 4773, 10], [4773, 5076, 11], [5076, 5433, 12], [5433, 5469, 13], [5469, 6408, 14], [6408, 6901, 15], [6901, 6932, 16], [6932, 7890, 17], [7890, 9915, 18], [9915, 10922, 19], [10922, 11196, 20], [11196, 11333, 21], [11333, 11496, 22], [11496, 11758, 23], [11758, 12676, 24], [12676, 12775, 25], [12775, 13073, 26], [13073, 13566, 27], [13566, 13888, 28], [13888, 14522, 29], [14522, 14554, 30], [14554, 14586, 31], [14586, 15073, 32]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 15073, 0.0219]]}
|
olmocr_science_pdfs
|
2024-12-09
|
2024-12-09
|
2f64e92568acbfa2ca8c082dc1bf29bf9fa9a554
|
A New Approach to Programming Language Education for Beginners with Top-Down Learning
Abstract—There are two basic approaches in learning new programming language: a bottom-up approach and a top-down approach. It has been said that if a learner has already acquired one language, the top-down approach is more efficient to learn another while, for a person who has absolutely no knowledge of any programming languages; the bottom-up approach is preferable. The major problem of the bottom-up approach is that it requires longer period to acquire the language. For quicker learning, this paper applies a top-down approach for a beginners who has not yet acquired any programming languages.
Index Terms—Introduction: Bottom-up-approach, Learning-approach, Programming-language-learning, and Top-down-approach
I. INTRODUCTION
A programming language education is one of the most serious issues in software development, and is quite time-consuming, in particular when targeting a person who has never learned any language before [1].
Usually, when learning a new programming language, a bottom-up approach is taken in many cases [2]. That is, first learning the data definition and grammar of the targeted language, and coding a sample program, then developing the actual software with a newly learned language.
Let’s suppose the situation where an engineer with a full command of English must write a resume in French. In the bottom-up approach, he first learns the basics of French grammar, then takes the step of writing a resume in French. In the top-down approach, he gets “examples of French resumes,” and changes some parts of the example to fit his purpose.
When beginners need linguistic acquirement, a bottom-up approach is used in many cases, and there are many case studies. As for a top-down approach, on the other hand, there is very little research in the programming learning method. And there are very few examples that can be used as a canonical programming.
II. LANGUAGE LEARNING APPROACH
There are two approaches in learning a programming language: a bottom-up approach (BUA) and a top-down approach (TDA).
A. Bottom Up Approach (BUA)
The bottom-up approach is a learning approach generally starting from the basics and moving to details. For a person who tries to learn C for example, he first studies grammar and data definition, then learns how to program. This approach is very frequently used in an educational institution and a book which teaches a programming language to beginners.
B. Top Down Approach (TDA)
The top-down approach mentioned in this paper is a learning method that first uses sample programming to acquire the language ability, then studying the details of the language, i.e., grammar and data definition. TDA approach uses sample coding. When a programmer learns C, for example, a simple and canonical sample program written in C is used, and he learns programming by understanding and changing the sample code.
TDA has many advantages over BUA. Firstly TDA requires shorter period to acquire the programming language skill than BUA. TDA gives a final program, or a targeted goal to a learner and what he has to do is copy, think, change and verify. For the learner, each program presented to him gives a clear picture and goal of “This is the program that you will learn,” and he can focus on a “block” of a program rather than a small piece of a program. He understands the program as a whole, a meaningful block of programming.
Since pieces of sample coding referred by the learner are picked up from the programs that furnish textbook-style and canonical programming style, he is expected that he will be able to simultaneously learn the coding style as well.
A typical learning process of TDA is, (1) read a block of source code with referring the comments, (2) guess and understand the meaning of a program sentence. The repetition of this process surely increases the program understandability, or the ability to understand someone else’s programs.
Another advantage that a learner can enjoy from TDA is that he can acquire the sense of reusability, i.e., increasing the productivity by applying the copy-and-paste-based developing methodology. The software reusability is supposed to be one of the most promising remedies to improve the development productivity, which has only showed quite sluggish improvement for the last 4 decades. The basic idea of TDA is “using and changing
A NEW APPROACH TO PROGRAMMING LANGUAGE EDUCATION FOR BEGINNERS WITH TOP-DOWN LEARNING
the already existing programs,” and is very similar to that of reusability.
The primary shortcoming of TDA, however, is that a learner can easily catch the overview of the program, but may not understand the details [2]. We named this mentality the ITIUE-syndrome (I Think I Understand Everything syndrome), and addresses this issue lately.
C. Applicability of TDA
TDA is expected to have many advantages, but is scarcely seen in the actual programming language education in particular when targeting a first-time learner. A rare case that TDA is used is in the situation where an advanced programmer, i.e., a software engineer who has a full command of one or more programming language, learns second or more language.
The major issue that prevents the wide dissemination of TDA even among advanced programmers is the difficulties in selecting sample programs to be used for TDA, i.e., the sample programs must be pragmatic, well-written, and obeying the programming style.
Based upon our teaching experience of programming languages, we tended to develop the confidence that TDA can be applicable to the novice learner’s language learning, and conduct TDA is applicable in the programming language education targeting a first-time learner.
III. OVERVIEW EXPERIMENT
The overview of the experiments to measure the effectiveness of TDA for the first-time learner is as follows:
A. Select language
C was selected as the target programming language.
B. The details of learners
Six students (BU1, BU2, BU3 and TD1, TD2, TD3) were picked up, and BU1, BU2, BU3 were grouped for BUA while TD1, TD2, TD3 were for TDA. The details of six students are:
• BU1: An 18-year-old freshman majoring Information Engineering. No programming experience.
• BU3: A 23-year-old senior majoring Information Eng. Has experience of Java programming only.
• TD1: An 18-year-old freshman majoring Information Engineering. No programming experience.
• TD2: A 23-year-old senior majoring Material Engineering. No programming experience.
• TD3: A 23-year-old junior majoring Psychology. No programming experience.
C. Programming Sentences to Be Learned
Six students were divided into 2 groups, i.e., the Three BUA learners and Three TDA learners, and were expected to learn the following 3 sentences:
• if Sentence
• for Sentence
• while Sentence
D. Pre-Education
Prior to the experiments (or, a programming contest), both groups received the pre-education as follows:
1) BUA Group
Three tutors, or programming experts, with using textbooks, taught 3 BU learners the basics of C including how to use variables and grammar of “if,” “for” and “while.” The tutoring period was approximately 90 minutes a person.
2) TDA Group
No tutors were assigned to TDA group (no advice or guidance were given), instead only the following 3 sample programs were showed:
```
#include <stdio.h>
int main(void)
{ //Define “inputted number to be judged”
int num;
printf("Please enter an integer :");
scanf("%d",&num); /
// A value is inputted
// Judge if the value is even or odd //
if((num%2)==0){
printf("an even number");
} else{
printf("an odd number");
}
}
```
Figure 1. A Sample Program for “if-sentence”
```
#include <stdio.h>
int main(void)
{ int i; // Define “loop counter”
// Define “total number,” and set zero.
int sum=0;
// Repeat i times
for(i=1;i<=10;i++)
{ sum=sum+i; // Add “i” to the sum
printf("Total is% d",sum);
//Display the value of the sum
}
}
```
Figure 2. A Sample Program for “for-sentence”
```
A NEW APPROACH TO PROGRAMMING LANGUAGE EDUCATION FOR BEGINNERS WITH TOP-DOWN LEARNING
IV. RESULTS, ANALYSIS AND INTERPRETATION
A. Results
TABLE 1 shows the overall results of this programming experiment. “Minutes to code” is the duration time needed to code in minutes. “Correctness” is whether the program is functionally correct or not, or if the program works as defined in the specification (we applied 5-point grading system where, from 5 to 1, grading changes from excellent to poor). “Structure” refers to the program structure, and evaluates if the program follows the programming style including logic structure, data structure, indentation, naming conversion etc [3]. “Comments” evaluates whether or not comments are properly attached [4]. The “LOC” stands for “Lines of Code,” or a number of program lines. The “Grammar” means whether the program is grammatically correct or not, or a participant can code the program without compilation errors within the given time.
We also conducted an interview with 6 participants to analyze the “program understandability” and “motivation,”
<table>
<thead>
<tr>
<th>BUA / TDA</th>
<th>BUA</th>
<th>TDA</th>
</tr>
</thead>
<tbody>
<tr>
<td>Participants</td>
<td>BU1</td>
<td>BU2</td>
</tr>
<tr>
<td>minutes to code</td>
<td>51</td>
<td>60</td>
</tr>
<tr>
<td>Correctness</td>
<td>4</td>
<td>4</td>
</tr>
<tr>
<td>Structure</td>
<td>5</td>
<td>5</td>
</tr>
<tr>
<td>Comments</td>
<td>no</td>
<td>No</td>
</tr>
<tr>
<td>LOC</td>
<td>31</td>
<td>30</td>
</tr>
<tr>
<td>Grammar</td>
<td>5</td>
<td>5</td>
</tr>
</tbody>
</table>
B. Analysis
Here is one thing that we have to consider when the results are analyzed: BU3 was selected because he has the programming experience of Java (not C) only, but he extended his knowledge and experience to C programming, and showed quite high performance as is illustrated in TABLE1. We assumed that BU3 was an odd one to exclude from the results.
1) Minutes to Code
If BU3 is excluded because he is a semi-expert of Java, or an “odd man out,” the learners of BUA takes nearly 100% more than the TDA learners to develop the program. Please note that, prior to the experiments, the 3 BUA learners took a C programming language lesson in a man-to-man fashion while the 3 TDA was given only sample programs, i.e., they acquired the programming ability by self-learning.
2) Correctness
All the programs made by 6 people worked as specified in the requirement specification illustrated in Fig.4. Thus, in terms of the functional quality, we do not see any differences between BUA and TDA, or another interpretation is “Shorter learning period did not bring poorer quality.”
3) Structure
“Structure” here means whether or not the developed program follows the coding rules. Even if BU3 is excluded as an “odd man out” same as in “Minutes to
The program in Fig.1 judges if the inputted value is odd or even. The program in Fig.2 calculates the total number from 1 to 10 with using an “if statement,” and Fig.3 does the same thing with a “while-statement.” When 3 TDA learners received the above 3 programs, they tried to understand the meanings of each sentence by comparing the coding and comments, and repeated “change-and-run the programs” to verify that their understanding was correct.
E. Specifications of the Program to Be Developed
After 2 groups completed 90-minute learning, the following simple specification was presented to measure the effectiveness of TDA:
Make a “guess the secret number” program that satisfies the following requirements:
1. Get an inputted “guessed number.”
2. A player can try 10 times.
3. Compare the guessed number and the secret number.
4. If the guessed number is not right, display a message like “The guessed number was larger (smaller). You can try 7 times.”
5. If the guessed number is correct, end the program.
6. Set “256” as the secret number.
In order for the 6 participants to make the required program, 30 minutes were given as their first trial of programming, but, as we anticipated, none of 6 participants have come out a correct one (a few of them were close, but were not good enough). We then gave a few clues (we gave more clues to the BUA group than the TDA team) and another 30 minutes.
```c
#include <stdio.h>
int main(void){
int i=1; // Define “loop counter”
// Define “total number,” and set zero.
int sum=0;
// Repeat while “i” is ten or less.
while(i<=10){
// Add “i” to the sum
sum=sum+i;
// Add 1 to the loop counter.
i++;
}
printf("Total is% d",sum)
// Display the value of the sum
}
```
Figure 3. A Sample Program for “while-sentence”
Figure 4. Specification of the Problem to Be Developed
http://www.i-jep.org
Code,” the learners of BUA showed (slightly) better performance than the TDA people. This is the only instance that did not go as we anticipated before we conducted the experiments. We had an intensive interview with TD3 to figure out that he did not like programming (or, he tended to think that he was forced to join the experiments), and reiterated code-and-paste without any deeper consideration. It would be better, same as BU3, to assume TD3 as an “odd one out.”
4) Comments
Same as in “Minutes to Code,” if BU3 is excluded as an “odd man out,” the learners of BUA did not write any comments while 100% of the TDA learners put comments. The TDA people wrote comments, because the TDA people always saw the well-commented program, and assumed that comments are must. The TDA-styled learning is also good for better program readability.
5) LOC (Lines of Code)
In terms of the number of program lines developed by 6 learners, there were not significant differences between the BUA learners and the TDA people.
6) Grammar
We checked grammatical errors that were rejected by C compiler: none of 6 programs had uncompilable errors.
C. Further Analysis
Here we develop further analysis. Fig. 5 through Fig. 10 illustrate the source programs that were actually made by 6 examinees of the TDA group and the BUA group (Comments and messages in the source code were translated in English for readers’ better understanding).
Figure 5. TD1 Result Code
```c
#include <stdio.h>
int main(void)
{
int i; //Loop Counter
int num; //Number of determine
int r=6; //Number of remain
for(i=1;i<=10;i++)
{
if(num>255)
{
printf("Enter the number of Xd time\n",i);
scanf("%d\n",num); //Input Number
}
//Judgment. Otherwise or 255 <=
printf("Number is Small\n");
break;
}
if(num>=255)
{
printf("Number is Big\n");
printf("Chance is 0\n",r);
}
else if(num<255)
{
printf("Number is Small\n");
printf("Chance is 0\n",r);
}
if(num>99)
{
printf("Net Chance\n");
break;
}
return 0;
}
```
Figure 6. TD2 Result Code
```c
#include <stdio.h>
int main(void)
{
int num; //Number of determine
int i;
int val=256;
int r=6; //Number of remain
for(i=1;i<=10;i++)
{
printf("Enter the integer: ");
scanf("%d",&num); //Number of Input
a = 10 - i;
//Select()
if(num<=a) //Number is 2d
{
printf("Number is 2d\n");
printf("Chance is 0\n",r);
}
else if(num<=val) //Number is 3d
{
printf("Number is 3d\n");
printf("Chance is 0\n",r);
}
else if(num>val) //Number is 4d
{
printf("Number is 4d\n");
printf("Chance is 0\n",r);
}
}
return 0;
}
```
Figure 7. TD3 Result Code
A NEW APPROACH TO PROGRAMMING LANGUAGE EDUCATION FOR BEGINNERS WITH TOP-DOWN LEARNING
1) Quality
We compared the source code of TDA and BUA to figure out little differences. The differences were very little but obvious in “comments” and “naming.”
a) Comment
Only one person of the BUA group described comments while all the three of the TDA group added comments. This is because (1) all the sample programs had comments, the TDA examinees assumed that a source program must have comments, (2) we put emphasis on the importance of the comments prior to the programming, (3)
we asked the TDA examinees to understand the meaning of the source code by comparing each program sentence and the attached comment. For the BUA learners, commenting or not commenting heavily depends on the educators: whether or not he teaches the importance of comments.
b) Naming variables
Between the TDA and BUA learners, there were significant differences in the “naming convention,” or naming rules. Fig.11 illustrates examples of the variable names made by a BUA examinee. The variable names do not show or suggest the actual meanings of the variables.
Fig.12 shows an example of the variable names used by a TDA learner. Compared to the names of the BUA examinees, the variable names have some meanings, and suggest the usage of the variables. These better naming came from the sample source code that applies textbook-style naming convention.
There is a tendency that put more of a group of TDA is to understand the Naming of Things also when you look at the code of the other.
D. Interpretation
1) Program Understandability
We conducted an interview with BUA people to find out that they (except for BU3) even did not have the sense of the programing understandability. This is because they wrote a program, but did not read it. On the other hand, the TDA learners started from reading programs with referring to comments. This unconsciously increased the learners’ program understandability.
2) Motivation
Retaining motivation is extremely important and difficult when learning something, and many studies have addressed this issue in programming language learning [5] [6].
The interview revealed that TDA learners could retain the motivation much longer than the BUA people. The TDA learners clearly understood their goals because samples were given. People can retain motivation if a goal is showed.
V. ISSUE OF TDA
TDA has some issues: When we conducted the interview, the three participants of the TDA group mentioned the following comments:
- "I think I understood everything" (actually he did not)
- "I understood the process" (actually he does not know how to use it)
- "Because I see the goal, I thought it must be easy to overcome the problem"
We suspect that this is an undesirable side effect of TDA, and we name it ITIUE-syndrome (I Think I Understood Everything syndrome). Since the basic idea of TDA is, firstly, TDA clearly shows where to start and its goal by sample programs, then a learner studies programming, he tends to think that “I think I can easily make it,” or in the worst case, “I completely understood everything” even though what he has to learn is how to actually and practically program.
This mentality must be corrected. One of the possible remedies will be to provide a program with some blank lines, or a “fill-in-the-blanks” type of programming questions to see how deeply the learner understands.
In addition, one must also consider the sample code to be provided. The sample code must furnish canonical coding style, naming convention, and algorithm so that a learner assumes the code as a textbook. We need criterion for choosing the sample source code.
VI. FUTURE WORK
Our experiments showed that TDA is quite effective for a beginner education. In order for us to analyze the more details of TDA, in particular the applicability and relationship between TDA and a programming language, we will conduct a larger scale programming experiments.
One of the most crucial issues that we have to tackle is that how we will be able to furnish canonical or textbook-styled programs which perfectly follow programming rules, use good algorithm, have proper comments, etc.
Also we will have to come out a language learning process based upon TDA to generalize the language education.
VII. CONCLUSION
When learning a new programming language, those who are familiar with programming languages tend to apply top-down approach or TDA, i.e., firstly attempting to understand program sentences then moving to grammar and details. Although this approach will surely bring a quicker learning compared to a bottom-up approach, or BUA, which starts from grammar then goes to program sentence, many education organizations for programming language have supposed that TDA was not good for beginners.
We picked up 6 students, who have never learned any programming language, and applied a top-down approach in their new programming language learning education.
The results revealed that TDA is quite effective even when a beginner is targeted: although there is no noticeable improvement in program writing between TDA and BUA, the learners in the TDA group significantly increased the program understandability (i.e., understanding other person’s programming) because they reiterated “read and understand the sample programs. They also acquired the sense of reusability.
ACKNOWLEDGEMENT
We thank Hiroki Hayashi, Sho Takahashi, Yuta Saito, Ryo Masuoka, Hiroto Baba, Hirotaka Suma who participated into our programming experiments. Also we thank Daisuke Moriya, Yuya Hukuyama, Tomoyasu Tanaka for conducting the experiments, summarizing the data, and proof reading.
REFERENCES
AUTHORS
D Saito is with the Information and Communication Technology Department, Tokai University (e-mail: 3bjnnm007@mail.tokai-u.jp).
T Yamaura is with the Information and Communication Technology Department, Tokai University (e-mail: yamaura@keyaki.cc.u-tokai.ac.jp)
This article is an extended and modified version of a paper presented at the 2013 IEEE International Conference on Teaching, Assessment and Learning for Engineering (TALE2013), held 26-29 August 2013, Bali Dynasty Resort, Kuta, Indonesia. Submitted 30 September. Published as re-submitted by the authors 01 December 2013.
|
{"Source-Url": "http://www.online-journals.org/index.php/i-jep/article/download/3216/2896", "len_cl100k_base": 5064, "olmocr-version": "0.1.53", "pdf-total-pages": 6, "total-fallback-pages": 0, "total-input-tokens": 17383, "total-output-tokens": 5881, "length": "2e12", "weborganizer": {"__label__adult": 0.0011873245239257812, "__label__art_design": 0.0009617805480957032, "__label__crime_law": 0.0008444786071777344, "__label__education_jobs": 0.087646484375, "__label__entertainment": 0.0002117156982421875, "__label__fashion_beauty": 0.0004775524139404297, "__label__finance_business": 0.0006871223449707031, "__label__food_dining": 0.0015687942504882812, "__label__games": 0.00186920166015625, "__label__hardware": 0.0015764236450195312, "__label__health": 0.0011577606201171875, "__label__history": 0.0004880428314208984, "__label__home_hobbies": 0.0003910064697265625, "__label__industrial": 0.0009102821350097656, "__label__literature": 0.0011034011840820312, "__label__politics": 0.0007781982421875, "__label__religion": 0.0012655258178710938, "__label__science_tech": 0.00653076171875, "__label__social_life": 0.000518798828125, "__label__software": 0.004886627197265625, "__label__software_dev": 0.88134765625, "__label__sports_fitness": 0.0011348724365234375, "__label__transportation": 0.001682281494140625, "__label__travel": 0.0006089210510253906}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 22902, 0.02333]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 22902, 0.63908]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 22902, 0.94266]], "google_gemma-3-12b-it_contains_pii": [[0, 4446, false], [4446, 8204, null], [8204, 12815, null], [12815, 15748, null], [15748, 17317, null], [17317, 22902, null]], "google_gemma-3-12b-it_is_public_document": [[0, 4446, true], [4446, 8204, null], [8204, 12815, null], [12815, 15748, null], [15748, 17317, null], [17317, 22902, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 22902, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 22902, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 22902, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 22902, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 22902, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 22902, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 22902, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 22902, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 22902, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 22902, null]], "pdf_page_numbers": [[0, 4446, 1], [4446, 8204, 2], [8204, 12815, 3], [12815, 15748, 4], [15748, 17317, 5], [17317, 22902, 6]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 22902, 0.03462]]}
|
olmocr_science_pdfs
|
2024-12-08
|
2024-12-08
|
5d32518f0093bacffe95cc9e835dc3afb1668a7e
|
CS 3410: Chord Distributed Hash Table
Introduction
In this assignment, you will implement a basic CHORD distributed hash table (DHT) as described in this paper:
You can download my Linux implementation to play with. Download it using:
```
curl -so chord-example https://cit.dixie.edu/cs/3410/chord-example
```
Make it executable:
```
chmod 755 chord-example
```
Then launch it using:
```
./chord-example
```
Requirements
Your DHT must implement the services to maintain a DHT, and it must support a simple command-line user interface. Each instance (running on different machines, or on the same machine on different ports) will run an RPC server and act as an RPC client. In addition, several background tasks will run to keep the DHT data structures up-to-date.
User interface
When running, an instance of your DHT should support a simple command-line interface. It will supply a prompt, and the user can issue one of the following commands. The simplest command is:
- **help**: this displays a list of recognized commands
The main commands start with those related to joining and leaving DHT rings:
- **port <n>**: set the port that this node should listen on. By default, this should be port 3410, but users can set it to something else.
This command only works before a ring has been created or joined. After that point, trying to issue this command is an error.
- **create**: create a new ring.
This command only works before a ring has been created or joined. After that point, trying to issue this command is an error.
- **join <address>**: join an existing ring, one of whose nodes is at the address specified.
This command only works before a ring has been created or joined. After that point, trying to issue this command is an error.
- **quit**: shut down. This quits and ends the program. If this was the last instance in a ring, the ring is effectively shut down.
If this is not the last instance, it should send all of its data to its immediate successor before quitting. Other than that, it is not necessary to notify the rest of the ring when a node shuts down.
Next, there are those related to finding and inserting keys and values. A `<key>` is any sequence of one or more non-space characters, as is a value.
- **put <key> <value>**: insert the given key and value into the currently active ring. The instance must find the peer that is responsible for the given key using a DHT lookup operation, then contact that host directly and send it the key and value to be stored.
- **putrandom <n>**: randomly generate n keys (and accompanying values) and put each pair into the ring.
Useful for debugging.
- **get `<key>`**: find the given key in the currently active ring. The instance must find the peer that is responsible for the given key using a DHT lookup operation, then contact that host directly and retrieve the value and display it to the local user.
- **delete `<key>`**: similar to lookup, but instead of retrieving the value and displaying it, the peer deletes it from the ring.
Finally, there are operations that are useful mainly for debugging:
- **dump**: display information about the current node, including the range of keys it is responsible for, its predecessor and successor links, its finger table, and the actual key/value pairs that it stores.
- **dumpkey `<key>`**: similar to **dump**, but this one finds the node responsible for `<key>`, asks it for its dump info, and displays it to the local user. This allows a user at one terminal to query any part of the ring.
- **dumpaddr `<address>`**: similar to above, but query a specific host and dump its info.
- **dumpall**: walk around the ring, dumping all information about every peer in the ring in clockwise order (display the current host, then its successor, etc).
Of these, **dump** is the most helpful and is required. The others may prove helpful in debugging, but they are optional.
**DHT interface**
When communicating with other DHT nodes, your DHT should use the basic operations described in the paper, including finger tables. You should implement a successor list as described in the paper, and basic migration of key/value pairs as nodes join and leave. Details are given later in this document.
There are a few different basic types of values that you will need to work with. For node addresses, use a string representation of the address in the form `address:port`, where address is a dotted-decimal IP address (not a host name). When referring to positions on the ring (ring addresses), you will be using a large number, not a string. This works out nicely: keys and node addresses are strings, and both can be hashed into ring addresses, which are not strings. The type checker will make sure you never mix up the two types of addresses.
You will use the sha1 hash algorithm (available in `crypto/sha1` in the Go standard library), which gives 160-bit results. This means that your finger table will have up to 160 entries. In order to treat these as large integer operations and perform math operations on them, you will need to use the `math/big` package. I recommend immediately converting sha1 hash results into `big` values and using that as your type for ring addresses.
Each node will need to maintain the following data structures as described in the paper:
- **finger**: a list of addresses of nodes on the circle. Create a list with 161 entries, all of which start out empty (`None`). You will only need to maintain a few of them at the end, but by creating a full-size list you will simplify your code and make it as similar to the pseudo-code in the paper as possible. Use entries 1-160 (instead of 0-159) for the same reason.
- **successor**: a list of addresses to the next several nodes on the ring. Set the size of this list as a global, named constant with a value of at least 3.
- **predecessor**: a link to the previous node on the circle (an address)
Note that addresses should contain an IP address and a port number.
The main operations you must support are:
- **find_successor(id)**: note that this is not the same as the **get** function from the command-line interface. This is the operation defined in Figure 5 of the paper.
- **create()**: note that this is not the same as the **create** function in the application interface; it is the operation defined in Figure 6 of the paper (and is invoked by the command-line interface).
- **join(n')**: note that this is not the same as the **join** function in the application interface.
- **stabilize()**
- **notify(n')**
Suggestions
The following are implementation suggestions, which you are free to follow or ignore.
Goroutines
- When you start the DHT (either through a create request or a join request), you should launch the RPC server for the local node. This is similar to what you have already done in the first project. Set up the necessary data structures, then launch the RPC server in its own goroutine.
- Run the stabilize procedure in its own goroutine, also launched at node creation time. It should run in a forever loop: sleep for a second, then call the stabilize procedure described in the paper.
- Similarly, fixfingers should run every second or so in its own goroutine.
- CheckPredecessor also runs in its own goroutine, also in a loop that repeats every second or so.
- Use the main goroutine to run the command-line interface loop. When it exits, everything else will be shut down as well.
RPC connections
The number and locations of peers will vary over time. For a production system, you would maintain a pool of outgoing connections and garbage collect connections over time.
To make things simpler, establish a fresh RPC connection for each message you send, wait for the response, then shut down that connection. You may find it helpful to write a function like this:
```go
func call(address string, method string, request interface{}, reply interface{}) error
```
This function takes care of establishing a connection to the given address, sending a request to the given method with the given parameters, then closes the client connection and returns the result.
It is okay to make all of your requests synchronously, i.e., the goroutine that sends the request can stop and wait until the response is available.
Iterative lookups
Use the iterative style of recursive lookups as described in the paper. All RPC calls will be able to return values immediately without blocking, i.e., every RPC server function queries or modifies local data structures without having to contact other servers.
The most complicated operation you must support is a complete `find_successor` lookup that may have to contact multiple servers. It should start by checking if the result can be found locally. If not, it should enter a loop. In each iteration, it contacts a single server, asking it for the result. The server returns either the result itself, or a forwarding address of the node that should be contacted next.
Put in a hard-coded limit on the number of requests that a single lookup can generate, just in case. Define this as a global, named constant. 32 ought to be sufficient for hundreds of nodes.
Here is revised pseudo-code for `find_successor` and friends:
```go
// ask node n to find the successor of id
// or a better node to continue the search with
n.find_successor(id)
if (id ∈ [n, successor])
return true, successor;
else
return false, closest_preceding_node(id);
// search the local table for the highest predecessor of id
n.closest_preceding_node(id)
```
// skip this loop if you do not have finger tables implemented yet
for i = m downto 1
if (finger[i] ∈ n, id)
return finger[i];
return successor;
// find the successor of id
find(id, start)
found, nextNode = false, start;
i = 0
while not found and i < maxSteps
found, nextNode = nextNode.find_successor(id);
i += 1
if found
return nextNode;
else
report error;
Hash functions
To get a SHA1 hash value, include the appropriate libraries and use something like this:
```go
func hashString(elt string) *big.Int {
hasher := sha1.New()
hasher.Write([]byte(elt))
return new(big.Int).SetBytes(hasher.Sum(nil))
}
```
Now you can use the operations in [math/big] to work with these 160-bit values. It is a bit cumbersome because you cannot use infix operators. For example, the following is helpful:
```go
const keySize = sha1.Size * 8
var two = big.NewInt(2)
func jump(address string, fingerentry int) *big.Int {
n := hashString(address)
fingerentryminus1 := big.NewInt(int64(fingerentry) - 1)
jump := new(big.Int).Exp(two, fingerentryminus1, nil)
sum := new(big.Int).Add(n, jump)
return new(big.Int).Mod(sum, hashMod)
}
```
This computes the address of a position across the ring that should be pointed to by the given finger table entry (using 1-based numbering).
Another useful function is this:
```go
func between(start, elt, end *big.Int, inclusive bool) bool {
if end.Cmp(start) > 0 {
return start.Cmp(elt) < 0 && elt.Cmp(end) < 0 || (inclusive && elt.Cmp(end) == 0)
} else {
return start.Cmp(elt) < 0 || elt.Cmp(end) < 0 || (inclusive && elt.Cmp(end) == 0)
}
}
```
This one returns true if `elt` is between `start` and `end` on the ring, accounting for the boundary where the ring loops back on itself. If inclusive is true, it tests if `elt` is in `[start, end]`, otherwise it tests for `(start, end]`.
It is helpful to be able to print out hash codes in a format that makes it easy to visually compare two hash values. The following code will do this:
```go
hex := fmt.Sprintf("%040x", hashString(value))
s := hex[:8] + ". (" + string(value) + ")"
```
Big integers can be printed like any other integer value using variants of Printf, so this code prints is as a hexadecimal value (`%x`), padding it to be at least 40 characters long with leading zeros (the `040` between `%` and `x`). Then it takes a slice of that string to grab the first 8 characters (since that is usually plenty) and
append the original string. This is useful for keys and addresses.
**Getting your network address**
It is helpful to have your code find its own address. The following code will help:
```go
func getLocalAddress() string {
conn, err := net.Dial("udp", "8.8.8.8:80")
if err != nil {
log.Fatal(err)
}
defer conn.Close()
localAddr := conn.LocalAddr().(*net.UDPAddr)
return localAddr.IP.String()
}
```
**Implementation order**
**Week 1**
- Start by building your keyboard handler. Implement simple functions like `help`, `quit`, `port`, etc.
- Implement a skeleton `create` function that starts a `Node` instance complete with RPC server. Start by having it listen for a `ping` method that just responds to all requests immediately.
- Implement a `ping` command for the keyboard, which issues a ping request to a given address (as explained earlier). Use this to test if your RPC setup is working. You should use the `call` function given earlier. This will give you a complete RPC client/server pair. Note: `ping` will not be part of the final Chord ring, but it is a simple way to test that your RPC connections are working.
- Implement `get`, `put`, and `delete` RPC server functions that manipulate the bucket of key/values pairs stored on a given instance. The node should maintain a `map[string]string` holding the values on the local node, and the `get`, `put`, and `delete` methods modify that local `map`.
Implement `get`, `put`, and `delete` keyboard commands that require an address to be specified (later you will find the address by invoking your find function). These are a partial implementation of what you will eventually need. In the final version, the user would type:
```
put state utah
```
to trigger sending a `put` RPC request to the appropriate remote node. The implementation would start by looking up the node responsible for the key “state” and then issue the appropriate RPC call. In this partial version, the call would look like:
```
put state utah 144.38.198.13:3410
```
The implementation skips the lookup step and uses the supplied address instead. This lets you create the UI and test the RPC functionality before you have implemented the Chord protocol.
Test everything with multiple instances running. You should be able to insert keys into remote instances, retrieve them, and delete them.
- Start implementing your `dump` command, which will initially just list the key/value pairs stored locally.
- Make a ring. Start by ignoring finger tables, and make a ring that just uses successor pointers. Follow the rules outlined in the paper. Implement the `join` command that initially just sets the given address as your successor. An example use of the command would be:
```
join 144.38.198.13:3410
```
In the final version, the given address will be used as the starting point in a lookup to find this node’s successor. In this version, the local node uses the given address as the successor. In order to build a ring with multiple nodes, you will need to manually figure out the ring order of the nodes and use “join” to build them in the correct sequence.
Note: you will actually need to track a list of successors, so at this point you should store the successor
link as a slice of size one to make it easier to update later.
- Update \texttt{dump} to show all interesting information about this node.
\textbf{Week 2}
- Implement a timer event for the \texttt{stabilize} function. This will require implementing \texttt{notify} as well. Your goal is to allow a complete ring with valid successor and predecessor pointers. Each node will maintain a list of successors as described in the later part of the Chord paper.
You should store the successor list and the predecessor link as fields of your Node object, the same one you are publishing over RPC. Whenever you need the immediate successor, you should access the first element in the successor list.
The pseudocode for \texttt{stabilize} calls for looking up the successor’s predecessor link. Add an RPC method that a node can call to get this information from its successor. In addition to the predecessor address, the call should return the list of successors. Create a global constant that controls the number of successor links you will track. Three or four is a reasonable size.
When the successor node returns its list of successors, you should update your successor list as follows:
- Add your successor’s address to the beginning of the list you got from your successor
- Truncate the list if needed so it is not too long (measuring it against the maximum length discussed above).
- Replace your old successor list with this new one
When \texttt{stabilize} tries to contact the successor and it fails for some reason, assume that your successor has gone down. Chop the first element off your successors list, and set your successor to the next element in the list. If there is no such element (the list is empty), set your successor to your own address.
This management of a list of successors will allow you to heal the ring after a node failure.
- Implement the initial version of the \texttt{find} function. Have it follow the list of successor pointers (since no finger table exists yet). You should implement \texttt{find} using the pseudocode given earlier. \texttt{find_successor} should be this revised version for now:
\begin{verbatim}
find_successor(id)
if (id ∈ (n, successor])
return true, successor;
else
return false, successor;
\end{verbatim}
This skips the call to \texttt{closest_preceding_node} and ignores finger tables, so every lookup ends up following the linked list of nodes around the circle.
This should give you correct lookups, they are just less efficient than the versions that use finger tables.
- Revise your “join” command to use \texttt{find}. It should use the node supplied by the user as the starting point for a lookup, and should look up its own address. The result will be its true successor, which it can then use to put itself at the correct point on the ring.
The node should not start running \texttt{stabilize} until it has discovered its correct point on the ring.
- Update \texttt{get}, \texttt{put}, and \texttt{delete} to use your \texttt{find} function to find the address where a key/value pair should be located instead of requiring the user to specify it.
- Make two new RPC server functions. \texttt{put_all} receives a map of key/value pairs, and adds all of its contents to the local bucket of key/value pairs. \texttt{get_all} takes the address of a new node that is between you and your predecessor. It should gather all keys that belong to that new node (use your \texttt{between} function to determine this) into a new map, and it should also remove them from your bucket. You can loop through all the values in a map like this:
\begin{verbatim}
for key, value := range elt.Bucket { ... }
\end{verbatim}
Return the map of values that no longer belong in your node.
- When a node is about to go down (in response to a `quit` command, call `put_all` on its successor, handing it the entire local bucket before shutting down.
- When joining an existing ring, issue a `get_all` request to your new successor once the join has succeeded, i.e., as soon as you know your successor.
- At this point, you should be able to build rings with all basic functionality in place. The rest is just optimization.
- Add `fix_fingers` and `check_predecessor` and update `stabilize` to conform to the pseudo-code in the paper (if it does not already).
When `fix_fingers` finds an entry, add it to the next entry (as given in the pseudo-code), but also loop and keep adding to successive entries as long as it is still in the right range. For example, the successor for the position 1 step further around the ring is probably the successor for 2 steps around the ring, and for 4, 8, and 16 steps around the ring. You can check this without repeating the `find_successor` operation, and will likely fill the first 155 or so of the 160 entries with a single value. This is a good optimization.
- Update your `find_successor` function to use the finger table. In `closest_preceding_node`, the last line (the fallback case if nothing suitable was found in the finger table) should return your successor, not your own address.
At this point, you should have complete functionality.
|
{"Source-Url": "http://cit.dixie.edu/cs/3410/asst_chord.pdf", "len_cl100k_base": 4728, "olmocr-version": "0.1.53", "pdf-total-pages": 7, "total-fallback-pages": 0, "total-input-tokens": 19989, "total-output-tokens": 5260, "length": "2e12", "weborganizer": {"__label__adult": 0.0002911090850830078, "__label__art_design": 0.00021839141845703125, "__label__crime_law": 0.0002186298370361328, "__label__education_jobs": 0.0011510848999023438, "__label__entertainment": 7.301568984985352e-05, "__label__fashion_beauty": 0.00010442733764648438, "__label__finance_business": 0.00011587142944335938, "__label__food_dining": 0.0003285408020019531, "__label__games": 0.0005545616149902344, "__label__hardware": 0.0008645057678222656, "__label__health": 0.0003261566162109375, "__label__history": 0.00017964839935302734, "__label__home_hobbies": 7.814168930053711e-05, "__label__industrial": 0.00028133392333984375, "__label__literature": 0.00020885467529296875, "__label__politics": 0.00017189979553222656, "__label__religion": 0.00041866302490234375, "__label__science_tech": 0.01024627685546875, "__label__social_life": 0.00011396408081054688, "__label__software": 0.0053253173828125, "__label__software_dev": 0.97802734375, "__label__sports_fitness": 0.0002388954162597656, "__label__transportation": 0.000339508056640625, "__label__travel": 0.00016224384307861328}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 20637, 0.0114]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 20637, 0.47064]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 20637, 0.88748]], "google_gemma-3-12b-it_contains_pii": [[0, 2692, false], [2692, 6623, null], [6623, 9625, null], [9625, 12238, null], [12238, 15484, null], [15484, 19239, null], [19239, 20637, null]], "google_gemma-3-12b-it_is_public_document": [[0, 2692, true], [2692, 6623, null], [6623, 9625, null], [9625, 12238, null], [12238, 15484, null], [15484, 19239, null], [19239, 20637, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 20637, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 20637, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 20637, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 20637, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, true], [5000, 20637, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 20637, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 20637, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 20637, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 20637, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 20637, null]], "pdf_page_numbers": [[0, 2692, 1], [2692, 6623, 2], [6623, 9625, 3], [9625, 12238, 4], [12238, 15484, 5], [15484, 19239, 6], [19239, 20637, 7]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 20637, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-07
|
2024-12-07
|
f9cabd6354beb16197c40b81025f52d2454077d7
|
# Table of Contents
**Foreword** .......................................................................................................................... iii
**Conference Organization** ................................................................................................ iv
**Wireless Computing, Networking and Sensing**
*Dr. H. T. Kung* .......................................................................................................................... 1
**Virtual Spaces: From the Past to the Future**
*Dr. Shi-Kuo Chang* .................................................................................................................. 2
**Software Engineering of Autonomic Grid Computing Systems and Applications**
Web Services Reliability Patterns (S)
*Ingrid Buckley, Eduardo B. Fernandez, Gustavo Rossi, S. Masoud Sadjadi* .......... 4
Consistency in Self-Reconfiguration of Self-Healing Systems
*Michael E. Shin, Kiran Gopala Reddy Sunanda* ....................................................... 10
Task Decomposition for Adaptive Data Staging in Workflows for Distributed Environments (S)
*Onyeka Ezenwoye, Balaji Viswanathan, S. Masoud Sadjadi, Liana Fong, Gargi Dasgupta, Selim Kalayci* ................................................................. 16
**Requirements**
Constructing FODA Feature Diagrams with a GUI-based Tool (S)
*Shin Nakajima* ....................................................................................................................... 20
Towards a Classification of Requirements Relationships
Ruhaya Ab Aziz, Didar Zowghi, Tom McBride ........................................... 26
Towards the Selection of the Most Suitable Elicitation Technique Through a Defined
Requirements Elicitation Process (S)
Marcelo Werneck Barbosa, Glivia Angelica Rodrigues Barbosa .......................... 33
A Requirement Traceability Refinement Method Based on Relevance Feedback
Lingjun Kong, Juan Li, Yin Li, Ye Yang, Qing Wang ...................................... 37
Applying Transformation Rules to Improve i* Models (S)
Marcia Lucena, Carla Silva, Emanuel Santos, Fernanda Alencar, Jaelson Castro ...... 43
Nested NL Representation for OO Analysis and Design (S)
Magda G. Ilieva, Olga Ormandjieva .............................................................. 49
Specification of Data Requirements from Task Descriptions
Jose Luis de la Vara, Juan Sanchez .............................................................. 55
From Organizational Models to Software Requirements
Alicia Martinez, Oscar Pastor, John Mylopoulos, Hugo Estrada .......................... 61
Systematic Review of Requirements Reuse
Flavia Braga de Azambuja, Ricardo Melo Bastos, Ana Paula Terra Bacelo .......... 67
Reprioritizing the Requirements in Agile Software Development: Towards a Conceptual
Model from Clients' Perspective
Zornitza Racheva, Maya Daneva ............................................................... 73
Data Mining and Features
A Novel Hybrid Search Algorithm for Feature Selection
Pengpeng Lin, Huanjing Wang, Taghi M. Khoshgoftaar ................................. 81
Improving Text Document Clustering by Exploiting Open Web Directory
Gaurav Ruhela, P.Krishna Reddy .............................................................. 87
Automated Nursing Knowledge Management Using Indexing (S)
Shihong Huang, Sucharita Chinchanikar, Abhijit Pandya, Sam Hsu, Marilyn Parker
Applications
Classifying Web Robots by K-means Clustering
Derek Doran, Swapna S. Gokhale ................................................................. 97
Systematic Risk Assessment and Cost Estimation for Software Problems
Jerry Gao, Maulik Shah, Mihir Shah, Devarshi Vyas, Pushkala Pattabhiraman, Kamini Dandapani, Emese Bari ............................................................... 103
Improving Negotiations through Fuzzy Cognitive Maps
Sergio Assis Rodrigues, Tiago Santos da Silva, Jano Moreira de Souza ..................... 110
Software Engineering with Computational Intelligence and Machine Learning
Value-Based Software Quality Modeling
Naeem Seliya, Taghi M. Khoshgoftaar ....................................................... 116
Predicting Maintainability expressed as Change Impact: A Machine-learning-based Approach
H. Lounis, M.K. Abdi, H. Sahraoui ............................................................. 122
Program File Bug Fix Effort Estimation Using Machine Learning Methods for OSS (S)
Syed Nadeem Ahsan, Javed Ferzund, Franz Wotawa .............................................. 129
Software Architecture and Evolution
An Architecture-based Evolution Management Method for Software Product Line
Xin Peng, Liwei Shen, Wenyun Zhao ......................................................... 135
Towards Design and Architectural Evaluation of Product Variants: A Case Study on an Open Source Software System
Muhammad Irfan Ullah, Guenther Ruhe, Vahid Garousi ........................................ 141
Decision Support System Environment for Software Architecture Style Selection (DESAS v1.0) (S)
Shahrouz Moaven, Hamed Ahmadi, Jafar Habibi, Ali Kamandi ................................. 147
Towards Architecture-centric Collaborative Software Development (S)
Yanchun Sun, Hui Song, Wenpin Jiao ................................................................. 152
Agents and Multi-Agent Systems
Analysis of Agent Oriented Software Engineering Methodologies for Social Causal Models
Michele Atkinson, Sheryl Duggins ................................................................. 157
Realization of Semantic Search Using Concept Learning and Document Annotation Agents
Behrouz H. Far, Cheng Zhong, Zilan Yang, Mohsen Afsharchi ............................... 164
Agent-based Simulation Model for the Evolution Process of Open Source Software
Taemin Seo, Heesang Lee .................................................................................. 170
Towards Merging Goal Models of Networked Software
Zaiwen Feng, Keqing He, Rong Peng, Jian Wang, Yutao Ma ................................. 178
Comparison of Some Single-agent and Multi-agent Information Filtering Systems on a Benchmark Text Data Set (S)
Snehabis Mukhopadhyay, Shengquan Peng, Rajeev Raje, Mathew Palakal, Javed Mostafa ........................................................................................................ 185
Towards Adaptable BDI Agent: A Formal Aspect-oriented Modeling Approach (S)
Lily Chang, Xudong He ..................................................................................... 189
A Multi-agent Debugging Extension Architecture (S)
Ziad Al-Sharif, Clinton Jeffery ............................................................................. 194
A Recognition-primed Architecture for Human-centric Multi-agent Systems
Xiaocong Fan ...................................................................................................... 200
Using Knowledge Objects to Exchange Knowledge in a MAS Platform
*Ana Paula Lemke, Marcelo Blois* ................................................................. 206
JA AF: A Framework to Implement Self-adaptive Agents
*Balduino F. dos S. Neto, Andrew D. da Costa, Manoel T. de A. Netto, Viviane T. da Silva, Carlos J. P. de Lucena* ................................................................. 212
An Agent-based Centralized e-Marketplace in a Virtual Environment (S)
*Ingo Seidel, Markus Gartner, Josef Froschauer, Helmut Berger, Dieter Merkl* ........ 218
**Interoperability and Semantic Web Technologies**
Semantic Service Matchmaking in the ATM Domain Considering Infrastructure Capability Constraints (S)
*Thomas Moser, Richard Mordinyi, Wikan Danar Sunindyo, Stefan Biffl* ............... 222
Ontology Mapping Representations: A Pragmatic Evaluation (S)
*Hendrik Thomas, Declan O'Sullivan, Rob Brennan* ........................................ 228
Bridging Semantic Gaps Between Stakeholders in the Production Automation Domain with Ontology Areas
*Stefan Biffl, Wikan Danar Sunindyo, Thomas Moser* ........................................ 233
LD2SD: Linked Data Driven Software Development
*Aftab Iqbal, Oana Ureche, Michael Hausenblas, Giovanni Tummarello* ............... 240
Improving Searchability of a Music Digital Library with Semantic Web Technologies
*Paloma de Juan, Carlos A. Iglesias* ................................................................. 246
A Guideline Engine For Knowledge Management in Clinical Decision Support Systems (CDSSs)
*Michele Ceccarelli, Alessandro De Stasio, Antonio Donatiello, Dante Vitale* ........... 252
Ontology-based Semantic Annotations of Medical Articles (S)
*Jihen Majdoubi, Mohamed Tmar, Faiez Gargouri* ............................................. 258
Reverse Engineering
Automating Business Intelligence Recovery from a Web-based System
Jian Kang, Jianzhi Li, Jianchu Huang, Yingchun Tian, Hongji Yang .......................... 262
Automatic Class Matching to Compare Extracted Class Diagrams: Approach and Case Study (S)
Yan Liang, Nicholas A. Kraft, Randy K. Smith ....................................................... 268
SOA-based software engineering
Modeling and Verification of Automatic Multi-business Transactions
Min Yuan, Zhiqiu Huang, Jian Zhao, Xiang Li ....................................................... 274
An Adaptive Management Framework for Service Brokers in Service-oriented Architecture
W.T. Tsai, Tszyan Chow, Yinong Chen, Xiao Wei ............................................... 280
Requirements Discovery Based on RGPS Using Evolutionary Algorithm (S)
Tao Peng, Bing Li, Weifeng Pan, Zaiwen Feng ..................................................... 286
Mediation Based Variability Modeling for Service Oriented Software Product Lines (S)
Mohammad Abu-Matar .......................................................... 291
Software Engineering Education
Pedagogy-oriented Software Modeling and Simulation of Component-based Physical Systems
Dan Tappan .......................................................... 295
An Academia-Industry Collaborative Teaching and Learning Model for Software Engineering Education (S)
Huilin Ye .......................................................... 301
Software Testing and Automation
Data Flow Analysis and Testing for Web Service Compositions Based on WS-BPEL
*Chien-Hung Liu, Shu-Ling Chen* ................................................................. 306
Knowledge-based Software Test Generation
*Valeh H. Nasser, Weichang Du, Dawn MacIsaac* ....................................... 312
Some Experiments on Test Case Tracebaility (S)
*Macario Polo, Beatriz Perez, Pedro Reales* .............................................. 318
Service Oriented Architecture
Business Modeling for Service Engineering: Toward an integrated Procedure Model
*Gregor Scheithauer, Stefan Augustin, Guido Wirtz* .................................... 322
A Systematic SOA-based Architecture Process
*Jose Jorge Lima Dias Junior, Eduardo Santana de Almeida, Silvio Romero de Lemos Meira* ................................................................. 328
Research and Implementation of Service-oriented Architecture Supporting Location-based Services on Sensor Networks (S)
*Bin-Yi Liao, Wen-Shyang Huang, Jeng-Shyang Pan, Hong-Chi Wu, Yuh-Ming Cheng, Jen-Kuin Lee, Bo-Sian Wang, E-Liang Chen, Mong-Fong Horng* .............. 334
Service Creation and Composition for Realization On Service-oriented Architecture
*Chi-Lu Yang, Yeim-Kuan Chang, Chih-Ping Chu* ........................................ 338
An Extendible Translation of BPEL to a Machine-verifiable Model
*John C. Sloan, Taghi M. Khoshgoftaar, Augusto Varas* .............................. 344
Generating Test Cases of Composite Services Based on OWL-S and EH-CPN
*Bixin Li, Ju Cai, Dong Qiu, Shunhui Ji, Yuting Jiang* ................................. 350
User Perceived Response-time Optimization Method for Composite Web Services
Junfeng Zhao, Yasha Wang, Bing Xie ................................................................. 356
Dynamic Service Composition for Virtual UPnP Device Creation
Sheng-Tzong Cheng, Chih-Lun Chou, Jiashing Shih, Mingzoo Wu ..................... 364
Using Service-oriented Architectures for Socio-Cultural Analysis
David Garlan, Kathleen M. Carley, Bradley Schmerl, Michael Bigrigg, Orieta Celiku. 370
Languages and Program Understanding
A Conceptual Model for Comprehension of Object-oriented Interactive Systems (S)
Izuru Kume, Etsuya Shibayama ................................................................. 376
Arabic Lisp (S)
Hanan Elazhary ......................................................................................... 382
The Use of Reading Technique and Visualization for Program Understanding
Daniel Porto, Manoel Mendonca, Sandra Fabbri ........................................ 386
Language Support for Event-based Debugging
Ziad Al-Sharif, Clinton Jeffery ..................................................................... 392
Pie Tree Visualization
Mireille Samia, Michael Leuschel .............................................................. 400
Formal Verification of Scalable NonZero Indicators
Shao Jie Zhang, Yang Liu, Jun Sun, Jin Song Dong, Wei Chen, Yanhong A. Liu ... 406
Software Quality
Detecting Defects with an Interactive Code Review Tool Based on Visualisation and
Machine Learning
Stefan Axelsson, Dejan Baca, Robert Feldt, Darius Sidlauskas, Denis Kacan ........ 412
Dynamic Test Profiles in Adaptive Random Testing: A Case Study (S)
Huai Liu, Fei-Ching Kuo, Tsong Yueh Chen .......................................................... 418
A Novel Method of Mutation Clustering Based on Domain Analysis (S)
Changbin Ji, Zhenyu Chen, Baowen Xu, Zhihong Zhao ........................................... 422
Using a Mining Frequency Patterns Model to Automate Passive Testing of Real-time Systems
Cesar Andres, Mercedes G. Merayo, Manuel Nunez ............................................... 426
DeLLIS: A Data Mining Process for Fault Localization (S)
Peggy Cellier, Mireille Ducasse, Sebastien Ferre, Olivier Ridoux .............................. 432
Extending AOP to Support Broad Runtime Monitoring Needs (S)
Amjad Nusayr, Jonathan Cook .................................................................................... 438
Clustering of Defect Reports Using Graph Partitioning Algorithms (S)
Vasile Rus, Xiaofei Nan, Sajjan Shiva, Yixin Chen .................................................. 442
Documenting Quality Attributes of Software Components (S)
Wenhui Zhu, Yanchun Sun, Gang Huang, Hong Mei .............................................. 446
Taming Inconsistency in Value-based Software Development
Du Zhang .................................................................................................................. 450
WSTester: Testing Web Service for Behavior Conformance (S)
Bixin Li, Lili Yang, Shunhui Ji, Dong Qiu, Xufang Gong ......................................... 456
Robustness Verification Challenges in Automotive Telematics Software (S)
Ali Shahrokni, Robert Feldt, Fredrik Petterson, Anders Back .................................. 460
Smart Environments and Applications
A 2D-barcode Based Mobile Advertising Solution
Jerry Zeyu Gao, Hema Veeraragavathatham, Shailashree Savanur, Jinchun Xia ...... 466
Long-term Prediction of Wireless Network Traffic
Zhiwei Xu, Zhou Zhou, Weibiao Wu ................................................................. 473
Software Architecture and Applications
Resource Allocation for a Modular Software System
Lance Fiondella, Swapna S. Gokhale ................................................................. 480
Enhancing Property Specification Tools With Validation Techniques
Salamah Salamah, Matthew Del Buono, Eric Baily, Sarah Printy, Derek Ferris,
Laurel Christian ............................................................... 487
Software Process and Process Models
Supporting Good Decision Making at Early Stage of Software Design
Hung-Fu Chang, Stephen C-Y. Lu ................................................................. 493
A Language for Modeling Software Development Life Cycles (S)
Ernest Cachia, Mark Micallef ................................................................. 499
Weaving Process Patterns into Software Process Models (S)
Xiao-yang He, Ya-sha Wang, Jin-gang Guo, Wu Zhou, Jia-kuan Ma .................... 505
Assessing Workflow Ability of ERP and WfM Systems (S)
Lerina Aversano, Roberto Intonti, Maria Tortorella ........................................ 509
Mining Objective Process Metrics from Repository Data
Michael VanHilst, Shihong Huang ................................................................. 514
Collaborative Development of System Architecture - a Tool for Coping with
Inconsistency (S)
Peter Henderson, Matthew J. Henderson .................................................. 520
BITS: Issue Tracking and Project Management Tool in Healthcare Software
Development (S)
Ayse Tosun, Ayse Bener, Ekrem Kocaguneli .............................................. 526
Security and Privacy
Privacy-preserving Clustering of Data Streams
*Ching-Ming Chao, Chih-Chin Shen* .......................................................... 530
FiGD: An Open Source Intellectual Property Violation Detector (S)
*Carson Brown, David Barrera, Dwight Deugo* .......................................... 536
Integrating Privacy Requirements into Security Requirements Engineering
*Saeed Abu-Nimeh, Seiya Miyazaki, Nancy R. Mead* .................................. 542
iPass: An Integrated Framework for Educating, Monitoring and Enforcing Password Policies for Online Services (S)
*Dhananjay Kulkarni, Diana Ciric, Fernanda Zulkarnain* ............................... 548
Ontologies and their Applications
Improving Natural Language Specifications with Ontologies
*Sven J. Korner, Torben Brumm* .......................................................... 552
A Knowledge-based Retrieval Model
*Fabio Silva, Rosario Girardi, Lucas Drumond* .......................................... 558
TRIple Content-based OnTology (TRICOt) for XML Dissemination (S)
*Mirella M. Moro, Deise de Brum Saccol, Renata de Matos Galante* ............. 564
An Ontology-based Approach to Portable Embedded System Development
*Feng Chen, Hong Zhou, Jianzhi Li, Ruimin Liu, Hongji Yang, Han Li, He Guo, Yuxin Wang* .......................................................... 569
An Integrated Ontology Framework for Health Information Exchange
*S. Demurjian, R. Saripalle, S. Berhe* .......................................................... 575
HCI and Smart Environments
Modeling User Interpersonal Stances in Affective Dialogues with an ECA
Nicole Novielli, Enrica Gentile ................................................................. 581
Capturing Users' Preferences and Intentions in a Semantic Search System (S)
Caio Stein D’Agostini, Renato Fileto ...................................................... 587
Toward Developing Knowledge Representation in Emergency Medical Assistance through a Ontology-based Semantic Cache Model (S)
Heloise Manica, Cristiano C. da Rocha, Jose Leomar Todesco, M. A. R. Dantas, Michael A. Bauer ................................................................. 592
Specification of a Component-based Domotic System to Support User-defined Scenarios
Fady Hamoui, Marianne Huchard, Christelle Urtado, Sylvain Vauttier ........... 597
Towards Mobility Support in Smart Environments (S)
Daniel Retkowitz, Ibrahim Armac, Manfred Nagl .................................. 603
A Graph Transformation-based Approach to Task Allocation in Wireless Sensor Actor Networks (S)
Hossein Momeni, Vahid Rafe, Mohsen Sharifi, Adel T. Rahmani ................. 609
Software Measurement
Another New Criterion to Improve the Interaction Diagrams Quality
Lilia Grati, Mohamed Tmar, Faiez Gargouri ........................................... 613
Software Project Effort Estimation Non Lineal Mathematical Models
Pablo R. Soria, Borja Martin, Marian Fernandez de Sevilla, Maria J. Dominguez-Alda, Miguel A. Herranz ......................................................... 619
Software Estimation: Universal Models or Multiple Models? (S)
Alain Abran, Juan Jose Cuadrado Gallego .............................................. 625
An Empirical Study of the Feedback of the In-process Measurement in a Japanese Consortium-type Software Project (S)
_Yoshiki Mitani, Tomoko Matsumura, Katsuro Inoue, Mike Barker, Akito Monden, Ken-ichi Matsumoto_ ………………………………………………………………………………………………………………….. 631
Prest: An Intelligent Software Metrics Extraction, Analysis and Defect Prediction Tool
_Ekrem Kocaguneli, Ayse Tosun, Ayse Bener, Burak Turhan, Bora Caglayan_ ……….. 637
Accelerated Risk Management using Statistical Triggers
_Rose Williams, Krishna Ratakonda_ ……………………………………………………………. 643
Process Management and Outsourcing
A Layered Approach for Planning Releases under Uncertain Capacities
_Jim McElroy, Guenther Ruhe_ ………………………………………………………………….. 649
PP-HAS: A Task Priority Based Preemptive Human Resource Scheduling Method
_Lizi Xie, Qing Wang, Junchao Xiao, Yongji Wang, Ye Yang_ ………………………………. 655
A Real Execution of a Software Process Improvement: An Opportunity to Execute a Combination of Approaches (S)
_Adriano Bessa Albuquerque, Ana Regina Rocha_ ………………………………….. 661
Establish Decision Making Process for Selecting Outsourcing Company
_Akihiro Hayshi_ …………………………………………………………………………………. 666
From Strategy to Solution: A Lightweight Semi-prescriptive Approach for Software Development Lifecycle with Outsourcing Support (S)
_Nelio Alves, Sergio Paim, Alexandre Cardoso, Edgard Lamounier_ ……………………. 672
Databases and Data Modeling
A Model Driven Method for Data Warehouse
_Leopoldo Zepeda, Elizabeth Cecena, Jorge Rivas, Javier Cano, Nelly Condory, Matilde Celma_ ……………………………………………………………………………………………. 676
Analyzing the Software Development Process with SyQL and Lagrein
*Mirco Bianco, Alberto Sillitti, Giancarlo Succi* .................................................. 682
Performance Analysis of a Deductive Database with a Semantic Web Reasoning Engine: ConceptBase and Racer
*Simone A. Ludwig, Craig Thompson, Kristofor Amundson* ................................. 688
Object Specification Language for Graph Based Conceptual level Multidimensional Data Model (S)
*Anirban Sarkar, Sankhayan Choudhury, Nabendu Chaki, Swapan Bhattacharya* ...... 694
A Framework for Trajectory Data Preprocessing for Data Mining (S)
*Luis Otavio Alvares, Gabriel Oliveira, Carlos A. Heuser, Vania Bogorny* ............... 698
**Multimedia Software Engineering**
A Payload Optimization Technique for Multimedia Visual Cryptographye
*Moussa H. Abdallah, Rola I. Al-Khalid, Randa A. Al-Dallah* ................................. 703
Knowledge Management Framework for Conference Video-recording Retrieval
*Maria Sokhn, Elena Mugellini, Omar Abou Khaled* ........................................... 709
**Software Engineering and Aspects**
Separating The Scattered Concerns: A Graph Based Model
*Dipankar Majumdar, Swapan Bhattacharya* .......................................................... 715
Early Analysis of Modularity in Software Product Lines
*Jose M. Conejero, Juan Hernandez, Elena Jurado, Pedro J. Clemente, Roberto Rodriguez* ................................................................. 721
**Model-Driven Software Engineering**
MD-JPA Profile: A Model Driven Language for Java Persistence
*Alexandre Torres, Renata Galante, Marcelo S. Pimenta* ....................................... 727
A Pragmatic UML-based Meta Model for Object-oriented Code Generation
Tobias Haubold, Georg Beier, Wolfgang Golubski ........................................... 733
An Ontology-based Model Driven Approach for a Music Learning System
Yingchun Tian, Feng Chen and Hongji Yang, Leigh Landy ............................... 739
Reviewer's Index ..................................................................................................... 745
Author's Index ........................................................................................................ 748
Note: (S) means short paper.
|
{"Source-Url": "http://www.ksi.edu/seke/tocs/seke2009toc.pdf", "len_cl100k_base": 5077, "olmocr-version": "0.1.50", "pdf-total-pages": 15, "total-fallback-pages": 0, "total-input-tokens": 26311, "total-output-tokens": 6017, "length": "2e12", "weborganizer": {"__label__adult": 0.00041031837463378906, "__label__art_design": 0.00049591064453125, "__label__crime_law": 0.0002505779266357422, "__label__education_jobs": 0.0016460418701171875, "__label__entertainment": 0.00011074542999267578, "__label__fashion_beauty": 0.00015115737915039062, "__label__finance_business": 0.0003740787506103515, "__label__food_dining": 0.0002694129943847656, "__label__games": 0.0006542205810546875, "__label__hardware": 0.0010194778442382812, "__label__health": 0.0004045963287353515, "__label__history": 0.0003361701965332031, "__label__home_hobbies": 8.112192153930664e-05, "__label__industrial": 0.0003516674041748047, "__label__literature": 0.000423431396484375, "__label__politics": 0.00016427040100097656, "__label__religion": 0.0004353523254394531, "__label__science_tech": 0.02398681640625, "__label__social_life": 0.00012552738189697266, "__label__software": 0.011505126953125, "__label__software_dev": 0.9560546875, "__label__sports_fitness": 0.0002081394195556641, "__label__transportation": 0.00031638145446777344, "__label__travel": 0.00017750263214111328}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 24326, 0.01317]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 24326, 0.13015]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 24326, 0.52379]], "google_gemma-3-12b-it_contains_pii": [[0, 1522, false], [1522, 3320, null], [3320, 5009, null], [5009, 6962, null], [6962, 8791, null], [8791, 10270, null], [10270, 11932, null], [11932, 13535, null], [13535, 15429, null], [15429, 17192, null], [17192, 18733, null], [18733, 20444, null], [20444, 22029, null], [22029, 23725, null], [23725, 24326, null]], "google_gemma-3-12b-it_is_public_document": [[0, 1522, true], [1522, 3320, null], [3320, 5009, null], [5009, 6962, null], [6962, 8791, null], [8791, 10270, null], [10270, 11932, null], [11932, 13535, null], [13535, 15429, null], [15429, 17192, null], [17192, 18733, null], [18733, 20444, null], [20444, 22029, null], [22029, 23725, null], [23725, 24326, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 24326, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 24326, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 24326, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 24326, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 24326, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 24326, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 24326, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 24326, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 24326, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 24326, null]], "pdf_page_numbers": [[0, 1522, 1], [1522, 3320, 2], [3320, 5009, 3], [5009, 6962, 4], [6962, 8791, 5], [8791, 10270, 6], [10270, 11932, 7], [11932, 13535, 8], [13535, 15429, 9], [15429, 17192, 10], [17192, 18733, 11], [18733, 20444, 12], [20444, 22029, 13], [22029, 23725, 14], [23725, 24326, 15]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 24326, 0.0]]}
|
olmocr_science_pdfs
|
2024-11-30
|
2024-11-30
|
5531804aa40393ff146f3355ea1c8528dca0975a
|
The Case for the Software Defined Edge
Matthew P. Grosvenor, Lazaros Koromilas, Hitesh Ballani,
Paolo Costa, Christos Gkantsidis, Thomas Karagiannis
Technical Report
MSR-TR-2014-154
Abstract
Despite the hype, the use of Software Defined Networking (SDN) has been limited to simple management tasks. This results both from the narrow interface between the data- and control-plane in today’s SDN designs and from the inherent limitations of enforcing policies at switches. We propose Sweden, a software-defined edge architecture for enforcing management policies in closed environments like datacenters.
Sweden enforces the policies at end hosts with minimal network support. It decomposes administrator specified policy programs into program fragments that (i) require global visibility and hence, run at a centralized controller, (ii) need to be responsive and hence, run at the end host, (iii) need to be on the data path and hence, run at the network interface (NIC). For the last part, Sweden leverages programmable NICs and exposes a programmable match-action API, thus allowing delegation of control logic and state to the NIC.
Through examples, we show how such end-based management improves control-plane scalability and responsiveness while allowing for richer policies than previous proposals.
1 Introduction
To manage today’s networks, administrators have to manually configure both network devices and end hosts. This is cumbersome and error-prone. To remedy this, software-defined networking (SDN) argues for a simple interface between the data- and control-plane which, in turn, allows switches to be programmed based on high-level policies. OpenFlow [17] is the de facto interface for today’s switches, while efforts like Open vSwitch [23] have extended this programming model to end hosts too. However, the narrow data-plane interface restricts a lot of SDN work to simple policies like routing and reachability.
This paper explores an alternate tact for policy-based network management. We observe that while switches have good network layer visibility due to their location, they have limited compute and storage resources. By contrast, end hosts (i.e., compute servers, storage servers and middleboxes) have plentiful resources and are aware of high-level semantics for their traffic. Hence, in closed environments like datacenters, diverse management policies can be enforced at end hosts with minimal support from the network.
We propose Sweden, a software-defined edge architecture for policy-driven programming of end hosts. Sweden comprises three components: a logically centralized controller, end host control modules and programmable network interfaces (NICs). Of these, only the NICs are on the data path. This design has two key features. First, since end hosts can run actual control programs, it leads to a natural distribution of the control-plane between the controller and the ends. Second, the NICs expose a programmable match-action API with both programmable matches and actions. This API is the interface between Sweden’s data- and control-plane, and means that we can delegate requisite control logic and state to the NICs themselves.
Sweden can enforce management policies and even implement new data-plane functionality. The administrator expresses policies using event-driven programs, written in a high-level language, that are to be run at an idealized controller. This policy program is automatically decomposed into controller, end-host and NIC programs. Such decomposition leverages the strengths of each layer – logic requiring global visibility resides at the controller, logic that needs to be responsive or requires application-level semantics resides at the end host module, and only minimal logic that is necessary on the data path is on the NIC itself. Through a few example policies that are either hard or impossible to implement using SDN, we illustrate the benefits of such an approach: better scalability since each end is only responsible for traffic it observes, greater control-plane responsiveness as control logic resides at the end host itself, a performant data-plane since only necessary computation and state resides on the data path, and the ability to enforce richer policies that are stateful or require application-level semantics. We also describe our implementation efforts and a case study showing that our prototype can implement a simple per-packet load balancing policy at line rate.
The observation regarding the benefits of end host based network management is not new [7,11,23,27,28]. However, even with these proposals, the interface to the end host data plane is still a variant of OpenFlow. Instead, Sweden embodies an extreme design point with a distributed control-plane and a programmable data-plane that can be programmed to do on-path stateful computations.
2 Design
In this section, we provide an overview of the Sweden architecture and programming abstractions and then describe the implementation of a few example policies. Sweden targets environments in which (some components of) end hosts are owned by a single administration domain and can therefore be trusted. In this paper, we focus on datacenters, although our approach can also be applied in other scenarios such as enterprise or home networks [11,12].
2.1 Design Overview
The design of Sweden has been driven by two main goals. The first is to have a distributed control plane, which leverages the global knowledge available at the controller as well as the large amount of resources and application-level visibility available at the end hosts.
This is achieved by splitting the control logic between a centralized controller and a set of control modules running within the OS or hypervisor at the end hosts.
Second, we want to provide a **programmable data plane**, which can implement richer policies than the ones currently supported by SDN. We leverage recent availability of programmable NICs that allow actual programs to be executed on the NIC. We exploit this capability in Sweden by delegating the policy logic that is necessary on the data path to the NICs. This ensures high performance while still retaining a high degree of flexibility.
The Sweden architecture is depicted in Figure 1. Policies are specified using a policy program, written in a high-level language, which is conceptually able to observe all packets sent and received by end hosts in the network. This allows administrators to focus on the algorithms underlying the policies to be enforced instead of the details of their implementation. We describe the programming model used to express the policies in Section 2.2.1.
A policy program $p$ is decomposed into program fragments to be run at the controller ($p_c$), at each end host ($p_e$), and within the NIC ($p_n$). Conceptually, $p = p_c + \cup_{e \in E} p_e + \cup_{n \in N} p_n$, where $E$ and $N$ are the set of end hosts and NICs governed by the policy. Here, “=” implies extensional equality — given the same inputs, the programs will generate the same output, i.e., return values and global state. Like the original policy program, the controller program and the host program are implemented in a high-level language. For efficiency reasons the NIC program, instead, uses the restricted set of API described in Section 2.2.2. Unlike traditional SDN proposals, since the control logic is implemented in the centralized controller, Sweden requires only limited functionality from the switches, which we describe in Section 2.2.3.
In §2.3 we show how we can leverage existing work to automatically partition policy programs into program fragments. In the following section, we rely on a few manually decomposed examples to illustrate the benefits of our design.
**Table 1: Match-action rules in the NIC**
<table>
<thead>
<tr>
<th>Match</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>(<\text{match-exp}>\rightarrow f(\text{pkt}, {\text{state parameters}}))</td>
<td></td>
</tr>
</tbody>
</table>
### 2.2 Programming Abstractions
Next, we briefly describe the programming model used by administrators to express their policies in Sweden and the API that we use to implement the NIC control modules. We then describe the switch functionality required.
#### 2.2.1 Policy programming model
We opted for an event-based programming model to express policy programs. This reduces the complexity for developers (as they only need to worry about handling a small set of events) and simplifies the decomposition process (as the program structure is fixed). We support a pre-defined set of objects, namely packet, which allows developers to easily access packet fields, topology, which comprises the link and nodes (end host, switches, and middleboxes) in the datacenters, and timer, which enables timeouts or deferred actions. Developers can also define their own data structures by composing standard types such as list and hashTable. Instances of these custom data structures (hereafter called state), however, must be explicitly listed in the program preamble and cannot be dynamically allocated as doing this would complicate code static analysis.
We identified four classes of events and defined the following methods to handle them:
- **onPcktRcvdFromApp**: invoked when a packet is received from the application;
- **onPcktRcvdFromNet**: invoked when a packet is received from the network;
- **onTopologyChange**: invoked when there is a change in the topology, e.g., due to a link or server failure;
- **onStateChange**: invoked when one of the state object changes, e.g., a new tenant is admitted into the network.
A timeout can be created using the primitive createTimer, passing as parameters the time at which it should fire and the callback function to be invoked. We provide standard primitives to handle packets such as forward, drop, and duplicate. Beside common fields such as src and dst, the packet object also contains some meta-fields such as priority and rateLimiter that are not mapped to header fields but are used to indicate how the packet should be queued.
Section 2.3 provides a few examples of implementing policies using this programming model in pseudo-code.
#### 2.2.2 NIC API
The challenge with allowing NIC programmability is to achieve flexibility without sacrificing performance. To balance this, we expose a restricted NIC programming
model. A NIC program comprises a set of tables containing match-action rules, as shown in Table 1. The match operation is specified as a matching expression operating on the packet header. For the action, instead of a pre-defined set of actions, we allow action functions. An action function is a loop-free function that takes as input a packet and returns the set of next hops the packet should be forwarded to. Here a next hop can be the host, a NIC port, or even another table. The function can have other optional state parameters that carry shared state. The function can manipulate the packet (header and body), the state parameters, and create, delete, modify the match-action rules in the NIC.
Match-action programming is a natural fit for two reasons. First, it is possible to efficiently implement lookup tables in hardware using TCAMs. Secondly, thanks to the popularity from the OpenFlow community, match-action programming is already a familiar model for programmers.
2.2.3 Network support
Sweden's end-based approach to network management requires that end hosts be able to control how their packets are routed through the network. Recent proposals have shown how existing technologies like MPLS and VLANs can be used to achieve source routing in datacenters [18]. Here, end hosts specify the path of a network packet as a label in the packet header, e.g., through an MPLS label or VLAN tag, and switches perform label-based forwarding.
Such source routing requires the controller to configure the label forwarding tables at switches. For MPLS, this can be achieved through a distributed control protocol like LDP [5] while for VLANs, Spain [18] describes a solution involving multiple spanning trees. Hence, label based forwarding and the corresponding control protocol is the primary functionality Sweden requires of the underlying network. Additionally, most existing switches already support statistics gathering capabilities (e.g. SNMP) and priority-based queuing. These can be exploited by Sweden to implement richer policies.
2.3 Example policies
We now use four example policies to illustrate Sweden's operation. We chose these examples as they are either difficult or impossible to implement using SDN. The first three policies can be implemented with an idealized form of SDN (that is not restricted to the OpenFlow protocol) but in an approximate form and with higher latency for new flows and much greater control overhead. The last policy involves new data-plane functionality that requires application semantics and cannot be implemented using SDN.
2.3.1 Weighted Load Balancing
Datacenters today use ECMP to load balance traffic among multiple equal cost paths. However, ECMP assumes that the underlying topology is balanced and regular which is often not true in practice [34]. For example, in Figure 2 ECMP would distribute the traffic at switch A evenly across the two upstream links even though subsequent links along the paths have very different capacities. This can result in unfairness and poor tail performance. Consequently, Zhou et al. [34] propose WCMP, a weighted version of ECMP that balances traffic across links in a weighted fashion. In the example in Figure 2 WCMP can be used to balance traffic across the two upstream links of A in a 10:1 ratio.
```
//Global program state
1: cachedPaths([src, dst] -> {[Path1, Weight1], ...})
//Helper functions
2: path weighted_select({[path, weight], ...})
3: {[path, weight], ...} gen_paths(src, dst)
//Event-driven functions
4: void onTopologyChange()
5: for Link l: topology.getLinks() do
6: l.weight = compute_weight()
8: void onPcktRcvdFromApp (packet p) {
9: if ![p.src, p.dst] not in cachedPaths then
11: p.path = weighted_select(cachedPaths[p.src, p.dst])
12: send(p)
13: }
```
Figure 3: Policy program implementing weighted load balancing.
Policy program. We consider the following high-level policy—“Use per-packet WCMP to balance the traffic across all links”. Figure 3 shows a policy program that implements this policy. Note that this an idealized policy program that is invoked, without any delay, every time an end host sends or receives a packet. The key program logic resides in two event functions: onTopologyChange function that is invoked whenever the network topology changes and the onPcktRcvdFromApp function that is invoked when a host sends a packet.
packet. At a high level, the policy program performs three operations—(i). It uses knowledge of the datacenter topology, represented by as a graph, to associate a weight with each link in the graph (onTopologyChange function). (ii) For each flow, it determines the weight for each path to the destination. A path’s weight is the probability with which it should be used and is a product of the normalized weights of all links along the path. This step needs to be responsive to avoid delaying flow initiation, but the results can be cached for subsequent packets of the flow (lines 9–10). (iii). For each packet, it chooses a path in a weighted fashion (line 11).
Program fragments. With Sweden, we can decompose this program into program fragments to be run at the controller, end host and the data path (i.e. NIC). The controller program performs the first operation mentioned above; it implements the onTopologyChange function, and informs end hosts of the new topology and per-edge weights. The host program performs the second operation by implementing the gen_paths function. The NIC program, shown in Figure 4, performs the third operation.
Require: End host implements gen_paths
//Initial Match-Action Table
1: <src:*, dst:*, sport:*, dport:*> -> f(p)
//Helper functions
2: path weighted_select([path, weight], ...) //Choose a path in a weighted fashion
3: label generate_label_for_path(path) //Given routing label, determine the next hop
4: next-hop next_hop(label)
5: next-hops f(Pkt p) { 6: weightedPaths = HOST.gen_paths(p.dst)
7: create_rule(<cp.src, p.dst, p.sport, p.dport> -> g(pkt, weightedPaths))
8: return g(p, weightedPaths)
9: }
10: next-hops g (Pkt p, {path, weight}) -> paths { 11: path = weighted_select(paths)
12: p.label = generate_label_for_path(path)
13: return next_hop(p.label)
14: }
Figure 4: NIC program for weighted load balancing.
We detail the operation of the NIC program. It comprises a default rule that matches all packets and applies function f to the packet (line 1). When a new flow starts, this function is invoked. The function uses an RPC to the host to obtain the set of paths to the destination and their weights (line 6). It then inserts a match-action rule such that subsequent packets of the flows are processed by function g (line 7). This match-action rule is ephemeral and times out when the flow finishes. The state parameter for the function g (i.e., paths) contains the flow’s paths and their weights, and it selects the packet’s path in a weighted fashion.
We note that in this example, there is a straightforward mapping between functions in the original policy program and the program fragments. However, in general, the decomposition could be more involved.
2.3.2 Rate control
Proposals for congestion control in datacenters can be roughly divided in three different classes. The first one contains traditional congestion control algorithms like TCP and its variants [23,30], which operate in a distributed fashion. At the other end of the spectrum, we find recent proposals for centralized congestion control that rely on global knowledge and centrally compute the rate for each flow [22]. Finally, there are hybrid solutions that leverage coarse-grained network information, e.g., link congestion or utilization, to guide fine-grained rate allocation at the edge, e.g., [12,19].
Here, we focus on the last class and show how we can implement in Sweden a simplified version of the hybrid solution described in [12]. The solution consists of two phases. In the first one, the centralized controller computes a price, $0 \leq p \leq 1$, for each network link based on its utilization (details in [12]). Next, link prices are used to estimate a flow’s fair sending rate. A flow’s fair share across a link $A$ is estimated through following feedback control loop:
$$X_A(t+1) = X_A(t) + kX_A(t)[1 - p_A(t) - p(t)u_A(t)],$$
where $X_A$ is the nominal fair share in link $A$ at time $t$, $k$ is a gain parameter, and $u_A(t)$ is the utilization of the resource $A$ at time $t$. The sending rate of a flow is the minimum of its share across all links it traverses.
Policy program. The policy program for this solution is reported in Figure 3. The key program logic resides in two functions that are invoked periodically. The first function, compute_prices, is invoked at coarse timescales (seconds) and uses link utilization information to compute link prices. The second function, update_rates, is invoked at fine timescales (milliseconds) and uses link prices to update the rates for individual flows.
Program fragments. Sweden can decompose the program as follows. The controller runs the compute_prices function by periodically polling switches for statistics on link utilization. The host program extracts all resource information that is relevant for its local flows and periodically recomputes the rates, which are then enforced by the NIC.
2.3.3 Anycast
The example in Section 2.3.1 focused on load balancing of traffic across multiple paths to a destination. Here, instead, we consider the complementary policy of anycasting—load balancing among different destinations. This is typical of web or IO traffic in which requests are usually dispatched to any of the available web
servers or storage replicas. Applications interact with the service using a virtual IP address (VIP), which is then remapped to the direct IP address (DIP) of the selected destination. This can be achieved using custom hardware appliances or software load balancers [21].
Conceptually, the policy can be expressed as “given a request (e.g., HTTP GET or IO read), forward it to one of the available destinations in a (weighted) round-robin fashion”. Due to space constraints, we do not show the policy program. Instead, we explain the operation of various program fragments. The controller leverages global visibility to keep track of the list of available destinations for each virtual IP and when a change is detected (e.g., due to a server failure), it immediately notifies the end hosts. When a new flow starts, the NIC contacts the host’s control module to retrieve the destination to use. Next, for each packet belonging to the flow, the NIC performs a NAT operation, i.e. it replaces the virtual IP used by the application with the dynamic IP returned by the host. This process is completely transparent to applications, which only see the dynamic IP returned by the host. This process is completed only after a server failure, the controller provides the destination with a list of available destinations, which are then passed to the NIC. When a new flow is created, the NIC sends a request to each of them, asking for the current value of the desired metric (e.g., the CPU load). The receiving NIC issues an RPC to the local host to obtain the requested measure and sends it back to the source NIC. Once all replies have been received (or the timeout has expired), the source NIC selects the best destination and establishes a connection to it. Finally, as described above, the NIC takes care of rewriting the packet destination address when sourcing a new packet.
2.3.4 Message-awareness
We conclude our list of examples by briefly discussing a novel policy that takes into account application-level semantics in network processing.
Traditional network policies operate either at the flow or packet granularity. Often, however, neither choice is fully satisfactory. For example, balancing traffic across multiple paths on a per-flow basis ensures the best load distribution but it can negatively impact application throughput due to high packet reordering. Conversely, load balancing on a per-packet basis ensures that packets are received in order but it can lead to severe load imbalance in presence of flows with heterogeneous sizes [1].
We argue, instead, that in many cases a better strategy is to partition packets based on application-level message boundaries. These can be detected either programmatically by the end host (e.g., using a custom API or relying on the socket send() primitive) or inferred at the NIC by inspecting the content of the socket buffer. Once the message boundaries have been identified, the NIC can then enforce the specific policy when sending a packet. For example, a message-aware traffic policy could force all packets belonging to the same message to be routed along the same path. Similarly, the NIC could assign priorities to packets based on the kind of message (e.g., data vs. control message) they belong to, rather than statically assigning priorities based on packet headers.
2.4 Program decomposition
Automatic program decomposition has been a very active research area over the past decade; for web applications [9,10,12,33], sensor networks [10,20], mobile applications [6,10,24], databases [8], and COM applications [15]. Some of these techniques impose a structure and constraints on the original program to make it amenable to decomposition [15,20,24,32]. Some are restricted to decomposition at function boundaries [6,10], while some support general programming models [8,9]. Merlin [28] also uses program decomposition for simple reachability and QoS policies. Instead, we support richer policies and offload
---
```
require: Datacenter topology topology
//Global program state
1: activeFlows: Flow //the set of active flows
//Helper functions
2: compute_prices(topology) //computes the flow rate using Eq. 1
3: enforce_rate(flow, rate)
4: update_rate(flow) //computes the flow rate using Eq. 1
//Event-driven functions
5: for Link l: topology.getLinks() do
6: if l.price = compute_price() then
7: createTimer(l, compute_prices)
8: createTimer(lms, update_rates)
9: }
10: void update_rates (){
11: for Flow f: localhost.getActiveFlows() do
12: if f.rate = update_rate(f) then
13: enforce_rate(f, f.rate)
14: createTimer(lms, update_rates)
15: }
16: void onPktSend (Pkt p) {
17: if is not in activeFlows then
18: update_rate(flow)
19: send(p)
20: }
```
Figure 5: Policy program implementing centralized congestion control.
---
As distribution datacenter applications today, Sweden can also be used to implement enhanced versions that take into account application-specific and/or dynamic criteria to select the destination. For instance, we could select as destination the server with the lowest number of outstanding requests in its queue or with the lowest CPU load. Like in the example above, the controller provides the end hosts with a list of available destinations, which are then passed to the NIC. When a new flow is created, the NIC sends a request to each of them, asking for the current value of the desired metric (e.g., the CPU load). The receiving NIC issues an RPC to the local host to obtain the requested measure and sends it back to the source NIC. Once all replies have been received (or the timeout has expired), the source NIC selects the best destination and establishes a connection to it. Finally, as described above, the NIC takes care of rewriting the packet destination address when sourcing a new packet.
We leverage these ideas to automatically decompose Sweden’s policy programs. The basic idea is to perform control flow analysis to identify the basic blocks of each function. Blocks that use global state are executed in the centralized controller. For the rest, we decide their execution as follows. We classify blocks that we can execute on the NIC or install flow rules as being on the “slow path” (for the latter we assume that they will be executed infrequently); otherwise, blocks that forward or process packets belong to the “fast path”; the rest are assigned as their parent block. We aim to execute slow path blocks in the end host control module and fast path blocks in the NIC. We decompose functions that contain both fast and slow blocks by using a RPC between the NIC and the host. During such RPCs, we also need to copy the necessary state to perform the computation. In our examples, identifying that state has been easy, but, in general, this is a challenging problem. More broadly, we are investigating techniques that use domain-specific information to identify the best place to run the user programs depending on the capabilities (and execution cost) of the NICs, hosts, and controller.
3 Implementation
Our testbed consists of four Intel Xeon E5-1620 machines running at 3.70GHz with 16GB of installed memory. Each machine is equipped with a dual-port 10GbE Netronome NFE-3240 programmable flow processor NIC. The flow processor NICs include a 40 core, 8 way multi-threaded CPU (320 threads), and 4GB of memory. The CPU can perform CAM operations on main memory. The cards are programmed in a variant of C89, with explicit memory management for DRAM, scratch memory and general purpose registers. The network switch is a 40x10Gbps Blade RackSwitch.
We are extending the NIC firmware to be able to execute control programs and keep state in the NIC. We use a fast CAM assisted hashtable to implement a match-action flowtable. In addition, we have implemented a lightweight Remote Procedure Call (RPC) mechanism so that the cards can call functions on the host. For example, the card may need to request assistance from the host in the case of a flow table lookup failure. Our action functions are currently written in C and run directly on the card hardware. In future, we envisage a micro-interpreter would be used to provide a safe execution environment for action functions.
4 Weighted load balancing: A case study
As a proof-of-concept, we experimented with the weighted load balancing policy [2.3.1]. Our testing configuration emulates the arrangement shown in Figure 2. To do so, we use two hosts. The primary interfaces on each
NIC are connected together at 10Gbps. The secondary interfaces are connected together at 1Gbps. This creates two paths with different capacities between the two machines. The NICs can “source route” between these paths by choosing which port to forward traffic over. A single network interface is exposed at the OS level so that applications are unaware of the multiple paths in the network.
The NICs run our custom firmware and implement the NIC fragment of the WCMP policy—which controls how packets are balanced between the two physical ports. We use per-packet balancing, instead of path balancing to highlight Sweden’s ability to apply per-packet policies at high rate. In the default case, we use the same weights for both paths, thus implementing per-packet ECMP. When packets arrive at a NIC, they are equally distributed between both ports. Figure 6 shows the performance in this case (confidence intervals are within 1% of the mean values shown). For TCP, the throughput is dominated by the capacity of the slowest link peaking at 2Gb/s as we’d expect. For the UDP we get a throughput of about 7Gb/s. NIC driver issues mean that each host is limited to 12Gb/s. When divided equally between the two paths, we get 6Gb/s through the 10GbE path plus 1Gb/s through the GbE path.
Next, we apply the weighted select function (see Figure 2) to enforce a 10:1 ratio between ports. Figure 6 shows the results. With UDP, we achieve close to the full 11Gb/s which is our topology’s min cut. The TCP performance is lower due to in-network reordering of packets [13]. Modifying TCP’s congestion control algorithm can alleviate such issues [25]; however, the goal of our experiment is to highlight how Sweden can implement this simple policy and benefit unmodified applications running vanilla TCP.
5 Discussion & concluding remarks
Sweden decentralizes the control plane, by allowing end hosts to actively participate in policy implementation. At the same time, Sweden envisions a wider data-plane interface through programmable NICs.
Our existing implementation, though at its early stages, highlights that such shift is feasible and can unlock capabilities that are currently absent in SDNs by i) extending the programmability of the data-plane through
programmable actions, ii) overcoming a number of inherent switch limitations such as the limited computation capabilities (e.g., compute power, memory), the absence of visibility on application semantics and the need to enforce policies for large number of traffic flows at increasingly higher and higher speeds. Instead, operating at the edge provides application context and high computation capabilities that can be devoted to a smaller fraction of the traffic compared to switches.
On the other hand, we recognize that some recent proposals leverage flow coordination capabilities only found within (non-standard) switches [4][14][31]. We envision that Sweden could support these schemes using the same decomposition techniques we discussed, with an additional policy program that runs directly at the switches.
As a final note, we stress that operating at the edge can easily extend the set of management policies with properties that are elusive or hard to guarantee in today’s SDNs; examples here include per-flow consistency during updates [26], application-aware traffic engineering or message level routing (see previous section). Taking this a step further, we believe that Sweden’s architecture opens up the capability of a cross-resource management plane by extending programmable control to resources beyond the network (e.g., storage [29]).
6 References
http://netronome.com/product/flownics/
|
{"Source-Url": "https://www.microsoft.com/en-us/research/wp-content/uploads/2014/07/index-tr.pdf", "len_cl100k_base": 6720, "olmocr-version": "0.1.53", "pdf-total-pages": 9, "total-fallback-pages": 0, "total-input-tokens": 28651, "total-output-tokens": 9621, "length": "2e12", "weborganizer": {"__label__adult": 0.0004291534423828125, "__label__art_design": 0.0004014968872070313, "__label__crime_law": 0.0003757476806640625, "__label__education_jobs": 0.0005664825439453125, "__label__entertainment": 0.0001913309097290039, "__label__fashion_beauty": 0.00019299983978271484, "__label__finance_business": 0.0005741119384765625, "__label__food_dining": 0.0004627704620361328, "__label__games": 0.0008416175842285156, "__label__hardware": 0.005352020263671875, "__label__health": 0.0007328987121582031, "__label__history": 0.0004701614379882813, "__label__home_hobbies": 0.00012481212615966797, "__label__industrial": 0.0008425712585449219, "__label__literature": 0.0002560615539550781, "__label__politics": 0.0003998279571533203, "__label__religion": 0.0005512237548828125, "__label__science_tech": 0.3408203125, "__label__social_life": 9.244680404663086e-05, "__label__software": 0.0269622802734375, "__label__software_dev": 0.6171875, "__label__sports_fitness": 0.0003502368927001953, "__label__transportation": 0.0013284683227539062, "__label__travel": 0.0003342628479003906}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 38802, 0.04393]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 38802, 0.34483]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 38802, 0.86696]], "google_gemma-3-12b-it_contains_pii": [[0, 184, false], [184, 5611, null], [5611, 10318, null], [10318, 14749, null], [14749, 20005, null], [20005, 25816, null], [25816, 30734, null], [30734, 37177, null], [37177, 38802, null]], "google_gemma-3-12b-it_is_public_document": [[0, 184, true], [184, 5611, null], [5611, 10318, null], [10318, 14749, null], [14749, 20005, null], [20005, 25816, null], [25816, 30734, null], [30734, 37177, null], [37177, 38802, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 38802, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 38802, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 38802, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 38802, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 38802, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 38802, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 38802, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 38802, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 38802, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 38802, null]], "pdf_page_numbers": [[0, 184, 1], [184, 5611, 2], [5611, 10318, 3], [10318, 14749, 4], [14749, 20005, 5], [20005, 25816, 6], [25816, 30734, 7], [30734, 37177, 8], [37177, 38802, 9]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 38802, 0.01587]]}
|
olmocr_science_pdfs
|
2024-12-11
|
2024-12-11
|
a68ced25770dbafcbbe1b5b71c1841d7e917932d
|
An Intrusion Detection Sensor for the NetVM Virtual Processor
Original
Availability:
This version is available at: 11583/2298001 since:
Publisher:
IEEE
Published
DOI:
Terms of use:
openAccess
This article is made available under terms and conditions as specified in the corresponding bibliographic description in the repository
(Article begins on next page)
An Intrusion Detection Sensor for the NetVM Virtual Processor
O. Morandi, G. Moscardi, F. Risso
Dipartimento di Automatica e Informatica, Politecnico di Torino, Italy
{oilvier.morandi, giorgio.moscardi, fulvio.risso}@polito.it
Abstract— In the wide scenario of packet processing architectures, the development of ever sophisticated applications faces the challenge of finding a balance between different requirements: ever increasing performance, flexibility, and portability of the software across different platforms and hardware architectures. The Network Virtual Machine (NetVM) aims at responding to such defy by taking into account all these elements and by providing an abstract architecture for developing today’s packet processing applications. In order to demonstrate that the NetVM platform can be profitably employed for the development of complex applications, we developed a Snort-like network intrusion detection sensor. In this paper we present its architecture and show that NetVM represents an excellent target for the dynamic generation of packet processing programs.
I. INTRODUCTION
In order to keep the pace with the everyday increasing requirements in terms of throughput and flexibility, the design of high-speed packet processing applications relies always more on network processors. However, the problem of running a packet processing application on architectures other than general-purpose processors is very complex, and it gets more difficult as the complexity of the application grows. The reasons of this issue are several and of different nature: differences between the various architectures and programming paradigms (single-threaded, multi-threaded, multi-process on a multi-core processor), difficulties in exploiting the available hardware resources, like ad-hoc instructions and coprocessors. This problem is further complicated by the several different architectures available for packet processing (network processors, multi-core, systolic processors, etc.).
The problem is only apparently simplified when working with network processors that are based on a general-purpose architecture, such as the Cavium Octeon multi-MIPS processor, because a simple recompilation and minimum changes to the application enable the production of running code, in spite of sacrificing the ability to exploit the hardware resources available on the target machine, such as the Octeon’s Deterministic Finite Automata coprocessors. The problem can be solved by rewriting some parts of the application, but this solution is not general, and if the architecture changes again, the work has to be restarted from scratch. In this scenario, the NetVM virtual platform [1] represents a general solution for such problems, because it provides an abstract architecture for packet processing applications, which is able to hide the differences between physical platforms.
Even though the presented advantages of the NetVM platform look promising, it must be noted that some of them are in fact only claims that need to be further explored and demonstrated. The aim of this paper is to demonstrate the first of such claims, i.e. that the NetVM is suitable for the development of complex real-world applications, and that such development could be carried out in a relatively easy manner. To prove this statement, we have built an IDS sensor that represents one of the typical applications that could run on the NetVM architecture. This application was chosen due to its requirements in terms of processing capabilities and the necessity to deal with multiple protocol layers including deep packet inspection. In addition, IDSs are suitable for hardware acceleration because of their extensive use of regular expressions and lookup tables, which are often assisted by specialized coprocessors on physical platforms. In addition, even if this will require deeper studies, this paper will point out that the code generated for the NetVM is efficient, i.e. performances are comparable with the same application running natively on the target platform.
This work is organized as follows. Section II and III present respectively the related work and a brief recap of the technologies that are the foundation of this paper. Section IV presents the architecture of our implementation, while the evaluation of the results is given in Section V. Finally, Section VI will present some conclusive remarks.
II. RELATED WORK
The rise of network processors generated the demand for new programming models for easing the development of packet processing applications for such highly special purpose architectures, while still allowing the performances needed for keeping the pace with ever increasing line rates and traffic loads. In particular, [2] and [3] propose different software models for building complete routers through the interconnection of simple packet processing modules. [4] and
[5] propose two different packet processing languages and compilers for automatically partitioning the code to be executed on the microengines of the Intel IXP2400 network processor. While such solutions are similar to the one proposed by NetVM, they tend to focus on a specific application (e.g. packet forwarding), or on a specific architecture (e.g. Intel NPUs).
The implementation of a complete Snort-like intrusion detection sensor on a network processor was first explored by [6] that presents a compiler for generating C code from a set of intrusion signatures to be executed on an Intel IXP1200 NPU.
Since network intrusion detection relies on deep packet inspection functionalities, such as string and regular expression matching, great effort has been directed towards solutions for optimizing and offloading such processor intensive tasks through efficient algorithms and specialized hardware modules or coprocessors [7][8][9][10][11][12]. Another approach is using optimized algorithms targeted over the physical hardware platform; for example, [13] proposes a modified version of the Aho-Corasick [14] string-matching algorithm that can be executed in parallel on several microengines of the Intel IXP1200 network processor. However, our approach aims at validating the entire application instead of speeding up specific functions such as only string and RegEx matching.
III. RELATED TECHNOLOGIES
A. The NetVM Virtual Machine
The Network Virtual machine (NetVM) [1] is an abstract packet-handling engine that allows the portability of network processing applications across heterogeneous architectures.
In NetVM a packet-processing program is expressed as a set of modules called Network Processing Elements (NetPEs), which represent virtual processors that execute a mid-level assembly language called NetVM Intermediate Language (NetIL). The interconnections between different modules determine the behavior of the entire application. Figure 1 shows an example on how a simple packet forwarding element can be implemented as a NetVM application.
Figure 1. NetVM Based Forwarding Element.
The elementary execution engine, the NetPE, is a stack-based processor that is made up of a set of private registers (e.g. stack pointer, etc) and a memory hierarchy. The code instantiated on a single NetPE can be mapped on real processing engines on the physical hardware according to the best strategy. Execution of a NetVM program on real hardware relies on an implementation of the virtual machine, which can be an interpreter or a compiler for the translation of NetIL code to native machine code.
The NetVM has been designed to facilitate the translation of NetIL into native code: Figure 2 shows the complete architecture: a high level language (i.e. Snort rules) is used to produce NetIL code through an appropriate compiler. Then, a Just-in-Time compiler is used to produce the final binary code, which can then be executed on the target processing platform.
Figure 2. The code generation process in NetVM.
Since packet-processing applications usually rely on a subset of functionalities that are often implemented directly in hardware on many network processor architectures (e.g. Content Addressable Memories for fast table lookups, Deterministic Finite Automata coprocessors for string and regular expression matching), the NetVM architecture includes the concept of virtual coprocessors, i.e. a well-defined interface for making such features available to the programmer. An application considers coprocessors as “black boxes” providing specific operations, accessible through a well-defined interface that guarantees software portability among different platforms. On architectures that do not provide any hardware acceleration, coprocessors could be emulated by software. More details on the NetVM architecture are presented in [1].
B. Snort
Snort [15] is the implementation of a passive network IDS that is the de-facto reference in this class of applications; hence it seemed an obvious choice to design our own IDS by keeping compatibility with its rules and alerting formats. This way our IDS would get immediate benefit from the huge database of already-existing attack signatures, which would also offer an excellent testing environment.
Snort is currently capable of performing real-time traffic analysis and packet logging on IP networks. Its architecture is highly modular, and its capabilities include protocol analysis and content searching, which can be used to detect a variety of attacks and probes, such as buffer overflows, stealth port scans, CGI attacks, SMB probes, and many other security threats.
Snort uses a database of rules to describe the known attacks. Each rule describes a number of tests that should be performed on a packet, such as searching for a particular IP address or TCP port in the packet header, or matching a string or a regular expression in the payload. If all the tests specified in a rule are verified, then the corresponding action is undertaken (e.g. sending an alert and/or logging the packet). For example, the following rule:
```
log tcp any any --> 10.1.1.0/24 B0 \n(content: "GET"; msg: "HTTP GET");
```
logs every packet coming from any host and directed to port 80 of any machine of the 10.1.1.0/24 network containing the 'GET' string. Such packets will be logged with a message saying "HTTP GET".
More details on the Snort IDS can be found in [15].
IV. ARCHITECTURE OF THE INTRUSION DETECTION SENSOR
The IDS sensor for the NetVM is not a direct port of Snort: the two applications share almost no lines of code. Our solution is based on a custom compiler that takes Snort rules and creates NetVM assembly. The internal architecture had to be redesigned from scratch in order to take full advantage of the NetVM paradigm, which tries to exploit the intrinsic modularization seen in packet-processing applications that are usually made up of several short and independent tasks. As the Snort rule format basically specifies tests that might involve the different protocols present in a packet, we decided to create different modules, instantiated on different Network Processing Elements (NetPEs). Tests on each protocol are performed in the NetPE responsible for it, with the exception of some special functions (such as packet analysis and pattern matching) that are not associated to a single protocol and that are allocated to specific NetPEs. The final architecture is shown in Figure 3.
For instance, the rule mentioned before will involve generation of code in different modules: the IP one will check that the destination address matches;The next module is the TCP module which will be involved for checking the value of the TCP destination port, and so on. The rule will match only if all the tests are verified.
The NetPE abstraction offers the possibility of an excellent modularization: each module is almost independent, and performance can be incremented by simply improving the code generation for NetPEs that represent the bottleneck, implementing ad-hoc strategies to minimize the number of tests to be performed on a packet. For instance, some rarely used modules (e.g. ICMP) use a very simple algorithm (linear search), while others implement smarter strategies. Global optimizations can also be implemented in the NetVM framework to be able to reduce the size of the target code.
In the NetVM model, NetPEs communicate among themselves through exchange buffers, i.e. meta-packets that, besides the packet buffer, contain additional data (e.g. time stamps) and a dedicated area called info partition, where modules can store state information that flows through the NetVM following the same path of the packet. Each module composing the IDS exploits the info partition for keeping the matching state of every rule and for communicating it to subsequent modules. In particular, the info partition is divided in two parts: the former contains a bit-vector, in which every bit represents a rule, while the latter is further organised into several 32-bit slots, each one containing data extracted from the packet, such as source IP address, port, etc.
Figure 3. Architecture of the NetVM IDS sensor.
A. Packet-processing workflow
The processing of a new packet starts with the Protocol Analysis module that extracts information on the protocol headers present in the packet and records the starting offset of the payload. This piece of information is stored inside the "info partition" of the exchange buffer and is therefore made available to all the following modules in the chain. The next module is dedicated to Content Matching, which matches the payload against a set of static patterns and regular expressions specified in the source rules. This task relies on string and regular expression matching coprocessors provided by the NetVM architecture. The location of this module, almost in front of the processing chain, is due to performance reasons. In fact, the search is carried out by a modified version of the well-known Aho-Corasick algorithm [14] that allows several patterns to be searched at the same time. As a result, if a pattern is found inside the payload, only the subset of rules based on it needs to be extensively verified.
Further modules will refine the processing by performing only the tests that are required on the subset of rules that have been selected as “possibly matching” in the previous modules. For instance, the IP, TCP and UDP modules group together all the rules that have the same addresses/ports, so that they only have to check each different combination of IP and netmask once. Another optimization consists in testing the destination address/port first, and then, if it matches, the source address/port. This approach is justified by the fact that attacks
come from anywhere (hence no source address is usually specified in real-world rules), while the addresses of the servers in the internal network are well-known. Testing if the packet contains a precise destination address allows discarding a large number of packets immediately, reducing the ones that need to be further processed in order to detect a match.
The **Ethernet** module only checks if the packet contains IPv4 or IPv6, and sends it to the proper module, or just discards it in case the network-layer protocol is not supported. This module does not provide any rule matching functionalities.
The **IPv4/IPv6** modules implement the tests over source and destination network addresses, while the **TCP** and **UDP** modules take care of checking the source and destination TCP/UDP ports of the packet, and the **ICMP** one checks all the possible ICMP options, which involve tests on the ICMP type, code, ID and sequence number.
The **Connection Tracking** and **Connection Status Matching** modules perform stateful TCP connection tracking, distinguishing who initiated the connection, the direction a packet is travelling in (i.e., from server to client or vice-versa) and the state of the connection (i.e., established or still in the handshake phase). This task is performed with the aid of a lookup coprocessor that acts as an associative memory holding information on the current state of active TCP connections. Finally, the **Payload** module handles the non-content payload-related options, such as tests on the payload size.
Connections among the various PEs are organized so that each incoming packet only traverses the subset of PEs dealing with the protocols it contains. This could be easily achieved through a scheme modelled after the TCP/IP protocol stack, as shown in Figure 3. This architecture has many advantages: first, each protocol is analysed only once. Second, the knowledge of a protocol is embedded in a single place, making debugging and improving the handling of a protocol easier. Furthermore, the addition of a new protocol simply requires a new NetPE to be inserted in the chain. Third, the number of traversed NetPEs is small, i.e. packets traverse only NetPEs responsible of protocols that are present in the packet (i.e. an UDP packet will not traverse the NetPE dedicated to TCP), with a clear advantage from the performance viewpoint. Fourth, the architecture is suitable for pipelining. At the moment, the application handles one packet at a time, but potentially it could handle more packets if the NetPEs can be instantiated on different physical execution units (e.g. in case of the Octeon multicore chip).
### B. The code generation process
The traditional approach in intrusion detection applications is usually based on iterating over the rules that are represented in memory as complex data structures. For our IDS we decided to follow a different approach to the problem. In our implementation, rule checks are directly embedded in the code. In particular, instead of producing static programs that iterate over data structures in memory, the code directly implements all the checks needed for matching packets against the rules. Such a choice is based on the consideration that rules data remains constant throughout the execution of the program and such information can be exploited in order to emit checks (i.e. branch instructions) based on constant values (instead of checks based on values loaded from memory) producing more efficient code and opening the way to further optimizations.
### V. PERFORMANCE EVALUATION
In order to assess the validity of our approach we made a series of tests using a real Snort rule database. We used an official ruleset provided by the Snort website in February 2007, which includes a total of 3058 rules, 1389 of them supported by our application. Such an apparent limitation is mainly due to the high number of rules requiring normalization and inspection of the URI field of HTTP headers (i.e. the uricontent option), which is a feature currently not supported by our application. We consider such number a fair one, because it includes all the rules needing deep packet inspection functionalities (i.e. string and regular expression matching), and it is in line with other research works [10][11][12].
Table 1 shows the number of NetIL instructions generated from the abovementioned ruleset for each module of our IDS. It is evident that the Content Matching module is the one with the highest number of instructions. The reason depends on the complexity of the rules involving content matching options.
<table>
<thead>
<tr>
<th>Module</th>
<th>Number of NetIL instructions</th>
<th>Number of x86 instructions</th>
<th>Code size (bytes)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Analyzer</td>
<td>137</td>
<td>163</td>
<td>613</td>
</tr>
<tr>
<td>Content Matching</td>
<td>38872</td>
<td>268,667</td>
<td>1,130,250</td>
</tr>
<tr>
<td>ethernet</td>
<td>10</td>
<td>20</td>
<td>104</td>
</tr>
<tr>
<td>ip</td>
<td>4531</td>
<td>2,057</td>
<td>13,991</td>
</tr>
<tr>
<td>icmp</td>
<td>5547</td>
<td>2,906</td>
<td>16,737</td>
</tr>
<tr>
<td>udp</td>
<td>4806</td>
<td>1,838</td>
<td>13,173</td>
</tr>
<tr>
<td>tcp</td>
<td>5127</td>
<td>2,100</td>
<td>14,442</td>
</tr>
<tr>
<td>Connection Tracking</td>
<td>141</td>
<td>261</td>
<td>1,271</td>
</tr>
<tr>
<td>Conn. Status Matching</td>
<td>6228</td>
<td>2,097</td>
<td>14,054</td>
</tr>
<tr>
<td><strong>Total</strong></td>
<td><strong>65399</strong></td>
<td><strong>280,109</strong></td>
<td><strong>1,204,635</strong></td>
</tr>
</tbody>
</table>
In order to evaluate the performance of our IDS sensor we measured the time needed to process a trace of 10M packets captured on a real network and we compared the results with those obtained running Snort under the same conditions. All the tests were performed on a Dual Xeon running at 3.4 GHz equipped with Linux 2.6.20-15 SMP. The NetVM application was compiled Just in Time into x86 assembly, while Snort was compiled through GCC version 4.1.2. Besides, all the features not supported by our IDS (e.g. flow reassembly) were disabled in Snort. The tests have been repeated 12 times, and results have been averaged excluding the best and the worst run. Results are
shown in Table 2.
<table>
<thead>
<tr>
<th>Application</th>
<th>Packets/Second</th>
</tr>
</thead>
<tbody>
<tr>
<td>NetVM IDS (interpreted)</td>
<td>5.634</td>
</tr>
<tr>
<td>NetVM IDS (with x86 JIT)</td>
<td>70.344</td>
</tr>
<tr>
<td>Snort (native)</td>
<td>97.922</td>
</tr>
</tbody>
</table>
Results look interesting. Performances of the IDS sensor interpreted by the virtual machine are discouraging, but this is expected: a virtual machine is not optimized for performance. Instead, performances obtained with the same code translated into native x86 code look promising, with our implementation running at 70% of the speed of the original Snort, although performance was not yet an objective at this stage. Differences in speed are due to several factors: the IDS code that does not implements all the performance-oriented tricks of Snort, because of the complexity of generating such code in NetIL assembly. In addition, the x86 JIT is still in an early stage and it implements only the most common optimizations, compared to the full set of optimizations implemented in GCC4. Our belief is that a more careful implementation of the JIT could further boost the performance, getting us closer to the original Snort.
VI. CONCLUSIONS
This paper presents the implementation of a network intrusion detection sensor for the NetVM platform. The objective of this work is to demonstrate that the NetVM abstraction is suitable for creating packet-processing applications both in terms of virtualized primitives (e.g. the NetPE abstraction, which enables an excellent modularization of the code) and in terms of performance.
The current status of the IDS sensor is not as mature as the original Snort. For instance, some features (such as the IP defragmenter and TCP flow reassembly) are missing, and some application-layer keywords in the rule language are not supported. However, our objective was not to create a perfect clone of Snort running on the NetVM, while creating a reasonable proof-of-concept application that demonstrates the validity of the NetVM architecture. From this point of view, results are interesting: a complex application can be implemented on the NetVM, and currently it runs at a reasonable speed. The intrinsic modularization offered by NetPEs enables the creation of complex applications, while the NetVM instruction set (and co-processors) is adequate for packet-processing software. The biggest problem encountered in creating the IDS sensor is the lack of a high-level compiler that can be used to write applications. The data-oriented approach followed by our ruleset compiler is partially a choice, but partially a necessity because of the lack of a C-like compiler for the NetVM. This may be interesting to pursue as the next step in order to improve the programmability of our platform.
Future works will include the support for more keywords (which will enable a better coverage of the rule set), a further refinement of the NetVM development tool chain (e.g. in terms of backend compilers) in order to achieve even better performance, and the integration of this code with the NetPDL language [16], which enables the dynamic generation of code for locating protocol fields.
REFERENCES
|
{"Source-Url": "https://iris.polito.it/retrieve/handle/11583/2298001/52154/09ICOIN.pdf", "len_cl100k_base": 5067, "olmocr-version": "0.1.53", "pdf-total-pages": 6, "total-fallback-pages": 0, "total-input-tokens": 17845, "total-output-tokens": 6474, "length": "2e12", "weborganizer": {"__label__adult": 0.0005064010620117188, "__label__art_design": 0.00039577484130859375, "__label__crime_law": 0.0012235641479492188, "__label__education_jobs": 0.0003247261047363281, "__label__entertainment": 0.00011229515075683594, "__label__fashion_beauty": 0.00022995471954345703, "__label__finance_business": 0.00024127960205078125, "__label__food_dining": 0.0003960132598876953, "__label__games": 0.0009140968322753906, "__label__hardware": 0.00722503662109375, "__label__health": 0.0008006095886230469, "__label__history": 0.0003330707550048828, "__label__home_hobbies": 0.0001233816146850586, "__label__industrial": 0.0009794235229492188, "__label__literature": 0.000225067138671875, "__label__politics": 0.0004274845123291016, "__label__religion": 0.0006594657897949219, "__label__science_tech": 0.199462890625, "__label__social_life": 9.930133819580078e-05, "__label__software": 0.0221710205078125, "__label__software_dev": 0.76171875, "__label__sports_fitness": 0.0004019737243652344, "__label__transportation": 0.0007815361022949219, "__label__travel": 0.00022220611572265625}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 28469, 0.03196]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 28469, 0.41863]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 28469, 0.89466]], "google_gemma-3-12b-it_contains_pii": [[0, 643, false], [643, 5543, null], [5543, 10193, null], [10193, 15357, null], [15357, 21926, null], [21926, 28469, null]], "google_gemma-3-12b-it_is_public_document": [[0, 643, true], [643, 5543, null], [5543, 10193, null], [10193, 15357, null], [15357, 21926, null], [21926, 28469, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 28469, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 28469, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 28469, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 28469, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 28469, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 28469, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 28469, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 28469, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 28469, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 28469, null]], "pdf_page_numbers": [[0, 643, 1], [643, 5543, 2], [5543, 10193, 3], [10193, 15357, 4], [15357, 21926, 5], [21926, 28469, 6]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 28469, 0.15888]]}
|
olmocr_science_pdfs
|
2024-12-06
|
2024-12-06
|
343b3827a56c790279a20f4a167f0b53e88b4362
|
Patterns-Oriented Design Applied to Cross-Platform Web-based Interactive Systems
M. Taleb
Human-Centred Software Engineering, Group Concordia University, Montreal, Quebec, Canada
Telephone: +1 514 848 2424 ext 3024 mtaleb@encs.concordia.ca
A. Seffah
Human-Centred Software Engineering Group Concordia University Montreal, Quebec, Canada
Telephone: +1 514 848 2424 ext.3024 seffah@cse.concordia.ca
A. Abran
Software Engineering Department & Information Technology, École de Technologie Supérieure (ÉTS),
Montreal, Quebec, Canada
Telephone: +1 514 396 8800 ext. 8632 aabran@ele.etsmtl.ca
Abstract
Design pattern suggests that developers must be able to reuse proven solutions emerging from the best design practices to solve common design problems while composing patterns to create reusable designs that can be mapped to different platforms. Without this, cross-platform Web applications designers are not properly applying design solutions or take full benefit of the power of patterns as reuse blocks, resulting in poor performance, poor scalability, and poor usability. Furthermore, the designer may “reinvent the wheel” when attempting to implement the same design for different platform. In this paper, we first introduce different types of Web design patterns as a vehicle for capturing and reusing good designs while detailing a motivating exemplar on how Web design patterns can be composed to create a generic Web application design. Then, we discuss why patterns are a suitable means for mapping a Web design to new platforms while maintaining its intrinsic quality attributes.
Keywords
Design Patterns, Patterns-Oriented Design, Web Applications, Mapping, Patterns Composition
1. Introduction
In recent years, the Web has matured from offering just simple functionality like displaying static pages to being able to cater to intricate processes such as end-to-end financial transactions. The user has been given also more sophisticated techniques to interact with the information. Furthermore, the convergence of the Internet, mobile telephony, and personal digital assistants (PDAs) technologies has led to the emergence of a new generation of Web applications. One of the major characteristics of such applications is that they allow a user to interact with the server-side services and contents in a different of ways. Different kinds of computers and devices (including, but not limited to traditional office desktop, laptops, palmtop, PDA with and without keyboards, mobile telephone, interactive television are used for interacting with such applications.
In this technological context, we are moving away from a print paradigm of a mere “brochureware” to Web sites as highly interactive information systems. Such kind of applications includes also mobile telephone embedded Internet applications (read e-mail, browse mobile portal sites, etc.). These resource constrained Web applications for small and mobile devices cannot support the full range of Web applications features because of the lack of screen space or low bandwidth.
This mosaic of Web applications has lead to the emergence of Web engineering as a sub-discipline of software engineering for creating high-quality Web interactive systems. One of the fundamental questions addressed by Web engineering is how can we develop and deploy the same application for different platform available today without architecturing and writing specific for each platform, learning different languages and the hundreds of Web design guidelines that are available for each platform.
Here, we are borrowing, adapting and refining the so popular and powerful patterns-assisted development to
cross-platform Web applications. The following are some of cross-platform Web engineering challenges that we are addressing specifically while adapting the pattern-oriented design approach.
Firstly, the POD should help in decoupling the different aspects of Web application architecture and isolate platform specifics from remaining concerns. The vast majority of current industry Web applications have adopted a layered architecture. As with other multi-tiered schemes such as client-server architecture, a common information repository is at the core of the multi-layers architecture. The services should be accessed strictly through the an adaptable presentation layer, which provides decoupling of the data from the device specific interfaces. In this way, device application developers need only worry about the standardized middleware interface rather than having to concern themselves with the multitude of toolkits put forth by database repository manufacturers. Segmenting the architecture and reducing coupling to stringent specifications allows designer to quickly understand how changes made to a particular component affect the remaining system. That is because achieving these goals requires a consistent approach to applying both cognitive and social factors to user interface design, and that would require independent developers to coordinate their activities. Unfortunately, conspiring at this level may be beyond the abilities of the industry.
Secondly, the diversity of platforms exhibits drastically different capabilities that designers need to take into account. For example, PDAs use a pen based input mechanism and have average screen sizes in the range of 3 inches. On the other hand, the typical PC uses a full size keyboard, a mouse and has an average screen size of 17 inches. Coping with such drastic variations implies much more than mere layout changes at the presentation level. Pen based input mechanism are slower than traditional keyboard and thus are inappropriate for applications such as word processing that require intensive user input. Similarly, the small screens available on many PDAs only provide coarse graphic capabilities and thus would be ill suited for photo editing applications.
Finally, many system manufacturers and researchers have issued design guidelines to capture and reuse the best Web design practices [1]. Recently, Palm Inc. has put forth design guidelines to address navigation issues, widget selection, and use of specialized input mechanisms such as handwriting recognition. Microsoft, IBM and Sun Microsystems have also published their own guidelines to assist developers with programming applications targeted at the Pocket PC/Windows CE platform. However, these guidelines are different from one platform or device to another. When designing a multi-devices Web application, this can be a source of many inconsistencies. The Java “look-and-feel” developed by Sun has been introduced as a set of cross-platform guidelines. However, cross-platform guidelines do not take into account the particularities of a specific device, in particular the platform constraints and capabilities. This can be a source of problems for a user using different kinds of devices to interact with the server side services and information of a Web application. Furthermore, for a novice designer or a software engineer who is not familiar with this mosaic of guidelines, it is hard to remember all design guidelines, let alone using them effectively.
In this paper, we introduced pattern-oriented design as a method to overcome such challenges. The proposed approach consists: (1) to compose different architectural, navigational and interaction patterns to create a high level and reusable designs, (2) to adapt this composing design to a particular platform using the mapping, i.e., make a transformation of this multiplatform architecture to obtain one specific and particular platform. To understand this point, refer to the section 5, which illustrates it with example. A sub-objective of our research is to define a systematic methodology, supported by a Web CASE tool, to compose and map a design using multi-layer pattern-oriented design architecture.
2. Background work
Introduced by the architect Christopher Alexander in 1977 [14], design pattern can viewed as a building block that we compose to create a design. A single pattern describes a problem, which appears constantly in our environment, and thus described the hart of the solution to this problem, in a way such as one can reuse this solution for different platform, without ever doing it twice in same manner [14]. For Web cross-platform application, patterns are interesting for three reasons; see also [15] for a more general discussion on patterns benefits:
- They come from experiments on good know-how and were not created artificially;
- They are a means of documenting architectures (out of building or software);
- They make it possible in the case of a cross-platform development in team to have a common vision.
Similar to the entire Software Engineering community, the HCI/UCD community has been a forum for vigorous discussion on pattern languages for user interface design and usability engineering. The goals of HCI patterns is to share successful user interface design solutions among HCI professionals, and to provide a common ground for anyone involved in the design, development, usability testing, or the use of interactive systems. Several HCI practitioners and interactive application designers have become interested in formulating HCI patterns (pattern languages). A number of pattern languages for interaction design have been suggested. For example, Van Duyne’s "The Design of
Sites” [10], Welie’s Interaction Design Patterns [5], and Tidwell’s UI Patterns [3] and Techniques play an important role. In addition, specific languages such as Laakso’s User Interface Design Patterns and the UPADE Web Language have been proposed as well.
The idea of using patterns for Web engineering is not new. Different pattern collections have been published including patterns for Web pages layout design [3, 4, 5], for navigation in a large information architecture as well as for visualizing and presenting information. In our work, we investigate Web Patterns and Patterns Oriented Design (POD) as a solution for cross-platform application and in particular, to solve the following design challenges.
Pattern-Oriented Design introduces a methodology for "composing" proven design patterns into reliable, robust large-scale software systems. However, the development of web applications using design patterns as design components requires a careful look at composition techniques. Several methods have been proposed for composition. For example, Yacoub and Ammar [12] proposed two composition techniques:
- **Behavioural composition techniques** that are based on object interaction specifications to show how instantiations of patterns can be composed
- **Structural composition techniques** which are based on the static architectural specifications of composed instantiated patterns using class diagrams
The pattern-supported approach (PSA) to the user interface design process suggests a wider scope for the use of patterns by looking at the overall design process. Based on the fact that the usability of a system emerges as the product of the user, the task and the context of use, PSA integrates this knowledge in most of its patterns, dividing the forces in the pattern description correspondingly (i.e., describing Task, User, and Context forces). PSA provides a double-linked chain of patterns (parts of an emerging pattern language) that support each step of the design process [16]. Building on PSA, the proposed approach highlighted another important aspect of pattern-oriented design: **pattern combination**. By combining different patterns, developers can utilize pattern relationships and combine them in order to produce an effective design solution. We will consider this principle in section 4. As a result, patterns become a more effective vehicle that supports design reuse.
### 3. The proposed web design patterns taxonomy
We propose at least six types of design patterns that can be used in Web-based applications engineering. Together these patterns provide an integrative solution to address the multi-faces of Web design:
1. **Information Architecture Design Patterns.** This category of patterns describes different conceptual models and architectures for organizing the underlying content across multiple pages, servers and computers. Such patterns provide solutions to questions such which information can be or should be presented on which device?
2. **User Interface and Page Layout Design Patterns.** These patterns provide solutions for how the contents or the related services are visually organized into working surfaces, the effective layout of multiple information spaces and the relationship between them. These patterns define the physical and logical layout suitable for specific Web pages such as home page, lists, tables, and forms.
3. **Navigation Design Patterns.** These patterns implement proven techniques for navigating within and/or between a set of pages and chunks of information.
4. **Interaction Design Patterns** focus on the interaction mechanisms that can be used to achieve tasks and the visual effects they have on the scene, as such they relate primarily to graphical and rendering transforms.
5. **Information Visualization Design Patterns.** These patterns suggest different visual representations and metaphors for grouping and displaying information in cognitively accessible chunks. They mainly define the form and content of the visualization i.e. the graphical scene, and as such relate primarily to data and mapping transforms.
6. **Interoperability and System Design Patterns.** These patterns aim to decouple the different layers of a Web application in particular between the content, the dialog and the views or presentations layers. These patterns are generally extensions of the Gamma design patterns such as MVC (Model, View and Controller) observer, command actions patterns.
In what follows, we have introduced some concrete examples of this mosaic of patterns that we have been using. These examples have shown also the need to combine several types of patterns to provide solutions to complex problems. The list of patterns is not exhaustive. There is no doubt that more patterns are still to be discovered, and that an endless number have yet to be invented.
The simplest pattern to organize the content of a Web application is in the sequence pattern that organizes a set of interrelated pages in a linear narrative. This pattern applies to information that naturally flows as a narrative, time line, or in a logical sequential order. Hierarchical organization schemes are particularly well suited to Web applications content, because Web sites should always be organized as offshoots of a single Home Page [1]. Many procedural manuals, lists of university courses, or medical
case descriptions are best organized the grid patterns. Several patterns need to be combined to organize the content of a complex Web application.
Navigation Patterns are fundamental in Web design in the sense that they help the user to recognize the document's allocation and navigate between chunks of information and pages easily and clearly. They can obviously reduce the user's memory load [7, 1]. See also [3, 5, 8, 9] for an exhaustive list of navigation design patterns. The following are some of the basic patterns: Shortcuts pattern, Dynamic Path Pattern or Bread Crumb, and Index Browsing pattern.
A critical design issue in particular for resource constrained (small) devices is how long does it take to determine if a document has relevant information? The index browsing patterns – A typical navigation design pattern, with the complicity of Executive Summary pattern, a page layout pattern, provide users a preview of underlying information before spending time downloading, browsing and reading large amounts of information.
Information overload is another of the fundamentals Web engineering problems. Web applications, especially large Web portals, provide access to millions of documents. The designer must consider how best to map the contents into a graphical representation that conveys information to the user while facilitating the exploration of a large Website content. In addition, the designer must provide dynamic actions that limit the amount of information the user receives while at the same time keeping the user informed about the content as a whole.
The following are some of the information visualization patterns for displaying such solving this complex design problem: collections Favourites, Bookmark, Frequently Visited Page, Preferences and Navigable Spaces Map patterns. These patterns need to be composed to provide a comprehensive map to a large amount of content that can be too much to be reasonably presented in a single view. The underlying content can be organized, using the combination of patterns, into distinct conceptual spaces or working surfaces, which are semantically linked to each other.
Communication and interoperability design patterns are fundamental patterns to facilitate the mapping of design between platforms. Example of patterns that can be considered to ensure the interoperability of Web applications include Adapter, Bridge, Builder, Decorator, Facade, Factory Method, Mediator, Memento, Prototype, Proxy, Singleton, State, Strategy, Visitor [2].
4. Pattern composition rules
A creation of a platform independent pattern oriented design exploits several relationships between patterns. Based on previous work [13], we identify four types of relationships.
1. Similar is a relationship, which applies to the same category of patterns.
2. Competitor is a relationship that applies to two patterns of the same patterns category.
3. Super-ordinate is the basic relationship to compose several patterns of different categories.
4. Subordinate. If pattern X is super-ordinate of Y and Z then Y and Z are sub-ordinate of X. This relationship is important in the mapping process of pattern-oriented design from a platform to another one.
5. An illustrative example
To illustrate the use of the relationships described in the previous section, we discuss here the redesign of the home of one of the most popular Web site for bio-informaticians, the National Center for Bioinformatics Information http://www.ncbi.nlm.nih.gov/. This extra large Web site provides information and offers a large set of very powerful, yet difficult to use, services for biologists. The home page is its facade to the world and the starting point for most user visits. Improving the home page multiplies the entire Web site's usability and increase the accessibility and visibility to the 10,000 pages included in this site.
Based on an empirical study we conducted [8] and recommendations from others [9, 10], a usable and easy to maintain home page for this large Web site can be developed by combining the following patterns [8]:
Tagline Pattern, Web Convenient Toolbar Pattern, Frequently- or Most Visited Pages Pattern, Site Map Pattern, About Pattern, Executive Summary Pattern, Index Browsing Pattern, Disclaimer Pattern, Maintainer Info Pattern, Go Back To Safe Place Pattern.
6. Pattern-Oriented Design Mapping
Using a pattern-oriented design as a starting point, it is possible to redesign a Web application for other platforms, by using what we call pattern mapping. The original set patterns used in the Web application are transformed or replaced in order to redesign and re-implement the application and in particular the user interface for mobile or PDA applications. Since patterns hold information about design solutions and context of use, platform capabilities and constraints are implicitly addressed in the transformed patterns.
The different mappings of the Quick Access pattern for three different platforms. This navigation design pattern helps the user reach specific pages, which reflect important website content, from any location on the site. For a news Web application, it can provide direct and quick access to central pages such as Top Stories, News, Sports, and Business. For a web browser on a desktop, it is implemented as an index browsing toolbar. For a PDA,
the Quick Access pattern can be implemented as a combo box. For a mobile phone, the Quick Access pattern is implemented as a selection [5]. Pattern descriptions should provide advice to pattern users for selecting the most suitable implementation for a given platform.
To illustrate the mapping-based design approach, in what follows, we describe the effect of screen size on the usage and selection of pattern. Different platforms use different screen sizes, and these different screen sizes afford different types and variants of patterns. The question when mapping a POD is how the change in screen size between two platforms affects redesign at the pattern level. The amount of information that can be displayed on a given platform screen is determined by a combination of area and number of pixels.
The choice of mapping strategy will depend on the size of the larger architecture and the value information.
Finally, we can consider mapping of patterns and graphical user objects in the context of the amount of change that must be applied to the desktop design or architecture to fit it into a PDA format. The list is ordered from the most direct to the least mapping rules:
1. **Identical**. No changes.
2. **Scalable** changes to the size of the original design or to the number of items in the original design.
3. **Multiple** of the original design, either simultaneously or sequentially in time.
4. **Fundamental** change to the nature of the original design pattern while replacing it generally by another one.
This taxonomy of mapping types is especially relevant to the automation of cross-platform design using patterns since the designs that are easiest to transform are those that require the least transformation. The taxonomy therefore identifies where human intervention will be needed for design decisions in the transformation process. In addition, when building a desktop design for which a PDA version is also planned, the taxonomy indicates which patterns to use in the desktop design to allow easy transformation to the PDA design.
Some of the navigation design patterns as used in the home page of a desktop-based Web application. Once these patterns are identified in the desktop-based Web application, they can be transformed or replaced by others in a PDA version.
The redesigned interface of the CBC (Canadian Brodcasting Corporation) site for migrating to a PDA platform. The permanent horizontal menus pattern at the top (P5) in the original desktop UI were replaced to a shorter horizontal menu pattern (P5s). In order to accommodate this change on the small PDA screen, the three different horizontal menus had to be shortened, and only important navigation items were used. The keyword search pattern (P13) remains as a keyword search. The permanent vertical menu at the left (P6) is redesigned to a drop-down menu (P15). The drop-down menu in the PDA design also includes the menu headings, “What's on today?” and “Online features” from the temporary vertical menu (P3) in the original desktop design. Finally, the information portal (P4), which is the first thing that captures the user’s attention, is redesigned to a smaller information portal (P4s).
### 7. Discussion
The types of cross-platform mapping that are recommended for some the most popular Web patterns and which can be used to redesign of a Web site for PDA. These transformations offer the closest and simplest equivalent in the corresponding platform. The method helps designers in design choices associated with (1) the size of the source architecture and target architecture and (2) the amount of information to maintain in migrating from the source platform to the target platform.
In this paper, we have introduced a pattern-oriented design method that essentially exploits pattern composition mapping. This approach is a significant improvement over non-structured migration methods currently in use, for the following reasons:
- The method provides a standardized table of pattern mapping, thereby reducing the redesign effort and ensuring consistency in redesign.
- The standardized rules for composition and mapping formalize best practices in design, thereby ensuring optimal quality of the migrated user interface.
- The method helps designers in design choices by novice designers, as compared to reengineering which currently requires a considerable degree of expertise and abstract reasoning ability.
Pattern-assisted design offers the very useful ability of easily extracting multiple platform-specific designs from a single generic (platform-independent) UI model. However, the current state of the art in patterns and cross-platform research is not yet mature enough to handle all the requirements of pattern-assisted design. Before generic UI pattern-based models can be defined, more research must be addressed to define the multiple levels of abstraction of patterns and to create a clear, well-structured taxonomy of patterns. The simplified taxonomy presented in section 3 is a starting point. Thus, within a pattern-based framework, the simplified “redesign and design” method proposed here is currently the most practical approach for migration of Web application between platforms.
8. A concluding remark
In this paper, we proposed and illustrated the POD approach, which aims to create a design for cross-platform application. Our discussion focused on the way to combine several types of patterns to create a reusable pattern-oriented design as well as mapping rules to translate this generic design into platforms-dependant Web applications. The proposed pattern taxonomy and the supporting composition and mapping rules aims to demonstrate when a pattern is applicable or required during the design process, how it can be reused, as well as how and why it can or cannot be combined with other related patterns and how it can be mapped. Using POD and the proposed taxonomy of patterns, cross-platform Web applications developers are provided with an effective tool: composition and mapping relationships and the underlying best practices to come up with reusable design solutions.
Our investigations are based on several years of Web applications development, validation and ethnographic interviews with Web developers, as well as suggestions from others. Such suggestions include reported best practices for using patterns as a bridge over the gaps between the design practices and software tools [11, 7]. Our experiences highlighted also that in order to render the patterns understandable by novice designers and software engineers who are unfamiliar with Web engineering, patterns should be presented to developers using a flexible structure to represent patterns, to make it easy for both the pattern authors, reviewers and users.
One of the major problems we found is that mastering and applying several types of patterns and a large collection of patterns require in-depth knowledge of both the problems and forces at play and most importantly must ultimately put forth battle-tested solutions. As such, it is inconceivable that pattern hierarchies will evolve strictly from theoretical considerations. Practical research and industry feedback are crucial in determining how successful a pattern-oriented design framework is at solving real-world problems. It is therefore essential to build an “academia-industry bridge” by establishing formal communication channels between industrial specialists in patterns, software design patterns, information architecture patterns as well as software pattern researchers. Such collaboration will lead, at to a common terminology which essential making the large diversity of patterns accessible to common Web engineering designers.
9. References
|
{"Source-Url": "http://www.researchgate.net/profile/Alain_Abran/publication/220713116_Patterns-Oriented_Design_Applied_to_Cross-Platform_Web-based_Interactive_Systems/links/0fcfd511c9285a60df000000.pdf", "len_cl100k_base": 5127, "olmocr-version": "0.1.53", "pdf-total-pages": 6, "total-fallback-pages": 0, "total-input-tokens": 18295, "total-output-tokens": 6225, "length": "2e12", "weborganizer": {"__label__adult": 0.0004584789276123047, "__label__art_design": 0.002788543701171875, "__label__crime_law": 0.00030517578125, "__label__education_jobs": 0.0011463165283203125, "__label__entertainment": 9.09566879272461e-05, "__label__fashion_beauty": 0.0002137422561645508, "__label__finance_business": 0.00019812583923339844, "__label__food_dining": 0.0003228187561035156, "__label__games": 0.00048279762268066406, "__label__hardware": 0.0007839202880859375, "__label__health": 0.0003848075866699219, "__label__history": 0.00032210350036621094, "__label__home_hobbies": 7.75456428527832e-05, "__label__industrial": 0.00032806396484375, "__label__literature": 0.00037026405334472656, "__label__politics": 0.00021588802337646484, "__label__religion": 0.0004940032958984375, "__label__science_tech": 0.00975799560546875, "__label__social_life": 6.836652755737305e-05, "__label__software": 0.0064239501953125, "__label__software_dev": 0.9736328125, "__label__sports_fitness": 0.0002541542053222656, "__label__transportation": 0.00043845176696777344, "__label__travel": 0.0002123117446899414}, "weborganizer_max": "__label__software_dev", "avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_v1__avg_fraction_numbers_in_line_ratio": [[0, 30244, 0.02309]], "fineweb_edu_fasttext_gt2__fineweb_edu_fasttext_gt2__score": [[0, 30244, 0.48589]], "ft_lang_id_en_doc_v2__ft_lang_id_en_doc_v2__en": [[0, 30244, 0.91012]], "google_gemma-3-12b-it_contains_pii": [[0, 3665, false], [3665, 9394, null], [9394, 14777, null], [14777, 20130, null], [20130, 25353, null], [25353, 30244, null]], "google_gemma-3-12b-it_is_public_document": [[0, 3665, true], [3665, 9394, null], [9394, 14777, null], [14777, 20130, null], [20130, 25353, null], [25353, 30244, null]], "google_gemma-3-4b-it_v2tag__is_academic_paper": [[0, 5000, true], [5000, 30244, null]], "google_gemma-3-4b-it_v2tag__is_class_syllabus": [[0, 5000, false], [5000, 30244, null]], "google_gemma-3-4b-it_v2tag__is_completion_certificate": [[0, 5000, false], [5000, 30244, null]], "google_gemma-3-4b-it_v2tag__is_court_notice": [[0, 5000, false], [5000, 30244, null]], "google_gemma-3-4b-it_v2tag__is_homework_assignment": [[0, 5000, false], [5000, 30244, null]], "google_gemma-3-4b-it_v2tag__is_news_article": [[0, 5000, false], [5000, 30244, null]], "google_gemma-3-4b-it_v2tag__is_public_order": [[0, 5000, false], [5000, 30244, null]], "google_gemma-3-4b-it_v2tag__is_resume_cv": [[0, 5000, false], [5000, 30244, null]], "google_gemma-3-4b-it_v2tag__is_test_or_quiz": [[0, 5000, false], [5000, 30244, null]], "google_gemma-3-4b-it_v2tag__is_textbook": [[0, 5000, false], [5000, 30244, null]], "pdf_page_numbers": [[0, 3665, 1], [3665, 9394, 2], [9394, 14777, 3], [14777, 20130, 4], [20130, 25353, 5], [25353, 30244, 6]], "pipe_delimited_lines_v1__pipe_delimited_lines_v1__pipe_delimited_lines_ratio": [[0, 30244, 0.0]]}
|
olmocr_science_pdfs
|
2024-12-05
|
2024-12-05
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.