On Dec 15, 2004, at 11:00 AM, David Coppit wrote:

Yes, but not in the traditional sense. Traditionally, you can only have 1
transition from a state for a given input. i.e. the model all by itself
defines a deterministic behavior. What you actually have is
model+algorithm defining a deterministic behavior.

Right.

IMHO, I would simply disallow multiple transitions in the model, which
would make it a real DFA. This change shouldn't impact your algorithm.
(i.e. it's doesn't find the *first* match, but rather *the* match.)

Hrm. I'm not sure how I would enforce that. But either way, I think DFA::Rules is a good name.


I'm pretty sure you don't want to try to implement an NFA directly. You'd
have to explore each possible transition (and following transitions),
backtracking when you reach a dead end. It would be better to convert an
NFA into a DFA. (NFAs are equivalent in power to DFAs.)

Yeah, I have no interest in implementing an NFA. This DFA does what I need with 1/100th the work. ;-)


Thanks for the feedback!

David



Reply via email to