Pattern covering by set approximations Nicolas Oury Laboratoire de - - PowerPoint PPT Presentation

pattern covering by set approximations
SMART_READER_LITE
LIVE PREVIEW

Pattern covering by set approximations Nicolas Oury Laboratoire de - - PowerPoint PPT Presentation

Outline Pattern covering by set approximations Nicolas Oury Laboratoire de Recherche en Informatique Universit e ParisSud, France TYPES, 2006 Nicolas Oury Pattern covering by set approximations Outline Outline Introduction 1 The


slide-1
SLIDE 1

Outline

Pattern covering by set approximations

Nicolas Oury

Laboratoire de Recherche en Informatique Universit´ e Paris–Sud, France

TYPES, 2006

Nicolas Oury Pattern covering by set approximations

slide-2
SLIDE 2

Outline

Outline

1

Introduction The Calculus of Inductive Constructions Inductive data types Definitions by pattern matching Useless cases in a pattern matching

2

Elimination of useless cases Undecidability Splitting

3

Approximations of inductive sets Set computations Examples Prototype Refutations reconstruction

4

Conclusions

Nicolas Oury Pattern covering by set approximations

slide-3
SLIDE 3

Introduction Elimination of useless cases Approximations of inductive sets Conclusions The Calculus of Inductive Constructions Inductive data types Definitions by pattern matching Useless cases in a pattern matching

Outline

1

Introduction The Calculus of Inductive Constructions Inductive data types Definitions by pattern matching Useless cases in a pattern matching

2

Elimination of useless cases Undecidability Splitting

3

Approximations of inductive sets Set computations Examples Prototype Refutations reconstruction

4

Conclusions

Nicolas Oury Pattern covering by set approximations

slide-4
SLIDE 4

Introduction Elimination of useless cases Approximations of inductive sets Conclusions The Calculus of Inductive Constructions Inductive data types Definitions by pattern matching Useless cases in a pattern matching

The Calculus of Inductive Constructions

Proof theory used in the Coq proof assistant Proving is typing a proof term Dependent inductive data types: list n . . .

Nicolas Oury Pattern covering by set approximations

slide-5
SLIDE 5

Introduction Elimination of useless cases Approximations of inductive sets Conclusions The Calculus of Inductive Constructions Inductive data types Definitions by pattern matching Useless cases in a pattern matching

The Calculus of Inductive Constructions

Proof theory used in the Coq proof assistant Proving is typing a proof term Dependent inductive data types: list n . . .

Nicolas Oury Pattern covering by set approximations

slide-6
SLIDE 6

Introduction Elimination of useless cases Approximations of inductive sets Conclusions The Calculus of Inductive Constructions Inductive data types Definitions by pattern matching Useless cases in a pattern matching

Inductive data types

Types defined by different constructors : nat = O : nat S : nat → nat Values are constructed inductively: O, S O, S (S O), . . . Elements are finite: x = S x is forbidden Dependent types: list _ = nil : list O cons : A → list n → list (S n)

Nicolas Oury Pattern covering by set approximations

slide-7
SLIDE 7

Introduction Elimination of useless cases Approximations of inductive sets Conclusions The Calculus of Inductive Constructions Inductive data types Definitions by pattern matching Useless cases in a pattern matching

Inductive data types

Types defined by different constructors : nat = O : nat S : nat → nat Values are constructed inductively: O, S O, S (S O), . . . Elements are finite: x = S x is forbidden Dependent types: list _ = nil : list O cons : A → list n → list (S n)

Nicolas Oury Pattern covering by set approximations

slide-8
SLIDE 8

Introduction Elimination of useless cases Approximations of inductive sets Conclusions The Calculus of Inductive Constructions Inductive data types Definitions by pattern matching Useless cases in a pattern matching

Inductive data types

Types defined by different constructors : nat = O : nat S : nat → nat Values are constructed inductively: O, S O, S (S O), . . . Elements are finite: x = S x is forbidden Dependent types: list _ = nil : list O cons : A → list n → list (S n)

Nicolas Oury Pattern covering by set approximations

slide-9
SLIDE 9

Introduction Elimination of useless cases Approximations of inductive sets Conclusions The Calculus of Inductive Constructions Inductive data types Definitions by pattern matching Useless cases in a pattern matching

Pattern matching

