A Coalgebraic Decision Procedure for WS1S Dmitriy Traytel Isabelle - - PowerPoint PPT Presentation

a coalgebraic decision procedure for ws1s
SMART_READER_LITE
LIVE PREVIEW

A Coalgebraic Decision Procedure for WS1S Dmitriy Traytel Isabelle - - PowerPoint PPT Presentation

A Coalgebraic Decision Procedure for WS1S Dmitriy Traytel Isabelle = A Coalgebraic Decision Procedure for WS1S Dmitriy Traytel Isabelle = Logic-Automaton Connection WS1S T | F | x X | x < y


slide-1
SLIDE 1

A Coalgebraic Decision Procedure for WS1S

Dmitriy Traytel

λ → ∀

=

Isabelle

β α

slide-2
SLIDE 2

A Coalgebraic Decision Procedure for WS1S

Dmitriy Traytel

λ → ∀

=

Isabelle

β α

slide-3
SLIDE 3

Logic-Automaton Connection

WS1S T | F | x ∈ X | x < y | ϕ∨ψ | ¬ϕ | ∃x. ϕ | ∃X. ϕ finite

slide-4
SLIDE 4

Logic-Automaton Connection

WS1S T | F | x ∈ X | x < y | ϕ∨ψ | ¬ϕ | FO x | ∃X. ϕ finite

slide-5
SLIDE 5

Logic-Automaton Connection

WS1S T | F | x ∈ X | x < y | ϕ∨ψ | ¬ϕ | FO x | ∃X. ϕ finite ∀I. I ϕ ⇐ ⇒ I ψ?

slide-6
SLIDE 6

Logic-Automaton Connection

WS1S T | F | x ∈ X | x < y | ϕ∨ψ | ¬ϕ | FO x | ∃X. ϕ finite ∀I. I ϕ ⇐ ⇒ I ψ? Finite Automata

Klarlund, Møller, et al. MONA

slide-7
SLIDE 7

Logic-Automaton Connection

WS1S T | F | x ∈ X | x < y | ϕ∨ψ | ¬ϕ | FO x | ∃X. ϕ finite ∀I. I ϕ ⇐ ⇒ I ψ? Finite Automata

Fiedor et al., TACAS 2015 dWiNA, Klarlund, Møller, et al. MONA

Finite Reachability Games

Toss Ganzow & Kaiser, CSL 2010

slide-8
SLIDE 8

Logic-Automaton Connection

WS1S ∀I. I ϕ ⇐ ⇒ I ψ? Regular Expressions L(α) = L(β)? ∀I. I ϕ ⇐ ⇒ enc I ∈ L(mkRE ϕ) Finite Automata

Fiedor et al., TACAS 2015 dWiNA, Klarlund, Møller, et al. MONA

Finite Reachability Games

Toss Ganzow & Kaiser, CSL 2010

λ → ∀

=

Isabelle

β α

  • T. & Nipkow, ICFP 2013
slide-9
SLIDE 9

Logic-Automaton Connection

WS1S ∀I. I ϕ ⇐ ⇒ I ψ?

Π-Extended Regular Expressions

L(α) = L(β)? ∀I. I ϕ ⇐ ⇒ enc I ∈ L(mkRE ϕ) Finite Automata

Fiedor et al., TACAS 2015 dWiNA, Klarlund, Møller, et al. MONA

Finite Reachability Games

Toss Ganzow & Kaiser, CSL 2010

λ → ∀

=

Isabelle

β α

  • T. & Nipkow, ICFP 2013
slide-10
SLIDE 10

Logic-Automaton Connection

WS1S ∀I. I ϕ ⇐ ⇒ I ψ?

Π-Extended Regular Expressions

L(α) = L(β)? ∀I. I ϕ ⇐ ⇒ enc I ∈ L(mkRE ϕ) Finite Automata

Fiedor et al., TACAS 2015 dWiNA, Klarlund, Møller, et al. MONA

Finite Reachability Games

Toss Ganzow & Kaiser, CSL 2010

λ → ∀

=

Isabelle

