All homeworks are due before class on the due date. All homework assignments must reflect your own understanding of the topic and be communicated in your own words. You may use one of the collaborative options. You may also request help and advice from your classmates on Piazza. Any help not allowed by that policy will be an honor violation.
Purpose: To encourage students to start working on the homework assignments early and recognize students who are actively engaged in the content
You will receiveNote: The final submission timestamp shown on Gradescope will be used.
p = (a ∧ b) -> (!c ∧ d)
Compute the determinations (i.e., the conditions under which each clause determines predicate p). You may use a mathematical approach or a tabular approach.
Use the following table. Fill out columns for the predicate (P) and the determinations (Pa, Pb, Pc, and Pd) columns.
Write T for true. Leave the column blank for F (false).
No steps need to be shown – only the results filled in the columns are graded.
| row# | a | b | c | d | P | Pa | Pb | Pc | Pd |
| 1 | T | T | T | T | |||||
| 2 | T | T | T | ||||||
| 3 | T | T | T | ||||||
| 4 | T | T | |||||||
| 5 | T | T | T | ||||||
| 6 | T | T | |||||||
| 7 | T | T | |||||||
| 8 | T | ||||||||
| 9 | T | T | T | ||||||
| 10 | T | T | |||||||
| 11 | T | T | |||||||
| 12 | T | ||||||||
| 13 | T | T | |||||||
| 14 | T | ||||||||
| 15 | T | ||||||||
| 16 |
Line 1: public String multiplePred(int x, int y)
Line 2: {
Line 3: int z;
Line 4: if (x < y)
Line 5: z = y – x;
Line 6: else
Line 7: z = x – y;
Line 8:
Line 9: if ( (z%2 == 0 || x*y == 12) && (x > 0) )
Line 10: return "A";
Line 11: else
Line 12: return "B";
Line 13: }
The given tests (t1 - t7):
t1: x = 0, y = 0 t2: x = 2, y = 0 t3: x = 2, y = 2 t4: x = 4, y = 3 t5: x = 3, y = 2 t6: x = -6, y = -2 t7: x = -5, y = -6
[optional] You may start by filling out the following table. This table will not be graded but it may be helpful when you answer the questions below.
| test# | x | y | multiplePred(x,y) | x < y | z%2 == 0 | x*y == 12 | x > 0 |
| t1 | 0 | 0 | |||||
| t2 | 2 | 0 | |||||
| t3 | 2 | 2 | |||||
| t4 | 4 | 3 | |||||
| t5 | 3 | 2 | |||||
| t6 | -6 | -2 | |||||
| t7 | -5 | -6 |
You must use tests from the list of eight tests (t1, t2, …, t7) given above, for credit.
Show your analysis and thought process.
Line 1: public String multiplePred(int x, int y)
Line 2: {
Line 3: int z;
Line 4: if (x < y)
Line 5: z = y – x;
Line 6: else
Line 7: z = x – y;
Line 8:
Line 9: if (z%2 == 0 && x > 0)
Line 10: return "A";
Line 11:
Line 12: if (x*y == 12 && x > 0)
Line 13: return "A";
Line 14:
Line 15: return "B";
Line 16: }
Identify a minimal set of tests for the refactored version of multiplePred() that achieves Restricted Active Clause Coverage (RACC).
You must use tests from the list of eight tests (t1, t2, …, t7) given above, for credit.
Show your analysis and thought process.
[Total: 20 points] Complete the tasks. Provide correct and clear solutions. Properly document your solutions.
( -5 points) for 24 hours late (submitted after 3-April 11am EST, by 4-April 11am EST)
(-10 points) for 48 hours late (submitted after 4-April 11am EST, by 5-April 11am EST)
(-2 points) for submitting a Word document or handwriting, or a write-up that is not a typed PDF file.
Save your write-up as a PDF file (only typed PDF is accepted) — No handwriting. No hand-drawing. No Word document.
Each team submits only one copy.
Upload your report as a PDF to Assignment 5 on Gradescope. Make sure you connect your partner to your group on Gradescope so that everyone receives credit.
Make sure that you submit all file(s).
Verify that you submit the correct file(s).
Making your submission available to the instructor and course staff is your responsibility; if we cannot access or open your file, you will not get credit. Be sure to test access to your file before the due date.
CC-BY-NC-SA 4.0 license.