the power of parameterization in coinductive proof · the power of parameterization in coinductive...

117
The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor Vafeiadis MPI-SWS POPL 2013 23 Jan 2013 1

Upload: others

Post on 24-Apr-2020

13 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

The Power of Parameterization

in Coinductive Proof

Chung-Kil Hur Microsoft Research Cambridge

Georg Neis, Derek Dreyer, Viktor Vafeiadis

MPI-SWS

POPL 2013

23 Jan 2013

1

Page 2: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Two Principles for Coinduction

• Tarski’s Fixed Point Theorem

+ Simple & Robust

- Inconvenient to use

• Syntactically Guarded Coinduction

- Complex & Fragile due to “Guardedness Checking”

+ More convenient to use

2

Page 3: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Our Contribution

• Parameterized Coinduction

+ Simple & Robust + Most convenient to use

3

Page 4: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Our Contribution

• Parameterized Coinduction

+ Simple & Robust + Most convenient to use

3

Key Idea

Semantic Guardedness

Page 5: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Previous Approaches

Tarski’s Fixed Point Theorem Syntactically Guarded Coinduction

Our Approach

Parameterized Coinduction

Talk Outline

4

Page 6: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Example of Recursively Defined Set:

Divergent Nodes in STS

5

𝑈

a b

c

f e d

g

h

Page 7: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Example of Recursively Defined Set:

Divergent Nodes in STS

5

𝑈

a b

c

f e d

Div = 𝑥 ∃𝑦. 𝑥 → 𝑦 ∧ 𝑦 ∈ Div }

g

h

Page 8: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Example of Recursively Defined Set:

Divergent Nodes in STS

5

𝑈

a b

c

f e d

Div = 𝑥 ∃𝑦. 𝑥 → 𝑦 ∧ 𝑦 ∈ Div } Div = 𝑓(Div) where

𝑓 𝑆

g

h

𝑆

Page 9: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Example of Recursively Defined Set:

Divergent Nodes in STS

5

𝑈

a b

c

f e d

Div = 𝑥 ∃𝑦. 𝑥 → 𝑦 ∧ 𝑦 ∈ Div } Div = 𝑓(Div) where

𝑓 𝑆

g

h

(Tarski’s Theorem) 𝜈𝑓 is the greatest solution of 𝑋 = 𝑓(𝑋)

For 𝑓 ∶ ℘ 𝑈 → ℘ 𝑈 , mon

𝑆

Page 10: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Example of Recursively Defined Set:

Divergent Nodes in STS

5

𝑈

a b

c

f e d

Div = 𝑥 ∃𝑦. 𝑥 → 𝑦 ∧ 𝑦 ∈ Div } Div = 𝑓(Div) where

𝑓 𝑆

g

h

(Tarski’s Theorem) 𝜈𝑓 is the greatest solution of 𝑋 = 𝑓(𝑋)

𝑆 is consistent

𝜈𝑓 = ⋃ 𝑆 𝑆 ⊆ 𝑓 𝑆 }

For 𝑓 ∶ ℘ 𝑈 → ℘ 𝑈 , mon

𝑆

Page 11: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Tarski’s Principle

6

𝑓 ∶ ℘ 𝑈 → ℘(𝑈) mon

𝑈 𝜈𝑓

(Tarski’s Principle)

𝑋 ⊆ 𝜈𝑓 𝑋

Page 12: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Tarski’s Principle

6

𝑓 ∶ ℘ 𝑈 → ℘(𝑈) mon

𝑈 𝜈𝑓

𝑆

(Tarski’s Principle)

𝑋 ⊆ 𝜈𝑓

∃ 𝑆. 𝑋 ⊆ 𝑆

𝑋

Page 13: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Tarski’s Principle

6

𝑓 ∶ ℘ 𝑈 → ℘(𝑈) mon

𝑈 𝜈𝑓

𝑆 𝑓

(Tarski’s Principle)

𝑋 ⊆ 𝜈𝑓

∃ 𝑆. 𝑋 ⊆ 𝑆 ∧ 𝑆 ⊆ 𝑓(𝑆)

𝑋

Page 14: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Tarski’s Principle

6

𝑓 ∶ ℘ 𝑈 → ℘(𝑈) mon

𝑈 𝜈𝑓

𝑆 𝑓

(Tarski’s Principle)

𝑋 ⊆ 𝜈𝑓

∃ 𝑆. 𝑋 ⊆ 𝑆 ∧ 𝑆 ⊆ 𝑓(𝑆)

𝑋

Sound by Definition: 𝜈𝑓 = ⋃ 𝑆 𝑆 ⊆ 𝑓 𝑆 }

Page 15: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Tarski Principle: Example

7

𝑈

