«ProvingProgramInvarianceand TerminationbyParametric Abstraction,LagrangianRelaxation andsemidefiniteprogramming»

Size: px
Start display at page:

Download "«ProvingProgramInvarianceand TerminationbyParametric Abstraction,LagrangianRelaxation andsemidefiniteprogramming»"

Transcription

1 «ProvingProgramInvarianceand TerminationbyParametric Abstraction,LagrangianRelaxation andsemidefiniteprogramming» Patrick Cousot École normale supérieure 45rued Ulm,75230Pariscedex05,France VMCAI 05 Paris,France 17Jan.2005 VMCAI 05,Paris,France,17Jan.2005 J 1 [] I ľp.cousot

2 Overviewofthe TerminationAnalysisMethod x x x x x VMCAI 05,Paris,France,17Jan.2005 J 2 [] I ľp.cousot

3 Proving Termination of a Loop Themainpointinthistalkis(4). VMCAI 05,Paris,France,17Jan.2005 J 3 [] I ľp.cousot

4 Proving Termination of a Loop 1. Perform an iterated forward/backward relational static analysis of the loop with termination hypothesis to determine a necessary proper termination precondition 2. Assuming the termination precondition, perform an forward relational static analysis of the loop to determine the loop invariant 3. Assuming the loop invariant, perform an forward relational staticanalysisoftheloopbodytodeterminetheloopabstract operational semantics 4. Assuming the loop semantics, use an abstraction of Floyd s ranking function method to prove termination of the loop VMCAI 05,Paris,France,17Jan.2005 J 4 [] I ľp.cousot

5 Arithmetic Mean Example while (x <> y) do x := x - 1; y := y + 1 od The polyhedral abstraction used for the static analysis of the examples is implemented using Bertrand Jeannet s NewPolka library. VMCAI 05,Paris,France,17Jan.2005 J 5 [] I ľp.cousot

6 Arithmetic Mean Example 1. Perform an iterated forward/backward relational static analysis of the loop with termination hypothesis to determine a necessary proper termination precondition 2. Assuming the termination precondition, perform an forward relational static analysis of the loop to determine the loop invariant 3. Assuming the loop invariant, perform an forward relational staticanalysisoftheloopbodytodeterminetheloopabstract operational semantics 4. Assuming the loop semantics, use an abstraction of Floyd s ranking function method to prove termination of the loop VMCAI 05,Paris,France,17Jan.2005 J 6 [] I ľp.cousot

7 Forward/reachability properties I Example: partial correctness(must stay into safe states) VMCAI 05,Paris,France,17Jan.2005 J 7 [] I ľp.cousot

8 Backward/ancestry properties I F Example: termination(must reach final states) VMCAI 05,Paris,France,17Jan.2005 J 8 [] I ľp.cousot

9 Forward/backward properties I F Example: total correctness(stay safe while reaching final states) VMCAI 05,Paris,France,17Jan.2005 J 9 [] I ľp.cousot

10 Principle of the iterated forward/backward iteration-based approximate analysis Overapproximate lfpfu lfpb by overapproximations of the decreasing sequence X 0 = > ::: X 2n+1 = lfp Y.X 2n uf(y) X 2n+2 = lfp Y.X 2n+1 ub(y) ::: VMCAI 05,Paris,France,17Jan.2005 J 10 [] I ľp.cousot

11 {x>=y} while (x <> y) do {x>=y+2} x := x - 1; {x>=y+1} y := y + 1 {x>=y} od {x=y} Arithmetic Mean Example: Termination Precondition(1) VMCAI 05,Paris,France,17Jan.2005 J 11 [] I ľp.cousot

12 Idea1 The auxiliary termination counter method VMCAI 05,Paris,France,17Jan.2005 J 12 [] I ľp.cousot

13 {x=y+2k,x>=y} while (x <> y) do {x=y+2k,x>=y+2} k := k - 1; {x=y+2k+2,x>=y+2} x := x - 1; {x=y+2k+1,x>=y+1} y := y + 1 {x=y+2k,x>=y} od {x=y,k=0} assume (k = 0) {x=y,k=0} Arithmetic Mean Example: Termination Precondition(2) Add an auxiliary termination counter to enforce (bounded) termination in the backward analysis! VMCAI 05,Paris,France,17Jan.2005 J 13 [] I ľp.cousot

14 {x=y+2k,x>=y} while (x <> y) do {x=y+2k,x>=y+2} k := k - 1; {x=y+2k+2,x>=y+2} x := x - 1; {x=y+2k+1,x>=y+1} y := y + 1 {x=y+2k,x>=y} od {x=y,k=0} assume (k = 0) {x=y,k=0} Arithmetic Mean Example: Termination Precondition(2) Add an auxiliary termination counter to enforce (bounded) termination in the backward analysis! VMCAI 05,Paris,France,17Jan.2005 J 13 [] I ľp.cousot

15 Arithmetic Mean Example 1. Perform an iterated forward/backward relational static analysis of the loop with termination hypothesis to determine a necessary proper termination precondition 2. Assuming the termination precondition, perform an forward relational static analysis of the loop to determine the loop invariant 3. Assuming the loop invariant, perform an forward relational staticanalysisoftheloopbodytodeterminetheloopabstract operational semantics 4. Assuming the loop semantics, use an abstraction of Floyd s ranking function method to prove termination of the loop VMCAI 05,Paris,France,17Jan.2005 J 14 [] I ľp.cousot

16 assume ((x=y+2*k) & (x>=y)); {x=y+2k,x>=y} while (x <> y) do {x=y+2k,x>=y+2} k := k - 1; {x=y+2k+2,x>=y+2} x := x - 1; {x=y+2k+1,x>=y+1} y := y + 1 {x=y+2k,x>=y} od {k=0,x=y} Arithmetic Mean Example: Loop Invariant VMCAI 05,Paris,France,17Jan.2005 J 15 [] I ľp.cousot

17 assume ((x=y+2*k) & (x>=y)); {x=y+2k,x>=y} while (x <> y) do {x=y+2k,x>=y+2} k := k - 1; {x=y+2k+2,x>=y+2} x := x - 1; {x=y+2k+1,x>=y+1} y := y + 1 {x=y+2k,x>=y} od {k=0,x=y} Arithmetic Mean Example: Loop Invariant VMCAI 05,Paris,France,17Jan.2005 J 15 [] I ľp.cousot

18 Arithmetic Mean Example 1. Perform an iterated forward/backward relational static analysis of the loop with termination hypothesis to determine a necessary proper termination precondition 2. Assuming the termination precondition, perform an forward relational static analysis of the loop to determine the loop invariant 3. Assuming the loop invariant, perform an forward relational staticanalysisoftheloopbodytodeterminetheloopabstract operational semantics 4. Assuming the loop semantics, use an abstraction of Floyd s ranking function method to prove termination of the loop VMCAI 05,Paris,France,17Jan.2005 J 16 [] I ľp.cousot

19 Case x < y: assume (x=y+2*k)&(x>=y+2); {x=y+2k,x>=y+2} assume (x < y); empty(6) assume (x0=x)&(y0=y)&(k0=k); empty(6) k := k - 1; x := x - 1; y := y + 1 empty(6) Arithmetic Mean Example: Body Relational Semantics Case x > y: assume (x=y+2*k)&(x>=y+2); {x=y+2k,x>=y+2} assume (x > y); {x=y+2k,x>=y+2} assume (x0=x)&(y0=y)&(k0=k); {x=y+2k0,y=y0,x=x0,x=y+2k, x>=y+2} k := k - 1; x := x - 1; y := y + 1 {x+2=y+2k0,y=y0+1,x+1=x0, x=y+2k,x>=y} VMCAI 05,Paris,France,17Jan.2005 J 17 [] I ľp.cousot

20 Case x < y: assume (x=y+2*k)&(x>=y+2); {x=y+2k,x>=y+2} assume (x < y); empty(6) assume (x0=x)&(y0=y)&(k0=k); empty(6) k := k - 1; x := x - 1; y := y + 1 empty(6) Arithmetic Mean Example: Body Relational Semantics Case x > y: assume (x=y+2*k)&(x>=y+2); {x=y+2k,x>=y+2} assume (x > y); {x=y+2k,x>=y+2} assume (x0=x)&(y0=y)&(k0=k); {x=y+2k0,y=y0,x=x0,x=y+2k, x>=y+2} k := k - 1; x := x - 1; y := y + 1 {x+2=y+2k0,y=y0+1,x+1=x0, x=y+2k,x>=y} VMCAI 05,Paris,France,17Jan.2005 J 17 [] I ľp.cousot

21 Arithmetic Mean Example 1. Perform an iterated forward/backward relational static analysis of the loop with termination hypothesis to determine a necessary proper termination precondition 2. Assuming the termination precondition, perform an forward relational static analysis of the loop to determine the loop invariant 3. Assuming the loop invariant, perform an forward relational staticanalysisoftheloopbodytodeterminetheloopabstract operational semantics 4. Assuming the loop semantics, use an abstraction of Floyd s ranking function method to prove termination of the loop VMCAI 05,Paris,France,17Jan.2005 J 18 [] I ľp.cousot

22 Floyd smethodforterminationof while B do C Given a loop invariant I, find an R=Q=Z-valued unkown rank function r such that: The rank is nonnegative: 8x 0 ;x:i(x 0 )^ B;C (x 0 ;x))r(x 0 ) 0 The rank is strictly decreasing: 8x 0 ;x:i(x 0 )^ B;C (x 0 ;x))r(x)»r(x 0 )` 1forZ, >0forR=QtoavoidZeno 1 2,1 4, VMCAI 05,Paris,France,17Jan.2005 J 19 [] I ľp.cousot

23 » clear all; [v0,v] = variables( x, y, k ) % linear inequalities % x0 y0 k0 Ai = [ 0 0 0]; % x y k Ai_ = [ 1-1 0]; % x0 - y0 >= 0 bi = [0]; [N Mk(:,:,:)]=linToMk(Ai,Ai_,bi); % linear equalities % x0 y0 k0 Ae = [ 0 0-2; 0-1 0; ; 0 0 0]; % x y k Ae_ = [ 1-1 0; % x - y - 2*k0-2 = ; % y - y0-1 = ; % x - x0 + 1 = ]; % x - y - 2*k = 0 be = [2; -1; 1; 0]; [M Mk(:,:,N+1:N+M)]=linToMk(Ae,Ae_,be); Arithmetic Mean Example: Ranking Function Input the loop abstract semantics VMCAI 05,Paris,France,17Jan.2005 J 20 [] I ľp.cousot

24 » display_mk(mk, N, v0, v); x -1.y >= 0-2.k0 +1.x -1.y +2 = 0-1.y0 +1.y -1 = 0-1.x0 +1.x +1 = 0 +1.x -1.y -2.k = 0... Display the abstract semantics of the loop while B do C compute ranking function,ifany» [diagnostic,r] = termination(v0, v, Mk, N, integer, linear );» disp(diagnostic) feasible (bnb)» intrank(r, v) r(x,y,k) = +4.k -2 VMCAI 05,Paris,France,17Jan.2005 J 21 [] I ľp.cousot

25 ProvingTerminationby ParametricAbstraction, LagrangianRelaxationand SemidefiniteProgramming VMCAI 05,Paris,France,17Jan.2005 J 22 [] I ľp.cousot

26 Idea2 Express the loop invariant and relational semantics as numerical positivity constraints VMCAI 05,Paris,France,17Jan.2005 J 23 [] I ľp.cousot

27 Relationalsemanticsof while B do C odloops x 0 2R=Q=Z:valuesoftheloopvariablesbeforealoop iteration x2r=q=z: valuesoftheloopvariablesafteraloop iteration I(x 0 ): loopinvariant, B;C (x 0 ;x): relationalsemanticsofoneiterationoftheloopbody I(x 0 )^ B;C (x 0 ;x)= N^ i=1 not a restriction for numerical programs ff i (x 0 ;x)> i 0 (> i 2f>; ;=g) VMCAI 05,Paris,France,17Jan.2005 J 24 [] I ľp.cousot

28 Example of linear program(arithmetic mean) [AA 0 ][x 0 x] > >b {x=y+2k,x>=y} while (x <> y) do k := k - 1; x := x - 1; y := y + 1 od x -1.y >= 0-2.k0 +1.x -1.y +2 = 0-1.y0 +1.y -1 = 0-1.x0 +1.x +1 = 0 +1.x -1.y -2.k = ` `21`1 0 0 ` ` `1` x 0 y 0 k 0 x y k = = = = `2 1 ` VMCAI 05,Paris,France,17Jan.2005 J 25 [] I ľp.cousot

29 Example of quadratic form program(factorial) [xx 0 ]A[xx 0 ] > +2[xx 0 ]q+r>0 n := 0; f := 1; while (f <= N) do n := n + 1; f := n * f od 2 [n 0 f 0 N 0 nfn] ` ` n 0 f 0 N 0 n f N -1.f0 +1.N0 >= 0 +1.n0 >= 0 +1.f0-1 >= 0-1.n0 +1.n -1 = 0 +1.N0-1.N = 0-1.f0.n +1.f = [n 0 f 0 N 0 nfn] VMCAI 05,Paris,France,17Jan.2005 J 26 [] I ľp.cousot =0 7 5

30 Example of semialgebraic program (logistic map) eps = 1.0e-9; while (0 <= a) & (a <= 1 - eps) & (eps <= x) & (x <= 1) do x := a*x*(1-x) od VMCAI 05,Paris,France,17Jan.2005 J 27 [] I ľp.cousot

31 Floyd smethodforterminationof while B do C FindanR=Q=Z-valuedunkownrankfunctionrand > 0suchthat: The rank is nonnegative: 8x 0 ;x: N^ i=1 ff i (x 0 ;x)> i 0)r(x 0 ) 0 The rank is strictly decreasing: 8x 0 ;x: N^ i=1 ff i (x 0 ;x)> i 0)r(x 0 )`r(x)` 0 VMCAI 05,Paris,France,17Jan.2005 J 28 [] I ľp.cousot

32 Idea3 Eliminatetheconjunction V andimplication)by Lagrangian relaxation VMCAI 05,Paris,France,17Jan.2005 J 29 [] I ľp.cousot

33 Implication(general case) A B, A)B 8x2A:x2B VMCAI 05,Paris,France,17Jan.2005 J 30 [] I ľp.cousot

34 Implication(linear case) A B A)B (assuminga6=;) ((soundness) )(completeness) borderofaparalleltoborderofb VMCAI 05,Paris,France,17Jan.2005 J 31 [] I ľp.cousot

35 Lagrangian relaxation(linear case) A B VMCAI 05,Paris,France,17Jan.2005 J 32 [] I ľp.cousot

36 Lagrangian relaxation, formally LetVbeafinitedimensionallinearvectorspace,N>0 and8k2[0;n]:ff k 2V7!R. 0 1 N^ ff k (x) 0A)(ff 0 (x) 0) k=1 ( soundness(lagrange) ) completeness(lossless) 6) incompleteness(lossy) 9 2[1;N]7!R + :8x2V:ff 0 (x)` NX k ff k (x) 0 k=1 relaxation=approximation, i =Lagrangecoefficients VMCAI 05,Paris,France,17Jan.2005 J 33 [] I ľp.cousot

37 Lagrangian relaxation, equality constraints 0 1 N^ ff k (x)=0a)(ff 0 (x) 0) k=1 ( soundness(lagrange) 9 2[1;N]7!R + :8x2V:ff 0 (x)` NX k ff k (x) 0 k=1 NX ^ 9 0 2[1;N]7!R + :8x2V:ff 0 (x)+ 0 k ff k(x) 0 k=1,( 00 = 0` ) 2 NX [1;N]7!R:8x2V:ff 0 (x)` 00 k ff k(x) 0 k=1 VMCAI 05,Paris,France,17Jan.2005 J 34 [] I ľp.cousot

38 Example: affine Farkas lemma, informally An application of Lagrangian relaxation to the case whenaisapolyhedron B A VMCAI 05,Paris,France,17Jan.2005 J 35 [] I ľp.cousot

39 Example: affine Farkas lemma, formally Formally,ifthesystemAx+b 0isfeasiblethen 8x:Ax+b 0)cx+d 0 ((soundness; Lagrange) )(completeness; Farkas) 9 0:8x:cx+d` (Ax+b) 0: VMCAI 05,Paris,France,17Jan.2005 J 36 [] I ľp.cousot

40 Yakubovich s S-procedure, informally An application of Lagrangian relaxation to the case whenaisaquadraticform A B VMCAI 05,Paris,France,17Jan.2005 J 37 [] I ľp.cousot

41 Incompleteness(convex case) A B VMCAI 05,Paris,France,17Jan.2005 J 38 [] I ľp.cousot

42 Yakubovich s S-procedure, completeness cases Theconstraintff(x) 0isregularifandonlyif9 2 V:ff( )>0. TheS-procedureislosslessinthecaseofoneregular quadratic constraint: 8x2R n :x > P 1 x+2q > 1 x+r 1 0) x > P 0 x+2q > 0 x+r 0 0 ( (Lagrange) ) (Yakubovich) 9 0:8x2R n :x > " # " P 0 q 0 q 0 > r ` 0 P 1 q 1 q > 1 r 1 #! x 0: VMCAI 05,Paris,France,17Jan.2005 J 39 [] I ľp.cousot

43 Floyd smethodforterminationof while B do C Find an R=Q=Z-valued unkown rank function r which is: Nonnegative:9 2[1;N]7!R + i: 8x 0 ;x:r(x 0 )` NX i=1 i ff i (x 0 ;x) 0 Strictlydecreasing:9 >0:9 0 2[1;N]7!R + i: 8x 0 ;x:(r(x 0 )`r(x)` )` NX i=1 0 i ff i(x 0 ;x) 0 VMCAI 05,Paris,France,17Jan.2005 J 40 [] I ľp.cousot

44 Idea4 Parametric abstraction of the ranking function r VMCAI 05,Paris,France,17Jan.2005 J 41 [] I ľp.cousot

45 Parametric abstraction Howcanwecomputetherankingfunctionr?! parametric abstraction: 1.Fixtheformr a ofthefunctionrapriori,interm of unkown parameters a 2. Compute the parameters a numerically Examples: r a (x)=a:x > linear r a (x)=a:(x1) > affine r a (x)=(x1):a:(x1) > quadratic VMCAI 05,Paris,France,17Jan.2005 J 42 [] I ľp.cousot

46 Floyd smethodforterminationof while B do C Find R=Q=Z-valued unkown parameters a, such that: Nonnegative:9 2[1;N]7!R + i: 8x 0 ;x:r a (x 0 )` NX i=1 i ff i (x 0 ;x) 0 Strictlydecreasing:9 >0:9 0 2[1;N]7!R + i: 8x 0 ;x:(r a (x 0 )`r a (x)` )` NX i=1 0 i ff i(x 0 ;x) 0 VMCAI 05,Paris,France,17Jan.2005 J 43 [] I ľp.cousot

47 Idea5 Eliminate the universal quantification 8 using linear matrix inequalities(lmis) VMCAI 05,Paris,France,17Jan.2005 J 44 [] I ľp.cousot

48 Mathematical programming 9x2R n : N^ i=1 [Minimizing f(x)] g i (x)>0 feasibility problem: find a solution to the constraints optimization problem: find a solution, minimizing f(x) Example: Linear programming 9x2R n : Ax>b [Minimizing cx] VMCAI 05,Paris,France,17Jan.2005 J 45 [] I ľp.cousot

49 Feasibility i=1 feasibilityproblem:findasolutions2r n totheoptimization program, such that g i N^ (s) 0,ortodetermine that the problem is infeasible feasibleset:fxj V N i=1 g i (x) 0g a feasibility problem can be converted into the optimization program N^ minf`y2rj g i (x)`y 0g i=1 VMCAI 05,Paris,France,17Jan.2005 J 46 [] I ľp.cousot

50 Semidefinite programming, once again 9x2R n : M(x)<0 [Minimizing cx] Where the linear matrix inequality(lmi) is nx M(x)=M 0 + x k M k k=1 withsymetricmatrices(m k =M k > )andthepositive semidefiniteness is M(x)<0=8X2R N :X > M(x)X 0 VMCAI 05,Paris,France,17Jan.2005 J 47 [] I ľp.cousot

51 Semidefinite programming, once again Feasibility is: 9x2R n :8X2R N :X > 0 + nx k=1 1 x k M k AX 0 oftheformoftheformulæweareinterestedinforprograms which semantics can be expressed as LMIs: N^ i=1 ff i (x 0 ;x)> i 0= N^ (x 0 x1)m i (x 0 x1) > > i 0 i=1 VMCAI 05,Paris,France,17Jan.2005 J 48 [] I ľp.cousot

52 Floyd smethodforterminationof while B do C Find R=Q=Z-valued unkown parameters a, such that: Nonnegative:9 2[1;N]7!R + i: 8x 0 ;x:r a (x 0 )` NX i=1 i (x 0 x1)m i (x 0 x1) > 0 Strictlydecreasing:9 >0:9 0 2[1;N]7!R + i: 8x 0 ;x:(r a (x 0 )`r a (x)` )` NX i=1 0 i (x 0x1)M i (x 0 x1) > 0 VMCAI 05,Paris,France,17Jan.2005 J 49 [] I ľp.cousot

53 Idea6 Solve the convex constraints by semidefinite programming VMCAI 05,Paris,France,17Jan.2005 J 50 [] I ľp.cousot

54 The simplex for linear programming y AX b cx c y x Dantzig 1948, exponential in worst case, good in practice VMCAI 05,Paris,France,17Jan.2005 J 51 [] I ľp.cousot

55 Polynomial methods Ellipsoid method: Khachian 1979, polynomial in worst casebutnotgoodinpractice Interior point method: Kamarkar 1984, polynomial in worst case and good in practice(hundreds of thousands of variables) VMCAI 05,Paris,France,17Jan.2005 J 52 [] I ľp.cousot

56 The interior point method y AX b cx c y x VMCAI 05,Paris,France,17Jan.2005 J 53 [] I ľp.cousot

57 Interior point method for semidefinite programming Nesterov& Nemirovskii 1988, polynomial in worst case and good in practice(thousands of variables) y cx c y Various path strategies e.g. stay in the middle x VMCAI 05,Paris,France,17Jan.2005 J 54 [] I ľp.cousot

58 Semidefinite programming solvers ő Numerous solvers available under Mathlab,a.o.: lmilab: P. Gahinet, A. Nemirovskii, A.J. Laub, M. Chilali Sdplr: S.Burer,R.Monteiro,C.Choi Sdpt3: R.Tütüncü,K.Toh,M.Todd SeDuMi: J.Sturm bnb: J. Löfberg(integer semidefinite programming) Common interfaces to these solvers, a.o.: Yalmip: J. Löfberg Sometime need some help(feasibility radius, shift,...) VMCAI 05,Paris,France,17Jan.2005 J 55 [] I ľp.cousot

59 Linear program: termination of Euclidean division» clear all % linear inequalities % y0 q0 r0 Ai = [ 0 0 0; 0 0 0; 0 0 0]; % y q r Ai_ = [ 1 0 0; % y - 1 >= ; % q - 1 >= ]; % r >= 0 bi = [-1; -1; 0]; % linear equalities % y0 q0 r0 Ae = [ 0-1 0; % -q0 + q -1 = ; % -y0 + y = ]; % -r0 + y + r = 0 % y q r Ae_ = [ 0 1 0; 1 0 0; 1 0 1]; be = [-1; 0; 0]; Iterated forward/backward polyhedral analysis: {y>=1} q:=0; {q=0,y>=1} r:=x; {x=r,q=0,y>=1} while(y<=r)do {y<=r,q>=0} r:=r-y; {r>=0,q>=0} q:=q+1 {r>=0,q>=1} od {q>=0,y>=r+1} VMCAI 05,Paris,France,17Jan.2005 J 56 [] I ľp.cousot

60 » [N Mk(:,:,:)]=linToMk(Ai, Ai_, bi);» [M Mk(:,:,N+1:N+M)]=linToMk(Ae, Ae_, be);» [v0,v]=variables( y, q, r );» display_mk(mk, N, v0, v); +1.y -1 >= 0 +1.q -1 >= 0 +1.r >= 0-1.q0 +1.q -1 = 0-1.y0 +1.y = 0-1.r0 +1.y +1.r = 0» [diagnostic,r] = termination(v0, v, Mk, N, integer, quadratic );» disp(diagnostic) termination (bnb)» intrank(r, v) r(y,q,r) = -2.y +2.q +6.r Floyd sproposalr(x;y;q;r)=x`qismoreintuitivebutrequirestodiscover thenonlinearloopinvariantx=r+qy. VMCAI 05,Paris,France,17Jan.2005 J 57 [] I ľp.cousot

61 Imposing a feasibility radius y cx c y x VMCAI 05,Paris,France,17Jan.2005 J 58 [] I ľp.cousot

62 Quadratic program: termination of factorial Program: LMI semantics: n := 0; f := 1; while (f <= N) do n := n + 1; f := n * f od -1.f0 +1.N0 >= 0 +1.n0 >= 0 +1.f0-1 >= 0-1.n0 +1.n -1 = 0 +1.N0-1.N = 0-1.f0.n +1.f = 0 r(n,f,n) = e-01.n e-04.f e+02.N e+02 VMCAI 05,Paris,France,17Jan.2005 J 59 [] I ľp.cousot

63 Idea7 Convex abstraction of non-convex constraints VMCAI 05,Paris,France,17Jan.2005 J 60 [] I ľp.cousot

64 Semidefinite programming relaxation for polynomial programs eps = 1.0e-9; while (0 <= a) & (a <= 1 - eps) & (eps <= x) & (x <= 1) do x := a*x*(1-x) od Write the verification conditions in polynomial form, use SOS solver to relax in semidefinite programming form. SOStool+SeDuMi: r(x) = e-13.x e+00 VMCAI 05,Paris,France,17Jan.2005 J 61 [] I ľp.cousot

65 ConsideringMoreGeneral FormsofPrograms VMCAI 05,Paris,France,17Jan.2005 J 62 [] I ľp.cousot

66 Handling disjunctive loop tests and tests in loop body Bycaseanalysis and conditional Lagrangian relaxation (Lagrangian relaxation in each of the cases) VMCAI 05,Paris,France,17Jan.2005 J 63 [] I ľp.cousot

67 Loop body with tests while (x < y) do if (i >= 0) then x := x+i+1 else y := y+i fi od `! case analysis: j i 0 i<0 lmilab: r(i,x,y) = e-09.i e+07.x e+07.y e+08 VMCAI 05,Paris,France,17Jan.2005 J 64 [] I ľp.cousot

