The Acceptance problem is a decision problem asks if a given machine model can accept a formula. It is decidable for DFAs and NFAs
Problem Specification(s)
Machine Models
Generative Models
Given a CFG
Decidability
The decidability of the problem requires a restructuring. Let be a language given by the TM encodings of and
Then, we need to check if is T-decidable.
DFA Acceptance Problem is decidable ^theorem-dfa
That is,
Proof
The following is a proof by TM simulation Construct a multi-tape Turing machine, , with 2 tapes (1 input and 1 work tape):
- For any string , first check if is a valid encoding of the form and reject if not.
- Simulate using by:
- Write out the current configuration of using the work tape. This should record the current state of and the tape head ‘for ’ (how many characters has processed).
- Initially this work tape would have . Then (assuming in the DFA , the first character of transitions it to ), etc.
- Use the transition function of to update the current configuration on the work tape.
- At every iteration, the counter of the tape head will always increase by one
- Eventually, the work tape will have where is the size of . If (the accept states of ), accept. Else, reject.
NFA Acceptance Problem is decidable ^theorem-nfa
That is,
Proof
Construct a multi-tape Turing machine, , with 2 tapes (1 input and 1 work tape): We can solve this problem by using a proof by reduction to reduce this to the DFA acceptance problem (which is decidable).
- Again, first pre-process the string to check if it is of the correct form .
- We know there exists an algorithm that converts a NFA to a DFA. By the Church-Turing Thesis, this means it can be done on a TM . So we run first, ensuring we have the input string now in the form where is an equivalent DFA.
- Then we use the same procedure as the DFA version
TM Acceptance Problem is undecidable ^theorem-tm
That is:
Proof
This proof requires the assumption that some languages are unrecognisable. Let be the unrecognisable language constructed previously. Assume that is decidable. Then there exists a Turing machine, that is a decider for it. For any , we have:
Now construct a new Turing machine that simulates , called :
- only takes in one argument, that being a machine code, .
- then simulates on , that is, it uses to check if accepts .
- If accepts, rejects, and vice versa (this makes ) a decider as well.
- So we have:
Then the language of is precisely the same as :
Which is proven to be unrecognisable. Thus, if we tried to feed in to , because is unrecognisable, cannot decide it and thus cannot be a decider for the TM acceptance problem.
Reductions
R1: The TM acceptance problem reduces to the Halting Problem
Proof
Recall that to prove this reduction, we need to show that can construct a decider for given a decider for . Let be the decider for (it takes in and decides if halts on )
We can construct a new decider for as follows:
- takes in the input
- First, it simulates on :
- If rejects, then does not halt on (it runs forever). Obviously this means that cannot accept . So rejects as well.
- If accepts (and being a decider, it can only accept or reject), then always halts on .
- Then, it is now ‘safe’ to simulate on (as we know terminates eventually)
- So accepts if accepts
- And rejects if rejects
Since always halts (is a decider) and decides if accepts , we have constructed a decider for and hence have proved the reduction.
R2: The TM acceptance problem reduces to the TM Emptiness Problem
Proof
Recall that to prove this reduction, we need to show that can construct a decider for given a decider for . Let be the decider for (it takes in and decides if rejects every input)
We can construct a new decider for as follows:
- takes in
- Inside , we construct a new Turing machine that takes in a string simulates independent of input:
- Note that does not depend on . It only depends on and which are ‘fixed’. Meaning, if accepts , then accepts everything. If rejects , rejects everything. Thus:
- Thus:
- Then, we run the emptiness decider on . Since accepts when , this means that either rejects or runs forever (in either case, it does not accept ). If rejects, then so accepts
Thus, we have created a decider (since is a decider) that decides if accepts . So we have proven the reduction.
Applications
- If the TM acceptance problem, was decidable, it would imply that satisfiability in predicate logic would be decidable (since the decider could be converted into an algorithm)
- The TM acceptance problem, is useful in static code analysis, as it can determine if a given program satisfies its specifications (accepts some input strings) without actually running the program. It also helps identify security vulnerabilities and runtime errors.
- This has critical applications in defence and medicine
- Since the DFA acceptance problem, is decidable, any program that can be modelled as an equivalent DFA can be ‘checked’ by a Turing machine.