Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Software Engineering Expert

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.

Software Engineering, Computer Science

  • Category:- Software Engineering
  • Reference No.:- M91264798

Have any Question?


Related Questions in Software Engineering

The research paper for this course is about some of the

The research paper for this course is about some of the best sources of digital evidence for child abuse and exploitation, domestic violence, and gambling according to the National Institute of Justice. Research commerci ...

Reply to this article with apa referencehate crimes

Reply to this article with APA reference. Hate crimes According to Merriam-Webster, hate crime is any of various crimes (such as assault or defacement of property) when motivated by hostility to the victim as a member of ...

Proposaldesign of an efficient gps tracking system tag for

Proposal Design of an efficient GPS Tracking System (tag) for monitoring small species IMPLEMENTING EMBEDDED SYSTEMS USING SYSML Task Using PapyrusSysML Software (Downloadable online - Evaluation Copy- Latest Version) Mo ...

Write review on this article with apa formatalthough

Write review on this article with APA format. Although computer crimes are being seen in our society more and more each day, it is still difficult to prosecute people who commit these crimes mainly because everything is ...

Write reply to this article with references with apa

Write reply to this article with references with APA bibliography. Hate Crimes Over the past couple of years, hate crimes have been on the rise in America's largest cities. Studies show that there were sharp spikes in th ...

Write review on this article with apa formatgovernment

Write review on this article with APA format. Government surveillance is a major issue in the United States and globally. Surveillance refers to any collection and processing of personal data, whether, identifiable or no ...

Research projectin the course we have covered various

RESEARCH PROJECT In the course, we have covered various security and privacy issues that arise in the cyberspace field. We have learned to identify these risks and have discussed the current approaches and developments f ...

Address the following integrating biblical perspectives

Address the following, integrating biblical perspectives where appropriate: Define a hate crime and describe how white supremacist groups use the Internet to spread their message of hate. Explain why hate crime legislati ...

Instructions - onion routingin this assignment you will

INSTRUCTIONS - ONION ROUTING In this assignment, you will answer the following questions related to Onion Routing and Tor. 1. Describe the infrastructure of Onion Routing and explain how it works for providing anonymity ...

In this assignment you will answer the following review

In this assignment, you will answer the following review questions from the reading materials of the module/week. 1. "What are the key components of a typical P2P application? Describe their functions." 2. "What are the ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As