68 Quadratic termination of linear loop {n>=0} ` termination precondition i := n; j := n; while (i <> 0) do if (j > 0) then j := j - 1 else j := n; i := i - 1 fi od determined by iterated forward/backward polyhedral analysis VMCAI 05,Paris,France,17Jan.2005 J 65 [] I ľp.cousot

69 sdplr(with feasibility radius of 1.0e+3): r(n,i,j) = e-04.n^ e-05.n.i e-03.n.j e-02.n e-03.i^ e-05.i.j e+01.i e-04.j^ e-01.j e+00 Ranking function Successive values of r(n;i;j)for n=10on loop entry r(10,i,j) i j VMCAI 05,Paris,France,17Jan.2005 J 66 [] I ľp.cousot

70 Handling nested loops byinductionontheloopdepth use an iterated forward/backward symbolic analysis to get a necessary termination precondition useaforwardsymbolicsymbolicanalysistogetthe semanticsofaloopbody use Lagrangian relaxation and semidefinite programming to get the ranking function VMCAI 05,Paris,France,17Jan.2005 J 67 [] I ľp.cousot

71 Example of termination of nested loops: Bubblesort inner loop i -1 >= 0 +1.j -1 >= 0 +1.n0-1.i >= 0-1.j +1.j -1 = 0-1.i +1.i = 0-1.n +1.n0 = 0 +1.n0-1.n0 = 0 +1.n0-1.n = 0... Iterated forward/backward polyhedral analysis followed by forward analysis of the body: assume (n0 = n & j >= 0 & i >= 1 & n0 >= i & j <> i); {n0=n,i>=1,j>=0,n0>=i} assume (n01 = n0 & n1 = n & i1 = i & j1 = j); {j=j1,i=i1,n0=n1,n0=n01,n0=n,i>=1,j>=0,n0>=i} j := j + 1 {j=j1+1,i=i1,n0=n1,n0=n01,n0=n,i>=1,j>=1,n0>=i} termination (lmilab) r(n0,n,i,j) = n n i -2.j VMCAI 05,Paris,France,17Jan.2005 J 68 [] I ľp.cousot

72 Example of termination of nested loops: Bubblesort outer loop i +1 >= 0 +1.n0-1.i -1 >= 0 +1.i -1.j +1 = 0-1.i +1.i +1 = 0-1.n +1.n0 = 0 +1.n0-1.n0 = 0 +1.n0-1.n = 0... Iterated forward/backward polyhedral analysis followed by forward analysis of the body: assume (n0=n & i>=0 & n>=i & i <> 0); {n0=n,i>=0,n0>=i} assume (n01=n0 & n1=n & i1=i & j1=j); {j1=j,i=i1,n0=n1,n0=n01,n0=n,i>=0,n0>=i} j := 0; while (j <> i) do j := j + 1 od; i := i - 1 {i+1=j,i+1=i1,n0=n1,n0=n01,n0=n,i+1>=0,n0>=i+1} termination (lmilab) r(n0,n,i,j) = n n i VMCAI 05,Paris,France,17Jan.2005 J 69 [] I ľp.cousot

73 Bycaseanalysis Handling nondeterminacy Same for concurrency by interleaving Same with fairness by nondeterministic interleaving with encoding of an explicit scheduler VMCAI 05,Paris,France,17Jan.2005 J 70 [] I ľp.cousot

74 Termination of a concurrent program [ 1: while [x+2 < y] do 2: [x := x + 1] od 3: 1: while [x+2 < y] do 2: [y := y - 1] od 3: ] interleaving `! while (x+2 < y) do if?=0 then x := x + 1 else if?=0 then y := y - 1 else x := x + 1; y := y - 1 fi fi od penbmi: r(x,y) = e+00.x e+00.y e-01 VMCAI 05,Paris,France,17Jan.2005 J 71 [] I ľp.cousot

