Unverified Commit 4645012d authored by Tom Wiesing's avatar Tom Wiesing
Browse files

Add Tom Wiesing Thesis

parent c78505b5
# Bachelor Thesis Repository
This is the source for the write-ups of my Bachelor Thesis (the actual code is in other places).
There are 3 parts to this:
* ```proposal/``` - The proposal for the topic
* ```thesis/``` - The actual thesis write-up
* ```presentation/``` - The beamer-latex used for my presentation
Assuming you have ``latexmk`` installed, you should be able to compile these by just running `make`.
## License
© Tom Wiesing 2015
[
![Creative Commons License](https://i.creativecommons.org/l/by-nc-nd/3.0/88x31.png)
](http://creativecommons.org/licenses/by-nc-nd/3.0/)
This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/">Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License</a>.
LFLAGS = -pdf
all: graph1 master
clean: cleanmaster cleangraph1
master: setupmaster
cd dest && latexmk $(LFLAGS) presentation.tex
cd dest && cp presentation.pdf ..
setupmaster:
mkdir -p dest
cp -r *.tex imgs dest
cleanmaster:
rm -rf dest
rm -f presentation.pdf
graph1: setupgraph1
cd graph1/dest && pdflatex -shell-escape graph1.tex
cd graph1/dest && convert -density 500 -resize 1920x1080 graph1.pdf graph1.png
cd graph1/dest && cp graph1.png ../../imgs/graph1.png
setupgraph1:
cd graph1 && mkdir -p dest
cd graph1 && cp *.tex dest
cleangraph1:
cd graph1 && rm -rf dest
cd imgs && rm -rf graph1.png
\documentclass[crop,tikz,multi=false]{standalone}[2012/04/13]
% Input encoding
\usepackage[utf8]{inputenc}
% Math packages
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{stex,amstext}
\usetikzlibrary{shapes,arrows,mmt}
\def\thmo#1#2{\mathsf{#1}\colon\kern-.15em{#2}}
\providecommand\myxscale{3.9}
\providecommand\myyscale{2.2}
\providecommand\myfontsize{\footnotesize}
\makeatletter
\begin{document}
\begin{tikzpicture}[xscale=\myxscale,yscale=\myyscale]\myfontsize
%Background
\draw[rounded corners, draw=none, fill=lightgray, opacity=0.5] (-1.7,-3.5) -- (-1.7,-0.5) -- (0.4,-0.5) -- (0.4,-3.5) -- cycle;
% Theory of Dimensions
\node[thy] (dim) at (-1,-3) {
\begin{tabular}{l}
\textsf{Dimensions}\\\hline
8 basic dimensions\\
dimension multiplication\\
dimension division\\
\hline
\end{tabular}
};
% Dimensions extended
\node[thy] (dimex) at (-1,-2) {
\begin{tabular}{l}
\textsf{Dimensions Extended}\\\hline
aliases for composite dimensions\\
(such as $\mathsf{area} = \mathsf{length} \cdot{} \mathsf{length}$)\\
\hline
\end{tabular}
};
\draw[include] (dim) -- (dimex);
%Numbers
\node[thy] (numbers) at (0,-2) {
\begin{tabular}{l}
\textsf{Numbers}\\\hline
basic numbers\\
(OpenMath)\\
\hline
\end{tabular}
};
% Quantity Expressions
\node[thy] (qes) at (-0.75,-1) {
\begin{tabular}{l}
\textsf{Quantity Expressions}\\\hline
quantity expression constructors\\
quantity expression multiplication\\
quantity expression division\\
\hline
\end{tabular}
};
\draw[include] (numbers) -- (qes);
\draw[include] (dimex) -- (qes);
%SI
\node[thy] (SI) at (-1,0) {
\begin{tabular}{l}
\textsf{SI}\\\hline
basic SI units for all dimensions\\
\hline
\end{tabular}
};
\draw[include] (qes) -- (SI);
%Imperial Lengths 1A
\node[thy] (ImpA1) at (0.3,0) {
\begin{tabular}{l}
\textsf{Imperial Lengths A1}\\\hline
Thou\\
\hline
\end{tabular}
};
\draw[include] (qes) -- (ImpA1);
\draw[view] (ImpA1) -- (SI);
%Imperial Lengths A2
\node[thy] (ImpA2) at (1.5,0) {
\begin{tabular}{l}
\textsf{Imperial Lengths A2}\\\hline
Inch, Foot, Yard, \\
Chain, Fathom, Mile, \\
Mile, Furlong, Cable, \\
Nautical Mile, League\\
\hline
\end{tabular}
};
\draw[include] (ImpA1) -- (ImpA2);
%Imperial Lengths B1
\node[thy] (ImpB1) at (0.9,-1) {
\begin{tabular}{l}
\textsf{Imperial Lengths B1}\\\hline
Link\\
\hline
\end{tabular}
};
\draw[include] (qes) -- (ImpB1);
\draw[view] (ImpB1) -- (ImpA2);
%Imperial Lengths B2
\node[thy] (ImpB2) at (1,-2) {
\begin{tabular}{l}
\textsf{Imperial Lengths B2}\\\hline
Rod\\
\hline
\end{tabular}
};
\draw[include] (ImpB1) -- (ImpB2);
% Imperial Lengths
\node[thy] (ImpLen) at (1.75,-1) {
\begin{tabular}{l}
\textsf{Imperial Lengths}\\\hline
\end{tabular}
};
\draw[include] (ImpA2) -- (ImpLen);
\draw[include] (ImpB2) -- (ImpLen);
% Imperial Area
\node[thy] (ImpArea) at (1.75,-2.7) {
\begin{tabular}{l}
\textsf{Imperial Area}\\\hline
Perch, Rood, Acre\\\hline
\end{tabular}
};
\draw[include] (ImpLen) -- (ImpArea);
\end{tikzpicture}
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% A TIKZ library for MMT Theory Graphs
% copyright 2014 Michael Kohlhase; Released under the LPPL
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% this library provides some standardized node and arrow styles for formatting MMT graph
% diagrams in tikz. The advantage is that we can classify the arrows and nodes
% symbolically and with the styles in this library achieve a uniform look that helps
% readability.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% 1. Theories
% a generic theory
\def\outerthysep{.3mm}
\def\innerthysep{.5mm}
\tikzstyle{thy}=[draw,outer sep=\outerthysep,rounded corners,inner sep=\innerthysep]
% a primitive theory
\tikzstyle{primthy}=[thy,double]
% a theory graph
\tikzstyle{thygraph}=[draw,outer sep=1mm,rounded corners,dashed]
%%% 2. Arrows
%%% 2.1. Arrowtips (only internal)
\usetikzlibrary{arrows}
\newcommand{\@mmtarrowtip}{angle 45}
\newcommand{\@mmtreversearrowtip}{angle 45 reversed}
\newcommand{\@mmtarrowtipepi}{triangle 45}
\newcommand{\@mmtarrowtipmonoright}{right hook}
\newcommand{\@mmtarrowtipmonoleft}{left hook}
\newcommand{\@mmtarrowtippartial}{right to}
\newcommand{\@mmtarrowtippartialleft}{left to}
\newcommand{\@mmtreversearrowtippartial}{right to reversed}
\newcommand{\@mmtreversearrowtippartialleft}{left to reversed}
%%% 2.2 the arrow sstyles in graphs
\usetikzlibrary{decorations,decorations.pathmorphing,decorations.markings}
% any morphism
\tikzstyle{morph}=[-\@mmtarrowtip,thick]
\tikzstyle{mapsto}=[|-\@mmtarrowtip] %| any morphism
% structures
\tikzstyle{struct}=[-\@mmtarrowtip,thick]
% inclusions: regular, partial, and left variants
\tikzstyle{include}=[\@mmtarrowtipmonoright-\@mmtarrowtip,thick]
\tikzstyle{revinclude}=[\@mmtarrowtip-\@mmtarrowtipmonoright,thick]
\tikzstyle{pinclude}=[\@mmtarrowtipmonoright-\@mmtarrowtippartial,thick]
\tikzstyle{includeleft}=[\@mmtarrowtipmonoleft-\@mmtarrowtip,thick]
\tikzstyle{pincludeleft}=[\@mmtarrowtipmonoleft-\@mmtarrowtippartialleft,thick]
% views: regular, mono, partial, and left variants
\tikzstyle{preview}=[decorate,
decoration={coil,aspect=0,amplitude=1pt,
segment length=6pt,
pre=lineto,pre length=3pt,
post=lineto,post length=5pt},
thick]
\tikzstyle{view}=[preview,red,-\@mmtarrowtip]
\tikzstyle{mview}=[preview,\@mmtarrowtipmonoright-\@mmtarrowtip]
\tikzstyle{pview}=[preview,-\@mmtarrowtippartial]
\tikzstyle{pmview}=[preview,\@mmtarrowtipmonoright-\@mmtarrowtippartial]
\tikzstyle{viewleft}=[preview,-\@mmtarrowtip]
\tikzstyle{mviewleft}=[preview,\@mmtarrowtipmonoleft-\@mmtarrowtip]
\tikzstyle{pviewleft}=[preview,-\@mmtarrowtippartialleft]
\tikzstyle{pmviewleft}=[preview,\@mmtarrowtipmonoleft-\@mmtarrowtippartialleft]
\tikzstyle{adoption}=[preview,thin,double,-\@mmtarrowtip]
% biviews: regular, partial, and left variants
\tikzstyle{biview}=[preview,\@mmtarrowtip-\@mmtarrowtip]
\tikzstyle{pbiview}=[preview,\@mmtreversearrowtippartial-\@mmtarrowtippartial]
\tikzstyle{pbiviewleft}=[preview,\@mmtreversearrowtippartialleft-\@mmtarrowtippartialleft]
% defining views (experimental)
\tikzstyle{defview}=[preview,densely dotted,-\@mmtarrowtip]
% meta-theory inclusion
\tikzstyle{meta}=[dotted,-\@mmtarrowtip,thick]
% conservative extensions (abbreviation)
\tikzstyle{conservative}=[hooks-\@mmtarrowtip,double]
% conservative development
\tikzstyle{conservdev}=[hooks-\@mmtarrowtip,dashed,double]
% antimorphisms as striktthroughs
\tikzset{anti/.style={
decoration={markings, mark=between positions 0.2 and 0.8 step 4mm with {
\draw [thick,-] ++ (-3pt,-3pt) -- (3pt,3pt);}},
postaction={decorate}}}
% parallel markup
\tikzstyle{parallel}=[\@mmtarrowtip-\@mmtarrowtip,dashed]
%%% 3. convenience macros
%%% 3.1 the \mmtthy macro takes three arguments, name, decl, axioms and makes a
% table-like structure
\newcommand\mmtthy[3]{\def\@test{#3}%
\begin{array}{l}\textsf{#1}\\\hline #2\ifx\@test\@empty\else\\\hline #3\fi\end{array}}
%%% 3.2 the \mmtar takes two arguments, some tikz options, and an arrow style. \nmmtar
% is a variant that also has a name on top.
\newcommand\mmtar[2][]{\raisebox{.5ex}{\tikz[#1]{\draw[#2] (0,0) -- (.6,0);}}}
\newcommand\nmmtar[3][]{\raisebox{.4ex}{\tikz[#1]{\draw[#2] (0,0) --
node[above]{\ensuremath{\scriptstyle #3}} (.8,0);}}}
\documentclass{beamer}
% Do some customisations
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}[frame number]
%Packages
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{amssymb}
\newcommand{\realnz}{\mathbb{R}^{\*}}
\usepackage{svg}
%META-INFORMATION
\title{Semantic Search for Quantity Expressions}
\author{Tom Wiesing\\\ \\Supervisor: Michael Kohlhase\\Co-supervisor: Tobias Preusser}
\date{May 20, 2015 \\110392 Guided Research Applied and Computational Mathematics \& Thesis}
\begin{document}
%TITLEPAGE
\frame{\titlepage}
%OVERVIEW
\begin{frame}{Semantic Search for Quantity Expressions}
\begin{itemize}[<+->]
\item Motivation: Problem and State Of The Art
\item Our Approach: Structure Of The Search Engine
\begin{itemize}
\item The Unit System
\item The Search Algorithm
\end{itemize}
\item The Implementation
\item Time for Questions
\end{itemize}
\end{frame}
%MOTIVATION
\begin{frame}{Motivation (1)}
\begin{itemize}[<+->]
\item We use units every day
\item We encounter them everywhere:
\begin{itemize}[<+->]
\item When driving, there are speed limits, for example: \raisebox{-0.5\height}{\includegraphics[width=10mm]{imgs/sign60.png}} $\frac{\text{km}}{\text{h}}$
\item When baking, it often says in recepies something like: ``add 3 tea spoons of sugar''
\item When shopping for shoes there are different sizes
\end{itemize}
\item In scientific papers they occur a lot
\item everything which somehow models a real system has at least one quantity expression
\item everything is quantified
\end{itemize}
\end{frame}
\begin{frame}{Motivation (2)}
\begin{itemize}[<+->]
\item within one paper, commonly only one type of units is used
\item In general there are \textbf{a lot} of \textbf{different} units to describe \textbf{the same} quantity
\item Just for lengths: \pause \textit{Meter}, \pause \textit{Inch}, \pause \textit{Foot}, \pause \textit{Mile}, \pause \textit{Nautical Mile}, \pause $\dots$
\item This can cause problems when not converting properly
\begin{itemize}
\item Mars Climate Orbiter (1999) \\ \includegraphics[width=50mm]{imgs/mco.jpg}
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}{Motivation (3)}
\pause
\begin{itemize}[<+->]
\item Most common solution: Unit Converters
\begin{itemize}[<+->]
\item There are a lot of these \\ \includegraphics[width=40mm]{imgs/google.png}
\item Google itself has one integrated \\ \includegraphics[width=40mm]{imgs/googleuc.png}
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}{Motivation (4)}
\begin{itemize}[<+->]
\item A lot of user interaction:
\begin{itemize}
\item Problem identification
\item input units \& output units
\item not integrated into search process
\end{itemize}
\item Wouldn't it be nice:
\begin{itemize}[<+->]
\item when searching for $90\ \frac{\text{km}}{\text{h}}$
\item we also find $25\ \frac{\text{m}}{\text{s}}$
\end{itemize}
\item This is the kind of search engine we have built
\end{itemize}
\end{frame}
%APPROACH
\begin{frame}{Our Approach (1)}
\begin{itemize}[<+->]
\item What components do we need for a semantic search engine?
\begin{enumerate}[<+->]
\item A \textit{Unit System} that is aware of the different representations of a QE
\item A \textit{Spotter} that finds representations of QEs inside documents
\item A \textit{Search Algorithm} that given a QE finds all its representations in the system
\item A \textit{Frontend} that allows queries to be made
\end{enumerate}
\item Spotter is done by \textit{Stiv Sherko}
\end{itemize}
\end{frame}
\begin{frame}{Our Approach (2)}
\begin{itemize}[<+->]
\item Meta-mathematical model: used to describe structure of mathematics
\item \textit{Theory} = List of \textit{Definitions}
\item \textit{Term} = Expression written using definitions from a Theory
\item Theories can be related in 2 ways:
\begin{itemize}
\item \textit{Import}s make Definitions from one theory available in another
\item \textit{View} = truth-preserving mapping between theories
\end{itemize}
\item Can be displayed in a \textit{Theory Graph}
\item \textit{MMT} = software that implements these concepts
\begin{itemize}
\item easy to write down theories without programming knowledge
\end{itemize}
\end{itemize}
\end{frame}
%Unit System
\begin{frame}{Our Approach: The Unit System (1)}
\begin{itemize}[<+->]
\item Need a \textit{Theory of Quantity Expressions} (QEs)
\item Each quantity has a dimension
\item According to SI there are 7 basic ones:
\begin{itemize}
\item length
\item mass
\item time
\item electric current
\item temperature
\item luminous intensity
\item amount of substance
\end{itemize}
\item but there are also quantities where we just \textit{count}
\item and \textit{dimensionless quantities} (such as Information)
\item so we have 9 basic dimensions
\end{itemize}
\end{frame}
\begin{frame}{Our Approach: The Unit System (2)}
\begin{itemize}[<+->]
\item we can also multiply these to get new dimensions
\begin{itemize}
\item area $=$ length $\cdot{}$ length
\end{itemize}
\item similarly we can divide dimensions
\begin{itemize}
\item velocity $= \frac{\text{length}}{\text{time}}$
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}{Our Approach: The Unit System (3) - A Theory of Dimensions}
\begin{center}
\begin{tabular}{|l l l|}
\hline
\textsf{Dimension} & &\\\hline
$\mathsf{dim}$ & $:$ & $ \mathsf{type}$\\
$\mathsf{none}$ & $:$ & $ \mathsf{dim}$\\
$\mathsf{count}$ & $:$ & $ \mathsf{dim}$\\
$\mathsf{length}$ & $:$ & $ \mathsf{dim}$\\
$\mathsf{mass}$ & $:$ & $ \mathsf{dim}$\\
$\mathsf{time}$ & $:$ & $ \mathsf{dim}$\\
$\mathsf{current}$ & $:$ & $ \mathsf{dim}$\\
$\mathsf{temperature}$ & $:$ & $ \mathsf{dim}$\\
$\mathsf{luminous}$ & $:$ & $ \mathsf{dim}$\\
$\mathsf{amount}$ & $:$ & $ \mathsf{dim}$\\
$\cdot{}$ & $:$ & $ \mathsf{dim} \rightarrow \mathsf{dim} \rightarrow \mathsf{dim}$\\
$/$ & $:$ & $ \mathsf{dim} \rightarrow \mathsf{dim} \rightarrow \mathsf{dim}$\\\hline
\end{tabular}
\end{center}
\end{frame}
\begin{frame}{Our Approach: The Unit System (4)}
\begin{itemize}[<+->]
\item Quantity Expressions can be one of
\begin{enumerate}
\item \textit{primitive unit}, such as Meter
\item \textit{Multiplication} of a (real) number with an existing QE, such as $5\ \text{Meter}$
\item \textit{Division} of an existing QE by a (non-zero real) number (equivalent to the above)
\item \textit{Product} of two existing QEs such as $\text{Newton} \cdot{} \text{Second}$
\item \textit{Quotient} of two existing QEs such as $1\ \frac{\text{Meter}}{\text{Second}}$
\item \textit{Sum} of two existing QEs
\end{enumerate}
\end{itemize}
\end{frame}
\begin{frame}{Our Approach: The Unit System (5) - A Theory of Quantity Expressions}
\begin{center}
\begin{tabular}{|l l l|}
\hline
\textsf{Quantity Expression} & &\\\hline
$ \mathsf{import \ Dimension}$ &&\\\hline
$\mathsf{QE}$ & $:$ & $ \mathsf{dim} \rightarrow \mathsf{type}$\\
$\mathsf{QENMul}$& $:$ & $ \forall x : \mathsf{dim} . \realnz \rightarrow \mathsf{QE}\left( x\right) \rightarrow \mathsf{QE}\left( x\right)$\\
$\mathsf{QENDiv}$& $:$ & $ \forall x : \mathsf{dim} . \mathsf{QE}\left( x\right) \rightarrow \realnz \rightarrow \mathsf{QE}\left( x\right)$\\
$\mathsf{QEAdd}$& $:$ & $ \forall x : \mathsf{dim} . \mathsf{QE}\left( x\right) \rightarrow \mathsf{QE}\left( x\right) \rightarrow \mathsf{QE} \left( x \right) $\\
$\mathsf{QEMul}$& $:$ & $ \forall x, y : \mathsf{dim} . \mathsf{QE}\left( x\right) \rightarrow \mathsf{QE}\left( y\right) \rightarrow \mathsf{QE} \left( x \cdot{} y \right) $\\
$ \mathsf{QEDiv}$& $:$ & $ \forall x, y : \mathsf{dim} . \mathsf{QE}\left( x\right) \rightarrow \mathsf{QE}\left( y\right) \rightarrow \mathsf{QE} \left( \frac{x}{y} \right) $\\\hline
\end{tabular}
\end{center}
\end{frame}
\begin{frame}{Our Approach: The Unit System (6)}
\begin{itemize}[<+->]
\item we can now easily create theories that define Units, such as a Meter Theory:
\item
\begin{tabular}{|l l l|}
\hline
\textsf{Meter} &&\\\hline
$ \mathsf{import \ Quantity\ Expression}$ &&\\
\hline
$\mathsf{Meter}$ & $:$ & $ \mathsf{QE} \left( \mathsf{length} \right)$\\\hline
\end{tabular}
\item we can also define some non-metric lengths:
\item
\begin{tabular}{|l|}
\hline
\textsf{Non SI Lengths}\\\hline
$ \mathsf{import \ Quantity\ Expression}$\\
\hline
$\mathsf{Thou} : \mathsf{QE}\left( \mathsf{length} \right)$\\
$\mathsf{Foot} = \mathsf{QENMul} \left( 1000, \mathsf{Thou} \right)$\\
$\mathsf{Yard} = \mathsf{QENMul} \left( 3, \mathsf{Foot} \right)$\\
$\mathsf{Chain} = \mathsf{QENMul} \left( 22, \mathsf{Yard} \right)$\\
$\mathsf{Furlong} = \mathsf{QENMul} \left( 10, \mathsf{Chain} \right)$\\
$\mathsf{Mile} = \mathsf{QENMul} \left( 8, \mathsf{Furlong} \right)$\\
\hline
\end{tabular}
\end{itemize}
\end{frame}
\begin{frame}{Our Approach: The Unit System (7)}
\begin{itemize}[<+->]
\item need to compare units
\begin{itemize}
\item use \textit{Views} ( = truth-preserving mappings between theories)
\item For example:
\[