Answered step by step
Verified Expert Solution
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 findint a int value;
Specification :
requires: a is nonnull and value occurs in a
modifies: none
effects: none
returns: i such that ai value
Specification :
requires: a is nonnull
modifies: none
effects: none
returns: i such that ai value if value occurs in a and i 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 or Specification 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 strength compares to Specification strength be different? Why
or why not?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started