Use semantically neutral state masks for applying states to factor trees