See SemiDecidable or Sipser: Introduction to the theory of Computation