Skip to content

Brzozowski derivative

In 1964 Brzozowki proposed idea of derivatives for regular expressions. Note: he uses λ\lambda for ϵ\epsilon, ϕ\phi for \emptyset, ++ for \cup, and &\& for \cap.

Formally derivative defined as Da(R)={t | atR}D_a(R) = \{ t \text{ | } at \in R \}. Basically, it is the opposite of concatenation.

Basic example, let LL be {abc,abd,bcd}\{abc, abd, bcd\}, then derivative by letter:

  • Da(L)={bc,bd}D_a(L) = \{bc, bd\}
  • Db(L)={cd}D_b(L) = \{cd\}
  • Dc(L)={}D_c(L) = \{\}
  • Dab(L)={c,d}D_{ab}(L) = \{c, d\}
  • Dabc(L)={ε}D_{abc}(L) = \{\varepsilon\}

More formally:

  • Da()=D_a(\emptyset) = \emptyset
  • Da(ϵ)=D_a(\epsilon) = \emptyset
  • Da(x)=ϵ if x=aD_a(x) = \epsilon \text{ if } x = a
  • Da(x)= if xaD_a(x) = \emptyset \text{ if } x \neq a
  • Da(L1L2)=Da(L1)Da(L2)D_a(L_1 \cup L_2) = D_a(L_1) \cup D_a(L_2)
  • Da(L1L2)=Da(L1)Da(L2)D_a(L_1 \cap L_2) = D_a(L_1) \cap D_a(L_2)
  • Da(L)=Da(L)LD_a(L^*) = D_a(L) \cdot L^*
  • Da(L1L2)=Da(L1)L2δ(L1)Da(L2)D_a(L_1 \cdot L_2) = D_a(L_1) \cdot L_2 \cup \delta(L_1) \cdot D_a(L_2)
  • Da(L)=Da(L)D_a(L^\prime) = D_a(L)^\prime - complement only defined in the absence of recursion

Definition of nullability function:

  • δ()=\delta(\emptyset) = \emptyset
  • δ(ϵ)=ϵ\delta(\epsilon) = \epsilon
  • δ(a)=\delta(a) = \emptyset
  • δ(L1L2)=δ(L1)δ(L2)\delta(L_1 \cup L_2) = \delta(L_1) \cup \delta(L_2)
  • δ(L1L2)=δ(L1)δ(L2)\delta(L_1 \cap L_2) = \delta(L_1) \cap \delta(L_2)
  • δ(L1L2)=δ(L1)δ(L2)\delta(L_1 \cdot L_2) = \delta(L_1) \cdot \delta(L_2)
  • δ(L)=ϵ\delta(L^*) = \epsilon
  • δ(L)=ϵ if δ(L)=\delta(L^\prime) = \epsilon \text{ if } \delta(L) = \emptyset
  • δ(L)= if δ(L)=ϵ\delta(L^\prime) = \emptyset \text{ if } \delta(L) = \epsilon

Brzozowki shows how derivatives can be used to construct Mealy and Moore automata (finite state machines). Also, he shows how identity rules can be used to simplify automata.

So in order to test if a string is in a language it is enough to take derivative by this word and if resulted language contains empty string (ε\varepsilon) than original language contains given word.