definition
examples
stateDiagram-v2 direction LR classDef accepting fill:#4CAF50,stroke:#333,stroke-width:2px classDef start fill:#FFD700,stroke:#333,stroke-width:2px s0: q0 s1: q1 s2: q2 s3: q3 s4: q4 s5: q5 [*] --> s0 s0 --> s1: a s1 --> s2: b s2 --> s2: Σ s2 --> s3: b s3 --> s4: a s4 --> [*] class s4 accepting class s0 start
stateDiagram-v2 direction LR classDef accepting fill:#4CAF50,stroke:#333,stroke-width:2px classDef start fill:#FFD700,stroke:#333,stroke-width:2px s0: q0 s1: q1 s2: q2 s3: q3 s4: q4 [*] --> s0 s0 --> s0: 0,1 s0 --> s1: 0 s0 --> s3: 1 s1 --> s2: 0 s3 --> s4: 1 s2 --> [*] s4 --> [*] class s2,s4 accepting class s0 start
epsilon transition
stateDiagram-v2 direction LR [*] --> s1 s1 --> s2: 1 s2 --> s3: 1 s3 --> s4: ε s1 --> s4: ε s1 --> s1: 0 s3 --> s3: 1
Given the following
stateDiagram-v2 direction LR [*] --> s1 s1 --> s2: 1 s2 --> s3: 1 s3 --> s4: ε s1 --> s4: ε s1 --> s1: 0 s3 --> s3: 1