UCT CSC2004Z practical / 2022
When three records agree
Use a small Java attribute validator to explore parsing, predicate composition and the counterexamples that reveal a rule gap.
ORIGINAL JAVA / NEW SYNTHETIC INPUTS
| Input relationship | Original output |
|---|---|
| Three identical records | Valid |
| All three attributes distinct | Valid |
| Same shape/fill, distinct colour | Invalid |
Source-built Check.java executed on three newly authored cases. The third row exposes the actual retained rule; a missing assignment specification is not replaced with an invented game requirement.
ENGINEERING PERSPECTIVE
Inside the work
Expose the difference between a rule description and its actual implementation. A tiny validator is useful as a focused study in parsing, predicates and counterexamples.
- Java / file parsing
- Split three records into comma-separated attributes.
- Synthetic cases
- Run the source-built program on newly authored inputs to reveal its retained rule.
Parse three records
Split the input into records, then attributes.
- Predicate composition
- The code accepts all-identical records or all-different attributes; mixed attribute combinations are not handled independently.
- Counterexamples
- One small conflicting case can reveal a rule gap more clearly than many passing examples.
- Specification uncertainty
- The missing original brief does not justify inventing a full game requirement.
What the demonstration establishes
Three source-built synthetic runs establish the displayed outputs. The page does not claim a complete SET game or robust malformed-input handling.
Evidence behind this page
Named submission archive and inspected Check.java marked as an own attempt.
How it works
Read three space-separated records, split attributes and compare equality/distinctness. The retained implementation accepts all-identical records or all-different attributes.
Results & recovery
- A previously unlisted named archive and source were recovered without executing its compiled classes.
- Inspection identifies a correctness gap: mixed same/different attribute combinations are not handled independently.
Technical limitations
The complete original specification was not recovered; the stricter code rule is documented rather than assumed to be a complete SET-game implementation. Malformed-input bounds are weak.
What I would improve now
Confirm the intended rule, validate record shape, test mixed attribute cases and distinguish a specification correction from historical behaviour.