Text this: Epistemic and doxastic logic with restrictions