Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I am a seeker of Perl wisdom and have just joined you as a monk. I was faced with a challenging question where I need heros to chip in. The question is as follows: Write a Perl program which simulates the operation of finite automata. The finite automata are represented using transition tables. They are restricted to a maximum of 10 states labelled 0-9, with start state 0. Their alphabets are restricted to a maximum of 26 lower case symbols a-z. The alphabet and transition tables of the finite automaton are specified in blank-seperated fields. The first line specifies the alphabet of the finite automaton, representing end-of-strings as #. The next line represent the rows of the transition table in order. The error condition is represented as ! and the accept condition by *. The line specifying the last row of the transition table is followed by a blank line, followed by zero or more lines representing the input strings, one string per line. The program must read the alphabet, the transition table and the input strings and for each string it must print, on one line, “Accept” or “reject”, followed by the input string. Input strings containing illegal symbols not in the machine’s alphabet must be rejected. The report on the final string must be followed by one blank line. The following lines for example represent a 3-state finite automaton which accepts strings over the alphabet {a,b} which contain double-b, followed by strings to be analysed: a b # 0 1 ! 0 2 ! 1 2 * <blank line> aababa babbaab abaaabbaa bbx <blank line> Given this input your program must output the following results: Reject aababa Accept babbaab Accept abaaabbaa Reject bbx <blank line> The representations of zero or more finite automata and their strings are given in a file. The program must write output to a file. I would appreciate if you help me out. My e-mail adress is:

In reply to RE: Sorry by bravismore
in thread Another for those who love the Regular Expression questions... by Hot Pastrami

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (7)
    As of 2020-02-19 17:09 GMT
    Find Nodes?
      Voting Booth?
      What numbers are you going to focus on primarily in 2020?

      Results (84 votes). Check out past polls.