First-order theories Gabriele Puppis LaBRI / CNRS Definition Fix a - - PowerPoint PPT Presentation

first order theories
SMART_READER_LITE
LIVE PREVIEW

First-order theories Gabriele Puppis LaBRI / CNRS Definition Fix a - - PowerPoint PPT Presentation

First-order theories Gabriele Puppis LaBRI / CNRS Definition Fix a class C of structures (e.g. graphs) and a logic L (e.g. FO). The L L L -theory of C C C is the set of all formulas in L that can be satisfied by some structure in C . The theory


slide-1
SLIDE 1

First-order theories

Gabriele Puppis

LaBRI / CNRS

slide-2
SLIDE 2

Definition

Fix a class C of structures (e.g. graphs) and a logic L (e.g. FO). The L L L-theory of C C C is the set of all formulas in L that can be satisfied by some structure in C . The theory is decidable if there is an algorithm that receives formulas as input and tells whether they are in the theory or not.

slide-3
SLIDE 3

Definition

Fix a class C of structures (e.g. graphs) and a logic L (e.g. FO). The L L L-theory of C C C is the set of all formulas in L that can be satisfied by some structure in C . The theory is decidable if there is an algorithm that receives formulas as input and tells whether they are in the theory or not.

Examples

first-order theory of the class of all graphs monadic theory of the class of all linear orders monadic theory of N monadic theory of the grid

slide-4
SLIDE 4

Undecidability of first-order theory

One cannot decide whether a given formula of FO[Σ, E1, E2] FO[Σ, E1, E2] FO[Σ, E1, E2] is satisfied over some labelled grid labelled grid labelled grid.

slide-5
SLIDE 5

Undecidability of first-order theory

One cannot decide whether a given formula of FO[Σ, E1, E2] FO[Σ, E1, E2] FO[Σ, E1, E2] is satisfied over some labelled grid labelled grid labelled grid. Given a Turing machine M, construct ψM ψM ψM defining its halting runs:

⋮ ⋮ ⋮ ⋯ ⋯ ⋯ ⋯ ⋱ qhalt qhalt qhalt

slide-6
SLIDE 6

Undecidability of first-order theory

One cannot decide whether a given formula of FO[Σ, E1, E2] FO[Σ, E1, E2] FO[Σ, E1, E2] is satisfied over some labelled grid labelled grid labelled grid. Given a Turing machine M, construct ψM ψM ψM defining its halting runs:

1

encode initial configuration by top row

⋮ ⋮ ⋮ ⋯ ⋯ ⋯ ⋯ ⋱ q0 q0 q0 ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ qhalt qhalt qhalt

slide-7
SLIDE 7

Undecidability of first-order theory

One cannot decide whether a given formula of FO[Σ, E1, E2] FO[Σ, E1, E2] FO[Σ, E1, E2] is satisfied over some labelled grid labelled grid labelled grid. Given a Turing machine M, construct ψM ψM ψM defining its halting runs:

1

encode initial configuration by top row

2

encode next configurations by next rows

⋮ ⋮ ⋮ ⋯ ⋯ ⋯ ⋯ ⋱ q0 q0 q0 ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ a a a q1 q1 q1 ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ a a a b b b q2 q2 q2 ⊔ ⊔ ⊔ a a a q3 q3 q3 b b b ⊔ ⊔ ⊔ qhalt qhalt qhalt

slide-8
SLIDE 8

Undecidability of first-order theory

One cannot decide whether a given formula of FO[Σ, E1, E2] FO[Σ, E1, E2] FO[Σ, E1, E2] is satisfied over some labelled grid labelled grid labelled grid. Given a Turing machine M, construct ψM ψM ψM defining its halting runs:

1

encode initial configuration by top row

2

encode next configurations by next rows

3

find a row with halting configuration

⋮ ⋮ ⋮ ⋯ ⋯ ⋯ ⋯ ⋱ q0 q0 q0 ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ a a a q1 q1 q1 ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ a a a b b b q2 q2 q2 ⊔ ⊔ ⊔ a a a q3 q3 q3 b b b ⊔ ⊔ ⊔ qhalt qhalt qhalt

