1 / 9

Argument Size Analysis Using Polyhedrons

Argument Size Analysis Using Polyhedrons. Lunjin Lu (Advisor) Jie Ouyang (Student). Motivations. Purpose: To discover the relationship between arguments regarding their sizes Applications: Discovery of symbolic constant Loop invariant computations Termination analysis.

garan
Download Presentation

Argument Size Analysis Using Polyhedrons

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Argument Size Analysis Using Polyhedrons Lunjin Lu (Advisor) Jie Ouyang (Student)

  2. Motivations • Purpose: • To discover the relationship between arguments regarding their sizes • Applications: • Discovery of symbolic constant • Loop invariant computations • Termination analysis

  3. Structure of the Analyzor Original Program SCCs computation Abstract compilation Normalized Program Call Dependency Graph Fixed Point Evaluation Analysis Results

  4. Bottom up Logic Program Analysis • Bottom up analysis is the reverse procedure of top down analysis. • Bottom up analysis starts from the stated facts in the program and derive the set of all correct answers. • The invariant derived by bottom up analysis is independent to any particular goals. • Bottom up analysis corresponds to the procedure of fixed point semantics evaluation.

  5. Abstract Interpretation • Abstract intrepretation maps concrete domain to abstract domain • Variables are abstracted to their size norm(integer) • Example: list_length([X|Xs])=1+list_length(Xs) • A constraint system describing argument size relationships is generated for each clause • Example: append([],A,A) append(A,B,C):- A=0,B=C

  6. Fixed Point Evaluation • Fixed Point Semantics captures the set of all correct answers of logic programs. • Analysis result is the fixed point semantics on the abstract domain. • Semi naive strategy is an efficient approach for evaluating fixed point. • Widening technique is applied to enforce the convergence of the evaluation.

  7. Polyhedra and Program Analysis • Many program analysis problems on numerical domain can be modeled as constraint systems. • A polyhedron is a geometric representation of answers of algebraic constraint systems. • Abstraction of set operations on concrete semantics domain corresponds to polyhedron operations on abstract semantics domain. • Parma Polyhedra Library(PPL) is the new generation library implementing polyhedron operations.

  8. Original Program Normalized Program quicksort(A,B):- A=0, B=0, A>=0, B>=0 quicksort(A,B):- A=1+C, partition(C,D,E,F), quicksort(E,G), quicksort(F,H), append(G,I,B), I=1+H, D>=0, C>=0, B>=0, E>=0, F>=0, G>=0, H>=0, A>=0, I>=0 partition(A,B,C,D):- A=1+E, C=1+F, G=0, B=0, partition(E,B,F,D), G>=0, E>=0, B>=0, F>=0, D>=0, A>=0, C>=0 partition(A,B,C,D):- A=1+E, D=1+F, G=0, B=0, partition(E,B,C,F), G>=0, E>=0, B>=0, C>=0, F>=0, A>=0, D>=0 partition(A,B,C,D):- A=0, C=0, D=0, B>=0, A>=0, C>=0, D>=0 append(A,B,C):- A=0,C=B,B>=0,A>=0,C>=0 append(A,B,C):-A=1+D,C=1+E,append(D,B,E),D>=0, B>=0,E>=0,A>=0,C>=0 quicksort([],[]). quicksort([X|Xs],Ys) :- partition(Xs,X,Left,Right), quicksort(Left,Ls), quicksort(Right,Rs), append(Ls,[X|Rs],Ys). partition([X|Xs],Y,[X|Ls],Rs) :- X =< Y, partition(Xs,Y,Ls,Rs). partition([X|Xs],Y,Ls,[X|Rs]) :- X > Y, partition(Xs,Y,Ls,Rs). partition([],Y,[],[]). append([],Ys,Ys). append([X|Xs],Ys,[X|Zs]) :- append(Xs,Ys,Zs). Sample Abstract Interpretation

  9. Analysis Result Normalized Program quicksort(A,B):- A=0, B=0, A>=0, B>=0 quicksort(A,B):- A=1+C, partition(C,D,E,F), quicksort(E,G), quicksort(F,H), append(G,I,B), I=1+H, D>=0, C>=0, B>=0, E>=0, F>=0, G>=0, H>=0, A>=0, I=0 partition(A,B,C,D):- A=1+E, C=1+F, G=0, B=0, partition(E,B,F,D), G>=0, E>=0, B>=0, F>=0, D>=0, A>=0, C>=0 partition(A,B,C,D):- A=1+E, D=1+F, G=0, B=0, partition(E,B,C,F), G>=0, E>=0, B>=0, C>=0, F>=0, A>=0, D>=0 partition(A,B,C,D):- A=0, C=0, D=0, B>=0, A>=0, C>=0, D>=0 append(A,B,C):- A=0, C=B, B>=0, A>=0, C>=0 append(A,B,C):- A=1+D, C=1+E, append(D,B,E), D>=0, B>=0, E>=0, A>=0, C>=0 quicksort(A,B):- A>=0, A=B partition(A,B,C,D):- A>= C, B>=0, C>=0, A=C+D append(A,B,C):- A>=0, B>=0, A+B=C Sample Analysis Result

More Related