Functions can be defined by pattern matching plus O n = n plus (S m) n = S (plus m n) With dependent types append :: list n → list m → list (n +m) append nil l = l append (cons a l’) l = cons a (append l’ l)

Nicolas Oury Pattern covering by set approximations

slide-10
SLIDE 10

Introduction Elimination of useless cases Approximations of inductive sets Conclusions The Calculus of Inductive Constructions Inductive data types Definitions by pattern matching Useless cases in a pattern matching

Pattern matching

Functions can be defined by pattern matching plus O n = n plus (S m) n = S (plus m n) With dependent types append :: list n → list m → list (n +m) append nil l = l append (cons a l’) l = cons a (append l’ l)

Nicolas Oury Pattern covering by set approximations

slide-11
SLIDE 11

Introduction Elimination of useless cases Approximations of inductive sets Conclusions The Calculus of Inductive Constructions Inductive data types Definitions by pattern matching Useless cases in a pattern matching

Useless cases

Another example : head :: list (S n) → A head (cons a ) = a head nil = ??? What do we want to write here?

A default case? A proof that the case is impossible?

We want to automaticaly eliminate these cases

Nicolas Oury Pattern covering by set approximations

slide-12
SLIDE 12

Introduction Elimination of useless cases Approximations of inductive sets Conclusions The Calculus of Inductive Constructions Inductive data types Definitions by pattern matching Useless cases in a pattern matching

Useless cases

Another example : head :: list (S n) → A head (cons a ) = a head nil = ??? What do we want to write here?

A default case? A proof that the case is impossible?

We want to automaticaly eliminate these cases

Nicolas Oury Pattern covering by set approximations

slide-13
SLIDE 13

Introduction Elimination of useless cases Approximations of inductive sets Conclusions The Calculus of Inductive Constructions Inductive data types Definitions by pattern matching Useless cases in a pattern matching

Useless cases

Another example : head :: list (S n) → A head (cons a ) = a head nil = ??? What do we want to write here?

A default case? A proof that the case is impossible?

We want to automaticaly eliminate these cases

Nicolas Oury Pattern covering by set approximations

slide-14
SLIDE 14

Introduction Elimination of useless cases Approximations of inductive sets Conclusions The Calculus of Inductive Constructions Inductive data types Definitions by pattern matching Useless cases in a pattern matching

Useless cases

Another example : head :: list (S n) → A head (cons a ) = a head nil = ??? What do we want to write here?

A default case? A proof that the case is impossible?

We want to automaticaly eliminate these cases

Nicolas Oury Pattern covering by set approximations

slide-15
SLIDE 15

Introduction Elimination of useless cases Approximations of inductive sets Conclusions The Calculus of Inductive Constructions Inductive data types Definitions by pattern matching Useless cases in a pattern matching

Useless cases

Another example : head :: list (S n) → A head (cons a ) = a head nil = ??? What do we want to write here?

A default case? A proof that the case is impossible?

We want to automaticaly eliminate these cases

Nicolas Oury Pattern covering by set approximations

slide-16
SLIDE 16

Introduction Elimination of useless cases Approximations of inductive sets Conclusions The Calculus of Inductive Constructions Inductive data types Definitions by pattern matching Useless cases in a pattern matching

Useless cases

Another example : head :: list (S n) → A head (cons a ) = a head nil = ??? What do we want to write here?

A default case? A proof that the case is impossible?

We want to automaticaly eliminate these cases

Nicolas Oury Pattern covering by set approximations

slide-17
SLIDE 17

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Undecidability Splitting

Outline

1

Introduction The Calculus of Inductive Constructions Inductive data types Definitions by pattern matching Useless cases in a pattern matching

2

Elimination of useless cases Undecidability Splitting

3

Approximations of inductive sets Set computations Examples Prototype Refutations reconstruction

4

Conclusions

Nicolas Oury Pattern covering by set approximations

slide-18
SLIDE 18

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Undecidability Splitting

Undecidability

Post problem

(u1, v1) . . . (un, vn) words on {a; b} ui1 . . . uik = vi1 . . . vik for some non empty (ij)1≤j≤k? This problem is undecidable

Encoding words : Word = ǫ : Word A : Word → Word B : Word → Word To each word we asociate a context: abb[] = A(B(B[]))

Nicolas Oury Pattern covering by set approximations

slide-19
SLIDE 19

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Undecidability Splitting

Undecidability

Post problem

