From b1e26541ce16c569d933496f3611200980d2b63c Mon Sep 17 00:00:00 2001 From: joachimschmidt557 Date: Wed, 6 Feb 2019 22:07:57 +0100 Subject: [PATCH] Add some comments --- DFA.fs | 6 ++++++ 1 file changed, 6 insertions(+) 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