doc-src/isac/dmeindl/proposal.tex
author Walther Neuper <neuper@ist.tugraz.at>
Sun, 18 Sep 2011 15:41:36 +0200
branchdecompose-isar
changeset 42274 9915408a8e56
parent 42273 3be1e95c4fbe
child 42331 2d1860acca3b
permissions -rwxr-xr-x
tuned
neuper@42272
     1
%WN mit diesen 3 Zeichen beginnen meine Kommentare
neuper@42272
     2
meindl_diana@42263
     3
\documentclass[12pt,a4paper]{article}
neuper@42272
     4
\bibliographystyle{alpha}
neuper@42272
     5
\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}
neuper@42272
     6
\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}}
neuper@42272
     7
%\usepackage{a4}
neuper@42272
     8
%\usepackage[naustrian]{babel}
neuper@42272
     9
%\usepackage[latin1]{inputenc}
neuper@42272
    10
%\usepackage{calc}
neuper@42272
    11
%\usepackage{amsmath}   
neuper@42272
    12
%\usepackage{epsfig}
neuper@42272
    13
%\usepackage{graphicx}
neuper@42272
    14
%\usepackage{xcolor}
neuper@42272
    15
%\usepackage{amsfonts}
neuper@42272
    16
%
neuper@42272
    17
%WN BITTE DIESE DEFINITIONEN WEGLASSEN ...
neuper@42273
    18
%% Seitenräder einstellen und Höhe der Seitenzahlen
neuper@42272
    19
%\usepackage{geometry}
neuper@42272
    20
%\geometry{a4paper, left=2.5cm, right=2cm, top=3cm, bottom=2.8cm}
neuper@42272
    21
%\setlength{\footskip}{2cm}
neuper@42272
    22
%
neuper@42272
    23
%
neuper@42273
    24
%%Zähler definieren und Starwert setzen:
neuper@42272
    25
%\newcommand{\R}{\mathbb R}
neuper@42272
    26
%%\newcommand{\N}{\mathbb N}
neuper@42272
    27
%%\newcommand{\Q}{\mathbb Q}
neuper@42272
    28
%%\newcommand{\C}{\mathbb C}
neuper@42272
    29
%
neuper@42272
    30
%
neuper@42272
    31
%\newcounter{ctr}
neuper@42272
    32
%\setcounter{ctr}{0}
neuper@42272
    33
%
neuper@42272
    34
%\newcounter{Teubner}
neuper@42272
    35
%\newcounter{Klingenberg}
neuper@42272
    36
%\newcounter{T}
neuper@42272
    37
%\newcounter{Vo}
neuper@42272
    38
%\newcounter{Se}
neuper@42272
    39
%\newcounter{E}
neuper@42272
    40
%\newcounter{Bwl}
neuper@42272
    41
%\newcounter{Int}
neuper@42272
    42
%\newcounter{Prim}
neuper@42272
    43
%\newcounter{Z}
neuper@42272
    44
%\setcounter{Z}{0}
neuper@42272
    45
%\setcounter{Teubner}{1}
neuper@42272
    46
%\setcounter{Klingenberg}{2}
neuper@42272
    47
%\setcounter{T}{1}
neuper@42272
    48
%\setcounter{Vo}{7}
neuper@42272
    49
%\setcounter{Se}{2}
neuper@42272
    50
%\setcounter{E}{3}
neuper@42272
    51
%\setcounter{Bwl}{4}
neuper@42272
    52
%\setcounter{Int}{5}
neuper@42272
    53
%\setcounter{Prim}{6}
neuper@42272
    54
%%BSP
neuper@42272
    55
%\newenvironment{myBsp}{
neuper@42272
    56
%  \begin{list}{\textbf{\textsc{Bsp:}}}{
neuper@42272
    57
%    \setlength{\labelwidth}{8Pc}
neuper@42272
    58
%    \setlength{\labelsep}{0.5Pc}    
neuper@42272
    59
%    \setlength{\rightmargin}{0Pc}
neuper@42272
    60
%    \setlength{\leftmargin}{2Pc}
neuper@42272
    61
%    \setlength{\parsep}{0ex plus 0.5ex}
neuper@42272
    62
%    \setlength{\listparindent}{1em}
neuper@42272
    63
%    \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex}
neuper@42272
    64
%    \setlength{\topsep}{0.5Pc}
neuper@42272
    65
%  }}
neuper@42272
    66
%  {\end{list}
neuper@42272
    67
%}
neuper@42272
    68
%
neuper@42272
    69
%
neuper@42272
    70
%%Lemma
neuper@42272
    71
%\newenvironment{myLemma}{
neuper@42272
    72
%  \begin{list}{\textsc{\textbf{Lemma:\ \ \ }}}{
neuper@42272
    73
%   \setlength{\labelsep}{-0.5Pc}    
neuper@42272
    74
%    \setlength{\leftmargin}{1Pc}
neuper@42272
    75
%    \setlength{\parsep}{0ex plus 0.5ex}
neuper@42272
    76
%    \setlength{\listparindent}{1em}
neuper@42272
    77
%    \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex}
neuper@42272
    78
%    \setlength{\topsep}{0.5Pc}
neuper@42272
    79
%  }}
neuper@42272
    80
%  {\end{list}
neuper@42272
    81
%}
neuper@42272
    82
%%Korollar
neuper@42272
    83
