Add some comments
This commit is contained in:
parent
857ef08ace
commit
b1e26541ce
1 changed files with 6 additions and 0 deletions
6
DFA.fs
6
DFA.fs
|
|
@ -21,9 +21,15 @@ let validateDFA (dfa:DFA) =
|
|||
|> List.length < 1
|
||||
|
||||
let deltaIsComplete =
|
||||
// Gets the cartesian product of states * sigma
|
||||
dfa.states
|
||||
|> List.collect (fun x -> dfa.sigma |> List.map (fun y -> (x, y)))
|
||||
|
||||
// Processes all tuples through delta
|
||||
|> List.map (fun x -> dfa.delta (fst x) (snd x))
|
||||
|
||||
// Checks if there is any result from delta which is not
|
||||
// a valid state
|
||||
|> List.filter (fun x -> not (List.contains x dfa.states))
|
||||
|> List.length < 1
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue