One definition for $P$ is the set of all languages that have a deterministic turing machine $M$ s.t. if $x\in A$ the machine accepts in polynomial time and otherwise it rejects, also in polynomial time. There is no loops, so $P\subseteq R$.
One definition for $NP$ is having a certificate and a deterministic turing machine $N$ s.t. if $y\in B$ then there is a (polynomial size) certificate $u$ s.t. $N$ accepts $y$ and $u$ in polynomial time. What if $y\notin B$? There will be no such certificate, but are we forced to halt? Polynomial time rejection? Seems that there is no refering to this case, and it bothers me - to know what is the exact definition.
An alternative definition for $NP$ is for a language $B$ to have a non deterministic turing machine $N$ s.t. if $y\in B$ then $N$ accepts in polynomial time. What about the case $y\notin B$? Do we have any requirements? Must it halt? Polynomially? Definitions I found seem to miss it.
Having the two definitions equivalent is easy for me to see, and the problem I described is the same problem, only once for each definition.
Additionally, this problem occurs when define $NTIME$ and $NSPACE$. If the input is in the language, we will need $f(n)$ time (or space) for a non deterministic turing machine. But otherwise - if the input is not in the language - what limitations do we have, by definition, on the computation time (or space)? Must we reject? Or loop?
I am aware that classically $NP\subseteq R$ as well. Yet, this issue bothers me, so I am hoping to tidy this gap in the definitions.
Edit: I have read chi's answer in Is rejecting in polynomial time required for language to be in P? . However, I am unsatisfied with his answer, as running in some time limit $O(f(n))$ (polynomial or other) doesn't grant you a numerical upper bound on the number of steps! Say we have an input of size $n=20$ and we had $f(n)=n^2$, so the running time is $O(n^2)$, this can be any $c\cdot 400$, we can't count the number of steps and compare it to this!