SlideServe
Menu
Préférences
© SlideServe · v2026

Analyzing Argument Sizes in Logic Programs Using Polyhedra

garan avatar
9 diapositives · 218 Views · Oct 15, 2014

This research investigates the relationship between argument sizes in logic programs through a bottom-up analysis method. The study delves into the applications of symbolic constants and loop invariant computations, aiming to derive a set of correct answers using fixed-point semantics. By modeling program analysis problems as constraint systems, the research uses polyhedra to explore abstract interpretations and their implications in evaluating logical assertions. The findings emphasize the importance of understanding argument size relationships for improving program analysis techniques.

Analyzing Argument Sizes in Logic Programs Using Polyhedra - slide 1
01 / 9Analyzing Argument Sizes in Logic Programs Using Polyhedra
1 / 17

Télécharger la présentation

Analyzing Argument Sizes in Logic Programs Using Polyhedra
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  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