slide-9
SLIDE 9

Undecidability of first-order theory

One cannot decide whether a given formula of FO[Σ, E1, E2] FO[Σ, E1, E2] FO[Σ, E1, E2] is satisfied over some labelled grid labelled grid labelled grid. (and equally for MSO[E1, E2] MSO[E1, E2] MSO[E1, E2] over the grid N × N N × N N × N) Given a Turing machine M, construct ψM ψM ψM defining its halting runs:

1

encode initial configuration by top row

2

encode next configurations by next rows

3

find a row with halting configuration MSO can even guess the labelling!

⋮ ⋮ ⋮ ⋯ ⋯ ⋯ ⋯ ⋱ q0 q0 q0 ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ a a a q1 q1 q1 ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ a a a b b b q2 q2 q2 ⊔ ⊔ ⊔ a a a q3 q3 q3 b b b ⊔ ⊔ ⊔ qhalt qhalt qhalt

slide-10
SLIDE 10

Undecidability of first-order theory

One cannot decide whether a given formula of FO[Σ, E1, E2] FO[Σ, E1, E2] FO[Σ, E1, E2] is satisfied over some labelled grid labelled grid labelled grid. (and equally for MSO[E1, E2] MSO[E1, E2] MSO[E1, E2] over the grid N × N N × N N × N) Given a Turing machine M, construct ψM ψM ψM defining its halting runs:

1

encode initial configuration by top row

2

encode next configurations by next rows

3

find a row with halting configuration MSO can even guess the labelling!

⋮ ⋮ ⋮ ⋯ ⋯ ⋯ ⋯ ⋱ q0 q0 q0 ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ a a a q1 q1 q1 ⊔ ⊔ ⊔ ⊔ ⊔ ⊔ a a a b b b q2 q2 q2 ⊔ ⊔ ⊔ a a a q3 q3 q3 b b b ⊔ ⊔ ⊔ qhalt qhalt qhalt

slide-11
SLIDE 11

Consequences (Church ’36, Turing ’37, Trakhtenbrot ’50, ...)

The FO theory of the class of all finite structures is undecidable (provided that signature contains a binary predicate besides =).

slide-12
SLIDE 12

Consequences (Church ’36, Turing ’37, Trakhtenbrot ’50, ...)

The FO theory of the class of all finite structures is undecidable (provided that signature contains a binary predicate besides =). The MSO theory of any class of graphs with unbounded grids as minors unbounded grids as minors unbounded grids as minors is undecidable. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮

n 4n+20

slide-13
SLIDE 13

Consequences (Church ’36, Turing ’37, Trakhtenbrot ’50, ...)

The FO theory of the class of all finite structures is undecidable (provided that signature contains a binary predicate besides =). The MSO theory of any class of graphs with unbounded grids as minors unbounded grids as minors unbounded grids as minors is undecidable. The MSO theory of (N, +) (N, +) (N, +) is undecidable. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮

n n+1 n+2 n+3 n+4 2n 2n+2 2n+4 2n+6 2n+8 3n 3n+3 3n+6 3n+9 3n+12 4n 4n+4 4n+8 4n+16 4n+20

slide-14
SLIDE 14

Definition

Presburger arithmetic is the first-order theory of (N, +) (N, +) (N, +)

Examples of Presburger formulas

ψ0 = ∃x. ∀y. (x + y = y) ϕ≤(x, y) = ∃z. (y = x + z) ϕ2×(x, y) = (x + x = y) ψω = ∀x. ∃y. (x ≤ y ∧ ¬x = y)

slide-15
SLIDE 15

Decidability of Presburger arithmetic (Presburger ’29)

One can decide if a Presburger sentence ψ holds over (N, +). Originally proved by quantifier elimination. Here we use automata!

slide-16
SLIDE 16

Decidability of Presburger arithmetic (Presburger ’29)

