Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the find ( ) method and two possible specifications for it that we reviewed in class: int find ( int [ ] a ,

Consider the find() method and two possible specifications for it that we reviewed in class:
int find(int[] a, int value);
Specification 1:
requires: a is non-null and value occurs in a
modifies: none
effects: none
returns: i such that a[i]= value
Specification 2:
requires: a is non-null
modifies: none
effects: none
returns: i such that a[i]= value if value occurs in a and i =-1 if value is not in a
Part (a). Using just the formula P B -> P A QA -> QB (where A and B refer to two specifications) alone, which of the
two given specifications (Specification 1 or Specification 2) is stronger, if any? Give a clear answer and briefly justify it.
Part (b). If you apply a formula different from the one in part (a) or if you use the definition of comparing specifications
by strength, would your conclusion how Specification 1 strength compares to Specification 2 strength be different? Why
or why not?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Multidimensional Array Data Management In Databases

Authors: Florin Rusu

1st Edition

1638281483, 978-1638281481

More Books

Students also viewed these Databases questions

Question

6.4 .585 D

Answered: 1 week ago

Question

What is the IP address for the Laptop?

Answered: 1 week ago