Formal proof of SCHUR conjugate function Toumazet Objectives and - - PowerPoint PPT Presentation

formal proof of schur conjugate function
SMART_READER_LITE
LIVE PREVIEW

Formal proof of SCHUR conjugate function Toumazet Objectives and - - PowerPoint PPT Presentation

Formal Proof of conjugate function Butelle Hivert Mayero Formal proof of SCHUR conjugate function Toumazet Objectives and tools SCHUR Micaela Mayero 1 Frama-C Franck Butelle 1 Florent Hivert 2 Some combi- Frdric Toumazet 3 natorial


slide-1
SLIDE 1

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Formal proof of SCHUR conjugate function

Franck Butelle1 Florent Hivert2

Micaela Mayero1

Frédéric Toumazet3

1 Univ. Paris 13, LIPN UMR 7030 2 Univ. Paris 11, LRI UMR 8623 4 Univ. Marne-la-Vallée, LIGM UMR 8049

MAP 2012 — Konstanz

1/26

slide-2
SLIDE 2

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Objectives and tools Some combinatorial objects The C function Formal Proof Conclusion

2/26

slide-3
SLIDE 3

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Objectives and tools

  • Proof of concept:
  • Algebraic combinatorics area: combinatorial explosion
  • SCHUR software, now under GNU GPL
  • Prove an old C program, uncommented and tricky, not

designed to be proved !

  • extract one key function, simple but quite representative
  • prove it
  • try to deduce some methodology
  • Tools and Means
  • Frama-C, plug-in Jessie
  • First-order logic annotations
  • Automatic provers...
  • And if it is not enough, use interactive provers.

3/26

slide-4
SLIDE 4

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

SCHUR

  • Interactive software (more than 240 commands)
  • calculate properties of Lie groups and symmetric functions
  • 20 years of research in algebraic combinatorics, physics,

etc.

  • Tool for computations, conjectures, teaching,...
  • Over 45 000 lines of C without comments
  • Originally written by B.G. Wybourne.
  • Now maintained by F. Butelle, R. King and F. Toumazet.
  • Nowadays under GPL (sourceforge.net).

4/26

slide-5
SLIDE 5

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Frama-C / Jessie

  • platform for source-code analysis of C software (successor
  • f Caduceus)
  • Jessie plug-in: generate verification conditions from

first-order logic annotations (ACSL, based on Why, Hoare logic).

  • Call external automatic provers (SMT) (Simplify, Alt-Ergo,

Z3, CVC3,...)

  • Many output formats available for interactive provers

(Coq, PVS, Isabelle/HOL,...)

  • Graphical interface
  • (Now Why3)

5/26

slide-6
SLIDE 6

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Some combinatorial objects

Objectives and tools Some combinatorial objects Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate The C function Formal Proof Conclusion

6/26

slide-7
SLIDE 7

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Integer Partition and Ferrers diagrams

Definition: Integer Partition

write n has a sum of non increasing integers Example : 4 = 3 + 1 = 2 + 2 = 2 + 1 + 1 = 1 + 1 + 1 + 1

Definition: Ferrers Diagram

The integer partition λ = (3, 1) can be represented by the following diagram F λ = Important role:

  • group representation theory
  • symmetric polynomials and the symmetric group
  • Frobenius (1849–1917): irreducible representations of

symmetric groups are indexed by integer partitions...

7/26

slide-8
SLIDE 8

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Young Tableaux

Definition: a semi-standard Young tableau

  • f shape λ is a numbering of the boxes of F λ with entries from

{1, 2, ..., n}, weakly increasing across rows and strictly increasing down columns. Example : λ = (4, 2, 2, 1) : 1 2 2 5 2 4 3 6 5

8/26

slide-9
SLIDE 9

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Symmetric Functions

Definition: a symmetric function

f (x1, x2, . . . ) is invariant under any permutation of its variables: f (x1, x2, . . . ) = f (x2, x1, . . . ) = . . . Usually restricted to polynomials functions.

9/26

slide-10
SLIDE 10

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Schur Functions

Definition: a Schur function

For a semi-standard Young tableau T of shape λ, if X T is the product of all xi, for all i appearing in T, then sλ =

T∈Tab(λ) xT where Tab(λ) is the set of all tableaux of

shape λ.

Example :

λ = (2, 1); when using alphabet {1, 2, 3}, Tab(λ) = 1 1 2 1 1 3 2 2 3 1 2 3 1 3 2 1 2 2 1 3 3 2 3 3

