Jumping Finite Automata:
Characterizations and Complexity
Henning Fernau, Meenakshi Paramasivan & Markus L. Schmid
{fernau, paramasivan, mschmid}@uni-trier.de
CIAA, Umeå, Sweden, 20 August 2015
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
1/36
Overview on the talk
• Jumping Finite Automata
• Operations on Languages and their Properties
• Alphabetic Shuffle Expressions
• Representations and Normal Forms
• Comparing JFA and REG
• Complexity of Parsing
• Discussions
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
2/36
Jumping Finite Automata An Introduction . . .
• Jumping Finite Automata - [Meduna and Zemek 2012]
• Reads the input by making a jump at any position of the input
• Different jumping sequences are possible
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
3/36
Jumping Finite Automata
start
a
s
r
c
b
t
b b c a c a
b b c a c a
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
4/36
Jumping Finite Automata
start
a
s
r
c
b
t
b b c a c a
b b c a c a
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
5/36
Jumping Finite Automata
a
s
start
r
c
b
t
b b c
c a
b b c a c
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
6/36
Jumping Finite Automata
a
s
start
r
c
b
t
b c
c a
b
c a c
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
7/36
Jumping Finite Automata
a
s
start
r
c
b
t
b c
a
b
a c
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
8/36
Jumping Finite Automata
start
a
s
r
c
b
t
b c
b
c
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
9/36
Jumping Finite Automata
a
s
start
r
c
b
t
c
c
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
10/36
Jumping Finite Automata
start
a
s
r
c
b
t
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
11/36
Jumping Finite Automata
start
a
s
r
c
b
t
Accepted language: {w ∈ {a, b, c}∗ : |w|a = |w|b = |w|c}
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
12/36
Definitions
FM
A finite machine (FM) is a quintuple M = (Q, Σ, R, s, F ) where
• Q is a finite set of states
• Σ is the input alphabet
• R is a finite set of rules of the form py → q (p, q ∈ Q, y ∈ Σ)
• s ∈ Q is the start state
• F ⊆ Q is a set of final states
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
13/36
Definitions
Let M = (Q, Σ, R, s, F ), finite machine, we interpret M in two ways:
- Configuration of a FA, M is any string in QΣ∗.
qw⇒pz ⇐⇒ ∃ qy → p ∈ R ∃ z ∈ Σ∗ : w = yz
- Configuration of a JFA, M is any string in Σ∗QΣ∗.
vqwyv 0pz 0 ⇐⇒ ∃ qy → p ∈ R ∃ z ∈ Σ∗ : w = yz ∧ vz = v 0z 0
LF A(M ) = {w ∈ Σ∗ : ∃f ∈ F : sw ⇒∗ f } and
LJF A(M ) = {w ∈ Σ∗ : ∃u, v ∈ Σ∗ ∃f ∈ F : w = uv ∧ usv y∗ f }.
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
14/36
Our Example
The FM M = ({s, r, t}, {a, b, c}, R, s, {s})
with R = {sa → r, rb → t, tc → s} accepts
LJF A(M ) = {w ∈ {a, b, c}∗ : |w|a = |w|b = |w|c}
start
a
s
r
c
b
t
For instance:
bacbcsa y bacrbc
[sa → r]
y bactc
[rb → t]
y bsac
[tc → s]
y rbc
[sa → r]
y tc
[rb → t]
ys
[tc → s]
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
15/36
Overview on the talk
• Jumping Finite Automata
• Operations on Languages and their Properties
• Alphabetic Shuffle Expressions
• Representations and Normal Forms
• Comparing JFA and REG
• Complexity of Parsing
• Discussions
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
16/36
Operations on Languages and their Properties
Shuffle Operation
The shuffle operation, denoted by , is defined recursively by
(au bv) = a(u bv) ∪ b(au v) and
(u ε) = (ε u) = {u}, where u, v ∈ Σ∗ and a, b ∈ Σ.
The shuffle operation is extended in a natural way to languages: the shuffle of two languages
L1 and L2 is
[
L1 L2 =
u v
u∈L1 ,v∈L2
Iterated Shuffle
For L ⊆ Σ∗ , the iterated shuffle of L is defined by:
∞
[
,∗
L
:=
L,n
where L,0 = {ε} and L,i := L,i−1
L.
n=0
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
17/36
Proposition 1
Let M1, M2, M3 be arbitrary languages.
1. M1 M2 = M2 M1 (commutative law)
2. (M1 M2) M3 = M1 (M2 M3) (associative law)
3. M1 (M2 ∪ M3) = M1 M2 ∪ M1 M3 (distributive law)
4. (M1 ∪ M2),∗ = (M1),∗ (M2),∗
5. (M1,∗),∗ = (M1),∗
6. (M1 M2,∗),∗ = (M1 (M1 ∪ M2),∗) ∪ {ε}
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
18/36
perm(w)
The set of all permutations of w, perm(w), is defined as follows:
{ε},
|w| = 0
perm(w) =
{a} perm(u), w = a · u, a ∈ Σ, u ∈ Σ∗
S
For L ⊆ Σ∗ , perm(L) = w∈L perm(w).
Lemma 1
∗
∗
perm : 2Σ → 2Σ is a hull operator, i.e., it is extensive, increasing and idempotent.
Lemma 2
−
The set {perm(w) : w ∈ Σ∗ } is a partition of Σ∗ . {perm(w) : w ∈ Σ∗ } = πΣ
(πΣ (w)).
Note: Parikh mapping πΣ : Σ∗ → NΣ , w 7→ (a 7→ |w|a )
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
19/36
Proposition 3
For L1, L2 ⊆ Σ∗, perm(L1) = perm(L2) iff πΣ(L1) = πΣ(L2).
Corollary 1
If L ∈ J F A , then L is perm-closed.
Theorem 1 (Meduna, Zemek & Parikh)
J F A = perm(RE G ) = perm(C F L ).
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
20/36
Proposition 2
∗
(2Σ , ∪, , ∅, {ε}) is a commutative semiring.
Theorem 2
∗
∗
Σ
Σ
perm : (2 , ∪, ·, ∅, {ε}) → (2 , ∪, , ∅, {ε}) is a semiring morphism that
also respects the iterated catenation resp. shuffle operation.
Note: perm cannot be an isomorphism, as the catenation semiring is not commutative, while the shuffle semiring is.
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
21/36
Overview on the talk
• Jumping Finite Automata
• Operations on Languages and their Properties
• Alphabetic Shuffle Expressions
• Representations and Normal Forms
• Comparing JFA and REG
• Complexity of Parsing
• Discussions
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
22/36
Alphabetic Shuffle Expressions
α-SHUF expressions
• ∅, and each a ∈ Σ are α-SHUF expressions,
• If S1 , S2 are α-SHUF expressions,
then (S1 + S2 ), (S1 S2 ) and S1 , ∗ are α-SHUF expressions.
Semantics: L((a + b), ∗ ) = {a, b}, ∗
SHUF expressions
• ∅, and each w ∈ Σ∗ are SHUF expressions,
• If S1 , S2 are SHUF expressions,
then (S1 + S2 ), (S1 S2 ) and S1 , ∗ are SHUF expressions.
Note: More generally, in shuffle expressions also concatenation and Kleene star are admitted as
operators.
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
23/36
Alphabetic Shuffle Expressions
Lemma 3
Let R0 be a regular expression. Let the α-SHUF expression R be obtained
from R0 by consequently replacing all · by , and all ∗ by ,∗ in R0. Then,
perm(L(R0)) = L(R).
Theorem 3
A language L ⊆ Σ∗ is in J F A iff there is some α-SHUF expression R such
that L = L(R).
Corollary 3
J F A is closed under iterated shuffle.
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
24/36
Overview on the talk
• Jumping Finite Automata
• Operations on Languages and their Properties
• Alphabetic Shuffle Expressions
• Representations and Normal Forms
• Comparing JFA and REG
• Complexity of Parsing
• Discussions
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
25/36
Representations and Normal Forms
Theorem 4 (Representation Theorem)
Let L ∈ J F A . Then ∃ n ≥ 1 and finite sets Mi, Ni for 1 ≤ i ≤ n, so that
the following representation is valid.
L=
n
[
i=1
perm(Mi)
(perm(Ni)),∗
(1)
Proof sketch: We will prove this representation theorem on the level of αSHUF expressions, so that we actually get a normal form theorem for these.
A central tool in the proof of the normal form theorem is the following notion that
corresponds to the well-known star-height of regular expressions.
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
26/36
height of α-SHUF expression
We can inductively associate the (shuffle iteration) height h to any α-SHUF
expression S as follows.
• If S is a base case, then h(S) = 0.
• If S = (S1 + S2) or S = (S1 S2), then h(S) = max{h(S1), h(S2)}.
,∗
• If S = S1 , then h(S) = h(S1) + 1.
The shuffle iteration height of a J F A -language L is then the smallest shuffle
iteration height of any α-SHUF expression S describing L.
Corollary 4
L ∈ J F A iff there is a regular language R of star height at most one such
that L = perm(R).
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
27/36
Corollary 2
Let L be a finite language. Then, L ∈ J F A if and only if L is perm-closed.
Proposition 4
Let L be some language. Then, L is finite and perm-closed if and only if there
is an α-SHUF expression R, with L = L(R), that does not contain the iterated
shuffle operator.
Corollary 6
It is decidable, given some JFA and some integer k, whether or not this JFA
describes a language of shuffle iteration height at most k.
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
28/36
Normal Form Theorem
Theorem 5
For any α-SHUF expression R, an equivalent α-SHUF expression S with
h(S) = 1 can be constructed that is the union of n α-SHUF expressions
,∗
S1, . . . , Sn such that Si = Fi Gi , where h(Fi) = h(Gi) = 0, 1 ≤ i ≤ n.
Sn(i)
Sm(i)
Moreover, we can assume that Fi = j=1 uj and Gi = j=1 vj , where all
uj and vj are α-SHUF expressions with as their only operators.
Proof Sketch:
1. By induction on the height of R.
2. Applying the laws from Proposition 1.
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
29/36
Overview on the talk
• Jumping Finite Automata
• Operations on Languages and their Properties
• Alphabetic Shuffle Expressions
• Representations and Normal Forms
• Comparing JFA and REG
• Complexity of Parsing
• Discussions
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
30/36
Comparing JFA and REG
Proposition 5
L ∈ J F A ∩ RE G if and only if L ∈ RE G and L is perm-closed.
Theorem 7
Let L ⊆ Σ∗. Then, L ∈ J F A ∩ RE G if and only if there exists a number
n ≥ 1, words wi and finite sets Ni for 1 ≤ i ≤ n, where each Ni is given as
S
ni (a) for some Σ ⊆ Σ and some n : Σ → N, so that the following
i
i
i
a∈Σi a
representation is valid.
L=
n
[
i=1
perm(wi)
(perm(Ni)),∗
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
31/36
Overview on the talk
• Jumping Finite Automata
• Operations on Languages and their Properties
• Alphabetic Shuffle Expressions
• Representations and Normal Forms
• Comparing JFA and REG
• Complexity of Parsing
• Discussions
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
32/36
Complexity of Parsing
Theorem 8
For any fixed input alphabet, the universal word problem for JFA is polynomialtime solvable.
Theorem 9, due to V. Vorel
The universal word problem for JFA (with unbounded input alphabet) is NPcomplete.
(The CIAA proceedings contain a weaker result.)
Theorem 10
The universal word problem is polynomial-time solvable for α-SHUF expressions in normal form.
We have an NP-hardness result on the universal word problem for general α-SHUF expressions.
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
33/36
Overview on the talk
• Jumping Finite Automata
• Operations on Languages and their Properties
• Alphabetic Shuffle Expressions
• Representations and Normal Forms
• Comparing JFA and REG
• Complexity of Parsing
• Discussions
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
34/36
Discussions
• We related JFA to the area of expressions involving shuffle operators.
• Is there a characterization of the class of languages accepted by general jumping finite
automata in terms of expressions?
• Several variants of jumping automata have been suggested in [Meduna & Zemek 2012] and
more variants can be easily thought of.
• Automata that process the input by jumping at the begin or at the end of it, so, the input is
accepted from both ends of the word. This resembles a specific form of revolving automata.
[Bensch, Bordihn, Holzer & Kutrib 2009]
• Automata that process the input by jumping alternately from the left and from the right. This
resembles a form of biautomata. [Klı́ma & Polák 2012]
• Hierarchies in [Flick & Kudlek 2012] inspires similar research for α-SHUF.
• As there is quite a number of variations and restrictions of the shuffle operation itself, it
would be also interesting to study expressions that contain (some of) these. This is also
something we are about to do in the near future.
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
35/36
Thank You!
Jumping Finite Automata: Characterizations and Complexity; CIAA 2015
36/36
© Copyright 2026 Paperzz