(u1, v1) . . . (un, vn) words on {a; b} ui1 . . . uik = vi1 . . . vik for some non empty (ij)1≤j≤k? This problem is undecidable

Encoding words : Word = ǫ : Word A : Word → Word B : Word → Word To each word we asociate a context: abb[] = A(B(B[]))

Nicolas Oury Pattern covering by set approximations

slide-20
SLIDE 20

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Undecidability Splitting

Undecidability

Post problem

(u1, v1) . . . (un, vn) words on {a; b} ui1 . . . uik = vi1 . . . vik for some non empty (ij)1≤j≤k?

Encoding Post problem in pattern matching covering : I _ _ = init : I ǫ ǫ u1v1 : I u v → I u1[u] v1[v] ... unvn : I u v → I un[u] vn[v] Is this function total? f :: I w w → nat f init = O

Nicolas Oury Pattern covering by set approximations

slide-21
SLIDE 21

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Undecidability Splitting

Undecidability

Post problem

(u1, v1) . . . (un, vn) words on {a; b} ui1 . . . uik = vi1 . . . vik for some non empty (ij)1≤j≤k?

Encoding Post problem in pattern matching covering : I _ _ = init : I ǫ ǫ u1v1 : I u v → I u1[u] v1[v] ... unvn : I u v → I un[u] vn[v] Is this function total? f :: I w w → nat f init = O

Nicolas Oury Pattern covering by set approximations

slide-22
SLIDE 22

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Undecidability Splitting

Splitting

Split inductive types along their constructors. Unification to eliminate cases. head :: list (S n) → A head (cons a ) = a head nil = ??? list (S n) splits into :

cons ⇒ n : nat, a : A, l : list n ⊢ cons a l : list (S n) nil ⇒ ⊢ nil : list O

First case generate a new goal : list n The second case is impossible : S n = O Epigram, Alf, Twelf . . .

Nicolas Oury Pattern covering by set approximations

slide-23
SLIDE 23

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Undecidability Splitting

Splitting

Split inductive types along their constructors. Unification to eliminate cases. head :: list (S n) → A head (cons a ) = a head nil = ??? list (S n) splits into :

cons ⇒ n : nat, a : A, l : list n ⊢ cons a l : list (S n) nil ⇒ ⊢ nil : list O

First case generate a new goal : list n The second case is impossible : S n = O Epigram, Alf, Twelf . . .

Nicolas Oury Pattern covering by set approximations

slide-24
SLIDE 24

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Undecidability Splitting

Splitting

Split inductive types along their constructors. Unification to eliminate cases. head :: list (S n) → A head (cons a ) = a head nil = ??? list (S n) splits into :

cons ⇒ n : nat, a : A, l : list n ⊢ cons a l : list (S n) nil ⇒ ⊢ nil : list O

First case generate a new goal : list n The second case is impossible : S n = O Epigram, Alf, Twelf . . .

Nicolas Oury Pattern covering by set approximations

slide-25
SLIDE 25

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Undecidability Splitting

Splitting

Split inductive types along their constructors. Unification to eliminate cases. head :: list (S n) → A head (cons a ) = a head nil = ??? list (S n) splits into :

cons ⇒ n : nat, a : A, l : list n ⊢ cons a l : list (S n) nil ⇒ ⊢ nil : list O

First case generate a new goal : list n The second case is impossible : S n = O Epigram, Alf, Twelf . . .

Nicolas Oury Pattern covering by set approximations

slide-26
SLIDE 26

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Undecidability Splitting

Splitting

Split inductive types along their constructors. Unification to eliminate cases. head :: list (S n) → A head (cons a ) = a head nil = ??? list (S n) splits into :

cons ⇒ n : nat, a : A, l : list n ⊢ cons a l : list (S n) nil ⇒ ⊢ nil : list O

First case generate a new goal : list n The second case is impossible : S n = O Epigram, Alf, Twelf . . .

Nicolas Oury Pattern covering by set approximations

slide-27
SLIDE 27

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Undecidability Splitting

Splitting does not use finiteness

empty = useless : empty → empty empty splits into useless ⇒ we have to show empty is empty R _ _ = R1 : R 0 1 R2 : R 0 2 Trans : R n p → R p m → R n m We want to show Trans is not accessible. First goal : { R n p; R p m} Splits into : { R n p’; R p’ p; R p m}

Nicolas Oury Pattern covering by set approximations