β α

  • T. & Nipkow, ICFP 2013
slide-11
SLIDE 11

a∗ ?

≡ ε+ a· a∗ for Σ = {a,b}

a∗

ε+ a· a∗

slide-12
SLIDE 12

a∗ ?

≡ ε+ a· a∗ for Σ = {a,b}

a∗

ε+ a· a∗

Brzozowski derivative d: letter → regex → regex

L(da r) = {w | aw ∈ L(r)} ε· a∗ ∅+ε· a∗

da

slide-13
SLIDE 13

a∗ ?

≡ ε+ a· a∗ for Σ = {a,b}

a∗

ε+ a· a∗ ε· a∗ ∅+ε· a∗ ∅· a∗ ∅+∅· a∗

da db

slide-14
SLIDE 14

a∗ ?

≡ ε+ a· a∗ for Σ = {a,b}

a∗

ε+ a· a∗ ε· a∗ ∅+ε· a∗ ∅· a∗ +ε· a∗ ∅+∅· a∗ +ε· a∗ ∅· a∗ ∅+∅· a∗

da da db

slide-15
SLIDE 15

a∗ ?

≡ ε+ a· a∗ for Σ = {a,b}

a∗

ε+ a· a∗ ε· a∗ ∅+ε· a∗ ∅· a∗ +ε· a∗ ∅+∅· a∗ +ε· a∗ ∅· a∗ +∅· a∗ +ε· a∗ ∅+∅· a∗ +∅· a∗ +ε· a∗ ∅· a∗ ∅+∅· a∗

da da da db

slide-16
SLIDE 16

a∗ ?

≡ ε+ a· a∗ for Σ = {a,b}

a∗

ε+ a· a∗ ε· a∗ ∅+ε· a∗ ∅· a∗ +ε· a∗ ∅+∅· a∗ +ε· a∗ ∅· a∗ +∅· a∗ +ε· a∗ ∅+∅· a∗ +∅· a∗ +ε· a∗ ∅· a∗ ∅+∅· a∗

da da da ACI db

slide-17
SLIDE 17

a∗ ?

≡ ε+ a· a∗ for Σ = {a,b}

a∗

ε+ a· a∗ ε· a∗ ∅+ε· a∗ ∅· a∗ +ε· a∗ ∅+∅· a∗ +ε· a∗ ∅· a∗ +∅· a∗ +ε· a∗ ∅+∅· a∗ +∅· a∗ +ε· a∗ ∅· a∗ ∅+∅· a∗ ∅· a∗ +∅· a∗ ∅+∅· a∗ +∅· a∗ ∅· a∗ +∅· a∗ +∅· a∗ ∅+∅· a∗ +∅· a∗ +∅· a∗

da da da ACI db db db ACI ACI da db

slide-18
SLIDE 18

Key ingredients: derivative + ε-acceptance test

  • coalgebra
slide-19
SLIDE 19

Key ingredients: derivative + ε-acceptance test

  • coalgebra
slide-20
SLIDE 20

Key ingredients: derivative + ε-acceptance test

  • coalgebra

Let’s define them on WS1S formulas directly!

slide-21
SLIDE 21

(∃X.x ∈ X)

?

≡ (¬x < x) for Σ = {(0),(1)}

∃X.x ∈ X ¬x < x ∃X.(T∨ F) ¬F ∃X.(T∨ F)∨(T∨ F) ¬F ∃X.(x ∈ X ∨ x ∈ X) ¬ x < x

d(1) d(1), d(0) ACI d(0) ACI

slide-22
SLIDE 22

(∃X.x ∈ X)

?

≡ (¬x < x) for Σ = {(0),(1)}

∃X.x ∈ X ¬x < x ∃X.(T∨ F) ¬F ∃X.(T∨ F)∨(T∨ F) ¬F ∃X.(x ∈ X ∨ x ∈ X) ¬ x < x

d(1) d(1), d(0) ACI d(0) ACI

Benefits

  • Simplicity
slide-23
SLIDE 23

(∃X.x ∈ X)

?

≡ (¬x < x) for Σ = {(0),(1)}

