Change from State struct to just strings
This commit is contained in:
parent
fa48bc49d1
commit
30949252c0
4 changed files with 36 additions and 40 deletions
|
|
@ -9,32 +9,32 @@ module IsNumeric =
|
|||
let numericDFA:DFA = {
|
||||
sigma = Seq.toList "01ab";
|
||||
states = [
|
||||
{name = "yes"};
|
||||
{name = "no"}
|
||||
"yes";
|
||||
"no"
|
||||
];
|
||||
delta = (fun x y ->
|
||||
match (x, y) with
|
||||
| ({name = "yes"}, '0') -> {name = "yes"}
|
||||
| ({name = "yes"}, '1') -> {name = "yes"}
|
||||
| _ -> {name = "no"}
|
||||
| ("yes", '0') -> "yes"
|
||||
| ("yes", '1') -> "yes"
|
||||
| _ -> "no"
|
||||
);
|
||||
beginState = {name = "yes"};
|
||||
acceptingStates = [{name = "yes"}]
|
||||
beginState = "yes";
|
||||
acceptingStates = ["yes"]
|
||||
}
|
||||
|
||||
let numericNFA:NFA = {
|
||||
sigma = Seq.toList "01ab";
|
||||
states = [
|
||||
{name = "yes"}
|
||||
"yes"
|
||||
];
|
||||
delta = (fun x y ->
|
||||
match (x, y) with
|
||||
| ({name = "yes"}, '0') -> [{name = "yes"}]
|
||||
| ({name = "yes"}, '1') -> [{name = "yes"}]
|
||||
| ("yes", '0') -> ["yes"]
|
||||
| ("yes", '1') -> ["yes"]
|
||||
| _ -> []
|
||||
);
|
||||
beginState = {name = "yes"};
|
||||
acceptingStates = [{name = "yes"}]
|
||||
beginState = "yes";
|
||||
acceptingStates = ["yes"]
|
||||
}
|
||||
|
||||
let test =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue