dfa

Regular expressions Equivalence

Is there a way to find out if two arbitrary regular expressions are equivalent? Looks like complex problem to me, but there might be some DFA simplification mechanism or something? ...

library for converting regular expressions to NFAs?

Is there a good library for converting Regular Expressions into NFAs? I see lots of academic papers on the subject, which are helpful, but not much in the way of working code. My question is due partially to curiosity, and partially to an actual need to speed up regular expression matching on a production system I'm working on. Althou...

Can I Determine the Set of First Chars Matched by Regex Pattern?

I would like to be able to compute the set of all characters which may be matched as the first character in a string by a given instance of java.util.regex.Pattern. More formally, given the DFA equivalent to a certain regular expression, I want the set of all outgoing transitions from the start state. An example: Pattern p = Pattern.c...

DFA based regular expression matching - how to get all matches!

Hi! I have a given DFA that represent a regular expression. I want to match the DFA against an input stream and get all possible matches back, not only the lestmost-longest match. For example: regex: a*ba|baa input: aaaaabaaababbabbbaa result: aaaaaba aaba ba baa Sorry for my English! Thanks for your help! ...

self-taught compiler courses / good introductory compiler books?

Does anyone know of online course / university lectures that comprise a typical compiler course? I've had theory of computing but unfortunately my school didn't offer a course in compiler construction. I know there are lectures out there; I was hoping for recommendations for particularly good offerings. Also, are there books for new...

Modelling a Finite Deterministic Automaton via this data *Edit with new code*

I have this input file: 2 3 2 1 ab 1 0 2 0 2 0 2 0 3 abaa aab aba 3 3 2 ade 0 1 2 1 2 0 2 1 0 1 2 2 2 a de The first line represents the number of test cases. Each test case starts with 3 integers, the first is the number of state for the automaton, next is the number of symbols in the alphabet and then the number of final states. ...

DFA Based Regular Expression Engines for Java with Capture

Are there any (free) regular expression engines for Java, that can compile a regular expression to a DFA, and do group capturing while matching the DFA ? I've found dk.brics.automaton and jrexx, which both compile to DFA, but neither seems to be able to do group capture. While the other engines I've found seem to compile to NFA. ...

Efficient mass string search problem.

The Problem: A large static list of strings is provided. A pattern string comprised of data and wildcard elements (* and ?). The idea is to return all the strings that match the pattern - simple enough. Current Solution: I'm currently using a linear approach of scanning the large list and globbing each entry against the pattern. My Que...

questions on nfa and dfa..

Hi Guys... Hope you help me with this one.... I have a main question which is ''how to judge whether a regular expression will be accepted by NFA and/or DFA? For eg. My question says that which of the regular expressions are equivalent? explain... 1.(a+b)*b(a+b)*b(a+b)* 2.a*ba*ba* 3.a*ba*b(a+b)* do we have to draw the NFA and DFA an...

How to get DFA intersection ?

How do we combine two dfa using intersection method ? ...

Finit Automata Library writen in F#

Could you recommend an open source library written in F# which provides generic types for FA construction and basic algorithms (NFA to DFA transformation, FA minimization ...)? ...

Efficient algorithm for converting a character set into a nfa/dfa

I'm currently working on a scanner generator. The generator already works fine. But when using character classes the algorithm gets very slow. The scanner generator produces a scanner for UTF8 encoded files. The full range of characters (0x000000 to 0x10ffff) should be supported. If I use large character sets, like the any operator '....

Parser vs. lexer and XML

I'm reading about compilers and parsers architecture now and I wonder about one thing... When you have XML, XHTML, HTML or any SGML-based language, what would be the role of a lexer here and what would be the tokens? I've read that tokens are like words prepared for parsing by the lexer. Although I don't have problem with finding tokens...

Determinant Finite Automata (JFLAP)

Hello all, I have a DFA question (Determinant Finite Automata) . We are using JFLAP to construct the automata. I cannot figure this question out to save my life! Here it is "DFA to recognize the language of all strings that have an even number of zeros and an odd number of ones." So the alphabet is {0,1} and only using 0,1. So I ...

Creating an Exclusive Or from two Deterministic Finite Automatons (Deterministic Finite-State Machines)

Two DFAs (Deterministic Finite Automaton or Deterministic Fininte-State Machines - Which will be called DFAs from here on) Defined over the set DFA 1: L1 = {Q1, E, D1, s1, F} DFA 2: L2 = {Q2, E, D2, s2, F} Q is the list of states. Ex 1, 2, 3, 4 or a, b, c, d E is the the language Ex. 0, 1 D is the transition set Ex. {(a,0,b)} state a ...

Data Structure to represent a DFA

Hi All, I was wondering, what would be the best data structure to represent a DFA ? I am looking at converting a regular expression to a DFA and make this particular functionality as a library in java. The main thing is that, each entity in the regex carries a set of value rather than a single string value like "car" . In my case , ...

If a language (L) is recognized by an n-state NFA, can it also be recognized by a DFA with no more than 2^n states?

I'm thinking so, because the upper bound would be the 2^n, and given that these are both finite machines, the intersection for both the n-state NFA and the DFA with 2^n or less states will be valid. Am I wrong here? ...

Syntax for Describing DFA or NFA

Do there exists any Standard Syntax for Describing the Transition Table for an NFA or DFA ? ...

DFA vs NFA engines, what is the difference in their capabilities and limitations?

Look for a non-technical explanation of the difference between DFA vs NFA engines based on their capabilities and limitations. Thanks! ...

NFA/DFA with variable transition conditions

Good night, Let's suppose I have a class which implements a NFA/DFA whose transitions are stored in a .NET Dictionary structure, and which takes an input word and recognizes a set of words derivable in some way from the input. Furthermore, let's suppose that the automaton is a generic template that can be applied to different words of t...