Skip to content
Snippets Groups Projects
Select Git revision
  • 488423236053d988f2b1f4b55e64bccbfce9abcb
  • for-vairdraw default protected
  • multi-context-windows
3 results

wl_init.c

Blame
  • rapport.tex 7.73 KiB
    % !TeX spellcheck = <none>
    \documentclass[french]{article}
    
    \usepackage{amsfonts}
    \usepackage{geometry}
    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}
    \usepackage[french]{babel}
    \usepackage{translator}
    \usepackage{graphicx}
    \usepackage[svgnames]{xcolor}
    \usepackage{lscape}
    \usepackage{tablefootnote}
    \usepackage{hyperref}
    \usepackage{tikz-uml}
    \usetikzlibrary {arrows.meta}
    \hypersetup{
    	colorlinks=true,
    	linkcolor=blue,
    	filecolor=blue,
    	citecolor = black,      
    	urlcolor=blue,
    	pdftitle={Compte-rendu intermédiaire de stage}
    }
    
    \title{Polymalys-py \\ \small Rapport technique}
    \author{FLOREA Andrei}
    
    \begin{document}
    	\maketitle
    
    	\tableofcontents
    	
    	\listoffigures
    
    	\section{Vue globale de Polymalys-py}
    	
    	\section{Polymarp: Domaine abstrait}
    	
    	Le domaine abstrait est composé d'un domaine numérique relationnel, d'un \textit{mapping} de registres et d'un \textit{mapping} d'addresses.
    	
    	\subsection{Domaine numérique relationel}
    	
    	L'objectif de ce module est d'avoir une interface modulaire avec les librairies de manipulation de domaines numériques. Pour ce faire, on définit des classes abstraites dans \verb*|numerical.py|, pour lesquelles on créera des implémentation pour chaque librairie souhaitée.
    	
    	\begin{figure}[h]
    		\centering
    		\resizebox{\textwidth}{!}{
    			\begin{tikzpicture}%[show background grid]
    				\begin{umlpackage}{numerical}
    					\umlclass[type=abstract]{PolyConstant}{
    						+ value: int
    					}{
    						\umlvirt{+ to\_expr(): PolyExpr}
    					}
    				
    					\umlclass[type=abstract, y = -3]{PolyVar}{
    						+ ident
    					}{
    						\umlvirt{+ to\_expr(): PolyExpr}
    					}
    					\umlclass[type=abstract, y = -6]{PolyExpr}{
    					}{
    						\umlvirt{+ get\_vars(): Set[PolyVar]}
    					}
    					\umlclass[type=abstract, y=-9]{PolyExprHelper}{
    						+ op: Operations \\
    						+ left: PolyExprHelper, PolyVar, PolyConstant \\
    						+ right: PolyExprHelper, PolyVar, PolyConstant
    					}{
    						+ get\_vars(): Set[PolyVar]
    					}
    					\umlclass[type=enumeration, y=-9, x=-7]{Operations}{
    						CONST \\ VAR \\ ADD \\ SUB \\ NEG \\ MUL \\ AND
    					}{}
    				
    					\umlinherit{PolyExprHelper}{PolyExpr}
    					\umlnest{PolyExprHelper}{Operations}
    					
    					\umlclass[type=abstract, y=-16]{PolyConstraint}{}{}
    					\umlclass[type=abstract, y=-13]{PolyConstraintHelper}{
    						+ expr: PolyExpr \\
    						+ op: Operations2 \\
    						+ const: PolyConstant
    					}{}
    					\umlclass[type=enumeration, y=-13, x=-7]{Operations2}{
    						EQ \\ LEQ \\ GEQ
    					}{}
    					
    					\umlinherit{PolyConstraintHelper}{PolyConstraint}
    					\umlnest{PolyConstraintHelper}{Operations2}
    					\umluniassoc[mult2=1]{PolyConstraintHelper}{PolyExprHelper}
    					
    					\umlclass[type=abstract, x=-2, y=-22]{PolyNumericalDomain}{}{
    						\umlvirt{\umlstatic{+ bottom(): PolyNumericalDomain}} \\
    						\umlvirt{+ add\_constraint(constraint: PolyConstraint)} \\
    						\umlvirt{+ is\_top(): bool} \\
    						\umlvirt{+ is\_bottom(): bool} \\
    						\umlvirt{+ maximize(expression): int or None} \\
    						\umlvirt{+ minimize(expression): int or None} \\
    						\umlvirt{+ join(other): PolyNumericalDomain} \\
    						\umlvirt{+ widening(other): PolyNumericalDomain} \\
    						\umlvirt{+ intersection(other): PolyNumericalDomain} \\
    						\umlvirt{+ substitute(old, new): PolyNumericalDomain} \\
    						\umlvirt{+ projection(var\_set): PolyNumericalDomain} \\
    						\umlvirt{+ includes(other: PolyNumericalDomain): bool} \\
    						+ get\_vars(): Set[PolyVar]
    					}
    					\umlclass[type=abstract, x=-2, y=-28]{PolyNumericalWrapper}{}{
    						\umlvirt{+ new\_var(value: int): PolyVar} \\
    						+ fold(repl1, repl2, var): PolyNumericalWrapper \\
    						+ expand(repl, var1, var2): PolyNumericalWrapper \\
    						\umlvirt{\umlstatic{+ match\_var(var1, var2, dom1, dom2): bool}} \\
    						\umlvirt{+ copy(p, var\_set): PolyNumericalWrapper} \\
    						\umlvirt{+ bac(var: PolyVar, avatar): PolyNumericalWrapper}
    					}
    					
    					\umluniassoc[geometry=-|, mult2=*, pos2=1.8]{PolyNumericalDomain}{PolyConstraint}
    					\umlinherit{PolyNumericalWrapper}{PolyNumericalDomain}
    				\end{umlpackage}
    
    				\begin{umlpackage}[x=8]{apron}
    					\umlclass{ApronConstant}{}{
    						+ to\_expr()
    					}
    					\umlclass[y=-3]{ApronVar}{
    					}{
    						+ to\_expr()
    					}
    					\umlclass[y = -9, x=2]{ApronExpr}{}{}
    					
    					\umlunicompo[geometry=|-]{ApronExpr}{ApronVar}
    					\umlunicompo[geometry=|-]{ApronExpr}{ApronConstant}
    					
    					\umlclass[y=-13]{ApronConstraint}{}{}
    					
    					\umlinherit{ApronConstraint}{PolyConstraintHelper}
    					
    					\umlclass[type=abstract, y=-22]{ApronNumericalDomain}{
    						+ env: Set[PolyVar]
    					}{
    						+ get\_vars(): Set[PolyVar] \\
    						+ add\_constraint(cons) \\
    						+ is\_top(): bool \\
    						+ is\_bottom(): bool \\
    						+ maximize(expression): int or None \\
    						+ minimize(expression): int or None \\	
    						+ join(other) \\
    						+ wideining(other) \\
    						+ intersection(other) \\
    						+ substitute(old, new) \\
    						+ projection(var\_set) \\
    						+ includes(other) \\
    						+ equals(other): bool
    					}
    					\umlclass[type=abstract, y=-28]{ApronNumericalWrapper}{}{
    						+ new\_var(ident: int): ApronVar \\
    						- npiv(): Set[PolyVar] \\
    						- linexpr(var, basis): List[ApronConstant] \\
    						\umlstatic{- \_get\_basis(dom1, dom2): Set[PolyVar]} \\
    						\umlstatic{+ match\_var(var1, var2, dom1, dom2)} \\
    						+ copy(p, var\_set) \\
    						+ bac(var, avatar)
    					}
    					
    					\umlinherit{ApronNumericalDomain}{PolyNumericalDomain}
    					\umlinherit{ApronNumericalWrapper}{ApronNumericalDomain}
    					\umlinherit{ApronNumericalWrapper}{PolyNumericalWrapper}
    					
    					\umlclass[type=abstract, x=7, y=-22]{ApronPoly}{}{
    						\umlstatic{+ bottom()}
    					}
    					\umlclass[x=7, y=-28]{ApronPolyWrapper}{}{}
    					
    					\umlinherit{ApronPoly}{ApronNumericalDomain}
    					\umlinherit{ApronPolyWrapper}{ApronPoly}
    					\umlinherit{ApronPolyWrapper}{ApronNumericalWrapper}
    				\end{umlpackage}
    				
    				\umlinherit{ApronConstant}{PolyConstant}
    				\umlinherit{ApronVar}{PolyVar}
    				\umlinherit{ApronExpr}{PolyExprHelper}
    
    			\end{tikzpicture}
    			}
    		\caption[Schéma UML de l'interface mathématique]{Hiérarchie des classes de l'interface mathématique et de son implémentation utilisant APRON}
    	\end{figure}
    
    	\subsection{Mappings}
    	
    	Les \textit{mappings} sont définis dans \verb*|mappings.py|. Ils implémentent le \textit{mapping} de registres \( R \mapsto \mathcal{V}\) et le \textit{mapping} d'adresses \( \left(\mathcal{V} \times \mathbb{N} \times \mathcal{V} \right) \mapsto \mathcal{V} \cup \left(\mathcal{V} \times \mathcal{V} \right) \)
    	
    	\begin{figure}[h]
    		\centering
    		\resizebox{\textwidth}{!}{
    			\begin{tikzpicture}%[show background grid]
    				\umlsimpleclass[x=8, y=-10]{PolyVar}
    				
    				\begin{umlpackage}{mappings}
    					\umlclass[type=interface, x=-2]{MappingMixin}{}{
    						+ \_\_contains\_\_(other): bool
    					}
    					
    					\umlclass[x=-4, y=-4]{RegisterMapping}{}{
    						+ replace(old, new)
    					}
    					\umlclass[y=-4]{LoopMapping}{}{
    						+ replace(old, new)
    					}
    					\umlclass[x=8, y=-5]{Avatar}{}{}
    					\umlclass[x=0, y = -7]{SLP}{
    						+ base: PolyVar \\
    						+ step: int or None \\
    						+ count: PolyVar
    					}{
    						+ last(): PolyExpr
    					}
    
    					\umluniassoc[mult2=2, pos2=0.9]{Avatar}{PolyVar}
    					\umlassoc[geometry=-|-, weight=0.8, name=assoc]{SLP}{Avatar}
    					\umlassoc[geometry=-|-, weight=0.8]{SLP}{PolyVar}
    					\umlassocclass[x=4, y=-4]{AddressMapping}{assoc-1}{}{
    						+ replace(old, new)
    					}
    				
    					\umlsimpleclass[x=2.2, text=DarkGreen]{dict}
    					
    					\umlinherit{RegisterMapping}{dict}
    					\umlinherit{LoopMapping}{dict}
    					\umlinherit{AddressMapping}{dict}
    					\umlimpl{RegisterMapping}{MappingMixin}
    					\umlimpl{LoopMapping}{MappingMixin}
    					\umlimpl{AddressMapping}{MappingMixin}
    				\end{umlpackage}
    			\end{tikzpicture}
    		}
    	\caption[Schéma UML des mappings]{Hiérarchies des classes de mappings}
    	\end{figure}
    \end{document}