One can decide if a Presburger sentence ψ holds over (N, +). Originally proved by quantifier elimination. Here we use automata!

1

Encode numbers x ∈ N by reverse binary expansions [x] ∈ B⋆ [x] ∈ B⋆ [x] ∈ B⋆ e.g. [4] = 001, [0] = ε, . . .

slide-17
SLIDE 17

Decidability of Presburger arithmetic (Presburger ’29)

One can decide if a Presburger sentence ψ holds over (N, +). Originally proved by quantifier elimination. Here we use automata!

1

Encode numbers x ∈ N by reverse binary expansions [x] ∈ B⋆ [x] ∈ B⋆ [x] ∈ B⋆ e.g. [4] = 001, [0] = ε, . . .

2

Encode sum relation + ⊆ N × N × N by language L+ ⊆ (B × B × B)⋆ L+ ⊆ (B × B × B)⋆ L+ ⊆ (B × B × B)⋆ e.g. [ + (3, 1, 4)] = [3] ⊗ [1] ⊗ [4] = (

1 1 0 ) ( 1 0 ) ( 1 )

slide-18
SLIDE 18

Decidability of Presburger arithmetic (Presburger ’29)

One can decide if a Presburger sentence ψ holds over (N, +). Originally proved by quantifier elimination. Here we use automata!

1

Encode numbers x ∈ N by reverse binary expansions [x] ∈ B⋆ [x] ∈ B⋆ [x] ∈ B⋆ e.g. [4] = 001, [0] = ε, . . .

2

Encode sum relation + ⊆ N × N × N by language L+ ⊆ (B × B × B)⋆ L+ ⊆ (B × B × B)⋆ L+ ⊆ (B × B × B)⋆ e.g. [ + (3, 1, 4)] = [3] ⊗ [1] ⊗ [4] = (

1 1 0 ) ( 1 0 ) ( 1 )

A+ ∶

p q

(

0 ) , ( 1 1 ) , ( 1 1 )

(

1 0 ) , ( 1 0 ) , ( 1 1 1 )

(

1 1 0 )

(

1 )

slide-19
SLIDE 19

Decidability of Presburger arithmetic (Presburger ’29)

One can decide if a Presburger sentence ψ holds over (N, +). We inductively translate every Presburger formula ϕ(x1, ..., xm) into a finite automaton Aϕ over Σm = Bm such that L (Aϕ) = { [x1] ⊗ ⋅ ⋅ ⋅ ⊗ [xm] ∈ Σ⋆

m ∣ (N, +) ⊧ ϕ(x1, ..., xm) }

L (Aϕ) = { [x1] ⊗ ⋅ ⋅ ⋅ ⊗ [xm] ∈ Σ⋆

m ∣ (N, +) ⊧ ϕ(x1, ..., xm) }

L (Aϕ) = { [x1] ⊗ ⋅ ⋅ ⋅ ⊗ [xm] ∈ Σ⋆

m ∣ (N, +) ⊧ ϕ(x1, ..., xm) }

so as to reduce satisfiability of ϕ to emptiness of L(Aϕ).

slide-20
SLIDE 20

Decidability of Presburger arithmetic (Presburger ’29)

One can decide if a Presburger sentence ψ holds over (N, +). We inductively translate every Presburger formula ϕ(x1, ..., xm) into a finite automaton Aϕ over Σm = Bm such that L (Aϕ) = { [x1] ⊗ ⋅ ⋅ ⋅ ⊗ [xm] ∈ Σ⋆

m ∣ (N, +) ⊧ ϕ(x1, ..., xm) }

L (Aϕ) = { [x1] ⊗ ⋅ ⋅ ⋅ ⊗ [xm] ∈ Σ⋆

m ∣ (N, +) ⊧ ϕ(x1, ..., xm) }

L (Aϕ) = { [x1] ⊗ ⋅ ⋅ ⋅ ⊗ [xm] ∈ Σ⋆

m ∣ (N, +) ⊧ ϕ(x1, ..., xm) }

