Example number of -symbols. length of the largest sequence of - - PowerPoint PPT Presentation

example
SMART_READER_LITE
LIVE PREVIEW

Example number of -symbols. length of the largest sequence of - - PowerPoint PPT Presentation

Finite Automata (FA) and Monadic Second Order logic (MSO). FA: executable model with good (decidable) properties. MSO (over words): very expressive and yet simple logic. Both equally expressive over words and trees (Bchi). Qualitative


slide-1
SLIDE 1

Finite Automata (FA) and Monadic Second Order logic (MSO). FA: executable model with good (decidable) properties. MSO (over words): very expressive and yet simple logic. Both equally expressive over words and trees (Büchi). Qualitative properties over words. Quantitative properties are also important (today).

Example

number of

  • symbols.

length of the largest sequence of

  • symbols.

How can we extend finite automata or MSO to define these properties (or functions)?

slide-2
SLIDE 2

Weighted automata

General automata framework to define quantitative properties over words. (Boolean) automata, Probabilistic automata, Distance automata, Multiplicity automata, etc... Extension of finite automata with weights from a fix semiring.

slide-3
SLIDE 3

Semiring (reminder)

Definition

A (commutative) semiring is an algebraic structure S = (S, ⊕, ⊙, 0, 1) where: (S, ⊕, 0) and (S, ⊙, 1) are commutative monoids, multiplication distributes over addition, and 0 ⊙ s = s ⊙ 0 = 0 for each s ∈ S.

Example

Natural numbers: (N, +, ⋅, 0, 1). Boolean: ({true, false}, ∨, ∧, false, true). Min-plus: (N∞, min, +, ∞, 0). Max-plus: (N−∞, max, +, −∞, 0).

slide-4
SLIDE 4

Weighted automata (definition)

Fix a semiring S and a finite alphabet Γ.

Definition

A weighted automata over S and Γ is a tuple A = (Γ, S, Q, E, I, F): E ∶ Q × Γ × Q → S is the transition relation (p a/s

  • → q), and

I, F ∶ Q → S is the initial and final function.

Semantics

A run ρ of A over a1 . . . an ∈ Γ∗ is: ρ = q0

a1/s1

  • → q1

a2/s2

  • → ⋯ an/sn
  • → qn

The weight of run ρ of A: weight(ρ) = I(q0) ⊙

n

i=1

si ⊙ F(qn) A defines the function ⟦A⟧ ∶ Γ∗ → S: ⟦A⟧(w) = ⊕

ρ∈RunA(w)

weight(ρ)

slide-5
SLIDE 5

Weighted automata (examples)

Over (N,+,⋅, 0, 1)

f(w) = 3 ⋅ ∣w∣a + 4 ⋅ ∣w∣b a, b/1 a, b/1 a/3 b/4

Over (N∞, min,+,∞, 0)

f(w) = min{∣w∣a, ∣w∣b} a/1 b/0 a/0 b/1

Over (N−∞, max,+,−∞, 0)

f(w) = maximum length of all infix sequences of b’s a, b/0 b/1 a, b/0 b/1 a/0

slide-6
SLIDE 6

What is a good logic to define quantitative properties?

Weighted MSO (Droste & Gastin 2005) Disadvantages: Semantical definition of valid formulas. Inherits the undecidability results of weighted automata. We want a quantitative logic that:

  • 1. has a simple and purely syntactical definition,
  • 2. as expressive as weighted automata, and
  • 3. with good decidability properties.
slide-7
SLIDE 7

We propose: Quantitative Monadic Second Order Logic (QMSO)

  • 1. General framework for adding quantitative properties to any boolean logic.
  • 2. Subfragments of QMSO capture different subclasses of WA.
  • 3. Subfragments of QMSO with good decidability properties.

More results in the paper: Evalution of QMSO with respect to counting complexity classes.

slide-8
SLIDE 8

Quantitative Monadic Second-Order Logic

Cristian Riveros University of Oxford Stephan Kreutzer Technische Universität Berlin LICS 2013

slide-9
SLIDE 9

QMSO and WA QMSO and subclasses of WA Beyond WA Conclusions

Outline

slide-10
SLIDE 10

Quantitative Monadic Second Order Logic (QMSO)

