Commit 4b917c59 authored by Dennis Müller's avatar Dennis Müller

added mois

parent c04fa3b2
......@@ -2,8 +2,8 @@
``Semantic Search'' -- a very suggestive term, which is alas seriously under-defined --
has often been touted as the ``killer application'' of semantic technologies. With a view finder,
we can add another possible interpretation: searching mathematical ontologies
(here modular theorem prover libraries) at the level of theories -- we call this \defemph{theory
classification}.
(here modular theorem prover libraries) at the level of theories -- we call this \rmoi[id=theoryclassification]{\defemph{theory
classification}}.
The basic use case is the following: Jane, a mathematician, becomes interested in a class
of mathematical objects, say -- as a didactic example -- something she initially calls
......
%%
%% This is file `moi.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% moi.dtx (with options: `package')
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{moi}[2018/01/03 v0.2 Math Object Identifiers]
\newif\if@show\@showfalse
\newif\if@snippets\@snippetsfalse
\newif\if@data\@datafalse
\newif\if@hide\@hidefalse
\DeclareOption{show}{\@showtrue}
\DeclareOption{data}{\@datatrue}
\DeclareOption{snippets}{\@snippetstrue}
\DeclareOption{publish}{\@hidetrue,\@snippetsfalse,\@datafalse,\@showfalse}
\ProcessOptions
\RequirePackage{marginnote}
\RequirePackage{color}
\RequirePackage{xkeyval}
\if@hide\else
\AtEndDocument{\ifnum\value{moiless}>0%
\typeout{}%
\typeout{Package moi warning:}%
\ifnum\value{moiless}=1\typeout{ There is still one MOI reference without MOI!}%
\else\typeout{ There are still \arabic{moiless} MOI references without MOIs!}\fi%
\typeout{}%
\fi}
\fi
\def\moiref@color{\color{magenta}}
\def\moiless@color{\color{cyan}}
\def\rmoi@color{\color{red}}
\newcounter{moiless}
\if@hide\newcommand\moiref[2][]{#2}\else
\newcommand\moiref[2][]{\def\@test{#1}%
\ifx\@test\@empty%
\stepcounter{moiless}%
{\if@show\moiref@color\fi{#2}}%
\else%
\if@show\marginnote{#1}{\moiless@color{#2}}\fi%
\fi}
\fi
\if@hide\newenvironment{moirefenv}[1][]{}{}\else
\newenvironment{moirefenv}[1][]{\def\@test{#1}%
\ifx\@test\@empty
\if@show\moiref@color\fi%
\else%
\if@show\marginnote{#1}\moiless@color\fi%
\fi}
{}
\fi
\if@data%
\newwrite\moidata@out%
\immediate\openout\moidata@out=\jobname.xml%
\AtBeginDocument{\protected@write\moidata@out{}{<MOIRegs xmlns="http://gitlab.com/IMKT/MOI">}}
\AtEndDocument{\protected@write\moidata@out{}{</MOIRegs>}
\closeout\moidata@out}
\fi
\def\rmoi@DOI{<<DOI Missing>>}
\newcommand\DocDOI[1]{\def\rmoi@DOI{#1}}
\if@hide\else\AtBeginDocument{
{\def\and{, }\def\thanks#1{}\def\inst#1{}
\xdef\rmoi@BibRef{\@author: \@title}}}
\fi
\newcommand\DocBibRef[1]{\def\rmoi@BibRef{#1}}
\newcounter{rmoi}
\define@key{rmoi}{id}{\gdef\rmoi@id{#1}}
\define@key{rmoi}{type}{\def\rmoi@type{#1}}
\define@key{rmoi}{fragment}{\def\rmoi@fragment{#1}}
\define@key{rmoi}{note}{\def\rmoi@note{#1}}
\newcommand\rmoi@setkeys[1]{%
\let\rmoi@id\@undefined%
\let\rmoi@type\@undefined%
\let\rmoi@fragment\@undefined%
\let\rmoi@note\@undefined%
\setkeys{rmoi}{#1}%
\@ifundefined{rmoi@id}{\def\rmoi@id{\romannumeral\value{rmoi}}}{}%
}
\newcommand\rmoi@xml{%
\if@data%
\protected@write\moidata@out{}{ <MOIReg%
\@ifundefined{rmoi@id}{}{ id="\rmoi@id"}>}%
\protected@write\moidata@out{}{ <MODRef DOI="\rmoi@DOI"\@ifundefined{rmoi@fragment}{}{ fragment="\rmoi@fragment"} pages="\thepage"/>}%
\protected@write\moidata@out{}{ <BibRef>\rmoi@BibRef\ p. \thepage</BibRef>}%
\@ifundefined{rmoi@type}{}{\protected@write\moidata@out{}{ <type>\rmoi@type</type>}}%
\@ifundefined{rmoi@note}{}{\protected@write\moidata@out{}{ <note>\rmoi@note</note>}}%
\protected@write\moidata@out{}{ </MOIReg>}%
\fi}
\newcommand\ext@rmoi@list[1]{%
\@ifundefined{rmoi@list}
{\xdef\rmoi@list{#1}}
{\xdef\rmoi@list{\rmoi@list,#1}}}
\if@hide\newcommand\rmoi[2][]{#2}\else
\newcommand\rmoi[2][]{\stepcounter{rmoi}%
\rmoi@setkeys{#1}\rmoi@xml%
\expandafter\newsavebox\csname MOI@\rmoi@id\endcsname%
\expandafter\savebox\csname MOI@\rmoi@id\endcsname{#2}%
\ext@rmoi@list{\rmoi@id}%
\if@show\marginnote\rmoi@id\textcolor{red}{#2}\else{#2}\fi}
\fi
\if@hide\newenvironment{rmoienv}[1][]{}{}\else
\newenvironment{rmoienv}[1][]{\stepcounter{rmoi}%
\rmoi@setkeys{#1}\rmoi@xml%
\expandafter\newsavebox\csname MOI@\rmoi@id\endcsname%
\if@show\marginnote{\rmoi@id}\fi
\begin{lrbox}{0}%
\begin{minipage}[t]{\textwidth}%
\if@show\rmoi@color\fi}
{\end{minipage}\end{lrbox}%
\noindent\usebox0%
\ext@rmoi@list\rmoi@id%
\global\expandafter\setbox\csname MOI@\rmoi@id\endcsname\box0}
\fi
\if@snippets%
\AtEndDocument{
\@ifundefined{rmoi@list}{}{\newpage%
\begin{appendix}\pagestyle{empty}
\section{Snippets}\newpage
The following pages contain the text contents of the MOI registration requests, so that
they can be included into the submission. Please disregard them. To get rid of them,
please remove the \texttt{snippets} option from the \texttt{\textbackslash usepackage\{moi\}}.
\@for\@I:=\rmoi@list\do{%
\expandafter\usebox\csname MOI@\@I\endcsname\newpage}
\end{appendix}}}
\fi
\endinput
%%
%% End of file `moi.sty'.
......@@ -7,7 +7,7 @@
\usepackage{url, multirow}
%\usepackage{tipa}
\usepackage{amsmath,amssymb,amstext}
\usepackage{graphicx,stmaryrd,mathabx,MnSymbol,tabularx,mathtools}
\usepackage{graphicx,stmaryrd,mathabx,MnSymbol,tabularx,mathtools,moi}
\usepackage[normalem]{ulem}
\usepackage{array}
\usepackage{mdframed}
......
......@@ -7,7 +7,7 @@
\usepackage{url, multirow}
%\usepackage{tipa}
\usepackage{amsmath,amssymb,amstext}
\usepackage{graphicx,stmaryrd,mathabx,MnSymbol,tabularx,mathtools}
\usepackage{graphicx,stmaryrd,mathabx,MnSymbol,tabularx,mathtools,moi}
\usepackage[normalem]{ulem}
\usepackage{array}
\usepackage{mdframed}
......
Let $C$ be a corpus of theories with the same fixed meta-theory $M$.
We call the problem of finding theory views between theories of $C$ the \defemph{view finding problem} and an algorithm that solves it a \defemph{view finder}.
\rmoi[id=viewfinding]{We call the problem of finding theory views between theories of $C$ the \defemph{view finding problem} and an algorithm that solves it a \defemph{view finder}.}
Note that a view finder is sufficient to solve the theory classification use case from the introduction:
Jane provides a $M$-theory $Q$ of beautiful sets, the view finder computes all (total) views from $Q$ into $C$.
......@@ -60,10 +60,11 @@ Above multiple normalization steps make use of a total order on abstract syntax
We omit the details and only remark that we try to avoid using the names of constants in the definition of the order --- otherwise, declarations that could be matched by a view would be normalized differently.
Even when breaking ties between requires comparing two constants, we can first try to recursively compare the syntax trees of their types.
\paragraph{Abstract Syntax Trees}
We define \textbf{abstract syntax trees} as pairs $(t,s)$ where $t$ is subject to the grammar
\begin{rmoienv}[id=abstractsyntaxtree]
\paragraph{Abstract Syntax Trees} We define \textbf{abstract syntax trees} as pairs $(t,s)$ where $t$ is subject to the grammar
\[t ::= C_{Nat} \mid V_{Nat} \mid \ombind{t}{t^+}{t^+}\]
(where $Nat$ is a non-terminal for natural numbers) and $s$ is a list of constant names.
\end{rmoienv}
We obtain an abstract syntax tree from an MMT expression $E$ by (i) switching to de-Bruijn representation of bound variables and (ii) replacing all occurrences of constants with $C_i$ in such a way that every $C_i$ refers to the $i$-th element of $s$.
Abstract syntax trees have the nice property that they commute with the application of simple views $\sigma$:
......@@ -129,7 +130,7 @@ Then the core algorithm will only find views that map at most one axiom.
Depending on what we intend to do with the results, we might prefer to consider them individually (e.g. to yield \emph{alignments} in the sense of \cite{KKMR:alignments:16}). But we can also use these small views as building blocks to construct larger, possibly total ones:
\begin{lemma}[Amalgamating Views]
We call two partial views \textbf{compatible} if they agree on all constants for which both provide an assignment.
\rmoi[id=amalgamatingviews]{We call two partial views \textbf{compatible} if they agree on all constants for which both provide an assignment.}
The union of compatible well-typed views is again well-typed.
\end{lemma}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment