Add some comments

This commit is contained in:
joachimschmidt557 2019-02-06 22:07:57 +01:00
parent 857ef08ace
commit b1e26541ce

6
DFA.fs
View file

@ -21,9 +21,15 @@ let validateDFA (dfa:DFA) =
|> List.length < 1 |> List.length < 1
let deltaIsComplete = let deltaIsComplete =
// Gets the cartesian product of states * sigma
dfa.states dfa.states
|> List.collect (fun x -> dfa.sigma |> List.map (fun y -> (x, y))) |> 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)) |> 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.filter (fun x -> not (List.contains x dfa.states))
|> List.length < 1 |> List.length < 1