FSM, Regular expressions, BNF Flashcards
What is a moore machine?
Outputs at each state (including when it starts)
what is a mealy machine?
The outputs are from the transitions
Why are FSM’s useful?
model many kinds of task eg a language, controller, protocols, spellcheck.
Define FSM?
Consiits of a set of inputs symbolsa, and produces a set of output symbols.
Finite number of stats with tranition rules
can have an output or not.
What is a halting state in a fsm
A state that has no outgoing transiitons
What is a non-deterministic FSM?
An fsm that may have several possible next states for each pair of state and input symbol.
(eg an input of 1 has 2 transitions, and which it does is decided by weather the fsm can get to the acceptor)
Deterministic FSM
has one next state for each input
What is a FSA?
Finite state automaton
an fsm which has no output until the end where it outputs yes or no.
(yes producing states are the accepting states)
What is a regular expression?
a notation for defining all the valid strings of a formal language or for defining a search pattern
What does | mean in regular equarssions?
or (has the lowest priority)
What does * mean in regular equarssions?
0 or more
What does ? mean in regular equarssions?
0 or 1
What does + mean in regular equarssions?
1 or more
What does ( ) mean in regular equarssions?
grouping
what does [] mean in regular expressions?
Whats inside the brackets is the class, and shows all allowable characters eg [ae] is a or e.
[a-z]-lowercase
[a-zA-Z]any letter