• 沒有找到結果。

Chapter 4: Decidability I

N/A
N/A
Protected

Academic year: 2022

Share "Chapter 4: Decidability I"

Copied!
11
0
0

加載中.... (立即查看全文)

全文

(1)

Chapter 4: Decidability I

Now we have algorithms

We want to check problems solvable or not by computers

Need a TM to decide it

i.e., accept/reject in a finite number of steps We will show some examples

(2)

Acceptance Problems for DFA I

ADFA = {hB, w i | B is a DFA that accepts w }

hB, w i is the input

Note that a DFA can be represented as a string (Q, Σ, . . .)

Is ADFA decidable?

Idea: input hB, w i

1 simulate B on w

2 ends in an accept state ⇒ accept otherwise ⇒ reject

(3)

Proof of A

DFA

I

Put

B = hQ, Σ, δ, q0, F i into a tape

Check if w ∈ Σ and B a valid DFA Simulate w according to δ

After processing the last element of w , check if in a final state

(4)

A

NFA

I

ANFA = {hB, w i | B is an NFA that accepts w }

We can convert B to a DFA and use the procedure for ADFA

It’s like to use the procedure for ADFA as a subroutine

(5)

A

REX

I

AREX = {hR, w i | R : regular expression generates w }

It’s similar

We convert R to a DFA first

Recall that we had a procedure to convert R to an NFA. Then we can convert the NFA to a DFA The key is that the conversion is a finite procedure

(6)

E

DFA

I

EDFA = {hAi | A : DFA, L(A) = ∅}

i.e. A accepts nothing Idea:

DFA accepts something

⇔ reaching a final state from q0 after several links procedure

1 mark q0

(7)

E

DFA

II

2 repeat until no new state marked mark all

a → b, where a has been marked

3 if no q ∈ F marked, accept. otherwise, reject Example: a state diagram with 3 nodes and the following connections

1 → 2, 3

(8)

E

DFA

III

Marked states in running the procedure 1

12 12

Each iteration: at least one new state marked At most n iterations: n: # states

(9)

EQ

DFA

I

EQDFA = {hA, Bi | A, B : DFAs, L(A) = L(B)}

EQDFA is decidable Idea for the proof:

Let a DFA C be the exclusive or of A and B If

L(A) = L(B) then

L(C ) = ∅

(10)

EQ

DFA

II

A B

Exclusive or of A and B

(latex source from

https://texample.net/tikz/examples/

set-operations-illustrated-with-venn-diagrams/)

(11)

EQ

DFA

III

Formally

L(C ) = (L(A) ∩ L(B)) ∪ (L(A) ∩ L(B)) B DFA ⇒ so is B

A, B DFA ⇒ so is A ∪ B, A ∩ B

We then use EDFA to check if L(C ) = ∅ or not

參考文獻

相關文件

That the sequence is increasing can be shown by induction... If not,

Here is

To do (9), you need to recall the exercise from hw 1 and hw 2 in Calculus I: (you do not need to turn in the following exercises) If you are not familiar with the exercises below,

[Hint: You may find the following fact useful.. If d is a metric for the topology of X, show that d|A × A is a metric for

Remark: All the sequences are sequence of real numbers.. Formula that might be useful: Let θ

Since {I n } is a finite covering of A, this process can be done in finite steps... Prove

[r]

Use definition to show that cf is also differentiable and D(αf ) =