so as to reduce satisfiability of ϕ to emptiness of L(Aϕ). For atomic formulas x = y and +(x, y, z), use automata A= and A+

slide-21
SLIDE 21

Decidability of Presburger arithmetic (Presburger ’29)

One can decide if a Presburger sentence ψ holds over (N, +). We inductively translate every Presburger formula ϕ(x1, ..., xm) into a finite automaton Aϕ over Σm = Bm such that L (Aϕ) = { [x1] ⊗ ⋅ ⋅ ⋅ ⊗ [xm] ∈ Σ⋆

m ∣ (N, +) ⊧ ϕ(x1, ..., xm) }

L (Aϕ) = { [x1] ⊗ ⋅ ⋅ ⋅ ⊗ [xm] ∈ Σ⋆

m ∣ (N, +) ⊧ ϕ(x1, ..., xm) }

L (Aϕ) = { [x1] ⊗ ⋅ ⋅ ⋅ ⊗ [xm] ∈ Σ⋆

m ∣ (N, +) ⊧ ϕ(x1, ..., xm) }

so as to reduce satisfiability of ϕ to emptiness of L(Aϕ). For atomic formulas x = y and +(x, y, z), use automata A= and A+ For disjunction ϕ1(¯ x) ∨ ϕ2(¯ x), compute union of Aϕ1 and Aϕ2

slide-22
SLIDE 22

Decidability of Presburger arithmetic (Presburger ’29)

One can decide if a Presburger sentence ψ holds over (N, +). We inductively translate every Presburger formula ϕ(x1, ..., xm) into a finite automaton Aϕ over Σm = Bm such that L (Aϕ) = { [x1] ⊗ ⋅ ⋅ ⋅ ⊗ [xm] ∈ Σ⋆

m ∣ (N, +) ⊧ ϕ(x1, ..., xm) }

L (Aϕ) = { [x1] ⊗ ⋅ ⋅ ⋅ ⊗ [xm] ∈ Σ⋆

m ∣ (N, +) ⊧ ϕ(x1, ..., xm) }

L (Aϕ) = { [x1] ⊗ ⋅ ⋅ ⋅ ⊗ [xm] ∈ Σ⋆

m ∣ (N, +) ⊧ ϕ(x1, ..., xm) }

so as to reduce satisfiability of ϕ to emptiness of L(Aϕ). For atomic formulas x = y and +(x, y, z), use automata A= and A+ For disjunction ϕ1(¯ x) ∨ ϕ2(¯ x), compute union of Aϕ1 and Aϕ2 For negation ¬ϕ(¯ x), compute the complement of Aϕ

slide-23
SLIDE 23

Decidability of Presburger arithmetic (Presburger ’29)

One can decide if a Presburger sentence ψ holds over (N, +). We inductively translate every Presburger formula ϕ(x1, ..., xm) into a finite automaton Aϕ over Σm = Bm such that L (Aϕ) = { [x1] ⊗ ⋅ ⋅ ⋅ ⊗ [xm] ∈ Σ⋆

m ∣ (N, +) ⊧ ϕ(x1, ..., xm) }

L (Aϕ) = { [x1] ⊗ ⋅ ⋅ ⋅ ⊗ [xm] ∈ Σ⋆

m ∣ (N, +) ⊧ ϕ(x1, ..., xm) }

L (Aϕ) = { [x1] ⊗ ⋅ ⋅ ⋅ ⊗ [xm] ∈ Σ⋆

m ∣ (N, +) ⊧ ϕ(x1, ..., xm) }

so as to reduce satisfiability of ϕ to emptiness of L(Aϕ). For atomic formulas x = y and +(x, y, z), use automata A= and A+ For disjunction ϕ1(¯ x) ∨ ϕ2(¯ x), compute union of Aϕ1 and Aϕ2 For negation ¬ϕ(¯ x), compute the complement of Aϕ For existential quantification ∃y. ϕ(¯ x, y), project Aϕ from Σm+1 to Σm

