Modify the design of the object-z specification

Assignment Help Software Engineering
Reference no: EM13725419

Text Box: 1The purpose of this assignment is to give you experience developing an Object-Z specification towards an implementation using refinement and refactoring. The case study is a document search engine. The search engine allows a user to load a number of text documents, and then perform searches for words contained in those documents.

The search engine has two modes of operation: it either searches for documents which contain all words in the query, or some (i.e., one or more) words in the query. It has three operations as follows.

LoadDoc loads a document into the search engine (the document will be an input) ToggleMode toggles the mode of the document between 'all words' and 'some words'

Query finds the previously loaded documents which satisfy a query (the input will be a sequence of words denoting the query, and the output a mapping from words in the query to document records - see below).

A document record consists of two components: the name of a document, and a number denoting the number of occurrences of a particular word in that document. The document records associated with a word w in the output of Query are such that: (i) the document name is the name of a document d containing w, and (ii) the number is the number of occurrences of w in d.

The output of Query is meant to be sent to a user interface class responsible for sorting and presenting the information to the search engine user. This user interface class is outside the system we are concerned with in this assignment.

Task 1

Your first task is to specify the search engine as a single Object-Z class SearchEngine. You will need to choose appropriate types for words, documents and document records.

Task 2

Your second task is to modify the design of the Object-Z specification from Task 1 as follows.

1. To ensure the search engine operates efficiently, documents will be searched for the words they contain when first loaded rather than on each query. When a document is loaded, the search engine will store the required information about the document in a word table. The word table maps a given word to a set of document records. Each document record in the set will correspond to a document which contains the word, and the number of times the word occurs in that document.

A new class WordTable will be added to the specification. This class is not responsible for dealing with adjusting the output according to the mode. That responsibility should remain with the SearchEngine class.

2. Assume the following class Comparable is also part of the specification.

A subclass of Comparable called DocRecordl will be added to the specification for repre­senting document records. The class should capture the same information as a document record and additionally have a Compare To operation which (like the compareTo method of the class Comparable in Java) outputs a negative number whenever the input (an instance of DocRecordl) has a larger number, a positive value when the input has a smaller number, and zero when it has the same number.

3. Finally, modify the specifications of SearchEngine and WordTable to use DocRecordl in place of your document record type.

Each modification of the specification will require one or more refactoring and/or refinement steps. You do not need to prove the refinement steps, but for each you should (i) state the proof obligations, (ii) specify any schemes needed by them, e.g., the schema R representing the retrieve relation for a data refinement, and (iii) provide a short informal (English) justification for why the refinement holds.

Each class and schema in your assignment should be preceded by explanatory text. This text should not simply paraphrase the formal text, but explain it in the context of the specification development. Further text may follow a class or schema where necessary, e.g., to help clarify complicated predicates.

Reference no: EM13725419

Questions Cloud

Case to be analyazed in strategic management : Make powerpoint slides for a case to be analyazed in strategic management
Unique issues of multiracial group members : Question 1: List the unique issues of multiracial group members.
Presentation on supplement to the completed marketing plan : The paper for the product is below power point needs ref please. the power point should have these bullets in it. Prepare a 15- to 20-slide Microsoft PowerPoint presentation as a supplement to the completed marketing plan that illustrates it's most..
Die machines to produce equipment for other firms : Tool Makers, Inc. uses tool and die machines to produce equipment for other firms. The initial cost of one customized tool and die machine is $850,000. This machine costs $10,000 a year to operate. Each machine has a life of 3 years before it is repl..
Modify the design of the object-z specification : Specify the search engine as a single Object-Z class SearchEngine. You will need to choose appropriate types for words, documents and document records.
Why are capital gains excluded from this model : A stock’s intrinsic value can be estimated by discounting expected dividends (or cash flows) to the present using the investor’s require rate of return. Why are capital gains excluded from this model? Does the exclusion of capital gains limit its val..
What is the equivalent annual cost of this machine : Tool Makers, Inc. uses tool and die machines to produce equipment for other firms. The initial cost of one customized tool and die machine is $850,000. This machine costs $10,000 a year to operate. Each machine has a life of 3 years before it is repl..
Describe the business opportunity decision processes : Describe the business opportunity decision processes, as explored through the "roots of opportunity" (Mariotti & Glacken, 2013). Articulate which decision process you used to devise your product or service. Describe your process compellingly, and w..
Write a reaserch paper on business government and society : Write a reaserch paper on Business Government and Society/PrincessMary

Reviews

Write a Review

Software Engineering Questions & Answers

  Would prototyping have helped the primis team

What kinds of questions might McGraw-Hill have asked as part of determining the feasibility of the Primis idea? Be sure to address the needs of the organization, end users (sales reps., faculty, students), IT specialists, and the groups involved i..

  A project manger needs to understand the importance of the

capital goodsa project manger needs to understand the importance of the acquisition of capital goods. there are many

  Write a program to simulate the scheduling of cpu

In this project, write a program to simulate the scheduling of CPU. The program will randomly generate process CPU burst based on user's setting. Performance is measured and analyzed in a report.

  Re usability in object oriented languages

Re-usability is ability to use code written for another condition. Most languages and programming paradigms support re-usability in some form.

  1 explain three forces leading companies to pursue

1. explain three forces leading companies to pursue international operations.2. explain the concept of protectionism.

  Systems analysis and design requirements

Systems Analysis and Design requirements

  Draw flowchart to compute the sum of series

Draw a flowchart to calculate the sum of 3+6+9+....+36. Then code the problem using C++programming language. Draw a flowchart to print 3,6,9,....36 Then code the logic using C++ programming language

  Research the following financial off balance sheet

research the following financial off balance sheet instrumentsaforeign currency forwards exchange contract binterest

  Nbspa full revolution press has 100 rpm flywheel rotation

nbspa full revolution press has 100 rpm flywheel rotation. the press is equipped with tow hand trip devices mounted on

  Question 1 why do performance appraisal systems fail nbspm

question 1 why do performance appraisal systems fail? nbspm instructions1- strong disagree2.-disagree3. neutral4.

  Case study building an access control systemas a member of

case study building an access control systemas a member of the information security team at a small college you have

  Make changes to the format class

Be sure to notice that the supplied program already handles compound statements, which are delimited by braces, so the code that you add should not treat compound statements as a special case.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd