Engineering Lab

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.

JavaFile parsingValidationBoundary cases

ORIGINAL JAVA / NEW SYNTHETIC INPUTS

Input relationshipOriginal output
Three identical recordsValid
All three attributes distinctValid
Same shape/fill, distinct colourInvalid

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.
STEP 1 / 3

Parse three records

Split the input into records, then attributes.

Source-derived walkthrough

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.

NEXT IN THE ARCHIVEFrom windings to a working transformer