Fix Denkfehler in contains sequence NFA
This commit is contained in:
parent
59b8f723cb
commit
8be6b8b050
1 changed files with 2 additions and 0 deletions
|
|
@ -18,6 +18,7 @@ module ContainsSequence =
|
|||
delta = (fun x y ->
|
||||
match (x, y) with
|
||||
| ("q0", '0') -> ["q0"; "q1"]
|
||||
| ("q0", _ ) -> ["q0"]
|
||||
| ("q1", '1') -> ["q0"; "q2"]
|
||||
| ("q2", '0') -> ["q0"; "q3"]
|
||||
| ("q3", '1') -> ["yes"]
|
||||
|
|
@ -38,4 +39,5 @@ module ContainsSequence =
|
|||
printfn "0100: %b" (NFA.acceptsWord contains0101 "0100")
|
||||
printfn "00101: %b" (NFA.acceptsWord contains0101 "00101")
|
||||
printfn "01011: %b" (NFA.acceptsWord contains0101 "01011")
|
||||
printfn "1000101: %b" (NFA.acceptsWord contains0101 "1000101")
|
||||
0
|
||||
Loading…
Add table
Add a link
Reference in a new issue