(

1 1 1

×

) (

1 1 1 1 1 1

×

)

slide-24
SLIDE 24

Example of translation

Consider the (unsatisfiable) formula ψ = ∃x. ¬ ∃y. (y = x + 1) ψ = ∃x. ¬ ∃y. (y = x + 1) ψ = ∃x. ¬ ∃y. (y = x + 1)

slide-25
SLIDE 25

Example of translation

Consider the (unsatisfiable) formula ψ = ∃x. ¬ ∃y. (y = x + 1) ψ = ∃x. ¬ ∃y. (y = x + 1) ψ = ∃x. ¬ ∃y. (y = x + 1)

1

Start from automaton Ay=x+1

y=x+1 y=x+1

p q ( 1

1 1 0 )

( 0

1 1 1 )

( 0

0 ), ( 1 1 1 1 1 1 )

slide-26
SLIDE 26

Example of translation

Consider the (unsatisfiable) formula ψ = ∃x. ¬ ∃y. (y = x + 1) ψ = ∃x. ¬ ∃y. (y = x + 1) ψ = ∃x. ¬ ∃y. (y = x + 1)

1

Start from automaton Ay=x+1

y=x+1 y=x+1

2

Project away the encoding of y y y, thus capturing ∃y. (y = x + 1) ∃y. (y = x + 1) ∃y. (y = x + 1) p q ( 1

1 1

×

) ( 0

1 1 1

×

) ( 0

×

), ( 1

1 1 1 1 1

×

)

slide-27
SLIDE 27

Example of translation

Consider the (unsatisfiable) formula ψ = ∃x. ¬ ∃y. (y = x + 1) ψ = ∃x. ¬ ∃y. (y = x + 1) ψ = ∃x. ¬ ∃y. (y = x + 1)

1

Start from automaton Ay=x+1

y=x+1 y=x+1

2

Project away the encoding of y y y, thus capturing ∃y. (y = x + 1) ∃y. (y = x + 1) ∃y. (y = x + 1)

3

Complement the det. automaton, thus capturing ¬ ∃y. (y = x + 1) ¬ ∃y. (y = x + 1) ¬ ∃y. (y = x + 1) p q ( 1

1 1

×

) ( 0

1 1 1

×

) ( 0

×

), ( 1

1 1 1 1 1

×

)

slide-28
SLIDE 28

Example of translation

Consider the (unsatisfiable) formula ψ = ∃x. ¬ ∃y. (y = x + 1) ψ = ∃x. ¬ ∃y. (y = x + 1) ψ = ∃x. ¬ ∃y. (y = x + 1)

1

Start from automaton Ay=x+1

y=x+1 y=x+1

2

Project away the encoding of y y y, thus capturing ∃y. (y = x + 1) ∃y. (y = x + 1) ∃y. (y = x + 1)

3

Complement the det. automaton, thus capturing ¬ ∃y. (y = x + 1) ¬ ∃y. (y = x + 1) ¬ ∃y. (y = x + 1)

4

Project away the encoding of x x x, thus getting ∃x. ¬ ∃y. (y = x + 1) ∃x. ¬ ∃y. (y = x + 1) ∃x. ¬ ∃y. (y = x + 1) p q ( 1

1 1

× ×

) ( 0

×

1 1 1

×

) ( 0

× ×

), ( 1

1 1

×

1 1 1

×

)

slide-29
SLIDE 29

Example of translation

Consider the (unsatisfiable) formula ψ = ∃x. ¬ ∃y. (y = x + 1) ψ = ∃x. ¬ ∃y. (y = x + 1) ψ = ∃x. ¬ ∃y. (y = x + 1)

1

Start from automaton Ay=x+1

y=x+1 y=x+1

2

Project away the encoding of y y y, thus capturing ∃y. (y = x + 1) ∃y. (y = x + 1) ∃y. (y = x + 1)

3

Complement the det. automaton, thus capturing ¬ ∃y. (y = x + 1) ¬ ∃y. (y = x + 1) ¬ ∃y. (y = x + 1)

