COMP 10070: Formal Foundations

COMP 10070 - Formal Foundations

Instructor Information

  • Instructor: John Dunnion
  • Email: John.Dunnion@ucd.ie
  • School: Computer Science and Informatics

Lecture 19: Finite State Automata

Introduction to Finite State Automata
  • Definition:
    • A Finite State Automaton (FSA) is defined as an abstract computing device that receives a string of symbols as input.
    • The machine reads this string one symbol at a time from left to right, halting upon reading the last symbol to signify either acceptance or rejection of the input.
Input Representation
  • The input is regarded as a single tape that is scanned by the finite state machine.
    • It operates on this tape to process the symbols sequentially.
Formal Definition of Finite Automaton
  • Slightly More Formal Definition (Hopcroft & Ullman, 1979, p.13):
    • A finite automaton is a mathematical model of a system that includes discrete inputs and outputs.
    • The system can exist in any of a finite number of internal configurations or states.
    • The state of the system summarizes the information concerning past inputs needed to determine future behavior on subsequent inputs.
Importance of Finite State Machines
  • Finite state systems are prevalent in computer science, serving as a design tool for various systems.
  • Examples of systems designed as finite state automata include:
    • Switching circuits (e.g., control units in computers)
    • Programs like text editors and lexical analyzers found in compilers.
  • The concept is fundamental due to its naturalness, appearing in diverse applications, indicating a rich structure and potential for application across multiple contexts.
Deterministic Finite State Automata (DFSA)
  • Formal Definition:
    • A deterministic finite state automaton is defined as a quintuple: DFSA = (Q, , , q_0, F)
      • Q: A finite, non-empty set of states
      • Σ: A finite input alphabet
      • δ: A mapping from Q × Σ into Q
      • q0∈Qq_0 \in Q: The initial state
      • F: A subset of Q representing the final states.
Functionality and Representation of DFSA
  • The functionality of a DFSA can be illustrated through a transition diagram, which visually represents the states and transitions.
  • Example Transition Structure:
    • For a set of states {0, 1, 2, 3}, and input symbols {a, b}:
    • Transition function examples:
      • (0,a) = 1
      • (1,b) = 2
      • (2,a) = 3
      • The automaton recognizes the regular language expressed as ab+aab+a, where ++ denotes 1 to n iterations and ∗* denotes 0 to n iterations.
Matrix Representation of DFSA
  • Transition functions can also be represented as a matrix, showcasing state transitions based on input symbols.
  • Example matrix structure based on the DFSA states and inputs:
    • Inputs in the matrix show which state transitions occur upon reading a specified input symbol.
Example Processing with DFDAs
  • Given a string (for example, abbbba), the automaton processes each symbol using the defined transition functions, letter by letter, reaching from state to state until the entire string is processed.
  • The question of whether the string is accepted or rejected is determined if the final state reached is part of the set of final states (F).
Nondeterministic Finite State Automata (NDFSA)
  • Definition:

    • Unlike deterministic FSAs, the behavior of a nondeterministic finite state automaton is not fully dictated by its current state and the current input symbol.
    • An NDFSA can have multiple next states for a given current state/input combination.
  • Formal Definition:

    • An NDFSA is defined as a quintuple: NDFSA = (Q, , , q_0, F)
      • Q: A finite, non-empty set of states
      • Σ: A finite input alphabet
      • δ: A mapping from Q × Σ into the power set of Q, : Q × Σ o (Q)
      • q0∈Qq_0 \in Q: The initial state
      • F: A subset of Q representing the final states.
Example NDFSA and Questions for Exploration
  • Example NDFSA representing transportation modes:
    • Q: {Howth, SydneyParade, CityCentre, UCD}
    • Σ: {3, 31, 39A, Dart, bicycle}
    • Initial state, q0q_0: Howth
    • Final state, F: {UCD}
    • Example transitions defined:
    • (Howth, Dart) = SydneyParade
    • (Howth, 31) = CityCentre
    • (SydneyParade, bicycle) = UCD
    • (CityCentre, 39A) = UCD
    • (UCD, 3) = SydneyParade
  • Exploration Questions:
    1. Identify the combinations of modes of transport defined by this NDFSA.
    2. Determine if this automaton is deterministic or nondeterministic.
    3. Identify alternative notational models applicable to this automaton.
    4. Discuss how to extend this model to accurately represent a journey from Howth to UCD, along with associated challenges.
ε Transitions in Finite Automata
  • Definition:
    • An ε transition allows the automaton to change states without reading any input symbol.
    • This means the automaton can “decide” to change states without an associated input.
  • Property:
    • For every finite automaton incorporating ε transitions, there exists an equivalent automaton that does not include ε transitions.
Properties of Finite State Automata
  • Finite state automata exhibit particular properties related to the languages they can accept:
    • All finite sets of strings are accepted by finite state automata.
    • Finite state automata specifically accept regular languages, providing an essential link to the study of language theory in computer science.
Deterministic vs. Nondeterministic Finite State Automata
  • Determinism:
    • Refers to the clear choices available to an automaton for the next move.
    • A finite state automaton is deemed deterministic if its behavior during recognition is fully determined by its current state and the input symbol being read (i.e., no alternative choices exist).
  • Nondeterminism:
    • In contrast, a nondeterministic finite automaton may have several possible transitions from a given state based on the input symbol, allowing multiple paths for recognizing languages.
  • Key Relation:
    • It has been established that for every NDFSA, there exists a corresponding DFSA that recognizes the same language.