∃X.x ∈ X ¬x < x ∃X.(T∨ F) ¬F ∃X.(T∨ F)∨(T∨ F) ¬F ∃X.(x ∈ X ∨ x ∈ X) ¬ x < x

d(1) d(1), d(0) ACI d(0) ACI

Benefits

  • Simplicity
  • Implementation!
slide-24
SLIDE 24

(∃X.x ∈ X)

?

≡ (¬x < x) for Σ = {(0),(1)}

∃X.x ∈ X ¬x < x ∃X.(T∨ F) ¬F ∃X.(T∨ F)∨(T∨ F) ¬F ∃X.(x ∈ X ∨ x ∈ X) ¬ x < x

d(1) d(1), d(0) ACI d(0) ACI

Benefits

  • Simplicity
  • Implementation!
  • Formalization!
slide-25
SLIDE 25

(∃X.x ∈ X)

?

≡ (¬x < x) for Σ = {(0),(1)}

∃X.x ∈ X ¬x < x ∃X.(T∨ F) ¬F ∃X.(T∨ F)∨(T∨ F) ¬F ∃X.(x ∈ X ∨ x ∈ X) ¬ x < x

d(1) d(1), d(0) ACI d(0) ACI

Benefits

  • Simplicity
  • Implementation!
  • Formalization!
  • Presentation?
slide-26
SLIDE 26

(∃X.x ∈ X)

?

≡ (¬x < x) for Σ = {(0),(1)}

∃X.x ∈ X ¬x < x ∃X.(T∨ F) ¬F ∃X.(T∨ F)∨(T∨ F) ¬F ∃X.(x ∈ X ∨ x ∈ X) ¬ x < x

d(1) d(1), d(0) ACI d(0) ACI

Benefits

  • Simplicity
  • Implementation!
  • Formalization!
  • Presentation?
  • Efficiency?
slide-27
SLIDE 27

(∃X.x ∈ X)

?

≡ (¬x < x) for Σ = {(0),(1)}

∃X.x ∈ X ¬x < x ∃X.(T∨ F) ¬F ∃X.(T∨ F)∨(T∨ F) ¬F ∃X.(x ∈ X ∨ x ∈ X) ¬ x < x

d(1) d(1), d(0) ACI d(0) ACI

Benefits

  • Simplicity
  • Implementation!
  • Formalization!
  • Presentation?
  • Efficiency?
  • vs. MONA
slide-28
SLIDE 28

(∃X.x ∈ X)

?

≡ (¬x < x) for Σ = {(0),(1)}

∃X.x ∈ X ¬x < x ∃X.(T∨ F) ¬F ∃X.(T∨ F)∨(T∨ F) ¬F ∃X.(x ∈ X ∨ x ∈ X) ¬ x < x

d(1) d(1), d(0) ACI d(0) ACI

Benefits

  • Simplicity
  • Implementation!
  • Formalization!
  • Presentation?
  • Efficiency?
  • vs. MONA

→ MonaCo (Pous & T., ongoing work)

slide-29
SLIDE 29

Interlude I: Encoding of Interpretations

I =

    

X → {1, 2, 3} Y → {0, 2} Z → {3}

slide-30
SLIDE 30

Interlude I: Encoding of Interpretations

I =

    

X → {1, 2, 3} Y → {0, 2} Z → {3} X 1 1 1 Y 1 1 Z 1 enc

slide-31
SLIDE 31

Interlude I: Encoding of Interpretations

I =

    

X → {1, 2, 3} Y → {0, 2} Z → {3} X 1 1 1 Y 1 1 Z 1 enc X 1 1 1 Y 1 Z 1 tail

slide-32
SLIDE 32

Interlude I: Encoding of Interpretations

I =

    

X → {1, 2, 3} Y → {0, 2} Z → {3} X 1 1 1 Y 1 1 Z 1 enc TAIL I =

    

X → {0, 1, 2} Y → {1} Z → {2} X 1 1 1 Y 1 Z 1 tail enc

slide-33
SLIDE 33

Interlude I: Encoding of Interpretations

