I want to construct a Turing machine that compares two different decidable Languages in some way (e.g. $ L_a$ and $ L_b$ ). Suppose we have the deciders $ M_a$ and $ M_b$ for these languages.

Am I allowed to use *both* these deciders in the design my Turing machine $ M$ ? By that I mean can I do the following on some input $ x$ for $ M$ :

- Input $ x$ to $ M_a$ . If $ M_a$ accepts go to step $ 2$ . If $ M_a$ rejects go to step $ 3$ .
- Input $ x$ to $ M_b$ . If $ M_b$ accepts, then $ M$ accepts input $ x$ . Else, $ M$ rejects $ x$ .
- Input $ x$ to $ M_b$ . If $ M_b$ accepts, then $ M$ rejects input $ x$ . Else, $ M$ accepts $ x$ .

The idea behind this is that $ M$ only accepts a string $ x$ if $ M_a$ and $ M_b$ both accept or both reject it as well.

So is this not valid? Do I have to write the outputs of $ M_a$ and $ M_b$ to other tapes and compare those values instead?