%\newenvironment{myKorollar}{
neuper@42272
    84
%  \begin{list}{\textsc{\textbf{Korollar: }}}{
neuper@42272
    85
%    \setlength{\labelwidth}{8Pc}
neuper@42272
    86
%    \setlength{\labelsep}{0.5Pc}    
neuper@42272
    87
%    \setlength{\rightmargin}{0Pc}
neuper@42272
    88
%    \setlength{\leftmargin}{4Pc}
neuper@42272
    89
%    \setlength{\parsep}{0ex plus 0.5ex}
neuper@42272
    90
%    \setlength{\listparindent}{1em}
neuper@42272
    91
%    \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex}
neuper@42272
    92
%    \setlength{\topsep}{0.5Pc}
neuper@42272
    93
%  }}
neuper@42272
    94
%  {\end{list}
neuper@42272
    95
%}
neuper@42272
    96
%
neuper@42272
    97
%%Theorem
neuper@42272
    98
%\newenvironment{myTheorem}{
neuper@42272
    99
%  \begin{list}{\textsc{\textbf{Theorem: }}}{
neuper@42272
   100
%    \setlength{\labelwidth}{8Pc}
neuper@42272
   101
%    \setlength{\labelsep}{0.5Pc}    
neuper@42272
   102
%    \setlength{\rightmargin}{0Pc}
neuper@42272
   103
%    \setlength{\leftmargin}{5Pc}
neuper@42272
   104
%    \setlength{\parsep}{0ex plus 0.5ex}
neuper@42272
   105
%    \setlength{\listparindent}{1em}
neuper@42272
   106
%    \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex}
neuper@42272
   107
%    \setlength{\topsep}{0.5Pc}
neuper@42272
   108
%  }}
neuper@42272
   109
%  {\end{list}
neuper@42272
   110
%}
neuper@42272
   111
%
neuper@42272
   112
%
neuper@42272
   113
%%Proportion
neuper@42272
   114
%\newenvironment{myProp}{
neuper@42272
   115
%  \begin{list}{\textsc{\textbf{Proportion: }}}{
neuper@42272
   116
%    \setlength{\labelwidth}{8Pc}
neuper@42272
   117
%    \setlength{\labelsep}{0.5Pc}    
neuper@42272
   118
%    \setlength{\rightmargin}{0Pc}
neuper@42272
   119
%    \setlength{\leftmargin}{4Pc}
neuper@42272
   120
%    \setlength{\parsep}{0ex plus 0.5ex}
neuper@42272
   121
%    \setlength{\listparindent}{1em}
neuper@42272
   122
%    \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex}
neuper@42272
   123
%    \setlength{\topsep}{0.5Pc}
neuper@42272
   124
%  }}
neuper@42272
   125
%  {\end{list}
neuper@42272
   126
%}
neuper@42272
   127
%
neuper@42272
   128
%%Farben
neuper@42272
   129
%
neuper@42272
   130