𝜈𝑓

a b

c

f e d

g

𝑓 𝑆 = 𝑥 ∃𝑦. 𝑥 → 𝑦 ∧ 𝑦 ∈ S }

Page 16: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Tarski Principle: Example

7

𝑈

𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓 g

𝑓 𝑆 = 𝑥 ∃𝑦. 𝑥 → 𝑦 ∧ 𝑦 ∈ S }

Page 17: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Tarski Principle: Example

7

𝑈

𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓 g

𝑓 𝑆 = 𝑥 ∃𝑦. 𝑥 → 𝑦 ∧ 𝑦 ∈ S }

c ⊆ 𝑓 c = ∅

Page 18: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Tarski Principle: Example

7

𝑈

𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓

c ⊆ {c, b, d}

g

𝑓 𝑆 = 𝑥 ∃𝑦. 𝑥 → 𝑦 ∧ 𝑦 ∈ S }

Page 19: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Tarski Principle: Example

7

𝑈

𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓

c, b, d ⊆ 𝑓( c, b, d )

c ⊆ {c, b, d}

g

𝑓 𝑆 = 𝑥 ∃𝑦. 𝑥 → 𝑦 ∧ 𝑦 ∈ S }

Page 20: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Tarski Principle: Example

7

𝑈

𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓

c, b, d ⊆ 𝑓( c, b, d )

c ⊆ {c, b, d}

g

𝑓 𝑆 = 𝑥 ∃𝑦. 𝑥 → 𝑦 ∧ 𝑦 ∈ S }

Page 21: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Tarski Principle: Example

7

𝑈

𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓

c, b, d ⊆ 𝑓( c, b, d )

c ⊆ {c, b, d}

g

𝑓 𝑆 = 𝑥 ∃𝑦. 𝑥 → 𝑦 ∧ 𝑦 ∈ S }

Page 22: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Tarski Principle: Example

7

𝑈

𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓

c, b, d ⊆ 𝑓( c, b, d )

c ⊆ {c, b, d}

g

𝑓 𝑆 = 𝑥 ∃𝑦. 𝑥 → 𝑦 ∧ 𝑦 ∈ S }

Tarski’s Principle

+ Simple & Easy to Understand

- Have to Find a Consistent Set Up Front

Page 23: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Talk Outline

8

Previous Approaches

Tarski’s Fixed Point Theorem Syntactically Guarded Coinduction

Our Approach

Parameterized Coinduction

Page 24: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Syntactically Guarded Coinduction

𝑓 ∶ ℘ 𝑈 → ℘(𝑈) mon

(Guarded Coinduction)

9

𝑋 ⊆ 𝜈𝑓

Page 25: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Syntactically Guarded Coinduction

𝑓 ∶ ℘ 𝑈 → ℘(𝑈) mon

(Guarded Coinduction)

9

𝑋 ⊆ 𝜈𝑓 ⟹ 𝑋 ⊆ 𝜈𝑓

𝑋 ⊆ 𝜈𝑓

Page 26: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Syntactically Guarded Coinduction

𝑓 ∶ ℘ 𝑈 → ℘(𝑈) mon

(Guarded Coinduction)

9

𝑋 ⊆ 𝜈𝑓 ⟹ 𝑋 ⊆ 𝜈𝑓

𝑋 ⊆ 𝜈𝑓 (pf is guarded)

pf:

Page 27: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Syntactically Guarded Coinduction

𝑓 ∶ ℘ 𝑈 → ℘(𝑈) mon

(Guarded Coinduction)

• Guardedness rules out trivial proofs.

9

𝑋 ⊆ 𝜈𝑓 ⟹ 𝑋 ⊆ 𝜈𝑓

𝑋 ⊆ 𝜈𝑓 (pf is guarded)

pf:

Page 28: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Syntactically Guarded Coinduction

𝑓 ∶ ℘ 𝑈 → ℘(𝑈) mon

(Guarded Coinduction)

• Guardedness rules out trivial proofs. • Its definition is syntactic and complex.

9

𝑋 ⊆ 𝜈𝑓 ⟹ 𝑋 ⊆ 𝜈𝑓

𝑋 ⊆ 𝜈𝑓 (pf is guarded)

pf:

Page 29: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Syntactically Guarded Coinduction

𝑓 ∶ ℘ 𝑈 → ℘(𝑈) mon

(Guarded Coinduction)

• Guardedness rules out trivial proofs. • Its definition is syntactic and complex.

9

𝑋 ⊆ 𝜈𝑓 ⟹ 𝑋 ⊆ 𝜈𝑓

𝑋 ⊆ 𝜈𝑓 (pf is guarded)

pf:

• The assumption can be used only after making progress.

Page 30: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Syntactically Guarded Coinduction