slide-28
SLIDE 28

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Undecidability Splitting

Splitting does not use finiteness

empty = useless : empty → empty empty splits into useless ⇒ we have to show empty is empty R _ _ = R1 : R 0 1 R2 : R 0 2 Trans : R n p → R p m → R n m We want to show Trans is not accessible. First goal : { R n p; R p m} Splits into : { R n p’; R p’ p; R p m}

Nicolas Oury Pattern covering by set approximations

slide-29
SLIDE 29

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Undecidability Splitting

Splitting does not use finiteness

empty = useless : empty → empty empty splits into useless ⇒ we have to show empty is empty R _ _ = R1 : R 0 1 R2 : R 0 2 Trans : R n p → R p m → R n m We want to show Trans is not accessible. First goal : { R n p; R p m} Splits into : { R n p’; R p’ p; R p m}

Nicolas Oury Pattern covering by set approximations

slide-30
SLIDE 30

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Undecidability Splitting

Splitting does not use finiteness

empty = useless : empty → empty empty splits into useless ⇒ we have to show empty is empty R _ _ = R1 : R 0 1 R2 : R 0 2 Trans : R n p → R p m → R n m We want to show Trans is not accessible. First goal : { R n p; R p m} Splits into : { R n p’; R p’ p; R p m}

Nicolas Oury Pattern covering by set approximations

slide-31
SLIDE 31

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Undecidability Splitting

Splitting does not use finiteness

empty = useless : empty → empty empty splits into useless ⇒ we have to show empty is empty R _ _ = R1 : R 0 1 R2 : R 0 2 Trans : R n p → R p m → R n m We want to show Trans is not accessible. First goal : { R n p; R p m} Splits into : { R n p’; R p’ p; R p m}

Nicolas Oury Pattern covering by set approximations

slide-32
SLIDE 32

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Outline

1

Introduction The Calculus of Inductive Constructions Inductive data types Definitions by pattern matching Useless cases in a pattern matching

2

Elimination of useless cases Undecidability Splitting

3

Approximations of inductive sets Set computations Examples Prototype Refutations reconstruction

4

Conclusions

Nicolas Oury Pattern covering by set approximations

slide-33
SLIDE 33

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Computing the set of inhabitants

Inductive types are least fixpoints so we iterate empty = useless : empty → empty empty0 = ∅ Applying useless to each elements of empty0 gives : empty1 = ∅ nat = O : nat S : nat → nat nat0 = ∅, nat1 = {0}, nat2 = {0; 1} nat3 = {0; 1; 2}, nat4 = {0; 1; 2; 3}, nat5 = {0; 1; 2; 3; 4}, . . .

Nicolas Oury Pattern covering by set approximations

slide-34
SLIDE 34

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Computing the set of inhabitants

Inductive types are least fixpoints so we iterate empty = useless : empty → empty empty0 = ∅ Applying useless to each elements of empty0 gives : empty1 = ∅ nat = O : nat S : nat → nat nat0 = ∅, nat1 = {0}, nat2 = {0; 1} nat3 = {0; 1; 2}, nat4 = {0; 1; 2; 3}, nat5 = {0; 1; 2; 3; 4}, . . .

Nicolas Oury Pattern covering by set approximations

slide-35
SLIDE 35

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Computing the set of inhabitants

Inductive types are least fixpoints so we iterate empty = useless : empty → empty empty0 = ∅ Applying useless to each elements of empty0 gives : empty1 = ∅ nat = O : nat S : nat → nat nat0 = ∅, nat1 = {0}, nat2 = {0; 1} nat3 = {0; 1; 2}, nat4 = {0; 1; 2; 3}, nat5 = {0; 1; 2; 3; 4}, . . .

Nicolas Oury Pattern covering by set approximations

slide-36
SLIDE 36

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Computing the set of inhabitants

Inductive types are least fixpoints so we iterate empty = useless : empty → empty empty0 = ∅ Applying useless to each elements of empty0 gives : empty1 = ∅ nat = O : nat S : nat → nat nat0 = ∅, nat1 = {0}, nat2 = {0; 1} nat3 = {0; 1; 2}, nat4 = {0; 1; 2; 3}, nat5 = {0; 1; 2; 3; 4}, . . .

Nicolas Oury Pattern covering by set approximations

slide-37
SLIDE 37

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Approximations of sets

