Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 什么';这是实现不带转换的自动机的标准方法吗?_Regex_Finite Automata_Deterministic - Fatal编程技术网

Regex 什么';这是实现不带转换的自动机的标准方法吗?

Regex 什么';这是实现不带转换的自动机的标准方法吗?,regex,finite-automata,deterministic,Regex,Finite Automata,Deterministic,FA的原始实现将使节点看起来像: struct Node { string label; Node*[char] trans; } 但是,如果您的一个转换是“![a]”(除字符“a”之外的任何内容),该怎么办。而且你的字母表太大,无法存储所有可能不是“a”的字符。你明白我的意思吗 编辑。我现在的猜测是 struct NFAState { string label; Node*[][char] trans; Node*[][char] notTrans;

FA的原始实现将使节点看起来像:

struct Node {
    string label;
    Node*[char] trans;
}
但是,如果您的一个转换是“![a]”(除字符“a”之外的任何内容),该怎么办。而且你的字母表太大,无法存储所有可能不是“a”的字符。你明白我的意思吗

编辑。我现在的猜测是

struct NFAState {
    string label;
    Node*[][char] trans;
    Node*[][char] notTrans;
    Node*[] epsTrans;
}

对于NFA节点。

您可以添加第二个
节点*[char]notTrans并存储not案例的所有节点-'a'
怎么样?你也想过硬编码的FA吗?或者,如果FA是非循环的,你可以使用比特流实现。@bartimar:你说的比特流impl是什么意思?我从一篇论文中明白了你的意思。我想我会把这个想法留给DFA。NFA的使用将意味着同时处于多个状态,这将不会利用内存中状态的顺序。我们在同一波长上。