𝑓 ∶ ℘ 𝑈 → ℘(𝑈) mon

(Guarded Coinduction)

• Guardedness rules out trivial proofs. • Its definition is syntactic and complex.

What cofix does in Coq

9

𝑋 ⊆ 𝜈𝑓 ⟹ 𝑋 ⊆ 𝜈𝑓

𝑋 ⊆ 𝜈𝑓 (pf is guarded)

pf:

• The assumption can be used only after making progress.

Page 31: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Syntactically Guarded Coinduction

𝑓 ∶ ℘ 𝑈 → ℘(𝑈) mon

(Guarded Coinduction)

• Guardedness rules out trivial proofs. • Its definition is syntactic and complex.

What cofix does in Coq

9

𝑋 ⊆ 𝜈𝑓 ⟹ 𝑋 ⊆ 𝜈𝑓

𝑋 ⊆ 𝜈𝑓 (pf is guarded)

pf:

Permits Incremental Reasoning

• The assumption can be used only after making progress.

Page 32: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example: Guarded Coinduction

10

𝑈 𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓

g

Page 33: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example: Guarded Coinduction

10

𝑈 𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓

{c} ⊆ 𝑓(𝜈𝑓) g

Page 34: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example: Guarded Coinduction

10

𝑈 𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓

{c} ⊆ 𝑓(𝜈𝑓) ∃𝑦. c → 𝑦 ∧ 𝑦 ∈ 𝜈𝑓 g

Page 35: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example: Guarded Coinduction

10

𝑈 𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓

{c} ⊆ 𝑓(𝜈𝑓) ∃𝑦. c → 𝑦 ∧ 𝑦 ∈ 𝜈𝑓 g

Page 36: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example: Guarded Coinduction

10

𝑈 𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓

{c} ⊆ 𝑓(𝜈𝑓) ∃𝑦. c → 𝑦 ∧ 𝑦 ∈ 𝜈𝑓 b ∈ 𝜈𝑓 g

Page 37: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example: Guarded Coinduction

10

𝑈 𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓

{c} ⊆ 𝑓(𝜈𝑓)

{b} ⊆ 𝜈𝑓

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ 𝜈𝑓 b ∈ 𝜈𝑓 g

Page 38: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example: Guarded Coinduction

10

𝑈 𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓

{c} ⊆ 𝑓(𝜈𝑓)

{b} ⊆ 𝜈𝑓

b ⊆ 𝜈𝑓 ⇒ {b} ⊆ 𝜈𝑓

By Guarded Coinduction

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ 𝜈𝑓 b ∈ 𝜈𝑓 g

Page 39: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example: Guarded Coinduction

10

𝑈 𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓

{c} ⊆ 𝑓(𝜈𝑓)

{b} ⊆ 𝜈𝑓

b ⊆ 𝜈𝑓 ⇒ {b} ⊆ 𝜈𝑓

By Guarded Coinduction

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ 𝜈𝑓 b ∈ 𝜈𝑓 g

Page 40: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example: Guarded Coinduction

10

𝑈 𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓

{c} ⊆ 𝑓(𝜈𝑓)

{b} ⊆ 𝜈𝑓

b ⊆ 𝜈𝑓 ⇒ {b} ⊆ 𝜈𝑓

By Guarded Coinduction

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ 𝜈𝑓 b ∈ 𝜈𝑓 g

Trivial Proof is NOT Guarded

Page 41: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example: Guarded Coinduction

10

𝑈 𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓

{c} ⊆ 𝑓(𝜈𝑓)

{b} ⊆ 𝜈𝑓

b ⊆ 𝜈𝑓 ⇒ {b} ⊆ 𝜈𝑓

By Guarded Coinduction

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ 𝜈𝑓 b ∈ 𝜈𝑓 g

Page 42: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example: Guarded Coinduction

10

𝑈 𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓

{c} ⊆ 𝑓(𝜈𝑓)

{b} ⊆ 𝜈𝑓

b ⊆ 𝜈𝑓 ⇒ {d} ⊆ 𝜈𝑓

b ⊆ 𝜈𝑓 ⇒ {b} ⊆ 𝜈𝑓

By Guarded Coinduction

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ 𝜈𝑓 b ∈ 𝜈𝑓 g

Page 43: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example: Guarded Coinduction

10

𝑈 𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓

{c} ⊆ 𝑓(𝜈𝑓)

{b} ⊆ 𝜈𝑓

b ⊆ 𝜈𝑓 ⇒ {d} ⊆ 𝜈𝑓

b ⊆ 𝜈𝑓 ⇒ {b} ⊆ 𝜈𝑓

By Guarded Coinduction

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ 𝜈𝑓 b ∈ 𝜈𝑓 g

