Halting in non-Turing-complete languages

前端 未结 3 1899
广开言路
广开言路 2021-02-19 04:09

The halting problem cannot be solved for Turing complete languages and it can be solved trivially for some non-TC languages like regexes where it always halts.

I was wo

3条回答
  •  眼角桃花
    2021-02-19 04:38

    The halting problem does not act on languages. Rather, it acts on machines (i.e., programs): it asks whether a given program halts on a given input.

    Perhaps you meant to ask whether it can be solved for other models of computation (like regular expressions, which you mention, but also like push-down automata).

    Halting can, in general, be detected in models with finite resources (like regular expressions or, equivalently, finite automata, which have a fixed number of states and no external storage). This is easily accomplished by enumerating all possible configurations and checking whether the machine enters the same configuration twice (indicating an infinite loop); with finite resources, we can put an upper bound on the amount of time before we must see a repeated configuration if the machine does not halt.

    Usually, models with infinite resources (unbounded TMs and PDAs, for instance), cannot be halt-checked, but it would be best to investigate the models and their open problems individually.

    (Sorry for all the Wikipedia links, but it actually is a very good resource for this kind of question.)

提交回复
热议问题