Making illegal state unrepresentable