Page 44: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example: Guarded Coinduction

10

𝑈 𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓

{c} ⊆ 𝑓(𝜈𝑓)

{b} ⊆ 𝜈𝑓

b ⊆ 𝜈𝑓 ⇒ {d} ⊆ 𝜈𝑓

b ⊆ 𝜈𝑓 ⇒ {b} ⊆ 𝜈𝑓

b ⊆ 𝜈𝑓 ⇒ {b} ⊆ 𝜈𝑓

By Guarded Coinduction

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ 𝜈𝑓 b ∈ 𝜈𝑓 g

Page 45: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example: Guarded Coinduction

10

𝑈 𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓

{c} ⊆ 𝑓(𝜈𝑓)

{b} ⊆ 𝜈𝑓

b ⊆ 𝜈𝑓 ⇒ {d} ⊆ 𝜈𝑓

b ⊆ 𝜈𝑓 ⇒ {b} ⊆ 𝜈𝑓

b ⊆ 𝜈𝑓 ⇒ {b} ⊆ 𝜈𝑓

By Guarded Coinduction

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ 𝜈𝑓 b ∈ 𝜈𝑓 g

This Proof is Guarded

Page 46: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example: Guarded Coinduction

10

𝑈 𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓

{c} ⊆ 𝑓(𝜈𝑓)

{b} ⊆ 𝜈𝑓

b ⊆ 𝜈𝑓 ⇒ {d} ⊆ 𝜈𝑓

b ⊆ 𝜈𝑓 ⇒ {b} ⊆ 𝜈𝑓

b ⊆ 𝜈𝑓 ⇒ {b} ⊆ 𝜈𝑓

By Guarded Coinduction

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ 𝜈𝑓 b ∈ 𝜈𝑓 g

This Proof is Guarded

Page 47: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example: Guarded Coinduction

10

𝑈 𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓

{c} ⊆ 𝑓(𝜈𝑓)

{b} ⊆ 𝜈𝑓

b ⊆ 𝜈𝑓 ⇒ {d} ⊆ 𝜈𝑓

b ⊆ 𝜈𝑓 ⇒ {b} ⊆ 𝜈𝑓

b ⊆ 𝜈𝑓 ⇒ {b} ⊆ 𝜈𝑓

By Guarded Coinduction

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ 𝜈𝑓 b ∈ 𝜈𝑓 g

This Proof is Guarded

Prove Incrementally with NO Consistent Set Up Front

Page 48: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Example: Simulation between Programs

11

Page 49: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Example: Simulation between Programs

11

Page 50: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Proof using Tarski’s Principle

12

Page 51: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Proof using Tarski’s Principle

12

Page 52: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Proof using Guarded Coinduction

13

Page 53: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Proof using Guarded Coinduction

13

Thanks to Incremental Proof + Simple Automation

Page 54: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Proof using Guarded Coinduction

13

Thanks to Incremental Proof + Simple Automation BUT!!!

Page 55: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Problems with

Syntactic Guardedness

14

Page 56: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Problems with

Syntactic Guardedness

14

Page 57: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Problems with

Syntactic Guardedness

14

Page 58: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Problems with

Syntactic Guardedness

14

Page 59: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Problems with

Syntactic Guardedness

14

Page 60: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Problems with

Syntactic Guardedness

14

The proof is NOT Syntactically Guarded

Page 61: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Problems with

Syntactic Guardedness

14

Guardedness NOT Expressed in the Logic

1. Far from complete 2. Bad interaction with automation 3. Hard to debug 4. Slow

Page 62: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Problems with

Syntactic Guardedness

14

Guardedness NOT Expressed in the Logic

1. Far from complete 2. Bad interaction with automation 3. Hard to debug 4. Slow

Page 63: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Summary:

Pros and Cons of Two Principles

• Tarski’s Fixed Point Theorem

+ Simple & Robust

- Inconvenient to use

• Syntactically Guarded Coinduction

- Complex & Fragile due to “Guardedness Checking”

+ More Convenient to use

15

Page 64: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Talk Outline

16

Previous Approaches

Tarski’s Fixed Point Theorem Syntactically Guarded Coinduction

Our Approach

Parameterized Coinduction

Page 65: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Syntactically Guarded Coinduction

17

Syntactically Guarded Coinduction

𝑓 ∶ ℘ 𝑈 → ℘(𝑈) mon

𝑋 ⊆ 𝜈𝑓 𝑋 ⊆ 𝜈𝑓

𝑋 ⊆ 𝜈𝑓 (pf is guarded)

pf: ⟹

Page 66: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Syntactically Guarded Coinduction

17

Syntactically Guarded Coinduction

𝑓 ∶ ℘ 𝑈 → ℘(𝑈) mon