4

Project away the encoding of x x x, thus getting ∃x. ¬ ∃y. (y = x + 1) ∃x. ¬ ∃y. (y = x + 1) ∃x. ¬ ∃y. (y = x + 1) p q ( 1

1 1

× ×

) ( 0

×

1 1 1

×

) ( 0

× ×

), ( 1

1 1

×

1 1 1

×

) What’s wrong??

slide-30
SLIDE 30

Example of translation

Consider the (unsatisfiable) formula ψ = ∃x. ¬ ∃y. (y = x + 1) ψ = ∃x. ¬ ∃y. (y = x + 1) ψ = ∃x. ¬ ∃y. (y = x + 1)

1

Start from automaton Ay=x+1

y=x+1 y=x+1

2

Project away the encoding of y y y, thus capturing ∃y. (y = x + 1) ∃y. (y = x + 1) ∃y. (y = x + 1)

3

Complement the det. automaton, thus capturing ¬ ∃y. (y = x + 1) ¬ ∃y. (y = x + 1) ¬ ∃y. (y = x + 1)

4

Project away the encoding of x x x, thus getting ∃x. ¬ ∃y. (y = x + 1) ∃x. ¬ ∃y. (y = x + 1) ∃x. ¬ ∃y. (y = x + 1) p q ( 1

1 1

× ×

) ( 0

×

1 1 1

×

) ( 0

× ×

), ( 1

1 1

×

1 1 1

×

) What’s wrong?? Languages of encodings should be closed under padding with 0’s After complement, keep only final states that are stable under 0.

slide-31
SLIDE 31

The previous result can be generalized to many other structures:

Definition

An automatic structure is a structure that is isomorphic to ( L, R1, . . . , Rn ) where L is a regular language of words over Σ (each word identifies a precise element of the structure) each relation Ri has arity ki and is represented by a regular language Li over (Σ ⊎ {#})

ki

(e.g. (ab, abb) ∈ Ri iff ( a

a )( b b )( # b ) ∈ Li )

slide-32
SLIDE 32

The previous result can be generalized to many other structures:

Definition

An automatic structure is a structure that is isomorphic to ( L, R1, . . . , Rn ) where L is a regular language of words over Σ (each word identifies a precise element of the structure) each relation Ri has arity ki and is represented by a regular language Li over (Σ ⊎ {#})

ki

(e.g. (ab, abb) ∈ Ri iff ( a

a )( b b )( # b ) ∈ Li )

Examples of automatic structures

(N, +, ∣p) (N, +, ∣p) (N, +, ∣p), with x ∣p y iff x = pn divides y Binary tree with successor, ancestor, and equi-level predicates Unlabelled grid (N × N, →, ↓) (N × N, →, ↓) (N × N, →, ↓)

slide-33
SLIDE 33

Theorem (B¨ uchi ’60, Hodgson ’76, Khoussainov & Nerode ’94)

Every automatic structure has a decidable first-order theory.

slide-34
SLIDE 34

Theorem (B¨ uchi ’60, Hodgson ’76, Khoussainov & Nerode ’94)

Every automatic structure has a decidable first-order theory. On the other hand...

Theorem

Some automatic structures have an undecidable reachability problem. The transition graph transition graph transition graph of a Turing machine is automatic! configurations are encoded by words a1...ai−1 a1...ai−1 a1...ai−1 q q q ai ai+1...an ai ai+1...an ai ai+1...an transitions are of the following forms a1...ai−1 q q q ai ai aiai+1...an a1...ai−1q q q ai ai aiai+1...an a1...ai−1ai ai ai q q q ai+1...an ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ a1...ai−1q′ q′ q′a′

i

a′

i

a′

iai+1...an

a1...ai−1a′

i

a′

i

a′

iq′

q′ q′ai+1...an a1...ai−1q′ q′ q′a′

i

a′

i

a′

iai+1...an

slide-35
SLIDE 35

Next