We work on over–approximations in domains where fixpoints converge. For example, nat∞ = {⊥} We test if the over–approximation is empty. Each construction must be reflected on the approximated sets. We only consider to monomorph first order inductives. We approximate dependent inductives by the set of terms with dependencies. R∞ = {(0, 1, R1); (0, 2, R2)}

Nicolas Oury Pattern covering by set approximations

slide-38
SLIDE 38

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Approximations of sets

We work on over–approximations in domains where fixpoints converge. For example, nat∞ = {⊥} We test if the over–approximation is empty. Each construction must be reflected on the approximated sets. We only consider to monomorph first order inductives. We approximate dependent inductives by the set of terms with dependencies. R∞ = {(0, 1, R1); (0, 2, R2)}

Nicolas Oury Pattern covering by set approximations

slide-39
SLIDE 39

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Approximations of sets

We work on over–approximations in domains where fixpoints converge. For example, nat∞ = {⊥} We test if the over–approximation is empty. Each construction must be reflected on the approximated sets. We only consider to monomorph first order inductives. We approximate dependent inductives by the set of terms with dependencies. R∞ = {(0, 1, R1); (0, 2, R2)}

Nicolas Oury Pattern covering by set approximations

slide-40
SLIDE 40

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Approximations of sets

We work on over–approximations in domains where fixpoints converge. For example, nat∞ = {⊥} We test if the over–approximation is empty. Each construction must be reflected on the approximated sets. We only consider to monomorph first order inductives. We approximate dependent inductives by the set of terms with dependencies. R∞ = {(0, 1, R1); (0, 2, R2)}

Nicolas Oury Pattern covering by set approximations

slide-41
SLIDE 41

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Approximations of sets

We work on over–approximations in domains where fixpoints converge. For example, nat∞ = {⊥} We test if the over–approximation is empty. Each construction must be reflected on the approximated sets. We only consider to monomorph first order inductives. We approximate dependent inductives by the set of terms with dependencies. R∞ = {(0, 1, R1); (0, 2, R2)}

Nicolas Oury Pattern covering by set approximations

slide-42
SLIDE 42

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Example of approximation

R n m = R1 : R 0 1 R2 : R 0 2 Trans : R n p → R p m → R n m R1 = {(0, 1, R1); (0, 2, R2)} We approximate the context of Trans n, m ,p : nat n, m, p ∈ nat_∞ t1 : R n p (t1,n,p)∈{(R1,O,1); (R2,O,2)} t2 : R p m (t2,p,m)∈{(R1,O,1); (R2,O,2)} p is in both {0} and {1; 2} ⇒ Trans can’t be applyied. R∞ = R1

Nicolas Oury Pattern covering by set approximations

slide-43
SLIDE 43

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Example of approximation

R n m = R1 : R 0 1 R2 : R 0 2 Trans : R n p → R p m → R n m R1 = {(0, 1, R1); (0, 2, R2)} We approximate the context of Trans n, m ,p : nat n, m, p ∈ nat_∞ t1 : R n p (t1,n,p)∈{(R1,O,1); (R2,O,2)} t2 : R p m (t2,p,m)∈{(R1,O,1); (R2,O,2)} p is in both {0} and {1; 2} ⇒ Trans can’t be applyied. R∞ = R1

Nicolas Oury Pattern covering by set approximations

slide-44
SLIDE 44

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Example of approximation

R n m = R1 : R 0 1 R2 : R 0 2 Trans : R n p → R p m → R n m R1 = {(0, 1, R1); (0, 2, R2)} We approximate the context of Trans n, m ,p : nat n, m, p ∈ nat_∞ t1 : R n p (t1,n,p)∈{(R1,O,1); (R2,O,2)} t2 : R p m (t2,p,m)∈{(R1,O,1); (R2,O,2)} p is in both {0} and {1; 2} ⇒ Trans can’t be applyied. R∞ = R1

Nicolas Oury Pattern covering by set approximations

slide-45
SLIDE 45

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Example of approximation

R n m = R1 : R 0 1 R2 : R 0 2 Trans : R n p → R p m → R n m R1 = {(0, 1, R1); (0, 2, R2)} We approximate the context of Trans n, m ,p : nat n, m, p ∈ nat_∞ t1 : R n p (t1,n,p)∈{(R1,O,1); (R2,O,2)} t2 : R p m (t2,p,m)∈{(R1,O,1); (R2,O,2)} p is in both {0} and {1; 2} ⇒ Trans can’t be applyied. R∞ = R1

