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
what does [^] mean in regular expressions?
anything but eg [^t] is anything but t
what does \d mean in regular expressions?
any numeric character
what does \w mean in regular expressions?
any alpha numeric character
what does \s mean in regular expressions?
space
what does \W (captital) mean in regular expressions?
its not \w or [^\w]
what does . mean in regular expressions?
it matches any character
applications of regular expressions
- searcing for files
- searching for words in a block of text
- searching for virus signatures
- filtering text
What is a turning machine?
An FSM that controls one + tapes that are infinite and can move in both directions. Can execute any algothrithm
What does a TM do at each step?
- Changes state
- Changes symbol on tape
- Moves the tape 1 step (or doesnt move)
- ::=

