The NFA that constructs the half (L)

Source: Internet
Author: User

The NFA that constructs the half (L)

Self-handling Baidu space

    Original article, paste please stick to the source

    occasionally some purely theoretical question. This is an advanced algorithm work problem,L is the regular language, and language b is the first half of all the strings in L, proving that B is also regular.

    objective to define and construct B An NFA, non-deterministic finite state machine.

    to use the parallel NFA"concept. For example, another question: How to tell if a string is both regular language A and regular language B? Such an NFA can be constructed , with astate set of qa*qb(Qa and Qb as a and B State sets). Accept the set as FA*FB, so that part of the machine (the first half of the status tuple) matches language A, and the other part (the second half of the tuple) matches language B.

    back to our theme. AssumptionsLthe correspondingDfato beD= (Q,[SUM],[DELTA],Q0,F). Construct LanguageB(LThe first half of all strings in half-open)Nfa, the idea is to first non-deterministic guessing inputXin theDThe status after the run is reachedQ(most likely not an end state because the inputXjustLhalf of a string in the. KnowQafter the construction childNfa:Dq, use the parallelNfa", the state set isQ*q, when the start state(Q0,Q), accept the status as{q}*f. ThisDqthe function is parallel to the judgmentXis not the languageAhalf (the first half of the state tuple, fromQ0to theQ), and non-deterministic judgments, guessesXin the languageAThe second half of the corresponding string (the first half of the state tuple, fromQto theF). And becauseXis the same length as his "second half", and the number of steps required from the start State to the receiving State is the same.

    is for B constructs the NFA. For All of the states of the D(DFA) in the Qi Construction sub State machine Dqi .

    dq= (Q*q,[sum],[delta] ', (q0,q), {q}*f)


    where Q is the state setof D, [sum] is the character setof D , Q0 is the starting state of D, F is the acceptance state of D, and[Delta] is the transfer function of D.

    transfer Function [Delta] ' ((Q1,Q2), a)) = {([Delta] (Q1,A), [Delta] (Q2,B)) |all b in [sum]}

    (for the first part of the state, transfer the original state set to identify the input x.) For the second part of the state, the non-deterministic transfer from the Q2 , guessing the "latter half" of X)

    Reference:http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi?board=riddles_cs;action=display;num= 1046126973

    The NFA that constructs the half (L)

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.