𝑋 ⊆ 𝜈𝑓 𝑋 ⊆ 𝜈𝑓

𝑋 ⊆ 𝜈𝑓

G ⟹

Semantically

Semantically

Guardedness Expressed Directly Within the Logic

Page 67: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Guarded Implication

18

𝑌 ⊆ 𝜈𝑓 𝑋 ⊆ 𝜈𝑓 ⟹ G

Page 68: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Guarded Implication

18

𝑌 ⊆ 𝜈𝑓 𝑋 ⊆ 𝜈𝑓 ⟹ G

Do NOT want to EXTEND the logic

Page 69: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Guarded Implication

18

𝑌 ⊆ 𝜈𝑓 𝑋 ⊆ 𝜈𝑓 ⟹ G

𝑋 ⊆ G𝑓(𝑌)

Do NOT want to EXTEND the logic

Instead, Define G𝑓

Called “Parameterized Greatest Fixed Point” of 𝑓

Page 70: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Guarded Implication

18

𝑌 ⊆ 𝜈𝑓 𝑋 ⊆ 𝜈𝑓 ⟹ G

𝑋 ⊆ G𝑓(𝑌)

Do NOT want to EXTEND the logic

Instead, Define G𝑓

Called “Parameterized Greatest Fixed Point” of 𝑓

Greatest Fixed Point of 𝑓 Under Guarded Assumption of 𝑌 ⊆ 𝜈𝑓

Page 71: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Guarded Implication

18

𝑌 ⊆ 𝜈𝑓 𝑋 ⊆ 𝜈𝑓 ⟹ G

𝑋 ⊆ G𝑓(𝑌)

G𝑓 𝑌 ≝ 𝜈(𝜆𝑆. 𝑓(𝑌 ∪ 𝑆))

Do NOT want to EXTEND the logic

Instead, Define G𝑓

Called “Parameterized Greatest Fixed Point” of 𝑓

Greatest Fixed Point of 𝑓 Under Guarded Assumption of 𝑌 ⊆ 𝜈𝑓

Page 72: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Properties of 𝐆𝒇

19

(Unfolding) G𝑓 𝑌 = 𝑓(𝑌 ∪ G𝑓 𝑌 )

(Semantically Guarded Coinduction) 𝑋 ⊆ G𝑓 𝑌 ⟺ 𝑋 ⊆ G𝑓(𝑋 ∪ 𝑌)

(Init) G𝑓 ∅ = 𝜈𝑓

Page 73: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Properties of 𝐆𝒇

19

(Unfolding) G𝑓 𝑌 = 𝑓(𝑌 ∪ G𝑓 𝑌 )

(Semantically Guarded Coinduction) 𝑋 ⊆ G𝑓 𝑌 ⟺ 𝑋 ⊆ G𝑓(𝑋 ∪ 𝑌)

(Init) G𝑓 ∅ = 𝜈𝑓

Page 74: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Properties of 𝐆𝒇

19

(Unfolding) G𝑓 𝑌 = 𝑓(𝑌 ∪ G𝑓 𝑌 )

(Semantically Guarded Coinduction) 𝑋 ⊆ G𝑓 𝑌 ⟺ 𝑋 ⊆ G𝑓(𝑋 ∪ 𝑌)

(Init) G𝑓 ∅ = 𝜈𝑓

Page 75: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Properties of 𝐆𝒇

19

(Unfolding) G𝑓 𝑌 = 𝑓(𝑌 ∪ G𝑓 𝑌 )

(Semantically Guarded Coinduction) 𝑋 ⊆ G𝑓 𝑌 ⟺ 𝑋 ⊆ G𝑓(𝑋 ∪ 𝑌)

(Init) G𝑓 ∅ = 𝜈𝑓

Page 76: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Properties of 𝐆𝒇

19

(Unfolding) G𝑓 𝑌 = 𝑓(𝑌 ∪ G𝑓 𝑌 )

(Semantically Guarded Coinduction) 𝑋 ⊆ G𝑓 𝑌 ⟺ 𝑋 ⊆ G𝑓(𝑋 ∪ 𝑌)

(Init) G𝑓 ∅ = 𝜈𝑓

Page 77: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example:

Parameterized Coinduction

20

𝑈 𝜈𝑓

a b

c

f e d

{c} ⊆ 𝜈𝑓

g

Page 78: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example:

Parameterized Coinduction

20

𝑈 𝜈𝑓

a b

c

f e d

{c} ⊆ G𝑓(∅)

g

Page 79: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example:

Parameterized Coinduction

20

𝑈 𝜈𝑓

a b

c

f e d

{c} ⊆ 𝑓(∅ ∪ G𝑓(∅))

{c} ⊆ G𝑓(∅)

