If $f$ is a function $\mathbb N\to\{\text{True},\text{False}\}$, then I know what it means to say that $f$ is in NP. But if $f$ is a function $A\to \{\text{True},\text{False}\}$, where $A$ is a set, then I do not know what that means.
The Boolean satisfiability problem (SAT) is known to be in NP, but what exactly does that mean? The domain $A$ of SAT is the set of all propositional-logic-formulas. Have people agreed to use some specific function $A\to\mathbb N$ as an encoding?