Nicolas Oury Pattern covering by set approximations

slide-46
SLIDE 46

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Example of approximation

R n m = R1 : R 0 1 R2 : R 0 2 Trans : R n p → R p m → R n m R1 = {(0, 1, R1); (0, 2, R2)} We approximate the context of Trans n, m ,p : nat n, m, p ∈ nat_∞ t1 : R n p (t1,n,p)∈{(R1,O,1); (R2,O,2)} t2 : R p m (t2,p,m)∈{(R1,O,1); (R2,O,2)} p is in both {0} and {1; 2} ⇒ Trans can’t be applyied. R∞ = R1

Nicolas Oury Pattern covering by set approximations

slide-47
SLIDE 47

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Example of approximation

R n m = R1 : R 0 1 R2 : R 0 2 Trans : R n p → R p m → R n m R1 = {(0, 1, R1); (0, 2, R2)} We approximate the context of Trans n, m ,p : nat n, m, p ∈ nat_∞ t1 : R n p (t1,n,p)∈{(R1,O,1); (R2,O,2)} t2 : R p m (t2,p,m)∈{(R1,O,1); (R2,O,2)} p is in both {0} and {1; 2} ⇒ Trans can’t be applyied. R∞ = R1

Nicolas Oury Pattern covering by set approximations

slide-48
SLIDE 48

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Another example of approximation

le n m = eq : le n n trans : le n m -> le n (S m) Counting the number of occurences of constructors leo = ∅, le1 = [|n|O = 1; |m|O = 1; |n|S = |m|S] We approximate the context of trans t : le n m [|n|_O=1;|m|_O=1;|n|_S=|m|_S] le2 = [|n|O = 1; |m|O = 1; |n|S ≤ |m|S; |n|S + 1 ≥ |m|S] . . . lek = [|n|O = 1; |m|O = 1; |n|S ≤ |m|S; |n|S + k ≥ |m|S] And with acceleration. le∞ = [|n|O = 1; |m|O = 1; |n|S ≤ |m|S]

Nicolas Oury Pattern covering by set approximations

slide-49
SLIDE 49

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Another example of approximation

le n m = eq : le n n trans : le n m -> le n (S m) Counting the number of occurences of constructors leo = ∅, le1 = [|n|O = 1; |m|O = 1; |n|S = |m|S] We approximate the context of trans t : le n m [|n|_O=1;|m|_O=1;|n|_S=|m|_S] le2 = [|n|O = 1; |m|O = 1; |n|S ≤ |m|S; |n|S + 1 ≥ |m|S] . . . lek = [|n|O = 1; |m|O = 1; |n|S ≤ |m|S; |n|S + k ≥ |m|S] And with acceleration. le∞ = [|n|O = 1; |m|O = 1; |n|S ≤ |m|S]

Nicolas Oury Pattern covering by set approximations

slide-50
SLIDE 50

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Another example of approximation

le n m = eq : le n n trans : le n m -> le n (S m) Counting the number of occurences of constructors leo = ∅, le1 = [|n|O = 1; |m|O = 1; |n|S = |m|S] We approximate the context of trans t : le n m [|n|_O=1;|m|_O=1;|n|_S=|m|_S] le2 = [|n|O = 1; |m|O = 1; |n|S ≤ |m|S; |n|S + 1 ≥ |m|S] . . . lek = [|n|O = 1; |m|O = 1; |n|S ≤ |m|S; |n|S + k ≥ |m|S] And with acceleration. le∞ = [|n|O = 1; |m|O = 1; |n|S ≤ |m|S]

Nicolas Oury Pattern covering by set approximations

slide-51
SLIDE 51

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Another example of approximation

le n m = eq : le n n trans : le n m -> le n (S m) Counting the number of occurences of constructors leo = ∅, le1 = [|n|O = 1; |m|O = 1; |n|S = |m|S] We approximate the context of trans t : le n m [|n|_O=1;|m|_O=1;|n|_S=|m|_S] le2 = [|n|O = 1; |m|O = 1; |n|S ≤ |m|S; |n|S + 1 ≥ |m|S] . . . lek = [|n|O = 1; |m|O = 1; |n|S ≤ |m|S; |n|S + k ≥ |m|S] And with acceleration. le∞ = [|n|O = 1; |m|O = 1; |n|S ≤ |m|S]

