Logics on Graph Properties and their Semantics A Survey Michele - - PowerPoint PPT Presentation

logics on graph properties and their semantics
SMART_READER_LITE
LIVE PREVIEW

Logics on Graph Properties and their Semantics A Survey Michele - - PowerPoint PPT Presentation

Logics on Graph Properties and their Semantics A Survey Michele Borassi January 30, 2014 Contents . . 1 Introduction . . 2 Basic Graph Logic . . Hybrid Graph Logic 3 . . Monadic Second-Order Logic (MSO) 4 . . Functional Logic


slide-1
SLIDE 1

Logics on Graph Properties and their Semantics

A Survey Michele Borassi January 30, 2014

slide-2
SLIDE 2

Contents

. .

1

Introduction . .

2

Basic Graph Logic . .

3

Hybrid Graph Logic . .

4

Monadic Second-Order Logic (MSO) . .

5

Functional Logic (if time allows) .

6

Conclusions

Michele Borassi 1/18

slide-3
SLIDE 3

Networks in the Real World

The collaboration network of all people who wrote an article with Erdös (source: http://www.orgnet.com/Erdos.html).

Introduction Michele Borassi 2/18

slide-4
SLIDE 4

Networks in the Real World

The yeast protein interaction network (source: http://www.bordalierinstitute.com/target1.html).

Introduction Michele Borassi 3/18

slide-5
SLIDE 5

Analyzing Networks

Some important properties and parameters: Connectivity: for each v, w, is there a path from v to w? Diameter: maximum distance between two connected vertices. Colorability: is it possible to color the graph using k colors such that no two adjacent vertices have the same color? Planarity: can we draw the graph without crossing edges? Hamiltonicity: is there a cycle touching each vertex exactly once? . Example . . . .

4

.

3

.

5

.

1

.

2

▶ Connected; ▶ Diameter=3; ▶ 3-colorable; ▶ Planar; ▶ not Hamiltonian.

Introduction Michele Borassi 4/18

slide-6
SLIDE 6

How to Check those Properties?

Diameter Hamiltonicity Planarity 3-colorability Connectivity A different algorithm for each property.

Introduction Michele Borassi 5/18

slide-7
SLIDE 7

One Algorithm to Rule Them All

  • 1. Design a logic that is able to express those properties:
  • a. syntax;
  • b. semantics.
  • 2. Design an efficient algorithm to verify queries in this logic

(model-checker).

Introduction Michele Borassi 6/18

slide-8
SLIDE 8

One Algorithm to Rule Them All

  • 1. Design a logic that is able to express those properties:
  • a. syntax;
  • b. semantics.
  • 2. Design an efficient algorithm to verify queries in this logic

(model-checker). . Example (a context where this paradigm works) . . Labeled transition systems Graphs HML (with recursion) Graph logic Expresses almost all interesting properties Not expressive enough (extensions are needed) Polynomial-time verifiable Depends on the extension

Introduction Michele Borassi 6/18

slide-9
SLIDE 9

One Algorithm to Rule Them All

  • 1. Design a logic that is able to express those properties:
  • a. syntax;
  • b. semantics.
  • 2. Design an efficient algorithm to verify queries in this logic

(model-checker). . Example (a context where this paradigm works) . . Labeled transition systems Graphs HML (with recursion) Graph logic Expresses almost all interesting properties Not expressive enough (extensions are needed) Polynomial-time verifiable Depends on the extension

Introduction Michele Borassi 6/18

slide-10
SLIDE 10

Basic Graph Logic (BGL): Syntax

Alphabet:

▶ logical symbols ∧, ¬, ⊤; ▶ symbols ♢, ♢+; ▶ countable set of propositional symbols {pi}.

. Definition ([BS09]) . . ϕ ::= p | ⊤ | ¬ϕ | ϕ ∧ ϕ | ♢ϕ | ♢+ϕ . Example . . ϕ = ♢¬p (there is a neighbor of v not satisfying p) ϕ = ♢+(p ∧ q) (a vertex reachable from v satisfies p and q).

Basic Graph Logic Michele Borassi 7/18

slide-11
SLIDE 11

BGL: Denotational Semantics

. Definition ([BS09]) . . Let f : {pi} → P(V ) be a function and v be a vertex.

▶ (V , E, f , v) |

= p ⇔ v ∈ f (p);

▶ (V , E, f , v) |

= ⊤ always;

▶ (V , E, f , v) |

= ¬ϕ ⇔ (V , E, f , v) ̸| = ϕ;

▶ (V , E, f , v) |

= ϕ∧ψ ⇔ (V , E, f , v) | = ϕ and (V , E, f , v) | = ψ;

▶ (V , E, f , v) |

= ♢ϕ ⇔ ∃wEv, w | = ϕ;

▶ (V , E, f , v) |

= ♢+ϕ ⇔ ∃wE +v, w | = ϕ; (V , E) | = ϕ if for each f : {pi} → V , v ∈ V , (V , E, f , v) | = ϕ. . Example . . (V , E) | = ♢⊤ if there is no isolated vertex. (V , E) | = (♢+p) → ♢p if it is a disjoint union of cliques.

Basic Graph Logic Michele Borassi 8/18

slide-12
SLIDE 12

BGL: Model-Checking Algorithm

Algorithm to verify if G = (V , E) satisfies ϕ at v0.

1 for each subformula ψ of ϕ in increasing order { 2

for each v ∈ V {

3

if v satisfies ψ mark v with ψ;

4

if v does not satisfy ψ mark v with ¬ψ;

5

}

6 } 7 if v0 is marked with ϕ return true; 8 if v0 is marked with ¬ϕ return true;

. Example ((V , E, f , 4) ̸| = (♢+p) → ♢p) . . . .

4

.

3

.

5p

.

1

.

2

ψ := p 0 :♢+ 1 : 2 : 3 : 4 : 5 : p

Basic Graph Logic Michele Borassi 9/18

slide-13
SLIDE 13

BGL: Model-Checking Algorithm

Algorithm to verify if G = (V , E) satisfies ϕ at v0.

1 for each subformula ψ of ϕ in increasing order { 2

for each v ∈ V {

3

if v satisfies ψ mark v with ψ;

4

if v does not satisfy ψ mark v with ¬ψ;

5

}

6 } 7 if v0 is marked with ϕ return true; 8 if v0 is marked with ¬ϕ return true;

. Example ((V , E, f , 4) ̸| = (♢+p) → ♢p) . . . .

4

.

3

.

5p

.

1

.

2

ψ := ♢+p 0 : ♢+p 1 : ♢+p 2 : ♢+p 3 : ♢+p 4 : ♢+p 5 : p, ♢+p

Basic Graph Logic Michele Borassi 9/18

slide-14
SLIDE 14

BGL: Model-Checking Algorithm

Algorithm to verify if G = (V , E) satisfies ϕ at v0.

1 for each subformula ψ of ϕ in increasing order { 2

for each v ∈ V {

3

if v satisfies ψ mark v with ψ;

4

if v does not satisfy ψ mark v with ¬ψ;

5

}

6 } 7 if v0 is marked with ϕ return true; 8 if v0 is marked with ¬ϕ return true;

. Example ((V , E, f , 4) ̸| = (♢+p) → ♢p) . . . .

4

.

3

.

5p

.

1

.

2

ψ := ♢p 0 : ♢+p, ♢p 1 : ♢+p, ♢p 2 : ♢+p 3 : ♢+p 4 : ♢+p 5 : p, ♢+p

Basic Graph Logic Michele Borassi 9/18

slide-15
SLIDE 15

BGL: Model-Checking Algorithm

Algorithm to verify if G = (V , E) satisfies ϕ at v0.

1 for each subformula ψ of ϕ in increasing order { 2

for each v ∈ V {

3

if v satisfies ψ mark v with ψ;

4

if v does not satisfy ψ mark v with ¬ψ;

5

}

6 } 7 if v0 is marked with ϕ return true; 8 if v0 is marked with ¬ϕ return true;

. Example ((V , E, f , 4) ̸| = (♢+p) → ♢p) . . . .

4

.

3

.

5p

.

1

.

2

ψ := (♢+p) → ♢p 0 : ♢+p, ♢p, ♢+p → ♢p 1 : ♢+p, ♢p, ♢+p → ♢p 2 : ♢+p 3 : ♢+p 4 : ♢+p 5 : p, ♢+p

Basic Graph Logic Michele Borassi 9/18

slide-16
SLIDE 16

Birational Equivalence

Equivalence in BGL can be tested using games. . Example (for more background see [Imm99]) . . Those graphs are equivalent? . . . Winning strategy for Spoiler ⇔ BGL-distinguishable graphs.

Basic Graph Logic Michele Borassi 10/18

slide-17
SLIDE 17

Birational Equivalence

Equivalence in BGL can be tested using games. . Example (for more background see [Imm99]) . . Spoiler chooses sets of vertices p1, . . . , pn and puts a peeble on a vertex v in one graph at its choice. . .

p1

. Winning strategy for Spoiler ⇔ BGL-distinguishable graphs.

Basic Graph Logic Michele Borassi 10/18

slide-18
SLIDE 18

Birational Equivalence

Equivalence in BGL can be tested using games. . Example (for more background see [Imm99]) . . Duplicator does the same in the other graph. . .

p1

.

p1

Winning strategy for Spoiler ⇔ BGL-distinguishable graphs.

Basic Graph Logic Michele Borassi 10/18

slide-19
SLIDE 19

Birational Equivalence

Equivalence in BGL can be tested using games. . Example (for more background see [Imm99]) . . Spoiler performs one of the following moves:

▶ move a peeble to an adjacent vertex; ▶ move a peeble to a reachable vertex;

. .

p1

.

p1

Winning strategy for Spoiler ⇔ BGL-distinguishable graphs.

Basic Graph Logic Michele Borassi 10/18

slide-20
SLIDE 20

Birational Equivalence

Equivalence in BGL can be tested using games. . Example (for more background see [Imm99]) . . Duplicator performs the same move in the other graph; . .

p1

.

p1

Winning strategy for Spoiler ⇔ BGL-distinguishable graphs.

Basic Graph Logic Michele Borassi 10/18

slide-21
SLIDE 21

Birational Equivalence

Equivalence in BGL can be tested using games. . Example (for more background see [Imm99]) . . They repeat the third and fourth move until the peebled vertices have different properties pi. If this happens, Spoiler wins. . .

p1

.

p1

Winning strategy for Spoiler ⇔ BGL-distinguishable graphs.

Basic Graph Logic Michele Borassi 10/18

slide-22
SLIDE 22

Birational Equivalence

Equivalence in BGL can be tested using games. . Example (for more background see [Imm99]) . . Another example. . . . Winning strategy for Spoiler ⇔ BGL-distinguishable graphs.

Basic Graph Logic Michele Borassi 10/18

slide-23
SLIDE 23

Birational Equivalence

Equivalence in BGL can be tested using games. . Example (for more background see [Imm99]) . . Spoiler chooses sets of vertices p1, . . . , pn and puts a peeble on a vertex v in one graph at its choice. . .

p1, p2

.

p1

.

p3

. . Winning strategy for Spoiler ⇔ BGL-distinguishable graphs.

Basic Graph Logic Michele Borassi 10/18

slide-24
SLIDE 24

Birational Equivalence

Equivalence in BGL can be tested using games. . Example (for more background see [Imm99]) . . Duplicator does the same in the other graph. . .

p1, p2

.

p1

.

p3

. .

p1, p2

.

p1

Winning strategy for Spoiler ⇔ BGL-distinguishable graphs.

Basic Graph Logic Michele Borassi 10/18

slide-25
SLIDE 25

Birational Equivalence

Equivalence in BGL can be tested using games. . Example (for more background see [Imm99]) . . Spoiler performs one of the following moves:

▶ move a peeble to an adjacent vertex; ▶ move a peeble to a reachable vertex;

. .

p1, p2

.

p1

.

p3

. .

p1, p2

.

p1

Winning strategy for Spoiler ⇔ BGL-distinguishable graphs.

Basic Graph Logic Michele Borassi 10/18

slide-26
SLIDE 26

Birational Equivalence

Equivalence in BGL can be tested using games. . Example (for more background see [Imm99]) . . Duplicator performs the same move in the other graph; . .

p1, p2

.

p1

.

p3

. .

p1, p2

.

p1

Winning strategy for Spoiler ⇔ BGL-distinguishable graphs.

Basic Graph Logic Michele Borassi 10/18

slide-27
SLIDE 27

Birational Equivalence

Equivalence in BGL can be tested using games. . Example (for more background see [Imm99]) . . They repeat the third and fourth move until the peebled vertices have different properties pi. If this happens, Spoiler wins. . .

p1, p2

.

p1

.

p3

. .

p1, p2

.

p1

Winning strategy for Spoiler ⇔ BGL-distinguishable graphs.

Basic Graph Logic Michele Borassi 10/18

slide-28
SLIDE 28

Birational Equivalence

Equivalence in BGL can be tested using games. . Example (for more background see [Imm99]) . . They repeat the third and fourth move until the peebled vertices have different properties pi. If this happens, Spoiler wins. . .

p1, p2

.

p1

.

p3

. .

p1, p2

.

p1

Winning strategy for Spoiler ⇔ BGL-distinguishable graphs.

Basic Graph Logic Michele Borassi 10/18

slide-29
SLIDE 29

Hybrid Graph Logic (HGL): Syntax

Alphabet:

▶ logical symbols ∧, ¬, ⊤; ▶ symbols ♢, ♢+, @w; ▶ countable set of propositional symbols {pi}; ▶ countable set of vertex symbols {wj}.

. Definition ([BS09]) . . ϕ ::= p | w | ⊤ | ¬ϕ | ϕ ∧ ϕ | ♢ϕ | ♢+ϕ | @wϕ . Example . . ϕ = (¬w) → (♢+w) (if v ̸= w, there is a path from v to w). ϕ = @w (¬ ♢+w) (there is no cycle passing through w).

Basic Graph Logic Michele Borassi 11/18

slide-30
SLIDE 30

HGL: Denotational Semantics

. Definition ([BS09]) . . Let f : {pi} → P(V ), g : {wi} → V be functions, and let v be a vertex.

▶ all clauses of BGL; ▶ (V , E, f , g, v) |

= w ⇔ v = w;

▶ (V , E, f , g, v) |

= @wϕ ⇔ (V , E, f , g, w) | = ϕ. (V , E) | = ϕ if for each possible f , g, v, (V , E, f , g, v) | = ϕ. . Example . . (V , E) | = (¬w) → ♢+w if it is connected. (V , E) | = @w (¬ ♢+w) if it is acyclic.

Hybrid Graph Logic Michele Borassi 12/18

slide-31
SLIDE 31

Monadic Second-Order Logic (MSO)

. Definition ([CE11]) . . ϕ ::= F(v) | E(v, w) | ¬ϕ | ϕ ∧ ϕ | ∃vϕ | ∃Fϕ . Example . . ϕ = ∃F ∀v ∀w E(v, w) → ¬(F(v) ↔ F(w)) (bipartite graph). . Theorem (folklore, for a proof see [AILS07]) . . BGL and HGL are fragments of MSO (even if recursive definitions are allowed). . Theorem ([Cou97, CE11]) . . Every query expressed in MSO can be verified in linear-time on classes of graphs of bounded treewidth.

Monadic Second-Order Logic (MSO) Michele Borassi 13/18

slide-32
SLIDE 32

Functional Logic (FL): Syntax

▶ MSO (and all its fragments) cannot express: ▶ diameter = k; ▶ there are k vertices; ▶ Hamiltonicity; ▶ k-colorability. ▶ Solution: Functional Logic.

. Definition . . The alphabet is made by a countable set of vertex variables {vi} and a countable set of function variables {Fj}. t ::= | 1 | t + t | t · t | Fj(vi) ϕ ::= vi = vi′ | t ≤ t | E(vi, vj) | ϕ ∧ ϕ | ¬ϕ | ∃viϕ | ∃Fjϕ.

▶ t: real number; ▶ ϕ: formula.

Functional Logic (if time allows) Michele Borassi 14/18

slide-33
SLIDE 33

FL: Denotational Semantics

▶ Variables evaluated according to νV : {vi} → V ; ▶ Functions evaluated according to νF : {Fi} → {f : V → R}; ▶ Terms evaluated according to νT (defined from νF).

(G, νV , νF) | = v = v′ ⇔ νV (v) = νV (v′). (G, νV , νF) | = t ≤ t′ ⇔ νT(t) ≤ νT(t′) (G, νV , νF) | = E(v, v′) ⇔ E(νV (v), νV (v′)) holds (G, νV , νF) | = ϕ ∧ ψ ⇔ (G, νV , νF) | = ϕ and (G, νV , νF) | = ψ (G, νV , νF) | = ¬ψ ⇔ (G, νV , νF) | = ϕ does not hold (G, νV , νF) | = ∃viϕ ⇔ (G, νV [v/vi], νF) | = ϕ for some v (G, νV , νF) | = ∃Fiϕ ⇔ (G, νV , νF[F/Fi]) | = ϕ for some F

Functional Logic (if time allows) Michele Borassi 15/18

slide-34
SLIDE 34

FL: Operational Semantics

▶ Important for decidability issues. ▶ If νF is restricted to N, the logic becomes undecidable.

. Example . . G graph with one vertex v. ∀F1, ∃F2, F3, prime(F2(v))∧prime(F3(v))∧2F1(v) = F2(v)+F3(v).

▶ Operational semantics ⇒ logic is decidable.

Functional Logic (if time allows) Michele Borassi 16/18

slide-35
SLIDE 35

FL: Natural Semantics

▶ Abstract machine (translator into R formulas): ▶ pair < G; ϕ >; ▶ constants 1, . . . , n to denote vertices. ▶ rules:

⟨G, t ≤ t′⟩ ⇒ t ≤ t′ ⟨G, E(k, k′)⟩ ⇒ ⊤ if E(k, k′) ⟨G, E(k, k′)⟩ ⇒⊥ if ¬E(k, k′) ⟨G; ϕ⟩ ⇒ Φ ⟨G; ψ⟩ ⇒ Ψ ⟨G; ϕ ∧ ψ⟩ ⇒ Φ ∧ Ψ ⟨G; ϕ⟩ ⇒ Φ ⟨G; ¬ϕ⟩ ⇒ ¬Φ for each k, ⟨G; ϕ[k/vi]⟩ ⇒ Φk ⟨G; ∃viϕ⟩ ⇒ ∨

k=1,...,n Φk

for each k, ⟨G; ϕ[xk /Fi (k), xvk /Fi (vk )]⟩ ⇒ Φk ⟨G; ∃Fi ϕ⟩ ⇒ ∨

k=1,...,n ∃xk Φk

Functional Logic (if time allows) Michele Borassi 17/18

slide-36
SLIDE 36

Conclusions

  • 1. Tradeoff between expressive power and model-checking

complexity.

  • 2. Polynomial-time verifiable ⇔ low expressibility.
  • 3. Logics analyzed (in order of expressive power):

▶ Basic Graph Logic; ▶ Hybrid Graph Logic; ▶ Monadic Second-Order Logic; ▶ Functional Logic.

Thank you for your attention.

Conclusions Michele Borassi 18/18

slide-37
SLIDE 37

Bibliography

[AILS07] Luca Aceto, Anna Ingolfsdottir, Kim G. Larsen, and Jiri Srba. Reactive Systems. Cambridge University Press, Cambridge, 2007. [BS09] Mario. R. F. Benevides and L. Menasché Schechter. Using modal logics to express and check global graph properties. Logic Journal of IGPL, 17(5):559--587, August 2009. [CE11] Bruno Courcelle and Joost Engelfriet. Graph Structure and Monadic Second-Order Logic, a Language Theoretic Approach. Cambridge University Press, 2011. [Cou97] Bruno Courcelle. The expression of graph properties and graph transformations in monadic second-order logic. In Handbook of graph grammars and computing by graph transformations, volume 1, chapter 5, pages 313--400. G. Rozenberg ed., New-Jersey, London, 1997. [Imm99] Neil Immerman. Descriptive Complexity. Graduate texts in computer science. Springer New York, New York, 1999.