I =

    

X → {1, 2, 3} Y → {0, 2} Z → {3} X 1 1 1 Y 1 1 Z 1 enc TAIL I =

    

X → {0, 1, 2} Y → {1} Z → {2} X 1 1 1 Y 1 Z 1 tail enc I ϕ ⇐

⇒ TAIL I d (HEAD I) ϕ

slide-34
SLIDE 34

Interlude I: Encoding of Interpretations

I =

    

X → {1, 2, 3} Y → {0, 2} Z → {3} X 1 1 1 Y 1 1 Z 1 enc TAIL I =

    

X → {0, 1, 2} Y → {1} Z → {2} X 1 1 1 Y 1 Z 1 tail enc I ϕ ⇐

⇒ TAIL I d  

1

  ϕ

slide-35
SLIDE 35

Interlude II: First-Order Variables

Does x → {1,2,3} satisfy FO x?

slide-36
SLIDE 36

Interlude II: First-Order Variables

Does x → {1,2,3} satisfy FO x? No, only singleton sets do

slide-37
SLIDE 37

Interlude II: First-Order Variables

Does x → {1,2,3} satisfy FO x? No, only singleton sets do Yes, all non-empty sets do Minimum is the assigned value

slide-38
SLIDE 38

Interlude II: First-Order Variables

Does x → {1,2,3} satisfy FO x? No, only singleton sets do Yes, all non-empty sets do Minimum is the assigned value

→ my Ph.D. thesis draft → here (also used in MONA)

slide-39
SLIDE 39

Derivative

d : letter → formula → formula

slide-40
SLIDE 40

Derivative

d : letter → formula → formula d v T

=

T d v F

=

F

slide-41
SLIDE 41

Derivative

d : letter → formula → formula d v T

=

T d v F

=

F d v (FO x)

=

  • FO x

if ¬v[x] T

  • therwise
slide-42
SLIDE 42

Derivative

d : letter → formula → formula d v T

=

T d v F

=

F d v (FO x)

=

  • FO x

if ¬v[x] T

  • therwise

d v (x ∈ X)

=     

x ∈ X if ¬v[x] T if v[x]∧ v[X] F

  • therwise

d v (x < y)

=     

x < y if ¬v[x]∧¬v[y] FO y if v[x]∧¬v[y] F

  • therwise
slide-43
SLIDE 43

Derivative

d : letter → formula → formula d v T

=

T d v F

=

F d v (FO x)

=

  • FO x

if ¬v[x] T

  • therwise

d v (x ∈ X)

=     

x ∈ X if ¬v[x] T if v[x]∧ v[X] F

  • therwise

d v (x < y)

=     

x < y if ¬v[x]∧¬v[y] FO y if v[x]∧¬v[y] F

  • therwise

d v (ϕ∨ψ)

=

d v ϕ∨ d v ψ d v (¬ϕ)

= ¬ d v ϕ

slide-44
SLIDE 44

Derivative

d : letter → formula → formula d v T

=

T d v F

=

F d v (FO x)

=

  • FO x

if ¬v[x] T

  • therwise

d v (x ∈ X)

=     

x ∈ X if ¬v[x] T if v[x]∧ v[X] F

  • therwise

d v (x < y)

=     

x < y if ¬v[x]∧¬v[y] FO y if v[x]∧¬v[y] F

  • therwise

d v (ϕ∨ψ)

=

d v ϕ∨ d v ψ d v (¬ϕ)

= ¬ d v ϕ

d v (∃X. ϕ)

= ∃X. (d (vX→1) ϕ∨ d (vX→0) ϕ)

slide-45
SLIDE 45

Acceptance Test

ε : formula → bool

slide-46
SLIDE 46

Acceptance Test

ε : formula → bool ε T =

1

ε F = ε (FO x) = ε (x ∈ X) = ε (x < y) = ε (ϕ∨ψ) = ε ϕ∨ε ψ ε (¬ϕ) = ¬ε ϕ ε (∃X. ϕ) = ε ϕ

slide-47
SLIDE 47

Acceptance Test