g

Page 80: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example:

Parameterized Coinduction

20

𝑈 𝜈𝑓

a b

c

f e d

{c} ⊆ G𝑓(∅)

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ (∅ ∪ G𝑓(∅))

g

Page 81: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example:

Parameterized Coinduction

20

𝑈 𝜈𝑓

a b

c

f e d

{c} ⊆ G𝑓(∅)

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ (∅ ∪ G𝑓(∅))

g

Page 82: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example:

Parameterized Coinduction

20

𝑈 𝜈𝑓

a b

c

f e d

{c} ⊆ G𝑓(∅)

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ (∅ ∪ G𝑓(∅)) b ∈ (∅ ∪ G𝑓(∅))

g

Page 83: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example:

Parameterized Coinduction

20

𝑈 𝜈𝑓

a b

c

f e d

{b} ⊆ G𝑓(∅)

{c} ⊆ G𝑓(∅)

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ (∅ ∪ G𝑓(∅)) b ∈ (∅ ∪ G𝑓(∅))

g

Page 84: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example:

Parameterized Coinduction

20

𝑈 𝜈𝑓

a b

c

f e d

{b} ⊆ G𝑓(∅)

{b} ⊆ G𝑓({b})

By Semantically Guarded Coinduction

{c} ⊆ G𝑓(∅)

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ (∅ ∪ G𝑓(∅)) b ∈ (∅ ∪ G𝑓(∅))

g

Page 85: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example:

Parameterized Coinduction

20

𝑈 𝜈𝑓

a b

c

f e d

{b} ⊆ G𝑓(∅)

{b} ⊆ G𝑓({b})

By Semantically Guarded Coinduction

{c} ⊆ G𝑓(∅)

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ (∅ ∪ G𝑓(∅)) b ∈ (∅ ∪ G𝑓(∅))

g

Page 86: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example:

Parameterized Coinduction

20

𝑈 𝜈𝑓

a b

c

f e d

{b} ⊆ G𝑓(∅)

{b} ⊆ G𝑓({b})

By Semantically Guarded Coinduction

{c} ⊆ G𝑓(∅)

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ (∅ ∪ G𝑓(∅)) b ∈ (∅ ∪ G𝑓(∅))

g

NO Trivial Proof

Page 87: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example:

Parameterized Coinduction

20

𝑈 𝜈𝑓

a b

c

f e d

{b} ⊆ G𝑓(∅)

{b} ⊆ G𝑓({b})

By Semantically Guarded Coinduction

{c} ⊆ G𝑓(∅)

{b} ⊆ 𝑓({b} ∪ G𝑓({b}))

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ (∅ ∪ G𝑓(∅)) b ∈ (∅ ∪ G𝑓(∅))

g

Page 88: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example:

Parameterized Coinduction

20

𝑈 𝜈𝑓

a b

c

f e d

{b} ⊆ G𝑓(∅)

{b} ⊆ G𝑓({b})

By Semantically Guarded Coinduction

{c} ⊆ G𝑓(∅)

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ (∅ ∪ G𝑓(∅))

∃𝑦. b → 𝑦 ∧ 𝑦 ∈ ({b} ∪ G𝑓({b}))

b ∈ (∅ ∪ G𝑓(∅))

g

Page 89: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example:

Parameterized Coinduction

20

𝑈 𝜈𝑓

a b

c

f e d

{b} ⊆ G𝑓(∅)

{b} ⊆ G𝑓({b})

By Semantically Guarded Coinduction

{c} ⊆ G𝑓(∅)

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ (∅ ∪ G𝑓(∅))

∃𝑦. b → 𝑦 ∧ 𝑦 ∈ ({b} ∪ G𝑓({b}))

b ∈ (∅ ∪ G𝑓(∅))

g

Page 90: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example:

Parameterized Coinduction

20

𝑈 𝜈𝑓

a b

c

f e d

{b} ⊆ G𝑓(∅)

{b} ⊆ G𝑓({b})

By Semantically Guarded Coinduction

{c} ⊆ G𝑓(∅)

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ (∅ ∪ G𝑓(∅)) b ∈ (∅ ∪ G𝑓(∅))

d ∈ ({b} ∪ G𝑓({b}))

g

Page 91: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example:

Parameterized Coinduction

20

𝑈 𝜈𝑓

a b

c

f e d

{b} ⊆ G𝑓(∅)

{d} ⊆ G𝑓( b )

{b} ⊆ G𝑓({b})

By Semantically Guarded Coinduction

{c} ⊆ G𝑓(∅)

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ (∅ ∪ G𝑓(∅)) b ∈ (∅ ∪ G𝑓(∅))

d ∈ ({b} ∪ G𝑓({b}))