s(21)(x1, x2, x3) = x2

1x2+x2 1x3+x2 2x3+2x1x2x3+x1x2 2+x1x2 3+x2x2 3

Schur functions are the most important linear basis of symmetric function’s algebra.

10/26

slide-11
SLIDE 11

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Computation in algebraic combinatorics

Architecture of a software for computing in algebraic combinatorics:

  • a computer algebra kernel
  • a very large bunch of small combinatorial functions which

enumerate and manipulate the combinatorial data structures.

  • surgery on lists of integers or lists of lists of integers
  • computing the conjugate of a partition is a very good

example...

  • used by more than 100 commands in Schur.

11/26

slide-12
SLIDE 12

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Conjugate partition

The conjugate of an integer partition is the partition associated to the diagonal symmetric of its shape.

Example

λ = (3, 2, 1, 1, 1)

12/26

slide-13
SLIDE 13

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Conjugate partition

The conjugate of an integer partition is the partition associated to the diagonal symmetric of its shape.

Example

λ = (3, 2, 1, 1, 1)

12/26

slide-14
SLIDE 14

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Conjugate partition

The conjugate of an integer partition is the partition associated to the diagonal symmetric of its shape.

Example

λ = (3, 2, 1, 1, 1)

Conjugate

= ⇒ The conjugate of (3, 2, 1, 1, 1) is therefore (5, 2, 1).

12/26

slide-15
SLIDE 15

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Computation of the conjugate

A partition − → an array of integers. λ = (3, 2, 1, 1, 1) − → t[1] = 3, t[2] = 2, . . . t[l(λ)] = 1. Computation of the conjugate: count boxes.

Conjugate

= ⇒ 5, 2, 1    5 = # lines of length ≥ 1 2 = # lines of length ≥ 2 1 = # lines of length ≥ 3 tc[j] = |{i | 1 ≤ i ≤ l(λ) ∧ t[i] ≥ j}|

13/26

slide-16
SLIDE 16

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

The conjugate function in SCHUR

#d e f i n e MAX 100 void conjgte ( i n t A[MAX] , i n t B[MAX] ) { i n t i , partc = 1 , edge = 0; while (A[ partc ] != 0) { edge = A[ partc ] ; do partc = partc + 1; while (A[ partc ] == edge ) ; f o r ( i = A[ partc ] + 1; i <= edge ; i++) B[ i ] = partc − 1; } }

14/26

slide-17
SLIDE 17

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Function behavior

1 ... A[partc2] A[partc2]+1 ... A[partc1]=edge ... A[1] ↓ ↓ ↓ ↓ ↓ 1 → ... ... ... . . . . . . . . . . . . . . . partc1 → ... ... . . . . . . . . . . . . . . . partc1+n → ... ... partc2 → ... . . . . . . . . .

15/26

slide-18
SLIDE 18

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Annotations for the formal proof

no integer overflow is allowed...

#pragma J e s s i e I n t e g e r M o d e l ( s t r i c t )

Predicate declaration (based on actual data structure in SCHUR)

/∗@ p r e d i c a t e i s _ p a r t i t i o n {L}( i n t t [ ] ) = ( \ f o r a l l i n t e g e r i ; 1 <= i < MAX == > 0 <= t [ i ] < (MAX−1)) && ( \ f o r a l l i n t e g e r i , j ; 1 <= i <=j < MAX == > t [ j ] <= t [ i ] ) && t [MAX−1]==0; ∗/

16/26

slide-19
SLIDE 19

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Some more predicates...

countIfSup(t,j,k,z) is true iff z equals the number of lines of t, whose indexes are in {1, .., j − 1} and of length ≥ k...

/∗@ p r e d i c a t e countIfSup {L}( i n t t [ ] , i n t e g e r j , i n t e g e r k , i n t e g e r z ) = i s _ p a r t i t i o n {L}( t ) && 1<= j<= MAX && 1<=k< MAX && ((1<=z<j && \ f o r a l l i n t e g e r i ; 1<=i<=z == > t [ i ]>=k ) | | ( z==0 && \ f o r a l l i n t e g e r i ; 1<=i <j == > t [ i ]<k ) ) ; ∗/

We deduce the postcondition to verify: t2 is the conjugate of t1 iff

/∗@ p r e d i c a t e is_conjugate {L}( i n t t1 [ ] , i n t t2 [ ] ) = \ f o r a l l i n t e g e r k ; 1<=k< MAX == > countIfSup ( t1 ,MAX, k , t2 [ k ] ) ; ∗/

