Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

How to specify an NFA using Automa.jl?

$
0
0

@lesshaste wrote:

I would like to convert NFAs to DFAs using the function nfa2dfa from Automa.jl. However I can’t see in the docs how to specify an NFA. Here is a toy example NFA.

 Automaton("nondet",2,"abcd",[ [ [ 1 ], [ 2 ] ], [ [ 2 ], [ ] ], [ [ 2 ], [ ] ], [ [ 1 ], [ 2 ] ] ],[ 1 ],[ 1, 2 ])

This follows the specification from GAP. It has 2 states and 4 letters. Here it is as a transition matrix:

   |  1       2
-------------------
 a | [ 1 ]   [ 2 ]   
 b | [ 2 ]           
 c | [ 2 ]           
 d | [ 1 ]   [ 2 ]   
Initial state:    [ 1 ]
Accepting states: [ 1, 2 ]

How can you make an NFA in Automa.jl from this example?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 2795

Trending Articles