75 Termination of a fair parallel program [[ while [(x>0) (y>0) do x := x - 1] od while [(x>0) (y>0) do y := y - 1] od ]] interleaving +scheduler `! {m>=1} terminationpreconditiondeterminedbyiterated forward/backward polyhedral analysis t :=?; assume (0 <= t & t <= 1); s :=?; assume ((1 <= s) & (s <= m)); while ((x > 0) (y > 0)) do if (t = 1) then x := x - 1 else y := y - 1 fi; s := s - 1; if (s = 0) then if (t = 1) then t := 0 else t := 1 fi; s :=?; assume ((1 <= s) & (s <= m)) else skip fi od;; penbmi: r(x,y,m,s,t) = e+00.x e+00.y e-02.m e-07.s e-06.t e+03 VMCAI 05,Paris,France,17Jan.2005 J 72 [] I ľp.cousot

76 RelaxedParametric InvarianceProofMethod VMCAI 05,Paris,France,17Jan.2005 J 73 [] I ľp.cousot

77 Floyd s method for invariance GivenalooppreconditionP,findanunkownloopinvariant I such that: The invariant is initial: 8x:P(x)) I " The invariant is inductive: (x) 8x;x 0 :I(x)^ B;C (x;x 0 )) I " "??? (x 0 ) VMCAI 05,Paris,France,17Jan.2005 J 74 [] I ľp.cousot

78 Abstraction ExpressloopsemanticsasaconjunctionofLMIconstraints(by relaxation for polynomial semantics) Eliminate the conjunction and implication by Lagrangian relaxation Fixtheformoftheunkowninvariantbyparametric abstraction... weget... VMCAI 05,Paris,France,17Jan.2005 J 75 [] I ľp.cousot

79 Floyd s method for numerical programs Find R=Q=Z-valued unkown parameters a, such that: Theinvariantisinitial:9 2R + : 8x:I a (x)` :P(x) 0 Theinvariantisinductive:9 2[0;N]`!R + : NX 8x;x 0 :I a (x 0 )` 0 :I a (x) ` k :ff k (x;x 0 ) 0 " " k=1 bilinearin 0 anda VMCAI 05,Paris,France,17Jan.2005 J 76 [] I ľp.cousot

80 Idea8 Solve the bilinear matrix inequality(bmi) by semidefinite programming VMCAI 05,Paris,France,17Jan.2005 J 77 [] I ľp.cousot

81 Bilinear matrix inequality(bmi) solvers 9x2R n : m^ i=1 i 0 + n X k=1 [Minimizingx > Qx+cx] x k M i k + n X k=1 ő Two solvers available under Mathlab: PenBMI: M. Kočvara, M. Stingl bmibnb: J. Löfberg Common interfaces to these solvers: Yalmip: J. Löfberg nx =1 1 x k x Nk i <0 A VMCAI 05,Paris,France,17Jan.2005 J 78 [] I ľp.cousot

82 Program: Example: linear invariant Invariant: i := 2; j := 0; while (??) do if (??) then i := i + 4 else i := i + 2; j := j + 1 fi od; e-12*i e-10*j >= 0 Lessnaturalthani`2j`2 0 Alternative: - Determine parameters(a) by other methods (e.g. random interpretation) -UseBMIsolverstocheckforinvariance VMCAI 05,Paris,France,17Jan.2005 J 79 [] I ľp.cousot

83 Conclusion VMCAI 05,Paris,France,17Jan.2005 J 80 [] I ľp.cousot

84 Constraint resolution failure infeasibility of the constraints does not mean non termination or non invariance but simply failure inherent to abstraction! VMCAI 05,Paris,France,17Jan.2005 J 81 [] I ľp.cousot

85 Numerical errors LMI/BMI solvers do numerical computations with rounding errors, shifts, etc ranking function is subject to numerical errors thehardpointistodiscoveracandidatefortheranking function much less difficult, when the ranking function is known, to re-check for satisfaction(e.g. by static analysis) not very satisfactory for invariance(checking only???) VMCAI 05,Paris,France,17Jan.2005 J 82 [] I ľp.cousot

86 Related work Linear case(farkas lemma): - Invariants: Sankaranarayanan, Spima, Manna(CAV 03, SAS 04, heuristic solver) - Termination: Podelski& Rybalchenko(VMCAI 03, Lagrange coefficients eliminated by hand to reduce to linear programming so no disjunctions, no tests, etc) - Parallelization& scheduling: Feautrier, easily generalizable to nonlinear case VMCAI 05,Paris,France,17Jan.2005 J 83 [] I ľp.cousot

87 Seminal work LMI case, Lyapunov 1890, aninvariantsetofadifferential equation is stableinthesensethatitattracts all solutions if one canfindafunctionthatis bounded from below and decreases along all solutions outside the invariant set. VMCAI 05,Paris,France,17Jan.2005 J 84 [] I ľp.cousot

88 THE END, THANK YOU VMCAI 05,Paris,France,17Jan.2005 J 85 [] I ľp.cousot

89 THE END, THANK YOU VMCAI 05,Paris,France,17Jan.2005 J 85 [] I ľp.cousot

«Proving Program Invariance and Termination by Parametric Abstraction, Lagrangian Relaxation and Semidefinite Programming»

«Proving Program Invariance and Termination by Parametric Abstraction, Lagrangian Relaxation and Semidefinite Programming» «Proving Program Invariance and Termination by Parametric Abstraction, Lagrangian Relaxation and Semidefinite Programming» Patrick Cousot École normale supérieure 45rued Ulm,75230Pariscedex05,France Patrick.Cousot@ens.fr

More information

«Proving Program Invariance and Termination by Parametric Abstraction, Lagrangian Relaxation and Semidefinite Programming»

«Proving Program Invariance and Termination by Parametric Abstraction, Lagrangian Relaxation and Semidefinite Programming» «Proving Program Invariance and Termination by Parametric Abstraction, Lagrangian Relaxation and Semidefinite Programming» Patrick Cousot École normale supérieure 45rued Ulm,7523Pariscedex5,France Patrick.Cousot@ens.fr

More information

«A Lagrangian relaxation and mathematical programming framework for static analysis and verification» Static analysis. An impromptu 1 invited talk :-)

«A Lagrangian relaxation and mathematical programming framework for static analysis and verification» Static analysis. An impromptu 1 invited talk :-) 1 An impromptu 1 invited talk :-) on summer work with Radhia Cousot. 3 «A Lagrangian relaxation and mathematical programming framework for static analysis and verification» Patrick Cousot École normale

More information

Proving Program Invariance and Termination by Parametric Abstraction, Lagrangian Relaxation and Semidefinite Programming

Proving Program Invariance and Termination by Parametric Abstraction, Lagrangian Relaxation and Semidefinite Programming Proving Program Invariance and Termination by Parametric Abstraction, Lagrangian Relaxation and Semidefinite Programming 1 Patrick Cousot École Normale Supérieure 45 rue d Ulm, 75230 Paris cedex 05 (France)

More information

«ATutorialon Abstract Interpretation»

«ATutorialon Abstract Interpretation» «ATutorialon Abstract Interpretation» Patrick Cousot École normale supérieure 45 rue d Ulm 75230 Paris cedex 05, France Patrick.Cousot@ens.fr www.di.ens.fr/~cousot VMCAI 05 Industrial Day VMCAI 05 Industrial

More information

Constraint Solving for Program Verification: Theory and Practice by Example

Constraint Solving for Program Verification: Theory and Practice by Example Constraint Solving for Program Verification: Theory and Practice by Example Andrey Rybalchenko Technische Universität München Abstract. Program verification relies on the construction of auxiliary assertions

More information

The Polyranking Principle

The Polyranking Principle The Polyranking Principle Aaron R. Bradley, Zohar Manna, and Henny B. Sipma Computer Science Department Stanford University Stanford, CA 94305-9045 {arbrad,zm,sipma}@theory.stanford.edu Abstract. Although

More information

Constraint Solving for Program Verification: Theory and Practice by Example

Constraint Solving for Program Verification: Theory and Practice by Example Constraint Solving for Program Verification: Theory and Practice by Example Andrey Rybalchenko Technische Universität München Abstract. Program verification relies on the construction of auxiliary assertions

More information

Verification Constraint Problems with Strengthening

Verification Constraint Problems with Strengthening Verification Constraint Problems with Strengthening Aaron R. Bradley and Zohar Manna Computer Science Department Stanford University Stanford, CA 94305-9045 {arbrad,manna}@cs.stanford.edu Abstract. The

More information

Hoare Logic (I): Axiomatic Semantics and Program Correctness

Hoare Logic (I): Axiomatic Semantics and Program Correctness Hoare Logic (I): Axiomatic Semantics and Program Correctness (Based on [Apt and Olderog 1991; Gries 1981; Hoare 1969; Kleymann 1999; Sethi 199]) Yih-Kuen Tsay Dept. of Information Management National Taiwan

More information

Termination Analysis of Loops

Termination Analysis of Loops Termination Analysis of Loops Zohar Manna with Aaron R. Bradley Computer Science Department Stanford University 1 Example: GCD Algorithm gcd(y 1, y 2 ) = gcd(y 1 y 2, y 2 ) if y 1 > y 2 gcd(y 1, y 2 y

More information

Input: System of inequalities or equalities over the reals R. Output: Value for variables that minimizes cost function

Input: System of inequalities or equalities over the reals R. Output: Value for variables that minimizes cost function Linear programming Input: System of inequalities or equalities over the reals R A linear cost function Output: Value for variables that minimizes cost function Example: Minimize 6x+4y Subject to 3x + 2y

More information

A strongly polynomial algorithm for linear systems having a binary solution

A strongly polynomial algorithm for linear systems having a binary solution A strongly polynomial algorithm for linear systems having a binary solution Sergei Chubanov Institute of Information Systems at the University of Siegen, Germany e-mail: sergei.chubanov@uni-siegen.de 7th

More information

Lecture 5: Loop Invariants and Insertion-sort

Lecture 5: Loop Invariants and Insertion-sort Lecture 5: Loop Invariants and Insertion-sort COMS10007 - Algorithms Dr. Christian Konrad 11.01.2019 Dr. Christian Konrad Lecture 5: Loop Invariants and Insertion-sort 1 / 12 Proofs by Induction Structure

More information

Abstract Interpretation with Higher-Dimensional Ellipsoids and Conic Extrapolation

Abstract Interpretation with Higher-Dimensional Ellipsoids and Conic Extrapolation Abstract Interpretation with Higher-Dimensional Ellipsoids and Conic Extrapolation or potatoes & ice cream cones Mendes Oulamara, Arnaud Venet Computer Aided Verification, 2015 July 22, 2015 ÉCOLE NORMALE

More information

Example: feasibility. Interpretation as formal proof. Example: linear inequalities and Farkas lemma

Example: feasibility. Interpretation as formal proof. Example: linear inequalities and Farkas lemma 4-1 Algebra and Duality P. Parrilo and S. Lall 2006.06.07.01 4. Algebra and Duality Example: non-convex polynomial optimization Weak duality and duality gap The dual is not intrinsic The cone of valid

More information

Course 311: Michaelmas Term 2005 Part III: Topics in Commutative Algebra

Course 311: Michaelmas Term 2005 Part III: Topics in Commutative Algebra Course 311: Michaelmas Term 2005 Part III: Topics in Commutative Algebra D. R. Wilkins Contents 3 Topics in Commutative Algebra 2 3.1 Rings and Fields......................... 2 3.2 Ideals...............................

More information

Hoare Logic I. Introduction to Deductive Program Verification. Simple Imperative Programming Language. Hoare Logic. Meaning of Hoare Triples

Hoare Logic I. Introduction to Deductive Program Verification. Simple Imperative Programming Language. Hoare Logic. Meaning of Hoare Triples Hoare Logic I Introduction to Deductive Program Verification Işıl Dillig Program Spec Deductive verifier FOL formula Theorem prover valid contingent Example specs: safety (no crashes), absence of arithmetic

More information

The Assignment Axiom (Hoare)

The Assignment Axiom (Hoare) The Assignment Axiom (Hoare) Syntax: V := E Semantics: value of V in final state is value of E in initial state Example: X:=X+ (adds one to the value of the variable X) The Assignment Axiom {Q[E/V ]} V

More information

Lecture Note 5: Semidefinite Programming for Stability Analysis

Lecture Note 5: Semidefinite Programming for Stability Analysis ECE7850: Hybrid Systems:Theory and Applications Lecture Note 5: Semidefinite Programming for Stability Analysis Wei Zhang Assistant Professor Department of Electrical and Computer Engineering Ohio State

More information

LMI MODELLING 4. CONVEX LMI MODELLING. Didier HENRION. LAAS-CNRS Toulouse, FR Czech Tech Univ Prague, CZ. Universidad de Valladolid, SP March 2009

LMI MODELLING 4. CONVEX LMI MODELLING. Didier HENRION. LAAS-CNRS Toulouse, FR Czech Tech Univ Prague, CZ. Universidad de Valladolid, SP March 2009 LMI MODELLING 4. CONVEX LMI MODELLING Didier HENRION LAAS-CNRS Toulouse, FR Czech Tech Univ Prague, CZ Universidad de Valladolid, SP March 2009 Minors A minor of a matrix F is the determinant of a submatrix

More information

Robust and Optimal Control, Spring 2015

Robust and Optimal Control, Spring 2015 Robust and Optimal Control, Spring 2015 Instructor: Prof. Masayuki Fujita (S5-303B) D. Linear Matrix Inequality D.1 Convex Optimization D.2 Linear Matrix Inequality(LMI) D.3 Control Design and LMI Formulation

More information

An Abstract Domain to Infer Ordinal-Valued Ranking Functions

An Abstract Domain to Infer Ordinal-Valued Ranking Functions An Abstract Domain to Infer Ordinal-Valued Ranking Functions Caterina Urban and Antoine Miné ÉNS & CNRS & INRIA, Paris, France urban@di.ens.fr, mine@di.ens.fr Abstract. The traditional method for proving

More information

The maximal stable set problem : Copositive programming and Semidefinite Relaxations

The maximal stable set problem : Copositive programming and Semidefinite Relaxations The maximal stable set problem : Copositive programming and Semidefinite Relaxations Kartik Krishnan Department of Mathematical Sciences Rensselaer Polytechnic Institute Troy, NY 12180 USA kartis@rpi.edu

More information

Semidefinite Programming

Semidefinite Programming Semidefinite Programming Basics and SOS Fernando Mário de Oliveira Filho Campos do Jordão, 2 November 23 Available at: www.ime.usp.br/~fmario under talks Conic programming V is a real vector space h, i

More information

4. Algebra and Duality

4. Algebra and Duality 4-1 Algebra and Duality P. Parrilo and S. Lall, CDC 2003 2003.12.07.01 4. Algebra and Duality Example: non-convex polynomial optimization Weak duality and duality gap The dual is not intrinsic The cone

More information

CS357: CTL Model Checking (two lectures worth) David Dill

CS357: CTL Model Checking (two lectures worth) David Dill CS357: CTL Model Checking (two lectures worth) David Dill 1 CTL CTL = Computation Tree Logic It is a propositional temporal logic temporal logic extended to properties of events over time. CTL is a branching

More information

Geometric Quantifier Elimination Heuristics for Automatically Generating Octagonal and Max-plus Invariants

Geometric Quantifier Elimination Heuristics for Automatically Generating Octagonal and Max-plus Invariants Geometric Quantifier Elimination Heuristics for Automatically Generating Octagonal and Max-plus Invariants Deepak Kapur 1 Zhihai Zhang 2 Matthias Horbach 1 Hengjun Zhao 3 Qi Lu 1 and ThanhVu Nguyen 1 1

More information

COURSE ON LMI PART I.2 GEOMETRY OF LMI SETS. Didier HENRION henrion

COURSE ON LMI PART I.2 GEOMETRY OF LMI SETS. Didier HENRION   henrion COURSE ON LMI PART I.2 GEOMETRY OF LMI SETS Didier HENRION www.laas.fr/ henrion October 2006 Geometry of LMI sets Given symmetric matrices F i we want to characterize the shape in R n of the LMI set F

More information

1 Strict local optimality in unconstrained optimization

1 Strict local optimality in unconstrained optimization ORF 53 Lecture 14 Spring 016, Princeton University Instructor: A.A. Ahmadi Scribe: G. Hall Thursday, April 14, 016 When in doubt on the accuracy of these notes, please cross check with the instructor s

More information

The moment-lp and moment-sos approaches

The moment-lp and moment-sos approaches The moment-lp and moment-sos approaches LAAS-CNRS and Institute of Mathematics, Toulouse, France CIRM, November 2013 Semidefinite Programming Why polynomial optimization? LP- and SDP- CERTIFICATES of POSITIVITY

More information

Module 04 Optimization Problems KKT Conditions & Solvers

Module 04 Optimization Problems KKT Conditions & Solvers Module 04 Optimization Problems KKT Conditions & Solvers Ahmad F. Taha EE 5243: Introduction to Cyber-Physical Systems Email: ahmad.taha@utsa.edu Webpage: http://engineering.utsa.edu/ taha/index.html September

More information

Lecture 1 Introduction

Lecture 1 Introduction L. Vandenberghe EE236A (Fall 2013-14) Lecture 1 Introduction course overview linear optimization examples history approximate syllabus basic definitions linear optimization in vector and matrix notation

More information

King Fahd University of Petroleum and Minerals Prep-Year Math Program Math Term 161 Recitation (R1, R2)

King Fahd University of Petroleum and Minerals Prep-Year Math Program Math Term 161 Recitation (R1, R2) Math 001 - Term 161 Recitation (R1, R) Question 1: How many rational and irrational numbers are possible between 0 and 1? (a) 1 (b) Finite (c) 0 (d) Infinite (e) Question : A will contain how many elements

More information

6-1 The Positivstellensatz P. Parrilo and S. Lall, ECC

6-1 The Positivstellensatz P. Parrilo and S. Lall, ECC 6-1 The Positivstellensatz P. Parrilo and S. Lall, ECC 2003 2003.09.02.10 6. The Positivstellensatz Basic semialgebraic sets Semialgebraic sets Tarski-Seidenberg and quantifier elimination Feasibility

More information

arxiv: v1 [math.oc] 31 Jan 2017

arxiv: v1 [math.oc] 31 Jan 2017 CONVEX CONSTRAINED SEMIALGEBRAIC VOLUME OPTIMIZATION: APPLICATION IN SYSTEMS AND CONTROL 1 Ashkan Jasour, Constantino Lagoa School of Electrical Engineering and Computer Science, Pennsylvania State University

More information

Modern Optimal Control

Modern Optimal Control Modern Optimal Control Matthew M. Peet Arizona State University Lecture 19: Stabilization via LMIs Optimization Optimization can be posed in functional form: min x F objective function : inequality constraints

More information

Logical Abstract Domains and Interpretations

Logical Abstract Domains and Interpretations Logical Abstract Domains and Interpretations Patrick Cousot 2,3, Radhia Cousot 3,1, and Laurent Mauborgne 3,4 1 Centre National de la Recherche Scientifique, Paris 2 Courant Institute of Mathematical Sciences,

More information

Program verification

Program verification Program verification Data-flow analyses, numerical domains Laure Gonnord and David Monniaux University of Lyon / LIP September 29, 2015 1 / 75 Context Program Verification / Code generation: Variables

More information

Enumerate all possible assignments and take the An algorithm is a well-defined computational

Enumerate all possible assignments and take the An algorithm is a well-defined computational EMIS 8374 [Algorithm Design and Analysis] 1 EMIS 8374 [Algorithm Design and Analysis] 2 Designing and Evaluating Algorithms A (Bad) Algorithm for the Assignment Problem Enumerate all possible assignments

More information

Constraint-Based Static Analysis of Programs

Constraint-Based Static Analysis of Programs Constraint-Based Static Analysis of Programs Joint work with Michael Colon, Sriram Sankaranarayanan, Aaron Bradley and Zohar Manna Henny Sipma Stanford University Master Class Seminar at Washington University

More information

Eventual Linear Ranking Functions

Eventual Linear Ranking Functions Eventual Linear Ranking Functions Roberto BAGNARA 1 Fred MESNARD 2 1 BUGSENG & Dipartimento di Matematica e Informatica, Università di Parma, Italy 2 LIM, université de la Réunion, France PPDP 2013 Bagnara,

More information

CS 6820 Fall 2014 Lectures, October 3-20, 2014

CS 6820 Fall 2014 Lectures, October 3-20, 2014 Analysis of Algorithms Linear Programming Notes CS 6820 Fall 2014 Lectures, October 3-20, 2014 1 Linear programming The linear programming (LP) problem is the following optimization problem. We are given

More information

The Q-parametrization (Youla) Lecture 13: Synthesis by Convex Optimization. Lecture 13: Synthesis by Convex Optimization. Example: Spring-mass System

The Q-parametrization (Youla) Lecture 13: Synthesis by Convex Optimization. Lecture 13: Synthesis by Convex Optimization. Example: Spring-mass System The Q-parametrization (Youla) Lecture 3: Synthesis by Convex Optimization controlled variables z Plant distubances w Example: Spring-mass system measurements y Controller control inputs u Idea for lecture

More information

The Abstract Domain of Segmented Ranking Functions

The Abstract Domain of Segmented Ranking Functions The Abstract Domain of Segmented Ranking Functions Caterina Urban To cite this version: Caterina Urban. The Abstract Domain of Segmented Ranking Functions. Logozzo, Francesco and Fähndrich, Manuel. Static

More information

Optimality, Duality, Complementarity for Constrained Optimization

Optimality, Duality, Complementarity for Constrained Optimization Optimality, Duality, Complementarity for Constrained Optimization Stephen Wright University of Wisconsin-Madison May 2014 Wright (UW-Madison) Optimality, Duality, Complementarity May 2014 1 / 41 Linear

More information

Automatic Generation of Polynomial Invariants for System Verification

Automatic Generation of Polynomial Invariants for System Verification Automatic Generation of Polynomial Invariants for System Verification Enric Rodríguez-Carbonell Technical University of Catalonia Talk at EPFL Nov. 2006 p.1/60 Plan of the Talk Introduction Need for program

More information

Design of Distributed Systems Melinda Tóth, Zoltán Horváth

Design of Distributed Systems Melinda Tóth, Zoltán Horváth Design of Distributed Systems Melinda Tóth, Zoltán Horváth Design of Distributed Systems Melinda Tóth, Zoltán Horváth Publication date 2014 Copyright 2014 Melinda Tóth, Zoltán Horváth Supported by TÁMOP-412A/1-11/1-2011-0052

More information

Rank-one LMIs and Lyapunov's Inequality. Gjerrit Meinsma 4. Abstract. We describe a new proof of the well-known Lyapunov's matrix inequality about

Rank-one LMIs and Lyapunov's Inequality. Gjerrit Meinsma 4. Abstract. We describe a new proof of the well-known Lyapunov's matrix inequality about Rank-one LMIs and Lyapunov's Inequality Didier Henrion 1;; Gjerrit Meinsma Abstract We describe a new proof of the well-known Lyapunov's matrix inequality about the location of the eigenvalues of a matrix

More information

Course Outline. FRTN10 Multivariable Control, Lecture 13. General idea for Lectures Lecture 13 Outline. Example 1 (Doyle Stein, 1979)

Course Outline. FRTN10 Multivariable Control, Lecture 13. General idea for Lectures Lecture 13 Outline. Example 1 (Doyle Stein, 1979) Course Outline FRTN Multivariable Control, Lecture Automatic Control LTH, 6 L-L Specifications, models and loop-shaping by hand L6-L8 Limitations on achievable performance L9-L Controller optimization:

More information

Fast Algorithms for SDPs derived from the Kalman-Yakubovich-Popov Lemma

Fast Algorithms for SDPs derived from the Kalman-Yakubovich-Popov Lemma Fast Algorithms for SDPs derived from the Kalman-Yakubovich-Popov Lemma Venkataramanan (Ragu) Balakrishnan School of ECE, Purdue University 8 September 2003 European Union RTN Summer School on Multi-Agent

More information

III. Linear Programming

III. Linear Programming III. Linear Programming Thomas Sauerwald Easter 2017 Outline Introduction Standard and Slack Forms Formulating Problems as Linear Programs Simplex Algorithm Finding an Initial Solution III. Linear Programming

More information

Lecture Note 3: Interpolation and Polynomial Approximation. Xiaoqun Zhang Shanghai Jiao Tong University

Lecture Note 3: Interpolation and Polynomial Approximation. Xiaoqun Zhang Shanghai Jiao Tong University Lecture Note 3: Interpolation and Polynomial Approximation Xiaoqun Zhang Shanghai Jiao Tong University Last updated: October 10, 2015 2 Contents 1.1 Introduction................................ 3 1.1.1

More information

Semidefinite and Second Order Cone Programming Seminar Fall 2012 Project: Robust Optimization and its Application of Robust Portfolio Optimization

Semidefinite and Second Order Cone Programming Seminar Fall 2012 Project: Robust Optimization and its Application of Robust Portfolio Optimization Semidefinite and Second Order Cone Programming Seminar Fall 2012 Project: Robust Optimization and its Application of Robust Portfolio Optimization Instructor: Farid Alizadeh Author: Ai Kagawa 12/12/2012

More information

15-780: LinearProgramming

15-780: LinearProgramming 15-780: LinearProgramming J. Zico Kolter February 1-3, 2016 1 Outline Introduction Some linear algebra review Linear programming Simplex algorithm Duality and dual simplex 2 Outline Introduction Some linear

More information

Lecture 6 Verification of Hybrid Systems

Lecture 6 Verification of Hybrid Systems Lecture 6 Verification of Hybrid Systems Ufuk Topcu Nok Wongpiromsarn Richard M. Murray AFRL, 25 April 2012 Outline: A hybrid system model Finite-state abstractions and use of model checking Deductive

More information

FRTN10 Multivariable Control, Lecture 13. Course outline. The Q-parametrization (Youla) Example: Spring-mass System

FRTN10 Multivariable Control, Lecture 13. Course outline. The Q-parametrization (Youla) Example: Spring-mass System FRTN Multivariable Control, Lecture 3 Anders Robertsson Automatic Control LTH, Lund University Course outline The Q-parametrization (Youla) L-L5 Purpose, models and loop-shaping by hand L6-L8 Limitations

More information

Geometric problems. Chapter Projection on a set. The distance of a point x 0 R n to a closed set C R n, in the norm, is defined as

Geometric problems. Chapter Projection on a set. The distance of a point x 0 R n to a closed set C R n, in the norm, is defined as Chapter 8 Geometric problems 8.1 Projection on a set The distance of a point x 0 R n to a closed set C R n, in the norm, is defined as dist(x 0,C) = inf{ x 0 x x C}. The infimum here is always achieved.

More information

From Satisfiability to Linear Algebra

From Satisfiability to Linear Algebra From Satisfiability to Linear Algebra Fangzhen Lin Department of Computer Science Hong Kong University of Science and Technology Clear Water Bay, Kowloon, Hong Kong Technical Report August 2013 1 Introduction

More information

C&O367: Nonlinear Optimization (Winter 2013) Assignment 4 H. Wolkowicz

C&O367: Nonlinear Optimization (Winter 2013) Assignment 4 H. Wolkowicz C&O367: Nonlinear Optimization (Winter 013) Assignment 4 H. Wolkowicz Posted Mon, Feb. 8 Due: Thursday, Feb. 8 10:00AM (before class), 1 Matrices 1.1 Positive Definite Matrices 1. Let A S n, i.e., let

More information

Convex Optimization. (EE227A: UC Berkeley) Lecture 28. Suvrit Sra. (Algebra + Optimization) 02 May, 2013

Convex Optimization. (EE227A: UC Berkeley) Lecture 28. Suvrit Sra. (Algebra + Optimization) 02 May, 2013 Convex Optimization (EE227A: UC Berkeley) Lecture 28 (Algebra + Optimization) 02 May, 2013 Suvrit Sra Admin Poster presentation on 10th May mandatory HW, Midterm, Quiz to be reweighted Project final report

More information

A Brief Review on Convex Optimization

A Brief Review on Convex Optimization A Brief Review on Convex Optimization 1 Convex set S R n is convex if x,y S, λ,µ 0, λ+µ = 1 λx+µy S geometrically: x,y S line segment through x,y S examples (one convex, two nonconvex sets): A Brief Review

More information

8. Geometric problems

8. Geometric problems 8. Geometric problems Convex Optimization Boyd & Vandenberghe extremal volume ellipsoids centering classification placement and facility location 8 Minimum volume ellipsoid around a set Löwner-John ellipsoid

More information

arxiv: v1 [cs.pl] 25 Apr 2016

arxiv: v1 [cs.pl] 25 Apr 2016 Termination Analysis of Probabilistic Programs through Positivstellensatz s Krishnendu Chatterjee 1, Hongfei Fu 1,2, and Amir Kafshdar Goharshady 1 arxiv:1604.07169v1 [cs.pl] 25 Apr 2016 1 IST Austria

More information

Discovering Non-Linear Ranking Functions by Solving Semi-Algebraic Systems

Discovering Non-Linear Ranking Functions by Solving Semi-Algebraic Systems Discovering Non-Linear Ranking Functions by Solving Semi-Algebraic Systems Yinghua Chen 1, Bican Xia 1, Lu Yang 2, Naijun Zhan 3, and Chaochen Zhou 3 1 LMAM & School of Mathematical Sciences, Peking University

More information

15.081J/6.251J Introduction to Mathematical Programming. Lecture 18: The Ellipsoid method

15.081J/6.251J Introduction to Mathematical Programming. Lecture 18: The Ellipsoid method 15.081J/6.251J Introduction to Mathematical Programming Lecture 18: The Ellipsoid method 1 Outline Efficient algorithms and computational complexity Slide 1 The key geometric result behind the ellipsoid

More information

Handout #6 INTRODUCTION TO ALGEBRAIC STRUCTURES: Prof. Moseley AN ALGEBRAIC FIELD

Handout #6 INTRODUCTION TO ALGEBRAIC STRUCTURES: Prof. Moseley AN ALGEBRAIC FIELD Handout #6 INTRODUCTION TO ALGEBRAIC STRUCTURES: Prof. Moseley Chap. 2 AN ALGEBRAIC FIELD To introduce the notion of an abstract algebraic structure we consider (algebraic) fields. (These should not to

More information

c 2000 Society for Industrial and Applied Mathematics

c 2000 Society for Industrial and Applied Mathematics SIAM J. OPIM. Vol. 10, No. 3, pp. 750 778 c 2000 Society for Industrial and Applied Mathematics CONES OF MARICES AND SUCCESSIVE CONVEX RELAXAIONS OF NONCONVEX SES MASAKAZU KOJIMA AND LEVEN UNÇEL Abstract.

More information

8. Geometric problems

8. Geometric problems 8. Geometric problems Convex Optimization Boyd & Vandenberghe extremal volume ellipsoids centering classification placement and facility location 8 1 Minimum volume ellipsoid around a set Löwner-John ellipsoid

More information

Input: A set (x i -yy i ) data. Output: Function value at arbitrary point x. What for x = 1.2?

Input: A set (x i -yy i ) data. Output: Function value at arbitrary point x. What for x = 1.2? Applied Numerical Analysis Interpolation Lecturer: Emad Fatemizadeh Interpolation Input: A set (x i -yy i ) data. Output: Function value at arbitrary point x. 0 1 4 1-3 3 9 What for x = 1.? Interpolation

More information

EE/ACM Applications of Convex Optimization in Signal Processing and Communications Lecture 18

EE/ACM Applications of Convex Optimization in Signal Processing and Communications Lecture 18 EE/ACM 150 - Applications of Convex Optimization in Signal Processing and Communications Lecture 18 Andre Tkacenko Signal Processing Research Group Jet Propulsion Laboratory May 31, 2012 Andre Tkacenko

More information

Lecture Note 3: Polynomial Interpolation. Xiaoqun Zhang Shanghai Jiao Tong University

Lecture Note 3: Polynomial Interpolation. Xiaoqun Zhang Shanghai Jiao Tong University Lecture Note 3: Polynomial Interpolation Xiaoqun Zhang Shanghai Jiao Tong University Last updated: October 24, 2013 1.1 Introduction We first look at some examples. Lookup table for f(x) = 2 π x 0 e x2

More information

Lecture 6 Simplex method for linear programming

Lecture 6 Simplex method for linear programming Lecture 6 Simplex method for linear programming Weinan E 1,2 and Tiejun Li 2 1 Department of Mathematics, Princeton University, weinan@princeton.edu 2 School of Mathematical Sciences, Peking University,

More information

«Basic Concepts of Abstract Interpretation»

«Basic Concepts of Abstract Interpretation» «Basic Concepts of Abstract Interpretation» Patrick Cousot École normale supérieure 45 rue d Ulm 75230 Paris cedex 05, France Patrick.Cousot@ens.fr www.di.ens.fr/~cousot IFIP WCC Topical day on Abstract

More information

Convex Optimization. Newton s method. ENSAE: Optimisation 1/44

Convex Optimization. Newton s method. ENSAE: Optimisation 1/44 Convex Optimization Newton s method ENSAE: Optimisation 1/44 Unconstrained minimization minimize f(x) f convex, twice continuously differentiable (hence dom f open) we assume optimal value p = inf x f(x)

More information

Introduction to Semidefinite Programming I: Basic properties a

Introduction to Semidefinite Programming I: Basic properties a Introduction to Semidefinite Programming I: Basic properties and variations on the Goemans-Williamson approximation algorithm for max-cut MFO seminar on Semidefinite Programming May 30, 2010 Semidefinite

More information

CSCI : Optimization and Control of Networks. Review on Convex Optimization

CSCI : Optimization and Control of Networks. Review on Convex Optimization CSCI7000-016: Optimization and Control of Networks Review on Convex Optimization 1 Convex set S R n is convex if x,y S, λ,µ 0, λ+µ = 1 λx+µy S geometrically: x,y S line segment through x,y S examples (one

More information

The Reachability-Bound Problem. Gulwani and Zuleger PLDI 10

The Reachability-Bound Problem. Gulwani and Zuleger PLDI 10 The Reachability-Bound Problem Gulwani and Zuleger PLDI 10 CS252r Spring 2011 The Reachability-Bound problem Find a symbolic worst case bound on the number of times a program point is reached Intra-procedural:

More information

Appendix A Solving Linear Matrix Inequality (LMI) Problems

Appendix A Solving Linear Matrix Inequality (LMI) Problems Appendix A Solving Linear Matrix Inequality (LMI) Problems In this section, we present a brief introduction about linear matrix inequalities which have been used extensively to solve the FDI problems described

More information

Advances in Convex Optimization: Theory, Algorithms, and Applications

Advances in Convex Optimization: Theory, Algorithms, and Applications Advances in Convex Optimization: Theory, Algorithms, and Applications Stephen Boyd Electrical Engineering Department Stanford University (joint work with Lieven Vandenberghe, UCLA) ISIT 02 ISIT 02 Lausanne

More information

Generation of. Polynomial Equality Invariants. by Abstract Interpretation

Generation of. Polynomial Equality Invariants. by Abstract Interpretation Generation of Polynomial Equality Invariants by Abstract Interpretation Enric Rodríguez-Carbonell Universitat Politècnica de Catalunya (UPC) Barcelona Joint work with Deepak Kapur (UNM) 1 Introduction

More information

15.083J/6.859J Integer Optimization. Lecture 10: Solving Relaxations

15.083J/6.859J Integer Optimization. Lecture 10: Solving Relaxations 15.083J/6.859J Integer Optimization Lecture 10: Solving Relaxations 1 Outline The key geometric result behind the ellipsoid method Slide 1 The ellipsoid method for the feasibility problem The ellipsoid

More information

«Specification and Abstraction of Semantics» 1. Souvenir, Souvenir. Neil D. Jones. Contents. A Tribute Workshop and Festival to Honor Neil D.

«Specification and Abstraction of Semantics» 1. Souvenir, Souvenir. Neil D. Jones. Contents. A Tribute Workshop and Festival to Honor Neil D. «Specification and Abstraction of Semantics» Patrick Cousot Radhia Cousot École normale supérieure CNRS & École polytechnique 45 rue d Ulm Route de Saclay 7530 Paris cedex 05, France 9118 Palaiseau Cedex,

More information

Chapter 3 Deterministic planning

Chapter 3 Deterministic planning Chapter 3 Deterministic planning In this chapter we describe a number of algorithms for solving the historically most important and most basic type of planning problem. Two rather strong simplifying assumptions

More information

Polynomiality of Linear Programming

Polynomiality of Linear Programming Chapter 10 Polynomiality of Linear Programming In the previous section, we presented the Simplex Method. This method turns out to be very efficient for solving linear programmes in practice. While it is

More information

MAT 570 REAL ANALYSIS LECTURE NOTES. Contents. 1. Sets Functions Countability Axiom of choice Equivalence relations 9

MAT 570 REAL ANALYSIS LECTURE NOTES. Contents. 1. Sets Functions Countability Axiom of choice Equivalence relations 9 MAT 570 REAL ANALYSIS LECTURE NOTES PROFESSOR: JOHN QUIGG SEMESTER: FALL 204 Contents. Sets 2 2. Functions 5 3. Countability 7 4. Axiom of choice 8 5. Equivalence relations 9 6. Real numbers 9 7. Extended

More information

Linear Analysis Lecture 16

Linear Analysis Lecture 16 Linear Analysis Lecture 16 The QR Factorization Recall the Gram-Schmidt orthogonalization process. Let V be an inner product space, and suppose a 1,..., a n V are linearly independent. Define q 1,...,

More information

What can be expressed via Conic Quadratic and Semidefinite Programming?

What can be expressed via Conic Quadratic and Semidefinite Programming? What can be expressed via Conic Quadratic and Semidefinite Programming? A. Nemirovski Faculty of Industrial Engineering and Management Technion Israel Institute of Technology Abstract Tremendous recent

More information

Stability and Stabilization of polynomial dynamical systems. Hadi Ravanbakhsh Sriram Sankaranarayanan University of Colorado, Boulder

Stability and Stabilization of polynomial dynamical systems. Hadi Ravanbakhsh Sriram Sankaranarayanan University of Colorado, Boulder Stability and Stabilization of polynomial dynamical systems Hadi Ravanbakhsh Sriram Sankaranarayanan University of Colorado, Boulder Proving Asymptotic Stability: Lyapunov Functions Lyapunov Function:

More information

HW1 solutions. 1. α Ef(x) β, where Ef(x) is the expected value of f(x), i.e., Ef(x) = n. i=1 p if(a i ). (The function f : R R is given.

HW1 solutions. 1. α Ef(x) β, where Ef(x) is the expected value of f(x), i.e., Ef(x) = n. i=1 p if(a i ). (The function f : R R is given. HW1 solutions Exercise 1 (Some sets of probability distributions.) Let x be a real-valued random variable with Prob(x = a i ) = p i, i = 1,..., n, where a 1 < a 2 < < a n. Of course p R n lies in the standard

More information

Axiomatic Semantics. Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11 CSE

Axiomatic Semantics. Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11 CSE Axiomatic Semantics Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11 CSE 6341 1 Outline Introduction What are axiomatic semantics? First-order logic & assertions about states Results (triples)

More information

CSC 7101: Programming Language Structures 1. Axiomatic Semantics. Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11.

CSC 7101: Programming Language Structures 1. Axiomatic Semantics. Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11. Axiomatic Semantics Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11 1 Overview We ll develop proof rules, such as: { I b } S { I } { I } while b do S end { I b } That allow us to verify

More information

Part 5: Penalty and augmented Lagrangian methods for equality constrained optimization. Nick Gould (RAL)

Part 5: Penalty and augmented Lagrangian methods for equality constrained optimization. Nick Gould (RAL) Part 5: Penalty and augmented Lagrangian methods for equality constrained optimization Nick Gould (RAL) x IR n f(x) subject to c(x) = Part C course on continuoue optimization CONSTRAINED MINIMIZATION x

More information

Lecture 15: Algebraic Geometry II

Lecture 15: Algebraic Geometry II 6.859/15.083 Integer Programming and Combinatorial Optimization Fall 009 Today... Ideals in k[x] Properties of Gröbner bases Buchberger s algorithm Elimination theory The Weak Nullstellensatz 0/1-Integer

More information

Axiomatic semantics. Semantics and Application to Program Verification. Antoine Miné. École normale supérieure, Paris year

Axiomatic semantics. Semantics and Application to Program Verification. Antoine Miné. École normale supérieure, Paris year Axiomatic semantics Semantics and Application to Program Verification Antoine Miné École normale supérieure, Paris year 2015 2016 Course 6 18 March 2016 Course 6 Axiomatic semantics Antoine Miné p. 1 /

More information

Solving polynomial static output feedback problems with PENBMI

Solving polynomial static output feedback problems with PENBMI Solving polynomial static output feedback problems with PENBMI Didier Henrion, Johan Löfberg, Michal Kočvara, Michael Stingl Abstract An algebraic formulation is proposed for the static output feedback

More information

ELE539A: Optimization of Communication Systems Lecture 16: Pareto Optimization and Nonconvex Optimization

ELE539A: Optimization of Communication Systems Lecture 16: Pareto Optimization and Nonconvex Optimization ELE539A: Optimization of Communication Systems Lecture 16: Pareto Optimization and Nonconvex Optimization Professor M. Chiang Electrical Engineering Department, Princeton University March 16, 2007 Lecture

More information

Analytic Number Theory Solutions

Analytic Number Theory Solutions Analytic Number Theory Solutions Sean Li Cornell University sxl6@cornell.edu Jan. 03 Introduction This document is a work-in-progress solution manual for Tom Apostol s Introduction to Analytic Number Theory.

More information

Hoare Logic: Part II

Hoare Logic: Part II Hoare Logic: Part II COMP2600 Formal Methods for Software Engineering Jinbo Huang Australian National University COMP 2600 Hoare Logic II 1 Factorial {n 0} fact := 1; i := n; while (i >0) do fact := fact

More information

Selected Examples of CONIC DUALITY AT WORK Robust Linear Optimization Synthesis of Linear Controllers Matrix Cube Theorem A.

Selected Examples of CONIC DUALITY AT WORK Robust Linear Optimization Synthesis of Linear Controllers Matrix Cube Theorem A. . Selected Examples of CONIC DUALITY AT WORK Robust Linear Optimization Synthesis of Linear Controllers Matrix Cube Theorem A. Nemirovski Arkadi.Nemirovski@isye.gatech.edu Linear Optimization Problem,

More information