Nicolas Oury Pattern covering by set approximations

slide-52
SLIDE 52

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Another example of approximation

le n m = eq : le n n trans : le n m -> le n (S m) Counting the number of occurences of constructors leo = ∅, le1 = [|n|O = 1; |m|O = 1; |n|S = |m|S] We approximate the context of trans t : le n m [|n|_O=1;|m|_O=1;|n|_S=|m|_S] le2 = [|n|O = 1; |m|O = 1; |n|S ≤ |m|S; |n|S + 1 ≥ |m|S] . . . lek = [|n|O = 1; |m|O = 1; |n|S ≤ |m|S; |n|S + k ≥ |m|S] And with acceleration. le∞ = [|n|O = 1; |m|O = 1; |n|S ≤ |m|S]

Nicolas Oury Pattern covering by set approximations

slide-53
SLIDE 53

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Prototype implantation

An implantation parametric in the approximation used for inductive sets Two instances:

Trees with limited size Counting the number of occurences of a constructors with a library of convex set Polka

Nicolas Oury Pattern covering by set approximations

slide-54
SLIDE 54

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Prototype implantation

An implantation parametric in the approximation used for inductive sets Two instances:

Trees with limited size Counting the number of occurences of a constructors with a library of convex set Polka

Nicolas Oury Pattern covering by set approximations

slide-55
SLIDE 55

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Prototype implantation

An implantation parametric in the approximation used for inductive sets Two instances:

Trees with limited size Counting the number of occurences of a constructors with a library of convex set Polka

Nicolas Oury Pattern covering by set approximations

slide-56
SLIDE 56

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Prototype implantation

An implantation parametric in the approximation used for inductive sets Two instances:

Trees with limited size Counting the number of occurences of a constructors with a library of convex set Polka

Nicolas Oury Pattern covering by set approximations

slide-57
SLIDE 57

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Refutations reconstruction

Importance of reconstructing proof : safety of case elimination Two methods :

Prove every approximations is correct : Proof of the correction of the operation on approximated sets Prove each approximation is correct : Use of automatic tactics in Coq, like omega

Nicolas Oury Pattern covering by set approximations

slide-58
SLIDE 58

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Refutations reconstruction

Importance of reconstructing proof : safety of case elimination Two methods :

Prove every approximations is correct : Proof of the correction of the operation on approximated sets Prove each approximation is correct : Use of automatic tactics in Coq, like omega

Nicolas Oury Pattern covering by set approximations

slide-59
SLIDE 59

Introduction Elimination of useless cases Approximations of inductive sets Conclusions Set computations Examples Prototype Refutations reconstruction

Refutations reconstruction

Importance of reconstructing proof : safety of case elimination Two methods :

Prove every approximations is correct : Proof of the correction of the operation on approximated sets Prove each approximation is correct : Use of automatic tactics in Coq, like omega

Nicolas Oury Pattern covering by set approximations

slide-60
SLIDE 60

Introduction Elimination of useless cases Approximations of inductive sets Conclusions

Outline

1

Introduction The Calculus of Inductive Constructions Inductive data types Definitions by pattern matching Useless cases in a pattern matching

2

Elimination of useless cases Undecidability Splitting

3

Approximations of inductive sets Set computations Examples Prototype Refutations reconstruction

4

Conclusions

Nicolas Oury Pattern covering by set approximations

slide-61
SLIDE 61

Introduction Elimination of useless cases Approximations of inductive sets Conclusions

Conclusions

This method allows to eliminate case with some simple inductive analysis. Need to extend the method with polymorphic and higher

  • rder types.

Need of other data structures to approximate set of inductives.

Nicolas Oury Pattern covering by set approximations

slide-62
SLIDE 62

Introduction Elimination of useless cases Approximations of inductive sets Conclusions

Conclusions

This method allows to eliminate case with some simple inductive analysis. Need to extend the method with polymorphic and higher

  • rder types.

Need of other data structures to approximate set of inductives.

Nicolas Oury Pattern covering by set approximations

slide-63
SLIDE 63

Introduction Elimination of useless cases Approximations of inductive sets Conclusions

Conclusions

This method allows to eliminate case with some simple inductive analysis. Need to extend the method with polymorphic and higher

  • rder types.

Need of other data structures to approximate set of inductives.

Nicolas Oury Pattern covering by set approximations