diff --git a/DFA.fs b/DFA.fs index 47b9b31..f8fec60 100644 --- a/DFA.fs +++ b/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