validate
Checks that a result fits this spec. A selection must name one of the categories, and its distribution, when present, must cover exactly the categories. Other outcomes always fit.
Return
the result, unchanged
Parameters
result
the result to check
Throws
if a selection names an unknown category, or its distribution does not cover exactly the categories