g

Page 92: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example:

Parameterized Coinduction

20

𝑈 𝜈𝑓

a b

c

f e d

{b} ⊆ G𝑓(∅)

{d} ⊆ G𝑓( b )

{b} ⊆ G𝑓({b})

By Semantically Guarded Coinduction

{c} ⊆ G𝑓(∅)

{d} ⊆ 𝑓({b} ∪ G𝑓({b}))

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ (∅ ∪ G𝑓(∅)) b ∈ (∅ ∪ G𝑓(∅))

d ∈ ({b} ∪ G𝑓({b}))

g

Page 93: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example:

Parameterized Coinduction

20

𝑈 𝜈𝑓

a b

c

f e d

{b} ⊆ G𝑓(∅)

{d} ⊆ G𝑓( b )

{b} ⊆ G𝑓({b})

By Semantically Guarded Coinduction

{c} ⊆ G𝑓(∅)

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ (∅ ∪ G𝑓(∅))

∃𝑦. d → 𝑦 ∧ 𝑦 ∈ ({b} ∪ G𝑓({b}))

b ∈ (∅ ∪ G𝑓(∅))

d ∈ ({b} ∪ G𝑓({b}))

g

Page 94: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example:

Parameterized Coinduction

20

𝑈 𝜈𝑓

a b

c

f e d

{b} ⊆ G𝑓(∅)

{d} ⊆ G𝑓( b )

{b} ⊆ G𝑓({b})

By Semantically Guarded Coinduction

{c} ⊆ G𝑓(∅)

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ (∅ ∪ G𝑓(∅))

∃𝑦. d → 𝑦 ∧ 𝑦 ∈ ({b} ∪ G𝑓({b}))

b ∈ (∅ ∪ G𝑓(∅))

d ∈ ({b} ∪ G𝑓({b}))

g

Page 95: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example:

Parameterized Coinduction

20

𝑈 𝜈𝑓

a b

c

f e d

{b} ⊆ G𝑓(∅)

{d} ⊆ G𝑓( b )

{b} ⊆ G𝑓({b})

By Semantically Guarded Coinduction

{c} ⊆ G𝑓(∅)

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ (∅ ∪ G𝑓(∅)) b ∈ (∅ ∪ G𝑓(∅))

d ∈ ({b} ∪ G𝑓({b}))

b ∈ ({b} ∪ G𝑓({b}))

g

Page 96: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example:

Parameterized Coinduction

20

𝑈 𝜈𝑓

a b

c

f e d

{b} ⊆ G𝑓(∅)

{d} ⊆ G𝑓( b )

{b} ⊆ G𝑓({b})

By Semantically Guarded Coinduction

{c} ⊆ G𝑓(∅)

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ (∅ ∪ G𝑓(∅)) b ∈ (∅ ∪ G𝑓(∅))

d ∈ ({b} ∪ G𝑓({b}))

b ∈ ({b} ∪ G𝑓({b}))

g

Page 97: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

h

Example:

Parameterized Coinduction

20

𝑈 𝜈𝑓

a b

c

f e d

{b} ⊆ G𝑓(∅)

{d} ⊆ G𝑓( b )

{b} ⊆ G𝑓({b})

By Semantically Guarded Coinduction

{c} ⊆ G𝑓(∅)

∃𝑦. c → 𝑦 ∧ 𝑦 ∈ (∅ ∪ G𝑓(∅)) b ∈ (∅ ∪ G𝑓(∅))

d ∈ ({b} ∪ G𝑓({b}))

b ∈ ({b} ∪ G𝑓({b}))

g

NO Guardedness Checking!

Page 98: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Paco: A Coq Library for

Parameterized Coinduction

http://plv.mpi-sws.org/paco/

21

Syntactic Guardedness Semantic Guardedness

Page 99: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Paco: A Coq Library for

Parameterized Coinduction

http://plv.mpi-sws.org/paco/

21

Syntactic Guardedness Semantic Guardedness

Page 100: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Paco: A Coq Library for

Parameterized Coinduction

http://plv.mpi-sws.org/paco/

21

Guardedness Checking NOT Needed!

Syntactic Guardedness Semantic Guardedness Guardedness Checking Needed!

Page 101: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

22

Failed Proof using

Syntactically Guarded Coinduction

Page 102: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

22

Successful Proof using

Semantically Guarded Coinduction

Page 103: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

22

Successful Proof using

Semantically Guarded Coinduction

Page 104: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

22

Successful Proof using

Semantically Guarded Coinduction

Possible because of NO Syntactic Guardedness Checking

Page 105: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Syntactic Guardedness is

NOT Compositional

23

𝑋 ⊆ 𝜈𝑓

Page 106: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Syntactic Guardedness is

