Testing complement of DFA

This commit is contained in:
joachimschmidt557 2019-03-15 22:37:59 +01:00
parent 94699949eb
commit 59b8f723cb

View file

@ -22,6 +22,8 @@ module IsNumeric =
acceptingStates = ["yes"]
}
let numericDFAComplement = DFA.complement numericDFA
let numericNFA:NFA = {
sigma = Seq.toList "01ab";
states = [
@ -43,6 +45,9 @@ module IsNumeric =
printfn "0101: %b" (DFA.acceptsWord numericDFA "0101")
printfn "01a1: %b" (DFA.acceptsWord numericDFA "01a1")
printfn "Empty: %b" (DFA.acceptsWord numericDFA "")
printfn "Testing numeric checker DFA complement"
printfn "0101: %b" (DFA.acceptsWord numericDFAComplement "0101")
printfn "01a1: %b" (DFA.acceptsWord numericDFAComplement "01a1")
printfn "Testing numeric checker NFA"
printfn "0101: %A" (NFA.acceptsWord numericNFA "0101")
printfn "01a1: %b" (NFA.acceptsWord numericNFA "01a1")