For each w ∈ Γ∗, we represent w ∶= ({1, . . . , ∣w∣}, ≤, {Pa}a∈Γ).

Syntax of QMSO[S,Γ]

ϕ ∶= Pa(x) ∣ x ≤ y ∣ x ∈ X ∣ ϕ ∨ ϕ ∣ ¬ϕ ∣ ∃x. ϕ ∣ ∃X. ϕ θ ∶= ϕ ∣ s ∈ S ∣ θ ⊕ θ ∣ θ ⊙ θ ∣ Σx. θ ∣ Πx. θ ∣ ΣX. θ

Semantic of QMSO[S,Γ]

⟦ϕ⟧(w, σ) ∶= { 1 if (w, σ) ⊧ ϕ

  • therwise

⟦s⟧(w, σ) ∶= s ⟦θ1 ⊕ θ2⟧(w, σ) ∶= ⟦θ1⟧(w, σ) ⊕ ⟦θ2⟧(w, σ) ⟦Πx. θ(x)⟧(w, σ) ∶= ⊙

i ∈ dom(w)

⟦θ(x)⟧(w, σ[x → i]) ⟦ΣX. θ(X)⟧(w, σ) ∶= ⊕

I ⊆ dom(w)

⟦θ(X)⟧(w, σ[X → I])

slide-11
SLIDE 11

Quantitative Monadic Second Order Logic (QMSO)

The syntax of QMSO[S, Γ] depends on the semiring.

Syntax of QMSO[(N,+,⋅, 0, 1),Γ]

ϕ ∶= Pa(x) ∣ x ≤ y ∣ x ∈ X ∣ ϕ ∨ ϕ ∣ ¬ϕ ∣ ∃x. ϕ ∣ ∃X. ϕ θ ∶= ϕ ∣ s ∈ N ∣ θ + θ ∣ θ ⋅ θ ∣ Σx. θ ∣ Πx. θ ∣ ΣX. θ

Syntax of QMSO[(N∞, min,+,∞, 0),Γ]

ϕ ∶= Pa(x) ∣ x ≤ y ∣ x ∈ X ∣ ϕ ∨ ϕ ∣ ¬ϕ ∣ ∃x. ϕ ∣ ∃X. ϕ θ ∶= ϕ ∣ s ∈ N∞ ∣ min{θ, θ} ∣ θ + θ ∣ Min x. θ ∣ Σx. θ ∣ Min X. θ

Syntax of QMSO[(N−∞, max,+,−∞, 0),Γ]

ϕ ∶= Pa(x) ∣ x ≤ y ∣ x ∈ X ∣ ϕ ∨ ϕ ∣ ¬ϕ ∣ ∃x. ϕ ∣ ∃X. ϕ θ ∶= ϕ ∣ s ∈ N−∞ ∣ max{θ, θ} ∣ θ + θ ∣ Max x. θ ∣ Σx. θ ∣ Max X. θ

slide-12
SLIDE 12

Examples of QMSO formulas

Over (N,+,⋅, 0, 1)

f(w) = 3 ⋅ ∣w∣a + 4 ⋅ ∣w∣b Σx. ( 3 ⋅ Pa(x) + 4 ⋅ Pb(x) )

Over (N∞, min,+,∞, 0)

f(w) = min{∣w∣a, ∣w∣b} min { Σx. Pa(x) ↦ 1 , Σx. Pb(x) ↦ 1 } where Pa(x) ↦ 1 ∶= min{ Pa(x) + 1, ¬Pa(x) }.

Over (N−∞, max,+,−∞, 0)

f(w) = maximum length of all infix sequences of b’s Max x. (Σy. intervalb(x, y) ↦ 1) where intervalb(x, y) ∶= x ≤ y ∧ ∀z. (x ≤ z ∧ z ≤ y) → Pb(z).

slide-13
SLIDE 13

Subfragments of QMSO

  • 1. QMSO(Op) restricted to operators Op ⊆ {⊕, ⊙, Σx, Πx, ΣX }.

⊕ = semiring addition ⊙ = semiring multiplication Σx = first-order addition Πx = first-order multiplication ΣX = second-order addition

Example

Full QMSO ∶= QMSO(ΣX , Πx, Σx, ⊕, ⊙)

slide-14
SLIDE 14

Subfragments of QMSO

  • 1. QMSO(Op) restricted to operators Op ⊆ {⊕, ⊙, Σx, Πx, ΣX }.
  • 2. Alternation and Nesting of semiring quantifiers.

Example

QMSO(ΣX ΣxΠx, ⊕, ⊙): ΣX. (Σy. Πz. ϕ(X, z)) ⊕ (Πz1. Πz2. θ(X, z1, z2)) QMSO(ΣxΠ1

x, ⊕, ⊙):

Σx. (Σy. Πz. ϕ(x, y, z)) ⊙ (Πz. θ(x, z)) QMSO(Πn

x, ⊕, ⊙), n ∈ N:

Πx1. ⋯Πxn. θ(x1, . . . , xn)

slide-15
SLIDE 15

QMSO and weighted automata

QMSO is too expressive to capture weighted automata!

Over (N,+,⋅, 0, 1)

⟦Πx. Πy. 2⟧(w) = 2∣w∣2. For every weighted automata A over (N, +, ⋅, 0, 1): ⟦A⟧(w) ∈ 2O(∣w∣)

slide-16
SLIDE 16

QMSO and weighted automata

QMSO is too expressive to capture weighted automata!

Definition

Quantitative Iteration Logic (QIL) ∶= QMSO(ΣX,xΠ1

x, ⊕, ⊙).

Theorem

A function f ∶ Γ∗ → S is definable by a weighted automaton over S and Γ if, and only if, f is definable by a formula in QIL[S, Γ]. Weighted Automata ≡ QIL .

slide-17
SLIDE 17

Undecidable properties of QIL

Quantitative generalization of classical decision problems: Equivalence: ⟦θ1⟧(w) = ⟦θ2⟧(w) for all w ∈ Γ∗, Containment: ⟦θ1⟧(w) ≤ ⟦θ2⟧(w) for all w ∈ Γ∗.

Proposition

The following problems are undecidable:

  • 1. Containment of formulas in QMSO(ΣxΠ1

x, ⊕, ⊙) over (N, +, ⋅, 0, 1).

  • 2. Equivalence and containment of formulas in QMSO(ΣxΠ1

x, ⊕, ⊙)

  • ver (N∞, min, +, ∞, 0).
slide-18
SLIDE 18

QMSO and WA QMSO and subclasses of WA Beyond WA Conclusions

Outline

slide-19
SLIDE 19

Different fragments of QMSO captures different subclasses of WA

Classes of Weighted Automata (WA) depending on the ambiguity: Deterministic WA (DWA). Unambiguous WA (unamb- WA): ∣ RunA(w)∣ ≤ 1 for all w ∈ Σ∗ Finite Ambiguous WA (fin- WA): ∣ RunA(w)∣ < k for all w ∈ Σ∗ Polynomially Ambiguous WA (poly- WA): ∣ RunA(w)∣ ∈ O(∣w∣k) DWA ⊊ unamb- WA ⊊ fin- WA ⊊ poly- WA ⊊ WA

slide-20
SLIDE 20

Unambiguous and finitely ambiguous weighted automata are captured by QMSO

Subfragment QMSO(Op, ⊕b): ⊕-operator is restricted to a “base” level.

Example

(Πx. Pa(x) ⊕ Pb(x)) ⊙ (Πx. ∃z. x ≤ z ∧ Pa(z)) ∈ QMSO(Π1

x, ⊕b, ⊙)

(Πx. Pa(x) ⊕ Pb(x)) ⊕ (Πx. ∃z. x ≤ z ∧ Pa(z)) ∉ QMSO(Π1

x, ⊕b, ⊙)

slide-21
SLIDE 21

Unambiguous and finitely ambiguous weighted automata are captured by QMSO

Subfragment QMSO(Op, ⊕b): ⊕-operator is restricted to a “base” level.

Theorem

unamb- WA ≡ QMSO(Π1

x, ⊕b, ⊙)

fin- WA ≡ QMSO(Π1

x, ⊕, ⊙)

Proof idea.

From QMSO(Π1

x, ⊕b, ⊙) to unamb- WA:

Exploit unambiguity to express formulas of the form Πx. ⊕

i∈I

j∈J

ϕi,j(x). From QMSO(Π1

x, ⊕, ⊙) to fin- WA:

Use disambiguation theorem presented in Klimann et all, 2004.

slide-22
SLIDE 22

Polynomial ambiguous weighted automata are also captured by QMSO

Theorem

poly- WA ≡ QMSO(ΣxΠ1

x, ⊕, ⊙)

Proof idea.

From poly- WA to QMSO(ΣxΠ1

x, ⊕, ⊙):

Exploit structural properties of the components of a poly- WA.

slide-23
SLIDE 23

Which fragment captures deterministic weighted automata?

The forward-iterator (⋅)→ and the backward-iterator (⋅)← ⟦θ→⟧(w, σ) =

n

i=1

⟦θ⟧(w[1..i], σ) ⟦θ←⟧(w, σ) =

n

i=1

⟦θ⟧(w[i..n], σ)

Over (N∞, min,+,∞, 0)

f(w) = number of prefixes of w that satisfy ϕ. (min{ ϕ + 1, ¬ϕ })→.

slide-24
SLIDE 24

Which fragment captures deterministic weighted automata?

The forward-iterator (⋅)→ and the backward-iterator (⋅)← ⟦θ→⟧(w, σ) =

n

i=1

⟦θ⟧(w[1..i], σ) ⟦θ←⟧(w, σ) =

n

i=1

⟦θ⟧(w[i..n], σ)

Theorem

DWA ≡ QMSO(→, ⊕b, ⊙) co- DWA ≡ QMSO(←, ⊕b, ⊙)

∗ the (⋅)→- and (⋅)←-operator cannot be nested.

Connection of determinization of WA with logic.

slide-25
SLIDE 25

Fragments with good decidability properties

Corollary

The following problems are decidable:

  • 1. Equivalence and containment problem of formulas in QMSO(Π1

x, ⊕b, ⊙)

  • ver (N, +, ⋅, 0, 1).
  • 2. Equivalence and containment problem of formulas in QMSO(Π1

x, ⊕, ⊙)

  • ver (N∞, min, +, ∞, 0).

QMSO(Π1

x, ⊕b, ⊙) and QMSO(Π1 x, ⊕, ⊙) are good fragments.

slide-26
SLIDE 26

QMSO and WA QMSO and subclasses of WA Beyond WA Conclusions

Outline

slide-27
SLIDE 27

How to go further from these (good) fragments?

  • 1. Additive fragment: QMSO(Σk

xΠ1 x, ⊕, ⊙b).

Theorem

For all k ∈ N: polyk- WA ≡ QMSO(Σk

xΠ1 x, ⊕, ⊙b).

  • 2. Multiplicative fragment: QMSO(Πk

x, ⊕b, ⊙).

Two-way weighted automata with nested pebbles.

slide-28
SLIDE 28

Two-way weighted automata with nested pebbles

1 3 2 In the boolean case: Two-way weighted automata with nested pebbles ≡ regular languages Different subclasses of 2WA: Two-way WA with k-nested pebbles (2WA-k). Deterministic 2WA-k (2DWA-k). Unambiguous 2WA-k (unamb- 2WA-k).

slide-29
SLIDE 29

Multiplicative fragment and two-way WA with nested pebbles

Theorem

The following classes of WA and subfragments of QMSO are equally expressive over Γ and S:

  • 1. 2DWA-0,
  • 2. unamb- 2WA-0,
  • 3. unamb- WA, and
  • 4. QMSO(Π1

x, ⊕b, ⊙).

Theorem

For every k ∈ N, there exists an effective translation between the following classes of WA and subfragments of QMSO over Γ and S:

  • 1. 2DWA-k,
  • 2. unamb- 2WA-k, and
  • 3. QMSO(Πk+1

x

, ⊕b, ⊙).

slide-30
SLIDE 30

QMSO and WA QMSO and subclasses of WA Beyond WA Conclusions

Outline

slide-31
SLIDE 31

Future work

Logic-side: Relation between (inner) boolean logic and semiring operators. Expressibility of QMSO over more general structures. Automata-side: Decidability properties of subclasses of WA motivated by QMSO. Determinization of WA.