ε : formula → bool ε T =

1

ε F = ε (FO x) = ε (x ∈ X) = ε (x < y) = ε (ϕ∨ψ) = ε ϕ∨ε ψ ε (¬ϕ) = ¬ε ϕ ε (∃X. ϕ) = ε ϕ

Any objections?

slide-48
SLIDE 48

Acceptance Test

ε : formula → bool ε T =

1

ε F = ε (FO x) = ε (x ∈ X) = ε (x < y) = ε (ϕ∨ψ) = ε ϕ∨ε ψ ε (¬ϕ) = ¬ε ϕ ε (∃X. ϕ) = ε ϕ

Any objections? Yes, this decides M2L(Str), not WS1S.

slide-49
SLIDE 49

Acceptance Test

ε : formula → bool ε T =

1

ε F = ε (FO x) = ε (x ∈ X) = ε (x < y) = ε (ϕ∨ψ) = ε ϕ∨ε ψ ε (¬ϕ) = ¬ε ϕ ε (∃X. ϕ) = ε ϕ

Any objections? Yes, this decides M2L(Str), not WS1S. Careful with trailing zeros!

slide-50
SLIDE 50

Trailing Zeros

ϕ

y x

  • 1
  • 1
  • x < y
slide-51
SLIDE 51

Trailing Zeros

ϕ

y x

  • 1
  • 1
  • x < y

x

[0] [1] [0] [0]

  • ∃y. x < y
slide-52
SLIDE 52

Trailing Zeros

ϕ

y x

  • 1
  • 1
  • x < y

x

[0] [1] [0] [0]

  • ∃y. x < y

[ ] [ ] [ ] [ ]

  • ∀x. ∃y. x < y
slide-53
SLIDE 53

Trailing Zeros

ϕ ε ϕ

y x

  • 1
  • 1
  • x < y

x

[0] [1] [0] [0]

  • ∃y. x < y

[ ] [ ] [ ] [ ]

  • ∀x. ∃y. x < y
slide-54
SLIDE 54

Trailing Zeros

ϕ ε ϕ

y x

  • 1
  • 1
  • x < y

x

[0] [1] [0] [0]

  • ∃y. x < y

[ ] [ ] [ ] [ ]

  • ∀x. ∃y. x < y

For WS1S: futurize formula before applying ε

slide-55
SLIDE 55

Trailing Zeros

ϕ ε ϕ

y x

  • 1
  • 1
  • x < y

x

[0] [1] [0] [0]

  • ∃y. x < y

[ ] [ ] [ ] [ ]

  • ∀x. ∃y. x < y

For WS1S: futurize formula before applying ε futurize = derive from the right by

  ···  

under quantifiers

slide-56
SLIDE 56

Trailing Zeros

ϕ ε ϕ

y x

  • 1
  • 1
  • x < y

x

[0] [1] [0] [0]

  • ∃y. x < y

[ ] [ ] [ ] [ ]

  • ∀x. ∃y. x < y

For WS1S: futurize formula before applying ε futurize = derive from the right by

  ···  

under quantifiers

→ paper

slide-57
SLIDE 57

Altogether

A decision procedure for WS1S that

slide-58
SLIDE 58

Altogether

A decision procedure for WS1S that

  • perates on formulas directly and
slide-59
SLIDE 59

Altogether

A decision procedure for WS1S that

  • perates on formulas directly and

is verified in

λ → ∀

=

Isabelle

β α

and

slide-60
SLIDE 60

Altogether

A decision procedure for WS1S that

  • perates on formulas directly and

is verified in

λ → ∀

=

Isabelle

β α

and

  • utperforms MONA on carefully selected examples.
slide-61
SLIDE 61

Altogether

A decision procedure for WS1S that

  • perates on formulas directly and

is verified in

λ → ∀

=

Isabelle

β α

and

  • utperforms MONA on carefully selected examples.
  • Thanks. Questions?
slide-62
SLIDE 62

A Coalgebraic Decision Procedure for WS1S

Dmitriy Traytel

λ → ∀

=

Isabelle

β α