Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Finite state Transducers and mealy Machine


Published on

Formal Language and Automate

Published in: Engineering
  • Be the first to comment

  • Be the first to like this

Finite state Transducers and mealy Machine

  1. 1. Finite State Transducers Mealy Machine Nadeem Qasmi
  2. 2. Finite state transducer • A finite state transducer is a finite state automaton in which the members of Σ (the symbols labeling the arcs) are pairs, triples, etc., rather than simple symbols. • Traditionally the members of Σ in a transducer are just pairs, of which the left-hand member is the `input symbol' and the right hand member is the `output symbol'.
  3. 3. Finite State Transducers • Special type of finite state machine • It has two tapes • An input string and an output string • Rather than just traversing (and accepting or rejecting) an input string • It translates the contents of its input string to its output string
  4. 4. Finite state transducer • Fst has a finite set Q of internal states • Read once-only input file that contains a string from an input alphabet Σ, • Output mechanism produces a string from an output alphabet r, in response to a given input,
  5. 5. We put PAIRS of symbols (or symbol strings) on our transition arrows, viewing one as input and the other as output a:b at the arc means that in this transition the transducer reads a from the first tape and writes b onto the second.
  6. 6. Finite state transducer • Fst as an implementation of a function. If M is an fst, we will FM denote the function represented by M, so FM : D R Where D is subset of Σ* and R is a subset of r*
  7. 7. Finite state transducer  Interpreting as fst as a function implies that it is deterministic, that is that output is uniquely deterministic by the input,  Nondeterministic is no significant role in the study of finite state transducer.
  8. 8. Finite state transducer • One input symbol result in one output symbol appears to imply that the mapping FM length-preserving that is |FM (w)| = |w| • We can always include the empty string so that |FM (w)| < |w|
  9. 9. Formal definition of FST • A Deterministic Finite State Transducer (FST) is a 7-tuple (Q, Σ, Γ, δ, ω, q0, F) 1. Q is a finite set called the states 2. Σ is a finite set called the alphabet 3. Γ is a finite set called the output alphabet 4. δ : Q × Σ → Q is the transition function 5. ω : Q × Σ → Γ is the output function 6. q0 ∈ Q is the start state 7. F ⊆ Q is the set of accept states
  10. 10. Frequently the transition function and the transduction function(output function) are combined into a single transition-transduction function, which may also be called δ, Q × Σ → Q × Γ, mapping a pair of a state and an input symbol onto a pair of a state and an output symbol
  11. 11. • Each string-to-string finite state transducer relates the input alphabet Σ to the output alphabet Γ. Relations R on Σ*×Γ* that can be implemented as finite state transducers are called rational relations. Rational relations that are partial functions, i.e. that relate every input string from Σ* to at most one Γ*, are called rational functions.
  12. 12.  A finite-state transducer is deterministic if the output is uniquely determined by the input,
  13. 13. A finite-state transducer is non-deterministic if either the transition mapping or the transduction mapping fails to be a function, i.e. if there is more than one possible transition or more than one possible output symbol for a given pair of a state and an input symbol.
  14. 14. Mealy Machines  Output produced by each transition depends on the internal state prior to the transition and the input symbol used in the transition  Output produced during the transition.
  15. 15. Definition: Mealy Machine A Mealy machine is defined by the sextuple M = ( Q , Σ, r, δ, ,qo ) Where Q is a finite set of internal states, Σ is the input alphabet, R is the output alphabet, δ : Q × Σ Q is the transition function. : Q × Σ r is the output function. qo ∈ Q is the initial state of M.
  16. 16. • Starting qo at which time All input is available for processing. At the time tn the mealy machine is in state qi, the curent input symbol is ‘a’ and δ(qi ,a ) = qf , (qi ,a ) =b the machine enter state qf and produce output ‘b’. a/b It is assumed the entire process is process is terminated when the end of the input is reached. Note that there are no final states associated with a transducer. qi qf
  17. 17. Example
  18. 18. Question?
  19. 19. Thanks