17/26

slide-20
SLIDE 20

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Pre and Post conditions

/∗@ r e q u i r e s \ v a l i d (A+ ( 1 . . (MAX−1))); r e q u i r e s \ v a l i d (B+ ( 1 . . (MAX−1))); r e q u i r e s i s _ p a r t i t i o n (A ) ; r e q u i r e s \ f o r a l l i n t e g e r k ; 1<=k< MAX == > B[ k]== 0; a s s i g n s B [ 1 . . A [ 1 ] ] ; e n s u r e s is_conjugate (A,B ) ; ∗/ void c o n j g t e ( i n t A[MAX] , i n t B[MAX] ) { i n t i , p a r t c =1, edge = 0 ;

18/26

slide-21
SLIDE 21

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Loop invariant 1

/∗@ loop v a r i a n t MAX −p a r t c ; loop i n v a r i a n t 1<=partc < MAX; loop a s s i g n s B [ 1 . . A [ 1 ] ] ; loop i n v a r i a n t \ f o r a l l i n t e g e r k ; A[ p a r t c]+1<=k<= A [ 1 ] == > countIfSup (A,MAX, k ,B[ k ] ) ; ∗/ w h i l e (A[ p a r t c ] != 0) { edge = A[ p a r t c ] ; /∗@ ghost i n t

  • ld_partc = p a r t c ;

∗/ /∗@ loop v a r i a n t MAX −p a r t c ; loop i n v a r i a n t

  • ld_partc<=p a r t c

; loop i n v a r i a n t \ f o r a l l i n t e g e r k ;

  • ld_partc<=k<=p a r t c ==

> A[ k]==edge ; loop i n v a r i a n t partc < MAX−1; ∗/ do p a r t c = p a r t c + 1; w h i l e (A[ p a r t c ] == edge ) ;

19/26

slide-22
SLIDE 22

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Loop invariant 2

/∗@ a s s e r t countIfSup (A, partc , edge , partc −1);∗/ /∗@ loop v a r i a n t edge−i ; loop i n v a r i a n t i >= A[ p a r t c ]+1 && edge+1 >=i ; loop i n v a r i a n t \ f o r a l l i n t e g e r k ; A[ p a r t c ]+1 <=k <i == > countIfSup (A,MAX, k ,B[ k ] ) ; loop a s s i g n s B[ (A[ p a r t c ] + 1 ) . . edge ] ; ∗/ f o r ( i = A[ p a r t c ] + 1 ; i <= edge ; i ++) B[ i ] = p a r t c − 1; }

20/26

slide-23
SLIDE 23

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

gWhy interface

21/26

slide-24
SLIDE 24

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Coq proof assistant

  • When no automatic prover is able to prove a verification

condition: try to achieve an assisted proof Two cases:

  • Either we are able to identify "errors" in annotations

֒ → correction and back to automatic SMT provers

  • Or the property is "too complex" for SMT provers

֒ → prove it with Coq help

22/26

slide-25
SLIDE 25

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Coq for the conjugate

Identifying problems in annotations

Small causes, great consequences...

  • Replacing initial axiomatic definition by a predicate for

countIfSup

  • postcondition proof.
  • one more precondition required
  • Definition of countIfSup was incomplete (the second part
  • f || was missing)
  • Loop Invariant.

mistake in definition of countIfSup : j < MAX instead of j ≤ MAX

23/26

slide-26
SLIDE 26

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Difficulties

  • Isolate piece of code to prove.
  • Make "good" annotations without changing original code.
  • Prove all verification conditions
  • What confidence in automatic provers ?
  • no trace of how things are proved
  • some CVC3 versions have bugs...

24/26

slide-27
SLIDE 27

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Conclusion

  • Proof of a key/typical function of SCHUR.
  • Beginning of a methodology to prove a "big" computing

software.

  • Interactions between two communities
  • For combinatorists, increase confidence in computations
  • For formal proof people, proof of concept/feasibility

25/26

slide-28
SLIDE 28

Formal Proof

  • f conjugate

function Butelle Hivert Mayero Toumazet Objectives and tools

SCHUR Frama-C

Some combi- natorial

  • bjects

Integer Partition Young Tableaux Symmetric Functions Schur Functions The conjugate

C function Formal Proof

Annotate the program Automatically prove Coq proof assistant

Conclusion

Future works

  • Proving enumerative computations:
  • Littlewood-Richardson coefficients
  • Kostkas numbers
  • Kostkas matrices
  • ...
  • Library formally proved

26/26