%\newcommand{\red}[1]{\textcolor[rgb]{0.7,0,0}{\bf #1}}
neuper@42272
   131
%\newcommand{\rd}[1]{\color{red}{#1}}
neuper@42272
   132
%\newcommand{\white}[1]{\textcolor[rgb]{1,0,0}{\bf #1}}
neuper@42272
   133
%\newcommand{\w}[1]{\color{white}{#1}}
neuper@42272
   134
%\newcommand{\g}[1]{\color{myColor}{#1}}
neuper@42272
   135
%
neuper@42272
   136
%\usepackage{color}
neuper@42272
   137
%\definecolor{myColor}{rgb}{0.9,0.9,0.9}% Wir definieren im RGB-Farbraum
neuper@42272
   138
%
neuper@42272
   139
%
neuper@42272
   140
%\newcommand{\myDef}[1]{\parbox{\columnwidth}{\addtocounter{ctr}{1}{\w .}\\[-0.2cm]\textbf{Definition\ \Nummer:}\\#1}}
neuper@42272
   141
%\newcommand{\mySatz}[2]{\colorbox{myColor}{\parbox{\columnwidth}{\addtocounter{ctr}{1}{\g .}\\[-0.2cm]\textbf{Satz\ \Nummer:}\ #1\\ #2}}}
neuper@42272
   142
%\newcommand{\myBeweis}[1]{\textit{\textbf{Beweis:}\\ #1}}
neuper@42272
   143
%\newcommand{\myAlg}[2]{\parbox{\columnwidth}{\addtocounter{ctr}{1}\textbf{Algorithmus\ \Nummer:}\ \ #1\\#2}}
neuper@42272
   144
%\newcommand{\myProg}[1]{\fbox{\parbox{\columnwidth}{#1}}}
neuper@42272
   145
%
neuper@42272
   146
%\newcommand{\add}[1]{\addtocounter{#1}{1}}
neuper@42272
   147
%\newcommand{\zahl}[1]{\setcounter{#1}{Z}}
neuper@42272
   148
%\newcommand{\Q}[2]{\parbox{\columnwidth}{$^{[\arabic{#1}/#2]}$ }}
neuper@42272
   149
%
neuper@42272
   150
%\newcommand{\Nummer}{\thesection.\arabic{ctr}}
neuper@42272
   151
%
meindl_diana@42265
   152
%---------- --------------------------------------------------- Beginn -----------------------------------------------------------------------
meindl_diana@42263
   153
neuper@42272
   154
\title{Greatest Common Divisor \\ for Multivariate Polynomials}
neuper@42272
   155
\author{Diana Meindl\\meindl\_diana@yahoo.com}
neuper@42272
   156
\date{\today}
meindl_diana@42263
   157
meindl_diana@42263
   158
\begin{document}
meindl_diana@42263
   159
\maketitle
neuper@42272
   160
%{\w .}\\[12cm]
neuper@42272
   161
%\begin{center}
neuper@42272
   162
%Presented to \\
neuper@42272
   163
%A.Univ.Prof. Dipl.-Ing. Dr. Wolfgang Schreiner (RISC Insitute)\\
neuper@42272
   164
%and\\
neuper@42273
   165
%Dr. techn. Walther Neuper (Institut für Softwaretechnologie, TU Graz)
neuper@42272
   166
%\end{center}
neuper@42272
   167
%\newpage
neuper@42272
   168
%{\w .}\hspace{6.5cm}\textbf{Abstact}\\[0.5cm]
neuper@42272
   169
neuper@42272
   170
\abstract{
neuper@42272
   171
This is a proposal for a Masters Thesis at RISC, the Research Institute for Symbolic Computation at Linz University.\\
neuper@42272
   172
neuper@42272
   173
Calculation with fractions is an important part of Computer Algebra Systems (CAS). This proposal aims at a specific part of such calculations, the greatest common divisor (GCD) used for cancellation, but in the very general context of multivariate polynomials. Cancellation of multivariate polynomials is a settled topic in Computer Algebra, respective algorithms well documented and implementations available in all CASs.
neuper@42272
   174
neuper@42272
   175
This proposal claims for novelty with respect to the context of implementation in Computer Theorem Proving (CTP). On CTP's present development towards industrial use in software and systems verification, specific domain models involve demand on more and more mathematics, and within mathematics involve demand for more and more features. The proposed implementation of GCD and cancellation follows an actual demand.
neuper@42272
   176
neuper@42272
   177
If the implementation is successful, it might be included into the distribution of Isabelle, one of the two dominating CTPs in Europe.
neuper@42272
   178
}
neuper@42272
   179
meindl_diana@42263
   180
\newpage
neuper@42272
   181
%WN vorerst zu Zwecken der "Ubersicht lassen ...
neuper@42272
   182
\tableofcontents
neuper@42272
   183
meindl_diana@42234
   184
\section{Background}
neuper@42272
   185
The \sisac-project is a research and development project at the Institute for Software Technology of the Graz University of Technology. It is an educational mathematics assistant, a single-stepping system for applied mathematics based on the computer theorem prover Isabelle. The special is an easy readable knowledge base including Isabelles HOL-theories and a transparently working knowledge interpreter (a generalization of 'single stepping' algebra systems).
meindl_diana@42266
   186
The background to both, development and research, is given by actual needs in math education as well as by foundamental questions about 'the mechanization of thinking' as an essential aspect in mathematics and in technology.
neuper@42272
   187
The \sisac-system under construction comprises a tutoring-system and an authoring-system. The latter provides for adaption to various needs of individual users and educational institutions and for extensions to arbitrary fields of applied mathematics.
neuper@42272
   188
neuper@42272
   189
TODO:\\
neuper@42272
   190
European provers: Isabelle \cite{Nipkow-Paulson-Wenzel:2002}, Coq \cite{Huet_all:94}\\
neuper@42272
   191
American provers: PVS~\cite{pvs}, ACL2~\footnote{http://userweb.cs.utexas.edu/~moore/acl2/}\\
neuper@42272
   192
meindl_diana@42234
   193
\section{Goal of the thesis}
meindl_diana@42234
   194
\subsection{Current situation}
neuper@42272
   195
At the time there is no good implimentation for the problem of canceling fractions in \sisac and or in Isabelle. But because canceling is important for calculating with fractions a new implimentation is necessary.
meindl_diana@42266
   196
meindl_diana@42234
   197
\subsection{Problem} 
neuper@42272
   198
The wish is to handle fractions in \sisac not only in one variable also in more. So the goal of this thesis ist to find, assess and evaluate the existing algorithms and methods for finding the GCD. This will be an functional programm with the posibility to include it into Isabelle.
neuper@42272
   199
neuper@42272
   200
%WN eine pr"azisere Beschreibung des Problems kann ich mir nicht vorstellen (englische Version der Mail haben wir auch, aber sie passt nicht zur deutschen Antwort von Prof.Nipkow) ...
neuper@42272
   201
\bigskip
neuper@42272
   202
TODO Mail to Prof. Nipkow, leader of the development of Isabelle \cite{Nipkow-Paulson-Wenzel:2002} at TU M\"unchen, Mon, 23 May 2011 08:58:14 +0200:
neuper@42272
   203
\begin{verbatim}
neuper@42272
   204
Eine erste Idee, wie die Integration der Diplomarbeit f"ur
neuper@42272
   205
einen Benutzer von Isabelle aussehen k"onnte, w"are zum 
neuper@42272
   206
Beispiel im
neuper@42272
   207
neuper@42272
   208
   lemma cancel:
neuper@42272
   209
     assumes asm3: "x2 - x*y \<noteq> 0" and asm4: "x \<noteq> 0"
neuper@42272
   210
     shows "(x2 - y2) / (x2 - x*y) = (x + y) / (x::real)"
neuper@42272
   211
     apply (insert asm3 asm4)
neuper@42272
   212
     apply simp
neuper@42272
   213
   sorry
neuper@42272
   214
neuper@42272
   215
die Assumptions
neuper@42272
   216
neuper@42272
   217
   asm1: "(x2 - y2) = (x + y) * (x - y)" and asm2: "x2 - x*y = x * (x - y)"
neuper@42272
   218
neuper@42272
   219
im Hintergrund automatisch zu erzeugen (mit der Garantie, 
neuper@42272
   220
dass "(x - y)" der GCD ist) und sie dem Simplifier (f"ur die 
neuper@42272
   221
Rule nonzero_mult_divide_mult_cancel_right) zur Verf"ugung zu 
neuper@42272
   222
stellen, sodass anstelle von "sorry" einfach "done" stehen kann.
neuper@42272
   223
Und weiters w"are eventuell asm3 zu "x - y \<noteq> 0" zu vereinfachen, 
neuper@42272
   224
eine Rewriteorder zum Herstellen einer Normalform festzulegen, etc.
neuper@42272
   225
\end{verbatim}
neuper@42272
   226
%WN und eine bessere Motivation f"ur eine Master Thesis kann ich mir auch nicht vorstellen ...
neuper@42272
   227
Response of Prof. Nipkow:
neuper@42272
   228
neuper@42272
   229
\begin{verbatim}
neuper@42272
   230
Unser Spezialist fuer die mathematischen Theorien ist Johannes H"olzl. 
neuper@42272
   231
Etwas allgemeinere Fragen sollten auf jeden Fall an isabelle-dev@ 
neuper@42272
   232
gestellt werden.
neuper@42272
   233
neuper@42272
   234
Viel Erfolg bei der Arbeit!
neuper@42272
   235
Tobias Nipkow
neuper@42272
   236
\end{verbatim}
neuper@42272
   237
neuper@42272
   238
meindl_diana@42234
   239
\subsection{Expected results}
meindl_diana@42266
   240
Find good algorithms for the different problems, and find out which one will be the best for the special problem.\\
meindl_diana@42270
   241
The program should handling:
meindl_diana@42266
   242
\begin{itemize}
meindl_diana@42266
   243
\item[]real and rational coefficients. Maybe also imaginary coefficients.
meindl_diana@42270
   244
\item[]Multi variable polynomials canceling and adding, when they are in normal form.
meindl_diana@42266
   245
\end{itemize}
neuper@42272
   246
For the program should be used a functional programming language with good commentaries. And it should be based on Isabelle and works correctly in \sisac.
meindl_diana@42234
   247
meindl_diana@42234
   248
\section{State of the art}
neuper@42272
   249
In a broad view the context of this thesis can be seen as ``computation and deduction'': simplification and in particular cancellation of rational terms is concern of \textbf{computation} implemented in Computer Algebra Systems (CAS) --- whereas the novelty within the thesis is given by an implementation of cancellation in a computer theorem prover (CTP), i.e. in the domain of \textbf{deduction} with respective logical rigor not addressed in the realm of CAS.
meindl_diana@42234
   250
neuper@42272
   251
Below, after a general survey on computation, represented by CAS, and on deduction, represented by CTP, a more narrow view on ``CAS-functionality in CTP'' is pursued.
neuper@42272
   252
neuper@42272
   253
\subsection{Computer Algebra and Proof Assistants}
neuper@42272
   254
%WN achtung: diese subsection is fast w"ortlich kopiert aus \cite{plmms10} -- also in der Endfassung bitte "uberarbeiten !!!
neuper@42272
   255
Computer Algebra and Proof Assistants have coexisted for a many years so there is much research trying to bridge the gap between these approaches from both sides. We shall continue to abbreviate Computer Algebra (Systems) by ``CAS'', and in analogy we shall abbreviate proof assistants by CTP, computer theorem provig (comprising both, interactive theorem proving (ITP) and automated theorem proving (ATP), since in CTP there are ATP-tools included today.)
neuper@42272
   256
neuper@42272
   257
First, many CTPs already have CAS-like functionality,
neuper@42272
   258
especially for domains like arithmetic. They provide the user
neuper@42272
   259
with conversions, tactics or decision procedures that solve
neuper@42272
   260
problems in a particular domain. Such decision procedures present
neuper@42272
   261
in the standard library of HOL Light~\footnote{http://www.cl.cam.ac.uk/~jrh13/hol-light/} are used inside the
neuper@42272
   262
prototype described in Sect.\ref{cas-funct} on p.\pageref{part-cond} for arithmetic's,
neuper@42272
   263
symbolic differentiation and others.
neuper@42272
   264
neuper@42272
   265
Similarly some CAS systems provide environments that allow
neuper@42272
   266
logical reasoning and proving properties within the system. Such
neuper@42272
   267
environments are provided either as logical
neuper@42272
   268
extensions (e.g.~\cite{logicalaxiom}) or are implemented within a
neuper@42272
   269
CAS using its language~\cite{theorema00}.
neuper@42272
   270
neuper@42272
   271
There are numerous architectures for information exchange between
neuper@42272
   272
CAS and CTP with different levels of \emph{degree of trust}
neuper@42272
   273
between the prover and the CAS. In principle, there are several approaches. 
neuper@42272
   274
If CAS-functionality is not fully embedded in CTP, CAS can be called as ``oracles'' nevertheless (for efficiency reasons, in general) --- their results are regarded like prophecies of Pythia in Delphi. There are three kinds of checking oracles, however:
neuper@42272
   275
\begin{enumerate}
neuper@42272
   276
\item Just adopt the CAS result without any check. Isabelle internally marks such results.
neuper@42272
   277
\item Check the result inside CTP. There are many cases, where such checks are straight forward, for instance, checking the result of factorization by multiplication of the factors, or checking integrals by differentiation.
neuper@42272
   278
\item Generate a derivation of the result within CTP; in Isabelle this is called ``proof reconstruction''.
neuper@42272
   279
\end{enumerate}
neuper@42272
   280
A longer list of frameworks for
neuper@42272
   281
information exchange and bridges between systems can be found
neuper@42272
   282
in~\cite{casproto}.
neuper@42272
   283
neuper@42272
   284
There are many approaches to defining partial functions in proof
neuper@42272
   285
assistants. Since we would like the user to define functions
neuper@42272
   286
without being exposed to the underlying logic of the proof
neuper@42272
   287
assistant we only mention some automated mechanisms for defining
neuper@42272
   288
partial functions in the logic of a CTP.
neuper@42272
   289
Krauss~\cite{krauss} has developed a framework for defining
neuper@42272
   290
partial recursive functions in Isabelle/HOL, which formally
neuper@42272
   291
proves termination by searching for lexicographic combinations of
neuper@42272
   292
size measures. Farmer~\cite{farmer} implements a scheme for
neuper@42272
   293
defining partial recursive functions in \textrm{IMPS}.
neuper@42272
   294
neuper@42272
   295
\subsection{Motivation for CAS-functionality in CTP}
neuper@42272
   296
In the realm of CTP formuas are dominated by quantifiers $\forall$, $\exists$ and $\epsilon$ (such) and by operations like $\Rightarrow$, $\land$ and $\lor$. Numbers were strangers initially; numerals have been introduced to Isabelle not much before the year 2000~\footnote{In directory src/Provers/Arith/ see the files cancel\_numerals.ML and cancel\_numeral\_factor.ML in the Isabelle distribution 2011. They still use the notation $\#1,\#2,\#3,\dots$ from before 2000~!}. However, then numerals have been implemented with {\em polymorphic type} such that $2\cdot r\cdot\pi$ ($2$ is type \textit{real}) and $\pi_{\it approx}=3.14\,\land\, 2\cdot r\cdot\pi_{\it approx}$ can be written as well as $\sum_i^n i=\frac{n\cdot(n+1)}{2}$ ($2$ is type \textit{nat}). The different types are inferred by Hindle-Milner type inference \cite{damas-milner-82,Milner-78,Hindley-69}.
neuper@42272
   297
neuper@42272
   298
1994 was an important year for CTP: the Pentium Bug caused excitement in the IT community all around the world and motivated INTEL to invest greatly into formal verification of circuits (which carried over to verification of software). Not much later John Harrison mechanized real numbers as Dedekind Cuts in HOL Light \footnote{http://www.cl.cam.ac.uk/~jrh13/hol-light/} and derived calculus, derivative and integral from that definition \cite{harr:thesis}, an implementation which has been transferred to Isabelle very soon after that~\footnote{In the directory src/HOL/Multivariate\_Analysis/ see the files Gauge\_Measure.thy, Integration.thy, Derivative.thy, Real\_Integration.thy, Brouwer\_Fixpoint.thy, Fashoda.thy}.
neuper@42272
   299
neuper@42272
   300
Harrison also says that ``CAS are ill-defined'' and gives, among others, an example relevant for this thesis on cancellation: TODO ... meromorphic functions ...
neuper@42272
   301
neuper@42272
   302
\medskip
neuper@42272
   303
The main motivation for further introduction of CAS-functionality to CTP is also technology-driven: In this decade domain engineering is becoming an academic discipline with industrial relevance \cite{db:dom-eng}: vigorous efforts extend the scope of formal specifications even beyond software technology, and thus respective domains of mathematical knowledge are being mechanized in CTP. The Archive of Formal Proofs~\footnote{http://afp.sourceforge.net/} is Isabelle's repository for such work.
neuper@42272
   304
neuper@42272
   305
\subsection{Simplification within CTP}
neuper@42272
   306
Cancellation, the topic of this thesis, is a specific part of simplification of rationals. In the realm of CAS cancellation is {\em not} an interesting part of the state of the art, because cancellation has been implemented in the prevailing CAS more than thirty years ago --- however, cancellation of multivariate polynomials is {\em not} yet implemted in any of the dominating CTPs.
neuper@42272
   307
%WN: bitte mit Anfragen an die Mailing-Listen nachpr"ufen: Coq, HOL, ACL2, PVS
neuper@42272
   308
neuper@42272
   309
As in other CTPs, in Isabelle the simplifier is a powerful software component; the sets of rewrite rules, called \textit{simpsets}, contain several hundreds of elements. Rewriting is still very efficient, because the simpsets are transformed to term nets \cite{term-nets}.
neuper@42272
   310
neuper@42272
   311
Rational terms of multivariate polynomials still have a normal form \cite{bb-loos} and thus equivalence of respective terms is decidable. This is not the case, however, with terms containing roots or transcedent functions. Thus, CAS are unreliable by design in these cases.
neuper@42272
   312
neuper@42272
   313
In CTP, simplification of non-decidable domains is already an issue, as can be seem in the mail with subject ``simproc divide\_cancel\_factor produces error'' in the mailing-list \textit{isabelle-dev@mailbroy.informatik.tu-muenchen.de} from Thu, 15 Sep 2011 16:34:12 +0200
neuper@42272
   314
{%\footnotesize --- HILFT NICHTS
neuper@42272
   315
\begin{verbatim}
neuper@42272
   316
Hi everyone,
neuper@42272
   317
neuper@42272
   318
in the following snippet, applying the simplifier causes an error:
neuper@42272
   319
neuper@42272
   320
------------------------------------------
neuper@42272
   321
theory Scratch
neuper@42272
   322
  imports Complex_Main
neuper@42272
   323
begin
neuper@42272
   324
neuper@42272
   325
lemma
neuper@42272
   326
  shows "(3 / 2) * ln n = ((6 * k * ln n) / n) * ((1 / 2 * n / k) / 2)"
neuper@42272
   327
apply simp
neuper@42272
   328
------------------------------------------
neuper@42272
   329
neuper@42272
   330
outputs
neuper@42272
   331
neuper@42272
   332
------------------------------------------
neuper@42272
   333
Proof failed.
neuper@42272
   334
(if n = 0 then 0 else 6 * (k * ln n) / 1) * 2 / (4 * k) =
neuper@42272
   335
2 * (Numeral1 * (if n = 0 then 0 else 6 * (k * ln n) / 1)) / (2 * (2 * k))
neuper@42272
   336
 1. n \not= Numeral0 \rightarrow k * (ln n * (2 * 6)) / (k * 4) = k * (ln n * 12) / (k * 4)
neuper@42272
   337
1 unsolved goal(s)!
neuper@42272
   338
The error(s) above occurred for the goal statement:
neuper@42272
   339
(if n = 0 then 0 else 6 * (k * ln n) / 1) * 2 / (4 * k) =
neuper@42272
   340
2 * (Numeral1 * (if n = 0 then 0 else 6 * (k * ln n) / 1)) / (2 * (2 * k))
neuper@42272
   341
------------------------------------------
neuper@42272
   342
\end{verbatim}
neuper@42272
   343
}
neuper@42272
   344
Mail ``Re: simproc divide\_cancel\_factor produces error'' on Fri, 16 Sep 2011 22:33:36 +0200
neuper@42272
   345
\begin{verbatim}
neuper@42272
   346
> > After the release, I'll have to think about doing a complete overhaul
neuper@42272
   347
> > of all of the cancellation simprocs.
neuper@42272
   348
You are very welcome to do so.  Before you start, call on me and I will
neuper@42272
   349
write down some ideas I had long ago (other may want to join, too).
neuper@42272
   350
\end{verbatim}
neuper@42272
   351
%WN: bist du schon angemeldet in den Mailing-Listen isabelle-users@ und isabelle-dev@ ? WENN NICHT, DANN WIRD ES H"OCHSTE ZEIT !!!
neuper@42272
   352
neuper@42272
   353
\subsection{Open Issues with CAS-functionality in CTP}\label{cas-funct}
neuper@42272
   354
There is at least one effort explicitly dedicated to implement CAS-functionality in CTP \cite{cezary-phd}. %WN bitte unbedingt lesen (kann von mir in Papierform ausgeborgt werden) !!!
neuper@42272
   355
In this work three issues has been identified: partiality conditions, multi-valued functions and real numbers. These issues are addressed in the subsequent paragraphs, followed by a forth issue raised by \sisac.
neuper@42272
   356
neuper@42272
   357
\paragraph{Partiality conditions}\label{part-cond} are introduced by partial functions or by conditional rewriting. An example of how the CAS-functionality \cite{cezary-phd} looks like is given on p.\pageref{fig:casproto}. 
neuper@42272
   358
\cite{cezary-phd} gives an introductory example (floated to p.\pageref{fig:casproto}) which will be referred to in the sequel.
neuper@42272
   359
\input{thol.tex}
neuper@42272
   360
%WN das nachfolgende Format-Problem l"osen wir sp"ater ...
neuper@42272
   361
\begin{figure}[hbt]
neuper@42272
   362
\begin{center}
neuper@42272
   363
\begin{holnb}
neuper@42272
   364
  In1 := vector [\&2; \&2] - vector [\&1; \&0] + vec 1
neuper@42272
   365
 Out1 := vector [\&2; \&3]
neuper@42272
   366
  In2 := diff (diff (\Lam{}x. \&3 * sin (\&2 * x) +
neuper@42272
   367
         \&7 + exp (exp x)))
neuper@42272
   368
 Out2 := \Lam{}x. exp x pow 2 * exp (exp x) +
neuper@42272
   369
         exp x * exp (exp x) + -- \&12 * sin (\&2 * x)
neuper@42272
   370
  In3 := N (exp (\&1)) 10
neuper@42272
   371
 Out3 := #2.7182818284 + ... (exp (\&1)) 10 F
neuper@42272
   372
  In4 := x + \&1 - x / \&1 + \&7 * (y + x) pow 2
neuper@42272
   373
 Out4 := \&7 * x pow 2 + \&14 * x * y + \&7 * y pow 2 + \&1
neuper@42272
   374
  In5 := sum (0,5) (\Lam{}x. \&x * \&x)
neuper@42272
   375
 Out5 := \&30
neuper@42272
   376
  In6 := sqrt (x * x) assuming x > &1
neuper@42272
   377
 Out6 := x
neuper@42272
   378
\end{holnb}
neuper@42272
   379
\end{center}
neuper@42272
   380
\caption{\label{fig:casproto}Example interaction with the prototype
neuper@42272
   381
  CAS-like input-response loop. For the user input given in the
neuper@42272
   382
  \texttt{In} lines, the system produces the output in \texttt{Out}
neuper@42272
   383
  lines together with HOL Light theorems that state the equality
neuper@42272
   384
  between the input and the output.}
neuper@42272
   385
\end{figure}
neuper@42272
   386
In lines {\tt In6, Out6} this examples shows how to reliably simplify $\sqrt{x}$. \cite{caspartial} %TODO
neuper@42272
   387
gives more details on handling side conditions in formalized partial functions.
neuper@42272
   388
neuper@42272
   389
Analoguous to this example, cancellations (this thesis is concerned with) like
neuper@42272
   390
$$\frac{x^2-y^2}{x^2-x\cdot y}=\frac{x+y}{x}\;\;\;\;{\it assuming}\;x-y\not=0\land x\not=0$$
neuper@42272
   391
produce assumptions, $x-y\not=0, x\not=0$ here. Since the code produced in the framework of this thesis will be implemented in Isabelle's simplifier (outside this thesis), the presentation to the user will be determined by Isabelle and \sisac{} using the respective component of Isabelle. Also reliable handling of assumptions like $x-y\not=0, x\not=0$ is up to these systems.
neuper@42272
   392
neuper@42272
   393
\paragraph{Multi-valued functions:}\label{multi-valued}
neuper@42272
   394
\cite{seeingroots,davenp-multival-10} discuss cases where CAS are error prone when dropping a branch of a multi-valued function~\footnote{``Multivalued \textit{function}'' is a misnomer, since the value of a function applied to a certain argument is unique by definition of function.}. Familiar examples are ...
neuper@42272
   395
%WN ... zur Erkl"arung ein paar Beispiele von http://en.wikipedia.org/wiki/Multivalued_function
neuper@42272
   396
neuper@42272
   397
\paragraph{Real numbers} cannot be represented by numerals. In engineering applications, however, approximation by floating-point numbers are frequently useful. In CTP floating-point numbers must be handled rigorously as approximations. Already \cite{harr:thesis} introduced operations on real numerals accompanied by rigorous calculation of precision. \cite{russellphd} describes efficient implementation of infinite precision real numbers in Coq.
neuper@42272
   398
neuper@42272
   399
\paragraph{All solutions for equations} must be guaranted, if equation solving is embedded within CTP. So, given an equation $f(x)=0$ and the set of solutions $S$ of this equation, we want to have both,
neuper@42272
   400
\begin{eqnarray}
neuper@42272
   401
   \exists x_s.\;x_s\in S &\Rightarrow& f(x_s) = 0 \\\label{is-solut}
neuper@42272
   402
  x_s\in S &\Leftarrow& \exists x_s.\;f(x_s) = 0    \label{all-solut}
neuper@42272
   403
\end{eqnarray}
neuper@42272
   404
where (\ref{all-solut}) ensures that $S$ contains {\em all} solutions of the equation. The \sisac-project has implemented a prototype of an equation solver~\footnote{See \textit{equations} in the hierarchy of specifications at http://www.ist.tugraz.at/projects/isac/www/kbase/pbl/index\_pbl.html}.
neuper@42272
   405
neuper@42272
   406
There is demand for fullfledged equation solving in CTP, including equational systems and differential equations, because \sisac{} has a prototype of a CTP-based programming language calling CAS functions; and Lucas-Interpretation \cite{wn:lucas-interp-12} makes these functions accessible by single-stepping and ``next step guidance'', which would automatically generate a learning system for equation solving.
neuper@42272
   407
meindl_diana@42234
   408
\section{Thesis structure}
meindl_diana@42266
   409
The proposed table of contents of the thesis on the chapter level is as follows:
meindl_diana@42234
   410
\begin{enumerate}
meindl_diana@42263
   411
	\item Introduction (2-3 pages)
meindl_diana@42266
   412
	\item Computer Algebra Systems (CAS) (5 - 7 pages)\\
meindl_diana@42270
   413
	Which different CAS exists and whats the focus of them.
neuper@42273
   414
	\item The \sisac-Project (5 - 7 pages)\\
neuper@42273
   415
	This chapter will describe the \sisac-Project and the goals of the project.
meindl_diana@42234
   416
	\item Univariate Polynomials (15-20 pages)\\
meindl_diana@42263
   417
	This chapter will describe different Algorithms for univariate polynomials, with different coefficients.
meindl_diana@42234
   418
	\item Multivariate Polynomials (20-25 pages)\\
meindl_diana@42263
   419
	This chapter will describe different Algorithms for multivariate polynomials,  with different coefficients
meindl_diana@42263
   420
	\item Functional programming and SML(2-5 pages)\\
meindl_diana@42263
   421
	The basic idea of this programming languages.
neuper@42273
   422
	\item Implimentation in \sisac-Project (15-20 pages)
meindl_diana@42263
   423
	\item Conclusion (2-3 pages)
meindl_diana@42234
   424
\end{enumerate}
meindl_diana@42234
   425
%\newpage
meindl_diana@42234
   426
meindl_diana@42234
   427
\section{Timeline}
meindl_diana@42234
   428
%Werd nie fertig.\\
meindl_diana@42234
   429
\begin{center}
meindl_diana@42234
   430
		\begin{tabular}{|l|l|l|}
meindl_diana@42234
   431
		\hline
meindl_diana@42234
   432
			 \textbf{Time}&\textbf{Thesis}&\textbf{Project}\\
meindl_diana@42263
   433
			 \hline
meindl_diana@42266
   434
			 & Functional programming & Learning the basics and the idea\\
meindl_diana@42266
   435
			 & & of funcional programming\\
meindl_diana@42263
   436
			 \hline
meindl_diana@42266
   437
			 & Different CAS & Can they handle the problem \\
meindl_diana@42266
   438
			 & &and which algorithm do they use?\\ \hline
meindl_diana@42270
   439
			 & Univariate Polynomials & Implementation of the Algorithm\\
meindl_diana@42263
   440
			 & & for univariate Polynomials \\ \hline
meindl_diana@42270
   441
		   & Multivariate Polynomials &  Implementation of the Algorithm\\
meindl_diana@42266
   442
			 & & for multivariate Polynomials \\ \hline 
neuper@42272
   443
		   & The \sisac-Project &\\ \hline
meindl_diana@42266
   444
		   & Conclusion and Introduction & Find good examples for testing\\
meindl_diana@42234
   445
			\hline
meindl_diana@42234
   446
		\end{tabular}
meindl_diana@42234
   447
	\end{center}
meindl_diana@42266
   448
neuper@42273
   449
%WN oben an passender stelle einf"ugen
neuper@42272
   450
\cite{einf-funct-progr} \cite{Winkler:96}
meindl_diana@42234
   451
		
neuper@42273
   452
		
neuper@42272
   453
\bibliography{references}
neuper@42272
   454
%\section{Bibliography}
neuper@42272
   455
%%mindestens 10
neuper@42272
   456
%\begin{enumerate}
neuper@42273
   457
% \item Bird/Wadler, \textit{Einführung in die funktionale Programmierung}, Carl Hanser and Prentice-Hall International, 1992
neuper@42272
   458
% \item Franz Winkler, \textit{Polynomial Algorithms in Computer Algebra}, Springer,1996
neuper@42272
   459
% \item %M. Mignotte, \textit{An inequality about factors of polynomial}
neuper@42272
   460
% \item %M. Mignotte, \textit{Some useful bounds}
neuper@42272
   461
% \item %W. S. Brown and J. F. Traub. \textit{On euclid's algorithm and the theory of subresultans}, Journal of the ACM (JACM), 1971
neuper@42272
   462
% \item %Bruno Buchberger, \textit{Algorhimic mathematics: Problem types, data types, algorithm types}, Lecture notes, RISC Jku A-4040 Linz, 1982
neuper@42272
   463
% 
neuper@42272
   464
% \item %Tateaki Sasaki and Masayuki Suzuki, \textit{Thre new algorithms for multivariate polynomial GCD}, J. Symbolic Combutation, 1992
neuper@42272
   465
% \item
neuper@42272
   466
% \item
neuper@42272
   467
% \item
neuper@42272
   468
%\end{enumerate} 
meindl_diana@42263
   469
neuper@42272
   470
\end{document}
neuper@42272
   471
neuper@42274
   472
ALLES UNTERHALB \end{document} WIRD VON LATEX NICHT BERUECKSICHTIGT
neuper@42272
   473
WN110916 grep-ing through Isabelle code:
neuper@42272
   474
neuper@42272
   475
neuper@neuper:/usr/local/isabisac/src$ find -name "*umeral*"
neuper@42272
   476
./HOL/ex/Numeral.thy
neuper@42272
   477
./HOL/Tools/nat_numeral_simprocs.ML
neuper@42272
   478
./HOL/Tools/numeral_syntax.ML
neuper@42272
   479
./HOL/Tools/numeral.ML
neuper@42272
   480
./HOL/Tools/numeral_simprocs.ML
neuper@42272
   481
./HOL/Matrix/ComputeNumeral.thy
neuper@42272
   482
./HOL/Library/Numeral_Type.thy
neuper@42272
   483
./HOL/Numeral_Simprocs.thy
neuper@42272
   484
./HOL/Import/HOL/numeral.imp
neuper@42272
   485
./HOL/Code_Numeral.thy
neuper@42272
   486
./HOL/Nat_Numeral.thy
neuper@42272
   487
./ZF/Tools/numeral_syntax.ML
neuper@42272
   488
./Provers/Arith/cancel_numeral_factor.ML
neuper@42272
   489
./Provers/Arith/cancel_numerals.ML
neuper@42272
   490
./Provers/Arith/combine_numerals.ML
neuper@42272
   491
neuper@42272
   492
neuper@neuper:/usr/local/isabisac/src$ find -name "*ancel*"
neuper@42272
   493
./HOL/Tools/abel_cancel.ML                 
neuper@42272
   494
./Provers/Arith/cancel_div_mod.ML
neuper@42272
   495
./Provers/Arith/cancel_numeral_factor.ML  Paulson 2000 !!!
neuper@42272
   496
./Provers/Arith/cancel_sums.ML            
neuper@42272
   497
./Provers/Arith/cancel_numerals.ML        Paulson 2000