NOT Compositional

23

𝑌 ⊆ 𝜈𝑓 ⇒ 𝑋 ⊆ 𝜈𝑓

𝑋 ⊆ 𝜈𝑓

𝑋 ⊆ 𝜈𝑓 ⇒ 𝑌 ⊆ 𝜈𝑓

Page 107: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Syntactic Guardedness is

NOT Compositional

23

𝑌 ⊆ 𝜈𝑓 ⇒ 𝑋 ⊆ 𝜈𝑓

𝑋 ⊆ 𝜈𝑓

𝑋 ⊆ 𝜈𝑓 ⇒ 𝑌 ⊆ 𝜈𝑓

pf2:

pf1: (pf1is guarded)

(pf2is guarded)

Page 108: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Syntactic Guardedness is

NOT Compositional

23

𝑌 ⊆ 𝜈𝑓 ⇒ 𝑋 ⊆ 𝜈𝑓

𝑋 ⊆ 𝜈𝑓

𝑋 ⊆ 𝜈𝑓 ⇒ 𝑌 ⊆ 𝜈𝑓

pf2:

pf1: (pf1is guarded)

(pf2is guarded)

Not Expressible in the logic

Page 109: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Syntactic Guardedness is

NOT Compositional

23

𝑌 ⊆ 𝜈𝑓 ⇒ 𝑋 ⊆ 𝜈𝑓

𝑋 ⊆ 𝜈𝑓

𝑋 ⊆ 𝜈𝑓 ⇒ 𝑌 ⊆ 𝜈𝑓

pf2:

pf1:

Make Proofs Transparent

Page 110: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Syntactic Guardedness is

NOT Compositional

23

𝑌 ⊆ 𝜈𝑓 ⇒ 𝑋 ⊆ 𝜈𝑓

𝑋 ⊆ 𝜈𝑓

𝑋 ⊆ 𝜈𝑓 ⇒ 𝑌 ⊆ 𝜈𝑓

pf2:

pf1:

Make Proofs Transparent

𝑋 ⊆ 𝜈𝑓 ⇒ 𝑋 ⊆ 𝜈𝑓 pf2 ∘ pf1:

Page 111: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Syntactic Guardedness is

NOT Compositional

23

𝑌 ⊆ 𝜈𝑓 ⇒ 𝑋 ⊆ 𝜈𝑓

𝑋 ⊆ 𝜈𝑓

𝑋 ⊆ 𝜈𝑓 ⇒ 𝑌 ⊆ 𝜈𝑓

(pf2 ∘ pf1 is guarded)

pf2:

pf1:

Make Proofs Transparent

𝑋 ⊆ 𝜈𝑓 ⇒ 𝑋 ⊆ 𝜈𝑓 pf2 ∘ pf1:

Page 112: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Syntactic Guardedness is

NOT Compositional

23

𝑌 ⊆ 𝜈𝑓 ⇒ 𝑋 ⊆ 𝜈𝑓

𝑋 ⊆ 𝜈𝑓

𝑋 ⊆ 𝜈𝑓 ⇒ 𝑌 ⊆ 𝜈𝑓

(pf2 ∘ pf1 is guarded)

pf2:

pf1:

Make Proofs Transparent

𝑋 ⊆ 𝜈𝑓 ⇒ 𝑋 ⊆ 𝜈𝑓 pf2 ∘ pf1:

Two Problems with Transparent Proofs 1. Slowdown 2. NO Abstraction

Page 113: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Semantic Guardedness is

Compositional

24

𝑋 ⊆ G𝑓(𝑌)

𝑋 ⊆ G𝑓(∅)

𝑌 ⊆ G𝑓(𝑋)

Page 114: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Semantic Guardedness is

Compositional

24

𝑋 ⊆ G𝑓(𝑌)

𝑋 ⊆ G𝑓(∅)

𝑌 ⊆ G𝑓(𝑋)

Possible because Guardedness can be expressed in the Logic!

Page 115: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Problems with

Syntactic Guardedness

25

1. Non-Compositional

2. Far from complete

3. Bad interaction with automation

4. Hard to debug

5. Slow

Page 116: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Problems with

Syntactic Guardedness

25

1. Non-Compositional

2. Far from complete

3. Bad interaction with automation

4. Hard to debug

5. Slow

Semantic

Page 117: The Power of Parameterization in Coinductive Proof · The Power of Parameterization in Coinductive Proof Chung-Kil Hur Microsoft Research Cambridge Georg Neis, Derek Dreyer, Viktor

Related Work • Glynn Winskel (1989) • Lawrence Moss (2001)

Combination with Up-To Techniques

Mechanization in Coq

− Using Mendler-style recursion

What else is in the paper?

26