Testing complement of DFA
This commit is contained in:
parent
94699949eb
commit
59b8f723cb
1 changed files with 5 additions and 0 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue