integration.tex 2.87 KB
Newer Older
Michael Banken's avatar
Michael Banken committed
1
\chapter{Implementation}
2
\label{chap:implementation}
Michael Banken's avatar
Michael Banken committed
3
\section{Integration}
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
\subsection{Programming Interface}
\label{sec:api}

\begin{lstlisting}[language=scala]

/** Find simply redundant inclusions
    *
    * This method finds inclusions that are redundant, since they are already part of a different inclusion
    * @param theoryPath This is the path of the theory to be optimized
    * @param replacementmap This is a map containing inclusion replacements for each theory
    * @return This is a list containing the suggested removals for the theory
    */
def findRedundantIncludes(theoryPath : MPath, replacementmap : HashMap[MPath, HashMap[Path, HashSet[MPath]]] = HashMap[MPath, HashMap[Path, HashSet[MPath]]]()) : List[Path]
\end{lstlisting}

\begin{lstlisting}[language=scala]
/** Finds superfluous inclusions
    *
    * This method optimizes a theory by reducing its inclusions to those used inside the theory
    * @param theoryPath This is the path of the theory to be optimized
    * @param replacementmap This is a map containing inclusion replacements for each theory
    * @param futureUse This is a map containing used theories in the futureLite-code
    * @return This is a map containing the suggested replacements for the theory
    */
def findUnusedIncludeReplacements(theoryPath : MPath, replacementmap : HashMap[MPath, HashMap[Path, HashSet[MPath]]] = HashMap[MPath, HashMap[Path, HashSet[MPath]]](), futureUse : HashMap[MPath, HashSet[MPath]] = HashMap[MPath, HashSet[MPath]]()) : HashMap[Path, HashSet[MPath]]
\end{lstlisting}

\begin{lstlisting}[language=scala]
/** Optimizes multiple theories
 *
 * This method optimizes all given theories in the Iterable.
 * Boolean toggle for interactive mode.
 * @param theories Theories to be optimized as Iterable[MPath]
 * @return This is a map containing the suggested replacements for all analyzed theories
 */
def findReplacements(theories: Iterable[MPath], interactive : Boolean) : HashMap[MPath, HashMap[Path, HashSet[MPath]]]
\end{lstlisting}

\begin{lstlisting}[language=scala]
/** Optimizes all known theories
 *
 * This method optimizes all theories inside the onthology
 * @return This is a map containing the suggested replacements for all analyzed theories
 */
def findReplacements(interactive : Boolean = false) : HashMap[MPath, HashMap[Path, HashSet[MPath]]]
\end{lstlisting}

\begin{lstlisting}[language=scala]
/** Converts map to xml
 *
 * This method converts a given mapping as generated by findReplacements to an XML representation
 * @param map This is a map containing inclusion replacements for each theory
 * @return XML-String
 */
def toXML(map : HashMap[MPath, HashMap[Path, HashSet[MPath]]]) : String
\end{lstlisting}

\subsection{User Interface}
\label{sec:ui}
\begin{figure}[!htb]
\centering
\includegraphics[scale=.5]{styler_window}
\caption{A screenshot of the styler dialog}
\label{fig:dialog}
\end{figure}
\subsection{UML}
\label{sec:uml}