Ocaml 结构自动机

Ocaml 结构自动机,ocaml,caml,automata,Ocaml,Caml,Automata,我对CAML light语言有问题。。。我需要写一个CAML light程序,给出三个三字母的单词,如果这些字母出现在给定的单词中,那么它将返回true,否则返回false。程序必须使用确定性自动机 你知道吗?谢谢 无自动机的程序: let string_check c1 c2 string = (index_char string c1)>0 && (index_char string c2)>0;; let rec progCaml a b s_list = m

我对CAML light语言有问题。。。我需要写一个CAML light程序,给出三个三字母的单词,如果这些字母出现在给定的单词中,那么它将返回true,否则返回false。程序必须使用确定性自动机

你知道吗?谢谢

无自动机的程序:

let string_check c1 c2 string = (index_char string c1)>0 && (index_char string c2)>0;;

let rec progCaml a b s_list = match s_list with [] -> false | x::xs -> try (string_check a b x) with Not_found -> progCaml a b xs;;

如果我是你,我认为DFA首先接受包含一个特定字符的输入。然后将3个这样的DFA与第一个DFA的立方状态数组合。