# HG changeset patch # User Walther Neuper # Date 1379404252 -7200 # Node ID f8845fc8f38da72f667a8b3bd14e6db456f0d68d # Parent 7f3760f39bdcf8bd43d242f0210377d2cb62b361 separated Isac documentation (~~/doc-isac) from Isabelle documentation (~~/src/Doc) diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/CTP-userinterfaces.bib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/CTP-userinterfaces.bib Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,161 @@ +@inproceedings{Aspinall:2007:FIP:1420412.1420429, + author = {Aspinall, David and L\"{u}th, Christoph and Winterstein, Daniel}, + title = {A Framework for Interactive Proof}, + booktitle = {Proceedings of the 14th symposium on Towards Mechanized Mathematical Assistants: 6th International Conference}, + series = {Calculemus '07 / MKM '07}, + year = {2007}, + isbn = {978-3-540-73083-5}, + location = {Hagenberg, Austria}, + pages = {161--175}, + numpages = {15}, + url = {http://dx.doi.org/10.1007/978-3-540-73086-6_15}, + doi = {http://dx.doi.org/10.1007/978-3-540-73086-6_15}, + acmid = {1420429}, + publisher = {Springer-Verlag}, + address = {Berlin, Heidelberg}, +} + +@Book{armstrong:erlang96, + author = {Armstrong, Joe and others}, + title = {Concurrent Programming in Erlang}, + publisher = {Prentice Hall}, + year = {1996} +} + +@TechReport{odersky:scala06, + author = {Odersky, Martin and others}, + title = {An Overview of the Scala Programming Language}, + institution = {\'Ecole Polytechnique F\'ed\'erale de Lausanne (EPFL)}, + year = {2006}, + type = {Technical Report LAMP-REPORT-2006-001}, + address = {1015 Lausanne, Switzerland}, + note = {Second Edition}, + annote = {http://www.scala-lang.org/sites/default/files/linuxsoft_archives/docu/files/ScalaOverview.pdf} +} + +@article{Haller:2009:SAU:1496391.1496422, + author = {Haller, Philipp and Odersky, Martin}, + title = {Scala Actors: Unifying thread-based and event-based programming}, + journal = {Theor. Comput. Sci.}, + volume = {410}, + issue = {2-3}, + month = {February}, + year = {2009}, + issn = {0304-3975}, + pages = {202--220}, + numpages = {19}, + url = {http://portal.acm.org/citation.cfm?id=1496391.1496422}, + doi = {10.1016/j.tcs.2008.09.019}, + acmid = {1496422}, + publisher = {Elsevier Science Publishers Ltd.}, + address = {Essex, UK}, + keywords = {Actors, Concurrent programming, Events, Threads}, +} + +@InProceedings{scala:jmlc06, + author = {Philipp Haller and Martin Odersky}, + title = {Event-Based Programming without Inversion of Control}, + booktitle = {Proc. Joint Modular Languages Conference}, + year = 2006, + series = {Springer LNCS} +} + + +@InProceedings{makarius:isa-scala-jedit, + author = {Makarius Wenzel}, + title = {Asyncronous Proof Processing with {Isabelle/Scala} and {Isabelle/jEdit}}, + booktitle = {User Interfaces for Theorem Provers (UITP 2010)}, + year = {2010}, + editor = {C. Sacerdoti Coen and D. Aspinall}, + address = {Edinburgh, Scotland}, + month = {July}, + organization = {FLOC 2010 Satellite Workshop}, + note = {http://www4.in.tum.de/~wenzelm/papers/async-isabelle-scala.pdf} +} + +@Book{db:dom-eng, + author = {Bj{\o}rner, Dines}, + title = {Domain Engineering. Technology Management, Research and Engineering}, + publisher = {JAIST Press}, + year = {2009}, + month = {Feb}, + series = {COE Research Monograph Series}, + volume = {4}, + address = {Nomi, Japan} +} + +@inproceedings{Haftmann-Nipkow:2010:code, + author = {Florian Haftmann and Tobias Nipkow}, + title = {Code Generation via Higher-Order Rewrite Systems}, + booktitle = {Functional and Logic Programming, 10th International +Symposium: {FLOPS} 2010}, + year = {2010}, + publisher = {Springer}, + series = {Lecture Notes in Computer Science}, + volume = {6009} +} + +@Manual{coq1999, + title = {The Coq Proof Assistant}, + author = {Barras, B. and others}, + organization = {INRIA-Rocquencourt - CNRS-ENS Lyon}, + month = {July}, + year = {1999}, + pnote={},status={cited},source={mkm01.caprotti},location={} +} + +@Book{meta-ML, + author = {Gordon,M. and Milner,R. and Wadsworth,C. P.}, + title = {Edinburgh LCF: A Mechanised Logic of Computation}, + publisher = { Springer-Verlag}, + year = {1979}, + volume = {78}, + series = {Lecture Notes in Computer Science} +} + +@book{Paulson:Isa94, + title={Isabelle: a generic theorem prover}, + author={Paulson, Lawrence C. }, publisher={Springer-Verlag},year={1994}, + volume={828},series={Lecture Notes in Computer Science},address={},edition={},month={}, + note={With contributions by Topias Nipkow}, + status={},source={},location={-} + } + +@Book{pl:milner97, + author = {Robin Milner and Mads Tofte and Robert Harper and David MacQueen}, + title = {The Definition of Standard ML (Revised)}, + publisher = {The MIT Press}, + year = 1997, + address = {Cambridge, London}, + annote = {97bok375} +} + +@Article{back-grundy-wright-98, + author = {Back, Ralph and Grundy, Jim and von Wright, Joakim}, + title = {Structured Calculational Proof}, + journal = {Formal Aspects of Computing}, + year = {1998}, + number = {9}, + pages = {469-483} +} + +@Manual{isar-impl, + title = {The {Isabelle/Isar} Implementation}, + author = {Makarius Wenzel}, + month = {April 19}, + year = {2009}, + note = {With contributions by Florian Haftmann and Larry Paulson} +} + +@InProceedings{wenzel:isar, + author = {Wenzel, Markus}, + title = {Isar - a Generic Interpretative Approach to Readable Formal Proof Documents}, + booktitle = {Theorem Proving in Higher Order Logics}, + year = {1999}, + editor = {G. Dowek, A. Hirschowitz, C. Paulin, L. Thery}, + series = {LNCS 1690}, + organization = {12th International Conference TPHOLs'99}, + publisher = {Springer} +} + + diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/CTP-userinterfaces.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/CTP-userinterfaces.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,445 @@ +\documentclass{article} +\usepackage{a4} +\usepackage{times} +\usepackage{latexsym} +\bibliographystyle{alpha} +\usepackage{graphicx} + +\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} +\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} +\def\Problem{ {\tt Problem }} + +\title{Userinterfaces for Computer Theorem Provers.\\ + Contributions to Isabelle +} + +\author{G. Schafhauser, A. Schulhofer, M. Steger\\ +Knowledge Management Institute (KMI)\\ +TU Graz} + +\begin{document} +\maketitle +\abstract{ +This paper accompanies a pre-study on a sub-project planned within the \sisac-project. The goal of this sub-project is to extend the userinterface of the theorem prover Isabelle such, that Structured Derivations according to R.J.Back are interactively processed. The sub-project is one step towards using the upcoming Isabelle/Isar/Scala layer for \sisac. + +The paper comprises three parts: (1) Ample space is given to background information about the state of the art in user interfaces for theorem provers and about the upcoming requirements for future developments. (2) focuses the strategy of Isabelle and decisions in order to cope with future requirements. (3) provides a protocol of preparatory work for the sub-project. + +By the way, this paper shall serve as an entry point for students interested in joining the the work propared.} + +\section{Introduction}\label{intro} +Computer Theorem Provers (CTPs \footnote{The term CTP is used to address two different things in this paper: (1) the academic discipline comprising respective theories as well as (2) the products developed within this discipline, the provers and the respective technology.}) have a tradition as long as Computer Algebra Systems (CAS), another kind of mathematics assistants. However, CTPs task of proving is more challenging than calculating; so, in contrary to CASs, CTPs are not yet in widespread use --- not yet, because CTPs are on the step into industrial use in the current decade: Safe-critical software requires to be proven correct more and more \cite{db:dom-eng}, and the technology of CTP becomes ready to accomplish the task of efficiently proving hundreds of proof obligations. + +The present shift of the predominant user group from academic experts to software engineers raises novel user requirements for graphical user interfaces (GUI) of CTP. CTPs will become components of integrated development environments, and the knowledge bases have to scale up to industrial size. + +Two issues are particularly challenging: First, future knowledge bases (containing specifications, programs, tests etc) will under joint construction of many engineers. So requirements concerning cooperative work arise as already known from distributed repositories and version management. + +Second, CTP tends to exhaust resources in memory and in run-time. So, CTP will take profit from multicore processors upcoming in this decade --- and CTP are best suited to meet the architectural challenges raised by parallel programming, since this kind of mathematics assistants generally follow rigorous architectural principles and are comparably easy to adapt to these challenges \cite{makarius:isa-scala-jedit}. + +\medskip The paper is organised as follows: First a survey on CTP is given, Sect.\ref{ctp-techn} introduces two prominent CTPs, Sect.\ref{gui-coq-isa} describes their present user interfaces and Sect.\ref{gui-requir} goes into details with the novel requirements mentioned. Then Isabelle's plans for re-designing the user interface are presented: Sect.\ref{ml-users} motivates the strategy of how to approach the users' world, Sect.\ref{scala-medi} describes the rather recent programming language Scala connecting the world of languages for mathematics with the users' world and Sect.\ref{actors} goes into details with Scala's actor library. Finally possible contributions of the \sisac-team at TUG are discussed and prerequisites for such contributions presented: Sect.\ref{struct-der} presents a format for calculations particularly appropriate for education, which requires CTP support, Sect.\ref{plugin} describes plug-in technology required and Sect.\ref{netbeans} notes crucial details of proper project set-up in an integrated development environment. + +%Georg +\section{State of the art in CTP Interfaces} + +\subsection{A European technology: Coq and Isabelle}\label{ctp-techn} +% http://en.wikipedia.org/wiki/Coq\\ +% http://coq.inria.fr/ +% +% http://en.wikipedia.org/wiki/Isabelle\_(theorem\_prover)\\ +% http://isabelle.in.tum.de/index.html +% +%why math -- functional: some of the languages have been specifically designed for constructing software for symbolic computation (SC). +%%+ required for \ref{ml-users} +% +%SC http://en.wikipedia.org/wiki/Symbolic\_computation +%% mainly does not compute numerical values, but terms containing variables like functions (symbols) +% +%The LCF project +%http://hopl.murdoch.edu.au/showlanguage.prx?exp=8177 +%specifically designed a 'meta language' (ML) +%http://en.wikipedia.org/wiki/ML\_(programming\_language) +%\cite{pl:milner97} +%for developing CTP +\subsubsection{Standard ML} +Standard ML is a general-purpose, modular, functional programming language \cite{pl:milner97}. +Programs written in Standard ML consist of expressions to be evaluated, as opposed to statements or commands. +Functional programming languages constitute a family very different of object orientated languages, see Sect. \ref{ml-users}. ML originated from the LCF-project(Logic for Computable Functions)\cite{meta-Ml}, where it had been developed as a meta language. Since ML has been standardised this family of language is called Standard ML. Important for the logical foundation of SML is the $\lambda$-calculus. +%http://en.wikipedia.org/wiki/Standard_M +\subsubsection{Coq} +Coq is an interactive theorem prover, developed in France. +It is programmed in Objective Caml, an ML based programming language. +It has the ability to express mathematical assertions and check proof of mathematical assertions. +Furthermore Coq includes automatic theorem proving tactics and decision procedures. +Properties, programs and proofs are written a functional programming language called the Calculus of Inductive Constructions (CIC). +Proof development in Coq is done through a language of tactics that allows a user-guided proof process \cite{coq1999}. +Another feature of Coq is “that it can automatically extract executable programs from specifications, as either Objective Caml +or Haskell source code.“ +There are many easy-to-read introductions to Coq \footnote{http://coq.inria.fr/a-short-introduction-to-coq} on the internet. +\subsubsection{Isabelle} +Isabelle is an interactive theorem proving framework for high-level natural deduction proofs \cite{Paulson:Isa94}, written in Standard ML. +Isabelle is developed at University of Cambridge, Technische Universit\"at M\"unchen +and Universit\'e Paris-Sud. Isabelle is called a framework, because it implements several object logics. +The most widespread logic of Isabelle is Isabelle/HOL, short for higher-order logic. +Isabelle/HOL includes several specification tools, e.g. for data-types, inductive definitions and functions with complex pattern matching. +Proofs are written in the structured proof language Isar \cite{wenzel:isar}.Isabelle implements several tools, e.g. a reasoner, a simplifier and powerful automatic provers(Sledgehammer), increase the user's productivity in theorem proving. +Isabelle provides notational support: new notations can be introduced, using normal mathematical symbols. +Definitions and proofs may include \LaTeX{} source, from which Isabelle can automatically generate typeset documents. +Isabelle/HOL allows to turn executable specifications directly into code in SML, OCaml, and Haskell \cite{Haftmann-Nipkow:2010:code}. +%(http://www.cl.cam.ac.uk/research/hvg/Isabelle/overview.html) +\subsection{Userinterfaces for CTP: Coq and Isabelle}\label{gui-coq-isa} +% CoqIDE, .. +% http://coq.inria.fr/what-is-coq?q=node/57\\ +% earlier than Isabelle/jEdit +% +% ProofGeneral for Isabelle +% http://proofgeneral.inf.ed.ac.uk/\\ +% emacs stone age ? +\subsubsection{Coq Integrated Development Environment} +CoqIDE\footnote{http://coq.inria.fr/V8.1/refman/Reference-Manual016.html}, short for Coq Integrated Development Environment, is a graphical interface for Coq. It is written in Ocaml. +Its main purpose is to allow the user to navigate forward and backward into a Coq file, +executing corresponding commands or undoing them respectively. +There are several buffers for helping to write proof scripts. +Among all these buffers, there is always one which is the current running buffer, whose name is displayed on a green background, +which is the one where Coq commands are currently executed. +CoqIDE provides also a feedback system for the user. +Therefore the background is green when a command succeeds, otherwise an error message is displayed in the message window and the error location is underlined red. +CoqIDE offers only basic editing commands, therefore it is possible to launch another more sophisticated text editor. +Furthermore CoqIde provides a proof wizard “for automatically trying to solve the current goal using simple tactics.” +Another features of this IDE are the customisation options, which can be accessed by the Edit menu. +This allows the user to change the appearance of the IDE. + + +\begin{figure}[htbp] +\centering +%\includegraphics[bb=0 0 10 10]{coqide.png} +\includegraphics[scale=0.20]{fig/coqide} +\caption{CoqIDE main screen} +\end{figure} + + +%(http://coq.inria.fr/V8.1/refman/Reference-Manual016.html) +\subsubsection{Proof General for Isabelle} +Proof General is a generic front-end for proof assistants \cite{Aspinall:2007:FIP:1420412.1420429}, based on the text editor Emacs. +It has been developed at the University of Edinburgh with contributions from other sites. +Proof General supports the following proof assistants: Isabelle, Coq, PhoX, LEGO. +It is used to write proof scripts. A Proof Script is a sequence of commands sent to theorem prover. +The communication between the user and the theorem prover takes place via two or more Emacs text widgets. +Therefore the user sees only the output from the latest proof step. + + +Isabelle/Isar\footnote{http://proofgeneral.inf.ed.ac.uk/} Proof General has full support for multiple file scripting, with dependencies between theories communicated between Isabelle and Proof General. +There is full support for Unicode Tokens, using the Isabelle print mode for X Symbol tokens. Many Isabelle theories have X Symbol syntax already defined +and it's easy to add to your own theories. +%(http://proofgeneral.inf.ed.ac.uk/fileshow.php?file=releases%2FProofGeneral%2Fisar%2FREADME) +\begin{figure}[htbp] +\centering +\includegraphics[scale=0.30]{fig/pgisabelle} +\caption{Proof General for Isabelle}% +\end{figure} + +\subsubsection{Isabelle/Jedit} +jEdit is a text editor for programmers, written in Java. +Compared to fully-featured IDEs, such as Eclipse or NetBeans, jEdit is much +smaller and better focused on its primary task of text editing. +The general look of the Isabelle/jEdit plug-in is similar to existing Java IDEs \cite{makarius:isa-scala-jedit}. +The main Isabelle/jEdit plug-in consists of ten small Scala files that augment some key jEdit components in order to provide a metaphor of asynchronous proof document editing. +Isabelle/jEdit integrates the jEdit 4.3.2 framework and some further jEdit plug-ins. +It also implements custom-made 'IsabelleText Unicode' font that actually contains the usual Isabelle symbols that users expect from long +years of Proof General X-Symbol support. +The editor provides useful feedback, via semantic information from the processed document in the background. +A lot of information can be directly attached +to the source text, via colouring, tool-tips, pop-ups etc. + +\subsection{Upcoming requirements for userinterfaces in CTP}\label{gui-requir} +% @ interaction close to tty (Telegraph)\\ +% BUT: separate parts in {\em one} proof could be processed in parallel +% +% @ http://www.informatik.uni-bremen.de/uitp/ +% +% @ ... see\\ +% http://www4.in.tum.de/~wenzelm/papers/async-isabelle-scala.pdf,\\ +% http://www4.in.tum.de/~wenzelm/papers/parallel-isabelle.pdf +"After several decades, most proof assistants are still centred around TTY-based interaction in a +tight read-eval-print loop. +All Emacs-based GUI's for CTPs follow this synchronous +model based on single commands with immediate response, meaning that the editor waits for the +prover after each command", according to \cite{makarius:isa-scala-jedit}. As to multicore politics of leading semiconductor chip manufacturer, parallelism in software technology has become an issue. +Therefore the support of parallelism in CTP technology improves the performance and multiuser support. +%So it is necessary to use proof documents instead of proof scripts. +%Proof scripts are sequences of commands however proof documents are structured texts. +%So the proof document idea seems to guarantee the perfect support for parallelism in the CTP technology. +Proof language Isar is structured such, that different parts can be interpreted in parallel. For instance, some might employ an +an automated prover for some minutes, while the user wants to proceed with other parts of the same proof. +A well-established concept able to cope with such parallel processing in actors, as introduced by Erlang. +This will be discussed in more detail in Sect. \ref{actors} + + +%Andreas +\section{Isabelle's plans for new userinterfaces}\label{gui-plans} + +The following observations lead to novel requirements for CTPS' userinterface: + +\begin{itemize} +\item theorem proving will be integrated into software development +\item hundreds of proof obligations are generated during a software verification process +\item so the final goal of Isabelle's planning is integration with other software development tools in an integrated development environment (IDE) +\item still many principal issues need to be clarified with respect to integration of CTP and other development tools. So engaging into details makes no sense at the present, and Isabelle will approach the final goal via experimental intermediate steps of integration +\item favourite IDE is jEdit, because it is clearer than Eclipse or NetBeans. The reason behind this choice follows in section \ref{plugin} +\end{itemize} + +These indicate design decisions are sketched in the sequel. + +\subsection{Connect ML-world to the users' world via JVM}\label{ml-users} +In Sect.\ref{ctp-techn} reasons have been given, why mathematics software at the state-of-the-art cannot be written in Java or the like. On the other side, Sect.\ref{gui-requir} stated requirements for mathematical userinterfaces, which cannot be accomplished by ML-like languages. These requirements can be best accomplished by languages like Java, which have powerful libraries available for convenient assembly of GUIs. + +\paragraph{Example: a functional mathematics engine} as the experimental one in the \sisac-project is given by the following signature: +{\it +\begin{tabbing} +\=xx\=xxxxxxxxxxxxxxxxxxxxxxxxx\=\kill +\>signature INTERPRETER =\\ +\>sig\\ +\>\>type calcstate\\ +\>\>type step = formula * position * tactic\\ +\>\> \\ +\>\>val do\_next : program $\rightarrow$ calcstate $\rightarrow$ (calcstate * step)\\ +\>\>val apply\_tactic : program $\rightarrow$ calcstate $\rightarrow$ position $\rightarrow$ tactic $\rightarrow$ (calcstate * step list)\\ +\>\>val apply\_formula : program $\rightarrow$ calcstate $\rightarrow$ position $\rightarrow$ formula $\rightarrow$ (calcstate * step list)\\ +\>end +\end{tabbing}} +The three essential functions are \textit{do\_next}, which reads a \textit{program} for determining the next \textit{step} in a calculation, the function \textit{apply\_tactic}, which applies a \textit{tactic} input by the user to the current \textit{position} in a calculation and thus may produce a list of \textit{step}s and the function \textit{apply\_formula}, which applies an input \textit{formula} accordingly. + +Now, the point with functional programming is, that the functions do {\em not} cause persistent updates in some memory, rather: all three functions above take the current state of the calculation, \textit{calcstate}, as an argument and after they have done they work return the updated \textit{calcstate}. + +There are several advantages of this kind of programming: more straight forward verification, which is not discussed here, and other features. For instance, given the three functions above, it is easy to undo steps of calculations, or go back to an earlier step of calculations: one just needs to store the \textit{calcstate}s (in a list), even without knowing the details of the \textit{calcstate}, which thus can be encapsulated for internal access only. + +\paragraph{Example: an object-oriented wrapper} as required for embedding the above mathematics engine into an object-oriented system. Such a wrapper may look like this: +{\footnotesize +\begin{verbatim} + public class Calcstate + { + private Program program_; + private Tree calcstate_; + private Position position_; + + public Calcstate(Program program) {...} + public Step do_next() {...} + public List apply_tactic(Tactic tactic) {...} + public List apply_formular(Formular formular) {...} + } +\end{verbatim} +} +\subsection{Scala as a mediator between ML and JVM}\label{scala-medi} +Scala \footnote{http://www.scala-lang.org} is a hybrid programming language. It combines object-oriented programming and functional programming. Scala runs on the Java Virtual Machine and is byte-code compatible with existing Java programs. The compilation model of Scala is nearly the same as the Java's model. So existing tools, libraries and applications can be used with Scala. The syntax of Scala is similar to Java and ML. A number of keywords plus the block syntax is adopted from Java and from ML the syntax for type annotation and declaration. The source-code is typically reduced, concisely and more compact compared to equivalent Java code \footnote{http://www.scalasolutions.com/scala}. + +Scala is pure object-oriented, this means every value is an object \cite{odersky:scala06}. The same is true for primitive data types, because compiler-generated byte code is using primitive data types. Known design patterns from OOP can be used with Scala as well. "Data types and behaviours of objects are described by classes and traits" \footnote{http://en.wikipedia.org/wiki/Scala\_(programming\_language)}. Traits not only consist of definitions, they also can contain implementations of methods. To avoid the problems of multiple inheritance, classes are able to extend various traits, this is a flexible mixin-based mechanism. The keyword Object is used to implement a Singleton-Class. + +In Scala every function is a value, hence Scala is also a functional language \cite{odersky:scala06}. Functions in Scala are first-class objects, this means it is possible to pass a function as a parameter, return a function from a subroutine, or assign to a variable. Scala also supports case classes, which are used for pattern matching. Case classes are regular classes which export their constructor parameters \footnote{http://de.wikipedia.org/wiki/Scala\_(Programmiersprache)}. Furthermore Scala allows functions to be nested. + +Scala is more statically typed than Java, but is able to infer types by usage. So most static type declarations are optional. This static type system ensures a safe and coherent use of abstraction. Scala supports \footnote{http://en.wikipedia.org/wiki/Scala\_(programming\_language)}: + +\begin{itemize} +\item generic classes +\item variance annotations +\item upper and lower type bounds +\item classes and abstract types as object members +\item compound types +\item explicitly typed self references +\item views +\item polymorphic methods +\end{itemize} + +Static types need no explicit declaration but can be given to give the code some clarity. + +Scala supports threads, but the Scala library contains an actor model inspired from Erlang \cite{armstrong:erlang96}. Concurrency and Scala actors follow in the next section. + +\subsection{Support for parallel processing}\label{actors} +Concurrency has lately become more and more attention, because multicore processors make concurrency very important for efficient program execution, by running multiple threads parallel and so concurrent programming gets indispensable and distributed computing, web services and mobile environments are naturally concurrent. A very attractive model is message-based concurrency, which is based on the actor model. + +An actor is a concurrent process that executes a function. The state of an actor gets never shared, so it doesn't need to compete for locks of shared data. Actors own a mailbox where incoming messages are stored in. A mailbox is mainly a queue with actors, which operate as several producers and one consumer. Actors share data by sending messages which are sent asynchronously. Messages are unchangeable, so they don't require a lock. By creating new actors, by sending messages to known actors, or changing its behaviour, an actor is able to reply to a message. The actor-based process is combined with pattern matching for messages. + +The Erlang programming language is a functional programming language that supports message-based concurrency, which operates with actors. It was developed for real-time control systems. Such systems are telephone exchanges, network simulators and distributed resource controllers \cite{scala:jmlc06}. These systems use a very popular lightweight implementation and a large number of concurrent processes, which can be active simultaneously. + +Operating system threads and threads of virtual machines are too heavyweight for the implementation of such processes. The standard concurrency for mainstream platforms were shared-memory threads with locks. Such a platform is the Java Virtual Machine (JVM), which suffers from high memory consumption and context-switching overhead. +The most disadvantageous consequences are \cite{scala:jmlc06}: +\begin{enumerate} +\item quick exhaustion of virtual address space +\item locking mechanisms often lack suitable contention managers +\end{enumerate} + +For that reasons Erlang uses lightweight concurrent processes by its own run time system and not by the underlying operating system \cite{scala:jmlc06} and the computations on these platforms are often modelled in an event-driven style, which is complicated and error-prone. +\paragraph{Two different strategies for concurrency} are being used for implementation. This two strategies often follow different programming models, the benefit of thread-based models is that they are easier to use, but they still suffer from the memory consumption and the context-switching. The event-based models are just the opposite of the thread-based, they are more efficient, but in massive designs they are very difficult. + +\subparagraph{Thread-based implementation:} The behaviour of a concurrent process is defined by implementing a thread-specific method. The execution state is maintained by an associated thread stack \cite{Haller:2009:SAU:1496391.1496422}. +Supports blocking operations and can be executed on multicore processors in parallel. + +\subparagraph{Event-based implementation:} The behaviour is defined by a number of (non-nested) event-handlers which are called from inside an event loop. The execution state of a concurrent process is maintained by an associated record or object \cite{Haller:2009:SAU:1496391.1496422}. Targets to a large number of actor which can be active simultaneously, because they are more lightweight. + +\paragraph{Actors in Scala} are based on actors in Erlang. Scala uses the basic thread model of Erlang, but on the other hand all higher-level functions got implemented in the Scala library as classes or methods. The Scala-actors are a unification of the implementation models mentioned above and they are compatible with normal Virtual Machine (VM) thread. Normal VM threads can use the same communication and monitoring capabilities, because they are treated like an actor. A message-based concurrency seems to be more secure than shared-memory with locks, because accessing an actor's mailbox is race-free. The advantage of a implementation in a library is that it can be flexibly extended and adapted to new needs. The library makes use of Scala abstraction opportunities, like partial functions and pattern matching. + +The main idea of this model is that an actor is able to wait for a message by using two different operations, which try to remove a message from the current actor's mailbox. To do so, a partial function must be given to the operation, that specifies a set of message patterns. These are {\itshape receive} and {\itshape react}. 'An actor can suspend with a full thread stack (receive) or it can suspend with just a continuation closure (react)' \cite{Haller:2009:SAU:1496391.1496422}. The first operation of an actor to wait for an message is equal to thread-based programming and the second operation to event-based programming. + +\subparagraph{receive:} The current actor's mailbox get scanned and if there is one message which matches one of the patterns declared in the partial function, the message is removed from the mailbox and the partial function is applied to the message, the result is returned. The declaration of receive: +$$\mathit{def}\;\mathit{receive}\mathit{[R]}(f: \mathit{PartialFunction}[Any, R]): \mathit{R}$$ +Otherwise the current thread blocks. Thus the receiving actor has the ability to execute normally when receiving a message which matches. Note that receive retains the complete call stack of the receiving actor; the actor’s behaviour is therefore a sequential program which corresponds to thread-based programming \cite{Haller:2009:SAU:1496391.1496422}. +\subparagraph{react:} The action which is specified in the partial function is the last code that the current actor executes, if the message is matching. The declaration of react: +$$\mathit{def}\;\mathit{react}(f: \mathit{PartialFunction}[Any, Unit]): \mathit{Nothing}$$ +The partial function gets registered by the current actor and the underlying thread gets released. React has the return type Nothing, this means that the method never returns normally. When the actor receives a matching message, the earlier registered partial function gets called and the actor's execution gets continued. The partial function f which corresponds to a set of event handlers \cite{Haller:2009:SAU:1496391.1496422}. + +For this implementation multiple actors are executed by multiple threads and therefore a thread pool is used. Whenever it is necessary the pool can be re sized, to support the operations of the thread-based and event-based model. If only operations of the event-based model are executed then the thread pool could be fixed. To avoid system-included deadlocks, if some actors use thread-based operations, the thread pool has to grow, because if there are outstanding tasks and every worker thread is occupied by a blocked actor, new threads are necessary. + +Since the communication between actors takes place through asynchronous message passing, asynchronous operations get executed, tasks have to be created and submitted to a thread pool for execution. A new task is created, when an actor spawns a new actor or a message, which enables an actor to continue, is send to an actor which is suspended in a react operation or by calling react, where a message can be immediately removed from the mailbox \cite{Haller:2009:SAU:1496391.1496422}. + +% Marco +\section{Planned contributions at TU Graz} + +\subsection{Make Isabelle process structured derivations}\label{struct-der} +Structured Derivations (SD) is a format for calculational reasoning, which has been established by \cite{back-grundy-wright-98}. This is an example calculation: +{\it\begin{tabbing} +123\=123\=123\=123\=123\=123\=123\=123\=123\=123\=123\=123\=\kill +\> $\bullet$\> \Problem [ maximum\_by, calculus ]\\ +\>\> $\vdash$\> $A = 2\cdot u\cdot v - u^2$\\ +\>\> $\bullet$\> \Problem [make, diffable, funtion]\\ +\>\> \dots\> $\overline{A}(\alpha) = 8\cdot r^2\cdot\sin\alpha\cdot\cos\alpha - 4\cdot r^2\cdot(\sin\alpha)^2$\\ +\>\> $\bullet$\> \Problem [on\_interval, for\_maximum, differentiate, function]\\ +\>\>\> $\vdash$\> $\overline{A}(\alpha) = 8\cdot r^2\cdot\sin\alpha\cdot\cos\alpha - 4\cdot r^2\cdot(\sin\alpha)^2$\\ +\>\>\> $\bullet$\> \Problem [differentiate, funtion]\\ +\>\>\> \dots\> $\overline{A}^\prime(\alpha) = 8\cdot r^2\cdot(-(\sin\alpha)^2+(\cos\alpha)^2 - 2\cdot\sin\alpha\cdot\cos\alpha)$\\ +\>\>\> $\bullet$\> \Problem [on\_interval, goniometric, equation]\\ +\>\>\> \dots\> $\alpha = \tan^{-1}(-1+\sqrt{2})$\\ +\>\> \dots\> $\alpha = \tan^{-1}(-1+\sqrt{2})$\\ +\>\> $\bullet$\> \Problem [tool, find\_values]\\ +\>\> \dots\> [ $u=0.23\cdot r, \:v=0.76\cdot r$ ]\\ +\> \dots\> [ $u=0.23\cdot r, \:v=0.76\cdot r$ ] %TODO calculate ! +\end{tabbing}} +The plan is to use the machinery provided Isabelle/Isar as a 'logical operating system' ~\cite{isar-impl} and adapt the machinery such that is accepts SC in parallel to the Isar proof language~\cite{wenzel:isar}. + +This plan involves the following details. + +\subsection{Add a plug-in to jEdit}\label{plugin} + % file structure, copied from example project ... +%Die von jEdit verfolgte Strategie im Bezug auf plug-in Management und natürlich generell die totale Offenlegegung des Codes ist für ein Projekt wie Isabelle und auch für das Isac-Project an der TU ideal. plug-ins lassen sich sehr einfach anfügen und durch die riesige Vielfalt von bereits bestehenden plug-ins ist auch die Adaption von plug-ins möglich bzw. zu empfehlen, denn warum sollte nicht bereits funktionierender Code verwendet werden?\\ +The importance of connecting the ML-world with the world of user interfaces has been is discussed in Sect.\ref{ml-users}. jEdit follows these lines, it is an open-source, Java-based text editor that works on Windows, Mac OS X, and Linux. A big advantage of jEdit is, that there is a very good and also simple way to use and write a plug-in. There are a lot of useful and powerful plug-ins available in the net and it is also possible to use a existing plug-in as part of a new one. Because of this facts, jEdit is very suitable for a project like Isabelle and also for the \sisac-project at TU-Graz. + +Each jEdit plug-in\footnote{To get more information about the jEdit infrastructure see: http://jedit.org/users-guide/plugin-intro} basically consists of source files, written in Java or Scala, XML-files and property files. The XML-Files are important for the administration of a plug-in and provides information like the name, author, ... of the plug-in. They are also containing small pieces of BeanShell code which is executed upon a user request. (Like pressing the 'start plugin' button.) So the XML-files provide the “glue” between user input and specific plug-in routines located in the source files. As you see, this files are used as interface between the plug-in and the jEdit engine itself. + +Based on the jEdit API, you are allowed to design your code quit freely and don't have to use a prescribed way to implement your ideas. + + +%isabell plugin beschreiben!!!!!!!! +The Isabelle-team also follow use this plug-in structure. In the next paragraph the involved files will be described. The jEdit-Isabelle plug-in consists of: +\begin{itemize} +\item 14 Scala-source-files +\item 3 XML-files +\item 1 property file +\end{itemize} +%Das vom Isabelle-Team erstellte jEdit plug-in folgt natürlich auch dem oben erklärten Muster. Es wird nun genauer auf dieses plug-in eingegangen. The plugin consits of 14 scala-source-files, three xml-files and one property-file. +\begin{description} +\item[Isabelle.props] The property-file \textit{Isabelle.props} contains general information about the Isabelle plug-in and the needed dependencies between Isabelle and the other used plug-ins like sidekick. +\item[dockables.xml] The XML-file \textit{dockables.xml} is used to create the needed dock-able windows which are important to set up the GUI of the plug-in. +\item[actions.xml] In the file \textit{actions.xml}, the dockable windows are added to the window-manager \textit{wm} and there is also some BeanShell-code to activate the Isabelle-GUI. +\item[services.xml] The last XML-file is \textit{services.xml} and is used to create instances of needed jEdit plug-ins. +\end{description} +This four files are located in the folder \textit{plugin}.\\ + +The more interesting files, the scala-files of the plug-in, can be found in the 'src/jedit'-directory. In this directory you can find the file \textit{Dummy.java} which is a dummy class and is simply used to make javadoc work. Just forget about this file. Also there is a folder/package \textit{jedit} which contains all Scala-source-files. Now it is time to take a closer look on the source-files: +\begin{description} +\item[plugin.scala] The file \textit{plugin.scala} is the main-file of the Isabelle plug-in and there are two important parts. First the \textit{Isabelle object}. This object contains data like name and path and also few basic functions. The second part is the \textit{class Plugin} which is derived from EBPlugin. Here the basic methods \textit{handleMessage}, \textit{start} and \textit{stop} are implemented. Each jEdit plug-in should have this methods because they are very important for the handling of the plug-in! +\item[dockable.scala] jEdit and also the Isabelle plug-in work with dock-able windows. This means that you can move around each single window and dock it somewhere on the screen. So it is possible to customise the jEdit-GUI. To support this, the file \textit{dockable.scala} is needed. The file \textit{output-dockable.scala} is derived from \textit{dockable.scala} and is used to print the result/output in a dock-able window. The same thing with \textit{protocol-dockable.scala} and \textit{raw-output-dockable.scala}. +\item[scala-console.scala] The next interesting file is \textit{scala-console.scala} with the main-class Scala-Console. This class is used to expand the Console plug-in in a way, that it is possible to interpret Scala-code with a Shell inside of jEdit. +\item[isabelle-sidekick.scala] The file \textit{isabelle-sidekick.scala} is related to the file \textit{scala-console.scala} because it is also used to adapt the plug-in Sidekick for Isabelle. +\item[document-model.scala, document-view.scala] The files \textit{document-model.scala} and \textit{document-view.scala} are used to connect the jEdit-buffer/the text-area to Isabelle. Both classes offer, upon others, methods to activate and deactivate this features. +\end{description} +There also some other source-files but they aren’t discussed here, because the main goal of this paragraph is to give a basic idea how a jEdit plug-in should be set up and the remaining files are not as important for the Isabelle plug-in structure. +%\begin{itemize} +%\item $html_panel.scala$ +%\item $isabelle_encoding.scala$ +%\item $isabelle_hyperlinks.scala$ +%\item $isabelle_options.scala$ +%\item $isabelle_token_maker.scala$ +%\item $isabelle_hyperlinks.scala$ +%\end{itemize} + + +% Like each other jEdit-Plugin also this + +%Das Konzept des frei wählbaren Designs ist am Beginn villeicht etwas schwierig umzusetzten, da es leichter ist, sich irgendwo anzulehnen bzw. ein bereits bestehendes sowie funktionierendes Konzept zu übernehmen. So wurden auch die ersten Schritte an der TU gemacht. Zu diesem Zweck wurde das von den Entwicklern von jEdit zur Verfügung gestellte plugin 'QuickNotepad' übernommen und in Scala übersetzt. Obwohl Scala eng mit Java verknüpft ist, war doch einiges an 'rewritting' notwendig bis das Scala-plugin lauffähig wurde. Die benötigten XML-files konnten dazu nahezu unberührt gelassen werden.\\ + +\subsection{Details of NetBeans projects}\label{netbeans} +% Scala + Java: html project files +As described in the last paragraph, jEdit is a open-source-project. The jEdit-developers use a NetBeans-project to produce the source-code and so it is beneficial to use a NetBeans project too, because there is a quite good documentation about setting up a NetBeans-project with the jEdit-source. See http://wiki.netbeans.org/NetbeansedJEdit for further information.\\\\ +If you want to set up a new jEdit plug-in project you have to attend that you have to create some source-files and that there must be a connection to the jEdit-source because you will need to exchange data with the jEdit engine. This could probably look like: \textit{jEdit.getProperty("options.isabelle.isabelle")}\\ +As shown above, the jEdit-source is needed to compile and build your plug-in. There are two ways to organise your project: +\begin{itemize} +\item with jEdit source code - two projects in one +\item with jedit.jar library +\end{itemize} +\subsubsection{Plug-in with jEdit-source} +It is a good way to download the jEdit source as NetBeans project because then it is possible to add another sub-project to the existing jEdit-NetBeans-project. As you see it is also possible to mix Scala and Java. A big advantage is, that debugging will now work really fine. If you want to set up a project like this, you should complete the following steps. +\begin{enumerate} +\item {Create a new NetBeans-project for your plug-in like \textit{example-plugin}. This will probably be a Scala-Project.} +\item Download (and try out) the \textit{jEdit-NetBeans-project} +\item at project \textit{example-plugin}: \textit{Project-browser} $\rightarrow$ Right-click at \textit{Libraries} $\rightarrow$ \textit{add Project...} and then choose the \textit{jEdit-NetBeans-project}. +\item at project \textit{example-plugin}: \textit{Project-browser} $\rightarrow$ Right-click at project-name-label $\rightarrow$ \textit{Properties} $\rightarrow$ \textit{Run} $\rightarrow$ \textit{Main Class:} org.gjt.sp.jedit.jEdit +\item compile and run +\end{enumerate} + +\subsubsection{Plug-in with jedit.jar} +It is also possible to use the \textit{jedit.jar} file. This file is already included in \$ISABELLE-HOME/contrib/jedit-4.3.2. Now you just have to follow this steps: +\begin{enumerate} +\item {Create a new NetBeans-project for your plug-in like \textit{example-plugin}. This will probably be a Scala-Project.} +\item at project \textit{example-plugin}: \textit{Project-browser} $\rightarrow$ Right-click at \textit{Libraries} $\rightarrow$ \textit{add JAR/Folder...} and then choose the \textit{jedit.jar} file. +\item at project \textit{example-plugin}: \textit{Project-browser} $\rightarrow$ Right-click at project-name-label $\rightarrow$ \textit{Properties} $\rightarrow$ \textit{Run} $\rightarrow$ \textit{Main Class:} org.gjt.sp.jedit.jEdit +\item compile and run +\end{enumerate} +This are two different ways to get started. It is difficult to say what is better because both versions have advantages. Now it is time to start coding your own plug-in but there are still a few things to think about. Remember, that a plug-in consists of source-, XML- and property-files. On default, NetBeans will just pack the source-files in the \textit{example-plugin.jar}-package. So you have to add a copy/move-routine in the \textit{build.xml} file of your NetBeans-project to get a complemented package. +\begin{itemize} +\item $\langle target name="-pre-jar"\rangle$ +\item $ \langle copy $file="plugin/services.xml" todir="\${build.classes.dir}" $/\rangle$ +\item $ \langle copy $file="plugin/dockables.xml" todir="\${build.classes.dir}" $/\rangle$ +\item $ \langle copy $file="plugin/actions.xml" todir="\${build.classes.dir}" $/\rangle$ +\item $ \langle copy $file="plugin/Isabelle.props" todir="\${build.classes.dir}" $/\rangle$ +\item $ \langle /target\rangle$ +\end{itemize} +%* kurze aufzählung der xml-netbeans-files + erklärung\\ +\subsubsection{NetBeans project files} +As you see in the paragraph above, it is also important to have basic knowledge about NetBeans, the project structure and how to change the operational sequences. A typical NetBeans-project consist of the source- and library-files and administrative XML- and property-files. In this paragraph the administrative part of the project is of note. The most important file is \textit{build.xml}. This file can be found in the project directory. There is also a folder \textit{nbproject} which contains the remaining XML- and property-files and also a folder \textit{private}, where individual user information about the project is stored. The files in this \textit{private} folder are not important to describe (and they should not be pushed on the repository!). + +A build-file like \textit{build.xml} contains one project and at least one (default) target. Targets contain task elements. Each task element of the build-file can have an id attribute and can later be referred to by the value supplied to this. So the id has to be unique. Such targets can be "run", "debug", "build", ... and can have dependencies to other targets. Tasks define what should happen, if a target is executed. So like in the example above, the target is \textit{pre-jar}, that means that this things will happen before the jar-package is packed. The tasks of this target are copying some files into the package. + +The files inside the \textit{nbproject}-folder are not so important because some of it are generated from \textit{build.xml} and changes in this files are useless. Just the file project.properties is really interesting because this file gives a nice and tight overview about the project settings. + +\subsection{Use interfaces between Java and Scala}\label{java-scala} +% how are data exchanged between Scala and Java ... +jEdit is completely written in Java and the required plugin(s) for \sisac{ }will be coded in Scala - so there must be ways to exchange data between Java and Scala. One way is to connect this two worlds with the in 4.2 described XML-files. Here you need to use a third type of code to get an interface between Java and Scala code. But there is also a way to get a direct connection. + +This link should be shown on the graphic-library \textit{Swing}. In both languages it is possible to use Swing which provides a lot of different shapes and useful functionality. So there is a Java-Swing and also a Scala-Swing-library. Now it is interesting to examine the connection between this two libraries. + +In Scala a direct use of Java-Libs (like Java-Swing) is possible. So if you are Java-Programmer and want to use Java-Swing in Scala, you can simply type\\ \textit{import javax.swing.JButton}\footnote{http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/JButton.html} to work with a Java-button. But you can also use the Scala-equivalent \textit{scala.swing.Button}\footnote{http://www.scala-lang.org/api/current/scala/swing/Button.html}. This two button-types will provide nearly the same functionality. + +So what is the idea of creating a nearly similar library a second time? Why have the Scala-developers done such extra work? The answer is, that they have tried to improve and simplify the usage of the Swing-library(and many other libs too!). So big parts of this Scala-Libraries are just Wrapper-objects, Wrapper-Classes and Wrapper-Methods of already existing parts in Java-Libraries. Needless to say that they also added new useful shapes and functionality. +But there is one important question left: Is it possible to mix Scala- and Java-objects? And yes, it is possible. There is a really easy way to convert a Scala-object to the Java-equivalent: +\begin{enumerate} +\item \textit{import javax.swing.JButton} +\item \textit{import scala.swing.Button} +\item \textit{var b: scala.swing.Button} +\item \textit{var jb: javax.swing.JButton} +\item \textit{jb = b.peer} +\end{enumerate} +As the example above illustrates, a conversion of Scala- to Java-objects is possible. It looks easy but also a little bit useless. Why should you need this? Just imagine that there is a plug-in written in Scala and one coded in Java. With this connection between Scala and Java, it would be easy to connect this two plug-ins! +%Diesen direkten Zusammenhang zwischen Java und Scala soll anhand der Grafik-Bibliotheken Swing. Beide Sprachen stellen diese Grafik-Bibliotheken zur Verfügung (und darin auch eigene Shapes und Funktionalität). Es ist jedoch möglich, Java-Bibliotheken, wie eben auch Java-Swing in Scala zu verwenden. Ein JButton kann zum Beispiel mittels \textit{import javax.swing.JButton} eingebunden und damit sofort auch verwendet werden. Auch Scala stellt in seiner Swing-Bibliothek zur Verfügung: \textit{scala.swing.Button}. Es wird nahezu die selbe Funktionalität angeboten und teilweise die Erzeugung bzw. Verwendung vereinfacht(???). Man kann sich nun fragen, warum sich die Scala-Entwickler einerseit die Mühe gemacht haben die Verwendung Java-Swing, wie in Java selbst, möglich zu machen und andererseits mit Scala-Swing eine nahezu idente Alternative geschaffen haben. Die Antwort darauf zeigt wie der objektorientierte Teil von Scala in vielen Bereichen aufgebaut wurden. Es wurde kein neues Konzept für diese Grafikklassen entworfen sondern Wrapper-Objekte/Methoden/Klassen erstellt, die das Arbeiten mit diesen Grafikkomponenten erleichtern soll. Ein Letztes Problem bleibt noch: Es ist zwar sehr einfach ein Java-Swing-Objekt an einen Scala-Swing-Container (zb. Frame) anzubinden, da eine Konvertierung von Java-Komponente in ein Scala-Äquivalent ist problemlos möglich. ... +\section{Conclusion and future work} +This paper collected background information on the topic of userinterfaces for theorem provers, which is not covered by the standard curriculum at Graz University of Technology: Computer theorem proving, respective interfaces and novel challenges for userinterfaces raised by integration of CTP into software engineering tools within the current decade. + +The general background information has been related to students' knowledge already gained during studies: functional and object-oriented programming paradigm, programming languages with focus on Scala and Scala's specific concept to handle asynchronous processing of proof documents, the concept of actors. + +An important part of the paper is a protocol of preparatory work already done on project-setup and software components required for the next goal which is: extend the theorem prover Isabelle with Structured Derivations. + +This part is considered an appropriate to start realising this goal and to prepare for future work, which will join the \sisac-project with front-of-the-wave technology in computer theorem proving and respective userinterfaces. + +\bigskip\noindent {\Large\textbf{Acknowledgements}} + +\medskip\noindent The authors thank the lecturer of 'Verfassen wissenschaftlicher Arbeiten' in winter semester 2010/11, Dipl.-Ing. Dr.techn. Markus Strohmaier, for his support on working on the topic they are interested in.\\ +The leader of the \sisac-project expresses his pleasure about the efficient collaboration between the institutes IICM and IST at TUG. + +\bibliography{CTP-userinterfaces} +%\bibliography{bib/math-eng,bib/bk,bib/RISC_2,bib/isac,bib/pl,bib/math,bib/pl} +\end{document} \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/akargl/ferialprakt.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/akargl/ferialprakt.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,101 @@ +\message{ !name(ferialprakt.tex)}\documentclass[a4paper,12pt]{article} +\usepackage{ngerman} +\usepackage{longtable} + + +\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} +\def\sisac{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} + +\title{Ferialpraxis\\ am Institut f\"ur Softwaretechnologie\\ + der Technischen Universit\"at Graz\\ \ + \\Arbeitsprotokoll} +\author{Alexander Kargl\\ + akargl@brgkepler.net} +\date{\today} + +\begin{document} + +\message{ !name(ferialprakt.tex) !offset(-3) } + +\maketitle +$\;$\\ +\vspace{0.2cm} +\section{Urspr\"ungliche Erwartungen} +In den letzten Sommerferien vor der Maturaklasse wollte ich mich genauer \"uber die Studienrichtungen im Bereich Informatik an der TU Graz informieren. Meine Interessen tendierten bereits in diese Richtung, aber ich war mir noch nicht sicher, ob das die richtige Entscheidung ist. + +Ich hatte das Gl\"uck ein Praktikum am Insitut f\"ur Softwaretechnologie absolvieren zu d\"urfen. Ich hoffte dadurch: +\begin{itemize} + \item einen Einblick in die Programmierung und Entstehung von gr\"o\3eren Softwareprojekten zu erhalten + \item neue Programmiertechniken und Sprachen kennenzulernen + \item und au\3erdem gleich wertvolle Erfahrung im Arbeitsleben sammeln zu k\"onnen +\end{itemize} + +\newpage +\section{Arbeitsprotokoll} +\begin{center} +\begin{tabular}{l|l||r} +\textbf{Datum} &\textbf{T\"atigkeit} & \textbf{Std.} \\[1pt] \hline \hline\noalign{\smallskip} +12.7.2011 + & Demonstration von ``educational math assistant \isac{}'', Isabelle & 1.6\\ + %& Demonstration des Theorem Provers & 0.6\\ + & Einf\"uhrung Linux, objektorientierte/funktionale Programmierung& 2.0\\ + & Installation: Isabelle, \isac-core, Mercurial & 3.0\\[3pt] \hline\noalign{\smallskip} +13.7.2011 + & Einf\"uhrung Latex, Konfiguration von Mercurial & 2.6 \\ + %& & 1.6 \\ + & ML-Programmierung/Einf\"uhrung & 5.0 \\[3pt] \hline\noalign{\smallskip} +14.7.2011 + & Einf\"uhrung und \"Ubung ML II & 4.6 \\ +% & Programmierung ML & 2.0 \\ + & Erstellung v. Beispielen f\"ur Kombinatoren in ML & 3.0 \\[3pt] \hline\noalign{\smallskip} +15.7.2011 + & Einf\"uhrung ML/\isac\ IV & 2.1 \\ + & ML- Programmierung & 5.5 \\ \hline \hline\noalign{\smallskip} +18.7.2011 + & Fehlersuche/Debugging Isac-Tests & 7.6 \\[3pt] \hline\noalign{\smallskip} +19.7.2011 + & Tests zu korrigiertem CompleteCalc auskommentiert & 7.6 \\ + & interface.sml calchead.sml ctree.sml mathengine.sml rewtools.sml & \\[3pt] \hline\noalign{\smallskip} +20.7.2011 + & Fehlersuche/Debugging Isac-Tests & 7.6 \\[3pt] \hline\noalign{\smallskip} +21.7.2011 + & Alle Fehler in Frontend/interface.sml behoben & 7.6 \\ + & Beginn zugeh\"orige Tests auskommentieren & 7.6 \\[3pt] \hline\noalign{\smallskip} +22.7.2011 + & Information \"uber Studienrichtungen etc. & 1.1 \\ + & Fehlersuche/Debugging Isac-Tests & 6.5 \\[3pt] \hline \hline\noalign{\smallskip} +25.7.2011 + & Fehlersuche/Debugging Isac-Tests & 7.6 \\[3pt] \hline\noalign{\smallskip} +26.7.2011 + & Beginn: systematisches Aufr\"aumen von auskommentierten Tests & 7.6 \\ + & Interpret/appl.sml Interpret/ctree.sml ProgLang/calculate.sml & \\[3pt] \hline\noalign{\smallskip} +27.7.2011 + & Fehlersuche/Debugging Isac-Tests & 7.6 \\[3pt] \hline\noalign{\smallskip} +28.7.2011 + & Fehlersuche/Debugging Isac-Tests & 3.6 \\ + & Fertigstellung Protokoll & 4.0 \\[3pt] \hline\noalign{\smallskip} +29.7.2011 + & Austausch mit Ferialpraktikanten anderer Studienrichtungen & 1.0 \\ + & Arbeit mit Robotern & 5.0 \\[3pt] \hline\noalign{\smallskip} +\end{tabular} +\end{center} +Die Arbeiten am Update der Tests sind in das Repository des \isac-Projektes hochgeladen worden und sind auf {\tt https://intra.ist.tugraz.at/hg/isa/} einzusehen. + + +\newpage +\section{R\"uckblick auf das Praktikum} +Meine Erwartungen haben sich gr\"o\3tenteils alle erf\"ullt und ich habe viel Neues dazugelernt: +\begin{itemize} + \item Grundlagen funktionaler Programmierung (SML) + \item Zusammenarbeit an einem gro\3sem Softwareprojekt mit mehreren Programmierern (Benutzung von Versionsverwaltungssystemen (Mercurial) , Kommentaren etc.) + \item Grundz\"uge der Funktionsweise eines Theorem Provers (Isabelle) + \item ``Test driven development'' - Verifizierung von Softwarekomponenten + \item schnelle Einarbeitung in neue komplexe Arbeitsumgebungen und Problemstellungen +\end{itemize} +Alles in allem hat sich dieses Praktikum f\"ur mich in jeder Hinsicht gelohnt. + + + +\end{document} + +\message{ !name(ferialprakt.tex) !offset(-78) } diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/chuber/Functions.thy --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/chuber/Functions.thy Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,27 @@ +theory Functions imports Main begin + +fun fib :: "nat \ nat" +where +"fib 0 = 1" +| "fib (Suc 0) = 1" +| "fib (Suc (Suc n)) = fib n + fib (Suc n)" + +thm fib.simps + +(*"fib (Suc (Suc n))"*) + +lemma "fib 0 = 1" +by simp +lemma "fib (Suc 0) = 1" +by simp +lemma "fib (Suc (Suc (Suc 0))) = (Suc (Suc (Suc 0)))" +by simp + +(*fun sep :: "’a \ ’a list \ ’a list" +where +"sep a (x#y#xs) = x # a # sep a (y # xs)" +| "sep a xs += xs"*) + + +end diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/chuber/bakk_thesis_prelim.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/chuber/bakk_thesis_prelim.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,102 @@ +\documentclass[12pt]{article} +\usepackage{a4} +\usepackage{times} +\usepackage{latexsym} +\bibliographystyle{alpha} +%\bibliographystyle{abbrv} +\usepackage{graphicx} + +\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} +\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} + +\title{Tentative Title:\\ + Theory of Functional Programming\\ + Introduced by Isabelle and \isac} +\author{n.n\\ +{\tt TODO@xxx.at}} + +\begin{document} +\maketitle +%\abstract{ +%TODO +%} + +\section{Background} + +``Functional programing'' (FP) is one of the leading paradigms in programming besides ``object oriented programming'' %\cite{?} +and ``logic (or constraint) programming'' \cite{?}. One advantage of FP are general and elegant approaches to the mathematical theory of programming \cite{?}. + +Presently FP gains importance in face of the ``multi-core crisis'' \cite{?}: functional programs are ready to exploit many cores in parallel. In spite of this fact, at Graz University of Technology (TUG) FP has vanished during recent years, and it is of actual importance to include FP again in education. + +In order to support such education this thesis will compile a course based on advanced tools developed in the intersection between computer science and mathematics: The computer theorem prover Isabelle \cite{Nipkow-Paulson-Wenzel:2002} and the educational math assistant \sisac. + +\section{Goal} + +The goal of this thesis is generation of interactive course material on FP and respective theory of programming, implemented in Isabelle and \sisac. + +The material shall use most recent developments, for instance the ``function package'' \cite{krauss:funs,krauss:termination07,krauss:partial06} recently implemented in Isabelle. This package supports all what is needed for programming and proving properties of programs. + +Although addressing most recent developments and theory at the state of the art, the material also shall serve in early phases of programming. Experience shows, that in early phases (in analogy to doing mathematics \cite{?}) proceeding step by step in a program is important for learning. This will be done by implementing selected programs into \sisac. + +The interactive course material shall serve in certain courses at TUG and in the recently established ``entry and orientation phase'' (Studien-Eingangs und -Orientierungs Phase, STEOP). + +\section{State of the Art} +The thesis cover a wide range of topics some of which will be presented in more detail to be agreed on. + +\paragraph{Theory of functional programming ?} +TODO + +\paragraph{Proof tools for FP} +Isabelle's function package \cite{krauss:funs} is the most advanced in comparison to other provers. It supports two different way of function definitions, one providing full automation (applicable in simple cases) and another featuring interactive proofs of termination. + +The function package covers the full range of FP: mutual, nested and higher-order recursion, partiality + +The other European computer theorem prover, Coq \cite{}, has less powerful support for FP (TODO) + +\paragraph{Didactics of FP} is concern of very different opinions: At some universities FP is addressed in introductory courses, while at other universities FP is considered an abstract topic addressed in higher semesters. The choice between these extreme alternatives seems to be related to principcal considerations on software construction \cite{aichernig:ingenieur}. + +The planned course might provide a bridge between the alternatives, addressing novices as well as advanced students by employing computer theorem provers. + +\paragraph{Educational math assistants,} if based on computer theorem proving, are appropriate to serve introduction to FP in a specific way: If considering evaluation of functional programs as rewriting, there is an obstacle. Empirical data show that students do not learn to apply rules at high-school --- for instance, the cannot apply the law of distributivity in algebra consciously, they do algebra in the same way they they use their mother language. + +The experimental system \sisac{}\footnote{http://www.ist.tugraz.at/projects/isac/} developed at TU Graz seems appropriate to provide experience in rigorous application of rewrite rules as a prerequisite to understand evaluation in FP. + + +\section{Thesis Structure} + +The main result of this thesis is the interactive course material, accompanied by a thesis. + +\paragraph{The interactive course material} will be implemented as Isabelle theories. Isabelle provides a document preparation system for theories which shall lead for a twofold presentation of the course: as (a) pdf-file(s) and as theories supporting interactive learning. + +For stepwise exercises in \sisac{} an additional Isabelle theory is required, which contains the specifications and programs for the respective exercises in ML-sections. + +\paragraph{The thesis} completes the work as required for a bakkalaureate. + +%general survey on FP +% +%description of the state of the art in proof tools specialized on FP +% +%didactic consideration about the course (what has been omitted, ...) +% +%future work, probably extending the course to more advanced topics +% +%future work, extending the course to more elementary topics, probably usable at high school +% +%... +% +%... + + +\section{Timeline} + +The main work shall be done during this summer as much as possible. + +%Milestones +%\subsection{TODO} +%study introductory material for Isabelle; contact Alexander Kraus and others for similar course material +% +%\subsection{TODO} +%\sisac =''= + +\bibliography{references} +\end{document} diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/chuber/references.bib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/chuber/references.bib Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,55 @@ + +@InCollection{krauss:partial06, + author = {Alexander Krauss}, + title = {Partial recursive functions in higher-order logic}, + booktitle = {Automated Reasoning (IJCAR 2006)}, + pages = {589-603}, + publisher = {Springer Verlag}, + year = {2006}, + editor = {Ulrich Furbach and Natarajan Shankar}, + volume = {4130}, + series = {Lecture Notes in Artificial Intelligence}, + doi = {http://dx.doi.org/10.1007/11814771_48} +} + +@InCollection{krauss:termination07, + author = {Lukas Bulwahn, Alexander Krauss, and Tobias Nipkow}, + title = {Finding lexicographic orders for termination proofs in Isabelle/HOL}, + booktitle = {Theorem Proving in Higher Order Logics (TPHOLs 2007)}, + pages = {38-53}, + publisher = {Springer Verlag}, + year = {2007}, + editor = {Schneider and J. Brandt}, + volume = {4732}, + series = {Lecture Notes in Computer Science}, + doi = {http://dx.doi.org/10.1007/978-3-540-74591-4_5} +} + +@Article{aichernig:ingenieur, + author = {Bernhard K. Aichernig and Peter Lucas}, + title = {Softwareentwicklung --- eine {I}ngenieursdisziplin!(?)}, + journal = {Telematik, Zeitschrift des Telematik-Ingenieur-Verbandes (TIV)}, + year = {1998}, + volume = {4}, + number = {2}, + pages = {2-8}, + note = {http://www.ist.tu-graz.ac.at/publications}, + annote = {} +} + +@Book{Nipkow-Paulson-Wenzel:2002, + author = {Tobias Nipkow and Lawrence C. Paulson and Markus Wenzel}, + title = {{Isabelle/HOL} --- A Proof Assistant for Higher-Order Logic}, + publisher = {Springer}, + series = {LNCS}, + volume = 2283, + year = 2002 +} +@PhdThesis{krauss:funs, + author = {Alexander Krauss}, + title = {Automating Recursive Definitions and Termination Proofs in Higher-Order Logic}, + school = {Technische Universit\"at M\"unchen}, + year = {2009}, + OPTnote = {http://www4.in.tum.de/~krauss/diss/} +} + diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/dmeindl/Hauptdatei.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/dmeindl/Hauptdatei.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,168 @@ +\documentclass[12pt,a4paper]{article} +\usepackage{a4} +\usepackage[naustrian]{babel} +\usepackage[latin1]{inputenc} +\usepackage{calc} +\usepackage{amsmath} +\usepackage{epsfig} +\usepackage{graphicx} +\usepackage{xcolor} +\usepackage{amsfonts} + + +% Seitenrder einstellen und Hhe der Seitenzahlen +\usepackage{geometry} +\geometry{a4paper, left=2.5cm, right=2cm, top=3cm, bottom=2.8cm} +\setlength{\footskip}{2cm} + + +\newcommand{\R}{\mathbb R} +%\newcommand{\N}{\mathbb N} +%\newcommand{\Q}{\mathbb Q} +%\newcommand{\C}{\mathbb C} + +%Zhler definieren und Starwert setzen: +\newcounter{ctr} +\setcounter{ctr}{0} + +\newcounter{Teubner} +\newcounter{Klingenberg} +\newcounter{T} +\newcounter{Vo} +\newcounter{Se} +\newcounter{E} +\newcounter{Bwl} +\newcounter{Int} +\newcounter{Prim} +\newcounter{Z} +\setcounter{Z}{0} +\setcounter{Teubner}{1} +\setcounter{Klingenberg}{2} +\setcounter{T}{1} +\setcounter{Vo}{7} +\setcounter{Se}{2} +\setcounter{E}{3} +\setcounter{Bwl}{4} +\setcounter{Int}{5} +\setcounter{Prim}{6} + +%BSP +\newenvironment{myBsp}{ + \begin{list}{\textbf{\textsc{Bsp:}}}{ + \setlength{\labelwidth}{8Pc} + \setlength{\labelsep}{0.5Pc} + \setlength{\rightmargin}{0Pc} + \setlength{\leftmargin}{2Pc} + \setlength{\parsep}{0ex plus 0.5ex} + \setlength{\listparindent}{1em} + \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex} + \setlength{\topsep}{0.5Pc} + }} + {\end{list} +} + + +%Lemma +\newenvironment{myLemma}{ + \begin{list}{\textsc{\textbf{Lemma:\ \ \ }}}{ + \setlength{\labelsep}{-0.5Pc} + \setlength{\leftmargin}{1Pc} + \setlength{\parsep}{0ex plus 0.5ex} + \setlength{\listparindent}{1em} + \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex} + \setlength{\topsep}{0.5Pc} + }} + {\end{list} +} +%Korollar +\newenvironment{myKorollar}{ + \begin{list}{\textsc{\textbf{Korollar: }}}{ + \setlength{\labelwidth}{8Pc} + \setlength{\labelsep}{0.5Pc} + \setlength{\rightmargin}{0Pc} + \setlength{\leftmargin}{4Pc} + \setlength{\parsep}{0ex plus 0.5ex} + \setlength{\listparindent}{1em} + \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex} + \setlength{\topsep}{0.5Pc} + }} + {\end{list} +} + +%Theorem +\newenvironment{myTheorem}{ + \begin{list}{\textsc{\textbf{Theorem: }}}{ + \setlength{\labelwidth}{8Pc} + \setlength{\labelsep}{0.5Pc} + \setlength{\rightmargin}{0Pc} + \setlength{\leftmargin}{5Pc} + \setlength{\parsep}{0ex plus 0.5ex} + \setlength{\listparindent}{1em} + \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex} + \setlength{\topsep}{0.5Pc} + }} + {\end{list} +} + + +%Proportion +\newenvironment{myProp}{ + \begin{list}{\textsc{\textbf{Proportion: }}}{ + \setlength{\labelwidth}{8Pc} + \setlength{\labelsep}{0.5Pc} + \setlength{\rightmargin}{0Pc} + \setlength{\leftmargin}{4Pc} + \setlength{\parsep}{0ex plus 0.5ex} + \setlength{\listparindent}{1em} + \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex} + \setlength{\topsep}{0.5Pc} + }} + {\end{list} +} + +%Farben + +\newcommand{\red}[1]{\textcolor[rgb]{0.7,0,0}{\bf #1}} +\newcommand{\rd}[1]{\color{red}{#1}} +\newcommand{\white}[1]{\textcolor[rgb]{1,0,0}{\bf #1}} +\newcommand{\w}[1]{\color{white}{#1}} +\newcommand{\g}[1]{\color{myColor}{#1}} + +\usepackage{color} +\definecolor{myColor}{rgb}{0.9,0.9,0.9}% Wir definieren im RGB-Farbraum + + +\newcommand{\myDef}[1]{\parbox{\columnwidth}{\addtocounter{ctr}{1}{\w .}\\[-0.2cm]\textbf{Definition\ \Nummer:}\\#1}} +\newcommand{\mySatz}[2]{\colorbox{myColor}{\parbox{\columnwidth}{\addtocounter{ctr}{1}{\g .}\\[-0.2cm]\textbf{Satz\ \Nummer:}\ #1\\ #2}}} +\newcommand{\myBeweis}[1]{\textit{\textbf{Beweis:}\\ #1}} +\newcommand{\myAlg}[2]{\parbox{\columnwidth}{\addtocounter{ctr}{1}\textbf{Algorithmus\ \Nummer:}\ \ #1\\#2}} +\newcommand{\myProg}[1]{\fbox{\parbox{\columnwidth}{#1}}} + +\newcommand{\add}[1]{\addtocounter{#1}{1}} +\newcommand{\zahl}[1]{\setcounter{#1}{Z}} +\newcommand{\Q}[2]{\parbox{\columnwidth}{$^{[\arabic{#1}/#2]}$ }} + +\newcommand{\Nummer}{\thesection.\arabic{ctr}} + +%------------------------------------------------------------- Beginn ----------------------------------------------------------------------- + +\title{Greates common divisor \\ for multivariable Polynomials} +\author{By\\Diana Meindl\\meindl$_-$diana@yahoo.com} +\date{} + +\begin{document} +\maketitle +{\w .}\\[12cm] +\begin{center} +Presented to \\ +A.Univ.Prof. Dipl.-Ing. Dr. Wolfgang Schreiner (RISC Insitute)\\ +and\\ +Dr. techn. Walther Neuper (Institut fr Softwaretechnologie, TU Graz) +\end{center} +\newpage +%\tableofcontents +\newpage +\input{proposal} +\newpage + +\end{document} \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/dmeindl/proposal.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/dmeindl/proposal.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,504 @@ +%WN mit diesen 3 Zeichen beginnen meine Kommentare +%WN111107: bitte spellchecker dr"uberlaufen lassen !!! + +\documentclass[12pt,a4paper]{article} +\bibliographystyle{alpha} +\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} +\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} +%\usepackage{a4} +%\usepackage[naustrian]{babel} +%\usepackage[latin1]{inputenc} +%\usepackage{calc} +%\usepackage{amsmath} +%\usepackage{epsfig} +%\usepackage{graphicx} +%\usepackage{xcolor} +%\usepackage{amsfonts} +% +%WN BITTE DIESE DEFINITIONEN WEGLASSEN ... +%% Seitenrder einstellen und Hhe der Seitenzahlen +%\usepackage{geometry} +%\geometry{a4paper, left=2.5cm, right=2cm, top=3cm, bottom=2.8cm} +%\setlength{\footskip}{2cm} +% +% +%%Zhler definieren und Starwert setzen: +%\newcommand{\R}{\mathbb R} +%%\newcommand{\N}{\mathbb N} +%%\newcommand{\Q}{\mathbb Q} +%%\newcommand{\C}{\mathbb C} +% +% +%\newcounter{ctr} +%\setcounter{ctr}{0} +% +%\newcounter{Teubner} +%\newcounter{Klingenberg} +%\newcounter{T} +%\newcounter{Vo} +%\newcounter{Se} +%\newcounter{E} +%\newcounter{Bwl} +%\newcounter{Int} +%\newcounter{Prim} +%\newcounter{Z} +%\setcounter{Z}{0} +%\setcounter{Teubner}{1} +%\setcounter{Klingenberg}{2} +%\setcounter{T}{1} +%\setcounter{Vo}{7} +%\setcounter{Se}{2} +%\setcounter{E}{3} +%\setcounter{Bwl}{4} +%\setcounter{Int}{5} +%\setcounter{Prim}{6} +%%BSP +%\newenvironment{myBsp}{ +% \begin{list}{\textbf{\textsc{Bsp:}}}{ +% \setlength{\labelwidth}{8Pc} +% \setlength{\labelsep}{0.5Pc} +% \setlength{\rightmargin}{0Pc} +% \setlength{\leftmargin}{2Pc} +% \setlength{\parsep}{0ex plus 0.5ex} +% \setlength{\listparindent}{1em} +% \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex} +% \setlength{\topsep}{0.5Pc} +% }} +% {\end{list} +%} +% +% +%%Lemma +%\newenvironment{myLemma}{ +% \begin{list}{\textsc{\textbf{Lemma:\ \ \ }}}{ +% \setlength{\labelsep}{-0.5Pc} +% \setlength{\leftmargin}{1Pc} +% \setlength{\parsep}{0ex plus 0.5ex} +% \setlength{\listparindent}{1em} +% \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex} +% \setlength{\topsep}{0.5Pc} +% }} +% {\end{list} +%} +%%Korollar +%\newenvironment{myKorollar}{ +% \begin{list}{\textsc{\textbf{Korollar: }}}{ +% \setlength{\labelwidth}{8Pc} +% \setlength{\labelsep}{0.5Pc} +% \setlength{\rightmargin}{0Pc} +% \setlength{\leftmargin}{4Pc} +% \setlength{\parsep}{0ex plus 0.5ex} +% \setlength{\listparindent}{1em} +% \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex} +% \setlength{\topsep}{0.5Pc} +% }} +% {\end{list} +%} +% +%%Theorem +%\newenvironment{myTheorem}{ +% \begin{list}{\textsc{\textbf{Theorem: }}}{ +% \setlength{\labelwidth}{8Pc} +% \setlength{\labelsep}{0.5Pc} +% \setlength{\rightmargin}{0Pc} +% \setlength{\leftmargin}{5Pc} +% \setlength{\parsep}{0ex plus 0.5ex} +% \setlength{\listparindent}{1em} +% \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex} +% \setlength{\topsep}{0.5Pc} +% }} +% {\end{list} +%} +% +% +%%Proportion +%\newenvironment{myProp}{ +% \begin{list}{\textsc{\textbf{Proportion: }}}{ +% \setlength{\labelwidth}{8Pc} +% \setlength{\labelsep}{0.5Pc} +% \setlength{\rightmargin}{0Pc} +% \setlength{\leftmargin}{4Pc} +% \setlength{\parsep}{0ex plus 0.5ex} +% \setlength{\listparindent}{1em} +% \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex} +% \setlength{\topsep}{0.5Pc} +% }} +% {\end{list} +%} +% +%%Farben +% +%\newcommand{\red}[1]{\textcolor[rgb]{0.7,0,0}{\bf #1}} +%\newcommand{\rd}[1]{\color{red}{#1}} +%\newcommand{\white}[1]{\textcolor[rgb]{1,0,0}{\bf #1}} +%\newcommand{\w}[1]{\color{white}{#1}} +%\newcommand{\g}[1]{\color{myColor}{#1}} +% +%\usepackage{color} +%\definecolor{myColor}{rgb}{0.9,0.9,0.9}% Wir definieren im RGB-Farbraum +% +% +%\newcommand{\myDef}[1]{\parbox{\columnwidth}{\addtocounter{ctr}{1}{\w .}\\[-0.2cm]\textbf{Definition\ \Nummer:}\\#1}} +%\newcommand{\mySatz}[2]{\colorbox{myColor}{\parbox{\columnwidth}{\addtocounter{ctr}{1}{\g .}\\[-0.2cm]\textbf{Satz\ \Nummer:}\ #1\\ #2}}} +%\newcommand{\myBeweis}[1]{\textit{\textbf{Beweis:}\\ #1}} +%\newcommand{\myAlg}[2]{\parbox{\columnwidth}{\addtocounter{ctr}{1}\textbf{Algorithmus\ \Nummer:}\ \ #1\\#2}} +%\newcommand{\myProg}[1]{\fbox{\parbox{\columnwidth}{#1}}} +% +%\newcommand{\add}[1]{\addtocounter{#1}{1}} +%\newcommand{\zahl}[1]{\setcounter{#1}{Z}} +%\newcommand{\Q}[2]{\parbox{\columnwidth}{$^{[\arabic{#1}/#2]}$ }} +% +%\newcommand{\Nummer}{\thesection.\arabic{ctr}} +% +%---------- --------------------------------------------------- Beginn ----------------------------------------------------------------------- + +\title{Greatest Common Divisor \\ for Multivariate Polynomials} +\author{Diana Meindl\\meindl\_diana@yahoo.com} +\date{\today} + +\begin{document} +\maketitle +%{\w .}\\[12cm] +%\begin{center} +%Presented to \\ +%A.Univ.Prof. Dipl.-Ing. Dr. Wolfgang Schreiner (RISC Insitute)\\ +%and\\ +%Dr. techn. Walther Neuper (Institut fr Softwaretechnologie, TU Graz) +%\end{center} +%\newpage +%{\w .}\hspace{6.5cm}\textbf{Abstact}\\[0.5cm] + +\abstract{ +This is a proposal for a Masters Thesis at RISC, the Research Institute for Symbolic Computation at Linz University.\\ + +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. + +This proposal claims for novelty with respect to the context of implementation, an implementation as a CAS-feature 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. Thus the proposed implementation of GCD and cancellation follows an actual demand. + +If the implementation is successful, it is planned to be included into the distribution of Isabelle, one of the two dominating CTPs in Europe. As part of the Isabelle distribution it will also serve the {\sisac} project aiming at an educational math assistant under development at RISC Linz and Graz University of Technology. +} + +\newpage +%WN vorerst zu Zwecken der "Ubersicht lassen ... +\tableofcontents + +\section{Background} +The \sisac-project is a research and development project launched at the Institute for Software Technology of the Graz University of Technology (TUG) and now continued at the Research Institute for Symbolic Computation (RISC) of University of Linz and at the Institute for Information Systems and Computer Media (IICM) of TUG. The resulting \sisac{} prototype is a ``transparent single-stepping system for applied mathematics'' based on the computer theorem prover Isabelle. The prototype has been proven useful in field tests at Austrain schools \cite{imst-htl06-SH,imst-htl07-SH,imst-hpts08-SH} and is now extended for wider use. + +Authoring knowledge in \sisac{} provides a strict separation of concerns between authoring math knowledge and authoring dialogues. The latter is pursued at IICM, the former is concern of this thesis. Math authoring is done by use of a CTP-based programming language \cite{plmms10} or by use of SML \cite{pl:milner97} as the meta language and implementation language of Isabelle. Since the code resulting from this thesis shall serve Isabelle, it will be written in SML. Via Isabelle distribution this thesis shall also serve \sisac; a re-implementation in \sisac's CTP-based language is planned as a subsequent project -- this will make cancellation transparent for singe-stepping. + +%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). +%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. +%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. + +TODO.WN111107 bitte googeln und je einen Absatz kopieren + zitieren woher (PLAGIATsgefahr):\\ +European provers: Isabelle \cite{Nipkow-Paulson-Wenzel:2002}, Coq \cite{Huet_all:94}\\ +American provers: PVS~\cite{pvs}, ACL2~\footnote{http://userweb.cs.utexas.edu/~moore/acl2/}\\ + +\section{Goal of the thesis} +\subsection{Current situation} +At the presetn time there is no implimentation for the problem of canceling fractions in Isabelle, and a deficient one in \sisac. But because canceling is important for calculating with fractions a new implimentation is necessary. + +\subsection{Problem} +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, where it will be used by \sisac{} as well. + +%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) ... +\bigskip +A 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 describes the problem as follows: +\begin{verbatim} +Eine erste Idee, wie die Integration der Diplomarbeit f"ur +einen Benutzer von Isabelle aussehen k"onnte, w"are zum +Beispiel im + + lemma cancel: + assumes asm3: "x2 - x*y \ 0" and asm4: "x \ 0" + shows "(x2 - y2) / (x2 - x*y) = (x + y) / (x::real)" + apply (insert asm3 asm4) + apply simp + sorry + +die Assumptions + + asm1: "(x2 - y2) = (x + y) * (x - y)" and asm2: "x2 - x*y = x * (x - y)" + +im Hintergrund automatisch zu erzeugen (mit der Garantie, +dass "(x - y)" der GCD ist) und sie dem Simplifier (f"ur die +Rule nonzero_mult_divide_mult_cancel_right) zur Verf"ugung zu +stellen, sodass anstelle von "sorry" einfach "done" stehen kann. +Und weiters w"are eventuell asm3 zu "x - y \ 0" zu vereinfachen, +eine Rewriteorder zum Herstellen einer Normalform festzulegen, etc. +\end{verbatim} +%WN und eine bessere Motivation f"ur eine Master Thesis kann ich mir auch nicht vorstellen ... +Response of Prof. Nipkow: + +\begin{verbatim} +Unser Spezialist fuer die mathematischen Theorien ist Johannes H"olzl. +Etwas allgemeinere Fragen sollten auf jeden Fall an isabelle-dev@ +gestellt werden. + +Viel Erfolg bei der Arbeit! +Tobias Nipkow +\end{verbatim} + + +\subsection{Expected results} +Implementation of algorithms for the different problems, and find out which one will be the best for the specific requirements in Isabelle.\\ +The program should accomplish: +\begin{itemize} +\item Real and rational coefficients. Maybe also imaginary coefficients. +\item Canceling and adding multivariate polynomials, when they are in normal form. +\end{itemize} +The program will be written in the functional programming language SML with appropriate comments. The resulting code shall meet the coding standards of Isabelle \cite{isar-impl} p.3-10. The integration of the code into the Isabelle distribution will be done by the Isabelle developer team. + +\section{State of the art} +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. + +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. + +\subsection{Computer Algebra and Proof Assistants} +%WN achtung: diese subsection is fast w"ortlich kopiert aus \cite{plmms10} -- also in der Endfassung bitte "uberarbeiten !!! +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.) + +First, many CTPs already have CAS-like functionality, +especially for domains like arithmetic. They provide the user +with conversions, tactics or decision procedures that solve +problems in a particular domain. Such decision procedures present +in the standard library of HOL Light~\footnote{http://www.cl.cam.ac.uk/~jrh13/hol-light/} are used inside the +prototype described in Sect.\ref{cas-funct} on p.\pageref{part-cond} for arithmetic's, +symbolic differentiation and others. + +Similarly some CAS systems provide environments that allow +logical reasoning and proving properties within the system. Such +environments are provided either as logical +extensions (e.g.~\cite{logicalaxiom}) or are implemented within a +CAS using its language~\cite{theorema00}. + +There are numerous architectures for information exchange between +CAS and CTP with different levels of \emph{degree of trust} +between the prover and the CAS. In principle, there are several approaches. +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: +\begin{enumerate} +\item Just adopt the CAS result without any check. Isabelle internally marks such results. +\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. +\item Generate a derivation of the result within CTP; in Isabelle this is called ``proof reconstruction''. +\end{enumerate} +A longer list of frameworks for +information exchange and bridges between systems can be found +in~\cite{casproto}. + +There are many approaches to defining partial functions in proof +assistants. Since we would like the user to define functions +without being exposed to the underlying logic of the proof +assistant we only mention some automated mechanisms for defining +partial functions in the logic of a CTP. +Krauss~\cite{krauss} has developed a framework for defining +partial recursive functions in Isabelle/HOL, which formally +proves termination by searching for lexicographic combinations of +size measures. Farmer~\cite{farmer} implements a scheme for +defining partial recursive functions in \textrm{IMPS}. + +\subsection{Motivation for CAS-functionality in CTP} +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}. + +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}. + +Harrison also says that ``CAS are ill-defined'' and gives, among others, an example relevant for this thesis on cancellation: TODO.WN111104 search for ... meromorphic functions in http://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-428.ps.gz + +\medskip +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. + +\subsection{Simplification within CTP} +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. +%WN: bitte mit Anfragen an die Mailing-Listen nachpr"ufen: Coq, HOL, ACL2, PVS + +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}. + +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. + +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 +{%\footnotesize --- HILFT NICHTS +\begin{verbatim} +Hi everyone, + +in the following snippet, applying the simplifier causes an error: + +------------------------------------------ +theory Scratch + imports Complex_Main +begin + +lemma + shows "(3 / 2) * ln n = ((6 * k * ln n) / n) * ((1 / 2 * n / k) / 2)" +apply simp +------------------------------------------ + +outputs + +------------------------------------------ +Proof failed. +(if n = 0 then 0 else 6 * (k * ln n) / 1) * 2 / (4 * k) = +2 * (Numeral1 * (if n = 0 then 0 else 6 * (k * ln n) / 1)) / (2 * (2 * k)) + 1. n \not= Numeral0 \rightarrow k * (ln n * (2 * 6)) / (k * 4) = k * (ln n * 12) / (k * 4) +1 unsolved goal(s)! +The error(s) above occurred for the goal statement: +(if n = 0 then 0 else 6 * (k * ln n) / 1) * 2 / (4 * k) = +2 * (Numeral1 * (if n = 0 then 0 else 6 * (k * ln n) / 1)) / (2 * (2 * k)) +------------------------------------------ +\end{verbatim} +} +Mail ``Re: simproc divide\_cancel\_factor produces error'' on Fri, 16 Sep 2011 22:33:36 +0200 +\begin{verbatim} +> > After the release, I'll have to think about doing a complete overhaul +> > of all of the cancellation simprocs. +You are very welcome to do so. Before you start, call on me and I will +write down some ideas I had long ago (other may want to join, too). +\end{verbatim} +%WN: bist du schon angemeldet in den Mailing-Listen isabelle-users@ und isabelle-dev@ ? WENN NICHT, DANN WIRD ES H"OCHSTE ZEIT !!! + +\subsection{Open Issues with CAS-functionality in CTP}\label{cas-funct} +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) !!! +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{}. + +\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}. +\cite{cezary-phd} gives an introductory example (floated to p.\pageref{fig:casproto}) which will be referred to in the sequel. +\input{thol.tex} +%WN das nachfolgende Format-Problem l"osen wir sp"ater ... +\begin{figure}[hbt] +\begin{center} +\begin{holnb} + In1 := vector [\&2; \&2] - vector [\&1; \&0] + vec 1 + Out1 := vector [\&2; \&3] + In2 := diff (diff (\Lam{}x. \&3 * sin (\&2 * x) + + \&7 + exp (exp x))) + Out2 := \Lam{}x. exp x pow 2 * exp (exp x) + + exp x * exp (exp x) + -- \&12 * sin (\&2 * x) + In3 := N (exp (\&1)) 10 + Out3 := #2.7182818284 + ... (exp (\&1)) 10 F + In4 := x + \&1 - x / \&1 + \&7 * (y + x) pow 2 + Out4 := \&7 * x pow 2 + \&14 * x * y + \&7 * y pow 2 + \&1 + In5 := sum (0,5) (\Lam{}x. \&x * \&x) + Out5 := \&30 + In6 := sqrt (x * x) assuming x > &1 + Out6 := x +\end{holnb} +\end{center} +\caption{\label{fig:casproto}Example interaction with the prototype + CAS-like input-response loop. For the user input given in the + \texttt{In} lines, the system produces the output in \texttt{Out} + lines together with HOL Light theorems that state the equality + between the input and the output.} +\end{figure} +In lines {\tt In6, Out6} this examples shows how to reliably simplify $\sqrt{x}$. \cite{caspartial} gives more details on handling side conditions in formalized partial functions. + +Analoguous to this example, cancellations (this thesis is concerned with) like +$$\frac{x^2-y^2}{x^2-x\cdot y}=\frac{x+y}{x}\;\;\;\;{\it assuming}\;x-y\not=0\land x\not=0$$ +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. + +\paragraph{Multi-valued functions:}\label{multi-valued} +\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 ... +%TODO.WN111104 ... zur Erkl"arung ein paar Beispiele von http://en.wikipedia.org/wiki/Multivalued_function + +\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. + +\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, +\begin{eqnarray} + \exists x_s.\;x_s\in S &\Rightarrow& f(x_s) = 0 \\\label{is-solut} + x_s\in S &\Leftarrow& \exists x_s.\;f(x_s) = 0 \label{all-solut} +\end{eqnarray} +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}. + +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. + +\subsection{Algorithms for cancellation of multivariate polynomials} +The most appropriate book for implementing the required algorithms in this thesis is \cite{Winkler:96}. TODO.WN111104 welche noch ? + +\section{Thesis structure} +The proposed table of contents of the thesis on the chapter level is as follows: +\begin{enumerate} + \item Introduction (2-3 pages) + \item Computer Algebra Systems (CAS) (5 - 7 pages)\\ + Which different CAS exists and whats the focus of them. + \item The \sisac{}-Project (5 - 7 pages)\\ + This chapter will describe the \sisac{}-Project and the goals of the project. + \item Univariate Polynomials (15-20 pages)\\ + This chapter will describe different Algorithms for univariate polynomials, with different coefficients. + \item Multivariate Polynomials (20-25 pages)\\ + This chapter will describe different Algorithms for multivariate polynomials, with different coefficients + \item Functional programming and SML(2-5 pages)\\ + The basic idea of this programming languages. + \item Implimentation in \sisac{}-Project (15-20 pages) + \item Conclusion (2-3 pages) +\end{enumerate} +%\newpage + +\section{Timeline} +%Werd nie fertig.\\ +\begin{center} + \begin{tabular}{|l|l|l|} + \hline + \textbf{Time}&\textbf{Thesis}&\textbf{Project}\\ + \hline + & Functional programming & Learning the basics and the idea\\ + & & of funcional programming\\ + \hline + & Different CAS & Can they handle the problem \\ + & &and which algorithm do they use?\\ \hline + & Univariate Polynomials & Implementation of the Algorithm\\ + & & for univariate Polynomials \\ \hline + & Multivariate Polynomials & Implementation of the Algorithm\\ + & & for multivariate Polynomials \\ \hline + & The \sisac-Project &\\ \hline + & Conclusion and Introduction & Find good examples for testing\\ + \hline + \end{tabular} + \end{center} + +%WN oben an passender stelle einf"ugen +\cite{einf-funct-progr} + + +\bibliography{bib/math-eng,bib/didact,bib/bk,bib/RISC_2,bib/isac,bib/pl,bib/math,references} +%\section{Bibliography} +%%mindestens 10 +%\begin{enumerate} +% \item Bird/Wadler, \textit{Einfhrung in die funktionale Programmierung}, Carl Hanser and Prentice-Hall International, 1992 +% \item Franz Winkler, \textit{Polynomial Algorithms in Computer Algebra}, Springer,1996 +% \item %M. Mignotte, \textit{An inequality about factors of polynomial} +% \item %M. Mignotte, \textit{Some useful bounds} +% \item %W. S. Brown and J. F. Traub. \textit{On euclid's algorithm and the theory of subresultans}, Journal of the ACM (JACM), 1971 +% \item %Bruno Buchberger, \textit{Algorhimic mathematics: Problem types, data types, algorithm types}, Lecture notes, RISC Jku A-4040 Linz, 1982 +% +% \item %Tateaki Sasaki and Masayuki Suzuki, \textit{Thre new algorithms for multivariate polynomial GCD}, J. Symbolic Combutation, 1992 +% \item +% \item +% \item +%\end{enumerate} + +\end{document} + +ALLES UNTERHALB \end{document} WIRD VON LATEX NICHT BERUECKSICHTIGT +WN110916 grep-ing through Isabelle code: + +neuper@neuper:/usr/local/isabisac/src$ find -name "*umeral*" +./HOL/ex/Numeral.thy +./HOL/Tools/nat_numeral_simprocs.ML +./HOL/Tools/numeral_syntax.ML +./HOL/Tools/numeral.ML +./HOL/Tools/numeral_simprocs.ML +./HOL/Matrix/ComputeNumeral.thy +./HOL/Library/Numeral_Type.thy +./HOL/Numeral_Simprocs.thy +./HOL/Import/HOL/numeral.imp +./HOL/Code_Numeral.thy +./HOL/Nat_Numeral.thy +./ZF/Tools/numeral_syntax.ML +./Provers/Arith/cancel_numeral_factor.ML +./Provers/Arith/cancel_numerals.ML +./Provers/Arith/combine_numerals.ML + +neuper@neuper:/usr/local/isabisac/src$ find -name "*ancel*" +./HOL/Tools/abel_cancel.ML +./Provers/Arith/cancel_div_mod.ML +./Provers/Arith/cancel_numeral_factor.ML Paulson 2000 !!! +./Provers/Arith/cancel_sums.ML +./Provers/Arith/cancel_numerals.ML Paulson 2000 diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/dmeindl/references.bib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/dmeindl/references.bib Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,296 @@ +@proceedings{DBLP:conf/mkm/2007, + editor = {Manuel Kauers and + Manfred Kerber and + Robert Miner and + Wolfgang Windsteiger}, + title = {Towards Mechanized Mathematical Assistants, 14th Symposium, + Calculemus 2007, 6th International Conference, MKM 2007, + Hagenberg, Austria, June 27-30, 2007, Proceedings}, + booktitle = {Calculemus/MKM}, + publisher = {Springer}, + series = {Lecture Notes in Computer Science}, + volume = {4573}, + year = {2007}, + isbn = {978-3-540-73083-5}, + bibsource = {DBLP, http://dblp.uni-trier.de} +} + +@proceedings{DBLP:conf/cade/2006, + editor = {Ulrich Furbach and + Natarajan Shankar}, + title = {Automated Reasoning, Third International Joint Conference, + IJCAR 2006, Seattle, WA, USA, August 17-20, 2006, Proceedings}, + booktitle = {IJCAR}, + publisher = {Springer}, + series = {Lecture Notes in Computer Science}, + volume = {4130}, + year = {2006}, + isbn = {3-540-37187-7}, + bibsource = {DBLP, http://dblp.uni-trier.de} +} + +@proceedings{DBLP:conf/iwfm/1999, + editor = {Andrew Butterfield and + Klemens Haegele}, + title = {3rd Irish Workshop on Formal Methods, Galway, Eire, July + 1999}, + booktitle = {IWFM}, + publisher = {BCS}, + series = {Workshops in Computing}, + year = {1999}, + bibsource = {DBLP, http://dblp.uni-trier.de} +} + +@proceedings{DBLP:conf/aisc/2008, + editor = {Serge Autexier and + John Campbell and + Julio Rubio and + Volker Sorge and + Masakazu Suzuki and + Freek Wiedijk}, + title = {Intelligent Computer Mathematics, 9th International Conference, + AISC 2008, 15th Symposium, Calculemus 2008, 7th International + Conference, MKM 2008, Birmingham, UK, July 28 - August 1, + 2008. Proceedings}, + booktitle = {AISC/MKM/Calculemus}, + publisher = {Springer}, + series = {Lecture Notes in Computer Science}, + volume = {5144}, + year = {2008}, + isbn = {978-3-540-85109-7}, + bibsource = {DBLP, http://dblp.uni-trier.de} +} + +@InProceedings{wn:lucas-interp-12, + author = {Neuper, Walther}, + title = {Automated Generation of User Guidance by Combining Computation and Deduction}, + booktitle = {THedu'11: CTP-compontents for educational software}, + year = {2012}, + editor = {Quaresma, Pedro}, + publisher = {EPTCS}, + note = {To appear} +} + +@InProceedings{davenp-multival-10, + author = {Davenport, James}, + title = {The Challenges of Multivalued "Functions"}, + booktitle = {Proceedings of the Conferences on Intelligent Computer Mathematics (CICM)}, + year = {2010} +} + +@PhdThesis{cezary-phd, + author = {Kalisyk, Cezary}, + title = {Correctness and Availability. Building Computer Algebra on top of Proof Assistants and making Proof Assistants available over the Web}, + school = {Radboud University Nijmegen}, + year = {2009}, + type = {IPA Dissertation Series 2009-18}, + note = {Promotor Herman Geuvers} +} + +@Book{bb-loos, + editor = {Buchberger, Bruno and Collins, George Edwin and Loos, + R\"udiger and Albrecht, Rudolf}, + title = {Computer Algebra. Symbolic and Algebraic Computation}, + publisher = {Springer Verlag}, + year = {1982}, + edition = {2} +} + +@Book{term-nets, + author = {Charniak, E. and Riesbeck, C. K. and McDermott, D. V.}, + title = {Artificial Intelligence Programming}, + publisher = {Lawrence Erlbaum Associates}, + year = {1980}, + note = {(Chapter 14)} +} + +@Book{db:dom-eng, + author = {Bj{\o}rner, Dines}, + title = {Domain Engineering. Technology Management, Research and Engineering}, + publisher = {JAIST Press}, + year = {2009}, + month = {Feb}, + series = {COE Research Monograph Series}, + volume = {4}, + address = {Nomi, Japan} +} + +@techreport{harr:thesis, + author={Harrison, John R.}, + title={Theorem proving with the real numbers}, + institution={University of Cambridge, Computer Laboratory},year={1996}, + type={Technical Report},number={408},address={},month={November}, + note={},status={},source={},location={loc?} + } + +@InProceedings{damas-milner-82, + author = {Damas, Luis and Milner, Robin}, + title = {Principal type-schemes for functional programs}, + booktitle = {9th Symposium on Principles of programming languages (POPL'82)}, + pages = {207-212}, + year = {1982}, + editor = {ACM} +} + +@Article{Milner-78, + author = {Milner, R.}, + title = {A Theory of Type Polymorphism in Programming}, + journal = {Journal of Computer and System Science (JCSS)}, + year = {1978}, + number = {17}, + pages = {348-374} +} + +@Article{Hindley-69, + author = {Hindley, R.}, + title = {The Principal Type-Scheme of an Object in Combinatory Logic}, + journal = {Transactions of the American Mathematical Society}, + year = {1969}, + volume = {146}, + pages = {29-60} +} + +@article{seeingroots, + author = {Jeffrey, D.J. and Norman, A.C.}, + title = {Not seeing the roots for the branches: multivalued functions in computer algebra}, + journal = {SIGSAM Bull.}, + volume = {38}, + number = {3}, + year = {2004}, + issn = {0163-5824}, + pages = {57--66}, + doi = {http://doi.acm.org/10.1145/1040034.1040036}, + publisher = {ACM}, + address = {New York, NY, USA}, + } + +@PhdThesis{russellphd, + author = {Russell O'Connor}, + title = {Incompleteness and Completeness.}, + school = {Radboud University Nijmegen}, + year = {2009}, +} + +@inproceedings{caspartial, + author = {Cezary Kaliszyk}, + title = {Automating Side Conditions in Formalized Partial Functions}, + booktitle = {AISC/MKM/Calculemus}, + year = {2008}, + pages = {300-314}, + ee = {http://dx.doi.org/10.1007/978-3-540-85110-3_26}, + crossref = {DBLP:conf/aisc/2008}, + bibsource = {DBLP, http://dblp.uni-trier.de} +} + +@inproceedings{farmer, + author = {Farmer, William M.}, + title = {A Scheme for Defining Partial Higher-Order Functions by + Recursion.}, + booktitle = {IWFM}, + year = {1999}, + crossref = {DBLP:conf/iwfm/1999}, + bibsource = {DBLP, http://dblp.uni-trier.de} +} + +@inproceedings{krauss, + author = {Krauss, Alexander}, + title = {Partial Recursive Functions in Higher-Order Logic}, + booktitle = {IJCAR}, + year = {2006}, + pages = {589-603}, + ee = {http://dx.doi.org/10.1007/11814771_48}, + crossref = {DBLP:conf/cade/2006}, + bibsource = {DBLP, http://dblp.uni-trier.de} +} + +@inproceedings{casproto, + author = {Cezary Kaliszyk and + Freek Wiedijk}, + title = {Certified Computer Algebra on Top of an Interactive Theorem + Prover}, + booktitle = {Calculemus}, + year = {2007}, + pages = {94-105}, + ee = {http://dx.doi.org/10.1007/978-3-540-73086-6_8}, + crossref = {DBLP:conf/mkm/2007}, + bibsource = {DBLP, http://dblp.uni-trier.de} +} + +@inproceedings{theorema00, + author = "Buchberger, B. and + Dupre, C. and + Jebelean, T. and + Kriftner, F. and + Nakagawa, K. and + Vasaru, D. and + Windsteiger, W.", + title = "{The Theorema Project: A Progress Report}", + booktitle = "Symbolic Computation and Automated Reasoning + (Proceedings of CALCULEMUS 2000, Symposium on the Integration of + Symbolic Computation and Mechanized Reasoning)", + editor = "Kerber, M. and + Kohlhase, M.", + publisher = "A.K.~Peters", + address = "Natick, Massachusetts", + isbn = "1-56881-145-4", + year = 2000 +} + +@inproceedings{logicalaxiom, + author = {E. Poll and S. Thompson}, + title = {{Adding the axioms to Axiom: Towards a system of automated reasoning in Aldor}}, + booktitle = {Calculemus and Types '98}, + year = {1998}, + place = {Eindhoven, The Netherlands}, + month = {July}, + note = {Also as technical report 6-98, Computing Laboratory, University of Kent} +} + +@InProceedings{pvs, + author = {Owre, S. and Rajan, S. and Rushby, J. and Shankar, N. and Srivas, M.}, + title = {{PVS}: Combining specification, proof checking, and model checking}, + booktitle = {Computer-Aided Verification}, + pages = {411-414}, + year = {1996}, + editor = {Alur, R. and Henzinger, T.A.}, + organization = {CAV'96}, + annote = {} +} + +@Book{Nipkow-Paulson-Wenzel:2002, + author = {Tobias Nipkow and Lawrence C. Paulson and Markus Wenzel}, + title = {{Isabelle/HOL} --- A Proof Assistant for Higher-Order Logic}, + publisher = {Springer}, + series = {LNCS}, + volume = 2283, + year = 2002 +} + +@Manual{Huet_all:94, + author = {Huet, G. and Kahn, G. and and Paulin-Mohring, C.}, + title = {The Coq Proof Assistant}, + institution = {INRIA-Rocquencourt}, + year = {1994}, + type = {Tutorial}, + number = {Version 5.10}, + address = {CNRS-ENS Lyon}, + status={},source={Theorema},location={-} +} + +@Book{einf-funct-progr, + author = {Richard Bird and Philip Wadler}, + title = {Introduction to Functional Programming}, + publisher = {Prentice Hall}, + year = 1988, + editor = {C. A. R. Hoare}, + series = {Prentice Hall International Series in Computer Science}, + address = {New York, London, Toronto, Sydney, Tokyo}, + annote = {88bok371} +} +@Book{Winkler:96, + author = {F. Winkler}, + title = {{Polynomial Algorithms in Computer Algebra}}, + publisher = {Springer-Verlag Wien New York}, + year = {1996} +} + diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/dmeindl/thol.tex Binary file doc-isac/dmeindl/thol.tex has changed diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/fig/coqide.png Binary file doc-isac/fig/coqide.png has changed diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/fig/jrocnik/isac-Ztrans-math-3.png Binary file doc-isac/fig/jrocnik/isac-Ztrans-math-3.png has changed diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/fig/jrocnik/math-universe-small.png Binary file doc-isac/fig/jrocnik/math-universe-small.png has changed diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/fig/jrocnik/math-universe.odg Binary file doc-isac/fig/jrocnik/math-universe.odg has changed diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/fig/jrocnik/math-universe.png Binary file doc-isac/fig/jrocnik/math-universe.png has changed diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/fig/pgisabelle.png Binary file doc-isac/fig/pgisabelle.png has changed diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/CLEANUP --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/CLEANUP Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,10 @@ +rm *.dvi +rm *.bbl +rm *.blg +rm *.aux +rm *.log +rm *.nav +rm *.out +rm *.snm +rm *.toc +rm *~ diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/FFT.thy --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/FFT.thy Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,532 @@ +(* Title: Fast Fourier Transform + Author: Clemens Ballarin , started 12 April 2005 + Maintainer: Clemens Ballarin +*) + +theory FFT +imports Complex_Main +begin + +text {* We formalise a functional implementation of the FFT algorithm + over the complex numbers, and its inverse. Both are shown + equivalent to the usual definitions + of these operations through Vandermonde matrices. They are also + shown to be inverse to each other, more precisely, that composition + of the inverse and the transformation yield the identity up to a + scalar. + + The presentation closely follows Section 30.2 of Cormen \textit{et + al.}, \emph{Introduction to Algorithms}, 2nd edition, MIT Press, + 2003. *} + + +section {* Preliminaries *} + +lemma of_nat_cplx: + "of_nat n = Complex (of_nat n) 0" + by (induct n) (simp_all add: complex_one_def) + + +text {* The following two lemmas are useful for experimenting with the + transformations, at a vector length of four. *} + +lemma Ivl4: + "{0..<4::nat} = {0, 1, 2, 3}" +proof - + have "{0..<4::nat} = {0..i=0..<4::nat. x i) = x 0 + x 1 + x 2 + x 3" + by (simp add: Ivl4 eval_nat_numeral) + + +text {* A number of specialised lemmas for the summation operator, + where the index set is the natural numbers *} + +lemma setsum_add_nat_ivl_singleton: + assumes less: "m < (n::nat)" + shows "f m + setsum f {m<.. {m<.. g i = f i" + shows "f m + setsum g {m<.. g i = f i" + and h: "!!i. [| k <= i; i < n |] ==> h i = f i" + shows "setsum g {m.. ((%i. Suc (2*i)) ` {0.. ((%i. Suc (2*i)) ` {0..i::nat = 0..<2*n. f i) = (\i = 0..i = 0..i::nat = 0..<2*n. f i) = + setsum f (op * 2 ` {0..i = 0..i = 0.. complex" where + "root n == cis (2*pi/(real (n::nat)))" + +lemma sin_periodic_pi_diff [simp]: "sin (x - pi) = - sin x" + by (simp add: sin_diff) + +lemma sin_cos_between_zero_two_pi: + assumes 0: "0 < x" and pi: "x < 2 * pi" + shows "sin x \ 0 \ cos x \ 1" +proof - + { assume "0 < x" and "x < pi" + then have "sin x \ 0" by (auto dest: sin_gt_zero_pi) } + moreover + { assume "x = pi" + then have "cos x \ 1" by simp } + moreover + { assume pi1: "pi < x" and pi2: "x < 2 * pi" + then have "0 < x - pi" and "x - pi < pi" by arith+ + then have "sin (x - pi) \ 0" by (auto dest: sin_gt_zero_pi) + with pi1 pi2 have "sin x \ 0" by simp } + ultimately show ?thesis using 0 pi by arith +qed + + +subsection {* Basic Lemmas *} + +lemma root_nonzero: + "root n ~= 0" + apply (unfold root_def) + apply (unfold cis_def) + apply auto + apply (drule sin_zero_abs_cos_one) + apply arith + done + +lemma root_unity: + "root n ^ n = 1" + apply (unfold root_def) + apply (simp add: DeMoivre) + apply (simp add: cis_def) + done + +lemma root_cancel: + "0 < d ==> root (d * n) ^ (d * k) = root n ^ k" + apply (unfold root_def) + apply (simp add: DeMoivre) + done + +lemma root_summation: + assumes k: "0 < k" "k < n" + shows "(\i=0..i=0..i=0..i=0.. root (2 * n) ^ n = - 1" + txt {* Note the space between @{text "-"} and @{text "1"}. *} + using root_cancel [where n = 2 and k = 1] + apply (simp only: mult_ac) + apply (simp add: complex_one_def) + done + + +section {* Discrete Fourier Transformation *} + +text {* + We define operations @{text DFT} and @{text IDFT} for the discrete + Fourier Transform and its inverse. Vectors are simply functions of + type @{text "nat => complex"}. *} + +text {* + @{text "DFT n a"} is the transform of vector @{text a} + of length @{text n}, @{text IDFT} its inverse. *} + +definition DFT :: "nat => (nat => complex) => (nat => complex)" where + "DFT n a == (%i. \j=0.. (nat => complex) => (nat => complex)" where + "IDFT n a == (%i. (\k=0..j = 0..<2 * m. root (2 * m) ^ (i * j) * a j) = + (\j = 0..j = 0..j = 0..j = 0..j = 0..<2 * m. root (2 * m) ^ (i * j) * a j) = + (\j = 0..j = 0..j = 0..j = 0..j = 0..<2 * m. a j / root (2 * m) ^ (i * j)) = + (\j = 0..j = 0..j = 0..j = 0..j = 0..<2 * m. a j / root (2 * m) ^ (i * j)) = + (\j = 0..j = 0..j = 0..j = 0.. (inverse a) ^ (n-m) = (a^m) / (a^n)" + apply (induct n m rule: diff_induct) + apply (simp add: nonzero_power_inverse + nonzero_inverse_eq_divide [THEN sym] nz) + apply simp + apply (simp add: nz) + done + +lemma power_diff_rev_if: + assumes nz: "(a::'a::field) ~= 0" + shows "(a^m) / (a^n) = (if n <= m then a ^ (m-n) else (1/a) ^ (n-m))" +proof (cases "n <= m") + case True with nz show ?thesis + by (simp add: power_diff) +next + case False with nz show ?thesis + by (simp add: power_diff_inverse nonzero_inverse_eq_divide [THEN sym]) +qed + +lemma power_divides_special: + "(a::'a::field) ~= 0 ==> + a ^ (i * j) / a ^ (k * i) = (a ^ j / a ^ k) ^ i" + by (simp add: nonzero_power_divide power_mult [THEN sym] mult_ac) + +theorem DFT_inverse: + assumes i_less: "i < n" + shows "IDFT n (DFT n a) i = of_nat n * a i" + using [[linarith_split_limit = 0]] + apply (unfold DFT_def IDFT_def) + apply (simp add: setsum_divide_distrib) + apply (subst setsum_commute) + apply (simp only: times_divide_eq_left [THEN sym]) + apply (simp only: power_divides_special [OF root_nonzero]) + apply (simp add: power_diff_rev_if root_nonzero) + apply (simp add: setsum_divide_distrib [THEN sym] + setsum_left_distrib [THEN sym]) + proof - + from i_less have i_diff: "!!k. i - k < n" by arith + have diff_i: "!!k. k < n ==> k - i < n" by arith + + let ?sum = "%i j n. setsum (op ^ (if i <= j then root n ^ (j - i) + else (1 / root n) ^ (i - j))) {0..j = 0..j = 0..j = i..j = i..j\{i} \ {i<..j\{i<.. (nat => complex) => (nat => complex)" where + "FFT 0 a = a" +| "FFT (Suc k) a = + (let (x, y) = (FFT k (%i. a (2*i)), FFT k (%i. a (2*i+1))) + in (%i. if i < 2^k + then x i + (root (2 ^ (Suc k))) ^ i * y i + else x (i- 2^k) - (root (2 ^ (Suc k))) ^ (i- 2^k) * y (i- 2^k)))" + +primrec IFFT :: "nat => (nat => complex) => (nat => complex)" where + "IFFT 0 a = a" +| "IFFT (Suc k) a = + (let (x, y) = (IFFT k (%i. a (2*i)), IFFT k (%i. a (2*i+1))) + in (%i. if i < 2^k + then x i + (1 / root (2 ^ (Suc k))) ^ i * y i + else x (i - 2^k) - + (1 / root (2 ^ (Suc k))) ^ (i - 2^k) * y (i - 2^k)))" + +text {* Finally, for vectors of length @{text "2 ^ k"}, + @{text DFT} and @{text FFT}, and @{text IDFT} and + @{text IFFT} are equivalent. *} + +theorem DFT_FFT: + "!!a i. i < 2 ^ k ==> DFT (2 ^ k) a i = FFT k a i" +proof (induct k) + case 0 + then show ?case by (simp add: DFT_def) +next + case (Suc k) + assume i: "i < 2 ^ Suc k" + show ?case proof (cases "i < 2 ^ k") + case True + then show ?thesis apply simp apply (simp add: DFT_lower) + apply (simp add: Suc) done + next + case False + from i have "i - 2 ^ k < 2 ^ k" by simp + with False i show ?thesis apply simp apply (simp add: DFT_upper) + apply (simp add: Suc) done + qed +qed + +theorem IDFT_IFFT: + "!!a i. i < 2 ^ k ==> IDFT (2 ^ k) a i = IFFT k a i" +proof (induct k) + case 0 + then show ?case by (simp add: IDFT_def) +next + case (Suc k) + assume i: "i < 2 ^ Suc k" + show ?case proof (cases "i < 2 ^ k") + case True + then show ?thesis apply simp apply (simp add: IDFT_lower) + apply (simp add: Suc) done + next + case False + from i have "i - 2 ^ k < 2 ^ k" by simp + with False i show ?thesis apply simp apply (simp add: IDFT_upper) + apply (simp add: Suc) done + qed +qed + +schematic_lemma "map (FFT (Suc (Suc 0)) a) [0, 1, 2, 3] = ?x" + by simp + +end diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/Makefile Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,81 @@ +## targets + +default: thesis clean +all: thesis docu present clean +thesis: thesis clean +docu: docu clean +present: present1 present2 clean +cadgme: cadgme clean + + +## dependencies + + +## settings + +LATEX = latex +PDFLATEX = pdflatex +BIBTEX = bibtex +RAIL = rail -a +SEDINDEX = ./sedindex +FIXBOOKMARKS = perl -pi fixbookmarks.pl + +DEFAULT_GARBAGE = *.aux *.log *.toc *.idx *.rai *.rao *.bbl *.ind *.ilg *.blg *.out *.lof +DEFAULT_OUTPUT = *.dvi jrocnik_present1.pdf jrocnik_present2.pdf jrocnik_bakk.pdf *.ps +GARBAGE = +OUTPUT = + +## special targets + +.DELETE_ON_ERROR: + +## actions + +nothing: + +clean: + @rm -f $(DEFAULT_GARBAGE) $(GARBAGE) + +mrproper: + @rm -f $(DEFAULT_GARBAGE) $(DEFAULT_OUTPUT) $(GARBAGE) $(OUTPUT) + +THESIS_NAME = jrocnik_bakk +THESIS_FILES = jrocnik_bakk.tex + +DOCU_NAME = Inverse_Z_Transform/doc/Inverse_Z_Transform +DOCU_FILES = Inverse_Z_Transform/doc/root.tex + +PRESENT1_NAME = jrocnik_present1 +PRESENT1_FILES = jrocnik_present1.tex + +PRESENT2_NAME = jrocnik_present2 +PRESENT2_FILES = jrocnik_present2.tex + +CADGME_NAME = jrocnik_cadgme +CADGME_FILES = cadgme.tex + +thesis: $(THESIS_NAME).pdf + +$(THESIS_NAME).pdf: $(THESIS_FILES) + $(PDFLATEX) $(THESIS_NAME) + $(BIBTEX) $(THESIS_NAME) + $(PDFLATEX) $(THESIS_NAME) + $(PDFLATEX) $(THESIS_NAME) + +present1: $(PRESENT1_NAME).pdf + +$(PRESENT1_NAME).pdf: $(PRESENT1_FILES) + $(PDFLATEX) $(PRESENT1_NAME) + $(PDFLATEX) $(PRESENT1_NAME) + +present2: $(PRESENT2_NAME).pdf + +$(PRESENT2_NAME).pdf: $(PRESENT2_FILES) + $(PDFLATEX) $(PRESENT2_NAME) + $(PDFLATEX) $(PRESENT2_NAME) + +cadgme: $(CADGME_NAME).pdf + +$(CADGME_NAME).pdf: $(CADGME_FILES) + $(PDFLATEX) $(CADGME_NAME) + $(PDFLATEX) $(CADGME_NAME) diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/TUGlogo.pdf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/TUGlogo.pdf Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,219 @@ +%PDF-1.3 +% +2 0 obj +<< +/Length 2930 +>> +stream +0 0.957 0.569 0 k +/GS1 gs +0 31.119 20.745 -20.746 re +f +22.819 31.119 20.746 -20.746 re +f +q +1 i +0 41.492 112.876 -41.432 re +W n +45.641 31.119 20.744 -20.746 re +f +10.372 20.746 20.747 -20.686 re +f +Q +35.268 41.492 20.744 -20.746 re +f +0.941 0.82 0.808 0.894 k +1 i +75.104 27.791 m +68.462 27.791 l +68.462 31.11 l +85.581 31.11 l +85.581 27.791 l +78.94 27.791 l +78.94 10.417 l +75.104 10.417 l +75.104 27.791 l +f +q +0 41.492 112.876 -41.432 re +W n +104.828 18.021 m +104.828 16.774 104.604 15.649 104.156 14.646 c +103.708 13.643 103.097 12.79 102.321 12.09 c +101.546 11.387 100.631 10.848 99.57 10.469 c +98.511 10.088 97.359 9.898 96.115 9.898 c +94.873 9.898 93.722 10.088 92.661 10.469 c +91.601 10.848 90.678 11.387 89.895 12.09 c +89.109 12.79 88.497 13.643 88.061 14.646 c +87.621 15.649 87.403 16.774 87.403 18.021 c +87.403 31.11 l +91.241 31.11 l +91.241 18.153 l +91.241 17.648 91.321 17.117 91.485 16.562 c +91.648 16.008 91.919 15.497 92.298 15.029 c +92.676 14.563 93.177 14.178 93.801 13.877 c +94.423 13.576 95.194 13.425 96.115 13.425 c +97.035 13.425 97.808 13.576 98.431 13.877 c +99.054 14.178 99.556 14.563 99.934 15.029 c +100.312 15.497 100.582 16.008 100.746 16.562 c +100.909 17.117 100.991 17.648 100.991 18.153 c +100.991 31.11 l +104.828 31.11 l +104.828 18.021 l +f +83.257 7.566 m +82.496 7.895 81.511 8.052 80.723 8.052 c +78.43 8.052 77.162 6.609 77.162 4.734 c +77.162 2.873 78.401 1.471 80.497 1.471 c +81.032 1.471 81.456 1.523 81.793 1.602 c +81.793 3.987 l +79.71 3.987 l +79.71 5.43 l +83.679 5.43 l +83.679 0.5 l +82.638 0.238 81.553 0.028 80.497 0.028 c +77.316 0.028 75.106 1.51 75.106 4.604 c +75.106 7.737 77.162 9.494 80.497 9.494 c +81.638 9.494 82.538 9.35 83.383 9.113 c +83.257 7.566 l +f +85.62 6.938 m +87.296 6.938 l +87.296 5.403 l +87.324 5.403 l +87.408 6.033 88.182 7.095 89.308 7.095 c +89.491 7.095 89.689 7.095 89.885 7.042 c +89.885 5.272 l +89.717 5.363 89.379 5.416 89.04 5.416 c +87.507 5.416 87.507 3.633 87.507 2.664 c +87.507 0.186 l +85.62 0.186 l +85.62 6.938 l +f +93.587 1.312 m +94.164 1.312 94.614 1.549 94.909 1.916 c +95.219 2.296 95.304 2.781 95.304 3.306 c +94.487 3.306 l +93.644 3.306 92.391 3.175 92.391 2.139 c +92.391 1.563 92.911 1.312 93.587 1.312 c +h +91.376 6.583 m +92.107 6.898 93.094 7.095 93.896 7.095 c +96.105 7.095 97.021 6.242 97.021 4.249 c +97.021 3.384 l +97.021 2.703 97.035 2.191 97.049 1.693 c +97.063 1.182 97.091 0.71 97.134 0.186 c +95.473 0.186 l +95.402 0.539 95.402 0.985 95.389 1.195 c +95.359 1.195 l +94.924 0.448 93.979 0.028 93.122 0.028 c +91.842 0.028 90.588 0.749 90.588 2.034 c +90.588 3.043 91.108 3.633 91.827 3.961 c +92.546 4.289 93.474 4.355 94.263 4.355 c +95.304 4.355 l +95.304 5.442 94.783 5.81 93.671 5.81 c +92.869 5.81 92.066 5.522 91.434 5.076 c +91.376 6.583 l +f +98.569 6.938 m +104.312 6.938 l +104.312 5.495 l +100.707 1.549 l +104.438 1.549 l +104.438 0.186 l +98.414 0.186 l +98.414 1.615 l +102.087 5.574 l +98.569 5.574 l +98.569 6.938 l +f +0 0.957 0.569 0 k +105.965 6.911 6.911 -6.851 re +f +Q +endstream +endobj +3 0 obj +<< +/ProcSet [/PDF ] +/ExtGState << +/GS1 4 0 R +>> +>> +endobj +4 0 obj +<< +/Type /ExtGState +/SA false +/SM 0.02 +/OP false +/op false +/OPM 1 +/BG2 /Default +/UCR2 /Default +/HT /Default +/TR2 /Default +>> +endobj +1 0 obj +<< +/Type /Page +/Parent 5 0 R +/Resources 3 0 R +/Contents 2 0 R +>> +endobj +6 0 obj +<< +/S /D +>> +endobj +7 0 obj +<< +/Nums [0 6 0 R ] +>> +endobj +5 0 obj +<< +/Type /Pages +/Kids [1 0 R] +/Count 1 +/MediaBox [0 0 113 42] +>> +endobj +8 0 obj +<< +/CreationDate (D:20060111234722+13'00') +/ModDate (D:20060111234722+13'00') +/Producer (PSNormalizer.framework) +>> +endobj +9 0 obj +<< +/Type /Catalog +/Pages 5 0 R +/PageLabels 7 0 R +>> +endobj +xref +0 10 +0000000000 65535 f +0000003204 00000 n +0000000016 00000 n +0000002998 00000 n +0000003064 00000 n +0000003349 00000 n +0000003284 00000 n +0000003311 00000 n +0000003429 00000 n +0000003560 00000 n +trailer +<< +/Size 10 +/Root 9 0 R +/Info 8 0 R +/ID [<99444215e2a4a31d5c4ca09b38102d5e><99444215e2a4a31d5c4ca09b38102d5e>] +>> +startxref +3627 +%%EOF diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/Test_Complex.thy --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/Test_Complex.thy Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,113 @@ +theory Test_Complex imports Isac begin + +section {*terms and operations*} +ML {* + print_depth 999; @{term "Complex 1 (2::real)"}; +*} +ML {* +@{term "Complex 1 2 + Complex 3 4"}; +print_depth 999; str2term "Complex 1 2 + Complex 3 4"; print_depth 999; +*} +ML {* +@{term "Complex 1 2 * Complex 3 4"}; +@{term "Complex 1 2 - Complex 3 4"}; +@{term "Complex 1 2 / Complex 3 4"}; +(*@{term "Complex 1 2 ^ Complex 3 4"}; + Type unification failed: Clash of types "complex" and "nat" + Operator: op ^ (Complex 1 2) :: nat \ complex + Operand: Complex 3 4 :: complex*) +*} +ML {* +term2str @{term "Complex 1 2 + Complex 3 4"}; +term2str @{term "Complex 1 2 / Complex 3 4"}; +*} + +ML {* +val a = @{term "Complex 1 2"}; +atomty a; +val a = str2term "Complex 1 2"; +atomty a; +*} +ML {* +val b = @{term "Complex 3 4"}; +val b = str2term "Complex 3 4"; +(*a + (b::complex); ERROR: term + term*) +*} + +section {*use the operations for simplification*} + + + +subsection {*example 1 -- ADD*} +ML {* + print_depth 1; + val (thy, ro, er) = (@{theory}, tless_true, eval_rls); +*} +ML {* + val thm = @{thm "complex_add"}; + val t = str2term "Complex 1 2 + Complex 3 4"; + val SOME _ = rewrite_ thy ro er true thm t; + val SOME (t', _) = rewrite_ thy ro er true thm t; + "Complex (1 + 3) (2 + 4)" = term2str t'; +*} + + + + +subsection {*example 2 -- ADD, MULT*} +ML {* + +val Simplify_complex = append_rls "Simplify_complex" e_rls + [ Thm ("complex_add",num_str @{thm complex_add}), + Thm ("complex_mult",num_str @{thm complex_mult}), + Rls_ norm_Poly + ]; + +*} +ML {* + +val t = str2term "(Complex 1 2 * (Complex 3 4 + Complex 5 (6::real)))"; +term2str t = "Complex 1 2 * (Complex 3 4 + Complex 5 6)"; +atomty t; + +*} +ML {* + + +val SOME (t, _) = rewrite_set_ thy true Simplify_complex t; + +term2str t = "Complex -12 26"; +atomty t; + +*} + +subsection {*example 3*} +ML {* +val Simplify_complex = append_rls "Simplify_complex" e_rls + [ Thm ("complex_mult",num_str @{thm complex_mult}), + Thm ("complex_inverse",num_str @{thm complex_inverse}), + Rls_ norm_Poly + ]; +*} +ML {* +val t = str2term "inverse (Complex (2::real) (4::real))"; +term2str t = "inverse Complex (2) (4)"; +atomty t; +*} +ML {* +trace_rewrite := true; +val SOME (t, _) = rewrite_set_ thy true Simplify_complex t; +trace_rewrite := false; +term2str t = "Complex -12 26"; +atomty t; +*} + + + +ML {* +trace_rewrite := true; +trace_rewrite := false; +*} + +end + diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/Test_Integral.thy --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/Test_Integral.thy Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,17 @@ +(* +doc-src/isac/jrocnik$ /usr/local/isabisac/bin/isabelle jedit Test_Integral.thy & +*) + +theory Test_Integral imports "../../../src/HOL/Multivariate_Analysis/Integration" +Integration begin + +ML {* +@{term "Integral s f k"} +*} +ML {* +*} +ML {* +*} + +end + diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/Test_SUM.thy --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/Test_SUM.thy Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,28 @@ + +theory Test_SUM imports Isac begin + +section {*trials with implicit function, probably required*} +ML {* +@{term "(%n :: nat. n) 2"}; +@{term "(%n. n) 2"}; +@{term "2"}; +*} +ML {* +@{term "(%n. n+n)"}; +@{term "(%n. n+n) a"}; +@{term "a+a"}; +*} +section {*sums*} +ML {* +val x = @{term "(SUM i = 0..< k. f i)"}; +term2str x +*} +ML {* +*} +ML {* +*} +ML {* +*} + +end + diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/bakkarbeit.tcp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/bakkarbeit.tcp Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,12 @@ +[FormatInfo] +Type=TeXnicCenterProjectInformation +Version=4 + +[ProjectInfo] +MainFile=jrocnik_bakk.tex +UseBibTeX=1 +UseMakeIndex=0 +ActiveProfile=LaTeX => PDF (Sumatra) +ProjectLanguage=en +ProjectDialect=US + diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/bakkarbeit.tps --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/bakkarbeit.tps Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,154 @@ +[FormatInfo] +Type=TeXnicCenterProjectSessionInformation +Version=2 + +[SessionInfo] +ActiveTab=0 +FrameCount=5 +ActiveFrame=0 + +[Frame0] +Columns=1 +Rows=1 +Flags=2 +ShowCmd=3 +MinPos.x=-1 +MinPos.y=-1 +MaxPos.x=-4 +MaxPos.y=-23 +NormalPos.left=0 +NormalPos.top=0 +NormalPos.right=112 +NormalPos.bottom=299 +Class=CLatexEdit +Document=jrocnik_bakk.tex + +[Frame0_Row0] +cyCur=848 +cyMin=10 + +[Frame0_Col0] +cxCur=992 +cxMin=10 + +[Frame0_View0,0] +Cursor.row=143 +Cursor.column=297 +TopSubLine=145 + +[Frame1] +Columns=1 +Rows=1 +Flags=0 +ShowCmd=1 +MinPos.x=-1 +MinPos.y=-1 +MaxPos.x=-4 +MaxPos.y=-23 +NormalPos.left=44 +NormalPos.top=44 +NormalPos.right=676 +NormalPos.bottom=512 +Class=CLatexEdit +Document=calulations.tex + +[Frame1_Row0] +cyCur=421 +cyMin=10 + +[Frame1_Col0] +cxCur=604 +cxMin=10 + +[Frame1_View0,0] +Cursor.row=52 +Cursor.column=25 +TopSubLine=35 + +[Frame2] +Columns=1 +Rows=1 +Flags=0 +ShowCmd=1 +MinPos.x=-1 +MinPos.y=-1 +MaxPos.x=-4 +MaxPos.y=-23 +NormalPos.left=66 +NormalPos.top=66 +NormalPos.right=698 +NormalPos.bottom=534 +Class=CLatexEdit +Document=bakkarbeit_titlepage.tex + +[Frame2_Row0] +cyCur=421 +cyMin=10 + +[Frame2_Col0] +cxCur=604 +cxMin=10 + +[Frame2_View0,0] +Cursor.row=7 +Cursor.column=0 +TopSubLine=0 + +[Frame3] +Columns=1 +Rows=1 +Flags=0 +ShowCmd=1 +MinPos.x=-1 +MinPos.y=-1 +MaxPos.x=-4 +MaxPos.y=-23 +NormalPos.left=88 +NormalPos.top=88 +NormalPos.right=1134 +NormalPos.bottom=670 +Class=CLatexEdit +Document=preambleForGeneratedDocuments.tex + +[Frame3_Row0] +cyCur=535 +cyMin=10 + +[Frame3_Col0] +cxCur=1018 +cxMin=10 + +[Frame3_View0,0] +Cursor.row=3 +Cursor.column=30 +TopSubLine=0 + +[Frame4] +Columns=1 +Rows=1 +Flags=0 +ShowCmd=1 +MinPos.x=-1 +MinPos.y=-1 +MaxPos.x=-4 +MaxPos.y=-23 +NormalPos.left=110 +NormalPos.top=110 +NormalPos.right=1156 +NormalPos.bottom=692 +Class=CLatexEdit +Document=references.bib + +[Frame4_Row0] +cyCur=535 +cyMin=10 + +[Frame4_Col0] +cxCur=1018 +cxMin=10 + +[Frame4_View0,0] +Cursor.row=24 +Cursor.column=15 +TopSubLine=0 + diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/bakkarbeit_titlepage.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/bakkarbeit_titlepage.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,44 @@ +\begin{titlepage} + + % Top of the page + \vspace*{-2cm} + \hfill + \begin{minipage}{4cm} + \includegraphics[width=40mm]{./TUGlogo.pdf} + \end{minipage} + + % Center of the page + \begin{center} + \vspace{1cm} + + \normalsize{Baccalaureate Thesis}\\ + + \HRule + \vspace{0.3cm} + \Large{ + \bf Interactive Course Material for Signal Processing based on Isabelle/\isac\\ + } + \HRule + + \vspace{1cm} + \normalsize{conducted at the}\\ + \normalsize{Institute for Software Technology}\\ + \normalsize{Institute of Signal Processing and Speech Communication}\\ + \vspace{0.3cm} + \normalsize{Graz University of Technology}\\ + + \vspace{1cm} + \normalsize{by}\\ + Jan Simon Ro\v{c}nik\\\href{mailto:student.tugraz.at}{\tt jan.rocnik@student.tugraz.at} + + \vspace{1cm} + \normalsize{Supervisor}\\ + Univ.-Prof. Dipl.-Ing. Dr.techn. Franz Wotawa + \vfill + + % Bottom of the page + {\large Graz, \today} + + \end{center} + +\end{titlepage} \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/calulations.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/calulations.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,202 @@ +%\documentclass[a4paper]{scrartcl} +%\usepackage[top=2cm, bottom=2.5cm, left=3cm, right=2cm, footskip=1cm]{geometry} +%\usepackage[german]{babel} +%\usepackage[T1]{fontenc} +%\usepackage[latin1]{inputenc} +%\usepackage{endnotes} +%\usepackage{trfsigns} +%\usepackage{setspace} +% +%\setlength{\parindent}{0ex} +%\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} +%\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} +% +%\begin{document} +%\title{Interactive Course Material for Signal Processing based on Isabelle/\isac} +%\subtitle{Problemsolutions (Calculations)} +%\author{Walther Neuper, Jan Rocnik} +%\maketitle + + +%------------------------------------------------------------------------------ +%FOURIER + +\subsection{Fourier Transformation} +\subsubsection*{Problem\endnote{Problem submitted by Bernhard Geiger. Originally fragment of the exam to \emph{Signaltransformationen VO} from 04.03.2011. Translated from German.}} +\textbf{(a)} Determine the fourier transform for the given rectangular impulse: + +\begin{center} +$x(t)= \left\{ + \begin{array}{lr} + 1 & -1\leq t\geq1\\ + 0 & else + \end{array} + \right.$ +\end{center} + +\textbf{\noindent (b)} Now consider the given delayed impulse, determine its fourie transformation and calculate phase and magnitude: + +\begin{center} +$x(t)= \left\{ + \begin{array}{lr} + 1 & -1\leq t\leq1\\ + 0 & else + \end{array} + \right.$ +\end{center} + +\subsubsection{Solution} +\textbf{(a)} \textsf{Subproblem 1} +\onehalfspace{ +\begin{tabbing} +000\=\kill +\texttt{\footnotesize{01}} \> Definition: $X(j\omega)=\int_\infty^\infty{x(t)\cdot e^{-j\omega t}}$\\ +\`Insert Condition: $x(t) = 1\;$ for $\;\{-1\leq t\;\land\;t\leq 1\}\;$ and $\;x(t)=0\;$ otherwise\\ +\texttt{\footnotesize{02}} \> $X(j\omega)=\int_{-1}^{1}{1\cdot e^{-j\omega t}}$\\ + \` $\int_a^b f\;t\;dt = \int f\;t\;dt\;|_a^b$\\ +\texttt{\footnotesize{03}} \> $\int 1\cdot e^{-j\cdot\omega\cdot t} d t\;|_{-1}^1$\\ + \` pbl: integration in $\cal C$\\ +\texttt{\footnotesize{04}} \> $\left(\frac{1}{-j\cdot\omega}\cdot e^{-j\cdot\omega\cdot t} \;|_{-1}^1\right)$\\ + \` $f\;t\;|_a^b = f\;b-f\;a$\\ +\texttt{\footnotesize{05}} \> $\frac{1}{-j\cdot\omega}\cdot e^{-j\cdot\omega\cdot 1} - \frac{1}{-j\cdot\omega}\cdot e^{-j\cdot\omega\cdot -1}$\\ +\texttt{\footnotesize{06}} \> $\frac{1}{-j\cdot\omega}\cdot e^{-j\cdot\omega} - \frac{1}{-j\cdot\omega}\cdot e^{j\cdot\omega}$\\ +\` Lift $\frac{1}{j\omega}$\\ +\texttt{\footnotesize{07}} \> $\frac{1}{j\cdot\omega}\cdot(e^{j\cdot\omega} - e^{-j\cdot\omega})$\\ + \` trick~!\\ +\texttt{\footnotesize{08}} \> $\frac{1}{\omega}\cdot(\frac{-e^{j\cdot\omega} + e^{-j\cdot\omega}}{j})$\\ + \` table\\ +\texttt{\footnotesize{09}} \> $2\cdot\frac{\sin\;\omega}{\omega}$ +\end{tabbing} +} + +\noindent\textbf{(b)} \textsf{Subproblem 1} +\onehalfspace{ +\begin{tabbing} +000\=\kill +\texttt{\footnotesize{01}} \> Definition: $X(j\omega)=\int_\infty^\infty{x(t)\cdot e^{-j\omega t}}$\\ +\`Insert Condition: $x(t) = 1\;$ for $\;\{1\leq t\;\land\;t\leq 3\}\;$ and $\;x(t)=0\;$ otherwise\\ +\texttt{\footnotesize{02}} \> $X(j\omega)=\int_{-1}^{1}{1\cdot e^{-j\omega t}}$\\ + \` $\int_a^b f\;t\;dt = \int f\;t\;dt\;|_a^b$\\ +\texttt{\footnotesize{03}} \> $\int 1\cdot e^{-j\cdot\omega\cdot t} d t\;|_{1}^3$\\ + \` pbl: integration in $\cal C$\\ +\texttt{\footnotesize{04}} \> $\left(\frac{1}{-j\cdot\omega}\cdot e^{-j\cdot\omega\cdot t} \;|_{1}^3\right)$\\ + \` $f\;t\;|_a^b = f\;b-f\;a$\\ +\texttt{\footnotesize{05}} \> $\frac{1}{-j\cdot\omega}\cdot e^{-j\cdot\omega\cdot 3} - \frac{1}{-j\cdot\omega}\cdot e^{-j\cdot\omega\cdot 1}$\\ +\`Lift $\frac{1}{-j\omega}$\\ +\texttt{\footnotesize{06}} \> $\frac{1}{j\cdot\omega}\cdot(e^{-j\cdot\omega} - e^{-j\cdot\omega3})$\\ + \`Lift $e^{j\omega2}$ (trick)\\ +\texttt{\footnotesize{07}} \> $\frac{1}{j\omega}\cdot e^{j\omega2}\cdot(e^{j\omega} - e^{-j\omega})$\\ +\`Simplification (trick)\\ +\texttt{\footnotesize{08}} \> $\frac{1}{\omega}\cdot e^{j\omega2}\cdot(\frac{e^{j\omega} - e^{-j\omega}}{j})$\\ + \` table\\ +\texttt{\footnotesize{09}} \> $2\cdot e^{j\omega2}\cdot\frac{\sin\;\omega}{\omega}$\\ +\noindent\textbf{(b)} \textsf{Subproblem 2}\\ +\`Definition: $X(j\omega)=|X(j\omega)|\cdot e^{arg(X(j\omega))}$\\ +\`$|X(j\omega)|$ is called \emph{Magnitude}\\ +\`$arg(X(j\omega))$ is called \emph{Phase}\\ +\texttt{\footnotesize{10}} \> $|X(j\omega)|=\frac{2}{\omega}\cdot sin(\omega)$\\ +\texttt{\footnotesize{11}} \> $arg(X(j\omega)=-2\omega$\\ +\end{tabbing} +} +%------------------------------------------------------------------------------ +%CONVOLUTION + +\subsection{Convolution} +\subsubsection*{Problem\endnote{Problem submitted by Bernhard Geiger. Originally part of the SPSC Problem Class 2, Summer term 2008}} +Consider the two discrete-time, linear and time-invariant (LTI) systems with the following impulse response: + +\begin{center} +$h_1[n]=\left(\frac{3}{5}\right)^n\cdot u[n]$\\ +$h_1[n]=\left(-\frac{2}{3}\right)^n\cdot u[n]$ +\end{center} + +The two systems are cascaded seriell. Derive the impulse respinse of the overall system $h_c[n]$. +\subsubsection*{Solution} + +\doublespace{ +\begin{tabbing} +000\=\kill +\texttt{\footnotesize{01}} \> $h_c[n]=h_1[n]*h_2[n]$\\ +\texttt{\footnotesize{02}} \> $h_c[n]=\left(\left(\frac{3}{5}\right)^n\cdot u[n]\right)*\left(\left(-\frac{2}{3}\right)^n\cdot u[n]\right)$\\ +\`Definition: $a^n\cdot u[n]\,*\,b^n\cdot u[n]=\sum\limits_{k=-\infty}^{\infty}{a^k\cdot u[k]\cdot b^{n-k}\cdot u[n-k]}$\\ +\texttt{\footnotesize{03}} \> $h_c[n]=\sum\limits_{k=-\infty}^{\infty}{\left(\frac{3}{5}\right)^k\cdot u[n]\,\cdot \,\left(-\frac{2}{3}\right)^{n-k}\cdot u[n-k]}$\\ +\`$u[n]= \left\{ + \begin{array}{lr} + 1 & for\ n>=0\\ + 0 & else + \end{array} + \right.$\\ +\`We can leave the unitstep through simplification.\\ +\`So the lower limit is 0, the upper limit is n.\\ +\texttt{\footnotesize{04}} \> $h_c[n]=\sum\limits_{k=0}^{n}{\left(\frac{3}{5}\right)^k\cdot \left(-\frac{2}{3}\right)^{n-k}}$\\ +\`Expand\\ +\texttt{\footnotesize{05}} \> $h_c[n]=\sum\limits_{k=0}^{n}{\left(\frac{3}{5}\right)^k\cdot \left(-\frac{2}{3}\right)^{n}\cdot \left(-\frac{2}{3}\right)^{-k}}$\\ +\`Lift\\ +\texttt{\footnotesize{06}} \> $h_c[n]=\left(-\frac{2}{3}\right)^{n}\cdot\sum\limits_{k=0}^{\infty}{\left(\frac{3}{5}\right)^k\cdot \left(-\frac{2}{3}\right)^{-k}}$\\ +\texttt{\footnotesize{07}} \> $h_c[n]=\left(-\frac{2}{3}\right)^{n}\cdot\sum\limits_{k=0}^{n}{\left(\frac{3}{5}\right)^k\cdot \left(-\frac{3}{2}\right)^{k}}$\\ +\texttt{\footnotesize{08}} \> $h_c[n]=\left(-\frac{2}{3}\right)^{n}\cdot\sum\limits_{k=0}^{n}{\left(-\frac{9}{10}\right)^{k}}$\\ +\`Geometric Series: $\sum\limits_{k=0}^{n}{q^k}=\frac{1-q^{n+1}}{1-q}$\\ +\`Now we have to consider the limits again.\\ +\`It is neccesarry to put the unitstep in again.\\ +\texttt{\footnotesize{09}} \> $h_c[n]=\left(-\frac{2}{3}\right)^{n}\cdot\frac{1-\left(-\frac{9}{10}\right)^{n+1}}{1-\left(-\frac{9}{10}\right)}\cdot u[n]$\\ +\texttt{\footnotesize{10}} \> $h_c[n]=\left(-\frac{2}{3}\right)^{n}\cdot\frac{1-\left(-\frac{9}{10}\right)^{n}\cdot\left(-\frac{9}{10}\right)}{1-\left(-\frac{9}{10}\right)}\cdot u[n]$\\ +\texttt{\footnotesize{11}} \> $h_c[n]=\left(-\frac{2}{3}\right)^{n}\cdot\frac{1-\left(-\frac{9}{10}\right)^{n}\cdot\left(-\frac{9}{10}\right)}{\left(\frac{19}{10}\right)}\cdot u[n]$\\ +\texttt{\footnotesize{12}} \> $h_c[n]=\left(-\frac{2}{3}\right)^{n}\cdot \left(1-\left(-\frac{9}{10}\right)^{n}\cdot\left(-\frac{9}{10}\right)\right)\cdot\left(\frac{10}{19}\right)\cdot u[n]$\\ +\`Lift $u[n]$\\ +\texttt{\footnotesize{13}} \> $\left(\frac{10}{19}\cdot\left(-\frac{2}{3}\right)^n+\frac{9}{19}\cdot\left(\frac{3}{5}\right)^n\right)\cdot u[n]$\\ +\end{tabbing} +} + +%------------------------------------------------------------------------------ +%Z-Transformation + +\subsection{Z-Transformation\label{sec:calc:ztrans}} +\subsubsection*{Problem\endnote{Problem submitted by Bernhard Geiger. Originally part of the signal processing problem class 5, summer term 2008.}} +Determine the inverse $\cal{z}$ transform of the following expression. Hint: applay the partial fraction expansion. + +\begin{center} +$X(z)=\frac{3}{z-\frac{1}{4}-\frac{1}{8}z^{-1}},\ \ x[n]$ is absolute summable +\end{center} + +\subsubsection*{Solution} +\onehalfspace{ +\begin{tabbing} +000\=\kill +\textsf{Main Problem}\\ +\texttt{\footnotesize{01}} \> $\frac{3}{z-\frac{1}{4}-\frac{1}{8}z^{-1}}$ \\ +\`Divide through z, neccesary for z-transformation\\ +\texttt{\footnotesize{02}} \> $\frac{3}{z^2-\frac{1}{4}z-\frac{1}{8}}$ \\ +\`Start with partial fraction expansion\\ +\texttt{\footnotesize{03}} \> $\frac{3}{z^2-\frac{1}{4}z-\frac{1}{8}}=\frac{A}{z-z_1}+\frac{B}{z-z_2}$ \\ +\`Eliminate Fractions\\ +\texttt{\footnotesize{04}} \> $3=A(z-z_2)+B(z-z_1)$ \\ +\textsf{Subproblem 1}\\ +\`Setup a linear equation system by inserting the zeros $z_1$ and $z_2$ for $z$\\ +\texttt{\footnotesize{05}} \> $3=A(z_1-z_2)$ \& $3=B(z_2-z_1)$\\ +\texttt{\footnotesize{06}} \> $\frac{3}{z_1-z_2}=A$ \& $\frac{3}{z_2-z_1}=B$\\ +\textsf{Subproblem 2}\\ +\`Determine $z_1$ and $z_2$\\ +\texttt{\footnotesize{07}} \> $z_1=\frac{1}{8}+\sqrt{\frac{1}{64}+\frac{1}{8}}$ \& $z_2=\frac{1}{8}-\sqrt{\frac{1}{64}+\frac{1}{8}}$\\ +\texttt{\footnotesize{08}} \> $z_1=\frac{1}{8}+\sqrt{\frac{9}{64}}$ \& $z_2=\frac{1}{8}-\sqrt{\frac{9}{64}}$\\ +\texttt{\footnotesize{09}} \> $z_1=\frac{1}{8}+\frac{3}{8}$ \& $z_2=\frac{1}{8}-\frac{3}{8}$\\ +\texttt{\footnotesize{10}} \> $z_1=\frac{1}{2}$ \& $z_2=-\frac{1}{4}$\\ +\textsf{Continiue with Subproblem 1}\\ +\`Get the coeffizients $A$ and $B$\\ +\texttt{\footnotesize{11}} \> $\frac{3}{\frac{1}{2}-(-\frac{1}{4})}=A$ \& $\frac{3}{-\frac{1}{4}-\frac{1}{2}}=B$\\ +\texttt{\footnotesize{12}} \> $\frac{3}{\frac{1}{2}+\frac{1}{4}}=A$ \& $\frac{3}{-\frac{1}{4}-\frac{1}{2}}=B$\\ +\texttt{\footnotesize{13}} \> $\frac{3}{\frac{3}{4}}=A$ \& $\frac{3}{-\frac{3}{4}}=B$\\ +\texttt{\footnotesize{14}} \> $\frac{12}{3}=A$ \& $-\frac{12}{3}=B$\\ +\texttt{\footnotesize{15}} \> $4=A$ \& $-4=B$\\ +\textsf{Continiue with Main Problem}\\ +\texttt{\footnotesize{16}} \> $\frac{A}{z-z_1}+\frac{B}{z-z_2}$\\ +\texttt{\footnotesize{17}} \> $\frac{4}{z-\frac{1}{2}}+\frac{4}{z-\left(-\frac{1}{4}\right)}$ \\ +\texttt{\footnotesize{18}} \> $\frac{4}{z-\frac{1}{2}}-\frac{4}{z+\frac{1}{4}}$ \\ +\`Multiply with z, neccesary for z-transformation\\ +\texttt{\footnotesize{19}} \> $\frac{4z}{z-\frac{1}{2}}-\frac{4z}{z+\frac{1}{4}}$ \\ +\texttt{\footnotesize{20}} \> $4\cdot\frac{z}{z-\frac{1}{2}}+(-4)\cdot\frac{z}{z+\frac{1}{4}}$ \\ +\`Transformation\\ +\texttt{\footnotesize{21}} \> $4\cdot\frac{z}{z-\frac{1}{2}}+(-4)\cdot\frac{z}{z+\frac{1}{4}}\ \Ztransf\ 4\cdot\left(-\frac{1}{2}\right)^n\cdot u[n]+(-4)\cdot\left(\frac{1}{4}\right)^n\cdot u[n]$\\ +\end{tabbing} +} +\theendnotes +%\end{document} \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/eJMT-paper/fig/isac-Ztrans-math-3.png Binary file doc-isac/jrocnik/eJMT-paper/fig/isac-Ztrans-math-3.png has changed diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/eJMT-paper/fig/isac-Ztrans-math.pdf Binary file doc-isac/jrocnik/eJMT-paper/fig/isac-Ztrans-math.pdf has changed diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/eJMT-paper/fig/universe.pdf Binary file doc-isac/jrocnik/eJMT-paper/fig/universe.pdf has changed diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/eJMT-paper/jrocnik_eJMT.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/eJMT-paper/jrocnik_eJMT.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,2135 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Electronic Journal of Mathematics and Technology (eJMT) % +% style sheet for LaTeX. Please do not modify sections % +% or commands marked 'eJMT'. % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% eJMT commands % +% % +\documentclass[12pt,a4paper]{article}% % +\usepackage{times} % +\usepackage{amsfonts,amsmath,amssymb} % +\usepackage[a4paper]{geometry} % +\usepackage{fancyhdr} % +\usepackage{color} % +\usepackage[pdftex]{hyperref} % see note below % +\usepackage{graphicx}% % +\hypersetup{ % + a4paper, % + breaklinks % +} % +% % +\newtheorem{theorem}{Theorem} % +\newtheorem{acknowledgement}[theorem]{Acknowledgement} % +\newtheorem{algorithm}[theorem]{Algorithm} % +\newtheorem{axiom}[theorem]{Axiom} % +\newtheorem{case}[theorem]{Case} % +\newtheorem{claim}[theorem]{Claim} % +\newtheorem{conclusion}[theorem]{Conclusion} % +\newtheorem{condition}[theorem]{Condition} % +\newtheorem{conjecture}[theorem]{Conjecture} % +\newtheorem{corollary}[theorem]{Corollary} % +\newtheorem{criterion}[theorem]{Criterion} % +\newtheorem{definition}[theorem]{Definition} % +\newtheorem{example}[theorem]{Example} % +\newtheorem{exercise}[theorem]{Exercise} % +\newtheorem{lemma}[theorem]{Lemma} % +\newtheorem{notation}[theorem]{Notation} % +\newtheorem{problem}[theorem]{Problem} % +\newtheorem{proposition}[theorem]{Proposition} % +\newtheorem{remark}[theorem]{Remark} % +\newtheorem{solution}[theorem]{Solution} % +\newtheorem{summary}[theorem]{Summary} % +\newenvironment{proof}[1][Proof]{\noindent\textbf{#1.} } % +{\ \rule{0.5em}{0.5em}} % +% % +% eJMT page dimensions % +% % +\geometry{left=2cm,right=2cm,top=3.2cm,bottom=4cm} % +% % +% eJMT header & footer % +% % +\newcounter{ejmtFirstpage} % +\setcounter{ejmtFirstpage}{1} % +\pagestyle{empty} % +\setlength{\headheight}{14pt} % +\geometry{left=2cm,right=2cm,top=3.2cm,bottom=4cm} % +\pagestyle{fancyplain} % +\fancyhf{} % +\fancyhead[c]{\small The Electronic Journal of Mathematics% +\ and Technology, Volume 1, Number 1, ISSN 1933-2823} % +\cfoot{% % + \ifnum\value{ejmtFirstpage}=0% % + {\vtop to\hsize{\hrule\vskip .2cm\thepage}}% % + \else\setcounter{ejmtFirstpage}{0}\fi% % +} % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Please place your own definitions here +% +\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} +\def\sisac{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} + +\usepackage{color} +\definecolor{lgray}{RGB}{238,238,238} + +\usepackage{hyperref} + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% How to use hyperref % +% ------------------- % +% % +% Probably the only way you will need to use the hyperref % +% package is as follows. To make some text, say % +% "My Text Link", into a link to the URL % +% http://something.somewhere.com/mystuff, use % +% % +% \href{http://something.somewhere.com/mystuff}{My Text Link} +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +\begin{document} +% +% document title +% +\title{Trials with TP-based Programming +\\ +for Interactive Course Material}% +% +% Single author. Please supply at least your name, +% email address, and affiliation here. +% +\author{\begin{tabular}{c} +\textit{Jan Ro\v{c}nik} \\ +jan.rocnik@student.tugraz.at \\ +IST, SPSC\\ +Graz University of Technology\\ +Austria\end{tabular} +}% +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% eJMT commands - do not change these % +% % +\date{} % +\maketitle % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% abstract +% +\begin{abstract} + +Traditional course material in engineering disciplines lacks an +important component, interactive support for step-wise problem +solving. Theorem-Proving (TP) technology is appropriate for one part +of such support, in checking user-input. For the other part of such +support, guiding the learner towards a solution, another kind of +technology is required. + +Both kinds of support can be achieved by so-called +Lucas-Interpretation which combines deduction and computation and, for +the latter, uses a novel kind of programming language. This language +is based on (Computer) Theorem Proving (TP), thus called a ``TP-based +programming language''. + +This paper is the experience report of the first ``application +programmer'' using this language for creating exercises in step-wise +problem solving for an advanced lab in Signal Processing. The tasks +involved in TP-based programming are described together with the +experience gained from a prototype of the programming language and of +it's interpreter. + +The report concludes with a positive proof of concept, states +insufficiency usability of the prototype and captures the requirements +for further development of both, the programming language and the +interpreter. +% +\end{abstract}% +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% eJMT command % +% % +\thispagestyle{fancy} % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Please use the following to indicate sections, subsections, +% etc. Please also use \subsubsection{...}, \paragraph{...} +% and \subparagraph{...} as necessary. +% + +\section{Introduction}\label{intro} + +% \paragraph{Didactics of mathematics} +%WN: wenn man in einem high-quality paper von 'didactics' spricht, +%WN muss man am state-of-the-art ankn"upfen -- siehe +%WN W.Neuper, On the Emergence of TP-based Educational Math Assistants +% faces a specific issue, a gap +% between (1) introduction of math concepts and skills and (2) +% application of these concepts and skills, which usually are separated +% into different units in curricula (for good reasons). For instance, +% (1) teaching partial fraction decomposition is separated from (2) +% application for inverse Z-transform in signal processing. +% +% \par This gap is an obstacle for applying math as an fundamental +% thinking technology in engineering: In (1) motivation is lacking +% because the question ``What is this stuff good for?'' cannot be +% treated sufficiently, and in (2) the ``stuff'' is not available to +% students in higher semesters as widespread experience shows. +% +% \paragraph{Motivation} taken by this didactic issue on the one hand, +% and ongoing research and development on a novel kind of educational +% mathematics assistant at Graz University of +% Technology~\footnote{http://www.ist.tugraz.at/isac/} promising to +% scope with this issue on the other hand, several institutes are +% planning to join their expertise: the Institute for Information +% Systems and Computer Media (IICM), the Institute for Software +% Technology (IST), the Institutes for Mathematics, the Institute for +% Signal Processing and Speech Communication (SPSC), the Institute for +% Structural Analysis and the Institute of Electrical Measurement and +% Measurement Signal Processing. +%WN diese Information ist f"ur das Paper zu spezielle, zu aktuell +%WN und damit zu verg"anglich. +% \par This thesis is the first attempt to tackle the above mentioned +% issue, it focuses on Telematics, because these specific studies focus +% on mathematics in \emph{STEOP}, the introductory orientation phase in +% Austria. \emph{STEOP} is considered an opportunity to investigate the +% impact of {\sisac}'s prototype on the issue and others. +% + +Traditional course material in engineering disciplines lacks an +important component, interactive support for step-wise problem +solving. The lack becomes evident by comparing existing course +material with the sheets collected from written exams (in case solving +engineering problems is {\em not} deteriorated to multiple choice +tests) on the topics addressed by the materials. +Theorem-Proving (TP) technology can provide such support by +specific services. An important part of such services is called +``next-step-guidance'', generated by a specific kind of ``TP-based +programming language''. In the +{\sisac}-project~\footnote{http://www.ist.tugraz.at/projects/isac/} such +a language is prototyped in line with~\cite{plmms10} and built upon +the theorem prover Isabelle~\cite{Nipkow-Paulson-Wenzel:2002} +\footnote{http://isabelle.in.tum.de/}. +The TP services are coordinated by a specific interpreter for the +programming language, called +Lucas-Interpreter~\cite{wn:lucas-interp-12}. The language + will be briefly re-introduced in order to make the paper +self-contained. + +The main part of the paper is an account of first experiences +with programming in this TP-based language. The experience was gained +in a case study by the author. The author was considered an ideal +candidate for this study for the following reasons: as a student in +Telematics (computer science with focus on Signal Processing) he had +general knowledge in programming as well as specific domain knowledge +in Signal Processing; and he was {\em not} involved in the development of +{\sisac}'s programming language and interpreter, thus being a novice to the +language. + +The goals of the case study were: (1) to identify some TP-based programs for +interactive course material for a specific ``Advanced Signal +Processing Lab'' in a higher semester, (2) respective program +development with as little advice as possible from the {\sisac}-team and (3) +to document records and comments for the main steps of development in an +Isabelle theory; this theory should provide guidelines for future programmers. +An excerpt from this theory is the main part of this paper. +\par + +\medskip The major example resulting from the case study will be used +as running example throughout this paper. This example requires a +program resembling the size of real-world applications in engineering; +such a size was considered essential for the case study, since there +are many small programs for a long time (mainly concerned with +elementary Computer Algebra like simplification, equation solving, +calculus, etc.~\footnote{The programs existing in the {\sisac} +prototype are found at +http://www.ist.tugraz.at/projects/isac/www/kbase/met/index\_met.html}) + +\paragraph{The mathematical background of the running example} is the +following: In Signal Processing, ``the ${\cal Z}$-transform for +discrete-time signals is the counterpart of the Laplace transform for +continuous-time signals, and they each have a similar relationship to +the corresponding Fourier transform. One motivation for introducing +this generalization is that the Fourier transform does not converge +for all sequences, and it is useful to have a generalization of the +Fourier transform that encompasses a broader class of signals. A +second advantage is that in analytic problems, the ${\cal Z}$-transform +notation is often more convenient than the Fourier transform +notation.'' ~\cite[p. 128]{oppenheim2010discrete}. The ${\cal Z}$-transform +is defined as +\begin{equation*} +X(z)=\sum_{n=-\infty }^{\infty }x[n]z^{-n} +\end{equation*} +where a discrete time sequence $x[n]$ is transformed into the function +$X(z)$ where $z$ is a continuous complex variable. The inverse +function is addressed in the running example and can be determined by +the integral +\begin{equation*} +x[n]=\frac{1}{2\pi j} \oint_{C} X(z)\cdot z^{n-1} dz +\end{equation*} +where the letter $C$ represents a contour within the range of +convergence of the ${\cal Z}$-transform. The unit circle can be a special +case of this contour. Remember that $j$ is the complex number in the +domain of engineering. As this transform requires high effort to +be solved, tables of commonly used transform pairs are used in +education as well as in engineering practice; such tables can be found +at~\cite{wiki:1} or~\cite[Table~3.1]{oppenheim2010discrete} as well. +A completely solved and more detailed example can be found at +~\cite[p. 149f]{oppenheim2010discrete}. + +Following conventions in engineering education and in practice, the +running example solves the problem by use of a table. + +\paragraph{Support for interactive stepwise problem solving} in the +{\sisac} prototype is shown in Fig.\ref{fig-interactive}~\footnote{ Fig.\ref{fig-interactive} also shows the prototype status of {\sisac}; for instance, +the lack of 2-dimensional presentation and input of formulas is the major obstacle for field-tests in standard classes.}: +A student inputs formulas line by line on the \textit{``Worksheet''}, +and each step (i.e. each formula on completion) is immediately checked +by the system, such that at most {\em one inconsistent} formula can reside on +the Worksheet (on the input line, marked by the red $\otimes$). +\begin{figure} [htb] +\begin{center} +\includegraphics[width=140mm]{fig/isac-Ztrans-math-3} +%\includegraphics[width=140mm]{fig/isac-Ztrans-math} +\caption{Step-wise problem solving guided by the TP-based program +\label{fig-interactive}} +\end{center} +\end{figure} +If the student gets stuck and does not know the formula to proceed +with, there is the button \framebox{NEXT} presenting the next formula +on the Worksheet; this feature is called ``next-step-guidance''~\cite{wn:lucas-interp-12}. The button \framebox{AUTO} immediately delivers the +final result in case the student is not interested in intermediate +steps. + +Adaptive dialogue guidance is already under +construction~\cite{gdaroczy-EP-13} and the two buttons will disappear, +since their presence is not wanted in many learning scenarios (in +particular, {\em not} in written exams). + +The buttons \framebox{Theories}, \framebox{Problems} and +\framebox{Methods} are the entry points for interactive lookup of the +underlying knowledge. For instance, pushing \framebox{Theories} in +the configuration shown in Fig.\ref{fig-interactive}, pops up a +``Theory browser'' displaying the theorem(s) justifying the current +step. The browser allows to lookup all other theories, thus +supporting indepentend investigation of underlying definitions, +theorems, proofs --- where the HTML representation of the browsers is +ready for arbitrary multimedia add-ons. Likewise, the browsers for +\framebox{Problems} and \framebox{Methods} support context sensitive +as well as interactive access to specifications and programs +respectively. + +There is also a simple web-based representation of knowledge items; +the items under consideration in this paper can be looked up as +well +~\footnote{\href{http://www.ist.tugraz.at/projects/isac/www/kbase/thy/browser\_info/HOL/HOL-Real/Isac/Inverse\_Z\_Transform.thy}{http://www.ist.tugraz.at/projects/isac/www/kbase/thy/browser\_info/HOL/HOL-Real/Isac/\textbf{Inverse\_Z\_Transform.thy}}} +~\footnote{\href{http://www.ist.tugraz.at/projects/isac/www/kbase/thy/browser\_info/HOL/HOL-Real/Isac/Partial\_Fractions.thy}{http://www.ist.tugraz.at/projects/isac/www/kbase/thy/browser\_info/HOL/HOL-Real/Isac/\textbf{Partial\_Fractions.thy}}} +~\footnote{\href{http://www.ist.tugraz.at/projects/isac/www/kbase/thy/browser\_info/HOL/HOL-Real/Isac/Build\_Inverse\_Z\_Transform.thy}{http://www.ist.tugraz.at/projects/isac/www/kbase/thy/browser\_info/HOL/HOL-Real/Isac/\textbf{Build\_Inverse\_Z\_Transform.thy}}}. + +% can be explained by having a look at +% Fig.\ref{fig-interactive} which shows the beginning of the interactive +% construction of a solution for the problem. This construction is done in the +% right window named ``Worksheet''. +% \par +% User-interaction on the Worksheet is {\em checked} and {\em guided} by +% TP services: +% \begin{enumerate} +% \item Formulas input by the user are {\em checked} by TP: such a +% formula establishes a proof situation --- the prover has to derive the +% formula from the logical context. The context is built up from the +% formal specification of the problem (here hidden from the user) by the +% Lucas-Interpreter. +% \item If the user gets stuck, the program developed below in this +% paper ``knows the next step'' and Lucas-Interpretation provides services +% featuring so-called ``next-step-guidance''; this is out of scope of this +% paper and can be studied in~\cite{gdaroczy-EP-13}. +% \end{enumerate} It should be noted that the programmer using the +% TP-based language is not concerned with interaction at all; we will +% see that the program contains neither input-statements nor +% output-statements. Rather, interaction is handled by the interpreter +% of the language. +% +% So there is a clear separation of concerns: Dialogues are adapted by +% dialogue authors (in Java-based tools), using TP services provided by +% Lucas-Interpretation. The latter acts on programs developed by +% mathematics-authors (in Isabelle/ML); their task is concern of this +% paper. + +\bigskip The paper is structured as follows: The introduction +\S\ref{intro} is followed by a brief re-introduction of the TP-based +programming language in \S\ref{PL}, which extends the executable +fragment of Isabelle's language (\S\ref{PL-isab}) by tactics which +play a specific role in Lucas-Interpretation and in providing the TP +services (\S\ref{PL-tacs}). The main part \S\ref{trial} describes +the main steps in developing the program for the running example: +prepare domain knowledge, implement the formal specification of the +problem, prepare the environment for the interpreter, implement the +program in \S\ref{isabisac} to \S\ref{progr} respectively. +The work-flow of programming, debugging and testing is +described in \S\ref{workflow}. The conclusion \S\ref{conclusion} will +give directions identified for future development. + + +\section{\isac's Prototype for a Programming Language}\label{PL} +The prototype of the language and of the Lucas-Interpreter is briefly +described from the point of view of a programmer. The language extends +the executable fragment of Higher-Order Logic (HOL) in the theorem prover +Isabelle~\cite{Nipkow-Paulson-Wenzel:2002}\footnote{http://isabelle.in.tum.de/}. + +\subsection{The Executable Fragment of Isabelle's Language}\label{PL-isab} +The executable fragment consists of data-type and function +definitions. It's usability even suggests that fragment for +introductory courses \cite{nipkow-prog-prove}. HOL is a typed logic whose type system resembles that of functional programming +languages. Thus there are +\begin{description} +\item[base types,] in particular \textit{bool}, the type of truth +values, \textit{nat}, \textit{int}, \textit{complex}, and the types of +natural, integer and complex numbers respectively in mathematics. +\item[type constructors] allow to define arbitrary types, from +\textit{set}, \textit{list} to advanced data-structures like +\textit{trees}, red-black-trees etc. +\item[function types,] denoted by $\Rightarrow$. +\item[type variables,] denoted by $^\prime a, ^\prime b$ etc, provide +type polymorphism. Isabelle automatically computes the type of each +variable in a term by use of Hindley-Milner type inference +\cite{pl:hind97,Milner-78}. +\end{description} + +\textbf{Terms} are formed as in functional programming by applying +functions to arguments. If $f$ is a function of type +$\tau_1\Rightarrow \tau_2$ and $t$ is a term of type $\tau_1$ then +$f\;t$ is a term of type~$\tau_2$. $t\;::\;\tau$ means that term $t$ +has type $\tau$. There are many predefined infix symbols like $+$ and +$\leq$ most of which are overloaded for various types. + +HOL also supports some basic constructs from functional programming: +{\footnotesize\it\label{isabelle-stmts} +\begin{tabbing} 123\=\kill +01\>$( \; {\tt if} \; b \; {\tt then} \; t_1 \; {\tt else} \; t_2 \;)$\\ +02\>$( \; {\tt let} \; x=t \; {\tt in} \; u \; )$\\ +03\>$( \; {\tt case} \; t \; {\tt of} \; {\it pat}_1 + \Rightarrow t_1 \; |\dots| \; {\it pat}_n\Rightarrow t_n \; )$ +\end{tabbing}} +\noindent The running example's program uses some of these elements +(marked by {\tt tt-font} on p.\pageref{s:impl}): for instance {\tt +let}\dots{\tt in} in lines {\rm 02} \dots {\rm 13}. In fact, the whole program +is an Isabelle term with specific function constants like {\tt +program}, {\tt Take}, {\tt Rewrite}, {\tt Subproblem} and {\tt +Rewrite\_Set} in lines {\rm 01, 03. 04, 07, 10} and {\rm 11, 12} +respectively. + +% Terms may also contain $\lambda$-abstractions. For example, $\lambda +% x. \; x$ is the identity function. + +%JR warum auskommentiert? WN2... +%WN2 weil ein Punkt wie dieser in weiteren Zusammenh"angen innerhalb +%WN2 des Papers auftauchen m"usste; nachdem ich einen solchen +%WN2 Zusammenhang _noch_ nicht sehe, habe ich den Punkt _noch_ nicht +%WN2 gel"oscht. +%WN2 Wenn der Punkt nicht weiter gebraucht wird, nimmt er nur wertvollen +%WN2 Platz f"ur Anderes weg. + +\textbf{Formulae} are terms of type \textit{bool}. There are the basic +constants \textit{True} and \textit{False} and the usual logical +connectives (in decreasing order of precedence): $\neg, \land, \lor, +\rightarrow$. + +\textbf{Equality} is available in the form of the infix function $=$ +of type $a \Rightarrow a \Rightarrow {\it bool}$. It also works for +formulas, where it means ``if and only if''. + +\textbf{Quantifiers} are written $\forall x. \; P$ and $\exists x. \; +P$. Quantifiers lead to non-executable functions, so functions do not +always correspond to programs, for instance, if comprising \\$( +\;{\it if} \; \exists x.\;P \; {\it then} \; e_1 \; {\it else} \; e_2 +\;)$. + +\subsection{\isac's Tactics for Lucas-Interpretation}\label{PL-tacs} +The prototype extends Isabelle's language by specific statements +called tactics~\footnote{{\sisac}'s. These tactics are different from +Isabelle's tactics: the former concern steps in a calculation, the +latter concern proofs.}. For the programmer these +statements are functions with the following signatures: + +\begin{description} +\item[Rewrite:] ${\it theorem}\Rightarrow{\it term}\Rightarrow{\it +term} * {\it term}\;{\it list}$: +this tactic applies {\it theorem} to a {\it term} yielding a {\it +term} and a {\it term list}, the list are assumptions generated by +conditional rewriting. For instance, the {\it theorem} +$b\not=0\land c\not=0\Rightarrow\frac{a\cdot c}{b\cdot c}=\frac{a}{b}$ +applied to the {\it term} $\frac{2\cdot x}{3\cdot x}$ yields +$(\frac{2}{3}, [x\not=0])$. + +\item[Rewrite\_Set:] ${\it ruleset}\Rightarrow{\it +term}\Rightarrow{\it term} * {\it term}\;{\it list}$: +this tactic applies {\it ruleset} to a {\it term}; {\it ruleset} is +a confluent and terminating term rewrite system, in general. If +none of the rules ({\it theorem}s) is applicable on interpretation +of this tactic, an exception is thrown. + +% \item[Rewrite\_Inst:] ${\it substitution}\Rightarrow{\it +% theorem}\Rightarrow{\it term}\Rightarrow{\it term} * {\it term}\;{\it +% list}$: +% +% \item[Rewrite\_Set\_Inst:] ${\it substitution}\Rightarrow{\it +% ruleset}\Rightarrow{\it term}\Rightarrow{\it term} * {\it term}\;{\it +% list}$: + +%SPACEvvv +\item[Substitute:] ${\it substitution}\Rightarrow{\it +term}\Rightarrow{\it term}$: allows to access sub-terms. +%SPACE^^^ + +\item[Take:] ${\it term}\Rightarrow{\it term}$: +this tactic has no effect in the program; but it creates a side-effect +by Lucas-Interpretation (see below) and writes {\it term} to the +Worksheet. + +\item[Subproblem:] ${\it theory} * {\it specification} * {\it +method}\Rightarrow{\it argument}\;{\it list}\Rightarrow{\it term}$: +this tactic is a generalisation of a function call: it takes an +\textit{argument list} as usual, and additionally a triple consisting +of an Isabelle \textit{theory}, an implicit \textit{specification} of the +program and a \textit{method} containing data for Lucas-Interpretation, +last not least a program (as an explicit specification)~\footnote{In +interactive tutoring these three items can be determined explicitly +by the user.}. +\end{description} +The tactics play a specific role in +Lucas-Interpretation~\cite{wn:lucas-interp-12}: they are treated as +break-points where, as a side-effect, a line is added to a calculation +as a protocol for proceeding towards a solution in step-wise problem +solving. At the same points Lucas-Interpretation serves interactive +tutoring and hands over control to the user. The user is free to +investigate underlying knowledge, applicable theorems, etc. And the +user can proceed constructing a solution by input of a tactic to be +applied or by input of a formula; in the latter case the +Lucas-Interpreter has built up a logical context (initialised with the +precondition of the formal specification) such that Isabelle can +derive the formula from this context --- or give feedback, that no +derivation can be found. + +\subsection{Tactics as Control Flow Statements} +The flow of control in a program can be determined by {\tt if then else} +and {\tt case of} as mentioned on p.\pageref{isabelle-stmts} and also +by additional tactics: +\begin{description} +\item[Repeat:] ${\it tactic}\Rightarrow{\it term}\Rightarrow{\it +term}$: iterates over tactics which take a {\it term} as argument as +long as a tactic is applicable (for instance, {\tt Rewrite\_Set} might +not be applicable). + +\item[Try:] ${\it tactic}\Rightarrow{\it term}\Rightarrow{\it term}$: +if {\it tactic} is applicable, then it is applied to {\it term}, +otherwise {\it term} is passed on without changes. + +\item[Or:] ${\it tactic}\Rightarrow{\it tactic}\Rightarrow{\it +term}\Rightarrow{\it term}$: If the first {\it tactic} is applicable, +it is applied to the first {\it term} yielding another {\it term}, +otherwise the second {\it tactic} is applied; if none is applicable an +exception is raised. + +\item[@@:] ${\it tactic}\Rightarrow{\it tactic}\Rightarrow{\it +term}\Rightarrow{\it term}$: applies the first {\it tactic} to the +first {\it term} yielding an intermediate term (not appearing in the +signature) to which the second {\it tactic} is applied. + +\item[While:] ${\it term::bool}\Rightarrow{\it tactic}\Rightarrow{\it +term}\Rightarrow{\it term}$: if the first {\it term} is true, then the +{\it tactic} is applied to the first {\it term} yielding an +intermediate term (not appearing in the signature); the intermediate +term is added to the environment the first {\it term} is evaluated in +etc. as long as the first {\it term} is true. +\end{description} +The tactics are not treated as break-points by Lucas-Interpretation +and thus do neither contribute to the calculation nor to interaction. + +\section{Concepts and Tasks in TP-based Programming}\label{trial} +%\section{Development of a Program on Trial} + +This section presents all the concepts involved in TP-based +programming and all the tasks to be accomplished by programmers. The +presentation uses the running example from +Fig.\ref{fig-interactive} on p.\pageref{fig-interactive}. + +\subsection{Mechanization of Math --- Domain Engineering}\label{isabisac} + +%WN was Fachleute unter obigem Titel interessiert findet sich +%WN unterhalb des auskommentierten Textes. + +%WN der Text unten spricht Benutzer-Aspekte anund ist nicht speziell +%WN auf Computer-Mathematiker fokussiert. +% \paragraph{As mentioned in the introduction,} a prototype of an +% educational math assistant called +% {{\sisac}}\footnote{{{\sisac}}=\textbf{Isa}belle for +% \textbf{C}alculations, see http://www.ist.tugraz.at/isac/.} bridges +% the gap between (1) introducation and (2) application of mathematics: +% {{\sisac}} is based on Computer Theorem Proving (TP), a technology which +% requires each fact and each action justified by formal logic, so +% {{{\sisac}{}}} makes justifications transparent to students in +% interactive step-wise problem solving. By that way {{\sisac}} already +% can serve both: +% \begin{enumerate} +% \item Introduction of math stuff (in e.g. partial fraction +% decomposition) by stepwise explaining and exercising respective +% symbolic calculations with ``next step guidance (NSG)'' and rigorously +% checking steps freely input by students --- this also in context with +% advanced applications (where the stuff to be taught in higher +% semesters can be skimmed through by NSG), and +% \item Application of math stuff in advanced engineering courses +% (e.g. problems to be solved by inverse Z-transform in a Signal +% Processing Lab) and now without much ado about basic math techniques +% (like partial fraction decomposition): ``next step guidance'' supports +% students in independently (re-)adopting such techniques. +% \end{enumerate} +% Before the question is answers, how {{\sisac}} +% accomplishes this task from a technical point of view, some remarks on +% the state-of-the-art is given, therefor follow up Section~\ref{emas}. +% +% \subsection{Educational Mathematics Assistants (EMAs)}\label{emas} +% +% \paragraph{Educational software in mathematics} is, if at all, based +% on Computer Algebra Systems (CAS, for instance), Dynamic Geometry +% Systems (DGS, for instance \footnote{GeoGebra http://www.geogebra.org} +% \footnote{Cinderella http://www.cinderella.de/}\footnote{GCLC +% http://poincare.matf.bg.ac.rs/~janicic/gclc/}) or spread-sheets. These +% base technologies are used to program math lessons and sometimes even +% exercises. The latter are cumbersome: the steps towards a solution of +% such an interactive exercise need to be provided with feedback, where +% at each step a wide variety of possible input has to be foreseen by +% the programmer - so such interactive exercises either require high +% development efforts or the exercises constrain possible inputs. +% +% \subparagraph{A new generation} of educational math assistants (EMAs) +% is emerging presently, which is based on Theorem Proving (TP). TP, for +% instance Isabelle and Coq, is a technology which requires each fact +% and each action justified by formal logic. Pushed by demands for +% \textit{proven} correctness of safety-critical software TP advances +% into software engineering; from these advancements computer +% mathematics benefits in general, and math education in particular. Two +% features of TP are immediately beneficial for learning: +% +% \paragraph{TP have knowledge in human readable format,} that is in +% standard predicate calculus. TP following the LCF-tradition have that +% knowledge down to the basic definitions of set, equality, +% etc~\footnote{http://isabelle.in.tum.de/dist/library/HOL/HOL.html}; +% following the typical deductive development of math, natural numbers +% are defined and their properties +% proven~\footnote{http://isabelle.in.tum.de/dist/library/HOL/Number\_Theory/Primes.html}, +% etc. Present knowledge mechanized in TP exceeds high-school +% mathematics by far, however by knowledge required in software +% technology, and not in other engineering sciences. +% +% \paragraph{TP can model the whole problem solving process} in +% mathematical problem solving {\em within} a coherent logical +% framework. This is already being done by three projects, by +% Ralph-Johan Back, by ActiveMath and by Carnegie Mellon Tutor. +% \par +% Having the whole problem solving process within a logical coherent +% system, such a design guarantees correctness of intermediate steps and +% of the result (which seems essential for math software); and the +% second advantage is that TP provides a wealth of theories which can be +% exploited for mechanizing other features essential for educational +% software. +% +% \subsubsection{Generation of User Guidance in EMAs}\label{user-guid} +% +% One essential feature for educational software is feedback to user +% input and assistance in coming to a solution. +% +% \paragraph{Checking user input} by ATP during stepwise problem solving +% is being accomplished by the three projects mentioned above +% exclusively. They model the whole problem solving process as mentioned +% above, so all what happens between formalized assumptions (or formal +% specification) and goal (or fulfilled postcondition) can be +% mechanized. Such mechanization promises to greatly extend the scope of +% educational software in stepwise problem solving. +% +% \paragraph{NSG (Next step guidance)} comprises the system's ability to +% propose a next step; this is a challenge for TP: either a radical +% restriction of the search space by restriction to very specific +% problem classes is required, or much care and effort is required in +% designing possible variants in the process of problem solving +% \cite{proof-strategies-11}. +% \par +% Another approach is restricted to problem solving in engineering +% domains, where a problem is specified by input, precondition, output +% and postcondition, and where the postcondition is proven by ATP behind +% the scenes: Here the possible variants in the process of problem +% solving are provided with feedback {\em automatically}, if the problem +% is described in a TP-based programing language: \cite{plmms10} the +% programmer only describes the math algorithm without caring about +% interaction (the respective program is functional and even has no +% input or output statements!); interaction is generated as a +% side-effect by the interpreter --- an efficient separation of concern +% between math programmers and dialog designers promising application +% all over engineering disciplines. +% +% +% \subsubsection{Math Authoring in Isabelle/ISAC\label{math-auth}} +% Authoring new mathematics knowledge in {{\sisac}} can be compared with +% ``application programing'' of engineering problems; most of such +% programing uses CAS-based programing languages (CAS = Computer Algebra +% Systems; e.g. Mathematica's or Maple's programing language). +% +% \paragraph{A novel type of TP-based language} is used by {{\sisac}{}} +% \cite{plmms10} for describing how to construct a solution to an +% engineering problem and for calling equation solvers, integration, +% etc~\footnote{Implementation of CAS-like functionality in TP is not +% primarily concerned with efficiency, but with a didactic question: +% What to decide for: for high-brow algorithms at the state-of-the-art +% or for elementary algorithms comprehensible for students?} within TP; +% TP can ensure ``systems that never make a mistake'' \cite{casproto} - +% are impossible for CAS which have no logics underlying. +% +% \subparagraph{Authoring is perfect} by writing such TP based programs; +% the application programmer is not concerned with interaction or with +% user guidance: this is concern of a novel kind of program interpreter +% called Lucas-Interpreter. This interpreter hands over control to a +% dialog component at each step of calculation (like a debugger at +% breakpoints) and calls automated TP to check user input following +% personalized strategies according to a feedback module. +% \par +% However ``application programing with TP'' is not done with writing a +% program: according to the principles of TP, each step must be +% justified. Such justifications are given by theorems. So all steps +% must be related to some theorem, if there is no such theorem it must +% be added to the existing knowledge, which is organized in so-called +% \textbf{theories} in Isabelle. A theorem must be proven; fortunately +% Isabelle comprises a mechanism (called ``axiomatization''), which +% allows to omit proofs. Such a theorem is shown in +% Example~\ref{eg:neuper1}. + +The running example requires to determine the inverse ${\cal Z}$-transform +for a class of functions. The domain of Signal Processing +is accustomed to specific notation for the resulting functions, which +are absolutely capable of being totalled and are called step-response: $u[n]$, where $u$ is the +function, $n$ is the argument and the brackets indicate that the +arguments are discrete. Surprisingly, Isabelle accepts the rules for +$z^{-1}$ in this traditional notation~\footnote{Isabelle +experts might be particularly surprised, that the brackets do not +cause errors in typing (as lists).}: +%\vbox{ +% \begin{example} + \label{eg:neuper1} + {\footnotesize\begin{tabbing} + 123\=123\=123\=123\=\kill + + 01\>axiomatization where \\ + 02\>\> rule1: ``$z^{-1}\;1 = \delta [n]$'' and\\ + 03\>\> rule2: ``$\vert\vert z \vert\vert > 1 \Rightarrow z^{-1}\;z / (z - 1) = u [n]$'' and\\ + 04\>\> rule3: ``$\vert\vert z \vert\vert < 1 \Rightarrow z / (z - 1) = -u [-n - 1]$'' and \\ + 05\>\> rule4: ``$\vert\vert z \vert\vert > \vert\vert$ $\alpha$ $\vert\vert \Rightarrow z / (z - \alpha) = \alpha^n \cdot u [n]$'' and\\ + 06\>\> rule5: ``$\vert\vert z \vert\vert < \vert\vert \alpha \vert\vert \Rightarrow z / (z - \alpha) = -(\alpha^n) \cdot u [-n - 1]$'' and\\ + 07\>\> rule6: ``$\vert\vert z \vert\vert > 1 \Rightarrow z/(z - 1)^2 = n \cdot u [n]$'' + \end{tabbing}} +% \end{example} +%} +These 6 rules can be used as conditional rewrite rules, depending on +the respective convergence radius. Satisfaction from accordance with traditional +notation contrasts with the above word {\em axiomatization}: As TP-based, the +programming language expects these rules as {\em proved} theorems, and +not as axioms implemented in the above brute force manner; otherwise +all the verification efforts envisaged (like proof of the +post-condition, see below) would be meaningless. + +Isabelle provides a large body of knowledge, rigorously proved from +the basic axioms of mathematics~\footnote{This way of rigorously +deriving all knowledge from first principles is called the +LCF-paradigm in TP.}. In the case of the ${\cal Z}$-transform the most advanced +knowledge can be found in the theories on Multivariate +Analysis~\footnote{http://isabelle.in.tum.de/dist/library/HOL/HOL-Multivariate\_Analysis}. However, +building up knowledge such that a proof for the above rules would be +reasonably short and easily comprehensible, still requires lots of +work (and is definitely out of scope of our case study). + +%REMOVED DUE TO SPACE CONSTRAINTS +%At the state-of-the-art in mechanization of knowledge in engineering +%sciences, the process does not stop with the mechanization of +%mathematics traditionally used in these sciences. Rather, ``Formal +%Methods''~\cite{ fm-03} are expected to proceed to formal and explicit +%description of physical items. Signal Processing, for instance is +%concerned with physical devices for signal acquisition and +%reconstruction, which involve measuring a physical signal, storing it, +%and possibly later rebuilding the original signal or an approximation +%thereof. For digital systems, this typically includes sampling and +%quantization; devices for signal compression, including audio +%compression, image compression, and video compression, etc. ``Domain +%engineering''\cite{db:dom-eng} is concerned with {\em specification} +%of these devices' components and features; this part in the process of +%mechanization is only at the beginning in domains like Signal +%Processing. +% +%TP-based programming, concern of this paper, is determined to +%add ``algorithmic knowledge'' to the mechanised body of knowledge. +%% in Fig.\ref{fig:mathuni} on +%% p.\pageref{fig:mathuni}. As we shall see below, TP-based programming +%% starts with a formal {\em specification} of the problem to be solved. +%% \begin{figure} +%% \begin{center} +%% \includegraphics[width=110mm]{../../fig/jrocnik/math-universe-small} +%% \caption{The three-dimensional universe of mathematics knowledge} +%% \label{fig:mathuni} +%% \end{center} +%% \end{figure} +%% The language for both axes is defined in the axis at the bottom, deductive +%% knowledge, in {\sisac} represented by Isabelle's theories. + +\subsection{Preparation of Simplifiers for the Program}\label{simp} + +All evaluation in the prototype's Lucas-Interpreter is done by term rewriting on +Isabelle's terms, see \S\ref{meth} below; in this section some of respective +preparations are described. In order to work reliably with term rewriting, the +respective rule-sets must be confluent and terminating~\cite{nipk:rew-all-that}, +then they are called (canonical) simplifiers. These properties do not go without +saying, their establishment is a difficult task for the programmer; this task is +not yet supported in the prototype. + +The prototype rewrites using theorems only. Axioms which are theorems as well +have been already shown in \S\ref{eg:neuper1} on p.\pageref{eg:neuper1} , we +assemble them in a rule-set and apply them in ML as follows: + +{\footnotesize +\begin{verbatim} + 01 val inverse_z = Rls + 02 {id = "inverse_z", + 03 rew_ord = dummy_ord, + 04 erls = Erls, + 05 rules = [Thm ("rule1", @{thm rule1}), Thm ("rule2", @{thm rule1}), + 06 Thm ("rule3", @{thm rule3}), Thm ("rule4", @{thm rule4}), + 07 Thm ("rule5", @{thm rule5}), Thm ("rule6", @{thm rule6})], + 08 errpatts = [], + 09 scr = ""} +\end{verbatim}} + +\noindent The items, line by line, in the above record have the following purpose: +\begin{description} +\item[01..02] the ML-value \textit{inverse\_z} stores it's identifier +as a string for ``reflection'' when switching between the language +layers of Isabelle/ML (like in the Lucas-Interpreter) and +Isabelle/Isar (like in the example program on p.\pageref{s:impl} on +line {\rm 12}). + +\item[03..04] both, (a) the rewrite-order~\cite{nipk:rew-all-that} +\textit{rew\_ord} and (b) the rule-set \textit{erls} are trivial here: +(a) the \textit{rules} in {\rm 07..12} don't need ordered rewriting +and (b) the assumptions of the \textit{rules} need not be evaluated +(they just go into the context during rewriting). + +\item[05..07] the \textit{rules} are the axioms from p.\pageref{eg:neuper1}; +also ML-functions (\S\ref{funs}) can come into this list as shown in +\S\ref{flow-prep}; so they are distinguished by type-constructors \textit{Thm} +and \textit{Calc} respectively; for the purpose of reflection both +contain their identifiers. + +\item[08..09] are error-patterns not discussed here and \textit{scr} +is prepared to get a program, automatically generated by {\sisac} for +producing intermediate rewrites when requested by the user. + +\end{description} + +%OUTCOMMENTED DUE TO SPACE RESTRICTIONS +% \noindent It is advisable to immediately test rule-sets; for that +% purpose an appropriate term has to be created; \textit{parse} takes a +% context \textit{ctxt} and a string (with \textit{ZZ\_1} denoting ${\cal +% Z}^{-1}$) and creates a term: +% +% {\footnotesize +% \begin{verbatim} +% 01 ML {* +% 02 val t = parse ctxt "ZZ_1 (z / (z - 1) + z / (z - ) + 1)"; +% 03 *} +% 04 val t = Const ("Build_Inverse_Z_Transform.ZZ_1", +% 05 "RealDef.real => RealDef.real => RealDef.real") $ +% 06 (Const (...) $ (Const (...) $ Free (...) $ (Const (...) $ Free (...) +% \end{verbatim}} +% +% \noindent The internal representation of the term, as required for +% rewriting, consists of \textit{Const}ants, a pair of a string +% \textit{"Groups.plus\_class.plus"} for $+$ and a type, variables +% \textit{Free} and the respective constructor \textit{\$}. Now the +% term can be rewritten by the rule-set \textit{inverse\_z}: +% +% {\footnotesize +% \begin{verbatim} +% 01 ML {* +% 02 val SOME (t', asm) = rewrite_set_ @{theory} inverse\_z t; +% 03 term2str t'; +% 04 terms2str asm; +% 05 *} +% 06 val it = "u[n] + ^ n * u[n] + [n]" : string +% 07 val it = "|| z || > 1 & || z || > " : string +% \end{verbatim}} +% +% \noindent The resulting term \textit{t} and the assumptions +% \textit{asm} are converted to readable strings by \textit{term2str} +% and \textit{terms2str}. + +\subsection{Preparation of ML-Functions}\label{funs} +Some functionality required in programming, cannot be accomplished by +rewriting. So the prototype has a mechanism to call functions within +the rewrite-engine: certain redexes in Isabelle terms call these +functions written in SML~\cite{pl:milner97}, the implementation {\em +and} meta-language of Isabelle. The programmer has to use this +mechanism. + +In the running example's program on p.\pageref{s:impl} the lines {\rm +05} and {\rm 06} contain such functions; we go into the details with +\textit{argument\_in X\_z;}. This function fetches the argument from a +function application: Line {\rm 03} in the example calculation on +p.\pageref{exp-calc} is created by line {\rm 06} of the example +program on p.\pageref{s:impl} where the program's environment assigns +the value \textit{X z} to the variable \textit{X\_z}; so the function +shall extract the argument \textit{z}. + +\medskip In order to be recognised as a function constant in the +program source the constant needs to be declared in a theory, here in +\textit{Build\_Inverse\_Z\_Transform.thy}; then it can be parsed in +the context \textit{ctxt} of that theory: + +{\footnotesize +\begin{verbatim} +01 consts +02 argument'_in :: "real => real" ("argument'_in _" 10) +\end{verbatim}} + +%^3.2^ ML {* val SOME t = parse ctxt "argument_in (X z)"; *} +%^3.2^ val t = Const ("Build_Inverse_Z_Transform.argument'_in", "RealDef.real ⇒ RealDef.real") +%^3.2^ $ (Free ("X", "RealDef.real ⇒ RealDef.real") $ Free ("z", "RealDef.real")): term +%^3.2^ \end{verbatim}} +%^3.2^ +%^3.2^ \noindent Parsing produces a term \texttt{t} in internal +%^3.2^ representation~\footnote{The attentive reader realizes the +%^3.2^ differences between interal and extermal representation even in the +%^3.2^ strings, i.e \texttt{'\_}}, consisting of \texttt{Const +%^3.2^ ("argument'\_in", type)} and the two variables \texttt{Free ("X", +%^3.2^ type)} and \texttt{Free ("z", type)}, \texttt{\$} is the term +%^3.2^ constructor. +The function body below is implemented directly in SML, +i.e in an \texttt{ML \{* *\}} block; the function definition provides +a unique prefix \texttt{eval\_} to the function name: + +{\footnotesize +\begin{verbatim} +01 ML {* +02 fun eval_argument_in _ +03 "Build_Inverse_Z_Transform.argument'_in" +04 (t as (Const ("Build_Inverse_Z_Transform.argument'_in", _) $(f $arg))) _ = +05 if is_Free arg (*could be something to be simplified before*) +06 then SOME (term2str t ^"="^ term2str arg, Trueprop $(mk_equality (t, arg))) +07 else NONE +08 | eval_argument_in _ _ _ _ = NONE; +09 *} +\end{verbatim}} + +\noindent The function body creates either \texttt{NONE} +telling the rewrite-engine to search for the next redex, or creates an +ad-hoc theorem for rewriting, thus the programmer needs to adopt many +technicalities of Isabelle, for instance, the \textit{Trueprop} +constant. + +\bigskip This sub-task particularly sheds light on basic issues in the +design of a programming language, the integration of differential language +layers, the layer of Isabelle/Isar and Isabelle/ML. + +Another point of improvement for the prototype is the rewrite-engine: The +program on p.\pageref{s:impl} would not allow to contract the two lines {\rm 05} +and {\rm 06} to + +{\small\it\label{s:impl} +\begin{tabbing} +123l\=123\=123\=123\=123\=123\=123\=((x\=123\=(x \=123\=123\=\kill +\>{\rm 05/06}\>\>\> (z::real) = argument\_in (lhs X\_eq) ; +\end{tabbing}} + +\noindent because nested function calls would require creating redexes +inside-out; however, the prototype's rewrite-engine only works top down +from the root of a term down to the leaves. + +How all these technicalities are to be checked in the prototype is +shown in \S\ref{flow-prep} below. + +% \paragraph{Explicit Problems} require explicit methods to solve them, and within +% this methods we have some explicit steps to do. This steps can be unique for +% a special problem or refindable in other problems. No mather what case, such +% steps often require some technical functions behind. For the solving process +% of the Inverse Z Transformation and the corresponding partial fraction it was +% neccessary to build helping functions like \texttt{get\_denominator}, +% \texttt{get\_numerator} or \texttt{argument\_in}. First two functions help us +% to filter the denominator or numerator out of a fraction, last one helps us to +% get to know the bound variable in a equation. +% \par +% By taking \texttt{get\_denominator} as an example, we want to explain how to +% implement new functions into the existing system and how we can later use them +% in our program. +% +% \subsubsection{Find a place to Store the Function} +% +% The whole system builds up on a well defined structure of Knowledge. This +% Knowledge sets up at the Path: +% \begin{center}\ttfamily src/Tools/isac/Knowledge\normalfont\end{center} +% For implementing the Function \texttt{get\_denominator} (which let us extract +% the denominator out of a fraction) we have choosen the Theory (file) +% \texttt{Rational.thy}. +% +% \subsubsection{Write down the new Function} +% +% In upper Theory we now define the new function and its purpose: +% \begin{verbatim} +% get_denominator :: "real => real" +% \end{verbatim} +% This command tells the machine that a function with the name +% \texttt{get\_denominator} exists which gets a real expression as argument and +% returns once again a real expression. Now we are able to implement the function +% itself, upcoming example now shows the implementation of +% \texttt{get\_denominator}. +% +% %\begin{example} +% \label{eg:getdenom} +% \begin{verbatim} +% +% 01 (* +% 02 *("get_denominator", +% 03 * ("Rational.get_denominator", eval_get_denominator "")) +% 04 *) +% 05 fun eval_get_denominator (thmid:string) _ +% 06 (t as Const ("Rational.get_denominator", _) $ +% 07 (Const ("Rings.inverse_class.divide", _) $num +% 08 $denom)) thy = +% 09 SOME (mk_thmid thmid "" +% 10 (Print_Mode.setmp [] +% 11 (Syntax.string_of_term (thy2ctxt thy)) denom) "", +% 12 Trueprop $ (mk_equality (t, denom))) +% 13 | eval_get_denominator _ _ _ _ = NONE;\end{verbatim} +% %\end{example} +% +% Line \texttt{07} and \texttt{08} are describing the mode of operation the best - +% there is a fraction\\ (\ttfamily Rings.inverse\_class.divide\normalfont) +% splittet +% into its two parts (\texttt{\$num \$denom}). The lines before are additionals +% commands for declaring the function and the lines after are modeling and +% returning a real variable out of \texttt{\$denom}. +% +% \subsubsection{Add a test for the new Function} +% +% \paragraph{Everytime when adding} a new function it is essential also to add +% a test for it. Tests for all functions are sorted in the same structure as the +% knowledge it self and can be found up from the path: +% \begin{center}\ttfamily test/Tools/isac/Knowledge\normalfont\end{center} +% This tests are nothing very special, as a first prototype the functionallity +% of a function can be checked by evaluating the result of a simple expression +% passed to the function. Example~\ref{eg:getdenomtest} shows the test for our +% \textit{just} created function \texttt{get\_denominator}. +% +% %\begin{example} +% \label{eg:getdenomtest} +% \begin{verbatim} +% +% 01 val thy = @{theory Isac}; +% 02 val t = term_of (the (parse thy "get_denominator ((a +x)/b)")); +% 03 val SOME (_, t') = eval_get_denominator "" 0 t thy; +% 04 if term2str t' = "get_denominator ((a + x) / b) = b" then () +% 05 else error "get_denominator ((a + x) / b) = b" \end{verbatim} +% %\end{example} +% +% \begin{description} +% \item[01] checks if the proofer set up on our {\sisac{}} System. +% \item[02] passes a simple expression (fraction) to our suddenly created +% function. +% \item[04] checks if the resulting variable is the correct one (in this case +% ``b'' the denominator) and returns. +% \item[05] handels the error case and reports that the function is not able to +% solve the given problem. +% \end{description} + +\subsection{Specification of the Problem}\label{spec} +%WN <--> \chapter 7 der Thesis +%WN die Argumentation unten sollte sich NUR auf Verifikation beziehen.. + +Mechanical treatment requires to translate a textual problem +description like in Fig.\ref{fig-interactive} on +p.\pageref{fig-interactive} into a {\em formal} specification. The +formal specification of the running example could look like is this +~\footnote{The ``TODO'' in the postcondition indicates, that postconditions +are not yet handled in the prototype; in particular, the postcondition, i.e. +the correctness of the result is not yet automatically proved.}: + +%WN Hier brauchen wir die Spezifikation des 'running example' ... +%JR Habe input, output und precond vom Beispiel eingefügt brauche aber Hilfe bei +%JR der post condition - die existiert für uns ja eigentlich nicht aka +%JR haben sie bis jetzt nicht beachtet WN... +%WN2 Mein Vorschlag ist, das TODO zu lassen und deutlich zu kommentieren. +%JR2 done + +\label{eg:neuper2} +{\small\begin{tabbing} + 123\=123\=postcond \=: \= $\forall \,A^\prime\, u^\prime \,v^\prime.\,$\=\kill + %\hfill \\ + \>Specification:\\ + \> \>input \>: ${\it filterExpression} \;\;X\;z=\frac{3}{z-\frac{1}{4}+-\frac{1}{8}*\frac{1}{z}}, \;{\it domain}\;\mathbb{R}-\{\frac{1}{2}, \frac{-1}{4}\}$\\ + \>\>precond \>: $\frac{3}{z-\frac{1}{4}+-\frac{1}{8}*\frac{1}{z}}\;\; {\it continuous\_on}\; \mathbb{R}-\{\frac{1}{2}, \frac{-1}{4}\}$ \\ + \>\>output \>: stepResponse $x[n]$ \\ + \>\>postcond \>: TODO +\end{tabbing}} + +%JR wie besprochen, kein remark, keine begründung, nur simples "nicht behandelt" + +% \begin{remark} +% Defining the postcondition requires a high amount mathematical +% knowledge, the difficult part in our case is not to set up this condition +% nor it is more to define it in a way the interpreter is able to handle it. +% Due the fact that implementing that mechanisms is quite the same amount as +% creating the programm itself, it is not avaible in our prototype. +% \label{rm:postcond} +% \end{remark} + +The implementation of the formal specification in the present +prototype, still bar-bones without support for authoring, is done +like that: +%WN Kopie von Inverse_Z_Transform.thy, leicht versch"onert: + +{\footnotesize\label{exp-spec} +\begin{verbatim} + 00 ML {* + 01 store_specification + 02 (prepare_specification + 03 "pbl_SP_Ztrans_inv" + 04 ["Jan Rocnik"] + 05 thy + 06 ( ["Inverse", "Z_Transform", "SignalProcessing"], + 07 [ ("#Given", ["filterExpression X_eq", "domain D"]), + 08 ("#Pre" , ["(rhs X_eq) is_continuous_in D"]), + 09 ("#Find" , ["stepResponse n_eq"]), + 10 ("#Post" , [" TODO "])]) + 11 prls + 12 NONE + 13 [["SignalProcessing","Z_Transform","Inverse"]]); + 14 *} +\end{verbatim}} + +Although the above details are partly very technical, we explain them +in order to document some intricacies of TP-based programming in the +present state of the {\sisac} prototype: +\begin{description} +\item[01..02]\textit{store\_specification:} stores the result of the +function \textit{prep\_specification} in a global reference +\textit{Unsynchronized.ref}, which causes principal conflicts with +Isabelle's asynchronous document model~\cite{Wenzel-11:doc-orient} and +parallel execution~\cite{Makarius-09:parall-proof} and is under +reconstruction already. + +\textit{prep\_specification:} translates the specification to an internal format +which allows efficient processing; see for instance line {\rm 07} +below. +\item[03..04] are a unique identifier for the specification within {\sisac} +and the ``mathematics author'' holding the copy-rights. +\item[05] is the Isabelle \textit{theory} required to parse the +specification in lines {\rm 07..10}. +\item[06] is a key into the tree of all specifications as presented to +the user (where some branches might be hidden by the dialogue +component). +\item[07..10] are the specification with input, pre-condition, output +and post-condition respectively; note that the specification contains +variables to be instantiated with concrete values for a concrete problem --- +thus the specification actually captures a class of problems. The post-condition is not handled in +the prototype presently. +\item[11] is a rule-set (defined elsewhere) for evaluation of the pre-condition: \textit{(rhs X\_eq) is\_continuous\_in D}, instantiated with the values of a concrete problem, evaluates to true or false --- and all evaluation is done by +rewriting determined by rule-sets. +\item[12]\textit{NONE:} could be \textit{SOME ``solve ...''} for a +problem associated to a function from Computer Algebra (like an +equation solver) which is not the case here. +\item[13] is a list of methods solving the specified problem (here +only one list item) represented analogously to {\rm 06}. +\end{description} + + +%WN die folgenden Erkl"arungen finden sich durch "grep -r 'datatype pbt' *" +%WN ... +% type pbt = +% {guh : guh, (*unique within this isac-knowledge*) +% mathauthors: string list, (*copyright*) +% init : pblID, (*to start refinement with*) +% thy : theory, (* which allows to compile that pbt +% TODO: search generalized for subthy (ref.p.69*) +% (*^^^ WN050912 NOT used during application of the problem, +% because applied terms may be from 'subthy' as well as from super; +% thus we take 'maxthy'; see match_ags !*) +% cas : term option,(*'CAS-command'*) +% prls : rls, (* for preds in where_*) +% where_: term list, (* where - predicates*) +% ppc : pat list, +% (*this is the model-pattern; +% it contains "#Given","#Where","#Find","#Relate"-patterns +% for constraints on identifiers see "fun cpy_nam"*) +% met : metID list}; (* methods solving the pbt*) +% +%WN weil dieser Code sehr unaufger"aumt ist, habe ich die Erkl"arungen +%WN oben selbst geschrieben. + + + + +%WN das w"urde ich in \sec\label{progr} verschieben und +%WN das SubProblem partial fractions zum Erkl"aren verwenden. +% Such a specification is checked before the execution of a program is +% started, the same applies for sub-programs. In the following example +% (Example~\ref{eg:subprob}) shows the call of such a subproblem: +% +% \vbox{ +% \begin{example} +% \label{eg:subprob} +% \hfill \\ +% {\ttfamily \begin{tabbing} +% ``(L\_L::bool list) = (\=SubProblem (\=Test','' \\ +% ``\>\>[linear,univariate,equation,test],'' \\ +% ``\>\>[Test,solve\_linear])'' \\ +% ``\>[BOOL equ, REAL z])'' \\ +% \end{tabbing} +% } +% {\small\textit{ +% \noindent If a program requires a result which has to be +% calculated first we can use a subproblem to do so. In our specific +% case we wanted to calculate the zeros of a fraction and used a +% subproblem to calculate the zeros of the denominator polynom. +% }} +% \end{example} +% } + +\subsection{Implementation of the Method}\label{meth} +A method collects all data required to interpret a certain program by +Lucas-Interpretation. The \texttt{program} from p.\pageref{s:impl} of +the running example is embedded on the last line in the following method: +%The methods represent the different ways a problem can be solved. This can +%include mathematical tactics as well as tactics taught in different courses. +%Declaring the Method itself gives us the possibilities to describe the way of +%calculation in deep, as well we get the oppertunities to build in different +%rulesets. + +{\footnotesize +\begin{verbatim} + 00 ML {* + 01 store_method + 02 (prep_method + 03 "SP_InverseZTransformation_classic" + 04 ["Jan Rocnik"] + 05 thy + 06 ( ["SignalProcessing", "Z_Transform", "Inverse"], + 07 [ ("#Given", ["filterExpression X_eq", "domain D"]), + 08 ("#Pre" , ["(rhs X_eq) is_continuous_in D"]), + 09 ("#Find" , ["stepResponse n_eq"]), + 10 rew_ord erls + 11 srls prls nrls + 12 errpats + 13 program); + 14 *} +\end{verbatim}} + +\noindent The above code stores the whole structure analogously to a +specification as described above: +\begin{description} +\item[01..06] are identical to those for the example specification on +p.\pageref{exp-spec}. + +\item[07..09] show something looking like the specification; this is a +{\em guard}: as long as not all \textit{Given} items are present and +the \textit{Pre}-conditions is not true, interpretation of the program +is not started. + +\item[10..11] all concern rewriting (the respective data are defined elsewhere): \textit{rew\_ord} is the rewrite order~\cite{nipk:rew-all-that} in case +\textit{program} contains a \textit{Rewrite} tactic; and in case the respective rule is a conditional rewrite-rule, \textit{erls} features evaluating the conditions. The rule-sets +\textit{srls, prls, nrls} feature evaluating (a) the ML-functions in the program (e.g. +\textit{lhs, argument\_in, rhs} in the program on p.\pageref{s:impl}, (b) the pre-condition analogous to the specification in line 11 on p.\pageref{exp-spec} +and (c) is required for the derivation-machinery checking user-input formulas. + +\item[12..13] \textit{errpats} are error-patterns~\cite{gdaroczy-EP-13} for this method and \textit{program} is the variable holding the example from p.\pageref {s:impl}. +\end{description} +The many rule-sets above cause considerable efforts for the +programmers, in particular, because there are no tools for checking +essential features of rule-sets. + +% is again very technical and goes hard in detail. Unfortunataly +% most declerations are not essential for a basic programm but leads us to a huge +% range of powerful possibilities. +% +% \begin{description} +% \item[01..02] stores the method with the given name into the system under a global +% reference. +% \item[03] specifies the topic within which context the method can be found. +% \item[04..05] as the requirements for different methods can be deviant we +% declare what is \emph{given} and and what to \emph{find} for this specific method. +% The code again helds on the topic of the case studie, where the inverse +% z-transformation does a switch between a term describing a electrical filter into +% its step response. Also the datatype has to be declared (bool - due the fact that +% we handle equations). +% \item[06] \emph{rewrite order} is the order of this rls (ruleset), where one +% theorem of it is used for rewriting one single step. +% \item[07] \texttt{rls} is the currently used ruleset for this method. This set +% has already been defined before. +% \item[08] we would have the possiblitiy to add this method to a predefined tree of +% calculations, i.eg. if it would be a sub of a bigger problem, here we leave it +% independend. +% \item[09] The \emph{source ruleset}, can be used to evaluate list expressions in +% the source. +% \item[10] \emph{predicates ruleset} can be used to indicates predicates within +% model patterns. +% \item[11] The \emph{check ruleset} summarizes rules for checking formulas +% elementwise. +% \item[12] \emph{error patterns} which are expected in this kind of method can be +% pre-specified to recognize them during the method. +% \item[13] finally the \emph{canonical ruleset}, declares the canonical simplifier +% of the specific method. +% \item[14] for this code snipset we don't specify the programm itself and keep it +% empty. Follow up \S\ref{progr} for informations on how to implement this +% \textit{main} part. +% \end{description} + +\subsection{Implementation of the TP-based Program}\label{progr} +So finally all the prerequisites are described and the final task can +be addressed. The program below comes back to the running example: it +computes a solution for the problem from Fig.\ref{fig-interactive} on +p.\pageref{fig-interactive}. The reader is reminded of +\S\ref{PL-isab}, the introduction of the programming language: + +{\footnotesize\it\label{s:impl} +\begin{tabbing} +123l\=123\=123\=123\=123\=123\=123\=((x\=123\=(x \=123\=123\=\kill +\>{\rm 00}\>ML \{*\\ +\>{\rm 00}\>val program =\\ +\>{\rm 01}\> "{\tt Program} InverseZTransform (X\_eq::bool) = \\ +\>{\rm 02}\>\> {\tt let} \\ +\>{\rm 03}\>\>\> X\_eq = {\tt Take} X\_eq ; \\ +\>{\rm 04}\>\>\> X\_eq = {\tt Rewrite} prep\_for\_part\_frac X\_eq ; \\ +\>{\rm 05}\>\>\> (X\_z::real) = lhs X\_eq ; \\ %no inside-out evaluation +\>{\rm 06}\>\>\> (z::real) = argument\_in X\_z; \\ +\>{\rm 07}\>\>\> (part\_frac::real) = {\tt SubProblem} \\ +\>{\rm 08}\>\>\>\>\>\>\>\> ( Isac, [partial\_fraction, rational, simplification], [] )\\ +%\>{\rm 10}\>\>\>\>\>\>\>\>\> [simplification, of\_rationals, to\_partial\_fraction] ) \\ +\>{\rm 09}\>\>\>\>\>\>\>\> [ (rhs X\_eq)::real, z::real ]; \\ +\>{\rm 10}\>\>\> (X'\_eq::bool) = {\tt Take} ((X'::real =$>$ bool) z = ZZ\_1 part\_frac) ; \\ +\>{\rm 11}\>\>\> X'\_eq = (({\tt Rewrite\_Set} prep\_for\_inverse\_z) @@ \\ +\>{\rm 12}\>\>\>\>\> $\;\;$ ({\tt Rewrite\_Set} inverse\_z)) X'\_eq \\ +\>{\rm 13}\>\> {\tt in } \\ +\>{\rm 14}\>\>\> X'\_eq"\\ +\>{\rm 15}\>*\} +\end{tabbing}} +% ORIGINAL FROM Inverse_Z_Transform.thy +% "Script InverseZTransform (X_eq::bool) = "^(*([], Frm), Problem (Isac, [Inverse, Z_Transform, SignalProcessing])*) +% "(let X = Take X_eq; "^(*([1], Frm), X z = 3 / (z - 1 / 4 + -1 / 8 * (1 / z))*) +% " X' = Rewrite ruleZY False X; "^(*([1], Res), ?X' z = 3 / (z * (z - 1 / 4 + -1 / 8 * (1 / z)))*) +% " (X'_z::real) = lhs X'; "^(* ?X' z*) +% " (zzz::real) = argument_in X'_z; "^(* z *) +% " (funterm::real) = rhs X'; "^(* 3 / (z * (z - 1 / 4 + -1 / 8 * (1 / z)))*) +% +% " (pbz::real) = (SubProblem (Isac', "^(**) +% " [partial_fraction,rational,simplification], "^ +% " [simplification,of_rationals,to_partial_fraction]) "^ +% " [REAL funterm, REAL zzz]); "^(*([2], Res), 4 / (z - 1 / 2) + -4 / (z - -1 / 4)*) +% +% " (pbz_eq::bool) = Take (X'_z = pbz); "^(*([3], Frm), ?X' z = 4 / (z - 1 / 2) + -4 / (z - -1 / 4)*) +% " pbz_eq = Rewrite ruleYZ False pbz_eq; "^(*([3], Res), ?X' z = 4 * (?z / (z - 1 / 2)) + -4 * (?z / (z - -1 / 4))*) +% " pbz_eq = drop_questionmarks pbz_eq; "^(* 4 * (z / (z - 1 / 2)) + -4 * (z / (z - -1 / 4))*) +% " (X_zeq::bool) = Take (X_z = rhs pbz_eq); "^(*([4], Frm), X_z = 4 * (z / (z - 1 / 2)) + -4 * (z / (z - -1 / 4))*) +% " n_eq = (Rewrite_Set inverse_z False) X_zeq; "^(*([4], Res), X_z = 4 * (1 / 2) ^^^ ?n * ?u [?n] + -4 * (-1 / 4) ^^^ ?n * ?u [?n]*) +% " n_eq = drop_questionmarks n_eq "^(* X_z = 4 * (1 / 2) ^^^ n * u [n] + -4 * (-1 / 4) ^^^ n * u [n]*) +% "in n_eq)" (*([], Res), X_z = 4 * (1 / 2) ^^^ n * u [n] + -4 * (-1 / 4) ^^^ n * u [n]*) +The program is represented as a string and part of the method in +\S\ref{meth}. As mentioned in \S\ref{PL} the program is purely +functional and lacks any input statements and output statements. So +the steps of calculation towards a solution (and interactive tutoring +in step-wise problem solving) are created as a side-effect by +Lucas-Interpretation. The side-effects are triggered by the tactics +\texttt{Take}, \texttt{Rewrite}, \texttt{SubProblem} and +\texttt{Rewrite\_Set} in the above lines {\rm 03, 04, 07, 10, 11} and +{\rm 12} respectively. These tactics produce the respective lines in the +calculation on p.\pageref{flow-impl}. + +The above lines {\rm 05, 06} do not contain a tactics, so they do not +immediately contribute to the calculation on p.\pageref{flow-impl}; +rather, they compute actual arguments for the \texttt{SubProblem} in +line {\rm 09}~\footnote{The tactics also are break-points for the +interpreter, where control is handed over to the user in interactive +tutoring.}. Line {\rm 11} contains tactical \textit{@@}. + +\medskip The above program also indicates the dominant role of interactive +selection of knowledge in the three-dimensional universe of +mathematics. The \texttt{SubProblem} in the above lines +{\rm 07..09} is more than a function call with the actual arguments +\textit{[ (rhs X\_eq)::real, z::real ]}. The programmer has to determine +three items: + +\begin{enumerate} +\item the theory, in the example \textit{Isac} because different +methods can be selected in Pt.3 below, which are defined in different +theories with \textit{Isac} collecting them. +\item the specification identified by \textit{[partial\_fraction, +rational, simplification]} in the tree of specifications; this +specification is analogous to the specification of the main program +described in \S\ref{spec}; the problem is to find a ``partial fraction +decomposition'' for a univariate rational polynomial. +\item the method in the above example is \textit{[ ]}, i.e. empty, +which supposes the interpreter to select one of the methods predefined +in the specification, for instance in line {\rm 13} in the running +example's specification on p.\pageref{exp-spec}~\footnote{The freedom +(or obligation) for selection carries over to the student in +interactive tutoring.}. +\end{enumerate} + +The program code, above presented as a string, is parsed by Isabelle's +parser --- the program is an Isabelle term. This fact is expected to +simplify verification tasks in the future; on the other hand, this +fact causes troubles in error detection which are discussed as part +of the work-flow in the subsequent section. + +\section{Work-flow of Programming in the Prototype}\label{workflow} +The new prover IDE Isabelle/jEdit~\cite{makar-jedit-12} is a great +step forward for interactive theory and proof development. The +{\sisac}-prototype re-uses this IDE as a programming environment. The +experiences from this re-use show, that the essential components are +available from Isabelle/jEdit. However, additional tools and features +are required to achieve acceptable usability. + +So notable experiences are reported here, also as a requirement +capture for further development of TP-based languages and respective +IDEs. + +\subsection{Preparations and Trials}\label{flow-prep} +The many sub-tasks to be accomplished {\em before} the first line of +program code can be written and tested suggest an approach which +step-wise establishes the prerequisites. The case study underlying +this paper~\cite{jrocnik-bakk} documents the approach in a separate +Isabelle theory, +\textit{Build\_Inverse\_Z\_Transform.thy}~\footnote{http://www.ist.tugraz.at/projects/isac/publ/Build\_Inverse\_Z\_Transform.thy}. Part +II in the study comprises this theory, \LaTeX ed from the theory by +use of Isabelle's document preparation system. This paper resembles +the approach in \S\ref{isabisac} to \S\ref{meth}, which in actual +implementation work involves several iterations. + +\bigskip For instance, only the last step, implementing the program +described in \S\ref{meth}, reveals details required. Let us assume, +this is the ML-function \textit{argument\_in} required in line {\rm 06} +of the example program on p.\pageref{s:impl}; how this function needs +to be implemented in the prototype has been discussed in \S\ref{funs} +already. + +Now let us assume, that calling this function from the program code +does not work; so testing this function is required in order to find out +the reason: type errors, a missing entry of the function somewhere or +even more nasty technicalities \dots + +{\footnotesize +\begin{verbatim} +01 ML {* +02 val SOME t = parseNEW ctxt "argument_in (X (z::real))"; +03 val SOME (str, t') = eval_argument_in "" +04 "Build_Inverse_Z_Transform.argument'_in" t 0; +05 term2str t'; +06 *} +07 val it = "(argument_in X z) = z": string\end{verbatim}} + +\noindent So, this works: we get an ad-hoc theorem, which used in +rewriting would reduce \texttt{argument\_in X z} to \texttt{z}. Now we check this +reduction and create a rule-set \texttt{rls} for that purpose: + +{\footnotesize +\begin{verbatim} +01 ML {* +02 val rls = append_rls "test" e_rls +03 [Calc ("Build_Inverse_Z_Transform.argument'_in", eval_argument_in "")] +04 val SOME (t', asm) = rewrite_set_ @{theory} rls t; +05 *} +06 val t' = Free ("z", "RealDef.real"): term +07 val asm = []: term list\end{verbatim}} + +\noindent The resulting term \texttt{t'} is \texttt{Free ("z", +"RealDef.real")}, i.e the variable \texttt{z}, so all is +perfect. Probably we have forgotten to store this function correctly~? +We review the respective \texttt{calclist} (again an +\textit{Unsynchronized.ref} to be removed in order to adjust to +Isabelle/Isar's asynchronous document model): + +{\footnotesize +\begin{verbatim} +01 calclist:= overwritel (! calclist, +02 [("argument_in", +03 ("Build_Inverse_Z_Transform.argument'_in", eval_argument_in "")), +04 ... +05 ]);\end{verbatim}} + +\noindent The entry is perfect. So what is the reason~? Ah, probably there +is something messed up with the many rule-sets in the method, see \S\ref{meth} --- +right, the function \texttt{argument\_in} is not contained in the respective +rule-set \textit{srls} \dots this just as an example of the intricacies in +debugging a program in the present state of the prototype. + +\subsection{Implementation in Isabelle/{\isac}}\label{flow-impl} +Given all the prerequisites from \S\ref{isabisac} to \S\ref{meth}, +usually developed within several iterations, the program can be +assembled; on p.\pageref{s:impl} there is the complete program of the +running example. + +The completion of this program required efforts for several weeks +(after some months of familiarisation with {\sisac}), caused by the +abundance of intricacies indicated above. Also writing the program is +not pleasant, given Isabelle/Isar/ without add-ons for +programming. Already writing and parsing a few lines of program code +is a challenge: the program is an Isabelle term; Isabelle's parser, +however, is not meant for huge terms like the program of the running +example. So reading out the specific error (usually type errors) from +Isabelle's message is difficult. + +\medskip Testing the evaluation of the program has to rely on very +simple tools. Step-wise execution is modeled by a function +\texttt{me}, short for mathematics-engine~\footnote{The interface used +by the front-end which created the calculation on +p.\pageref{fig-interactive} is different from this function}: +%the following is a simplification of the actual function + +{\footnotesize +\begin{verbatim} +01 ML {* me; *} +02 val it = tac -> ctree * pos -> mout * tac * ctree * pos\end{verbatim}} + +\noindent This function takes as arguments a tactic \texttt{tac} which +determines the next step, the step applied to the interpreter-state +\texttt{ctree * pos} as last argument taken. The interpreter-state is +a pair of a tree \texttt{ctree} representing the calculation created +(see the example below) and a position \texttt{pos} in the +calculation. The function delivers a quadruple, beginning with the new +formula \texttt{mout} and the next tactic followed by the new +interpreter-state. + +This function allows to stepwise check the program: + +{\footnotesize\label{ml-check-program} +\begin{verbatim} +01 ML {* +02 val fmz = +03 ["filterExpression (X z = 3 / ((z::real) + 1/10 - 1/50*(1/z)))", +04 "stepResponse (x[n::real]::bool)"]; +05 val (dI,pI,mI) = +06 ("Isac", +07 ["Inverse", "Z_Transform", "SignalProcessing"], +08 ["SignalProcessing","Z_Transform","Inverse"]); +09 val (mout, tac, ctree, pos) = CalcTreeTEST [(fmz, (dI, pI, mI))]; +10 val (mout, tac, ctree, pos) = me tac (ctree, pos); +11 val (mout, tac, ctree, pos) = me tac (ctree, pos); +12 val (mout, tac, ctree, pos) = me tac (ctree, pos); +13 ... +\end{verbatim}} + +\noindent Several dozens of calls for \texttt{me} are required to +create the lines in the calculation below (including the sub-problems +not shown). When an error occurs, the reason might be located +many steps before: if evaluation by rewriting, as done by the prototype, +fails, then first nothing happens --- the effects come later and +cause unpleasant checks. + +The checks comprise watching the rewrite-engine for many different +kinds of rule-sets (see \S\ref{meth}), the interpreter-state, in +particular the environment and the context at the states position --- +all checks have to rely on simple functions accessing the +\texttt{ctree}. So getting the calculation below (which resembles the +calculation in Fig.\ref{fig-interactive} on p.\pageref{fig-interactive}) +is the result of several weeks of development: + +{\small\it\label{exp-calc} +\begin{tabbing} +123l\=123\=123\=123\=123\=123\=123\=123\=123\=123\=123\=123\=\kill +\>{\rm 01}\> $\bullet$ \> {\tt Problem } (Inverse\_Z\_Transform, [Inverse, Z\_Transform, SignalProcessing]) \`\\ +\>{\rm 02}\>\> $\vdash\;\;X z = \frac{3}{z - \frac{1}{4} - \frac{1}{8} \cdot z^{-1}}$ \`{\footnotesize {\tt Take} X\_eq}\\ +\>{\rm 03}\>\> $X z = \frac{3}{z + \frac{-1}{4} + \frac{-1}{8} \cdot \frac{1}{z}}$ \`{\footnotesize {\tt Rewrite} prep\_for\_part\_frac X\_eq}\\ +\>{\rm 04}\>\> $\bullet$\> {\tt Problem } [partial\_fraction,rational,simplification] \`{\footnotesize {\tt SubProblem} \dots}\\ +\>{\rm 05}\>\>\> $\vdash\;\;\frac{3}{z + \frac{-1}{4} + \frac{-1}{8} \cdot \frac{1}{z}}=$ \`- - -\\ +\>{\rm 06}\>\>\> $\frac{24}{-1 + -2 \cdot z + 8 \cdot z^2}$ \`- - -\\ +\>{\rm 07}\>\>\> $\bullet$\> solve ($-1 + -2 \cdot z + 8 \cdot z^2,\;z$ ) \`- - -\\ +\>{\rm 08}\>\>\>\> $\vdash$ \> $\frac{3}{z + \frac{-1}{4} + \frac{-1}{8} \cdot \frac{1}{z}}=0$ \`- - -\\ +\>{\rm 09}\>\>\>\> $z = \frac{2+\sqrt{-4+8}}{16}\;\lor\;z = \frac{2-\sqrt{-4+8}}{16}$ \`- - -\\ +\>{\rm 10}\>\>\>\> $z = \frac{1}{2}\;\lor\;z =$ \_\_\_ \`- - -\\ +\> \>\>\>\> \_\_\_ \`- - -\\ +\>{\rm 11}\>\> \dots\> $\frac{4}{z - \frac{1}{2}} + \frac{-4}{z - \frac{-1}{4}}$ \`\\ +\>{\rm 12}\>\> $X^\prime z = {\cal z}^{-1} (\frac{4}{z - \frac{1}{2}} + \frac{-4}{z - \frac{-1}{4}})$ \`{\footnotesize {\tt Take} ((X'::real =$>$ bool) z = ZZ\_1 part\_frac)}\\ +\>{\rm 13}\>\> $X^\prime z = {\cal z}^{-1} (4\cdot\frac{z}{z - \frac{1}{2}} + -4\cdot\frac{z}{z - \frac{-1}{4}})$ \`{\footnotesize{\tt Rewrite\_Set} prep\_for\_inverse\_z X'\_eq }\\ +\>{\rm 14}\>\> $X^\prime z = 4\cdot(\frac{1}{2})^n \cdot u [n] + -4\cdot(\frac{-1}{4})^n \cdot u [n]$ \`{\footnotesize {\tt Rewrite\_Set} inverse\_z X'\_eq}\\ +\>{\rm 15}\> \dots\> $X^\prime z = 4\cdot(\frac{1}{2})^n \cdot u [n] + -4\cdot(\frac{-1}{4})^n \cdot u [n]$ \`{\footnotesize {\tt Check\_Postcond}} +\end{tabbing}} +The tactics on the right margin of the above calculation are those in +the program on p.\pageref{s:impl} which create the respective formulas +on the left. +% ORIGINAL FROM Inverse_Z_Transform.thy +% "Script InverseZTransform (X_eq::bool) = "^(*([], Frm), Problem (Isac, [Inverse, Z_Transform, SignalProcessing])*) +% "(let X = Take X_eq; "^(*([1], Frm), X z = 3 / (z - 1 / 4 + -1 / 8 * (1 / z))*) +% " X' = Rewrite ruleZY False X; "^(*([1], Res), ?X' z = 3 / (z * (z - 1 / 4 + -1 / 8 * (1 / z)))*) +% " (X'_z::real) = lhs X'; "^(* ?X' z*) +% " (zzz::real) = argument_in X'_z; "^(* z *) +% " (funterm::real) = rhs X'; "^(* 3 / (z * (z - 1 / 4 + -1 / 8 * (1 / z)))*) +% +% " (pbz::real) = (SubProblem (Isac', "^(**) +% " [partial_fraction,rational,simplification], "^ +% " [simplification,of_rationals,to_partial_fraction]) "^ +% " [REAL funterm, REAL zzz]); "^(*([2], Res), 4 / (z - 1 / 2) + -4 / (z - -1 / 4)*) +% +% " (pbz_eq::bool) = Take (X'_z = pbz); "^(*([3], Frm), ?X' z = 4 / (z - 1 / 2) + -4 / (z - -1 / 4)*) +% " pbz_eq = Rewrite ruleYZ False pbz_eq; "^(*([3], Res), ?X' z = 4 * (?z / (z - 1 / 2)) + -4 * (?z / (z - -1 / 4))*) +% " pbz_eq = drop_questionmarks pbz_eq; "^(* 4 * (z / (z - 1 / 2)) + -4 * (z / (z - -1 / 4))*) +% " (X_zeq::bool) = Take (X_z = rhs pbz_eq); "^(*([4], Frm), X_z = 4 * (z / (z - 1 / 2)) + -4 * (z / (z - -1 / 4))*) +% " n_eq = (Rewrite_Set inverse_z False) X_zeq; "^(*([4], Res), X_z = 4 * (1 / 2) ^^^ ?n * ?u [?n] + -4 * (-1 / 4) ^^^ ?n * ?u [?n]*) +% " n_eq = drop_questionmarks n_eq "^(* X_z = 4 * (1 / 2) ^^^ n * u [n] + -4 * (-1 / 4) ^^^ n * u [n]*) +% "in n_eq)" (*([], Res), X_z = 4 * (1 / 2) ^^^ n * u [n] + -4 * (-1 / 4) ^^^ n * u [n]*) + +\subsection{Transfer into the Isabelle/{\isac} Knowledge}\label{flow-trans} +Finally \textit{Build\_Inverse\_Z\_Transform.thy} has got the job done +and the knowledge accumulated in it can be distributed to appropriate +theories: the program to \textit{Inverse\_Z\_Transform.thy}, the +sub-problem accomplishing the partial fraction decomposition to +\textit{Partial\_Fractions.thy}. Since there are hacks into Isabelle's +internals, this kind of distribution is not trivial. For instance, the +function \texttt{argument\_in} in \S\ref{funs} explicitly contains a +string with the theory it has been defined in, so this string needs to +be updated from \texttt{Build\_Inverse\_Z\_Transform} to +\texttt{Atools} if that function is transferred to theory +\textit{Atools.thy}. + +In order to obtain the functionality presented in Fig.\ref{fig-interactive} on p.\pageref{fig-interactive} data must be exported from SML-structures to XML. +This process is also rather bare-bones without authoring tools and is +described in detail in the {\sisac} wiki~\footnote{http://www.ist.tugraz.at/isac/index.php/Generate\_representations\_for\_ISAC\_Knowledge}. + +% \newpage +% ------------------------------------------------------------------- +% +% Material, falls noch Platz bleibt ... +% +% ------------------------------------------------------------------- +% +% +% \subsubsection{Trials on Notation and Termination} +% +% \paragraph{Technical notations} are a big problem for our piece of software, +% but the reason for that isn't a fault of the software itself, one of the +% troubles comes out of the fact that different technical subtopics use different +% symbols and notations for a different purpose. The most famous example for such +% a symbol is the complex number $i$ (in cassique math) or $j$ (in technical +% math). In the specific part of signal processing one of this notation issues is +% the use of brackets --- we use round brackets for analoge signals and squared +% brackets for digital samples. Also if there is no problem for us to handle this +% fact, we have to tell the machine what notation leads to wich meaning and that +% this purpose seperation is only valid for this special topic - signal +% processing. +% \subparagraph{In the programming language} itself it is not possible to declare +% fractions, exponents, absolutes and other operators or remarks in a way to make +% them pretty to read; our only posssiblilty were ASCII characters and a handfull +% greek symbols like: $\alpha, \beta, \gamma, \phi,\ldots$. +% \par +% With the upper collected knowledge it is possible to check if we were able to +% donate all required terms and expressions. +% +% \subsubsection{Definition and Usage of Rules} +% +% \paragraph{The core} of our implemented problem is the Z-Transformation, due +% the fact that the transformation itself would require higher math which isn't +% yet avaible in our system we decided to choose the way like it is applied in +% labratory and problem classes at our university - by applying transformation +% rules (collected in transformation tables). +% \paragraph{Rules,} in {\sisac{}}'s programming language can be designed by the +% use of axiomatizations like shown in Example~\ref{eg:ruledef} +% +% \begin{example} +% \label{eg:ruledef} +% \hfill\\ +% \begin{verbatim} +% axiomatization where +% rule1: ``1 = $\delta$[n]'' and +% rule2: ``|| z || > 1 ==> z / (z - 1) = u [n]'' and +% rule3: ``|| z || < 1 ==> z / (z - 1) = -u [-n - 1]'' +% \end{verbatim} +% \end{example} +% +% This rules can be collected in a ruleset and applied to a given expression as +% follows in Example~\ref{eg:ruleapp}. +% +% \begin{example} +% \hfill\\ +% \label{eg:ruleapp} +% \begin{enumerate} +% \item Store rules in ruleset: +% \begin{verbatim} +% val inverse_Z = append_rls "inverse_Z" e_rls +% [ Thm ("rule1",num_str @{thm rule1}), +% Thm ("rule2",num_str @{thm rule2}), +% Thm ("rule3",num_str @{thm rule3}) +% ];\end{verbatim} +% \item Define exression: +% \begin{verbatim} +% val sample_term = str2term "z/(z-1)+z/(z-)+1";\end{verbatim} +% \item Apply ruleset: +% \begin{verbatim} +% val SOME (sample_term', asm) = +% rewrite_set_ thy true inverse_Z sample_term;\end{verbatim} +% \end{enumerate} +% \end{example} +% +% The use of rulesets makes it much easier to develop our designated applications, +% but the programmer has to be careful and patient. When applying rulesets +% two important issues have to be mentionend: +% \subparagraph{How often} the rules have to be applied? In case of +% transformations it is quite clear that we use them once but other fields +% reuqire to apply rules until a special condition is reached (e.g. +% a simplification is finished when there is nothing to be done left). +% \subparagraph{The order} in which rules are applied often takes a big effect +% and has to be evaluated for each purpose once again. +% \par +% In our special case of Signal Processing and the rules defined in +% Example~\ref{eg:ruledef} we have to apply rule~1 first of all to transform all +% constants. After this step has been done it no mather which rule fit's next. +% +% \subsubsection{Helping Functions} +% +% \paragraph{New Programms require,} often new ways to get through. This new ways +% means that we handle functions that have not been in use yet, they can be +% something special and unique for a programm or something famous but unneeded in +% the system yet. In our dedicated example it was for example neccessary to split +% a fraction into numerator and denominator; the creation of such function and +% even others is described in upper Sections~\ref{simp} and \ref{funs}. +% +% \subsubsection{Trials on equation solving} +% %simple eq and problem with double fractions/negative exponents +% \paragraph{The Inverse Z-Transformation} makes it neccessary to solve +% equations degree one and two. Solving equations in the first degree is no +% problem, wether for a student nor for our machine; but even second degree +% equations can lead to big troubles. The origin of this troubles leads from +% the build up process of our equation solving functions; they have been +% implemented some time ago and of course they are not as good as we want them to +% be. Wether or not following we only want to show how cruel it is to build up new +% work on not well fundamentials. +% \subparagraph{A simple equation solving,} can be set up as shown in the next +% example: +% +% \begin{example} +% \begin{verbatim} +% +% val fmz = +% ["equality (-1 + -2 * z + 8 * z ^^^ 2 = (0::real))", +% "solveFor z", +% "solutions L"]; +% +% val (dI',pI',mI') = +% ("Isac", +% ["abcFormula","degree_2","polynomial","univariate","equation"], +% ["no_met"]);\end{verbatim} +% \end{example} +% +% Here we want to solve the equation: $-1+-2\cdot z+8\cdot z^{2}=0$. (To give +% a short overview on the commands; at first we set up the equation and tell the +% machine what's the bound variable and where to store the solution. Second step +% is to define the equation type and determine if we want to use a special method +% to solve this type.) Simple checks tell us that the we will get two results for +% this equation and this results will be real. +% So far it is easy for us and for our machine to solve, but +% mentioned that a unvariate equation second order can have three different types +% of solutions it is getting worth. +% \subparagraph{The solving of} all this types of solutions is not yet supported. +% Luckily it was needed for us; but something which has been needed in this +% context, would have been the solving of an euation looking like: +% $-z^{-2}+-2\cdot z^{-1}+8=0$ which is basically the same equation as mentioned +% before (remember that befor it was no problem to handle for the machine) but +% now, after a simple equivalent transformation, we are not able to solve +% it anymore. +% \subparagraph{Error messages} we get when we try to solve something like upside +% were very confusing and also leads us to no special hint about a problem. +% \par The fault behind is, that we have no well error handling on one side and +% no sufficient formed equation solving on the other side. This two facts are +% making the implemention of new material very difficult. +% +% \subsection{Formalization of missing knowledge in Isabelle} +% +% \paragraph{A problem} behind is the mechanization of mathematic +% theories in TP-bases languages. There is still a huge gap between +% these algorithms and this what we want as a solution - in Example +% Signal Processing. +% +% \vbox{ +% \begin{example} +% \label{eg:gap} +% \[ +% X\cdot(a+b)+Y\cdot(c+d)=aX+bX+cY+dY +% \] +% {\small\textit{ +% \noindent A very simple example on this what we call gap is the +% simplification above. It is needles to say that it is correct and also +% Isabelle for fills it correct - \emph{always}. But sometimes we don't +% want expand such terms, sometimes we want another structure of +% them. Think of a problem were we now would need only the coefficients +% of $X$ and $Y$. This is what we call the gap between mechanical +% simplification and the solution. +% }} +% \end{example} +% } +% +% \paragraph{We are not able to fill this gap,} until we have to live +% with it but first have a look on the meaning of this statement: +% Mechanized math starts from mathematical models and \emph{hopefully} +% proceeds to match physics. Academic engineering starts from physics +% (experimentation, measurement) and then proceeds to mathematical +% modeling and formalization. The process from a physical observance to +% a mathematical theory is unavoidable bound of setting up a big +% collection of standards, rules, definition but also exceptions. These +% are the things making mechanization that difficult. +% +% \vbox{ +% \begin{example} +% \label{eg:units} +% \[ +% m,\ kg,\ s,\ldots +% \] +% {\small\textit{ +% \noindent Think about some units like that one's above. Behind +% each unit there is a discerning and very accurate definition: One +% Meter is the distance the light travels, in a vacuum, through the time +% of 1 / 299.792.458 second; one kilogram is the weight of a +% platinum-iridium cylinder in paris; and so on. But are these +% definitions usable in a computer mechanized world?! +% }} +% \end{example} +% } +% +% \paragraph{A computer} or a TP-System builds on programs with +% predefined logical rules and does not know any mathematical trick +% (follow up example \ref{eg:trick}) or recipe to walk around difficult +% expressions. +% +% \vbox{ +% \begin{example} +% \label{eg:trick} +% \[ \frac{1}{j\omega}\cdot\left(e^{-j\omega}-e^{j3\omega}\right)= \] +% \[ \frac{1}{j\omega}\cdot e^{-j2\omega}\cdot\left(e^{j\omega}-e^{-j\omega}\right)= +% \frac{1}{\omega}\, e^{-j2\omega}\cdot\colorbox{lgray}{$\frac{1}{j}\,\left(e^{j\omega}-e^{-j\omega}\right)$}= \] +% \[ \frac{1}{\omega}\, e^{-j2\omega}\cdot\colorbox{lgray}{$2\, sin(\omega)$} \] +% {\small\textit{ +% \noindent Sometimes it is also useful to be able to apply some +% \emph{tricks} to get a beautiful and particularly meaningful result, +% which we are able to interpret. But as seen in this example it can be +% hard to find out what operations have to be done to transform a result +% into a meaningful one. +% }} +% \end{example} +% } +% +% \paragraph{The only possibility,} for such a system, is to work +% through its known definitions and stops if none of these +% fits. Specified on Signal Processing or any other application it is +% often possible to walk through by doing simple creases. This creases +% are in general based on simple math operational but the challenge is +% to teach the machine \emph{all}\footnote{Its pride to call it +% \emph{all}.} of them. Unfortunately the goal of TP Isabelle is to +% reach a high level of \emph{all} but it in real it will still be a +% survey of knowledge which links to other knowledge and {{\sisac}{}} a +% trainer and helper but no human compensating calculator. +% \par +% {{{\sisac}{}}} itself aims to adds \emph{Algorithmic Knowledge} (formal +% specifications of problems out of topics from Signal Processing, etc.) +% and \emph{Application-oriented Knowledge} to the \emph{deductive} axis of +% physical knowledge. The result is a three-dimensional universe of +% mathematics seen in Figure~\ref{fig:mathuni}. +% +% \begin{figure} +% \begin{center} +% \includegraphics{fig/universe} +% \caption{Didactic ``Math-Universe'': Algorithmic Knowledge (Programs) is +% combined with Application-oriented Knowledge (Specifications) and Deductive Knowledge (Axioms, Definitions, Theorems). The Result +% leads to a three dimensional math universe.\label{fig:mathuni}} +% \end{center} +% \end{figure} +% +% %WN Deine aktuelle Benennung oben wird Dir kein Fachmann abnehmen; +% %WN bitte folgende Bezeichnungen nehmen: +% %WN +% %WN axis 1: Algorithmic Knowledge (Programs) +% %WN axis 2: Application-oriented Knowledge (Specifications) +% %WN axis 3: Deductive Knowledge (Axioms, Definitions, Theorems) +% %WN +% %WN und bitte die R"ander von der Grafik wegschneiden (was ich f"ur *.pdf +% %WN nicht hinkriege --- weshalb ich auch die eJMT-Forderung nicht ganz +% %WN verstehe, separierte PDFs zu schicken; ich w"urde *.png schicken) +% +% %JR Ränder und beschriftung geändert. Keine Ahnung warum eJMT sich pdf's +% %JR wünschen, würde ebenfalls png oder ähnliches verwenden, aber wenn pdf's +% %JR gefordert werden WN2... +% %WN2 meiner Meinung nach hat sich eJMT unklar ausgedr"uckt (z.B. kann +% %WN2 man meines Wissens pdf-figures nicht auf eine bestimmte Gr"osse +% %WN2 zusammenschneiden um die R"ander weg zu bekommen) +% %WN2 Mein Vorschlag ist, in umserem tex-file bei *.png zu bleiben und +% %WN2 png + pdf figures mitzuschicken. +% +% \subsection{Notes on Problems with Traditional Notation} +% +% \paragraph{During research} on these topic severely problems on +% traditional notations have been discovered. Some of them have been +% known in computer science for many years now and are still unsolved, +% one of them aggregates with the so called \emph{Lambda Calculus}, +% Example~\ref{eg:lamda} provides a look on the problem that embarrassed +% us. +% +% \vbox{ +% \begin{example} +% \label{eg:lamda} +% +% \[ f(x)=\ldots\; \quad R \rightarrow \quad R \] +% +% +% \[ f(p)=\ldots\; p \in \quad R \] +% +% {\small\textit{ +% \noindent Above we see two equations. The first equation aims to +% be a mapping of an function from the reel range to the reel one, but +% when we change only one letter we get the second equation which +% usually aims to insert a reel point $p$ into the reel function. In +% computer science now we have the problem to tell the machine (TP) the +% difference between this two notations. This Problem is called +% \emph{Lambda Calculus}. +% }} +% \end{example} +% } +% +% \paragraph{An other problem} is that terms are not full simplified in +% traditional notations, in {{\sisac}} we have to simplify them complete +% to check weather results are compatible or not. in e.g. the solutions +% of an second order linear equation is an rational in {{\sisac}} but in +% tradition we keep fractions as long as possible and as long as they +% aim to be \textit{beautiful} (1/8, 5/16,...). +% \subparagraph{The math} which should be mechanized in Computer Theorem +% Provers (\emph{TP}) has (almost) a problem with traditional notations +% (predicate calculus) for axioms, definitions, lemmas, theorems as a +% computer program or script is not able to interpret every Greek or +% Latin letter and every Greek, Latin or whatever calculations +% symbol. Also if we would be able to handle these symbols we still have +% a problem to interpret them at all. (Follow up \hbox{Example +% \ref{eg:symbint1}}) +% +% \vbox{ +% \begin{example} +% \label{eg:symbint1} +% \[ +% u\left[n\right] \ \ldots \ unitstep +% \] +% {\small\textit{ +% \noindent The unitstep is something we need to solve Signal +% Processing problem classes. But in {{{\sisac}{}}} the rectangular +% brackets have a different meaning. So we abuse them for our +% requirements. We get something which is not defined, but usable. The +% Result is syntax only without semantic. +% }} +% \end{example} +% } +% +% In different problems, symbols and letters have different meanings and +% ask for different ways to get through. (Follow up \hbox{Example +% \ref{eg:symbint2}}) +% +% \vbox{ +% \begin{example} +% \label{eg:symbint2} +% \[ +% \widehat{\ }\ \widehat{\ }\ \widehat{\ } \ \ldots \ exponent +% \] +% {\small\textit{ +% \noindent For using exponents the three \texttt{widehat} symbols +% are required. The reason for that is due the development of +% {{{\sisac}{}}} the single \texttt{widehat} and also the double were +% already in use for different operations. +% }} +% \end{example} +% } +% +% \paragraph{Also the output} can be a problem. We are familiar with a +% specified notations and style taught in university but a computer +% program has no knowledge of the form proved by a professor and the +% machines themselves also have not yet the possibilities to print every +% symbol (correct) Recent developments provide proofs in a human +% readable format but according to the fact that there is no money for +% good working formal editors yet, the style is one thing we have to +% live with. +% +% \section{Problems rising out of the Development Environment} +% +% fehlermeldungen! TODO + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\end{verbatim} + +\section{Summary and Conclusions}\label{conclusion} + +%JR obvious + +%This paper gives a first experience report about programming with a +%TP-based programming language. + +A brief re-introduction of the novel kind of programming +language by example of the {\sisac}-prototype makes the paper +self-contained. The main section describes all the main concepts +involved in TP-based programming and all the sub-tasks concerning +respective implementation in the {\sisac} prototype: mechanisation of mathematics and domain +modeling, implementation of term rewriting systems for the +rewriting-engine, formal (implicit) specification of the problem to be +(explicitly) described by the program, implementation of the many components +required for Lucas-Interpretation and finally implementation of the +program itself. + +The many concepts and sub-tasks involved in programming require a +comprehensive work-flow; first experiences with the work-flow as +supported by the present prototype are described as well: Isabelle + +Isar + jEdit provide appropriate components for establishing an +efficient development environment integrating computation and +deduction. However, the present state of the prototype is far off a +state appropriate for wide-spread use: the prototype of the program +language lacks expressiveness and elegance, the prototype of the +development environment is hardly usable: error messages still address +the developer of the prototype's interpreter rather than the +application programmer, implementation of the many settings for the +Lucas-Interpreter is cumbersome. + +\subsection{Conclusions for Future Development} +From the above mentioned experiences a successful proof of concept can be concluded: +programming arbitrary problems from engineering sciences is possible, +in principle even in the prototype. Furthermore the experiences allow +to conclude detailed requirements for further development: +\begin{enumerate} +\item Clarify underlying logics such that programming is smoothly +integrated with verification of the program; the post-condition should +be proved more or less automatically, otherwise working engineers +would not encounter such programming. +\item Combine the prototype's programming language with Isabelle's +powerful function package and probably with more of SML's +pattern-matching features; include parallel execution on multi-core +machines into the language design. +\item Extend the prototype's Lucas-Interpreter such that it also +handles functions defined by use of Isabelle's functions package; and +generalize Isabelle's code generator such that efficient code for the +whole definition of the programming language can be generated (for +multi-core machines). +\item Develop an efficient development environment with +integration of programming and proving, with management not only of +Isabelle theories, but also of large collections of specifications and +of programs. +\item\label{CAS} Extend Isabelle's computational features in direction of +\textit{verfied} Computer Algebra: simplification extended by +algorithms beyond rewriting (cancellation of multivariate rationals, +factorisation, partial fraction decomposition, etc), equation solving +, integration, etc. +\end{enumerate} +Provided successful accomplishment, these points provide distinguished +components for virtual workbenches appealing to practitioners of +engineering in the near future. + +\subsection{Preview to Development of Course Material} +Interactive course material, as addressed by the title, +can comprise step-wise problem solving created as a side-effect of a +TP-based program: The introduction \S\ref{intro} briefly shows that Lucas-Interpretation not only provides an +interactive programming environment, Lucas-Interpretation also can +provide TP-based services for a flexible dialogue component with +adaptive user guidance for independent and inquiry-based learning. + +However, the {\sisac} prototype is not ready for use in field-tests, +not only due to the above five requirements not sufficiently +accomplished, but also due to usability of the fron-end, in particular +the lack of an editor for formulas in 2-dimension representation. + +Nevertheless, the experiences from the case study described in this +paper, allow to give a preview to the development of course material, +if based on Lucas-Interpretation: + +\paragraph{Development of material from scratch} is too much effort +just for e-learning; this has become clear with the case study. For +getting support for stepwise problem solving just in {\em one} example +class, the one presented in this paper, involved the following tasks: +\begin{itemize} +\item Adapt the equation solver; since that was too laborous, the +program has been adapted in an unelegant way. +\item Implement an algorithms for partial fraction decomposition, +which is considered a standard normal form in Computer Algebra. +\item Implement a specification for partial fraction decomposition and +locate it appropriately in the hierarchy of specification. +\item Declare definitions and theorems within the theory of +${\cal Z}$-transform, and prove the theorems (which was not done in the +case study). +\end{itemize} +On the other hand, for the one the class of problems implemented, +adding an arbitrary number of examples within this class requires a +few minutes~\footnote{As shown in Fig.\ref{fig-interactive}, an +example is called from an HTML-file by an URL, which addresses an +XML-structure holding the respective data as shown on +p.\pageref{ml-check-program}.} and the support for individual stepwise +problem solving comes for free. + +\paragraph{E-learning benefits from Formal Domain Engineering} which can be +expected for various domains in the near future. In order to cope with +increasing complexity in domain of technology, specific domain +knowledge is beeing mechanised, not only for software technology +\footnote{For instance, the Archive of Formal Proofs +http://afp.sourceforge.net/} but also for other engineering domains +\cite{Dehbonei&94,Hansen94b,db:dom-eng}. This fairly new part of +engineering sciences is called ``domain engineering'' in +\cite{db:SW-engIII}. + +Given this kind of mechanised knowledge including mathematical +theories, domain specific definitions, specifications and algorithms, +theorems and proofs, then e-learning with support for individual +stepwise problem solving will not be much ado anymore; then e-learning +media in technology education can be derived from this knowledge with +reasonable effort. + +\paragraph{Development differentiates into tasks} more separated than +without Lucas-Interpretation and more challenginging in specific +expertise. These are the kinds of experts expected to cooperate in +development of +\begin{itemize} +\item ``Domain engineers'', who accomplish fairly novel tasks +described in this paper. +\item Course designers, who provide the instructional design according +to curricula, together with usability experts and media designers, are +indispensable in production of e-learning media at the state-of-the +art. +\item ``Dialog designers'', whose part of development is clearly +separated from the part of domain engineers as a consequence of +Lucas-Interpretation: TP-based programs are functional, as mentioned, +and are only concerned with describing mathematics --- and not at all +concerned with interaction, psychology, learning theory and the like, +because there are no in/output statements. Dialog designers can expect +a high-level rule-based language~\cite{gdaroczy-EP-13} for describing +their part. +\end{itemize} + +% response-to-referees: +% (2.1) details of novel technology in order to estimate the impact +% (2.2) which kinds of expertise are required for production of e-learning media (instructional design, math authoring, dialog authoring, media design) +% (2.3) what in particular is required for programming new exercises supported by next-step-guidance (expertise / efforts) +% (2.4) estimation of break-even points for development of next-step-guidance +% (2.5) usability of ISAC prototype at the present state +% +% The points (1.*) seem to be well covered in the paper, the points (2.*) are not. So I decided to address the points (2.*) in a separate section §5.1."". + +\bigskip\noindent For this decade there seems to be a window of opportunity opening from +one side inreasing demand for formal domain engineering and from the +other side from TP more and more gaining industrial relevance. Within +this window, development of TP-based educational software can take +benefit from the fact, that the TPs leading in Europe, Coq~\cite{coq-team-10} and +Isabelle are still open source together with the major part of +mechanised knowledge.%~\footnote{NICTA}. + +\bibliographystyle{alpha} +{\small\bibliography{references}} + +\end{document} +% LocalWords: TP IST SPSC Telematics Dialogues dialogue HOL bool nat Hindley +% LocalWords: Milner tt Subproblem Formulae ruleset generalisation initialised +% LocalWords: axiomatization LCF Simplifiers simplifiers Isar rew Thm Calc SML +% LocalWords: recognised hoc Trueprop redexes Unsynchronized pre rhs ord erls +% LocalWords: srls prls nrls lhs errpats InverseZTransform SubProblem IDE IDEs +% LocalWords: univariate jEdit rls RealDef calclist familiarisation ons pos eq +% LocalWords: mout ctree SignalProcessing frac ZZ Postcond Atools wiki SML's +% LocalWords: mechanisation multi diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/eJMT-paper/references.bib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/eJMT-paper/references.bib Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,343 @@ +@Misc{coq-team-10, + author = {Coq development team}, + title = {Coq 8.3 Reference Manual}, + howpublished = {http://coq.inria.fr/reman}, + year = {2010}, + note = {INRIA} +} + +@Book{db:dom-eng, + author = {Bj{\o}rner, Dines}, + title = {Domain Engineering. Technology Management, Research and Engineering}, + publisher = {JAIST Press}, + year = {2009}, + month = {Feb}, + series = {COE Research Monograph Series}, + volume = {4}, + address = {Nomi, Japan} +} + +@INPROCEEDINGS{Hansen94b, + KEY = "Hansen94", + AUTHOR = "Kirsten Mark Hansen", + EDITOR = "M. Naftalin, T. Denvir, M. Bertran", + TITLE = "Validation of a Railway Interlocking Model", + BOOKTITLE = "FME'94: Industrial Benefit of Formal Methods", + PUBLISHER = "Springer-Verlag", + YEAR = "1994", + MONTH = "October", + PAGES = "582-601", + ANNOTE = "", + COMMENT = "PGL has got the proceedings. ADN" +} + +@INPROCEEDINGS{Dehbonei&94, + KEY = "Dehbonei\&94", + AUTHOR = "Dehbonei, Babak and Mejia, Fernando", + EDITOR = "M. Naftalin, T. Denvir, M. Bertran", + TITLE = "Formal Methods in the Railways Signalling Industry", + BOOKTITLE = "FME'94:Industrial Benefit of Formal Methods", + PUBLISHER = "Springer-Verlag", + YEAR = "1994", + MONTH = "October", + PAGES = "26-34", + ANNOTE = "", + COMMENT = "Peter has got the proceedings. ADN" +} + +@Book{db:SW-engIII, + author = {Bj{\o}rner, Dines}, + title = {Software Engineering}, + publisher = {Springer}, + year = {2006}, + volume = {3}, + series = {Texts in Theoretical Computer Science}, + address = {Berlin, Heidelberg} +} + +@Book{pl:milner97, + author = {Robin Milner and Mads Tofte and Robert Harper and David MacQueen}, + title = {The Definition of Standard ML (Revised)}, + publisher = {The MIT Press}, + year = 1997, + address = {Cambridge, London}, + annote = {97bok375} +} + +@book{nipk:rew-all-that, + title={Term rewriting and all that}, + author={Baader, Franz and Nipkow, Tobias }, + publisher={Cambridge University Press},year={1998}, + volume={},series={},address={},edition={},month={}, + note={},status={},source={},location={IST} + } + +@Misc{jrocnik-bakk, + author = {Jan Rocnik}, + title = {Interactive Course Material for Signal Processing based on Isabelle/{\isac}}, + howpublished = {Bakkalaureate Thesis}, + year = {2012}, + note = {IST, Graz University of Technology, http://www.ist.tugraz.at/projects/isac/publ/jrocnik\_bakk.pdf} +} + +@book{proakis2004contemporary, + title={Contemporary communication systems using MATLAB and Simulink}, + author={Proakis, J.G. and Salehi, M. and Bauch, G.}, + isbn={9780534406172}, + lccn={31054410}, + series={BookWare companion series}, + url={http://books.google.at/books?id=5mXGQgAACAAJ}, + year={2004}, + publisher={Thomson--Brooks/Cole} +} +@book{oppenheim2010discrete, + title={Discrete-time signal processing}, + author={Oppenheim, A.V. and Schafer, R.W.}, + isbn={9780131988422}, + series={Prentice-Hall signal processing series}, + url={http://books.google.at/books?id=mYsoAQAAMAAJ}, + year={2010}, + publisher={Prentice Hall} +} +@manual{wenzel2011system, + title={The Isabelle System Manual}, + author={Wenzel, M. and Berghofer, S.}, + organization={TU Muenchen}, + year={2011}, + month={January} +} +@Book{Nipkow-Paulson-Wenzel:2002, + author = {Tobias Nipkow and Lawrence C. Paulson and Markus Wenzel}, + title = {{Isabelle/HOL} --- A Proof Assistant for Higher-Order Logic}, + publisher = {Springer}, + series = {LNCS}, + volume = 2283, + year = 2002} +@Book{progr-mathematica, + author = {Maeder, Roman E.}, + title = {Programming in Mathematica}, + publisher = {Addison-Wesley}, + address = {Reading, Mass.}, + year = {1997} +} +@Book{prog-maple06, + author = {Aladjav, Victor and Bogdevicius, Marijonas}, + title = {Maple: Programming, Physical and Engineering Problems}, + publisher = {Fultus Corporation}, + year = {2006}, + month = {February 27}, + annote = {ISBN: 1596820802} +} +@Article{plmms10, + author = {Florian Haftmann and Cezary Kaliszyk and Walther Neuper}, + title = {{CTP}-based programming languages~? Considerations about an experimental design}, + journal = {ACM Communications in Computer Algebra}, + year = {2010}, + volume = {44}, + number = {1/2}, + pages = {27-41}, + month = {March/June} +} +@inproceedings{casproto, + author = {Cezary Kaliszyk and + Freek Wiedijk}, + title = {Certified Computer Algebra on Top of an Interactive Theorem + Prover}, + booktitle = {Calculemus}, + year = {2007}, + pages = {94-105}, + ee = {http://dx.doi.org/10.1007/978-3-540-73086-6_8}, + crossref = {DBLP:conf/mkm/2007}, + bibsource = {DBLP, http://dblp.uni-trier.de} +} +@InProceedings{wn:lucas-interp-12, + author = {Neuper, Walther}, + title = {Automated Generation of User Guidance by Combining Computation and Deduction}, + booktitle = {THedu'11: CTP-compontents for educational software}, + year = {2012}, + editor = {Quaresma, Pedro}, + publisher = {EPTCS}, + note = {To appear} +} +@Manual{Huet_all:94, + author = {Huet, G. and Kahn, G. and Paulin-Mohring, C.}, + title = {The Coq Proof Assistant}, + institution = {INRIA-Rocquencourt}, + year = {1994}, + type = {Tutorial}, + number = {Version 5.10}, + address = {CNRS-ENS Lyon}, + status={},source={Theorema},location={-} +} +@TECHREPORT{Back-SD09, + author = {Back, Ralph-Johan}, + title = {Structured Derivations as a Unified Proof Style for Teaching Mathematics}, + institution = {TUCS - Turku Centre for Computer Science}, + year = {2009}, + type = {TUCS Technical Report}, + number = {949}, + address = {Turku, Finland}, + month = {July} +} +@InProceedings{ActiveMath-MAIN11, + author = {Melis, Erica and Siekmann, Jörg}, + title = {An Intelligent Tutoring System for Mathematics}, + booktitle = {Seventh International Conference Artificial Intelligence and Soft Computing (ICAISC)}, + pages = {91-101}, + year = {2004}, + editor = {Rutkowski, L. and Siekmann, J. and Tadeusiewicz, R. and Zadeh, L.A.}, + number = {3070,}, + series = {LNAI}, + publisher = {Springer-Verlag}, + doi = {doi:10.1007/978-3-540-24844-6\_12}} +@TechReport{mat-tutor-cmu-MAIN11, + author = {John R. Anderson}, + title = {Intelligent Tutoring and High School Mathematics}, + institution = {Carnegie Mellon University, Department of Psychology}, + year = {2008}, + type = {Technical Report}, + number = {20}, + note = {http://repository.cmu.edu/psychology/20} +} +@PhdThesis{proof-strategies-11, + author = {Dietrich, Dominik}, + title = {Proof Planning with Compiled Strategies}, + school = {FR 6.2 Informatik, Saarland University}, + year = {2011} +} +@proceedings{DBLP:conf/mkm/2007, + editor = {Manuel Kauers and + Manfred Kerber and + Robert Miner and + Wolfgang Windsteiger}, + title = {Towards Mechanized Mathematical Assistants, 14th Symposium, + Calculemus 2007, 6th International Conference, MKM 2007, + Hagenberg, Austria, June 27-30, 2007, Proceedings}, + booktitle = {Calculemus/MKM}, + publisher = {Springer}, + series = {Lecture Notes in Computer Science}, + volume = {4573}, + year = {2007}, + isbn = {978-3-540-73083-5}, + bibsource = {DBLP, http://dblp.uni-trier.de} +} + +@InProceedings{gdaroczy-EP-13, + author = {Gabriella Dar\'{o}czy and Walther Neuper}, + booktitle = {unknown}, + title = {Error-Patterns within ``Next-Step-Guidance'' in TP-based Educational Systems}, + OPTpages = {TODO-TODO}, + crossref = {eduTPS-12}, + note = {to appear in this publication} +} + + +@Proceedings{eduTPS-12, + title = {Theorem-Prover based Systems for Education (eduTPS)}, + year = {2013}, + OPTkey = {}, + OPTbooktitle = {}, + OPTeditor = {}, + OPTvolume = {}, + OPTnumber = {}, + OPTseries = {}, + OPTaddress = {}, + OPTmonth = {}, + OPTorganization = {}, + publisher = {The Electronic Journal of Mathematics and Technology}, + note = {to appear}, + OPTannote = {} +} + +@Misc{nipkow-prog-prove, + author = {Nipkow, Tobias}, + title = {Programming and Proving in {Isabelle/HOL}}, + howpublished = {contained in the Isabelle distribution}, + month = {May 22}, + year = {2012} +} + +@Book{pl:hind97, + author = {J. Roger Hindley}, + title = {Basic Simple Type Theory}, + publisher = {Cambridge University Press}, + year = 1997, + editor = {S. Abramsky and P. H. Aczel and others}, + number = 42, + series = {Cambridge Tracts in Theoretical Computer Science}, + address = {Cambridge}, + annote = {97bok308} +} + +@Article{Milner-78, + author = {Milner, R.}, + title = {A Theory of Type Polymorphism in Programming}, + journal = {Journal of Computer and System Science (JCSS)}, + year = {1978}, + number = {17}, + volume = {0}, + pages = {348-374} +} + +@inproceedings{Wenzel-11:doc-orient, + author = {Wenzel, Makarius}, + title = {Isabelle as document-oriented proof assistant}, + booktitle = {Proceedings of the 18th Calculemus and 10th international conference on Intelligent computer mathematics}, + series = {MKM'11}, + year = {2011}, + isbn = {978-3-642-22672-4}, + location = {Bertinoro, Italy}, + pages = {244--259}, + numpages = {16}, + url = {http://dl.acm.org/citation.cfm?id=2032713.2032732}, + acmid = {2032732}, + publisher = {Springer-Verlag}, + address = {Berlin, Heidelberg}, +} +@InProceedings{makar-jedit-12, + author = {Makarius Wenzel}, + title = {Isabelle/{jEdit} — a Prover IDE within the {PIDE} framework}, + booktitle = {Conference on Intelligent Computer Mathematics (CICM 2012)}, + year = {2012}, + editor = { J. Jeuring and others}, + number = {7362}, + series = {LNAI}, + publisher = {Springer} +} + +@InProceedings{Makarius-09:parall-proof, + author = {Wenzel, Makarius}, + title = {Parallel Proof Checking in {Isabelle/Isar}}, + booktitle = {ACM SIGSAM 2009 International Workshop on Programming Languages for Mechanized Mathematics Systems (PLMMS)}, + year = {2009}, + editor = {Dos Reis and L. Th\'ery}, + address = {Munich}, + month = {August}, + publisher = {ACM Digital library} +} + +@Book{fm-03, + author = {Jean Francois Monin and Michael G. Hinchey}, + title = {Understanding formal methods}, + publisher = {Springer}, + year = {2003} +} + +@misc{wiki:1, + author = {Wikipedia}, + Title = {Table of common Z-transform pairs}, + year = {2012}, + url = {http://en.wikipedia.org/wiki/Z-transform#Table_of_common_Z-transform_pairs}, + note = {[Online; accessed 31-Oct-2012]} + } + +@InProceedings{kremp.np:assess, + author = {Krempler, Alan and Neuper, Walther}, + title = {Formative Assessment for User Guidance in Single Stepping Systems}, + booktitle = {Interactive Computer Aided Learning, Proceedings of ICL08}, + year = {2008}, + editor = {Aucher, Michael E.}, + address = {Villach, Austria}, + note = {$\,$\\http://www.ist.tugraz.at/projects/isac/publ/icl08.pdf} +} + diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/final/jrocnik_bakk.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/final/jrocnik_bakk.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,688 @@ +% Title: bakkarbeit_jrocnik.tex +% Author: Jan Rocnik +% (c) copyright due to lincense terms. +%2345678901234567890123456789012345678901234567890123456789012345678901234567890 +% 10 20 30 40 50 60 70 80 + +%define document class +\documentclass[a4paper, 12pt]{article} + +%packages for language and input +\usepackage[english]{babel} +\usepackage[T1]{fontenc} +\usepackage[latin1]{inputenc} + +%generel packages +\usepackage{url} +\usepackage{endnotes} +\usepackage{trfsigns} +\usepackage{setspace} +\usepackage[pdfpagelabels]{hyperref} +\usepackage{longtable} + +\usepackage{float} %For restylefloat +\newfloat{example}{ht}{} %self made floats +\floatname{example}{Example} %name for float +\restylefloat{table} %float tables +\floatstyle{ruled} %boxes around floats +\restylefloat{example} %float examples --> boxes +\restylefloat{figure} + +%colors and graphics +\usepackage{graphicx} +\usepackage{color} +\definecolor{lgray}{RGB}{238,238,238} + +%isabelle relevant packages +\usepackage{isabelle,isabellesym} +%\isabellestyle{it} + +%define isac logos +\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} +\def\sisac{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} + +\newcommand{\HRule}{\rule{\linewidth}{0.2mm}} + +%start new even page +\usepackage{ifthen} +\newcommand{\newevenside}{ + \ifthenelse{\isodd{\thepage}}{\newpage}{ + \newpage + \phantom{placeholder} % doesn't appear on page + \thispagestyle{empty} % if want no header/footer + \newpage + } +} + +%this should be the last package used +%\usepackage{pdfsetup} + +%----------// BEGIN DOCUMENT \\----------% + +\begin{document} + +%----------// TITLE PAGE \\----------%1 + +\input{./bakkarbeit_titlepage.tex} +\newpage + +%----------// EMPTY PAGE \\----------%2 + +\setcounter{page}{2} +\thispagestyle{empty}\mbox{}\newpage + +%----------// THANKS \\----------%3 + +\setcounter{page}{3} +\begin{center} + Special Thanks to\\ + \hfill \\ + \emph{Dr.techn. Walther Neuper}\\ + \emph{Dipl.-Ing. Bernhard Geiger} +\end{center} +\thispagestyle{empty} +\newpage + +%----------// EMPTY PAGE \\----------%4 + +%the following command was replaced by \newevenside +%\thispagestyle{empty}\mbox{}\newpage + +%----------// ABSTRACT \\----------%5 + +\newevenside +\begin{abstract} +The Baccalaureate Thesis creates interactivee course material for Signal Processing (SP) based on the experimental educational math assistant Isabelle/{\sisac} ({\em Isa}belle for Transparent {\em C}alculations in Applied Mathematics). +\par The content of the course material is defined together with the Institute for Signal Processing and Speech Communication (SPSC) of Graz University of Technology (TUG). The content is planned to be used in specific lectures and labs of the SPSC and thus is thoroughly concerned with underlying mathematical and physical theory. +One challenge of this thesis is, that much theory required for SPSC is not yet mechanized in Computer Theorem Provers (TP); so this thesis will provide preliminary definitions and theorems (without proofs~!) implemented in Isabelle \emph{theories}. +\par Another challenge is the implementation of interactivee courses: this is done within the educational math assistant Isabelle/{\sisac}, which is under development at Austrian Universities, one of them TU Graz. The present state of {\sisac{}} happens to provide the {\em first} occasion for authoring by a non-member of the {\sisac}-developer team. So this challenge involves alpha-testing of the underlying \emph{TP-based programing language}, because error messages are still not user-friendly and need frequent contact with {\sisac}-developers. +So the practical outcome of this thesis is twofold: +\begin{enumerate} +\item Interactive course material hopefully useful in education within the SPSC and within \emph{STEOP}\footnote{German: "`Studieneingangs- und Orientierungsphase"'}, the introductory orientation phase at TUG, as a preview for students in Telematics on later application of math knowledge introduced in the first semester and +\item A detailed description of technicalities in programing implemented as an interactivee Isabelle/Isar theory, providing future programers with guidelines and {\sisac}-developers with feedback in usability of the CTP-based program language. +\end{enumerate} +\end{abstract} +\clearpage + +%----------// EMPTY PAGE \\----------%6 + +%the following command was replaced by \newevenside +%\thispagestyle{empty}\mbox{}\newpage + +%----------// T O C \\----------%7-9 + +\newevenside + +\pagenumbering{Roman} +%This thesis is structured into a fundamental part introducing the motivation, the basic notions concerning the thesis aswell as the {\sisac{}} project and describing the mathematic base. Further a automatically generated practical part representing the work on {\sisac{}} which can be extended. +\tableofcontents +\clearpage +\pagenumbering{arabic} +\setcounter{page}{10} + +%----------// PART-1 \\----------% + +\newevenside + +\part{Project Fundamentals} + +\section{Introduction} +Didactics of mathematics faces a specific issue, a gap between (1) introduction of math concepts and skills and (2) application of these concepts and skills, which usually are separated into different units in curricula (for good reasons). For instance, (1) teaching partial fraction decomposition is separated from (2) application for inverse Z-transform in signal processing. + +This gap is an obstacle for applying math as an fundamental thinking technology in engineering: In (1) motivation is lacking because the question ``What is this stuff good for~?'' cannot be treated sufficiently, and in (2) the ``stuff'' is not available to students in higher semesters as widespread experience shows. + +\medskip +Motivated by this didactical issue on the one hand, and ongoing R\&D on a novel kind of educational mathematics assistant at Graz University of Technology~\footnote{http://www.ist.tugraz.at/isac/} promising to cope with this issue on the other hand, several institutes are planning to join their expertise: the Institutes for Institute for Information Systems and Computer Media (IICM), the Institute for Software Technology (IST), the Institutes for Mathematics, the Signal Processing and Speech Communication Institute (SPSC), the Institute for Structural Analysis and the Institute of Electrical Measurement and Measurement Signal Processing. +\par This thesis is the first attempt to tackle the above mentioned issue, it focuses on Telematics, because these specific studies focus on mathematics in \emph{STEOP}, the introductory orientation phase. \emph{STEOP} is considered an opportunity to investigate the impact of {\sisac}'s prototype on the issue and others. + +\medskip +The thesis is structured as follows: Part~I concerns theory and project controlling, Part~II the implementation work, where the latter is the main work, Part~III the resume including summary, open questions and conclusion and the appendixes in Part~IV. +\par In part I, Section~\ref{isabisac} gives a brief description of the state-of-the-art for educational math assistants (Section~\ref{emas}) and introduces the notions required for the implementation work (Section~\ref{math-auth}). In particular, Section~\ref{user-guid} explains, why math authoring in {\sisac{}} is {\em not} concerned with interaction (and thus not with user guidance etc at all~!). So a concise description of the thesis' goals needs to be postponed to Section~\ref{sec:goals}. +\par Section~\ref{sp} analyzes a problems defined by the SPSC for the knowledge already provided (Section~\ref{know-isab}, Section~\ref{know-isac}), discusses the selection of problems for implementation (Section~\ref{know-missing}) TODO: further structure ? +%(\S\ref{}) + +\section{Mechanization of Math in Isabelle/ISAC\label{isabisac}} + +%\subsubsection*{Notes on Mechanization of Mathematics} +%This thesis tries to \emph{connect} these two worlds and is one of the first guidelines to implement problem classes in {\sisac}. As we are still in a eary part of development, this is the first thesis dealing within this topic and there is \emph{no} related work to guid through. A more detailed description about this fact can be found in Section \ref{sec:related}. +%The major challenge of the practical part, of this thesis, is, that "connecting the two worlds" involves programing in a CTP-based programing language which is in a very early state of prototyping. There is no concrete experience data ready to grep. +% +As mentioned in the introduction, a prototype of an educational math assistant called {\sisac}\footnote{{\sisac}=\textbf{Isa}belle \cite{Nipkow-Paulson-Wenzel:2002} for \textbf{C}alculations, see http://www.ist.tugraz.at/isac/.} bridges the gap between (1) introducation and (2) application of mathematics: {\sisac} is based on Computer Theorem Proving (TP), a technology which requires each fact and each action justified by formal logic, so {{\sisac{}}} makes justifications transparent to students in interactivee step-wise problem solving. By that way {\sisac} already can serve both: +\begin{enumerate} +\item Introduction of math stuff (in e.g. partial fraction decomposition) by stepwise explaining and exercising respective symbolic calculations with ``next step guidance (NSG)'' and rigorously checking steps freely input by students --- this also in context with advanced applications (where the stuff to be taught in higher semesters can be skimmed through by NSG), and +\item Application of math stuff in advanced engineering courses (e.g. problems to be solved by inverse Z-transform in a Signal Processing Lab) --- and now without much ado about basic math techniques (like partial fraction decomposition): ``next step guidance'' supports students in independently (re-)adopting such techniques. +\end{enumerate} +Before the question is answers, how {\sisac} accomplishes this task from a technical point of view, some remarks on the state-of-the-art is given, therefor follow up Section~\ref{emas}. + +\subsection{Educational Mathematics Assistants (EMAs)}\label{emas} +Educational software in mathematics is, if at all, based on Computer Algebra Systems (CAS, for instance \cite{progr-mathematica,prog-maple06}), Dynamic Geometry Systems (DGS, for instance \footnote{GeoGebra http://www.geogebra.org, Cinderella http://www.cinderella.de/, GCLC http://poincare.matf.bg.ac.rs/~janicic/gclc/}) or spread-sheets. These base technologies are used to program math lessons and sometimes even exercises. The latter are cumbersome: the steps towards a solution of such an interactivee exercise need to be provided with feedback, where at each step a wide variety of possible input has to be foreseen by the programer --- so such interactivee exercises either require high development efforts or the exercises constrain possible inputs. + +A new generation of educational math assistants (EMAs) is emerging presently, which is based on Theorem Proving (TP). TP, for instance Isabelle \cite{Nipkow-Paulson-Wenzel:2002} and Coq \cite{Huet_all:94}, is a technology which requires each fact and each action justified by formal logic. Pushed by demands for \textit{proven} correctness of safety-critical software TP advances into software engineering; from these advancements computer mathematics benefits in general, and math education in particular. Two features of TP are immediately beneficial for learning: + +\paragraph{TP have knowledge in human readable format,} that is in standard predicate calculus. TP following the LCF-tradition have that knowledge down to the basic definitions of set, equality, etc~\footnote{http://isabelle.in.tum.de/dist/library/HOL/HOL.html}; following the typical deductive development of math, natural numbers are defined and their properties proven~\footnote{http://isabelle.in.tum.de/dist/library/HOL/Number\_Theory/Primes.html}, etc. Present knowledge mechanized in TP exceeds high-school mathematics by far, however by knowledge required in software technology, and not in other engineering sciences. + +\paragraph{TP can model the whole problem solving process} in mathematical problem solving {\em within} a coherent logical framework. This is already being done by three projects, by Ralph-Johan Back \cite{Back-SD09}, by ActiveMath \cite{ActiveMath-MAIN11} and by Carnegie Mellon Tutor \cite{mat-tutor-cmu-MAIN11}. + +Having the whole problem solving process within a logical coherent system, such a design guarantees correctness of intermediate steps and of the result (which seems essential for math software); and the second advantage is that TP provides a wealth of theories which can be exploited for mechanizing other features essential for educational software. + +\subsection{Generation of User Guidance in EMAs}\label{user-guid} +One essential feature for educational software is feedback to user input and assistance in coming to a solution. + +\paragraph{Checking user input} by ATP during stepwise problem solving is being accomplished by the three projects mentioned above \cite{Back-SD09,ActiveMath-MAIN11,mat-tutor-cmu-MAIN11} exclusively. They model the whole problem solving process as mentioned above, so all what happens between formalized assumptions (or formal specification) and goal (or fulfilled postcondition) can be mechanized. Such mechanization promises to greatly extend the scope of educational software in stepwise problem solving. + +\paragraph{Next step guidance (NSG)} comprises the system's ability to propose a next step; this is a challenge for TP: either a radical restriction of the search space by restriction to very specific problem classes is required, or much care and effort is required in designing possible variants in the process of problem solving \cite{proof-strategies-11}. + +Another approach is restricted to problem solving in engineering domains, where a problem is specified by input, precondition, output and postcondition, and where the postcondition is proven by ATP behind the scenes \cite{wn:lucas-interp-12}: Here the possible variants in the process of problem solving are provided with feedback {\em automatically}, if the problem is described in a TP-based programing language~\cite{plmms10}: the programer only describes the math algorithm without caring about interaction (the respective program is functional and even has no in/output statements~!); interaction is generated as a side-effect by the interpreter --- an efficient separation of concern between math programers and dialog designers promising application all over engineering disciplines. + + +\subsection{Math Authoring in Isabelle/ISAC\label{math-auth}} +Authoring new mathematics knowledge in {\sisac} can be compared with ``application programing'' of engineering problems; most of such programing uses CAS-based programing languages (CAS = Computer Algebra Systems; e.g. Mathematica's \cite{progr-mathematica} or Maple's programing language \cite{prog-maple06}). + +{\sisac}, however, uses a novel type of TP-based language \cite{plmms10} for describing how to construct a solution to an engineering problem and for calling equation solvers, integration, etc~\footnote{Implementation of CAS-like functionality in TP is not primarily concerned with efficiency, but with a didactic question: What to decide for: for high-brow algorithms at the state-of-the-art or for elementary algorithms comprehensible for students~?} within TP; TP can ensure ``systems that never make a mistake'' \cite{casproto} --- are impossible for CAS which have no logics underlying. + +With writing such TP-based programs authoring is perfect, the application programer is not concerned with interaction or with user guidance: this is concern of a novel kind of program interpreter called Lucas-Interpreter \cite{wn:lucas-interp-12}. This interpreter hands over control to a dialog component at each step of calculation (like a debugger at breakpoints) and calls automated TP to check user input following personalized strategies according to a feedback module. + +\medskip +However ``application programing with TP'' is not done with writing a program: according to the principles of TP, each step must be justified. Such justifications are given by theorems. So all steps must be related to some theorem, if there is no such theorem it must be added to the existing knowledge, which is organized in so-called \textbf{theories} in Isabelle. A theorem must be proven; fortunately Isabelle comprises a mechanism (called ``axiomatization''), which allows to omit proofs. Such a theorem is shown in Example~\ref{eg:neuper1}. + +\begin{example} +{\small\begin{tabbing} +123\=123\=123\=123\=\kill +\hfill \\ +\>axiomatization where \\ +\>\> rule1: "1 = $\delta$ [n]" and\\ +\>\> rule2: "|| z || > 1 ==> z / (z - 1) = u [n]" and\\ +\>\> rule3: "|| z || < 1 ==> z / (z - 1) = -u [-n - 1]" and \\ +\>\> rule4: "|| z || > || $\alpha$ || ==> z / (z - $\alpha$) = $\alpha^n$ * u [n]" and\\ +\>\> rule5: "|| z || < || $\alpha$ || ==> z / (z - $\alpha$) = -($\alpha^n$) * u [-n - 1]" and\\ +\>\> rule6: "|| z || > 1 ==> z/(z - 1)$^2$ = n $\cdot$ u [n]" +\end{tabbing} +} +\caption{Axiomatization in Isabelle\label{eg:neuper1}} +\end{example} + +In order to provide TP with logical facts for checking user input, the Lucas-Interpreter requires a \textbf{specification}. Such a specification is shown in Example~\ref{eg:neuper2}. + +\begin{example} +{\small\begin{tabbing} +123,\=postcond \=: \= $\forall \,A^\prime\, u^\prime \,v^\prime.\,$\=\kill +\hfill \\ +Specification no.1:\\ +%\>input\>: $\{\;r={\it arbitraryFix}\;\}$ \\ +\>input \>: $\{\;r\;\}$ \\ +\>precond \>: $0 < r$ \\ +\>output \>: $\{\;A,\; u,v\;\}$ \\ +\>postcond \>:{\small $\;A=2uv-u^2 \;\land\; (\frac{u}{2})^2+(\frac{v}{2})^2=r^2 \;\land$}\\ +\> \>\>{\small $\;\forall \;A^\prime\; u^\prime \;v^\prime.\;(A^\prime=2u^\prime v^\prime-(u^\prime)^2 \land +(\frac{u^\prime}{2})^2+(\frac{v^\prime}{2})^2=r^2) \Longrightarrow A^\prime \leq A$} \\ +\>props\>: $\{\;A=2uv-u^2,\;(\frac{u}{2})^2+(\frac{v}{2})^2=r^2\;\}$ +\end{tabbing} +} +\caption{Specification for the Lucas-Interpreter\label{eg:neuper2}} +\end{example} + +Such a specification is checked before the execution of a program is started, the same applies for sub-programs. In the following example program (Example~\ref{eg:subprob}) the sub-programs are designated by \ttfamily SubProblem \normalfont: + +\begin{example} +\hfill \\ +{\ttfamily \begin{tabbing} +``(L\_L::bool list) = (\=SubProblem (\=Test','' \\ +``\>\>[linear,univariate,equation,test],'' \\ +``\>\>[Test,solve\_linear])'' \\ +``\>[BOOL equ, REAL z])'' \\ +\end{tabbing} +} +{\small\textit{ + \noindent If a program requires a result which has to be calculated first we can use a subproblem to do so. In our specific case we wanted to calculate the zeros of a fraction and used a subproblem to calculate the zeros of the denominator polynom. + }} +\caption{Usage of Subproblems in Programs\label{eg:subprob}} +\end{example} + + +\subsection{Goals of the Thesis}\label{sec:goals} +Imagine a piece of software would be able to support you by understanding every problem class, upcoming in the first years attending university - wouldn't it be great? +\par {{\sisac{}}} tries to do that, but the current state of the art is miles away from this goal and a single implementation of a problem is not enough to change this circumstance. Through this fact it is all the more essential to try, test, research and document the implementation of problem classes from "`real world"' applications. Responding to the abstract at the begin of this document the thesis has two folds; on the one hand certainly to provide interactivee course material for Signal Processing (which means to implement a single problem provided by the Institute of Signal Processing and Speech Communication (SPSC); follow up Calulcations), and to extract experience data respectively help the {{\sisac{}}}-team by setting up a detailed description of technicalities hacking {\sisac{}} on the other hand. + +All the notions are in place to describe the task ``Interactive Course Material for Signal Processing based on Isabelle/{\sisac}'', the main task of this thesis, appropriately by the following points: +\begin{enumerate} +\item Analyze the problems given by the SPSC Lab for mathematics \textbf{knowledge required}, search the knowledge already available in Isabelle/{\sisac}, estimate efforts required to fill the gap between knowledge required and knowledge available, and finally select problems for implementation accordingly. +\item Implement the selected problems in Isabelle/{\sisac}, which means, in appropriate Isabelle theories \textbf{for each problem} implement: + \begin{enumerate} + \item \textbf{Definitions and theorems} required within the specification (including ``descriptions'' for input variables and output variables) and the program (proofs omitted via ``axiomatization'') + \item \textbf{A specification} which describes the input variables, the preconditions on the input (a challenge for rigorously exact mathematics~!), the output variables and the postcondition, which relates input to output such that the problem is characterized formally (another challenge for rigorously exact mathematics~!) + \item \textbf{A program} describing the algorithm which solves the problem, i.e. which constructs output meeting the postcondition. Programming involves identifying the steps (tactics~!) which create the calculation and calling CAS-functions (simplification, equation solvers, etc) appropriately. Modularization of programs into {\tt SubProblems} has to prepare for re-use of code. + \end{enumerate} +\item Add \textbf{multimedia explanations} to each problem (i.e. to specific definitions, theorems, the specification and the program) such that non-expert students (e.g. within \emph{STEOP}, the introductory orientation phase at TUG) get an idea the problem is about. +\item \textbf{Document the implementation} such that + \begin{enumerate} + \item Interactive course material hopefully useful in education within the SPSC and within \emph{STEOP}, the introductory orientation phase at TUG, as a preview for students in Telematics on later application of math knowledge introduced in the first semester and + \item A detailed description of technicalities in programing implemented as an interactivee Isabelle/Isar theory, providing future programers with guidelines and {\sisac}-developers with feedback in usability of the TP-based program language. + \item subsequent application programers have guidelines for further implementation of interactivee course material in SPSC and other engineering sciences + \item {\sisac{}} developers get feedback for ongoing improvement of the TP-based programing language, the respective development environment and the respective program interpreter (called Lucas-Interpreter) + \item development of knowledge for engineering sciences is being motivated in the Isabelle community. + \end{enumerate} +\end{enumerate} + + +\section{Mechanization of Signal Processing Problems}\label{sp} +\subsection{Relevant Knowledge available in Isabelle}\label{know-isab} +Isabelle is developed now for a long time and so we are able to access a huge range of theories and useful snippets. The main problem according this snip sets is that isabelle still is a theorem proofer and not an algebra system. But due the work of the {\sisac}-development team there are already also many calculation examples provided. +\par The SPSC provided a list of problems which are often done wrong or are misunderstood by students in term of the problem classes. Out of these tasks we tried to extract the core operations and looked up which parts are already implemented or useful. The provided problem classes are: +\begin{itemize} + \item Fourier-Transformation + \item Convolution + \item Inverse Z-Transformation and partial fraction decomposition + \item Index transformation +\end{itemize} + +A survey of these selected Problems on their "`correct"' solution can be found in Appendix~\ref{app:calc}. After manually solving this problems we started checking which of them are able to realizable. As already remarked above, isabelle is just a theorem proover due this fact isabelle only provides some theories which are useful for the provided problem classes. +\par Yet, isabelle also has some problems on traditional notation. For example a theory called FFT is already implemented this theory does not provide methods for solving fourier transformation tasks, it only defines the basic condition a fast Fourier transformed expression has to fulfill. +\par For the problems we had a look-on isabelle did not provide specific theories which can be implemented one by one, so a look at the mechanized knowledge in {\sisac} is the next step, therefore follow up Section~\ref{know-isac}. + +\subsection{Relevant Knowledge available in ISAC}\label{know-isac} +{\sisac} already provides a small registry of useful programs and surveys on using isabelle as for solving problems. These snip sets are things like norming rational numbers, solving variate and univariate equations, substitutions, some simple integrals and so on. For a detailed review on the currently implemented theories a look at the {\sisac} project web-page\footnote{http://www.ist.tugraz.at/projects/isac/www/kbase/pbl/index\_pbl.html} is strongly recommended, as the appreciation for this thesis is no describing all parts of {\sisac} in detail. This would also not be possible as {\sisac} is permanently growing. +\par After we differenced {\sisac} and isabelle we are able to introduce two axes in the project. This axes are the specifications (``application axis'' represented as isabelle) and methods (``algorithmic axis'' represented as {\sisac}). +\par During the first weeks of work on this thesis we decided on implementing the Z-Transformation and particullary the included partial fraction decomposion first. The algoritmix axis therefor already provides the knowledge for the following parts: +\begin{description} +\item[Partial Fractions] We now how to handle them and we are able to illustrate them. +\item[Cancellation of multivariate rational terms] Simplification is possible. +\item[Equations] The possibility of solving linear and second order equations is provided, also the possibility to get the left or right hand side of an equation. +\item[Substitution] We are able to substitute given variables in terms, we are also able to subsitude a list of variables in terms. +\end{description} + +\subsection{Survey on Required Knowledge}\label{know-missing} +Following tables (Table~\ref{tab:eff-four},~\ref{tab:eff-conv},~\ref{tab:eff-ztrans}) are showing the expected development effort for specific problems. The values are only very inaccurately approximations of the real work, but needed as a basis for descieding with which problem to start: + +\begin{table} + \centering + \begin{tabular}{p{4cm}|p{5cm}|rp{2.5cm}} + \textbf{Requirements} & \textbf{Comments} &\textbf{Effort}\\ \hline\hline + solving Integrals & simple via properties table & 20\\ + & \emph{real} & MT\\ \hline + transformation table & simple transform & 20\\ \hline + visualisation & backend & 10\\ \hline + example collection & with explanations & 20\\ \hline\hline + \multicolumn{2}{c|}{} & 70-80\\ + \end{tabular} + + \caption{Fourier-Transformation development effort\label{tab:eff-four}} +\end{table} + + +\begin{table} + \centering + \begin{tabular}{p{4cm}|p{5cm}|rp{2.5cm}} + \textbf{Requirements} & \textbf{Comments} &\textbf{Effort}\\ \hline\hline + simplify rationals & {\sisac} & 0\\ \hline + define $\sum\limits_{i=0}^{n}i$ & partly {\sisac} & 10\\ \hline + simplify sum & termorder & 10\\ + & simplify rules & 20\\ + & use simplify rationals& 0\\ \hline + index adjustments & with unit step & 10\\ \hline + example collection & with explanations & 20\\ \hline\hline + \multicolumn{2}{c|}{} & 70-90\\ + \end{tabular} + + \caption{Convolution Operations development effort\label{tab:eff-conv}} +\end{table} + +\begin{table} + \centering + \begin{tabular}{p{4cm}|p{5cm}|rp{2.5cm}} + \textbf{Requirements} & \textbf{Comments} &\textbf{Effort}\\ \hline\hline + solve for part.fract. & {\sisac}: degree 2 & 0\\ + & complex nomminators & 30\\ + & degree > 2 & MT\\ \hline + simplify polynomial & {\sisac} & 0\\ + simplify rational & {\sisac} & 0\\ \hline + partial fraction & degree 2, & 20\\ + decomposition & specification, method& 30\\ \hline + ${\cal Z}^{-1}$ table & explanations, figures& 20\\ \hline + example collection & with explanations & 20\\ \hline\hline + \multicolumn{2}{c|}{} & 90-120\\ + \end{tabular} + +\caption{Z-Transformation development effort\label{tab:eff-ztrans}} +\end{table} + +As conclusion of the summarized efforts it is evident that only one topic can be tried to realized as a baccalaureate thesis. In accord with Dr. Neuper we decided after some practical tests to start with the implementation of the (Inverse) Z-Transformation. The Reason is that this topic can mostly be done with knowledge which was already tried to be mechanized in {\sisac}. + +\subsection{Formalization of missing knowledge in Isabelle} + +A problem behind is the mechanization of mathematic theories in TP-bases languages. There is still a huge gap between these algorithms and this what we want as a solution - in Example Signal Processing. +\begin{example} + \[ + X\cdot(a+b)+Y\cdot(c+d)=aX+bX+cY+dY + \] + {\small\textit{ + \noindent A very simple example on this what we call gap is the simplification above. It is needles to say that it is correct and also Isabelle for fills it correct - \emph{always}. But sometimes we don't want expand such terms, sometimes we want another structure of them. Think of a problem were we now would need only the coefficients of $X$ and $Y$. This is what we call the gap between mechanical simplification and the solution. + }} + \caption{Correct but not useful}\label{eg:gap} +\end{example} +Until we are not able to fill this gap we have to live with it but first have a look on the meaning of this statement: +\par Mechanized math starts from mathematical models and \emph{hopefully} proceeds to match physics. Academic engineering starts from physics (experimentation, measurement) and then proceeds to mathematical modeling and formalization. The process from a physical observance to a mathematical theory is unavoidable bound of setting up a big collection of standards, rules, definition but also exceptions. These are the things making mechanization that difficult. +\begin{example} + \[ + m,\ kg,\ s,\ldots + \] + {\small\textit{ + \noindent Think about some units like that one's above. Behind each unit there is a discerning and very accurate definition: One Meter is the distance the light travels, in a vacuum, through the time of 1 / 299.792.458 second; one kilogram is the weight of a platinum-iridium cylinder in paris; and so on. But are these definitions usable in a computer mechanized world?! + }} + \caption{Units in measurement}\label{eg:units} +\end{example} +\par A computer or a TP-System builds on programs with predefined logical rules and does not know any mathematical trick (follow up example \ref{eg:trick}) or recipe to walk around difficult expressions. +\begin{example} +\[ \frac{1}{j\omega}\cdot\left(e^{-j\omega}-e^{j3\omega}\right)= \] +\[ \frac{1}{j\omega}\cdot e^{-j2\omega}\cdot\left(e^{j\omega}-e^{-j\omega}\right)= + \frac{1}{\omega}\, e^{-j2\omega}\cdot\colorbox{lgray}{$\frac{1}{j}\,\left(e^{j\omega}-e^{-j\omega}\right)$}= \] +\[ \frac{1}{\omega}\, e^{-j2\omega}\cdot\colorbox{lgray}{$2\, sin(\omega)$} \] + {\small\textit{ + \noindent Sometimes it is also useful to be able to apply some \emph{tricks} to get a beautiful and particularly meaningful result, which we are able to interpret. But as seen in this example it can be hard to find out what operations have to be done to transform a result into a meaningful one. + }} + \caption{Mathematic tricks}\label{eg:trick} +\end{example} +For such a system the only possibility is to work through its known definitions and stops if none of these fits. Specified on Signal Processing or any other application it is often possible to walk through by doing simple creases. This creases are in generell based on simple math operatiopms but the challenge is to teach the machine \emph{all}\footnote{Its pride to call it \emph{all}.} of them. Unfortunately the goal of TP Isabelle is to reach a high level of \emph{all} but it in real it will still be a survey of knowledge which links to other knowledge and {\sisac{}} a trainer and helper but no human compensating calculator. +\par {{\sisac{}}} itself aims to adds an \emph{application} axis (formal specifications of problems out of topics from Signal Processing, etc.) and an \emph{algorithmic} axis to the \emph{deductive} axis of physical knowledge. The result is a three-dimensional universe of mathematics seen in Figure~\ref{fig:mathuni}. + +\begin{figure} +\hfill \\ + \begin{center} + \includegraphics[scale=0.7]{math-universe} + \end{center} + \caption{Three-dimensional universe of mathematics\label{fig:mathuni}} +\end{figure} + +\subsection{Notes on Problems with Traditional Notation} +Due the thesis work we discovers sever ell problems of traditional notations. Some of them have been known in computer science for many years now and are still unsolved, one of them aggregates with the so called \emph{Lambda Calculus}, Example~\ref{eg:lamda} provides a look on the problem that embarrassed us. + +\begin{example} + +\[ f(x)=\ldots\; \quad R \rightarrow \quad R \] + + +\[ f(p)=\ldots\; p \in \quad R \] + + {\small\textit{ + \noindent Above we see two equations. The first equation aims to be a mapping of an function from the reell range to the reell one, but when we change only one letter we get the second equation which usually aims to insert a reel point $p$ into the reell function. In computer science now we have the problem to tell the machine (TP) the difference between this two notations. This Problem is called Lambda Calculus. + }} + \caption{Towards the Lambda Calculus\label{eg:lamda}} +\end{example} + +An other problem is that terms are not full simplified in traditional notations, in {\sisac} we have to simplify them complete to check weather results are compatible or not. in e.g. the solutions of an second order linear equation is an rational in {\sisac} but in tradition we keep fractions as long as possible and as long as they aim to be 'beautiful' (1/8, 5/16,...). + +The math which should be mechanized in Computer Theorem Provers (\emph{TP}) has (almost) a problem with traditional notations (predicate calculus) for axioms, definitions, lemmas, theorems as a computer program or script is not able to interpret every Greek or Latin letter and every Greek, Latin or whatever calculations symbol. Also if we would be able to handle these symbols we still have a problem to interpret them at all. (Follow up \hbox{Example \ref{eg:symbint1}}) + +\begin{example} + \[ + u\left[n\right] \ \ldots \ unitstep + \] + {\small\textit{ + \noindent The unitstep is something we need to solve Signal Processing problem classes. But in {{\sisac{}}} the rectangular brackets have a different meaning. So we abuse them for our requirements. We get something which is not defined, but usable. The Result is syntax only without semantic. + }} + \caption{Expression Interpretation}\label{eg:symbint1} +\end{example} + +\noindent In different problems, symbols and letters have different meanings and ask for different ways to get through. (Follow up \hbox{Example \ref{eg:symbint2}}) +\begin{example} + \[ + \widehat{\ }\ \widehat{\ }\ \widehat{\ } \ \ldots \ exponent + \] + {\small\textit{ + \noindent For using exponents the three widehat symbols are required. The reason for that is due the development of {{\sisac{}}} the single widehat and also the double were already in use for different operations. + }} + \caption{Symbol Interpretation}\label{eg:symbint2} +\end{example} +Exclusive from the input, also the output can be a problem. We are familiar with a specified notations and style taught in university but a computer program has no knowledge of the form proved by a professor and the machines themselves also have not yet the possibilities to print every symbol (correct) Recent developments provide proofs in a human readable format but according to the fact that there is no money for good working formel editors yet, the style is one thing we have to live with. + +\section{Project Controlling} +We decided to split the thesis into five Iteration defined in Section~\ref{sec:milesurv}. As there is also a lot of work to do outer the thesis we accord on an increased contact by mail. For the coordination of the whole {\sisac} files i got access to the mercurial repository. We also appointed on periodic team meetings. + +\subsection{Survey on Milestones\label{sec:milesurv}} +Doing something completely new requires a good controlling, the thesis itself also needs it. After the first meetings and the definition of the intrinsic work we decided on splitting the thesis into the following iterations. +\begin{description} + \item[1st Iteration] Information Collection + \item[2nd Iteration] Problem Selection + \item[3rd Iteration] Implementation + \item[4th Iteration] Thesis Writing + \item[5th Iteration] Finalization +\end{description} +A more detailed description of this milestones can be found in Section~\ref{sec:detmile}. + +\subsection{Milestone Details\label{sec:detmile}} +\begin{description} + \item[Information Collection] The first iteration starts by an introduction to the {\sisac} System and ends up with the first presentation. Listeners of the first presentation were \em Dr. Walther Neuper \normalfont and \em DI Bernhard Geiger\normalfont. We talked about common SPSC problems and the possibilities of realize them in the {\sisac} System. In preparation of the Presentation \em DI Geiger \normalfont sent us a few example problems and we had a experimental survey about the realization effort. + \item[Problem Selection] In the second iteration we collected informations about the knowledge mechanized in {\sisac} (cf. Section~\ref{know-isab}). After the first iteration it was clear that implementing of problems in {\sisac} requires a higher effort than originally expected due this fact the second iteration ends up on the decision which of the provided problems is going to be implemented. We wrote and collected a handful of experimental scripts regarding sums, Fourier transformation and partial fraction decomposition. + \item[Implementation] Unfortunately the biggest and most important part is the implementation. The iteration started with the decision on the problem and ends up by finishing the test Script (seen in Part~\ref{part:impl}) as well as the integration of this work into the {\sisac}-Knowledge. For a better controlling and result of this iteration we had severe ll regular meetings (\em Dr. Neuper \normalfont and \em Jan Ro\v{c}nik\normalfont) and contact over e-mail to assess the state of the {\sisac}-developers work. + \item[Thesis Writing] One part of this thesis is generated automatically out of \ttfamily Build\_Inverse\_Z\_Transform\normalfont. Maybe this part well be the most important result of the thesis as it will be used as a documentation for the upcoming developers. Due this fact this iteration started also contemporaneous with the implementation but ends up separate after finishing the implementation with describing the needed theory and background. + \item[Finalization] The work ends up with the last iteration - finalization. It is started by completing the written thesis and the preparation of the second presentation which concludes this project. In the second presentation we will have demonstrated our realized problem embedded in the new {\sisac}-frontend as well as the work, hiding behind. We will also want to give a clear view about the power of {\sisac} and animate the attending agents to go on working within this project. +\end{description} + +%\clearpage + +%----------// PART 2 \\----------% + +\newevenside + +\part{Implementation\label{part:impl}} +\input{./preambleForGeneratedDocuments.tex} +\par Please be aware that this is only a part of the thesis output, also follow up the theories and according tests that have been improved or created by me and are involved to the work on this thesis: +\begin{itemize} +\item \ttfamily Partial\_Fractions.thy \normalfont - \ttfamily partial\_fractions.sml \normalfont +\item \ttfamily Inverse\_Z\_Transformation.thy \normalfont - \ttfamily inverse\_z\_transformation.sml \normalfont +\item \ttfamily Rational.thy \normalfont - \ttfamily rational.sml \normalfont +\end{itemize} +\HRule +%\setcounter{section}{0} +\input{../../../test/Tools/isac/ADDTESTS/course/SignalProcess/document/Build_Inverse_Z_Transform} + +\clearpage + +%----------// PART 3 \\----------% + +\newevenside +\part{Thesis Summary and Review} +\section{Related Work}\label{sec:related} +Unusual for a Baccalaureate Thesis, there is {\em no} related work; this requires explanation. +Of course, this thesis relies on front-of-the wave computer mathematics, on TP. But {{\sisac{}}} uses TP in a very specific way, which is too weakly related to other work: programing in the TP-based language and rigorous formal specification of problems in Signal Processing where the main tasks in the practical part of this thesis. The major challenge for the practical work was given by the fact, that the work concerned alpha-testing of the TP-based programing environment. +\par Another area of work could be considered as related work: authoring of e-learning content. However, {{\sisac{}}} provides division of concern such that the practical part of this thesis could focus on computer mathematics; this work was not concerned with interaction (the TP-based programing language has neither input statements nor output statements), nor with dialog guidance nor with any kind of learning theory. +\par These two reasons are given for the unusual statement, that there is no related work to be discussed in this thesis. + +\section{Issues and Open Questions} +At the end of the first Iteration we agreed on a view issues that might have to be accomplished during the thesis. This Issues were: +\begin{itemize} + \item What knowledge is already mechanized in \emph{Isabelle}? + \item How can missing theorems and definitions be mechanized? + \item What is the effort for such mechanization? + \item How do calculations look like, by using mechanized knowledge? + \item What problems and subproblems have to be solved? + \item Which problems are already implemented in {\sisac}? + \item How are the new problems specified ({\sisac})? + \item Which variants of programs in {\sisac} solve the problems? + \item What is the contents of the interactive course material (Figures, etc.)? +\end{itemize} +The significant part of this list was declared during the thesis. Next sections will review the most important items, regardless they where accomplished or not. + +\subsection{Accomplished} +We discovered the process how missing theorems and definitions can be mechanized and used this knowledge to implement new material. Now we ware able to solve partial fractions, we built theorems, specification and program. We completed the background work for interactive solving them. The same thing applies to the inverse Z-transformation with partial fractions; we built theorems, specification and program to step through an amount of exercises. But the most important accomplished part is the Isabelle theory (\ttfamily Build\_Inverse\_Z\_Transform.thy\normalfont) indicating issues for the coming {\sisac}-developers. Until we were not able to fulfill all the things we wanted, this is the most recent work and will be the headstone for the further work on {\sisac}. +\par Expect the necessary theories for solving the mentioned part and the guideline we also put tests for the new theories to the system and added some new methods to existing theories with their according tests. Also we were able to answer the questions about the mechanized knowledge in \emph{isabelle} and {\sisac}. We checked the required effort to add new material to the system and we walked through the question what subproblems have to be solved and how they are declared, when adding new material. Now we also know how problems are declared and which variants exist to solve them. All this can be found in this thesis. +\subsection{Partially Accomplished} +As already told upwards, we accomplished a guideline for upcoming {\sisac}-developers this was a very important and necessary task; but through upcoming changes in the development environment and programing language there is a need for more descriptions and informations. This changes are not yet fulfilled and so it was not possible to include a correct guideline fot them in our example theory or this thesis. +\par Also we were not able to provide a representative count of example problems for partial fractions or the inverse Z-Transformation. We are able to say that our accomplished material can handle one problem each, exactly as we wanted and it is toughed but due to less time we have no more experience data. +\subsection{Not Accomplished} +The properly longest item is the list with the not accomplished issues, but there is no need to count this as a negative aspect due the fact that we collected experience data for following needs: +\par We were not able to put explanations, figures to examples, theorem descriptions and problem description to our course material. The reason for that was the time at one side and the ongoing restructuration of the system on the other side. +\par Only a sufficient number of topics was implemented. There were more problems to solve than we expected. We were only able to implement one from the SPSC given tasks m entered in Appendix~\ref{app:calc}. Due this fact the material we got as an output of the thesis will be no support for labs or lectures at the SPSC and also no material for the STEOP, which also was a big wish at the beginning. +\subsection{Open Questions and Work} +At the end of this thesis there is now part left unattended, but many parts that require beauty corrections and many parts that require a few more manpower. This upcoming open tasks are: +\begin{itemize} + \item What is the contents of the interactive course material (Figures, etc.)? + \item What are the pre and post conditions of the problems? + \item How would a correct implementation of the Z-Transformation look like? + \item What do students expect of this implementation? +\end{itemize} +To complete the task of creating course material describing the needed steps to do a partial fraction or inverse Z-Transformation in {\sisac} the real effort is not conceivable. But for a first usable version only a few steps are left to do this steps would be: +\begin{enumerate} + \item Cleanup the\ttfamily InverseZTransformation.thy\normalfont file and put it into the {\sisac} knowledge tree like it was done with\ttfamily PartialFractions.thy\normalfont. + \item Create a good example program and test it. + \item Describe the used theories with the mathematic definitions and background. + \item Add figures and small examples. +\end{enumerate} +There are also needs on finishing other parts to get a complete part of course material but this would be the steps to get a first usable version. + +\section{Conclusion and Personal Experience} +After working on {\sisac} for month, it is hard do find the right words about the system. For sure the system itself is a great idea and it would have been a big relaxation if i would have been able to use this system in the last years for sever ell subjects. But for me the biggest disadvantage of {\sisac} is the frontend until there is no mathematical notation and visualisation of simply fractions i don't think that i or other students would be able to use it for learning. I also think that for learning there is no need of complex examples or complex solutions, examples have to be simple but also have to cover all necessary steps of a calculation. Unfortunately there exist different learning types and I'm a visual one, what is also the explanation for my maybe drastic explanation. +\par About the backend, what finally was my main work there is not much left to say. The programing language requires a long time to work in and to find out how decelerations work and how isabelle and {\sisac} is build up, maybe this period of collecting informations is to long for a Bakk. Thesis. Also it is hard to find informations about the theories until there was no related work and no usable documentation wether for {\sisac} nor for isabelle or ML. +\par When working within the {\sisac} sources you often hung up on problems which would be simple to solve but are hard to discover, therefor it was often necessary to make breaks and define concrete steps on problem solving. Also when having a plan of the upcoming implementation I had to break myself out to do not to much step at once. Often its better to implement small parts and test, write tests and wait then hurrying up. An other aspect is that it was necessary to build {\sisac} from scratch after every change; this and the fact that my finally theories had over 1000 lines often made the development process to a stop and go dilemma. +\par Finally I have to say a big \bfseries thank you \normalfont to Dr.~Neuper who invested a lot of his time in my thesis and the {\sisac} project, I remember some hard and long meetings but finally I look back glad. + +\subsection{Anecdotes} +At the very beginning of the thesis i made some calculations and thoughed of every step more than twice. This calculations were the ground stone of my work, we build every step in the calculation following up the real calculations - when doing them by hand. Time went on and after adding the last commands to the programm for applying the transformation ruleset i compared the results - oh wonder there was a mistake in my calculation :) +\begin{center} +Thank you {\sisac}! +\end{center} + +%----------// BIB \\-----------% + +\renewcommand{\refname}{\section{References}} +\bibliographystyle{alpha} +\bibliography{references} +\clearpage + +%----------// APPENDIX \\-----------% +\newevenside +\part{Appendix} +\appendix +%----------// WORK TIME \\-----------% + + +\section{Record of Working Time} +\begin{footnotesize} +\begin{longtable}{l p{6.5cm} c c r} +{\bf Date} & {\bf Description} & {\bf Begin} & {\bf End} & {\bf Dur.}\\ +\hline \hline +\endhead + +\hline + \multicolumn{5}{r}{{Continued on next page}} \\ +\hline +\endfoot + +\hline +\hline +\endlastfoot + +\multicolumn{5}{l}{Start 1st Iteration} \\ +\hline +29.06.2011 & Meeting Dr. Neuper and DI Geiger & 15:00 & 17:30 & 2,50 \\ +02.07.2011 & Working on Examples from DI Geiger & 20:00 & 21:30 & 1,50 \\ +03.07.2011 & Working on Examples from DI Geiger & 21:00 & 22:45 & 1,75 \\ +05.07.2011 & Meeting Dr. Neuper, Information Exchange & 10:00 & 13:00 & 3,00 \\ +06.07.2011 & Installing Isabelle & 20:00 & 22:30 & 2,50 \\ +07.07.2011 & Meeting Dr. Neuper, present-1 & 14:45 & 16:15 & 1,50 \\ +18.07.2011 & Meeting Dr. Neuper, present-1 Structure & 14:15 & 16:00 & 1,75 \\ +19.07.2011 & Meeting Dr. Neuper, present-1 Content & 07:20 & 09:20 & 2,00\\ +19.07.2011 & Meeting Dr. Neuper & 10:00 & 12:00 & 2,00\\ +21.07.2011 & HG Error Correction, Latex for Thesis & 11:10 & 14:00 & 2,83\\ +22.07.2011 & Meeting Dr. Neuper & 10:00 & 12:00 & 2,00\\ +23.07.2011 & Latex for Calculations & 13:45 & 16:30 & 2,75\\ +24.07.2011 & Meeting Dr. Neuper, present-1 & 20:10 & 20:40 & 0,50\\ +25.07.2011 & Meeting Dr. Neuper, present-1 & 15:15 & 17:55 & 2,67\\ +26.07.2011 & Work on Test\_Complex.thy & 10:45 & 12:10 & 1,42\\ +27.07.2011 & present-1 (Dr. Neuper, DI Geiger) & 10:00 & 12:00 & 2,00\\ +\hline +\multicolumn{5}{l}{End 1st Iteration} \\ +\multicolumn{5}{l}{Start 2nd Iteration} \\ +\hline +02.09.2011 & Meeting Dr. Neuper, Latex for Thesis & 08:30 & 10:20 & 1,83\\ +05.09.2011 & Meeting Dr. Neuper, Partial\_Frations.thy & 09:30 & 12:45 & 3,25\\ +05.09.2011 & Partial\_Fractions.thy & 17:10 & 18:30 & 1,33\\ +06.09.2011 & Documentation Partial\_Fractions.thy & 10:00 & 13:15 & 3,25\\ +07.09.2011 & Meeting Dr. Neuper, ML Introduction & 10:00 & 12:50 & 2,83\\ +08.09.2011 & Preparing Scripts for Latex Output & 19:00 & 22:45 & 3,75\\ +09.09.2011 & Preparing Scripts for Latex Output & 11:40 & 15:00 & 3,33\\ +10.09.2011 & Meeting Dr. Neuper, Latex Output, HG Errors & 10:00 & 12:00 & 2,00\\ +\hline +\multicolumn{5}{l}{End 2nd Iteration} \\ +\multicolumn{5}{l}{Start 3rd and 4th Iteration} \\ +\hline +14.09.2011 & Start on Inverse\_Z\_Transf. Script & 09:10 & 12:25 & 3,25\\ +16.09.2011 & Information Exchange Sums & 13:15 & 16:00 & 2,75\\ +19.09.2011 & Programming on Inverse\_Z\_Transf. & 10:00 & 13:10 & 3,17\\ +20.09.2011 & Meeting Dr. Neuper, Inverse\_Z\_Transf. Script & 15:30 & 18:10 & 2,67\\ +23.09.2011 & New IsaMakefile for Latex generation & 13:00 & 14:30 & 1,50\\ +23.09.2011 & Meeting Dr. Neuper, Inverse\_Z\_Transf. Script & 14:30 & 17:30 & 3,00\\ +26.09.2011 & Partial\_Fractions.thy, get\_Argument & 13:30 & 16:15 & 2,75\\ +27.09.2011 & Meeting Dr. Neuper, HG Error & 09:00 & 12:20 & 3,33\\ +28.09.2011 & Meeting Dr. Neuper, Hierarchy Reconstruction & 10:00 & 12:30 & 2,50\\ +01.10.2011 & Some Testing & 10:00 & 11:00 & 1,00\\ +02.10.2011 & Inverse\_Z\_Transf. Errors & 15:00 & 16:10 & 1,17\\ +06.10.2011 & Meeting Dr. Neuper & 15:00 & 17:50 & 2,83\\ +07.10.2011 & Meeting Dr. Neuper, Inverse\_Z\_Transf. Script & 15:00 & 16:50 & 1,83\\ +09.10.2011 & Work on Thesis & 16:30 & 18:45 & 2,25\\ +11.10.2011 & Meeting Dr. Neuper, Abstract & 14:10 & 17:10 & 3,00\\ +13.10.2011 & Work on Thesis, Implemention part & 08:30 & 10:00 & 1,50\\ +18.10.2011 & Work on Thesis & 20:30 & 22:50 & 2,33\\ +19.10.2011 & Work on Thesis & 21:20 & 23:40 & 2,33\\ +20.10.2011 & Work on Thesis & 08:45 & 10:45 & 2,00\\ +25.10.2011 & Meeting Dr. Neuper: thesis review & 08:00 & 10:00 & 2,00\\ +25.10.2011 & Reorganising after meeting & 20:10 & 23:50 & 3,67\\ +26.10.2011 & Reorganising after meeting, examples in thesis & 08:30 & 11:10 & 2,67\\ +07.11.2011 & Meeting Preparation & 16:30 & 17:15 & 0,75\\ +08.11.2011 & Meeting Dr. Neuper: thesis addons & 16:00 & 17:30 & 1,50\\ +12.11.2011 & Reorganization after meeting & 21:10 & 22:30 & 1,33\\ +20.11.2011 & Review of Inv\_Z\_Trans & 10:15 & 13:30 & 3,25\\ +21.11.2011 & get\_numerator & 12:15 & 14:30 & 2,25\\ +23.11.2011 & get\_numerator & 20:30 & 21:15 & 0,75\\ +24.11.2011 & get\_numerator final & 14:10 & 15:30 & 1,33\\ +28.11.2011 & tried to go on in build\_inverse\_ & 11:00 & 13:10 & 2,17\\ +01.12.2012 & Tuning Invers\_Z\_Tansf. Script & 16:15 & 19:30 & 3,25\\ +04.12.2012 & Moved Some Tests to Knowledge & 15:30 & 18:15 & 2,75\\ +05.12.2012 & Tuning Invers\_Z\_Tansf. Script & 13:10 & 14:15 & 1,08\\ +08.12.2012 & Inverse\_Z\_Tansf. Script, Factors from Solution & 14:30 & 16:15 & 1,75\\ +10.12.2012 & Moved Some Tests to Knowledge & 20:10 & 23:00 & 2,83\\ +11.12.2012 & Inverse\_Z\_Tansf. Script, PBZ Ansatz & 10:10 & 12:30 & 2,33\\ +12.12.2012 & Inverse\_Z\_Tansf. Script, Subsitution & 09:00 & 11:30 & 2,50\\ +16.12.2012 & Tuning Invers\_Z\_Tansf. Script & 17:15 & 18:45 & 1,50\\ +19.12.2012 & Tuning Invers\_Z\_Tansf. Script & 19:00 & 20:30 & 1,50\\ +14.01.2012 & Inverse\_Z\_Tansf. Script, Substitution & 18:45 & 20:30 & 1,75\\ +22.01.2012 & Inverse\_Z\_Transf. Script, Calc Coeff. & 20:10 & 21:45 & 1,58\\ +12.02.2012 & Inverse\_Z\_Transf. Script & 17:30 & 19:00 & 1,50\\ +13.02.2012 & Finished Work on Inverse\_Z\_Transf. Script & 19:30 & 22:10 & 2,67\\ +14.02.2012 & Formatting for Latex output & 09:00 & 14:45 & 5,75\\ +15.02.2012 & Formatting for Latex output & 10:00 & 15:30 & 5,50\\ +16.02.2012 & Going on Work on Thesis & 14:45 & 18:30 & 3,75\\ +17.02.2012 & Tuning Invers\_Z\_Tansf. Script & 18:30 & 19:45 & 1,25\\ +19.02.2012 & Meeting Dr. Neuper, present-2 & 09:00 & 13:30 & 4,50\\ +19.02.2012 & Meeting Dr. Neuper, Integration of work to Isac & 15:00 & 19:10 & 4,17\\ +20.02.2012 & Meeting Dr. Neuper, Integration of work to Isac & 09:00 & 12:45 & 3,75\\ +20.02.2012 & Meeting Dr. Neuper, Integration of work to Isac & 14:10 & 18:30 & 4,33\\ +\hline +\multicolumn{5}{l}{End 3rd Iteration}\\ +\hline +20.02.2012 & Finishing Thesis & 20:30 & 22:50 & 2,33\\ +21.02.2012 & Finishing Thesis & 13:30 & 14:45 & 1,25\\ +02.03.2012 & Finishing Thesis & 15:45 & 19:00 & 3,25\\ +06.03.2012 & Finishing Thesis & 09:15 & 10:30 & 1,25\\ +07.03.2012 & Finishing Thesis & 13:15 & 16:00 & 2,75\\ +\hline +\multicolumn{5}{l}{End 4th Iteration} \\ +\multicolumn{5}{l}{Start 5th Iteration} \\ +\hline +26.02.2012 & Preparing present-2 & 09:30 & 13:00 & 3,5 \\ +20.03.2012 & Preparing present-2 & 14:00 & 16:30 & 2,5 \\ +08.05.2012 & Meeting Dr. Neuper, present-2, work on isac & 08:00 & 12:00 & 4,0 \\ +08.05.2012 & present-2 & 14:00 & 15:00 & 1,0 \\ +\hline +\multicolumn{5}{l}{End 5th Iteration} \\ +\hline +\multicolumn{4}{l}{Total working time:} & 203 \\ +\end{longtable} +\end{footnotesize} + +%----------// CALCULATIONS \\-----------% + +\newevenside +\section{Calculations\label{app:calc}} +\input{calulations} +\end{document} + diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/final/jrocnik_present1.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/final/jrocnik_present1.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,434 @@ + +\documentclass{beamer} + + +\mode +{ + \usetheme{Hannover} + \setbeamercovered{transparent} +} + +\usepackage[english]{babel} +\usepackage[utf8]{inputenc} +\usepackage{times} +\usepackage[T1]{fontenc} + +\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} +\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} + +\title[SPSC in \isac] % (optional, use only with long paper titles) +{Interactive Course Material\\ for Signal Processing\\ based on Isabelle/\isac} + +\subtitle{Baccalaureate Thesis} + +\author[Ro\v{c}nik] +{Jan Rocnik} + +\institute % (optional, but mostly needed) +{ + Technische Universit\"at Graz\\ + Institut f\"ur TODO +} + +% If you have a file called "university-logo-filename.xxx", where xxx +% is a graphic format that can be processed by latex or pdflatex, +% resp., then you can add a logo as follows: + +% \pgfdeclareimage[height=0.5cm]{university-logo}{university-logo-filename} +% \logo{\pgfuseimage{university-logo}} + + + +% Delete this, if you do not want the table of contents to pop up at +% the beginning of each subsection: +\AtBeginSubsection[] +{ + \begin{frame}{Outline} + \tableofcontents[currentsection,currentsubsection] + \end{frame} +} + +\begin{document} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Title Page %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame} + \titlepage +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Table of Contents %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame}{Outline} + \tableofcontents + % You might wish to add the option [pausesections] +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%---------------------------------------------------------------%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\section[Intro]{Introduction} + +\begin{frame}{Issues to be Accomplished} + +\begin{itemize} + +\item What knowledge is already mechanised in \emph{Isabelle}? +\item How can missing theorems and definitions be mechanised? +\item What is the effort for such mechanisation? +\item How do calculations look like, by using mechanised knowledge? +\item What problems and subproblems have to be solved? +\item Which problems are already implemented in \sisac? +\item How are the new problems specified (\sisac)? +\item Which variantes of programms in \sisac\ solve the problems? +\item What is the contents of the interactiv course material (Figures, etc.)? + +\end{itemize} +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%---------------------------------------------------------------%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\section[Fourier]{Fourier transformation} +\subsection[Fourier]{Fourier transform} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Fourier INTRO %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame}\frametitle{Fourier Transformation: Introduction} +Possibilities: +\begin{itemize} +\item Transform operation by using property-tables +\item Transform operation by using integral +\end{itemize} +Also Important: +\begin{itemize} +\item Visualisation?! +\end{itemize} +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Transform expl SPEC %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame}\frametitle{Fourier Transformation: Specification} +{\footnotesize + +Determine the fourier transform for the given rectangular impulse: + +\begin{center} +$x(t)= \left\{ + \begin{array}{lr} + 1 & -1\leq t\leq1\\ + 0 & else + \end{array} + \right.$ +\end{center} + +\hrulefill + +\begin{tabbing} +1\=postcond \=: \= \= $\;\;\;\;$\=\kill +\>given \>:\> piecewise\_function \\ +\> \> \> \>$fun (x (t::real),\ x=1\ ((t>=-1)\ \&\ (t<=1)),\ x=0)$\\ +\>precond \>:\> TODO\\ +\>find \>:\> $X(j\cdot\omega)$\\ +\>postcond \>:\> TODO\\ +\end{tabbing} + +} +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Transform expl REQ %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame}\frametitle{Fourier Transform: Development effort} +{\small +\begin{center} +\begin{tabular}{l|l|r} +requirements & comments &effort\\ \hline\hline +solving Intrgrals & simple via propertie table & 20\\ + & \emph{real} & MT\\ \hline +transformation table & simple transform & 20\\ \hline +visualisation & backend & 10\\ \hline +example collection & with explanations & 20\\ \hline\hline + & & 70-80\\ +\end{tabular} +\end{center} +effort --- in 45min units\\ +MT --- thesis ``Integrals'' (mathematics) +} +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%--------------------FOURIER---Conclusion-----------------------%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame}{Fourier Transformation: Summary} +\begin{itemize} + +\item Standard integrals can be solved with tables +\item No real integration (yet avaible) +\item Math \emph{tricks} difficult to implement + + +\end{itemize} +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%-----------------------------------------------------------------% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\section[LTI Systems]{LTI systems} +\subsection[Convolution]{Convolution (Faltung)} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% LTI INTRO %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame}\frametitle{Convolution: Introduction} +\begin{itemize} +\item Calculation include sums +\item Demonstrative examples +\item Visualisation is important +\end{itemize} +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% LTI SPEC %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame}\frametitle{Convolution: Specification} +{\footnotesize + +Consider the two discrete-time, linear and time-invariant (LTI) systems with the following impulse response: + +\begin{center} +$h_1[n]=\left(\frac{3}{5}\right)^n\cdot u[n]$\\ +$h_1[n]=\left(-\frac{2}{3}\right)^n\cdot u[n]$ +\end{center} + +The two systems are cascaded seriell. Derive the impulse respinse of the overall system $h_c[n]$. + +\hrulefill + +\begin{tabbing} +1\=postcond \=: \= \= $\;\;\;\;$\=\kill +\>given \>:\> Signals h1[n], h2[n] \\ +\> \> \> \>((h1[n]=(3/5)\textasciicircum{}n*u[n]),\,h2[n]=(-2/3)\textasciicircum{}n*u[n]))\\ + +\>precond \>:\> TODO\\ +\>find \>:\> $h1[n]\,*\,h2[n]$\\ +\>postcond \>:\> TODO\\ +\end{tabbing} + +} +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% LTI REQ %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame}\frametitle{Convolution: Development effort} +{\small +\begin{center} +\begin{tabular}{l|l|r} +requirements & comments &effort\\ \hline\hline +simplify rationals & \sisac & 0\\ \hline +define $\sum\limits_{i=0}^{n}i$ & partly \sisac & 10\\ \hline +simplify sum & termorder & 10\\ + & simplify rules & 20\\ + & use simplify rationals& 0\\ \hline +index adjustments & with unit step & 10\\ \hline +example collection & with explanations & 20\\ \hline\hline + & & 70-90\\ +\end{tabular} +\end{center} +effort --- in 45min units\\ +} +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%--------------------LTI-------Conclusion-----------------------%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame}{Convolution: Summary} +\begin{itemize} + +\item Standard example +\item Straight forward +\item Challenge are sum limits + +\end{itemize} +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%-----------------------------------------------------------------% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\section[Z-transform]{Z-Transform} +\subsection[(Inverse) Z-Transform]{(Inverse) Z-Transform} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Z-Transform INTRO %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame}\frametitle{(Inverse) ${\cal Z}$-Transformation: Introduction} +\begin{itemize} +\item Pure Transformation is simple to realise with Z-Transform Properties (Table) +\item Partial Fraction are just math simplifications +\end{itemize} +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Z-Transform SPEC %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame}\frametitle{(Inverse) Z-Transformation: Specification} +{\footnotesize + +Determine the inverse z transform of the following expression. Hint: applay the partial fraction expansion. + +\begin{center} +$X(z)=\frac{3}{z-\frac{1}{4}-\frac{1}{8}z^{-1}},\ \ x[n]$ is absolute summable +\end{center} + + +\hrulefill + +\begin{tabbing} +1\=postcond \=: \= \= $\;\;\;\;$\=\kill +\>given \>:\> Expression of z \\ +\> \> \> \>(X (z::complex),3/(z-1/4-1/8\,z\textasciicircum{}(-1)))\\ +\>precond \>:\> TODO\\ +\>find \>:\> Expression of n\\ +\> \> \> \>$h[n]$\\ +\>postcond \>:\> TODO\\ +\end{tabbing} + +} +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Z expl REQ %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +\begin{frame}\frametitle{(Inverse) Z-Transformation: Development effort} +{\small +\begin{center} +\begin{tabular}{l|l|r} +requirements & comments &effort\\ \hline\hline +solve for part.fract. & \sisac: degree 2 & 0\\ + & complex nomminators & 30\\ + & degree > 2 & MT\\ \hline +simplify polynomial & \sisac & 0\\ +simplify rational & \sisac & 0\\ \hline +part.fract.decomposition& degree 2 & \\ + & specification, method& 30\\ \hline +${\cal Z}^{-1}$ table & & 20\\ + & explanations, figures& 20\\ \hline +example collection & with explanations & 20\\ \hline\hline + & & 90-120\\ +% & & 1 MT +\end{tabular} +\end{center} +effort --- in 45min units\\ +MT --- thesis ``factorization'' (mathematics) +} +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%--------------------Z-TRANS---Conclusion-----------------------%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame}{(Inverse) Z-Transformation: Summary} +\begin{itemize} + +\item No \emph{higher} math operations +\item Different subproblems of math (equation systems, etc.) +\item Both directions have the same effort + +\end{itemize} +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%-----------------------------------------------------------------% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\section[Conclusions]{Conclusions} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%--------------------------DEMONSTRATION--------------------------% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame}{Demonstration} + +\centering{Demonstration} + +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%--------------------------CONCLUSION-----------------------------% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame}{Conclusions} + +Design Challanges: + +{\small +\begin{itemize} + +\item Pre and Post conditions +\item Exact mathematic behind functions +\item Accurate mathematic notation + +\end{itemize} +} + +Goals: +{\small +\begin{itemize} + +\item Spot the power of \sisac +\item Implementation of generell but simple math problems +\item Setting up a good first guideline (documentation) for furher problem implemenations + +\end{itemize} + +\centering{Efforts are only approximations, due we have no \emph{real} experience data!} +} + +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%--------------------------TIME LINE------------------------------% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame}{Comming up} + +{\small +\begin{tabular}{l r} + +Juli 2011 & project startup\\ +Juli 2011 & information collection, 1st presentation\\ +August 2011 & extern traineeship\\ +September 2011 & main work\\ +after Oktober & finishing, documentation\\ + +\end{tabular} +} + +\end{frame} + + +\end{document} + + diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/final/jrocnik_present2.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/final/jrocnik_present2.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,299 @@ +\documentclass[% +%handout, % prints handouts (=no animations, for printed version) +%mathserif +%xcolor=pst, +14pt +% fleqn +]{beamer} + +\usepackage{beamerthemedefault} + +\usepackage{color} +\definecolor{lgray}{RGB}{238,238,238} + +\useoutertheme[subsection=false]{smoothbars} +\useinnertheme{circles} + +\setbeamercolor{block title}{fg=black,bg=gray} +\setbeamercolor{block title alerted}{use=alerted text,fg=black,bg=alerted text.fg!75!bg} +\setbeamercolor{block title example}{use=example text,fg=black,bg=example text.fg!75!bg} +\setbeamercolor{block body}{parent=normal text,use=block title,bg=block title.bg!25!bg} +\setbeamercolor{block body alerted}{parent=normal text,use=block title alerted,bg=block title alerted.bg!25!bg} +\setbeamercolor{block body example}{parent=normal text,use=block title example,bg=block title example.bg!25!bg} + +%activate hyperlinks at the end +%\usepackage{hyperref} + +\usepackage[english]{babel} +\usepackage[utf8]{inputenc} +\usepackage{array} +\usepackage{setspace} + +\definecolor{tug}{rgb}{0.96862,0.14509,0.27450} + +\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} +\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} + +\setbeamertemplate{headline}[text line]{ + \begin{beamercolorbox}[wd=\paperwidth,ht=8ex,dp=4ex]{} + \insertnavigation{0.85\paperwidth} + \raisebox{-10pt}{\includegraphics[width=15mm]{tuglogo}}\vskip2pt + \hskip-1pt\rule{\paperwidth}{0.3pt} + \end{beamercolorbox} +} + +\setbeamertemplate{navigation symbols}{} + +\definecolor{gray}{rgb}{0.8,0.8,0.8} +\setbeamercolor{footline}{fg=black,bg=gray} + +% Fusszeile mit Autor, Titel und Foliennummer / Gesamtfolienzahl +\setbeamertemplate{footline}[text line]{ + \hskip-1pt + \begin{beamercolorbox}[wd=\paperwidth]{footline} + \rule{\paperwidth}{0.3pt} + \colorbox{tug}{\rule{3pt}{0pt}\rule{0pt}{3pt}} + \textbf{\rule{0pt}{5pt}\insertshortauthor\hfill\insertshortinstitute\hfill% + \insertshorttitle\rule{1em}{0pt}} + \rule{\paperwidth}{0.3pt} + \end{beamercolorbox} + \begin{beamercolorbox}[wd=\paperwidth,ht=2ex,dp=2ex]{white} + \end{beamercolorbox} +}% + +%% Titelblatt-Einstellungen +\institute[IST, SPSC]{Institute for Software Technology\\Institute of Signal Processing and Speech Communication\\Graz University of Technology} +\title[ISAC for Signal Processing]{Interactive Course Material for\\ Signal Processing based on\\ Isabelle/\isac} +\subtitle{Baccalaureate Thesis} +\author{Jan Rocnik} +\date{\today} + +% Subject and Keywords for PDF +\subject{Final presentation of Baccalaureate Thesis} +\keywords{Isac, Isabelle, ist, spsc, thesis, course material} + +\titlegraphic{\includegraphics[width=20mm]{tuglogo}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{document} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame}[plain] + \frametitle{} + \titlepage +\end{frame} + + + +\begin{frame} + \frametitle{Contents} + \begin{spacing}{0.3} + \tableofcontents[hideallsubsections % + % ,pausesections + ] % erzeugt Inhaltsverzeichnis + \end{spacing} +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{Introduction} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\subsection{isabelle} +\begin{frame} + \frametitle{What is Isabelle?} + \begin{spacing}{1.5} + \begin{itemize} + \item Generic Proof Assistant + \item Formula proofing in logical calculus + \item Developed in Cambridge, Muenchen and Paris + \end{itemize} + \end{spacing} +\end{frame} + +\subsection{isac} +\begin{frame} + \frametitle{What is {\isac}?} + \begin{spacing}{1.5} + \begin{itemize} + \item \textcolor{tug}{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal A}$}belle for~{}\textcolor{tug}{${\cal C}$}alculations + \item Interactive Course Material + \item Learning Coach + \item Developed at Austrian Universities + \end{itemize} + \end{spacing} +\end{frame} + +\subsection{motivation} +\begin{frame} + \frametitle{Motivation - {\isac{}}'s~Potential} + \begin{itemize} + \item Stepwise solving of engineering problems\\ + {\small $\rightarrow$ \textcolor{tug}{Consistent Framework}} + \item Explaining underlying knowledge\\ + {\small $\rightarrow$ \textcolor{tug}{Transparent Content, Access to Multimedia Content}} + \item Checking steps input by the student\\ + {\small $\rightarrow$ \textcolor{tug}{Proof Situation}} + \item Assessing stepwise problem solving\\ + {\small $\rightarrow$ \textcolor{tug}{One system for tutoring and assessment}} + \end{itemize} +\end{frame} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{Thesis Definition} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame} + \frametitle{Thesis Definition} + %---> Follow up thesis abstract! <---% + \begin{spacing}{1.2} + \begin{itemize} + \item Creation of interactive course material\\ + {\small Based on problems given by SPSC} + \item Content should be usable\ldots + \begin{itemize} + \item in Signalprocessing Problem Classes + \item in \emph{STEOP} + \end{itemize} + \item Guideline for upcoming TP-Programmers. + \item Feedback of usability\\ + {\small (TP-Programming-Language)} + \end{itemize} + \end{spacing} +\end{frame} + +\subsection{issues} +\begin{frame} + \frametitle{Issues to Accomplish I} + \begin{spacing}{1.4} + \begin{itemize} + \item What knowledge is mechanized in Isabelle?\\ + {\small How about new?} + \item What problems are implemented in {\sisac{}}?\\ + {\small How about new?} + \item What is the effort? + \end{itemize} + \end{spacing} +\end{frame} + +\begin{frame} + \frametitle{Issues to Accomplish II} +\begin{spacing}{1.4} +\begin{itemize} + \item How look calculations like?\\ + {\small Ansatzs, Subproblems?} + \item How are problems specified?\\ + {\small Given, Pre-/Postcondition, Find?} + \item What is the contents of the interactive course material?\\ + {\small Figures, Explanations,\ldots} +\end{itemize} +\end{spacing} +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{Details} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\subsection{Technical Survey} +\begin{frame} + \frametitle{Technical Survey I {\normalsize Mechanizing Knowledge}} + \begin{spacing}{1.5} + \begin{itemize} + \item Not enough knowledge is mechanized\\ + {\small Equation Solving, Integrals,\ldots} + \item Computer Mathematicians required!\\ + {\small Mathematics: Equation solving, Engineer: Z-Transform} + \item RISC Linz, Mathematics TU Graz + \end{itemize} + \end{spacing} +\end{frame} + +\begin{frame} + \frametitle{Technical Survey II {\normalsize Notation Problems} } + \begin{spacing}{1.5} + \begin{itemize} + \item Different brackets have different meanings\\ + {\small $u[n] \neq u(n)$\ldots in Math; but also in the source code} + \item Simplification, tricks and beauty\\ + {\small $X\cdot(a+b)+Y\cdot(c+d)=aX+bX+cY+dY$}\\ + {\small $\frac{1}{j\omega}\cdot\left(e^{-j\omega}-e^{j3\omega}\right)=\frac{1}{j\omega}\cdot e^{-j2\omega}\cdot\left(e^{j\omega}-e^{-j\omega}\right)=$}\\ + {\small $=\frac{1}{\omega}\, e^{-j2\omega}\cdot\colorbox{lgray}{$\frac{1}{j}\,\left(e^{j\omega}-e^{-j\omega}\right)$}=\frac{1}{\omega}\,e^{-j2\omega}\cdot\colorbox{lgray}{$2\, sin(\omega)$} $} + \end{itemize} + \end{spacing} +\end{frame} + +\subsection{Demonstration} +\begin{frame} + \frametitle{Demonstration of {\isac}} + \begin{spacing}{1.5} + \begin{itemize} + \item {\Large Development Environment} (Backend) + \vspace{15mm} + \item {\Large Math Assistant} (Frontend) + \end{itemize} + \end{spacing} +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{Summary} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\subsection{Accomplished Work} +\begin{frame} + \frametitle{Accomplished Work} + \begin{itemize} + \item Partial Fractions\\ {\small Theorems, Specification, Program} + \item Inverse Z-Transform with Partial Fractions\\ {\small Theorems, Specification, Program} + \item Isabelle Theory indicating issues\\ {\small Preparation for {\sisac{}}-developers} + \end{itemize} +\end{frame} + +\subsection{Partially Accomplished} +\begin{frame} + \frametitle{Partially Accomplished} + \begin{spacing}{1.4} + \begin{itemize} + \item Guidelines for Upcoming TP-Programmers\\ + {\small \textbf{Note:} Development environment and languages changes} + \item Examples + \end{itemize} + \end{spacing} +\end{frame} + +\subsection{Not Accomplished} +\begin{frame} + \frametitle{Not Accomplished} + \begin{spacing}{1.2} + \begin{itemize} + \item Content of interactive course material\\ + {\small Figures, Explanations,\ldots} + \item A sufficient count of implementations + \item No support of labs and lectures atm + \item No material for \emph{STEOP} atm + \end{itemize} + \end{spacing} +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{Conclusion} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame} + \frametitle{Conclusion} + \begin{spacing}{1.2} + \begin{itemize} + \item TP-based language not ready + \item Programming guideline not yet sufficient + \item Hope for usability in enginieering studies + \vspace{5mm} + \item Hard to spend 200h on 1 programm + \item \isac{} pointed at my own error + \end{itemize} + \end{spacing} +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\end{document} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% EOF \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/fixbookmarks.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/fixbookmarks.pl Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,4 @@ + +s/\\([a-zA-Z]+)\s*/$1/g; +s/\$//g; +s/^BOOKMARK/\\BOOKMARK/g; diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/isabelle.sty --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/isabelle.sty Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,218 @@ +%% +%% macros for Isabelle generated LaTeX output +%% + +%%% Simple document preparation (based on theory token language and symbols) + +% isabelle environments + +\newcommand{\isabellecontext}{UNKNOWN} + +\newcommand{\isastyle}{\UNDEF} +\newcommand{\isastyleminor}{\UNDEF} +\newcommand{\isastylescript}{\UNDEF} +\newcommand{\isastyletext}{\normalsize\rm} +\newcommand{\isastyletxt}{\rm} +\newcommand{\isastylecmt}{\rm} + +%symbol markup -- \emph achieves decent spacing via italic corrections +\newcommand{\isamath}[1]{\emph{$#1$}} +\newcommand{\isatext}[1]{\emph{#1}} +\DeclareRobustCommand{\isascriptstyle}{\def\isamath##1{##1}\def\isatext##1{\mbox{\isastylescript##1}}} +\newcommand{\isactrlsub}[1]{\emph{\isascriptstyle${}\sb{#1}$}} +\newcommand{\isactrlsup}[1]{\emph{\isascriptstyle${}\sp{#1}$}} +\newcommand{\isactrlisub}[1]{\emph{\isascriptstyle${}\sb{#1}$}} +\newcommand{\isactrlisup}[1]{\emph{\isascriptstyle${}\sp{#1}$}} +\DeclareRobustCommand{\isactrlbsub}{\emph\bgroup\math{}\sb\bgroup\mbox\bgroup\isastylescript} +\DeclareRobustCommand{\isactrlesub}{\egroup\egroup\endmath\egroup} +\DeclareRobustCommand{\isactrlbsup}{\emph\bgroup\math{}\sp\bgroup\mbox\bgroup\isastylescript} +\DeclareRobustCommand{\isactrlesup}{\egroup\egroup\endmath\egroup} +\newcommand{\isactrlbold}[1]{{\bfseries\upshape\boldmath#1}} +\newcommand{\isactrlloc}[1]{{\bfseries\upshape\boldmath#1}} + +\newenvironment{isaantiq}{{\isacharat\isacharbraceleft}}{{\isacharbraceright}} +\newcommand{\isaantiqopen}{\isakeyword{\isacharbraceleft}} +\newcommand{\isaantiqclose}{\isakeyword{\isacharbraceright}} + +\newdimen\isa@parindent\newdimen\isa@parskip + +\newenvironment{isabellebody}{% +\isamarkuptrue\par% +\isa@parindent\parindent\parindent0pt% +\isa@parskip\parskip\parskip0pt% +\isastyle}{\par} + +\newenvironment{isabelle} +{\begin{trivlist}\begin{isabellebody}\item\relax} +{\end{isabellebody}\end{trivlist}} + +\newcommand{\isa}[1]{\emph{\isastyleminor #1}} + +\newcommand{\isaindent}[1]{\hphantom{#1}} +\newcommand{\isanewline}{\mbox{}\par\mbox{}} +\newcommand{\isasep}{} +\newcommand{\isadigit}[1]{#1} + +\newcommand{\isachardefaults}{% +\chardef\isacharbang=`\!% +\chardef\isachardoublequote=`\"% +\chardef\isachardoublequoteopen=`\"% +\chardef\isachardoublequoteclose=`\"% +\chardef\isacharhash=`\#% +\chardef\isachardollar=`\$% +\chardef\isacharpercent=`\%% +\chardef\isacharampersand=`\&% +\chardef\isacharprime=`\'% +\chardef\isacharparenleft=`\(% +\chardef\isacharparenright=`\)% +\chardef\isacharasterisk=`\*% +\chardef\isacharplus=`\+% +\chardef\isacharcomma=`\,% +\chardef\isacharminus=`\-% +\chardef\isachardot=`\.% +\chardef\isacharslash=`\/% +\chardef\isacharcolon=`\:% +\chardef\isacharsemicolon=`\;% +\chardef\isacharless=`\<% +\chardef\isacharequal=`\=% +\chardef\isachargreater=`\>% +\chardef\isacharquery=`\?% +\chardef\isacharat=`\@% +\chardef\isacharbrackleft=`\[% +\chardef\isacharbackslash=`\\% +\chardef\isacharbrackright=`\]% +\chardef\isacharcircum=`\^% +\chardef\isacharunderscore=`\_% +\def\isacharunderscorekeyword{\_}% +\chardef\isacharbackquote=`\`% +\chardef\isacharbackquoteopen=`\`% +\chardef\isacharbackquoteclose=`\`% +\chardef\isacharbraceleft=`\{% +\chardef\isacharbar=`\|% +\chardef\isacharbraceright=`\}% +\chardef\isachartilde=`\~% +\def\isacharverbatimopen{\isacharbraceleft\isacharasterisk}% +\def\isacharverbatimclose{\isacharasterisk\isacharbraceright}% +} + +\newcommand{\isaliteral}[2]{#2} +\newcommand{\isanil}{} + + +% keyword and section markup + +\newcommand{\isakeyword}[1] +{\emph{\bf\def\isachardot{.}\def\isacharunderscore{\isacharunderscorekeyword}% +\def\isacharbraceleft{\{}\def\isacharbraceright{\}}#1}} +\newcommand{\isacommand}[1]{\isakeyword{#1}} + +\newcommand{\isamarkupheader}[1]{\section{#1}} +\newcommand{\isamarkupchapter}[1]{\chapter{#1}} +\newcommand{\isamarkupsection}[1]{\section{#1}} +\newcommand{\isamarkupsubsection}[1]{\subsection{#1}} +\newcommand{\isamarkupsubsubsection}[1]{\subsubsection{#1}} +\newcommand{\isamarkupsect}[1]{\section{#1}} +\newcommand{\isamarkupsubsect}[1]{\subsection{#1}} +\newcommand{\isamarkupsubsubsect}[1]{\subsubsection{#1}} + +\newif\ifisamarkup +\newcommand{\isabeginpar}{\par\ifisamarkup\relax\else\medskip\fi} +\newcommand{\isaendpar}{\par\medskip} +\newenvironment{isapar}{\parindent\isa@parindent\parskip\isa@parskip\isabeginpar}{\isaendpar} +\newenvironment{isamarkuptext}{\par\isastyletext\begin{isapar}}{\end{isapar}} +\newenvironment{isamarkuptxt}{\par\isastyletxt\begin{isapar}}{\end{isapar}} +\newcommand{\isamarkupcmt}[1]{{\isastylecmt--- #1}} + + +% styles + +\def\isabellestyle#1{\csname isabellestyle#1\endcsname} + +\newcommand{\isabellestyledefault}{% +\renewcommand{\isastyle}{\small\tt\slshape}% +\renewcommand{\isastyleminor}{\small\tt\slshape}% +\renewcommand{\isastylescript}{\footnotesize\tt\slshape}% +\isachardefaults% +} +\isabellestyledefault + +\newcommand{\isabellestylett}{% +\renewcommand{\isastyle}{\small\tt}% +\renewcommand{\isastyleminor}{\small\tt}% +\renewcommand{\isastylescript}{\footnotesize\tt}% +\isachardefaults% +} + +\newcommand{\isabellestyleit}{% +\renewcommand{\isastyle}{\small\it}% +\renewcommand{\isastyleminor}{\it}% +\renewcommand{\isastylescript}{\footnotesize\it}% +\renewcommand{\isacharunderscorekeyword}{\mbox{-}}% +\renewcommand{\isacharbang}{\isamath{!}}% +\renewcommand{\isachardoublequote}{\isanil}% +\renewcommand{\isachardoublequoteopen}{\isanil}% +\renewcommand{\isachardoublequoteclose}{\isanil}% +\renewcommand{\isacharhash}{\isamath{\#}}% +\renewcommand{\isachardollar}{\isamath{\$}}% +\renewcommand{\isacharpercent}{\isamath{\%}}% +\renewcommand{\isacharampersand}{\isamath{\&}}% +\renewcommand{\isacharprime}{\isamath{\mskip2mu{'}\mskip-2mu}}% +\renewcommand{\isacharparenleft}{\isamath{(}}% +\renewcommand{\isacharparenright}{\isamath{)}}% +\renewcommand{\isacharasterisk}{\isamath{*}}% +\renewcommand{\isacharplus}{\isamath{+}}% +\renewcommand{\isacharcomma}{\isamath{\mathord,}}% +\renewcommand{\isacharminus}{\isamath{-}}% +\renewcommand{\isachardot}{\isamath{\mathord.}}% +\renewcommand{\isacharslash}{\isamath{/}}% +\renewcommand{\isacharcolon}{\isamath{\mathord:}}% +\renewcommand{\isacharsemicolon}{\isamath{\mathord;}}% +\renewcommand{\isacharless}{\isamath{<}}% +\renewcommand{\isacharequal}{\isamath{=}}% +\renewcommand{\isachargreater}{\isamath{>}}% +\renewcommand{\isacharat}{\isamath{@}}% +\renewcommand{\isacharbrackleft}{\isamath{[}}% +\renewcommand{\isacharbackslash}{\isamath{\backslash}}% +\renewcommand{\isacharbrackright}{\isamath{]}}% +\renewcommand{\isacharunderscore}{\mbox{-}}% +\renewcommand{\isacharbraceleft}{\isamath{\{}}% +\renewcommand{\isacharbar}{\isamath{\mid}}% +\renewcommand{\isacharbraceright}{\isamath{\}}}% +\renewcommand{\isachartilde}{\isamath{{}\sp{\sim}}}% +\renewcommand{\isacharbackquoteopen}{\isatext{\raise.3ex\hbox{$\scriptscriptstyle\langle$}}}% +\renewcommand{\isacharbackquoteclose}{\isatext{\raise.3ex\hbox{$\scriptscriptstyle\rangle$}}}% +\renewcommand{\isacharverbatimopen}{\isamath{\langle\!\langle}}% +\renewcommand{\isacharverbatimclose}{\isamath{\rangle\!\rangle}}% +} + +\newcommand{\isabellestylesl}{% +\isabellestyleit% +\renewcommand{\isastyle}{\small\sl}% +\renewcommand{\isastyleminor}{\sl}% +\renewcommand{\isastylescript}{\footnotesize\sl}% +} + + +% tagged regions + +%plain TeX version of comment package -- much faster! +\let\isafmtname\fmtname\def\fmtname{plain} +\usepackage{comment} +\let\fmtname\isafmtname + +\newcommand{\isafold}[1]{\emph{$\langle\mathord{\mathit{#1}}\rangle$}} + +\newcommand{\isakeeptag}[1]% +{\includecomment{isadelim#1}\includecomment{isatag#1}\csarg\def{isafold#1}{}} +\newcommand{\isadroptag}[1]% +{\excludecomment{isadelim#1}\excludecomment{isatag#1}\csarg\def{isafold#1}{}} +\newcommand{\isafoldtag}[1]% +{\includecomment{isadelim#1}\excludecomment{isatag#1}\csarg\def{isafold#1}{\isafold{#1}}} + +\isakeeptag{theory} +\isakeeptag{proof} +\isakeeptag{ML} +\isakeeptag{visible} +\isadroptag{invisible} + +\IfFileExists{isabelletags.sty}{\usepackage{isabelletags}}{} diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/isabellesym.sty --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/isabellesym.sty Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,358 @@ +%% +%% definitions of standard Isabelle symbols +%% + +\newcommand{\isasymzero}{\isamath{\mathbf{0}}} %requires amssymb +\newcommand{\isasymone}{\isamath{\mathbf{1}}} %requires amssymb +\newcommand{\isasymtwo}{\isamath{\mathbf{2}}} %requires amssymb +\newcommand{\isasymthree}{\isamath{\mathbf{3}}} %requires amssymb +\newcommand{\isasymfour}{\isamath{\mathbf{4}}} %requires amssymb +\newcommand{\isasymfive}{\isamath{\mathbf{5}}} %requires amssymb +\newcommand{\isasymsix}{\isamath{\mathbf{6}}} %requires amssymb +\newcommand{\isasymseven}{\isamath{\mathbf{7}}} %requires amssymb +\newcommand{\isasymeight}{\isamath{\mathbf{8}}} %requires amssymb +\newcommand{\isasymnine}{\isamath{\mathbf{9}}} %requires amssymb +\newcommand{\isasymA}{\isamath{\mathcal{A}}} +\newcommand{\isasymB}{\isamath{\mathcal{B}}} +\newcommand{\isasymC}{\isamath{\mathcal{C}}} +\newcommand{\isasymD}{\isamath{\mathcal{D}}} +\newcommand{\isasymE}{\isamath{\mathcal{E}}} +\newcommand{\isasymF}{\isamath{\mathcal{F}}} +\newcommand{\isasymG}{\isamath{\mathcal{G}}} +\newcommand{\isasymH}{\isamath{\mathcal{H}}} +\newcommand{\isasymI}{\isamath{\mathcal{I}}} +\newcommand{\isasymJ}{\isamath{\mathcal{J}}} +\newcommand{\isasymK}{\isamath{\mathcal{K}}} +\newcommand{\isasymL}{\isamath{\mathcal{L}}} +\newcommand{\isasymM}{\isamath{\mathcal{M}}} +\newcommand{\isasymN}{\isamath{\mathcal{N}}} +\newcommand{\isasymO}{\isamath{\mathcal{O}}} +\newcommand{\isasymP}{\isamath{\mathcal{P}}} +\newcommand{\isasymQ}{\isamath{\mathcal{Q}}} +\newcommand{\isasymR}{\isamath{\mathcal{R}}} +\newcommand{\isasymS}{\isamath{\mathcal{S}}} +\newcommand{\isasymT}{\isamath{\mathcal{T}}} +\newcommand{\isasymU}{\isamath{\mathcal{U}}} +\newcommand{\isasymV}{\isamath{\mathcal{V}}} +\newcommand{\isasymW}{\isamath{\mathcal{W}}} +\newcommand{\isasymX}{\isamath{\mathcal{X}}} +\newcommand{\isasymY}{\isamath{\mathcal{Y}}} +\newcommand{\isasymZ}{\isamath{\mathcal{Z}}} +\newcommand{\isasyma}{\isamath{\mathrm{a}}} +\newcommand{\isasymb}{\isamath{\mathrm{b}}} +\newcommand{\isasymc}{\isamath{\mathrm{c}}} +\newcommand{\isasymd}{\isamath{\mathrm{d}}} +\newcommand{\isasyme}{\isamath{\mathrm{e}}} +\newcommand{\isasymf}{\isamath{\mathrm{f}}} +\newcommand{\isasymg}{\isamath{\mathrm{g}}} +\newcommand{\isasymh}{\isamath{\mathrm{h}}} +\newcommand{\isasymi}{\isamath{\mathrm{i}}} +\newcommand{\isasymj}{\isamath{\mathrm{j}}} +\newcommand{\isasymk}{\isamath{\mathrm{k}}} +\newcommand{\isasyml}{\isamath{\mathrm{l}}} +\newcommand{\isasymm}{\isamath{\mathrm{m}}} +\newcommand{\isasymn}{\isamath{\mathrm{n}}} +\newcommand{\isasymo}{\isamath{\mathrm{o}}} +\newcommand{\isasymp}{\isamath{\mathrm{p}}} +\newcommand{\isasymq}{\isamath{\mathrm{q}}} +\newcommand{\isasymr}{\isamath{\mathrm{r}}} +\newcommand{\isasyms}{\isamath{\mathrm{s}}} +\newcommand{\isasymt}{\isamath{\mathrm{t}}} +\newcommand{\isasymu}{\isamath{\mathrm{u}}} +\newcommand{\isasymv}{\isamath{\mathrm{v}}} +\newcommand{\isasymw}{\isamath{\mathrm{w}}} +\newcommand{\isasymx}{\isamath{\mathrm{x}}} +\newcommand{\isasymy}{\isamath{\mathrm{y}}} +\newcommand{\isasymz}{\isamath{\mathrm{z}}} +\newcommand{\isasymAA}{\isamath{\mathfrak{A}}} %requires eufrak +\newcommand{\isasymBB}{\isamath{\mathfrak{B}}} %requires eufrak +\newcommand{\isasymCC}{\isamath{\mathfrak{C}}} %requires eufrak +\newcommand{\isasymDD}{\isamath{\mathfrak{D}}} %requires eufrak +\newcommand{\isasymEE}{\isamath{\mathfrak{E}}} %requires eufrak +\newcommand{\isasymFF}{\isamath{\mathfrak{F}}} %requires eufrak +\newcommand{\isasymGG}{\isamath{\mathfrak{G}}} %requires eufrak +\newcommand{\isasymHH}{\isamath{\mathfrak{H}}} %requires eufrak +\newcommand{\isasymII}{\isamath{\mathfrak{I}}} %requires eufrak +\newcommand{\isasymJJ}{\isamath{\mathfrak{J}}} %requires eufrak +\newcommand{\isasymKK}{\isamath{\mathfrak{K}}} %requires eufrak +\newcommand{\isasymLL}{\isamath{\mathfrak{L}}} %requires eufrak +\newcommand{\isasymMM}{\isamath{\mathfrak{M}}} %requires eufrak +\newcommand{\isasymNN}{\isamath{\mathfrak{N}}} %requires eufrak +\newcommand{\isasymOO}{\isamath{\mathfrak{O}}} %requires eufrak +\newcommand{\isasymPP}{\isamath{\mathfrak{P}}} %requires eufrak +\newcommand{\isasymQQ}{\isamath{\mathfrak{Q}}} %requires eufrak +\newcommand{\isasymRR}{\isamath{\mathfrak{R}}} %requires eufrak +\newcommand{\isasymSS}{\isamath{\mathfrak{S}}} %requires eufrak +\newcommand{\isasymTT}{\isamath{\mathfrak{T}}} %requires eufrak +\newcommand{\isasymUU}{\isamath{\mathfrak{U}}} %requires eufrak +\newcommand{\isasymVV}{\isamath{\mathfrak{V}}} %requires eufrak +\newcommand{\isasymWW}{\isamath{\mathfrak{W}}} %requires eufrak +\newcommand{\isasymXX}{\isamath{\mathfrak{X}}} %requires eufrak +\newcommand{\isasymYY}{\isamath{\mathfrak{Y}}} %requires eufrak +\newcommand{\isasymZZ}{\isamath{\mathfrak{Z}}} %requires eufrak +\newcommand{\isasymaa}{\isamath{\mathfrak{a}}} %requires eufrak +\newcommand{\isasymbb}{\isamath{\mathfrak{b}}} %requires eufrak +\newcommand{\isasymcc}{\isamath{\mathfrak{c}}} %requires eufrak +\newcommand{\isasymdd}{\isamath{\mathfrak{d}}} %requires eufrak +\newcommand{\isasymee}{\isamath{\mathfrak{e}}} %requires eufrak +\newcommand{\isasymff}{\isamath{\mathfrak{f}}} %requires eufrak +\newcommand{\isasymgg}{\isamath{\mathfrak{g}}} %requires eufrak +\newcommand{\isasymhh}{\isamath{\mathfrak{h}}} %requires eufrak +\newcommand{\isasymii}{\isamath{\mathfrak{i}}} %requires eufrak +\newcommand{\isasymjj}{\isamath{\mathfrak{j}}} %requires eufrak +\newcommand{\isasymkk}{\isamath{\mathfrak{k}}} %requires eufrak +\newcommand{\isasymll}{\isamath{\mathfrak{l}}} %requires eufrak +\newcommand{\isasymmm}{\isamath{\mathfrak{m}}} %requires eufrak +\newcommand{\isasymnn}{\isamath{\mathfrak{n}}} %requires eufrak +\newcommand{\isasymoo}{\isamath{\mathfrak{o}}} %requires eufrak +\newcommand{\isasympp}{\isamath{\mathfrak{p}}} %requires eufrak +\newcommand{\isasymqq}{\isamath{\mathfrak{q}}} %requires eufrak +\newcommand{\isasymrr}{\isamath{\mathfrak{r}}} %requires eufrak +\newcommand{\isasymss}{\isamath{\mathfrak{s}}} %requires eufrak +\newcommand{\isasymtt}{\isamath{\mathfrak{t}}} %requires eufrak +\newcommand{\isasymuu}{\isamath{\mathfrak{u}}} %requires eufrak +\newcommand{\isasymvv}{\isamath{\mathfrak{v}}} %requires eufrak +\newcommand{\isasymww}{\isamath{\mathfrak{w}}} %requires eufrak +\newcommand{\isasymxx}{\isamath{\mathfrak{x}}} %requires eufrak +\newcommand{\isasymyy}{\isamath{\mathfrak{y}}} %requires eufrak +\newcommand{\isasymzz}{\isamath{\mathfrak{z}}} %requires eufrak +\newcommand{\isasymalpha}{\isamath{\alpha}} +\newcommand{\isasymbeta}{\isamath{\beta}} +\newcommand{\isasymgamma}{\isamath{\gamma}} +\newcommand{\isasymdelta}{\isamath{\delta}} +\newcommand{\isasymepsilon}{\isamath{\varepsilon}} +\newcommand{\isasymzeta}{\isamath{\zeta}} +\newcommand{\isasymeta}{\isamath{\eta}} +\newcommand{\isasymtheta}{\isamath{\vartheta}} +\newcommand{\isasymiota}{\isamath{\iota}} +\newcommand{\isasymkappa}{\isamath{\kappa}} +\newcommand{\isasymlambda}{\isamath{\lambda}} +\newcommand{\isasymmu}{\isamath{\mu}} +\newcommand{\isasymnu}{\isamath{\nu}} +\newcommand{\isasymxi}{\isamath{\xi}} +\newcommand{\isasympi}{\isamath{\pi}} +\newcommand{\isasymrho}{\isamath{\varrho}} +\newcommand{\isasymsigma}{\isamath{\sigma}} +\newcommand{\isasymtau}{\isamath{\tau}} +\newcommand{\isasymupsilon}{\isamath{\upsilon}} +\newcommand{\isasymphi}{\isamath{\varphi}} +\newcommand{\isasymchi}{\isamath{\chi}} +\newcommand{\isasympsi}{\isamath{\psi}} +\newcommand{\isasymomega}{\isamath{\omega}} +\newcommand{\isasymGamma}{\isamath{\Gamma}} +\newcommand{\isasymDelta}{\isamath{\Delta}} +\newcommand{\isasymTheta}{\isamath{\Theta}} +\newcommand{\isasymLambda}{\isamath{\Lambda}} +\newcommand{\isasymXi}{\isamath{\Xi}} +\newcommand{\isasymPi}{\isamath{\Pi}} +\newcommand{\isasymSigma}{\isamath{\Sigma}} +\newcommand{\isasymUpsilon}{\isamath{\Upsilon}} +\newcommand{\isasymPhi}{\isamath{\Phi}} +\newcommand{\isasymPsi}{\isamath{\Psi}} +\newcommand{\isasymOmega}{\isamath{\Omega}} +\newcommand{\isasymbool}{\isamath{\mathrm{I}\mkern-3.8mu\mathrm{B}}} +\newcommand{\isasymcomplex}{\isamath{\mathrm{C}\mkern-15mu{\phantom{\mathrm{t}}\vrule}\mkern9mu}} +\newcommand{\isasymnat}{\isamath{\mathrm{I}\mkern-3.8mu\mathrm{N}}} +\newcommand{\isasymrat}{\isamath{\mathrm{Q}\mkern-16mu{\phantom{\mathrm{t}}\vrule}\mkern10mu}} +\newcommand{\isasymreal}{\isamath{\mathrm{I}\mkern-3.8mu\mathrm{R}}} +\newcommand{\isasymint}{\isamath{\mathsf{Z}\mkern-7.5mu\mathsf{Z}}} +\newcommand{\isasymleftarrow}{\isamath{\leftarrow}} +\newcommand{\isasymlongleftarrow}{\isamath{\longleftarrow}} +\newcommand{\isasymrightarrow}{\isamath{\rightarrow}} +\newcommand{\isasymlongrightarrow}{\isamath{\longrightarrow}} +\newcommand{\isasymLeftarrow}{\isamath{\Leftarrow}} +\newcommand{\isasymLongleftarrow}{\isamath{\Longleftarrow}} +\newcommand{\isasymRightarrow}{\isamath{\Rightarrow}} +\newcommand{\isasymLongrightarrow}{\isamath{\Longrightarrow}} +\newcommand{\isasymleftrightarrow}{\isamath{\leftrightarrow}} +\newcommand{\isasymlongleftrightarrow}{\isamath{\longleftrightarrow}} +\newcommand{\isasymLeftrightarrow}{\isamath{\Leftrightarrow}} +\newcommand{\isasymLongleftrightarrow}{\isamath{\Longleftrightarrow}} +\newcommand{\isasymmapsto}{\isamath{\mapsto}} +\newcommand{\isasymlongmapsto}{\isamath{\longmapsto}} +\newcommand{\isasymmidarrow}{\isamath{\relbar}} +\newcommand{\isasymMidarrow}{\isamath{\Relbar}} +\newcommand{\isasymhookleftarrow}{\isamath{\hookleftarrow}} +\newcommand{\isasymhookrightarrow}{\isamath{\hookrightarrow}} +\newcommand{\isasymleftharpoondown}{\isamath{\leftharpoondown}} +\newcommand{\isasymrightharpoondown}{\isamath{\rightharpoondown}} +\newcommand{\isasymleftharpoonup}{\isamath{\leftharpoonup}} +\newcommand{\isasymrightharpoonup}{\isamath{\rightharpoonup}} +\newcommand{\isasymrightleftharpoons}{\isamath{\rightleftharpoons}} +\newcommand{\isasymleadsto}{\isamath{\leadsto}} %requires amssymb +\newcommand{\isasymdownharpoonleft}{\isamath{\downharpoonleft}} %requires amssymb +\newcommand{\isasymdownharpoonright}{\isamath{\downharpoonright}} %requires amssymb +\newcommand{\isasymupharpoonleft}{\isamath{\upharpoonleft}} %requires amssymb +\newcommand{\isasymupharpoonright}{\isamath{\upharpoonright}} %requires amssymb +\newcommand{\isasymrestriction}{\isamath{\restriction}} %requires amssymb +\newcommand{\isasymColon}{\isamath{\mathrel{::}}} +\newcommand{\isasymup}{\isamath{\uparrow}} +\newcommand{\isasymUp}{\isamath{\Uparrow}} +\newcommand{\isasymdown}{\isamath{\downarrow}} +\newcommand{\isasymDown}{\isamath{\Downarrow}} +\newcommand{\isasymupdown}{\isamath{\updownarrow}} +\newcommand{\isasymUpdown}{\isamath{\Updownarrow}} +\newcommand{\isasymlangle}{\isamath{\langle}} +\newcommand{\isasymrangle}{\isamath{\rangle}} +\newcommand{\isasymlceil}{\isamath{\lceil}} +\newcommand{\isasymrceil}{\isamath{\rceil}} +\newcommand{\isasymlfloor}{\isamath{\lfloor}} +\newcommand{\isasymrfloor}{\isamath{\rfloor}} +\newcommand{\isasymlparr}{\isamath{\mathopen{(\mkern-3mu\mid}}} +\newcommand{\isasymrparr}{\isamath{\mathclose{\mid\mkern-3mu)}}} +\newcommand{\isasymlbrakk}{\isamath{\mathopen{\lbrack\mkern-3mu\lbrack}}} +\newcommand{\isasymrbrakk}{\isamath{\mathclose{\rbrack\mkern-3mu\rbrack}}} +\newcommand{\isasymlbrace}{\isamath{\mathopen{\lbrace\mkern-4.5mu\mid}}} +\newcommand{\isasymrbrace}{\isamath{\mathclose{\mid\mkern-4.5mu\rbrace}}} +\newcommand{\isasymguillemotleft}{\isatext{\flqq}} %requires babel +\newcommand{\isasymguillemotright}{\isatext{\frqq}} %requires babel +\newcommand{\isasymbottom}{\isamath{\bot}} +\newcommand{\isasymtop}{\isamath{\top}} +\newcommand{\isasymand}{\isamath{\wedge}} +\newcommand{\isasymAnd}{\isamath{\bigwedge}} +\newcommand{\isasymor}{\isamath{\vee}} +\newcommand{\isasymOr}{\isamath{\bigvee}} +\newcommand{\isasymforall}{\isamath{\forall\,}} +\newcommand{\isasymexists}{\isamath{\exists\,}} +\newcommand{\isasymnexists}{\isamath{\nexists\,}} %requires amssymb +\newcommand{\isasymnot}{\isamath{\neg}} +\newcommand{\isasymbox}{\isamath{\Box}} %requires amssymb +\newcommand{\isasymdiamond}{\isamath{\Diamond}} %requires amssymb +\newcommand{\isasymturnstile}{\isamath{\vdash}} +\newcommand{\isasymTurnstile}{\isamath{\models}} +\newcommand{\isasymtturnstile}{\isamath{\vdash\!\!\!\vdash}} +\newcommand{\isasymTTurnstile}{\isamath{\mid\!\models}} +\newcommand{\isasymstileturn}{\isamath{\dashv}} +\newcommand{\isasymsurd}{\isamath{\surd}} +\newcommand{\isasymle}{\isamath{\le}} +\newcommand{\isasymge}{\isamath{\ge}} +\newcommand{\isasymlless}{\isamath{\ll}} +\newcommand{\isasymggreater}{\isamath{\gg}} +\newcommand{\isasymlesssim}{\isamath{\lesssim}} %requires amssymb +\newcommand{\isasymgreatersim}{\isamath{\gtrsim}} %requires amssymb +\newcommand{\isasymlessapprox}{\isamath{\lessapprox}} %requires amssymb +\newcommand{\isasymgreaterapprox}{\isamath{\gtrapprox}} %requires amssymb +\newcommand{\isasymin}{\isamath{\in}} +\newcommand{\isasymnotin}{\isamath{\notin}} +\newcommand{\isasymsubset}{\isamath{\subset}} +\newcommand{\isasymsupset}{\isamath{\supset}} +\newcommand{\isasymsubseteq}{\isamath{\subseteq}} +\newcommand{\isasymsupseteq}{\isamath{\supseteq}} +\newcommand{\isasymsqsubset}{\isamath{\sqsubset}} %requires amssymb +\newcommand{\isasymsqsupset}{\isamath{\sqsupset}} %requires amssymb +\newcommand{\isasymsqsubseteq}{\isamath{\sqsubseteq}} +\newcommand{\isasymsqsupseteq}{\isamath{\sqsupseteq}} +\newcommand{\isasyminter}{\isamath{\cap}} +\newcommand{\isasymInter}{\isamath{\bigcap\,}} +\newcommand{\isasymunion}{\isamath{\cup}} +\newcommand{\isasymUnion}{\isamath{\bigcup\,}} +\newcommand{\isasymsqunion}{\isamath{\sqcup}} +\newcommand{\isasymSqunion}{\isamath{\bigsqcup\,}} +\newcommand{\isasymsqinter}{\isamath{\sqcap}} +\newcommand{\isasymSqinter}{\isamath{\bigsqcap\,}} %requires stmaryrd +\newcommand{\isasymsetminus}{\isamath{\setminus}} +\newcommand{\isasympropto}{\isamath{\propto}} +\newcommand{\isasymuplus}{\isamath{\uplus}} +\newcommand{\isasymUplus}{\isamath{\biguplus\,}} +\newcommand{\isasymnoteq}{\isamath{\not=}} +\newcommand{\isasymsim}{\isamath{\sim}} +\newcommand{\isasymdoteq}{\isamath{\doteq}} +\newcommand{\isasymsimeq}{\isamath{\simeq}} +\newcommand{\isasymapprox}{\isamath{\approx}} +\newcommand{\isasymasymp}{\isamath{\asymp}} +\newcommand{\isasymcong}{\isamath{\cong}} +\newcommand{\isasymsmile}{\isamath{\smile}} +\newcommand{\isasymequiv}{\isamath{\equiv}} +\newcommand{\isasymfrown}{\isamath{\frown}} +\newcommand{\isasymJoin}{\isamath{\Join}} %requires amssymb +\newcommand{\isasymbowtie}{\isamath{\bowtie}} +\newcommand{\isasymprec}{\isamath{\prec}} +\newcommand{\isasymsucc}{\isamath{\succ}} +\newcommand{\isasympreceq}{\isamath{\preceq}} +\newcommand{\isasymsucceq}{\isamath{\succeq}} +\newcommand{\isasymparallel}{\isamath{\parallel}} +\newcommand{\isasymbar}{\isamath{\mid}} +\newcommand{\isasymplusminus}{\isamath{\pm}} +\newcommand{\isasymminusplus}{\isamath{\mp}} +\newcommand{\isasymtimes}{\isamath{\times}} +\newcommand{\isasymdiv}{\isamath{\div}} +\newcommand{\isasymcdot}{\isamath{\cdot}} +\newcommand{\isasymstar}{\isamath{\star}} +\newcommand{\isasymbullet}{\boldmath\isamath{\mathchoice{\displaystyle{\cdot}}{\textstyle{\cdot}}{\scriptstyle{\bullet}}{\scriptscriptstyle{\bullet}}}} +\newcommand{\isasymcirc}{\isamath{\circ}} +\newcommand{\isasymdagger}{\isamath{\dagger}} +\newcommand{\isasymddagger}{\isamath{\ddagger}} +\newcommand{\isasymlhd}{\isamath{\lhd}} %requires amssymb +\newcommand{\isasymrhd}{\isamath{\rhd}} %requires amssymb +\newcommand{\isasymunlhd}{\isamath{\unlhd}} %requires amssymb +\newcommand{\isasymunrhd}{\isamath{\unrhd}} %requires amssymb +\newcommand{\isasymtriangleleft}{\isamath{\triangleleft}} +\newcommand{\isasymtriangleright}{\isamath{\triangleright}} +\newcommand{\isasymtriangle}{\isamath{\triangle}} +\newcommand{\isasymtriangleq}{\isamath{\triangleq}} %requires amssymb +\newcommand{\isasymoplus}{\isamath{\oplus}} +\newcommand{\isasymOplus}{\isamath{\bigoplus\,}} +\newcommand{\isasymotimes}{\isamath{\otimes}} +\newcommand{\isasymOtimes}{\isamath{\bigotimes\,}} +\newcommand{\isasymodot}{\isamath{\odot}} +\newcommand{\isasymOdot}{\isamath{\bigodot\,}} +\newcommand{\isasymominus}{\isamath{\ominus}} +\newcommand{\isasymoslash}{\isamath{\oslash}} +\newcommand{\isasymdots}{\isamath{\dots}} +\newcommand{\isasymcdots}{\isamath{\cdots}} +\newcommand{\isasymSum}{\isamath{\sum\,}} +\newcommand{\isasymProd}{\isamath{\prod\,}} +\newcommand{\isasymCoprod}{\isamath{\coprod\,}} +\newcommand{\isasyminfinity}{\isamath{\infty}} +\newcommand{\isasymintegral}{\isamath{\int\,}} +\newcommand{\isasymointegral}{\isamath{\oint\,}} +\newcommand{\isasymclubsuit}{\isamath{\clubsuit}} +\newcommand{\isasymdiamondsuit}{\isamath{\diamondsuit}} +\newcommand{\isasymheartsuit}{\isamath{\heartsuit}} +\newcommand{\isasymspadesuit}{\isamath{\spadesuit}} +\newcommand{\isasymaleph}{\isamath{\aleph}} +\newcommand{\isasymemptyset}{\isamath{\emptyset}} +\newcommand{\isasymnabla}{\isamath{\nabla}} +\newcommand{\isasympartial}{\isamath{\partial}} +\newcommand{\isasymRe}{\isamath{\Re}} +\newcommand{\isasymIm}{\isamath{\Im}} +\newcommand{\isasymflat}{\isamath{\flat}} +\newcommand{\isasymnatural}{\isamath{\natural}} +\newcommand{\isasymsharp}{\isamath{\sharp}} +\newcommand{\isasymangle}{\isamath{\angle}} +\newcommand{\isasymcopyright}{\isatext{\rm\copyright}} +\newcommand{\isasymregistered}{\isatext{\rm\textregistered}} +\newcommand{\isasymhyphen}{\isatext{\rm-}} +\newcommand{\isasyminverse}{\isamath{{}^{-1}}} +\newcommand{\isasymonesuperior}{\isamath{{}^1}} +\newcommand{\isasymonequarter}{\isatext{\rm\textonequarter}} %requires textcomp +\newcommand{\isasymtwosuperior}{\isamath{{}^2}} +\newcommand{\isasymonehalf}{\isatext{\rm\textonehalf}} %requires textcomp +\newcommand{\isasymthreesuperior}{\isamath{{}^3}} +\newcommand{\isasymthreequarters}{\isatext{\rm\textthreequarters}} %requires textcomp +\newcommand{\isasymordfeminine}{\isatext{\rm\textordfeminine}} +\newcommand{\isasymordmasculine}{\isatext{\rm\textordmasculine}} +\newcommand{\isasymsection}{\isatext{\rm\S}} +\newcommand{\isasymparagraph}{\isatext{\rm\P}} +\newcommand{\isasymexclamdown}{\isatext{\rm\textexclamdown}} +\newcommand{\isasymquestiondown}{\isatext{\rm\textquestiondown}} +\newcommand{\isasymeuro}{\isatext{\textgreek{\euro}}} %requires greek babel +\newcommand{\isasympounds}{\isamath{\pounds}} +\newcommand{\isasymyen}{\isatext{\yen}} %requires amssymb +\newcommand{\isasymcent}{\isatext{\textcent}} %requires textcomp +\newcommand{\isasymcurrency}{\isatext{\textcurrency}} %requires textcomp +\newcommand{\isasymdegree}{\isatext{\rm\textdegree}} %requires textcomp +\newcommand{\isasymamalg}{\isamath{\amalg}} +\newcommand{\isasymmho}{\isamath{\mho}} %requires amssymb +\newcommand{\isasymlozenge}{\isamath{\lozenge}} %requires amssymb +\newcommand{\isasymwp}{\isamath{\wp}} +\newcommand{\isasymwrong}{\isamath{\wr}} +\newcommand{\isasymstruct}{\isamath{\diamond}} +\newcommand{\isasymacute}{\isatext{\'\relax}} +\newcommand{\isasymindex}{\isatext{\i}} +\newcommand{\isasymdieresis}{\isatext{\"\relax}} +\newcommand{\isasymcedilla}{\isatext{\c\relax}} +\newcommand{\isasymhungarumlaut}{\isatext{\H\relax}} +\newcommand{\isasymspacespace}{\isamath{~~}} +\newcommand{\isasymmodule}{\isamath{\langle}\isakeyword{module}\isamath{\rangle}} +\newcommand{\isasymsome}{\isamath{\epsilon\,}} diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/jrocnik_cadgme.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/jrocnik_cadgme.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,281 @@ +\documentclass[% +%handout, % prints handouts (=no animations, for printed version) +%mathserif +%xcolor=pst, +14pt +% fleqn +]{beamer} + +\usepackage{beamerthemedefault} + +\usepackage{color} +\definecolor{lgray}{RGB}{238,238,238} +\definecolor{gray}{rgb}{0.8,0.8,0.8} + +\useoutertheme[subsection=false]{smoothbars} +%\useinnertheme{circles} + +\setbeamercolor{block title}{fg=black,bg=gray} +\setbeamercolor{block title alerted}{use=alerted text,fg=black,bg=alerted text.fg!75!bg} +\setbeamercolor{block title example}{use=example text,fg=black,bg=example text.fg!75!bg} +\setbeamercolor{block body}{parent=normal text,use=block title,bg=block title.bg!25!bg} +\setbeamercolor{block body alerted}{parent=normal text,use=block title alerted,bg=block title alerted.bg!25!bg} +\setbeamercolor{block body example}{parent=normal text,use=block title example,bg=block title example.bg!25!bg} + +%activate hyperlinks at the end +%\usepackage{hyperref} + +\usepackage[english]{babel} +\usepackage[utf8]{inputenc} +\usepackage{array} +\usepackage{setspace} +\usepackage{url} + +\definecolor{tug}{rgb}{0.96862,0.14509,0.27450} + +\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} +\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} + +\setbeamertemplate{headline}[text line]{ + \begin{beamercolorbox}[wd=\paperwidth,ht=8ex,dp=4ex]{} + \insertnavigation{0.85\paperwidth} + \raisebox{-10pt}{\includegraphics[width=15mm]{tuglogo}}\vskip2pt + \hskip-1pt\rule{\paperwidth}{0.3pt} + \end{beamercolorbox} +} + +\setbeamertemplate{navigation symbols}{} +\setbeamercolor{footline}{fg=black,bg=gray} + +% Fusszeile mit Autor, Titel und Foliennummer / Gesamtfolienzahl +\setbeamertemplate{footline}[text line]{ + \hskip-1pt + \begin{beamercolorbox}[wd=\paperwidth]{footline} + \rule{\paperwidth}{0.3pt} + \colorbox{tug}{\rule{3pt}{0pt}\rule{0pt}{3pt}} + \textbf{\rule{0pt}{5pt}\insertshortauthor\hfill\insertshortinstitute\hfill% + \insertshorttitle\rule{1em}{0pt}} + \rule{\paperwidth}{0.3pt} + \end{beamercolorbox} + \begin{beamercolorbox}[wd=\paperwidth,ht=2ex,dp=2ex]{white} + \end{beamercolorbox} +}% + +%% Titelblatt-Einstellungen +\institute[IST]{Institute for Software Technology\\Graz University of Technology} +\title[ISAC for Signal Processing]{Interactive Course Material by TP-based Programming} +\subtitle{A Case Study} +\author{Jan Ro\v{c}nik} +\date{24. June 2012} + +% Subject and Keywords for PDF +\subject{CADGME Presentation} +\keywords{interactive course material, signal processing, z transform, TP-based programming +language, Lucas-Interpreter, Theorem Proving} + +\titlegraphic{\includegraphics[width=20mm]{tuglogo}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{document} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame}[plain] + \frametitle{} + \titlepage +\end{frame} + + + +%\begin{frame} +% \frametitle{Contents} +% \begin{spacing}{0.3} +% \tableofcontents[hideallsubsections % +% % ,pausesections +% ] % erzeugt Inhaltsverzeichnis +% \end{spacing} +%\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{Introduction} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\subsection{isabelle} +\begin{frame} + \frametitle{What is Isabelle?} + \begin{spacing}{2} + \begin{itemize} + \item Interactive Theorem Prover (Interactice TP) + \item Large body of mechanized math knowledge + \item Developed in Cambridge, Munich and Paris + \end{itemize} + \end{spacing} +\end{frame} + +\subsection{isac} +\begin{frame} + \frametitle{What is {\isac}?} + \begin{spacing}{1.7} + \begin{itemize} + \item \textcolor{tug}{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal A}$}belle for~{}\textcolor{tug}{${\cal C}$}alculations + \item Interactive Course Material + \item Learning Coach + \item Developed at Austrian Universities + \end{itemize} + \end{spacing} +\end{frame} + +\subsection{motivation} +\begin{frame} + \frametitle{{\isac{}} for Interactive Course Material} + \begin{itemize} + \item Stepwise solving of engineering problems\\ + {\small $\rightarrow$ \textcolor{tug}{One Framework for all phases of problem solving}} + \item Explaining underlying knowledge\\ + {\small $\rightarrow$ \textcolor{tug}{Transparent Content, Access to Multimedia Content}} + \item Checking steps input by the student\\ + {\small $\rightarrow$ \textcolor{tug}{Proof Situation}} + \item Assessing stepwise problem solving\\ + {\small $\rightarrow$ \textcolor{tug}{One system for tutoring and assessment}} + \end{itemize} +\end{frame} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{Material Creation} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\subsection{steps} +\begin{frame} + \frametitle{Course Material Creation {\normalsize Iterations}} %tasks? work flow? + \begin{spacing}{1.3} + \begin{enumerate} + \item Problem Analysis\\ + {\small Variants of problem solving steps} %example partial fractions + \item \textbf{Analysis of mechanized knowledge}\\ + {\small Existing and missing knowledge} + \item \textbf{Programming in a TP based language (TP-PL)} + \item Additional Content\\ + {\small Multimedia explanations for underlying knowledge} + \end{enumerate} + \end{spacing} +\end{frame} + +\subsection{issues} +\begin{frame} + \frametitle{Issues to Accomplish {\normalsize Information Collection}} + \begin{spacing}{1.3} + \begin{itemize} + \item What knowledge is mechanized in Isabelle?\\ + {\small Theorems, Definitions, Numbers,\ldots} + \item What knowledge is mechanized in {\isac{}}?\\ + {\small Problem specifications, Programs,\ldots} + \item What additional explanations are required?\\ + {\small Figures, Examples,\ldots} + \end{itemize} + \end{spacing} +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{Details} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\subsection{Technical Survey} +%\begin{frame} +% \frametitle{Technical Survey I {\normalsize Mechanizing Knowledge}} +% \begin{spacing}{1.5} +% \begin{itemize} +% \item Not enough knowledge is mechanized\\ +% {\small Equation Solving, Integrals,\ldots} +% \item Computer Mathematicians required!\\ +% {\small Mathematics: Equation solving, Engineer: Z-Transform} +% \item RISC Linz, Mathematics TU Graz +% \end{itemize} +% \end{spacing} +%\end{frame} + +%\begin{frame} +% \frametitle{Technical Survey II {\normalsize Representation Problems} } +% \begin{spacing}{1.9} +% \begin{itemize} +% \item Different brackets have different meanings\\ +% {\small $u[n]$ is a specific function application :) } +% \item We need Symbols, Indizes and Hochzahlen +% \item Different Representations for different purpos %winkel in polar oder kartesischen koordinaten usw. +% \end{itemize} +% \end{spacing} +%\end{frame} + +\begin{frame} + \frametitle{Representation Problems} + \begin{spacing}{1.4} + \begin{center} + + \begin{itemize} + \item Can meaning of symbols be varied?\\ + {\small $u[n]$ is a specific function in Signal Processing} + \item Simplification, tricks and beauty + \end{itemize} + + {\small $X\cdot(a+b)+Y\cdot(c+d)=aX+bX+cY+dY$}\\ + \vspace{3mm} + {\small $\frac{1}{j\omega}\cdot\left(e^{-j\omega}-e^{j3\omega}\right)=\frac{1}{j\omega}\cdot e^{-j2\omega}\cdot\left(e^{j\omega}-e^{-j\omega}\right)=$}\\ + {\small $=\frac{1}{\omega}\, e^{-j2\omega}\cdot\colorbox{lgray}{$\frac{1}{j}\,\left(e^{j\omega}-e^{-j\omega}\right)$}=\frac{1}{\omega}\,e^{-j2\omega}\cdot\colorbox{lgray}{$2\, sin(\omega)$} $} + + + \end{center} + \end{spacing} +\end{frame} + +\subsection{Demonstration} +\begin{frame} + \frametitle{Demonstration} + \begin{spacing}{1.5} + \begin{itemize} + \item Backend + \begin{itemize} + \item Equation solving + \item Notation problems, Working with Rulesets + \item Framework expansion + \item My Work + \end{itemize} + \end{itemize} + \end{spacing} +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{Summary} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\subsection{conclusion} +\begin{frame} + \frametitle{Conclusion} + \begin{spacing}{1.2} + \begin{itemize} + \item Proof of concept for TP-PL succesfull + \item Usability of TP-PL not sufficient + \item Requirements for improved usability clarified + \vspace{5mm} + \item Unacceptable to spend 200h on 1 program + \item \isac{} pointed at my own error + \end{itemize} + \end{spacing} +\end{frame} + +\subsection{contact} +\begin{frame} + \frametitle{Contact} + \begin{spacing}{1.7} + \begin{tabular}{lr} + Isabelle & \small \texttt{\href{isabelle.in.tum.de}{isabelle.in.tum.de}}\\ + The {\isac}-Project & \small \texttt{\href{www.ist.tugraz.at/isac}{www.ist.tugraz.at/isac}}\\ + Project leader & \small \texttt{\href{mailto:wneuper@ist.tugraz.at}{wneuper@ist.tugraz.at}}\\ + Jan Rocnik & \small \texttt{\href{mailto:jan.rocnik@student.tugraz.at}{jan.rocnik@student.tugraz.at}} + \end{tabular} + \end{spacing} +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\end{document} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% EOF \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/math-universe.png Binary file doc-isac/jrocnik/math-universe.png has changed diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/pdfsetup.sty --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/pdfsetup.sty Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,7 @@ +%% +%% default hyperref setup (both for pdf and dvi output) +%% + +\usepackage{color} +\definecolor{linkcolor}{rgb}{0,0,0.5} +\usepackage[colorlinks=true,linkcolor=linkcolor,citecolor=linkcolor,filecolor=linkcolor,pagecolor=linkcolor,urlcolor=linkcolor]{hyperref} diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/preambleForGeneratedDocuments.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/preambleForGeneratedDocuments.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,5 @@ +\section*{Preamble} +This part gives a detailed review on the development and testing process of new programms. All of the following part is automatically generated out of an {\sisac{}}-theory file (\texttt{.thy} - extension). In this case the file is called \texttt{Build\_Inverse\_Z\_Transform} it can be found in the {\sisac{}} directory: +\begin{center}\texttt{test/Tools/isac/ADDTESTS/course/}\end{center} +{\sisac{}} provides inbuild tools for translating theories into latex documents. To set up such an envoriemt a file called \texttt{isacmakefile} is needed. Further information about this automatic generation can be found in \cite{wenzel2011system}. +\par The following theory can be modified and used as a guiedline for implementing new material. Everything found here is just a snapshot of the work by \today. \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/references.bib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/references.bib Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,142 @@ +@book{proakis2004contemporary, + title={Contemporary communication systems using MATLAB and Simulink}, + author={Proakis, J.G. and Salehi, M. and Bauch, G.}, + isbn={9780534406172}, + lccn={31054410}, + series={BookWare companion series}, + url={http://books.google.at/books?id=5mXGQgAACAAJ}, + year={2004}, + publisher={Thomson--Brooks/Cole} +} +@book{oppenheim2010discrete, + title={Discrete-time signal processing}, + author={Oppenheim, A.V. and Schafer, R.W.}, + isbn={9780131988422}, + series={Prentice-Hall signal processing series}, + url={http://books.google.at/books?id=mYsoAQAAMAAJ}, + year={2010}, + publisher={Prentice Hall} +} +@manual{wenzel2011system, + title={The Isabelle System Manual}, + author={Wenzel, M. and Berghofer, S.}, + organization={TU Muenchen}, + year={2011}, + month={January} +} +@Book{Nipkow-Paulson-Wenzel:2002, + author = {Tobias Nipkow and Lawrence C. Paulson and Markus Wenzel}, + title = {{Isabelle/HOL} --- A Proof Assistant for Higher-Order Logic}, + publisher = {Springer}, + series = {LNCS}, + volume = 2283, + year = 2002} +@Book{progr-mathematica, + author = {Maeder, Roman E.}, + title = {Programming in Mathematica}, + publisher = {Addison-Wesley}, + address = {Reading, Mass.}, + year = {1997} +} +@Book{prog-maple06, + author = {Aladjav, Victor and Bogdevicius, Marijonas}, + title = {Maple: Programming, Physical and Engineering Problems}, + publisher = {Fultus Corporation}, + year = {2006}, + month = {February 27}, + annote = {ISBN: 1596820802} +} +@Article{plmms10, + author = {Florian Haftmann and Cezary Kaliszyk and Walther Neuper}, + title = {{CTP}-based programming languages~? Considerations about an experimental design}, + journal = {ACM Communications in Computer Algebra}, + year = {2010}, + volume = {44}, + number = {1/2}, + pages = {27-41} %, + %month = {March/June}, + %note = {http://www.ist.tugraz.at/projects/isac/publ/plmms-10.pdf} +} +@inproceedings{casproto, + author = {Cezary Kaliszyk and + Freek Wiedijk}, + title = {Certified Computer Algebra on Top of an Interactive Theorem + Prover}, + booktitle = {Calculemus}, + year = {2007}, + pages = {94-105}, + ee = {http://dx.doi.org/10.1007/978-3-540-73086-6_8}, + crossref = {DBLP:conf/mkm/2007}, + bibsource = {DBLP, http://dblp.uni-trier.de} +} +@InProceedings{wn:lucas-interp-12, + author = {Neuper, Walther}, + title = {Automated Generation of User Guidance by Combining Computation and Deduction}, + booktitle = {THedu'11: CTP-compontents for educational software}, + year = {2012}, + editor = {Quaresma, Pedro}, + publisher = {EPTCS}, + note = {To appear} +} +@Manual{Huet_all:94, + author = {Huet, G. and Kahn, G. and Paulin-Mohring, C.}, + title = {The Coq Proof Assistant}, + institution = {INRIA-Rocquencourt}, + year = {1994}, + type = {Tutorial}, + number = {Version 5.10}, + address = {CNRS-ENS Lyon}, + status={},source={Theorema},location={-} +} +@TECHREPORT{Back-SD09, + author = {Back, Ralph-Johan}, + title = {Structured Derivations as a Unified Proof Style for Teaching Mathematics}, + institution = {TUCS - Turku Centre for Computer Science}, + year = {2009}, + type = {TUCS Technical Report}, + number = {949}, + address = {Turku, Finland}, + month = {July} +} +@InProceedings{ActiveMath-MAIN11, + author = {Melis, Erica and Siekmann, Jrg}, + title = {An Intelligent Tutoring System for Mathematics}, + booktitle = {Seventh International Conference Artificial Intelligence and Soft Computing (ICAISC)}, + pages = {91-101}, + year = {2004}, + editor = {Rutkowski, L. and Siekmann, J. and Tadeusiewicz, R. and Zadeh, L.A.}, + number = {3070,}, + series = {LNAI}, + publisher = {Springer-Verlag}, + doi = {doi:10.1007/978-3-540-24844-6\_12}} +@TechReport{mat-tutor-cmu-MAIN11, + author = {John R. Anderson}, + title = {Intelligent Tutoring and High School Mathematics}, + institution = {Carnegie Mellon University, Department of Psychology}, + year = {2008}, + type = {Technical Report}, + number = {20}, + note = {http://repository.cmu.edu/psychology/20} +} +@PhdThesis{proof-strategies-11, + author = {Dietrich, Dominik}, + title = {Proof Planning with Compiled Strategies}, + school = {FR 6.2 Informatik, Saarland University}, + year = {2011} +} +@proceedings{DBLP:conf/mkm/2007, + editor = {Manuel Kauers and + Manfred Kerber and + Robert Miner and + Wolfgang Windsteiger}, + title = {Towards Mechanized Mathematical Assistants, 14th Symposium, + Calculemus 2007, 6th International Conference, MKM 2007, + Hagenberg, Austria, June 27-30, 2007, Proceedings}, + booktitle = {Calculemus/MKM}, + publisher = {Springer}, + series = {Lecture Notes in Computer Science}, + volume = {4573}, + year = {2007}, + isbn = {978-3-540-73083-5}, + bibsource = {DBLP, http://dblp.uni-trier.de} +} diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/sedindex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/sedindex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,21 @@ +#! /bin/sh +# +#sedindex - shell script to create indexes, preprocessing LaTeX's .idx file +# +# puts strings prefixed by * into \tt font +# terminator characters for strings are |!@{} +# +# a space terminates the \tt part to allow \index{*NE theorem}, etc. +# +# change *"X"Y"Z"W to "X"Y"Z"W@{\tt "X"Y"Z"W} +# change *"X"Y"Z to "X"Y"Z@{\tt "X"Y"Z} +# change *"X"Y to "X"Y@{\tt "X"Y} +# change *"X to "X@{\tt "X} +# change *IDENT to IDENT@{\tt IDENT} +# where IDENT is any string not containing | ! or @ +# FOUR backslashes: to escape the shell AND sed +sed -e "s~\*\(\".\".\".\".\)~\1@{\\\\tt \1}~g +s~\*\(\".\".\".\)~\1@{\\\\tt \1}~g +s~\*\(\".\".\)~\1@{\\\\tt \1}~g +s~\*\(\".\)~\1@{\\\\tt \1}~g +s~\*\([^ |!@{}][^ |!@{}]*\)~\1@{\\\\tt \1}~g" $1.idx | makeindex -c -q -o $1.ind diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/jrocnik/wn-notes.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/jrocnik/wn-notes.txt Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,76 @@ +WN110711 +HOL/Multivariate_Analysis/ +######################### _multi_variate ... nothing else found + +src$ grep -r "interior " * +========================== +HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +definition "interior S = {x. \T. open T \ x \ T \ T \ S}" + +grep -r "definition \"interval" * +================================= +HOL/Multivariate_Analysis/Brouwer_Fixpoint.thy +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +definition "interval_bij = (\ (a::'a,b::'a) (u::'a,v::'a) (x::'a::ordered_euclidean_space). + (\\ i. u$$i + (x$$i - a$$i) / (b$$i - a$$i) * (v$$i - u$$i))::'a)" + + +??? "{a<.. {c..d} \ s" ?definition interval? + +src$ grep -r ".nti.eriv" * +========================= +1 file except isac: +# HOL/Multivariate_Analysis/Derivative.thy +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +header {* Kurzweil-Henstock Gauge Integration in many dimensions. *} +definition differentiable :: "('a::real_normed_vector \ 'b::real_normed_vector) \ 'a net \ bool" (infixr "differentiable" 30) where + "f differentiable net \ (\f'. (f has_derivative f') net)" + +definition differentiable_on :: "('a::real_normed_vector \ 'b::real_normed_vector) \ 'a set \ bool" (infixr "differentiable'_on" 30) where + "f differentiable_on s \ (\x\s. f differentiable (at x within s))" + +definition "frechet_derivative f net = (SOME f'. (f has_derivative f') net)" + +/ +========================= +HOL/Multivariate_Analysis/Integration.thy +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +header {* Kurzweil-Henstock Gauge Integration in many dimensions. *} +definition "integral i f \ SOME y. (f has_integral y) i" + +/ +========================= +HOL/Multivariate_Analysis/Real_Integration.thy +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +text{*We follow John Harrison in formalizing the Gauge integral.*} + +definition Integral :: "real set \ (real \ real) \ real \ bool" where + "Integral s f k = (f o dest_vec1 has_integral k) (vec1 ` s)" + +Multivariate_Analysis/L2_Norm.thy:header {* Square root of sum of squares *} + + +################################################################################ +### sum +################################################################################ +src/HOL$ grep -r " sum " * +========================== +ex/Summation.thy:text {* The formal sum operator. *} +ex/Termination.thy:function sum :: "nat \ nat \ nat" +ex/Termination.thy: "sum i N = (if i > N then 0 else i + sum (Suc i) N)" +Isar_Examples/Summation.thy +~~~~~~~~~~~~~~~~~~~~~~~~~~~ +text {* The sum of natural numbers $0 + \cdots + n$ equals $n \times + +Series.thy +~~~~~~~~~~ +header{*Finite Summation and Infinite Series*} + +Deriv.thy +~~~~~~~~~ +definition + deriv :: "['a::real_normed_field \ 'a, 'a, 'a] \ bool" + --{*Differentiation: D is derivative of function f at x*} + ("(DERIV (_)/ (_)/ :> (_))" [1000, 1000, 60] 60) where + "DERIV f x :> D = ((%h. (f(x + h) - f x) / h) -- 0 --> D)" diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/mat-eng-de.lot --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/mat-eng-de.lot Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,12 @@ +\addvspace {10\p@ } +\addvspace {10\p@ } +\addvspace {10\p@ } +\addvspace {10\p@ } +\addvspace {10\p@ } +\addvspace {10\p@ } +\addvspace {10\p@ } +\addvspace {10\p@ } +\contentsline {table}{\numberline {8.1}{\ignorespaces Kleinste Teilchen des KB}}{37} +\contentsline {table}{\numberline {8.2}{\ignorespaces Welche tactics verwenden die Teile des KB\nobreakspace {}?}}{38} +\contentsline {table}{\numberline {8.3}{\ignorespaces theory von der ersten Version von ${\cal I}\mkern -2mu{\cal S}\mkern -5mu{\cal AC}$}}{39} +\contentsline {table}{\numberline {8.4}{\ignorespaces Daten in {\tt *.thy}- und {\tt *.ML}-files}}{40} diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/mat-eng-de.pdf Binary file doc-isac/mat-eng-de.pdf has changed diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/mat-eng-de.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/mat-eng-de.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,1354 @@ +\documentclass[11pt,a4paper,headline,headcount,towside,nocenter]{report} +\usepackage{latexsym} + +%\usepackage{ngerman} +%\grmn@dq@error ...and \dq \string #1 is undefined} +%l.989 ...tch the problem type \\{\tt["squareroot", +% "univ +\bibliographystyle{alpha} + +\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} +\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} + +\title{\isac \\ + Experimente zur Computermathematik\\[1.0ex] + und\\[1.0ex] + Handbuch f\"ur Autoren der\\ + Mathematik-Wissensbasis\\[1.0ex]} +\author{Alexandra Hirn und Eva Rott\\ + \tt isac-users@ist.tugraz.at\\[1.0ex]} +\date{\today} + +\begin{document} +\maketitle +\newpage +\tableofcontents +\newpage +\listoftables +\newpage + +\chapter{Einleitung} +Dies ist die \"Ubersetzung der dersten Kapitel einer englischen Version \footnote{http://www.ist.tugraz.at/projects/isac/publ/mat-eng.pdf}, auf den Stand von \sisac{} 2008 gebracht. Die \"Ubersetzung und Anpassung erfolgte durch die Autorinnen im Rahmen einer Ferialpraxis am Institut f\"ur Softwaretechnologie der TU Graz. + +Diese Version zeichnet sich dadurch aus, dass sie von ``Nicht-Computer-Freaks'' f\"ur ``Nicht-Computer-Freaks'' geschrieben wurde. + +\section{``Authoring'' und ``Tutoring''} +\paragraph{TO DO} Mathematik lernen -- verschiedene Autoren -- Isabelle +Die Grundlage f\"ur \isac{} bildet Isabelle. Dies ist ein ``theorem prover'', der von L. Paulson und T. Nipkow entwickelt wird und Hard- und Software pr\"uft. +\section{Der Inhalt des Dokuments} +\paragraph{TO DO} {Als Anleitung:} Dieses Dokument beschreibt das Kerngebiet (KE) von \isac{}, das Gebiet der mathematics engine (ME) im Kerngebiet und die verschiedenen Funktionen wie das Umschreiben und der Vergleich. + +\isac{} und KE wurden in SML geschrieben, die Sprache in Verbindung mit dem Vorg\"anger des theorem Provers Isabelle entwickelt. So kam es, dass in diesem Dokument die Ebene ASCII als SML Code pr\"asentiert wird. Der Leser wird vermutlich erkennen, dass der \isac{} Benutzer eine vollkommen andere Sichtweise auf eine grafische Benutzeroberfl\"ache bekommt. + +Das Dokument ist eigenst\"andig; Basiswissen \"uber SML (f\"ur eine Einf\"uhrung siehe \cite{Paulson:91}), Terme und Umschreibung wird vorrausgesetzt. + +%The interfaces will be moderately exended during the first phase of development of the mathematics knowledge. The work on the subprojects defined should {\em not} create interfaces of any interest to a user or another author of knowledge except identifiers (of type string) for theorems, rulesets etc. + +Hinweis: SML Code, Verzeichnis, Dateien sind {\tt in 'tt' geschrieben}; besonders in {\tt ML>} ist das Kerngebiet schnell. + +\paragraph{Versuchen Sie es!} Ein weiteres Anliegen dieses Textes ist, dem Leser Tipps f\"ur Versuche mit den Anwendungen zu geben. + +\section{Gleich am Computer ausprobieren!}\label{get-started} +\paragraph{TO DO screenshot} Bevor Sie mit Ihren Versuchen beginnen, m\"ochten wir Ihnen noch einige Hinweise geben: +\begin{itemize} + \item System starten + \item Shell aufmachen und die Datei mat-eng-de.sml \"offnen. + \item $>$ : Hinter diesem Zeichen (``Prompt'') stehen jene, die Sie selbst eingeben bzw. mit Copy und Paste aus der Datei kopieren. + \item Die Eingabe wird mit ``;'' und ``Enter'' abgeschlossen. + \item Zeilen, die nicht mit Prompt beginnen, werden vom Computer ausgegeben. + +\end{itemize} + +\part{Experimentelle Ann\"aherung} + +\chapter{Terme und Theorien} +Wie bereits erw\"ahnt, geht es um Computer-Mathematik. In den letzten Jahren hat die ``computer science'' grosse Fortschritte darin gemacht, Mathematik auf dem Computer verst\"andlich darzustellen. Dies gilt f\"ur mathematische Formeln, f\"ur die Beschreibung von Problemen, f\"ur L\"osungsmethoden etc. Wir beginnen mit mathematischen Formeln. + +\section{Von der Formel zum Term} +Um ein Beispiel zu nennen: Die Formel $a+b\cdot 3$ l\"asst sich in lesbarer Form so eingeben: +{\footnotesize\begin{verbatim} + > "a + b * 3"; + val it = "a + b * 3" : string +\end{verbatim}} +\noindent ``a + b * 3'' ist also ein string (eine Zeichenfolge). In dieser Form weiss der Computer nicht, dass z.B. eine Multiplikation {\em vor} einer Addition zu rechnen ist. Isabelle braucht dazu eine andere Darstellung f\"ur Formeln. In diese kann man mit der Funktion {\tt str2term} (string to term) umrechnen: +{\footnotesize\begin{verbatim} + > str2term "a + b * 3"; + val it = + Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $ + Free ("a", "RealDef.real") $ + (Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $ + ...) : Term.term +\end{verbatim}} +\noindent Diese Form heisst {\tt term} und ist nicht f\"ur den Menschen zum lesen gedacht. Isabelle braucht sie aber intern zum Rechnen. Wir wollen sie mit Hilfe von {\tt val} (value) auf der Variable {\tt t} speichern: +{\footnotesize\begin{verbatim} + > val t = str2term "a + b * 3"; + val t = + Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $ + Free ("a", "RealDef.real") $ + (Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $ + ...) : Term.term +\end{verbatim}} +Von dieser Variablen {\tt t} kann man den Wert jederzeit abrufen: +{\footnotesize\begin{verbatim} + > t; + val it = + Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $ + Free ("a", "RealDef.real") $ + (Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $ + ...) : Term.term +\end{verbatim}} +Der auf {\tt t} gespeicherte Term kann einer Funktion {\tt atomty} \"ubergeben werden, die diesen in einer dritten Form zeigt: +{\footnotesize\begin{verbatim} + > atomty term; + + *** + *** Const (op +, [real, real] => real) + *** . Free (a, real) + *** . Const (op *, [real, real] => real) + *** . . Free (b, real) + *** . . Free (3, real) + *** + + val it = () : unit +\end{verbatim}} +Diese Darstellung nennt man ``abstract syntax'' und macht unmittelbar klar, dass man a und b nicht addieren kann, weil ein Mal vorhanden ist. +\newline Es gibt noch eine vierte Art von Term, den cterm. Er wird weiter unten verwendet, weil er sich als string lesbar darstellt. + +\section{``Theory'' und ``Parsing``} +Der Unterschied zwischen \isac{} und bisheriger Mathematiksoftware (GeoGebra, Mathematica, Maple, Derive etc.) ist, dass das mathematische Wissen nicht im Programmcode steht, sondern in sogenannten theories (Theorien). +Dort wird das Mathematikwissen in einer f\"ur nicht Programmierer lesbaren Form geschrieben. Das Wissen von \isac{} ist in folgenden Theorien entahlten: +{\footnotesize\begin{verbatim} + > Isac.thy; + val it = + {ProtoPure, CPure, HOL, Set, Typedef, Fun, Product_Type, Lfp, Gfp, + Sum_Type, Relation, Record, Inductive, Transitive_Closure, + Wellfounded_Recursion, NatDef, Nat, NatArith, Divides, Power, + SetInterval, Finite_Set, Equiv, IntDef, Int, Datatype_Universe, + Datatype, Numeral, Bin, IntArith, Wellfounded_Relations, Recdef, IntDiv, + IntPower, NatBin, NatSimprocs, Relation_Power, PreList, List, Map, + Hilbert_Choice, Main, Lubs, PNat, PRat, PReal, RealDef, RealOrd, + RealInt, RealBin, RealArith0, RealArith, RComplete, RealAbs, RealPow, + Ring_and_Field, Complex_Numbers, Real, ListG, Tools, Script, Typefix, + Float, ComplexI, Descript, Atools, Simplify, Poly, Rational, PolyMinus, + Equation, LinEq, Root, RootEq, RatEq, RootRat, RootRatEq, PolyEq, Vect, + Calculus, Trig, LogExp, Diff, DiffApp, Integrate, EqSystem, Biegelinie, + AlgEin, Test, Isac} : Theory.theory +\end{verbatim}} +{\tt ProtoPure} und {\tt CPure} enthalten diese logischen Grundlagen, die in {\tt HOL} und den nachfolgenden Theorien erweitert werden. \isac{} als letzte Theorie beinhaltet das gesamte Wissen. +Dass das Mal vor dem Plus berechnet wird, ist so festgelegt: +{\footnotesize\begin{verbatim} + class plus = + fixes plus :: "'a \ 'a \ 'a" (infixl "+" 65) + + class minus = + fixes minus :: "'a \ 'a \ 'a" (infixl "-" 65) + + class uminus = + fixes uminus :: "'a \ 'a" ("- _" [81] 80) + + class times = + fixes times :: "'a \ 'a \ 'a" (infixl "*" 70) +\end{verbatim}} +{\tt infix} gibt an, dass der Operator zwischen den Zahlen steht und nicht, wie in ''abstract syntax``, vorne oben. +Die Zahlen rechts davon legen die Priorit\"at fest. 70 f\"ur Mal ist gr\"osser als 65 f\"ur Plus und wird daher zuerst berechnet. + +Wollen Sie wissen, wie die einzelnen Rechengesetze aussehen, k\"onnen Sie im Internet folgenden Link ansehen: http://isabelle.in.tum.de/dist/library/HOL/Groups.html + +\paragraph{} Der Vorgang, bei dem aus einem {\tt string} ein Term entsteht, nennt man Parsing. Dazu wird Wissen aus der Theorie ben\"otigt, denn {\tt str2term} nimmt intern eine parse-Funktion, bei der immer das gesamte \isac{}-Wissen verwendet wird. Bei dieser Funktion wird weiters festgelegt, aus welcher Theorie das Wissen genommen werden soll. +{\footnotesize\begin{verbatim} + > parse Isac.thy "a + b"; + val it = Some "a + b" : Thm.cterm Library.option +\end{verbatim}} +Um sich das Weiterrechnen zu erleichtern, kann das Ergebnis vom Parsing auf eine Variable, wie zum Beispiel {\tt t} gespeichert werden: +{\footnotesize\begin{verbatim} + > val t = parse Isac.thy "a + b"; + val t = Some "a + b" : Thm.cterm Library.option +\end{verbatim}} +{\tt Some} bedeutet, dass das n\"otige Wissen vorhanden ist, um die Rechnung durchzuf\"uhren. {\tt None} zeigt uns, dass das Wissen fehlt oder ein Fehler aufgetreten ist. Daher sieht man im folgenden Beispiel, dass {\tt HOL.thy} nicht ausreichend Wissen enth\"alt: +{\footnotesize\begin{verbatim} + > parse HOL.thy "a + b"; + val it = None : Thm.cterm Library.option +\end{verbatim}} +Anschliessend zeigen wir Ihnen noch ein zweites Beispiel, bei dem sowohl ein Fehler aufgetreten ist, als auch das Wissen fehlt: +{\footnotesize\begin{verbatim} + > parse Isac.thy "a + "; + *** Inner syntax error: unexpected end of input + *** Expected tokens: "contains_root" "is_root_free" "q_" "M_b" "M_b'" + *** "Integral" "differentiate" "E_" "some_of" "||" "|||" "argument_in" + *** "filter_sameFunId" "I__" "letpar" "Rewrite_Inst" "Rewrite_Set" + *** "Rewrite_Set_Inst" "Check_elementwise" "Or_to_List" "While" "Script" + *** "\\" "\\" "\\" "CHR" "xstr" "SOME" "\\" "@" + *** "GREATEST" "[" "[]" "num" "\\" "{)" "{.." "\\" "(|" + *** "\\" "SIGMA" "()" "\\" "PI" "\\" "\\" "{" "INT" + *** "UN" "{}" "LEAST" "\\" "0" "1" "-" "!" "?" "?!" "\\" + *** "\\" "\\" "\\!" "THE" "let" "case" "~" "if" "ALL" + *** "EX" "EX!" "!!" "_" "\\" "\\" "PROP" "[|" "OFCLASS" + *** "\\" "op" "\\" "%" "TYPE" "id" "longid" "var" "..." + *** "\\" "(" + val it = None : Thm.cterm Library.option +\end{verbatim}} + +Das mathematische Wissen w\"achst mit jeder Theorie von ProtoPure bis Isac. In den folgenden Beispielen wird gezeigt, wie das Wissen w\"achst. + +{\footnotesize\begin{verbatim} + > (*-1-*); + > parse HOL.thy "2^^^3"; + *** Inner lexical error at: "^^^3" + val it = None : Thm.cterm Library.option +\end{verbatim}} +''Inner lexical error`` und ''None`` bedeuten, dass ein Fehler aufgetreten ist, denn das Wissen \"uber {\tt *} findet sich erst in der {\tt theorie group}. + +{\footnotesize\begin{verbatim} + > (*-2-*); + > parse HOL.thy "d_d x (a + x)"; + val it = None : Thm.cterm Library.option +\end{verbatim}} +Hier wiederum ist noch kein Wissen \"uber das Differenzieren vorhanden. + +{\footnotesize\begin{verbatim} + > (*-3-*); + > parse Rational.thy "2^^^3"; + val it = Some "2 ^^^ 3" : Thm.cterm Library.option +\end{verbatim}} + +{\footnotesize\begin{verbatim} + > (*-4-*); + > val Some t4 = parse Rational.thy "d_d x (a + x)"; + val t4 = "d_d x (a + x)" : Thm.cterm +\end{verbatim}} + +{\footnotesize\begin{verbatim} + > (*-5-*); + > val Some t5 = parse Diff.thy "d_d x (a + x)"; + val t5 = "d_d x (a + x)" : Thm.cterm +\end{verbatim}} +Die letzen drei Aufgaben k\"onnen schon gel\"ost werden, da {\tt Rational.thy} \"uber das n\"otige Wissen verf\"ugt. + +\section{Details von Termen} +Mit Hilfe der darunterliegenden Darstellung sieht man, dass ein cterm in einen Term umgewandelt werden kann. +{\footnotesize\begin{verbatim} + > term_of; + val it = fn : Thm.cterm -> Term.term +\end{verbatim}} +Durch die Umwandlung eines cterms in einen Term sieht man die einzelnen Teile des Terms. ''Free`` bedeutet, dass man die Variable \"andern kann. +{\footnotesize\begin{verbatim} + > term_of t4; + val it = + Free ("d_d", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $ + ...: Term.term + +\end{verbatim}} +In diesem Fall sagt uns das ''Const``, dass die Variable eine Konstante ist, also ein Fixwert, der immer die selbe Funktion hat. +{\footnotesize\begin{verbatim} + > term_of t5; + val it = + Const ("Diff.d_d", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $ + ... : Term.term +\end{verbatim}} +Sollten verschiedene Teile des ''output`` (= das vom Computer Ausgegebene) nicht sichtbar sein, kann man mit einem bestimmten Befehl alles angezeigt werden. +{\footnotesize\begin{verbatim} + > print_depth; + val it = fn : int -> unit + \end{verbatim}} +Zuerst gibt man den Befehl ein, danach den Term, der gr\"osser werden soll. Dabei kann man selbst einen Wert f\"ur die L\"ange bestimmen. +{\footnotesize\begin{verbatim} + > print_depth 10; + val it = () : unit + > term_of t4; + val it = + Free ("d_d", "[RealDef.real, RealDef.real] => RealDef.real") $ + Free ("x", "RealDef.real") $ + (Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $ + Free ("a", "RealDef.real") $ Free ("x", "RealDef.real")) + : Term.term + + > print_depth 10; + val it = () : unit + > term_of t5; + val it = + Const ("Diff.d_d", "[RealDef.real, RealDef.real] => RealDef.real") $ + Free ("x", "RealDef.real") $ + (Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $ + Free ("a", "RealDef.real") $ Free ("x", "RealDef.real")) + : Term.term +\end{verbatim}} +\paragraph{Versuchen Sie es!} +Eine andere Variante um den Unterschied der beiden Terme zu sehen ist folgende: +{\footnotesize\begin{verbatim} + > (*-4-*) val thy = Rational.thy; + val thy = + {ProtoPure, CPure, HOL, Set, Typedef, Fun, Product_Type, Lfp, Gfp, + Sum_Type, Relation, Record, Inductive, Transitive_Closure, + Wellfounded_Recursion, NatDef, Nat, NatArith, Divides, Power, + SetInterval, Finite_Set, Equiv, IntDef, Int, Datatype_Universe, + Datatype, Numeral, Bin, IntArith, Wellfounded_Relations, Recdef, IntDiv, + IntPower, NatBin, NatSimprocs, Relation_Power, PreList, List, Map, + Hilbert_Choice, Main, Lubs, PNat, PRat, PReal, RealDef, RealOrd, + RealInt, RealBin, RealArith0, RealArith, RComplete, RealAbs, RealPow, + Ring_and_Field, Complex_Numbers, Real, ListG, Tools, Script, Typefix, + Float, ComplexI, Descript, Atools, Simplify, Poly, Rational} + : Theory.theory + > ((atomty) o term_of o the o (parse thy)) "d_d x (a + x)"; + + *** + *** Free (d_d, [real, real] => real) + *** . Free (x, real) + *** . Const (op +, [real, real] => real) + *** . . Free (a, real) + *** . . Free (x, real) + *** + + val it = () : unit + + + > (*-5-*) val thy = Diff.thy; + val thy = + {ProtoPure, CPure, HOL, Set, Typedef, Fun, Product_Type, Lfp, Gfp, + Sum_Type, Relation, Record, Inductive, Transitive_Closure, + Wellfounded_Recursion, NatDef, Nat, NatArith, Divides, Power, + SetInterval, Finite_Set, Equiv, IntDef, Int, Datatype_Universe, + Datatype, Numeral, Bin, IntArith, Wellfounded_Relations, Recdef, IntDiv, + IntPower, NatBin, NatSimprocs, Relation_Power, PreList, List, Map, + Hilbert_Choice, Main, Lubs, PNat, PRat, PReal, RealDef, RealOrd, + RealInt, RealBin, RealArith0, RealArith, RComplete, RealAbs, RealPow, + Ring_and_Field, Complex_Numbers, Real, Calculus, Trig, ListG, Tools, + Script, Typefix, Float, ComplexI, Descript, Atools, Simplify, Poly, + Equation, LinEq, Root, RootEq, Rational, RatEq, RootRat, RootRatEq, + PolyEq, LogExp, Diff} : Theory.theory + + > ((atomty) o term_of o the o (parse thy)) "d_d x (a + x)"; + + *** + *** Const (Diff.d_d, [real, real] => real) + *** . Free (x, real) + *** . Const (op +, [real, real] => real) + *** . . Free (a, real) + *** . . Free (x, real) + *** + + val it = () : unit +\end{verbatim}} + + +\chapter{''Rewriting``} +\section{Was ist Rewriting?} +Bei Rewriting handelt es sich um das Umformen von Termen nach vorgegebenen Regeln. Folgende zwei Funktionen sind notwendig: +{\footnotesize\begin{verbatim} + > rewrite; + val it = fn + : + theory' -> + rew_ord' -> + rls' -> bool -> thm' -> cterm' -> (string * string list) Library.option +\end{verbatim}} +Die Funktion hat zwei Argumente, die mitgeschickt werden m\"ussen, damit die Funktion arbeiten kann. Das letzte Element {\tt (cterm' * cterm' list) Library.option} im unteren Term ist das Ergebnis, das die Funktionen {\tt rewrite} zur\"uckgeben und die zwei vorhergehenden Argumente, {\tt theorem} und {\tt cterm}, sind die f\"ur uns wichtigen. {\tt Theorem} ist die Rechenregel und {\tt cterm} jene Formel auf die die Rechenregel angewendet wird. +{\footnotesize\begin{verbatim} + > rewrite_inst; + val it = fn + : + theory' -> + rew_ord' -> + rls' ->bool -> 'a -> thm' -> cterm' -> (cterm' * cterm' list) Library.option +\end{verbatim}} +Die Funktion {\tt rewrite\_inst} wird ben\"otigt, um Gleichungen, Rechnungen zum Differenzieren etc. zu l\"osen. Dabei wird die gebundene Variable (bdv) instanziiert, d.h. es wird die Variable angegeben, nach der man differenzieren will, bzw. f\"ur die ein Wert bei einer Gleichung herauskommen soll. +Um zu sehen wie der Computer vorgeht nehmen wir folgendes Beispiel, dessen Ergebnis offenbar 0 ist, was der Computer jedoch erst nach einer Reihe von Schritten herausfindet. +Im Beispiel wird differenziert, wobei \isac's Schreibweise jene von Computer Algebra Systemen (CAS) anzugleichen: in CAS wird differenziert mit $\frac{d}{dx}\; x^2 + 3 \cdot x + 4$, in \isac{} mit {\tt d\_d x (x \^{ }\^{ }\^{ } 2 + 3 * x + 4)}. +Zuerst werden die einzelnen Werte als Variablen gespeichert: +{\footnotesize\begin{verbatim} + > val thy' = "Diff.thy"; + val thy' = "Diff.thy" : string + > val ro = "tless_true"; + val ro = "tless_true" : string + > val er = "eval_rls"; + val er = "eval_rls" : string + > val inst = [("bdv","x::real")]; + val inst = [("bdv", "x::real")] : (string * string) list + > val ct = "d_d x (a + a * (2 + b))"; + val ct = "d_d x (a + a * (2 + b))" : string +\end{verbatim}} +Nun wird die Rechnung nach den Regeln ausgerechnet, wobei am Ende mehrere Dinge zugleich gemacht werden. +Folgende Regeln werden ben\"otigt: Summenregel, Produktregel, Multiplikationsregel mit einem konstanten Faktor und zum Schluss die Additionsregel. +{\footnotesize\begin{verbatim} + > val Some (ct,_) = rewrite_inst thy' ro er true inst ("diff_sum","") ct; + val ct = "d_d x a + d_d x (a * (2 + b))" : cterm' + > val Some (ct,_) = rewrite_inst thy' ro er true inst ("diff_prod","") ct; + val ct = "d_d x a + (d_d x a * (2 + b) + a * d_d x (2 + b))" : cterm' + > val Some (ct,_) = rewrite_inst thy' ro er true inst ("diff_const","") ct; + val ct = "d_d x a + (d_d x a * (2 + b) + a * 0) " : cterm' + > val Some (ct,_) = rewrite_inst thy' ro er true inst ("diff_const","") ct; + val ct = "d_d x a + (0 * (2 + b) + a * 0)" : cterm' + > val Some (ct,_) = rewrite_inst thy' ro er true inst ("diff_const","") ct; + val ct = "0 + (0 * (2 + b) + a * 0)" : cterm' + > val Some (ct,_) = rewrite_set thy' true "make_polynomial" ct; + val ct = "0" : string +\end{verbatim}} +Was {\tt rewrite\_set} genau macht, finden Sie im n\"achsten Kapitel. + +Dies w\"are ein etwas ernsthafteres Beispiel zum Differenzieren: +{\footnotesize\begin{verbatim} + > val ct = "d_d x (x ^^^ 2 + 3 * x + 4)"; + > val Some (ct,_) = rewrite_inst thy' ro er true inst ("diff_sum","") ct; +\end{verbatim}} +\paragraph{Versuchen Sie es,} diese Beispiel zu Ende zu f\"uhren! Die Regeln, die \isac{} kennt und zum Umformen verwenden kann, finden Sie im Internet \footnote{{\tiny\tt http://www.ist.tugraz.at/projects/isac/www/kbase/thy/browser\_info/HOL/HOL-Real/Isac/Diff.html}}. + +\section{Welche W\"unsche kann man an Rewriting stellen?} +Es gibt verschiedene Varianten von Rewriting, die alle eine bestimmte Bedeutung haben. +{\tt rewrite\_ set} wandelt Terme in ein ganzes rule set um, die normalerweise nur mit einem Theorem vereinfacht dargestellt werden. +Hierbei werden auch folgende Argumente verwendet:\\ +\tabcolsep=4mm +\def\arraystretch{1.5} +\begin{tabular}{lp{11.0cm}} +{\tt theory} & Die Theory von Isabelle, die alle n\"otigen Informationen f\"ur das Parsing {\tt term} enth\"alt. \\ +{\tt rew\_ord}& die Ordnung f\"ur das geordnete Rewriting. F\"ur {\em no} ben\"otigt das geordnete Rewriting {\tt tless\_true}, eine Ordnung, die f\"ur alle nachgiebigen Argumente true ist \\ +{\tt rls} & Das rule set; zur Auswertung von bestimmten Bedingungen in {\tt thm} falls {\tt thm} eine conditional rule ist \\ +{\tt bool} & ein Bitschalter, der die Berechnungen der m\"oglichen condition in {\tt thm} ausl\"ost: wenn sie {\tt false} ist, dann wird die condition bewertet und auf Grund des Resultats wendet man {\tt thm} an, oder nicht; wenn {\tt true} dann wird die condition nicht ausgewertet, aber man gibt sie in eine Menge von Hypothesen \\ +{\tt thm} & das theorem versucht den {\tt term} zu \"uberschreiben \\ +{\tt term} & {\tt thm} wendet Rewriting m\"oglicherweise auf den Term an \\ +\end{tabular}\\ + +{\footnotesize\begin{verbatim} + > rewrite_set; + val it = fn : theory' -> bool -> rls' -> ... +\end{verbatim}} +{\footnotesize\begin{verbatim} + > rewrite_set_inst; + val it = fn : theory' -> bool -> subs' -> . +\end{verbatim}} +Wenn man sehen m\"ochte wie Rewriting bei den einzelnen theorems funktioniert kann man dies mit {\tt trace\_rewrite} versuchen. +{\footnotesize\begin{verbatim} + > trace_rewrite := true; + val it = () : unit +\end{verbatim}} + + +\section{Rule sets} +Einige der oben genannten Varianten von Rewriting beziehen sich nicht nur auf einen theorem, sondern auf einen ganzen Block von theorems, die man als rule set bezeichnet. +Dieser wird so lange angewendet, bis ein Element davon f\"ur Rewriting verwendet werden kann. Sollte der Begriff ''terminate`` fehlen, wird das Rule set nicht beendet und l\"auft weiter. +Ein Beispiel f\"ur einen rule set ist folgendes: +{\footnotesize\begin{verbatim} +??????????? +\end{verbatim}} + +{\footnotesize\begin{verbatim} + > sym; + val it = "?s = ?t ==> ?t = ?s" : Thm.thm + > rearrange_assoc; + val it = + Rls + {id = "rearrange_assoc", + scr = Script (Free ("empty_script", "RealDef.real")), + calc = [], + erls = + Rls + {id = "e_rls", + scr = EmptyScr, + calc = [], + erls = Erls, + srls = Erls, + rules = [], + rew_ord = ("dummy_ord", fn), + preconds = []}, + srls = + Rls + {id = "e_rls", + scr = EmptyScr, + calc = [], + erls = Erls, + srls = Erls, + rules = [], + rew_ord = ("dummy_ord", fn), + preconds = []}, + rules = + [Thm ("sym_radd_assoc", "?m1 + (?n1 + ?k1) = ?m1 + ?n1 + ?k1" [.]), + Thm + ("sym_rmult_assoc", + "?m1 * (?n1 * ?k1) = ?m1 * ?n1 * ?k1" [.])], + rew_ord = ("e_rew_ord", fn), + preconds = []} : rls +\end{verbatim}} + + +\section{Berechnung von Konstanten} +Sobald Konstanten in dem Bereich des Subterms sind, k\"onnen sie von einer Funktion berechnet werden: +{\footnotesize\begin{verbatim} + > calculate; + val it = fn + : + theory' -> + string * + ( + string -> + Term.term -> Theory.theory -> (string * Term.term) Library.option) -> + cterm' -> (string * thm') Library.option + + > calculate_; + val it = fn + : + Theory.theory -> + string * + ( + string -> + Term.term -> Theory.theory -> (string * Term.term) Library.option) -> + Term.term -> (Term.term * (string * Thm.thm)) Library.option +\end{verbatim}} +Man bekommt das Ergebnis und das theorem bezieht sich darauf. Daher sind die folgenden mathematischen Rechnungen m\"oglich: +{\footnotesize\begin{verbatim} + > calclist; + val it = + [("Vars", ("Tools.Vars", fn)), ("matches", ("Tools.matches", fn)), + ("lhs", ("Tools.lhs", fn)), ("plus", ("op +", fn)), + ("times", ("op *", fn)), ("divide_", ("HOL.divide", fn)), + ("power_", ("Atools.pow", fn)), ("is_const", ("Atools.is'_const", fn)), + ("le", ("op <", fn)), ("leq", ("op <=", fn)), + ("ident", ("Atools.ident", fn)), ("sqrt", ("Root.sqrt", fn)), + ("Test.is_root_free", ("is'_root'_free", fn)), + ("Test.contains_root", ("contains'_root", fn))] + : + ( + string * + ( + string * + ( + string -> + Term.term -> Theory.theory -> (string * Term.term) Library.option))) list +\end{verbatim}} + + + + +\chapter{Termordnung} +Die Anordnungen der Begriffe sind unverzichtbar f\"ur den Gebrauch des Umschreibens von normalen Funktionen und von normalen Formeln, die n\"otig sind um passende Modelle f\"ur Probleme zu finden. + +\section{Beispiel f\"ur Termordnungen} +Es ist nicht unbedeutend, eine Verbindung zu Termen herzustellen, die wirklich eine Ordnung besitzen. Diese Ordnungen sind selbstaufrufende Bahnordnungen: + +{\footnotesize\begin{verbatim} + > sqrt_right; + val it = fn : bool -> Theory.theory -> subst -> Term.term * Term.term -> b ool + > tless_true; + val it = fn : subst -> Term.term * Term.term -> bool +\end{verbatim}} + +Das ''bool`` Argument gibt Ihnen die M\"oglichkeit, die Kontrolle zu den zugeh\"origen Unterordunungen zur\"uck zu verfolgen, damit sich die Unterordnungen, die 'true' sind, als strings anzeigen lassen. + +{\section{Geordnetes Rewriting}} +Beim Rewriting entstehen Probleme, die vom ''law of commutativity`` (= Kommutativgesetz) durch '+' und '*' verursacht werden. Diese Probleme k\"onnen nur durch geordnetes Rewriting gel\"ost werden, da hier ein Term nur umgeschrieben wird, wenn ein kleinerer dadurch entsteht. + + +\chapter{Problem hierachy} +\section{''Matching``} +Matching ist eine Technik von Rewriting, die von \isac{} verwendet wird, um ein Problem und den passenden problem type daf\"ur zu finden. Die folgende Funktion \"uberpr\"uft, ob Matching m\"oglich ist: +{\footnotesize\begin{verbatim} +> matches; +val it = fn : Theory.theory -> Term.term -> Term.term -> bool +\end{verbatim}} +Die folgende Gleichung wird in Operatoren und freie Variablen zerlegt. +{\footnotesize\begin{verbatim} +> val t = (term_of o the o (parse thy)) "3 * x^^^2 = 1"; +val t = +Const ("op =", "[RealDef.real, RealDef.real] => bool") $ +(Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $ +Free ("3", "RealDef.real") $ +(Const +("Atools.pow", +"[RealDef.real, RealDef.real] => RealDef.real") $ +Free ("x", "RealDef.real") $ Free ("2", " RealDef.real"))) $ +Free ("1", "RealDef.real") : Term.term +\end{verbatim}} +Nun wird ein Modell erstellt, das sich nicht auf bestimmte Zahlen bezieht, sondern nur eine generelle Zerlegung durchf\"uhrt. +{\footnotesize\begin{verbatim} +> val p = (term_of o the o (parse thy)) "a * b^^^2 = c"; +val p = +Const ("op =", "[RealDef.real, RealDef.real] => bool") $ +(Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $ +Free ("a", "RealDef.real") $ +(Const +("Atools.pow", +"[RealDef.real, RealDef.real] => RealDef.real") $ +Free ("b", "RealDef.real") $ Free ("2", "RealDef.real"))) $ +Free ("c", "RealDef.real") : Term.term +\end{verbatim}} +Dieses Modell enth\"alt sogenannte \textit{scheme variables}. +{\footnotesize\begin{verbatim} +> atomt p; +"*** -------------" +"*** Const (op =)" +"*** . Const (op *)""*** . . Free (a, )" +"*** . . Const (Atools.pow)" +"*** . . . Free (b, )" +"*** . . . Free (2, )" +"*** . Free (c, )" +"\n" +val it = "\n" : string +\end{verbatim}} +Das Modell wird durch den Befehl \textit{free2var} erstellt. +{\footnotesize\begin{verbatim} +> free2var; +val it = fn : Term.term -> Term.term +> val pat = free2var p; +val pat = +Const ("op =", "[RealDef.real, RealDef.real] => bool") $ +(Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $ +Var (("a", 0), "RealDef.real") $ +(Const +("Atools.pow", +"[RealDef.real, RealDef.real] => RealDef.real") $ +Var (("b", 0), "RealDef.real") $ +Free ("2", "RealDef.real"))) $ Var (("c", 0), "RealDef.real") +: Term.term +> Sign.string_of_term (sign_of thy) pat; +val it = "?a * ?b ^^^ 2 = ?c" : string +\end{verbatim}} +Durch \textit{atomt pat} wird der Term aufgespalten und in eine Form gebracht, die f\"ur die weiteren Schritte ben\"otigt wird. +{\footnotesize\begin{verbatim} +> atomt pat; +"*** -------------" +"*** Const (op =)" +"*** . Const (op *)" +"*** . . Var ((a, 0), )" +"*** . . Const (Atools.pow)" +"*** . . . Var ((b, 0), )" +"*** . . . Free (2, )" +"*** . Var ((c, 0), )" +"\n" +val it = "\n" : string +\end{verbatim}} +Jetzt kann das Matching an den beiden vorigen Terme angewendet werden. +{\footnotesize\begin{verbatim} +> matches thy t pat; +val it = true : bool +> val t2 = (term_of o the o (parse thy)) "x^^^2 = 1"; +val t2 = +Const ("op =", "[RealDef.real, RealDef.real] => bool") $ +(Const +("Atools.pow", +"[RealDef.real, RealDef.real] => RealDef.real") $ +Free ("x", "RealDef.real") $ Free ("2", "RealDef.real")) $ +Free ("1", "RealDef.real") : Term.term +> matches thy t2 pat; +val it = false : bool +> val pat2 = (term_of o the o (parse thy)) "?u^^^2 = ?v"; +val pat2 = +Const ("op =", "[RealDef.real, RealDef.real] => bool") $ +(Const +("Atools.pow", +"[RealDef.real, RealDef.real] => RealDef.real") $ +Var (("u", 0), "RealDef.real") $ Free ("2", "RealDef.real")) $ +Var (("v", 0), "RealDef.real") : Term.term +> matches thy t2 pat2; +val it = true : bool +\end{verbatim}} + +\section{Zugriff auf die hierachy} +Man verwendet folgenden Befehl, um sich Zugang zur hierachy von problem type zu verschaffen. +{\footnotesize\begin{verbatim} +> show_ptyps; +val it = fn : unit -> unit +> show_ptyps(); +[ +["e_pblID"], +["simplification", "polynomial"], +["simplification", "rational"], +["vereinfachen", "polynom", "plus_minus"], +["vereinfachen", "polynom", "klammer"], +["vereinfachen", "polynom", "binom_klammer"], +["probe", "polynom"], +["probe", "bruch"], +["equation", "univariate", "linear"], +["equation", "univariate", "root", "sq", "rat"], +["equation", "univariate", "root", "normalize"], +["equation", "univariate", "rational"], +["equation", "univariate", "polynomial", "degree_0"], +["equation", "univariate", "polynomial", "degree_1"], +["equation", "univariate", "polynomial", "degree_2", "sq_only"], +["equation", "univariate", "polynomial", " + degree_2", "bdv_only"], +["equation", "univariate", "polynomial", "degree_2", "pqFormula"], +["equation", "univariate", "polynomial", "degree_2", "abcFormula"], +["equation", "univariate", "polynomial", "degree_3"], +["equation", "univariate", "polynomial", "degree_4"], +["equation", "univariate", "polynomial", "normalize"], +["equation", "univariate", "expanded", "degree_2"], +["equation", "makeFunctionTo"], +["function", "derivative_of", "named"], +["function", "maximum_of", "on_interval"], +["function", "make", "by_explicit"], +["function", "make", "by_new_variable"], +["function", "integrate", "named"], +["tool", "find_values"], +["system", "linear", "2x2", "triangular"], +["system", "linear", "2x2", "normalize"], +["system", "linear", "3x3"], +["system", "linear", "4x4", "triangular"], +["system", "linear", "4x4", "normalize"], +["Biegelinien", " +MomentBestimmte"], +["Biegelinien", "MomentGegebene"], +["Biegelinien", "einfache"], +["Biegelinien", "QuerkraftUndMomentBestimmte"], +["Biegelinien", "vonBelastungZu"], +["Biegelinien", "setzeRandbedingungen"], +["Berechnung", "numerischSymbolische"], +["test", "equation", "univariate", "linear"], +["test", "equation", "univariate", "plain_square"], +["test", "equation", "univariate", "polynomial", "degree_two", "pq_formula"], +["test", "equation", "univariate", "polynomial", "degree_two", "abc_formula"], +["test", "equation", "univariate", "squareroot"], +["test", "equation", "univariate", "normalize"], +["test", "equation", "univariate", "sqroot-test"] +] +val it = () : unit +\end{verbatim}} + +\section{Die passende ''formalization`` f\"ur den problem type} +Eine andere Art des Matching ist es die richtige ''formalization`` zum jeweiligen problem type zu finden. Wenn eine solche vorhanden ist, kann \isac{} selbstst\"andig die Probleme l\"osen. + +\section{''problem-refinement``} +Will man die problem hierachy (= ) aufstellen, so ist darauf zu achten, dass man die verschiedenen Branches so konstruiert, dass das problem-refinement automatisch durchgef\"uhrt werden kann. +{\footnotesize\begin{verbatim} +> refine; +val it = fn : fmz_ -> pblID -> SpecifyTools.match list +> val fmz = ["equality (sqrt(9 + 4 * x)=sqrt x ++ sqrt (5 + x))", +# "soleFor x","errorBound (eps=0)", +# "solutions L"]; +val fmz = +["equality (sqrt(9 + 4 * x)=sqrt x + sqrt (5 + x))", "soleFor x", +"errorBound (eps=0)", ...] : string list +> refine fmz ["univariate","equation"]; +*** pass ["equation","univariate"] +*** comp_dts: ??.empty $ soleFor x +Exception- ERROR raised +\end{verbatim}} +Wenn die ersten zwei Regeln nicht angewendet werden k\"onnen, kommt die dritte zum Einsatz: +{\footnotesize\begin{verbatim} +> val fmz = ["equality (x + 1 = 2)", +# "solveFor x","errorBound (eps=0)", +# "solutions L"]; +val fmz = ["equality (x + 1 = 2)", "solveFor x", "errorBound (eps=0)", ...] +: string list +> refine fmz ["univariate","equation"]; +*** pass ["equation","univariate"] +*** pass ["equation","univariate","linear"] +*** pass ["equation","univariate","root"] +*** pass ["equation","univariate","rational"] +*** pass ["equation","univariate","polynomial" ] +*** pass ["equation","univariate","polynomial","degree_0"] +*** pass ["equation","univariate","polynomial","degree_1"] +*** pass ["equation","univariate","polynomial","degree_2"] +*** pass ["equation","univariate","polynomial","degree_3"] +*** pass ["equation","univariate","polynomial","degree_4"] +*** pass ["equation","univariate","polynomial","normalize"] +val it = +[Matches +(["univariate", "equation"], +{Find = [Correct "solutions L"], With = [...], ...}), +NoMatch (["linear", "univariate", ...], {Find = [...], ...}), +NoMatch (["root", ...], ...), ...] : SpecifyTools.match list +\end{verbatim}} +Der problem type wandelt $x + 1 = 2$ in die normale Form $-1 + x = 0$ um. Diese Suche nach der jeweiligen problem hierachy kann mit Hilfe eines ''proof state`` durchgef\"uhrt werden (siehe n\"achstes Kapitel). + + +\chapter{''Methods``} +Methods werden dazu verwendet, Probleme von type zu l\"osen. Sie sind in einer anderen Programmiersprache beschrieben. Die Sprache sieht einfach aus, betreibt aber im Hintergrund einen enormen Pr\"ufaufwand. So muss sich der Programmierer nicht mit technischen Details befassen, gleichzeitig k\"onnen aber auch keine falschen Anweisungen eingegeben werden. +\section{Der ''Syntax`` des script} +Syntax beschreibt den Zusammenhang der einzelnen Zeichen und Zeichenfolgen mit den Theorien. +Er kann so definiert werden: +\begin{tabbing} +123\=123\=expr ::=\=$|\;\;$\=\kill +\>script ::= {\tt Script} id arg$\,^*$ = body\\ +\>\>arg ::= id $\;|\;\;($ ( id :: type ) $)$\\ +\>\>body ::= expr\\ +\>\>expr ::= \>\>{\tt let} id = expr $($ ; id = expr$)^*$ {\tt in} expr\\ +\>\>\>$|\;$\>{\tt if} prop {\tt then} expr {\tt else} expr\\ +\>\>\>$|\;$\>listexpr\\ +\>\>\>$|\;$\>id\\ +\>\>\>$|\;$\>seqex id\\ +\>\>seqex ::= \>\>{\tt While} prop {\tt Do} seqex\\ +\>\>\>$|\;$\>{\tt Repeat} seqex\\ +\>\>\>$|\;$\>{\tt Try} seqex\\ +\>\>\>$|\;$\>seqex {\tt Or} seqex\\ +\>\>\>$|\;$\>seqex {\tt @@} seqex\\ +\>\>\>$|\;$\>tac $($ id $|$ listexpr $)^*$\\ +\>\>type ::= id\\ +\>\>tac ::= id +\end{tabbing} + +\section{\"Uberpr\"ufung der Auswertung} +Das Kontrollsystem arbeitet mit den folgenden Script-Ausdr\"ucken, die {\it tacticals} genannt werden: +\begin{description} +\item{{\tt while} prop {\tt Do} expr id} +\item{{\tt if} prop {\tt then} expr {\tt else} expr} +\end{description} +W\"ahrend die genannten Befehle das Kontrollsystem durch Auswertung der Formeln ausl\"osen, h\"angen die anderen von der Anwendbarkeit der Formel in den entsprechenden Unterbegriffen ab: +\begin{description} +\item{{\tt Repeat} expr id} +\item{{\tt Try} expr id} +\item{expr {\tt Or} expr id} +\item{expr {\tt @@} expr id} +\item xxx +\end{description} + + + +\chapter{Befehle von \isac{}} +In diesem Kapitel werden alle schon zur Verf\"ugung stehenden Schritte aufgelistet. Diese Liste kann sich auf Grund von weiteren Entwicklungen von \isac{} noch \"andern.\ +\newline\linebreak \textbf{Init\_Proof\_Hid (dialogmode, formalization, specifictaion)} gibt die eingegebenen Befehle an die mathematic engine weiter, wobei die beiden letzten Begriffe die Beispiele automatisch speichern. Es ist nicht vorgesehen, dass der Sch\"uler tactic verwendet.\ +\newline\linebreak \textbf{Init\_Proof} bildet mit einem ''proof tree`` ein leeres Modell.\ +\newline\linebreak \textbf{Model\_Problem problem} bestimmt ein problemtype, das wom\"oglich in der ''hierachy`` gefunden wurde, und verwendet es f\"ur das Umformen.\ +\newline\linebreak \textbf{Add\_Given, Add\_Find, Add\_Relation formula} f\"ugt eine Formel in ein bestimmtes Feld eines Modells ein. Dies ist notwendig, solange noch kein Objekt f\"ur den Benutzer vorhanden ist, in dem man die Formel eingeben kann, und nicht die gew\"unschte tactic und Formel von einer Liste w\"ahlen will.\ +\newline\linebreak \textbf{Specify\_Theorie theory, Specify\_Problem proble, Specify\_Method method} gibt das entsprechende Element des Basiswissens an.\ +\newline\linebreak \textbf{Refine\_Problem problem} sucht nach einem Problem in der hierachy, das auf das vorhandene zutrifft.\ +\newline\linebreak \textbf{Apply\_Method method} beendet das Modell und die Beschreibung. Danach wird die L\"osungmeldung ge\"offnet.\ +\newline\linebreak \textbf{Free\_Solve} beginnt eine L\"osungsmeldung ohne die Hilfe einer method.\ +\newline\linebreak \textbf{Rewrite theorem} bef\"ordert ein theorem in die aktuelle Formel und wandelt es demenetsprechend um. Wenn dies nicht m\"oglich ist, kommt eine Meldung mit ''error``.\ +\newline\linebreak \textbf{Rewrite\_Asm theorem} hat die gleiche Funktion wie Rewrite, speichert jedoch eine endg\"ultige Vorraussetzung des theorems, anstatt diese zu sch\"atzen.\ +\newline\linebreak \textbf{Rewrite\_Set ruleset} hat \"ahnliche Funktionen wie Rewrite, gilt aber f\"ur einen ganzen Satz von theorems, dem rule set.\ +\newline\linebreak \textbf{Rewrite\_Inst (substitution, theorem), Rewrite\_Set\_Inst (substitution, rule set)} ist vergleichbar mit besonderen tactics, ersetzt aber Konstanten im theorem, bevor es zu einer Anwendung kommt.\ +\newline\linebreak \textbf{Calculate operation} berechnet das Ergebnis der Eingabe mit der aktuellen Formel (plus, minus, times, cancel, pow, sqrt).\ +\newline\linebreak \textbf{Substitute substitution} f\"ugt der momentanen Formel {\tt substitution} hinzu und wandelt es um.\ +\newline\linebreak \textbf{Take formula} startet eine neue Reihe von Rechnungen in den Formeln, wo sich schon eine andere Rechnung befindet.\ +\newline\linebreak \textbf{Subproblem (theory, problem)} beginnt ein subproblem innerhalb einer Rechnung.\ +\newline\linebreak \textbf{Function formula} ruft eine Funktion auf, in der der Name in der Formel enthalten ist. ???????\ +\newline\linebreak \textbf{Split\_And, Conclude\_And, Split\_Or, Conclude\_Or, Begin\_Trans, End\_Trans, Begin\_Sequ, End\_Sequ, Split\_Intersect, End\_Intersect} betreffen den Bau einzelner branches des proof trees. Normalerweise werden sie vom dialog guide verdr\"angt.\ +\newline\linebreak \textbf{Check\_elementwise assumption} wird in Bezug auf die aktuelle Formel verwendet, die Elemente in einer Liste enth\"alt.\ +\newline\linebreak \textbf{Or\_to\_List} wandelt eine Verbindung von Gleichungen in eine Liste von Gleichungen um.\ +\newline\linebreak \textbf{Check\_postcond} \"uberpr\"uft die momentane Formel im Bezug auf die Nachbedinung beim Beenden des subproblem.\ +\newline\linebreak \textbf{End\_Proof} beendet eine \"Uberpr\"ufung und gibt erst dann ein Ergebnis aus, wenn Check\_postcond erfolgreich abgeschlossen wurde. + +\section{Die Funktionsweise der mathematic engine} +Ein proof (= Beweis) wird in der mathematic engine me von der tactic {\tt Init\_Proof} gestartet und wird wechselwirkend mit anderen tactics vorangebracht. Auf den input (= das, was eingegeben wurde) einzelner tactics folgt eine Formel, die von der me ausgegeben wird, und die darauf folgende tactic gilt. Der proof ist beendet, sobald die me {\tt End\_Proof} als n\"achste tactic vorschl\"agt. +\newline Im Anschluss werden Sie einen Rechenbeweis sehen, der von der L\"osung einer Gleichung (= equation) handelt, bei der diese automatisch differenziert wird. +{\footnotesize\begin{verbatim} +?????????????????????????????????????????????????????????????????????????????????? + +ML> val fmz = ["equality ((x+#1)*(x+#2)=x^^^#2+#8)","solveFor x", + "errorBound (eps=#0)","solutions L"]; + val fmz = + ["equality ((x+#1)*(x+#2)=x^^^#2+#8)","solveFor x","errorBound (eps=#0)", + "solutions L"] : string list + ML> + ML> val spec as (dom, pbt, met) = ("SqRoot.thy",["univariate","equation"], + ("SqRoot.thy","no_met")); + val dom = "SqRoot.thy" : string + val pbt = ["univariate","equation"] : string list + val met = ("SqRoot.thy","no_met") : string * string +\end{verbatim}} + +\section{Der Beginn einer Rechnung} + +Der proof state wird von einem proof tree und einer position ausgegeben. Beide sind zu Beginn leer. Die tactic {\tt Init\_Proof} ist, wie alle anderen tactics auch, an einen string gekoppelt. Um einen neuen proof beginnen zu k\"onnen, werden folgende Schritte durchgef\"uhrt: +{\footnotesize\begin{verbatim} +???????????????????????????????????????????????????????????????????????????????????????????? +ML> val (mID,m) = ("Init_Proof",Init_Proof (fmz, (dom,pbt,met))); + val mID = "Init_Proof" : string + val m = + Init_Proof + (["equality ((x+#1)*(x+#2)=x^^^#2+#8)","solveFor x","errorBound (eps=#0)", + "solutions L"],("SqRoot.thy",[#,#],(#,#))) : mstep + ML> + ML> val (p,_,f,nxt,_,pt) = me (mID,m) e_pos' c EmptyPtree; + val p = ([],Pbl) : pos' + val f = Form' (PpcKF (0,EdUndef,0,Nundef,(#,#))) : mout + val nxt = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"]) + : string * mstep + val pt = + Nd + (PblObj + {branch=#,cell=#,env=#,loc=#,meth=#,model=#,origin=#,ostate=#,probl=#, + result=#,spec=#},[]) : ptree +\end{verbatim}} +Die mathematics engine gibt etwas mit dem type {\tt mout} aus, was in unserem Fall ein Problem darstellt. Sobald mehr angezeigt wird, m\"usste dieses jedoch gel\"ost sein. +{\footnotesize\begin{verbatim} +????????????????????????????????????????????????????????????????????????????????????????????? + ML> Compiler.Control.Print.printDepth:=8; (*4 default*) + val it = () : unit + ML> + ML> f; + val it = + Form' + (PpcKF + (0,EdUndef,0,Nundef, + (Problem [], + {Find=[Incompl "solutions []"], + Given=[Incompl "equality",Incompl "solveFor"],Relate=[], + Where=[False "matches (?a = ?b) e_"],With=[]}))) : mout +\end{verbatim}} +{\footnotesize\begin{verbatim} +????????????????????????????????????????????????????????????????????????????????????????????? + ML> nxt; + val it = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"]) + : string * mstep + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val nxt = ("Model_Problem",Model_Problem ["normalize","univariate","equation"]) + : string * mstep + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; +\end{verbatim}} + +\section{The phase of modeling} +Dieses Kapitel besch\"aftigt sich mit dem input der Einzelheiten bei einem Problem. Die me kann dabei helfen, wenn man die formalization durch {\tt Init\_Proof} darauf hinweist. Normalerweise weiss die mathematics engine die n\"achste gute tactic. +{\footnotesize\begin{verbatim} +????????????????????????????????????????????????????????????????????????????????????????????? + ML> nxt; + val it = + ("Add_Given",Add_Given "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)") + : string * mstep + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val nxt = ("Add_Given",Add_Given "solveFor x") : string * mstep + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val nxt = ("Add_Find",Add_Find "solutions L") : string * mstep + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val f = Form' (PpcKF (0,EdUndef,0,Nundef,(#,#))) : mout +\end{verbatim}} +{\footnotesize\begin{verbatim} +????????????????????????????????????????????????????????????????????????????????????????????? + ML> Compiler.Control.Print.printDepth:=8; + ML> f; + val it = + Form' + (PpcKF + (0,EdUndef,0,Nundef, + (Problem [], + {Find=[Correct "solutions L"], + Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", + Correct "solveFor x"],Relate=[],Where=[],With=[]}))) : mout +\end{verbatim}} + + +\section{The phase of specification} +Diese phase liefert eindeutige Bestimmungen einer domain, den problem type und die method damit man sie verwenden kann. F\"ur gew\"ohnlich wird die Suche nach dem richtigen problem type unterst\"utzt. Dazu sind zwei tactics verwendbar: {\tt Specify\_Problem} entwickelt ein Feedback, wie ein problem type bei dem jetzigen problem zusammenpasst und {\tt Refine\_Problem} stellt Hilfe durch das System bereit, falls der Benutzer die \"Ubersicht verliert. +{\footnotesize\begin{verbatim} +?????????????????????????????????????????????????????????????????????????????????????????? + ML> nxt; + val it = ("Specify_Domain",Specify_Domain "SqRoot.thy") : string * mstep + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val nxt = + ("Specify_Problem",Specify_Problem ["normalize","univariate","equation"]) + : string * mstep + val pt = + Nd + (PblObj + {branch=#,cell=#,env=#,loc=#,meth=#,model=#,origin=#,ostate=#,probl=#, + result=#,spec=#},[]) : ptree +\end{verbatim}} +Die me erkennt den richtigen Problem type und arbeitet so weiter: +{\footnotesize\begin{verbatim} +????????????????????????????????????????????????????????????????????????????????????????? + ML> val nxt = ("Specify_Problem", + Specify_Problem ["polynomial","univariate","equation"]); + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val f = Form' (PpcKF (0,EdUndef,0,Nundef,(#,#))) : mout + val nxt = + ("Refine_Problem",Refine_Problem ["normalize","univariate","equation"]) + : string * mstep + ML> + ML> val nxt = ("Specify_Problem", + Specify_Problem ["linear","univariate","equation"]); + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val f = + Form' + (PpcKF + (0,EdUndef,0,Nundef, + (Problem ["linear","univariate","equation"], + {Find=[Correct "solutions L"], + Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", + Correct "solveFor x"],Relate=[], + Where=[False + "matches (?a + ?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)"], + With=[]}))) : mout +\end{verbatim}} +Wir nehmen wieder an, dass der dialog guide die n\"achsten tactics, veranlasst von der mathematic engine, versteckt und der Sch\"uler Hilfe ben\"otigt. Dann muss {\tt Refine\_Problem} angewandt werden. Dieser Befehl findet immer den richtigen Weg, wenn man es auf den problem type bezieht [''univariate``, ''equation``]. +{\footnotesize\begin{verbatim} +???????????????????????????????????????????????????????????????????????????????????????????? + ML> val nxt = ("Refine_Problem", + Refine_Problem ["linear","univariate","equation + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val f = Problems (RefinedKF [NoMatch #]) : mout + ML> + ML> Compiler.Control.Print.printDepth:=9;f;Compiler.Control.Print.printDepth:=4; + val f = + Problems + (RefinedKF + [NoMatch + (["linear","univariate","equation"], + {Find=[Correct "solutions L"], + Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", + Correct "solveFor x"],Relate=[], + Where=[False + "matches (?a + ?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)"], + With=[]})]) : mout + ML> + ML> val nxt = ("Refine_Problem",Refine_Problem ["univariate","equation"]); + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val f = + Problems + (RefinedKF [Matches #,NoMatch #,NoMatch #,NoMatch #,NoMatch #,Matches #]) + : mout + ML> + ML> + ML> Compiler.Control.Print.printDepth:=9;f;Compiler.Control.Print.printDepth:=4; + val f = + Problems + (RefinedKF + [Matches + (["univariate","equation"], + {Find=[Correct "solutions L"], + Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", + Correct "solveFor x"],Relate=[], + Where=[Correct + With=[]}), + NoMatch + (["linear","univariate","equation"], + {Find=[Correct "solutions L"], + Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", + Correct "solveFor x"],Relate=[], + Where=[False + "matches (?a + ?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)"], + With=[]}), + NoMatch + ... + ... + Matches + (["normalize","univariate","equation"], + {Find=[Correct "solutions L"], + Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", + Correct "solveFor x"],Relate=[],Where=[],With=[]})]) : mout +\end{verbatim}} +Die tactic {\tt Refine\_Problem} wandelt alle matches wieder in problem types um und sucht in der problem hierachy weiter. + + +\section{The phase of solving} +Diese phase beginnt mit dem Aufruf einer method, die eine normale form innerhalb einer tactic ausf\"uhrt: {\tt Rewrite rnorm\_equation\_add} und {\tt Rewrite\_Set SqRoot\_simplify}: +{\footnotesize\begin{verbatim} + ML> nxt; + val it = ("Apply_Method",Apply_Method ("SqRoot.thy","norm_univar_equation")) + : string * mstep + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val f = + Form' (FormKF (~1,EdUndef,1,Nundef,"(x + #1) * (x + #2) = x ^^^ #2 + #8")) + val nxt = + ("Rewrite", Rewrite + ("rnorm_equation_add","~ ?b =!= #0 ==> (?a = ?b) = (?a + #-1 * ?b = #0)")) + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val f = + Form' (FormKF (~1,EdUndef,1,Nundef, + "(x + #1) * (x + #2) + #-1 * (x ^^^ #2 + #8) = #0")) : mout + val nxt = ("Rewrite_Set",Rewrite_Set "SqRoot_simplify") : string * mstep + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val f = Form' (FormKF (~1,EdUndef,1,Nundef,"#-6 + #3 * x = #0")) : mout + val nxt = ("Subproblem",Subproblem ("SqRoot.thy",[#,#])) : string * mstep +\end{verbatim}} +Die Formel $-6 + 3\cdot x = 0$ ist die Eingabe eine subproblems, das wiederum gebraucht wird, um die Gleichungsart zu erkennen und die entsprechende method auszuf\"uhren: +{\footnotesize\begin{verbatim} + ML> nxt; + val it = ("Subproblem",Subproblem ("SqRoot.thy",["univariate","equation"])) + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val f = + Form' (FormKF + (~1,EdUndef,1,Nundef,"Subproblem (SqRoot.thy, [univariate, equation])")) + : mout + val nxt = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"]) + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val nxt = ("Model_Problem",Model_Problem ["linear","univariate","equation"]) +\end{verbatim}} +{\tt Refine [''univariate``, ''equation``]} sucht die passende Gleichungsart aus der problem hierachy heraus, welche man mit {\tt Model\_Problem [''linear``, ''univariate``, ''equation``]} \"uber das System ansehen kann. +Nun folgt erneut die phase of modeling und die phase of specification. + +\section{The final phase: \"Uberpr\"ufung der ''post-condition``} +Die gezeigten problems, die durch \isac{} gel\"ost wurden, sind so genannte 'example construction problems'. Das massivste Merkmal solcher problems ist die post-condition. Im Umgang mit dieser gibt es noch offene Fragen. +Dadurch wird die post-condition im folgenden Beispiel als problem und subproblem erw\"ahnt. +{\footnotesize\begin{verbatim} + ML> nxt; + val it = ("Check_Postcond",Check_Postcond ["linear","univariate","equation"]) + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val f = Form' (FormKF (~1,EdUndef,1,Nundef,"[x = #2]")) : mout + val nxt = + ("Check_Postcond",Check_Postcond ["normalize","univariate","equation"]) + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val f = Form' (FormKF (~1,EdUndef,0,Nundef,"[x = #2]")) : mout + val nxt = ("End_Proof'",End_Proof') : string * mstep +\end{verbatim}} +Die tactic {\tt End\_Proof'} bedeutet, dass der proof erflogreich beendet wurde.\\ + +\paragraph{Versuchen Sie es!} Die tactics, die vom System vorgeschlagen werden, m\"ussen vom Benutzer nicht angewendet werden. Er kann selbstverst\"andlich auch andere tactics verwenden und das System wird melden, ob dieser Befehl zutreffend ist oder nicht. + + +\part{Handbuch f\"ur Autoren} + +\chapter{Die Struktur des Grundlagenwissens} + +\section{''tactics`` und Daten} +Zuerst betrachten wir die me von aussen. Wir sehen uns tactics und an und verbinden sie mit unserem Grundwissen (KB). Im Bezug auf das KB befassen wir uns mit den kleinsten Teilchen, die von den Autoren des KB sehr genau durchgef\"uhrt werden m\"ussen. +Diese Teile sind in alphabetischer Anordnung in Tab.\ref{kb-items} auf Seite \pageref{kb-items} aufgelistet. + +{\begin{table}[h] +\caption{Kleinste Teilchen des KB} \label{kb-items} +%\tabcolsep=0.3mm +\begin{center} +\def\arraystretch{1.0} +\begin{tabular}{lp{9.0cm}} +Abk\"urzung & Beschreibung \\ +\hline +&\\ +{\it calc\_list} +& gesammelte Liste von allen ausgewerteten Funktionen\\ +{\it eval\_fn} +& ausgewertete Funktionen f\"ur Zahlen und f\"ur Eigenschaften, die in SML kodiert sind\\ +{\it eval\_rls } +& rule set {\it rls} f\"ur einfache Ausdr\"ucke mit {\it eval\_fn}s\\ +{\it fmz} +& Formalisierung, d.h. eine sehr geringe Darstellung von einem Beispiel \\ +{\it met} +& eine method d.h. eine Datenstruktur, die alle Informationen zum L\"osen einer phase enth\"alt ({\it rew\_ord}, {\it scr}, etc.)\\ +{\it metID} +& bezieht sich auf {\it met}\\ +{\it op} +& ein Operator, der der Schl\"ussel zu {\it eval\_fn} in einer {\it calc\_list} ist \\ +{\it pbl} +& Problem d.h. der Knotenpunkt in der problem hierachy\\ +{\it pblID} +& bezieht sich auf {\it pbl}\\ +{\it rew\_ord} +& Anordnung beim Rewriting\\ +{\it rls} +& rule set, d.h. eine Datenstruktur, die theorems {\it thm} und Operatoren {\it op} zur Vereinfachung (mit {\it rew\_ord}) enth\"alt \\ +{\it Rrls} +& rule set f\"ur das 'reverse rewriting' (eine \isac-Technik, die schrittweise Rewriting entwickelt, z.B. f\"ur die zur\"uckgenommenen Teile)\\ +{\it scr} +& script, das die Algorithmen durch Anwenden von tactics beschreibt und ein Teil von {\it met} ist \\ +{\it norm\_rls} +& spezielles Regelwerk zum Berechnen von Normalformen, im Zusammenhang mit {\it thy}\\ +{\it spec} +& Spezifikation, z.B, ein Tripel ({\it thyID, pblID, metID})\\ +{\it subs} +& Ersatz, z.B. eine Liste von Variablen und ihren jeweiligen Werten\\ +{\it Term} +& Term von Isabelle, z.B. eine Formel\\ +{\it thm} +& theorem\\ +{\it thy} +& theory\\ +{\it thyID} +& im Bezug auf {\it thy} \\ +\end{tabular}\end{center}\end{table}} + +Die Verbindung zwischen tactics und Daten werden in Tab.\ref{tac-kb} auf Seite \pageref{tac-kb} dargestellt. + + +\begin{table}[h] +\caption{Welche tactics verwenden die Teile des KB~?} \label{tac-kb} +\tabcolsep=0.3mm +\begin{center} +\begin{tabular}{|ll||cccc|ccc|cccc|} \hline +tactic &Eingabe & & & &norm\_& &rew\_&rls &eval\_&eval\_&calc\_& \\ +& &thy &scr &Rrls&rls &thm &ord &Rrls&fn &rls &list &dsc\\ +\hline\hline +Init\_Proof +&fmz & x & & & x & & & & & & & x \\ +&spec & & & & & & & & & & & \\ +\hline +\multicolumn{13}{|l|}{model phase}\\ +\hline +Add\_* +&Term & x & & & x & & & & & & & x \\ +FormFK &model & x & & & x & & & & & & & x \\ +\hline +\multicolumn{13}{|l|}{specify phase}\\ +\hline +Specify\_Theory +&thyID & x & & & x & & & & x & x & & x \\ +Specify\_Problem +&pblID & x & & & x & & & & x & x & & x \\ +Refine\_Problem +&pblID & x & & & x & & & & x & x & & x \\ +Specify\_Method +&metID & x & & & x & & & & x & x & & x \\ +Apply\_Method +&metID & x & x & & x & & & & x & x & & x \\ +\hline +\multicolumn{13}{|l|}{solve phase}\\ +\hline +Rewrite,\_Inst +&thm & x & x & & & x &met & & x &met & & \\ +Rewrite, Detail +&thm & x & x & & & x &rls & & x &rls & & \\ +Rewrite, Detail +&thm & x & x & & & x &Rrls & & x &Rrls & & \\ +Rewrite\_Set,\_Inst +&rls & x & x & & & & & x & x & x & & \\ +Calculate +&op & x & x & & & & & & & & x & \\ +Substitute +&subs & x & & & x & & & & & & & \\ +& & & & & & & & & & & & \\ +SubProblem +&spec & x & x & & x & & & & x & x & & x \\ +&fmz & & & & & & & & & & & \\ +\hline +\end{tabular}\end{center}\end{table} + + +\section{Die theories von \isac{}} +Die theories von \isac{} basieren auf den theories f\"ur HOL und Real von Isabelle. Diese theories haben eine spezielle Form, die durch die Endung {\tt *.thy} gekennzeichnet sind; normalerweise werden diese theories zusammen mit SML verwendet. Dann haben sie den selben Dateinamen, aber die Endung {\tt *.ML}. +Die theories von \isac{} representieren den Teil vom Basiswissen von \isac{}, die hierachy von den zwei theories ist nach diesen strukturiert. Die {\tt *.ML} Dateien beinhalten {\em alle} Daten von den anderen zwei Hauptlinien des Basiswissens, die problems und methods (ohne ihre jeweilige Struktur, die von den problem Browsern und den method Browsern gemacht wird, zu pr\"asentieren. +Die Tab.\ref{theories} auf Seite \pageref{theories} listet die base theories auf, die geplant sind in der Version \isac{} 1 angewendet zu werden. Wir erwarten, dass die Liste erweitert wird in n\"aherer Zukunft, und wir werden uns auch den theorie Browser genauer ansehen. +Die ersten drei theories auf der Liste geh\"oren {\em nicht} zum Grundwissen von \isac{}; sie besch\"aftigen sich mit der Skriptsprache f\"ur methods und ist hier nur zur Vollst\"andigkeit angef\"uhrt. + +{\begin{table}[h] +\caption{theory von der ersten Version von \isac} \label{theories} +%\tabcolsep=0.3mm +\begin{center} +\def\arraystretch{1.0} +\begin{tabular}{lp{9.0cm}} +theory & Beschreibung \\ +\hline +&\\ +ListI.thy +& ordnet die Bezeichnungen den Funktionen, die in {\tt Isabelle2002/src/HOL/List.thy} sind, zu und (intermediatly~?) definiert einige weitere Listen von Funktionen\\ +ListI.ML +& {\tt eval\_fn} f\"ur die zus\"atzliche Listen von Funktionen\\ +Tools.thy +& Funktion, die f\"ur die Auswertung von Skripten ben\"otigt wird\\ +Tools.ML +& bezieht sich auf {\tt eval\_fn}s\\ +Script.thy +& Vorraussetzung f\"ur script: types, tactics, tacticals\\ +Script.ML +& eine Reihe von tactics und Funktionen f\"ur den internen Gebrauch\\ +& \\ +\hline +& \\ +Typefix.thy +& fortgeschrittener Austritt, um den type Fehlern zu entkommen\\ +Descript.thy +& {\it Beschreibungen} f\"ur die Formeln von {\it Modellen} und {\it Problemen}\\ +Atools +& Neudefinierung von Operatoren; allgemeine Eigenschaften und Funktionen f\"ur Vorraussetzungen; theorems f\"ur {\tt eval\_rls}\\ +Float +& Gleitkommerzahlendarstellung\\ +Equation +& grunds\"atzliche Vorstellung f\"ur Gleichungen und Gleichungssysteme\\ +Poly +& Polynome\\ +PolyEq +& polynomiale Gleichungen und Gleichungssysteme \\ +Rational.thy +& zus\"atzliche theorems f\"ur Rationale Zahlen\\ +Rational.ML +& abbrechen, hinzuf\"ugen und vereinfachen von Rationalen Zahlen durch Verwenden von (einer allgemeineren Form von) Euclids Algorithmus; die entsprechenden umgekehrten Regels\"atze\\ +RatEq +& Gleichung mit rationalen Zahlen\\ +Root +& Radikanten; berechnen der Normalform; das betreffende umgekehrte Regelwerk\\ +RootEq +& Gleichungen mit Wurzeln\\ +RatRootEq +& Gleichungen mit rationalen Zahlen und Wurzeln (z.B. mit Termen, die beide Vorg\"ange enthalten)\\ +Vect +& Vektoren Analysis\\ +Trig +& Trigonometrie\\ +LogExp +& Logarithmus und Exponentialfunktionen\\ +Calculus +& nicht der Norm entsprechende Analysis\\ +Diff +& Differenzierung\\ +DiffApp +& Anwendungen beim Differenzieren (Maximum-Minimum-Probleme)\\ +Test +& (alte) Daten f\"ur Testfolgen\\ +Isac +& enth\"alt alle Theorien von\isac{}\\ +\end{tabular}\end{center}\end{table}} + + +\section{Daten in {\tt *.thy} und {\tt *.ML}} +Wie schon zuvor angesprochen, haben die Arbeiten die theories von *.thy und *.ML zusammen und haben deswegen den selben Dateiname. Wie diese Daten zwischen den zwei Dateien verteilt werden wird in der +Tab.\ref{thy-ML} auf Seite \pageref{thy-ML} gezeigt. Die Ordnung von den Datenteilchen in den theories sollte an der Ordnung von der Liste festhalten. + +{\begin{table}[h] +\caption{Daten in {\tt *.thy}- und {\tt *.ML}-files} \label{thy-ML} +\tabcolsep=2.0mm +\begin{center} +\def\arraystretch{1.0} +\begin{tabular}{llp{7.7cm}} +Datei & Daten & Beschreibung \\ +\hline +& &\\ +{\tt *.thy} +& consts +& Operatoren, Eigenschaften, Funktionen und Skriptnamen ('{\tt Skript} Name \dots{\tt Argumente}') +\\ +& rules +& theorems: \isac{} verwendet theorems von Isabelle, wenn m\"oglich; zus\"atzliche theorems, die jenen von Isabelle entsprechen, bekommen ein {\it I} angeh\"angt +\\& &\\ +{\tt *.ML} +& {\tt theory' :=} +& Die theory, die +abgegrenzt ist von der {\tt *.thy}-Datei, wird durch \isac{} zug\"anglich gemacht +\\ +& {\tt eval\_fn} +& die Auswertungsfunktion f\"ur die Operatoren und Eigenschaften, kodiert im meta-Level (SML); die Bezeichnugn von so einer Funktion ist eine Kombination von Schl\"usselw\"ortern {\tt eval\_} und einer Bezeichnung von der Funktion, die in in {\tt *.thy} erkl\"art ist +\\ +& {\tt *\_simplify} +& der automatisierte Vereinfacher f\"ur die tats\"achliche Theorie, z.B. die Bezeichnung von diesem Regelwerk ist eine Kombination aus den Theorienbezeichnungen und dem Schl\"usselwort {\tt *\_simplify} +\\ +& {\tt norm\_rls :=} +& der automatisierte Vereinfacher {\tt *\_simplify} wird so aufgehoben, dass er \"uber \isac{} zug\"anglich ist +\\ +& {\tt rew\_ord' :=} +& das Gleiche f\"ur die Anordnung des Rewriting, wenn es ausserhalb eines speziellen Regelwerks gebraucht wird +\\ +& {\tt ruleset' :=} +& dasselbe wie f\"ur Regels\"atze (gew\"ohnliche Regels\"atze, umgekehrte Regels\"atze, und {\tt eval\_rls}) +\\ +& {\tt calc\_list :=} +& dasselbe f\"ur {\tt eval\_fn}s, wenn es ausserhalb eines bestimmten Regelwerks gebraucht wird (wenn es ausserhalb eines bestimmten Regelwerks ben\"otigt wird) (z.B. f\"ur eine tactic {\tt Calculate} in einem Skript) +\\ +& {\tt store\_pbl} +& Problems, die in {\tt *.ML}-Dateien definiert sind, werden zug\"anglich f\"ur \isac{} +\\ +& {\tt methods :=} +& methods, die in {\tt *.ML}-Dateien definiert sind werden zug\"anglich f\"ur \isac{} +\\ +\end{tabular}\end{center}\end{table}} + +\section{Formale Beschreibung der Hierarchie von Problemen} + +\section{Skripttaktiken} +Tats\"achlich sind es die tactics, die die Berechnungen vorantreiben: im Hintergrund bauen sie den proof tree und sie \"ubernehmen die wichtigsten Aufgaben w\"ahrend der Auswertung bei der der ''script-interpreter`` zur Steuerung des Benutzers transferiert wird. Hier beschreiben wir nur den Syntax von tactics; die Semantik ist beschrieben etwas weiter unten im Kontext mit tactics, die die Benutzer/Innen dieses Programmes verwenden: Es gibt einen Schriftverkehr zwischen den user-tactics und den script tactics. + + + +\part{Authoring on the knowledge} + + +\section{Add a theorem} +\section{Define and add a problem} +\section{Define and add a predicate} +\section{Define and add a method} +\section{} +\section{} +\section{} +\section{} + + + +\newpage +\bibliography{bib/isac,bib/from-theses} + +\end{document} diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/mat-eng-en.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/mat-eng-en.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,1771 @@ +%WN051006 dropped in code, but interesting for case study 'order a list' +%EqSystem.thy +%--------------------------------------------------------------------------- +% +% order'_system :: "bool list => bool list " ("order'_system _") +% +%EqSystem.ML +%--------------------------------------------------------------------------- +%(*("order_system", ("EqSystem.order'_system", +% eval_order_system "#eval_order_system_"))*) +%fun eval_order_system _ "EqSystem.order'_system" +% (p as (Const ("EqSystem.order'_system",_) $ ts)) _ = +% let val ts' = sort (ord_simplify_Integral_ false (assoc_thy"Isac.thy") []) +% (isalist2list ts) +% val ts'' = list2isalist HOLogic.boolT ts' +% in if ts <> ts'' +% then Some (term2str p ^ " = " ^ term2str ts'', +% Trueprop $ (mk_equality (p,ts''))) +% else None +% end +% | eval_order_system _ _ _ _ = None; +% +% +%"Script Norm2SystemScript (es_::bool list) (vs_::real list) = \ +%\ (let es__ = Try (Rewrite_Set simplify_Integral_parenthesized False) es_; \ +%\ es__ = (Try (Calculate order_system_) (order_system es__))\ +%\in (SubProblem (Biegelinie_,[linear,system],[no_met])\ +%\ [bool_list_ es__, real_list_ vs_]))" +% )); +% +%eqsystem.sml +%--------------------------------------------------------------------------- +%"----------- eval_sort -------------------------------------------"; +%"----------- eval_sort -------------------------------------------"; +%"----------- eval_sort -------------------------------------------"; +%val ts = str2term "[c_2 = 0, -1 * (q_0 * L ^^^ 2) / 2 + (L * c + c_2) = 0]"; +%val ts' = sort (ord_simplify_Integral_ false (assoc_thy"Isac.thy") []) +% (isalist2list ts); +%terms2str ts'; +%val ts'' = list2isalist HOLogic.boolT ts'; +%if term2str ts'' = "[-1 * (q_0 * L ^^^ 2) / 2 + (L * c + c_2) = 0, c_2 = 0]" +%then () else raise error "eqsystem.sml eval_sort 1"; +% +%val t = str2term "order_system [c_2 = 0,\ +% \-1 * (q_0 * L ^^^ 2) / 2 + (L * c + c_2) = 0]"; +%val Some (str,_) = eval_order_system "" "EqSystem.order'_system" t ""; +%if str = "order_system [c_2 = 0, -1 * (q_0 * L ^^^ 2) / 2 + (L * c + c_2) = 0] = [-1 * (q_0 * L ^^^ 2) / 2 + (L * c + c_2) = 0, c_2 = 0]" then () +%else raise error "eqsystem.sml eval_sort 2"; +% +% +% +% calculate_ thy ("EqSystem.order'_system", +% eval_order_system "#eval_order_system_") t; +% +%--------------------------------------------------------------------------- +%--------------------------------------------------------------------------- +%--------------------------------------------------------------------------- + + +%In the following this text is not compatible with isac-code: +%* move termorder to knowledge: FIXXXmat0201a +% +% + +\documentclass[11pt,a4paper,headline,headcount,towside,nocenter]{report} +\usepackage{latexsym} % recommended by Ch.Schinagl 10.98 +\bibliographystyle{alpha} + +\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} + +\title{\isac --- Interface for\\ + Developers of Math Knowledge\\[1.0ex] + and\\[1.0ex] + Tools for Experiments in\\ + Symbolic Computation\\[1.0ex]} +\author{The \isac-Team\\ + \tt isac-users@ist.tugraz.at\\[1.0ex]} +\date{\today} + +\begin{document} +\maketitle +\newpage +\tableofcontents +\newpage +\listoftables +\newpage + +\chapter{Introduction} +\section{The scope of this document} +\paragraph{As a manual:} This document describes the interface to \isac's kernel (KE), the interface to the mathematics engine (ME) included in the KE, and to the various tools like rewriting, matching etc. + +\isac's KE is written in SML, the language developed in conjunction with predecessors of the theorem prover Isabelle. Thus, in this document we use the plain ASCII representation of SML code. The reader may note that the \isac-user is presented a completely different view on a graphical user interface. + +The document is selfcontained; basic knowledge about SML (as an introduction \cite{Paulson:91} is recommended), terms and rewriting is assumed. + +%The interfaces will be moderately exended during the first phase of development of the mathematics knowledge. The work on the subprojects defined should {\em not} create interfaces of any interest to a user or another author of knowledge except identifiers (of type string) for theorems, rulesets etc. + +Notation: SML code, directories, file names are {\tt written in 'tt'}; in particular {\tt ML>} is the KE prompt. + +\paragraph{Give it a try !} Another aim of this text is to give the reader hints for experiments with the tools introduced. + +\section{Related documents}\label{related-docs} +Isabelle reference manual \cite{Isa-ref}, also contained in the Isabelle distribution under $\sim${\tt /doc/}. + +{\bf The actual locations of files is being recorded in \\{\tt /software/services/isac/README} +\footnote{The KEs current version is {\tt isac.020120-math/} which is based on the version Isabelle99 at {\tt http://isabelle.in.tum.de}.\\ +The current locations at IST are\\ +{\tt [isabelle]\hspace{3em} /software/sol26/Isabelle99/}\\ +{\tt [isac-src]\hspace{3em} /software/services/isac/src/ke/}\\ +{\tt [isac-bin]\hspace{3em} /software/services/isac/bin/ke/} +} +and rigorously updated.} In this document we refer to the following directories +\begin{tabbing} +xxx\=Isabelle sources1234 \=\kill +\>Isabelle sources \> {\tt [isabelle]/}\\ +\>KE sources \> {\tt [isac-src]/\dots{version}\dots/}\\ +\>KE binary \> {\tt [isac-bin]/\dots{version}\dots/} +\end{tabbing} +where {\tt\dots version\dots} stands for a directory-name containing information on the version. + +\section{Getting started} +Change to the directory {\tt [isac-bin]} where \isac's binary is located and type to the unix-prompt '$>$' (ask your system administrator where the directory {\tt [isac-bin]} is on your system): +\begin{verbatim} + > [isac-bin]/sml @SMLload=isac.020120-math + val it = false : bool + ML> +\end{verbatim} +yielding the message {\tt val it = false : bool} followed by the prompt of the KE. Having been successful so far, just type in the input presented below -- all of it belongs to {\em one} session~! + +\part{Experimental approach} + +\chapter{Basics, terms and parsing} +Isabelle implements terms of the {\it simply typed lambda calculus} \cite{typed-lambda} defined in $\sim${\tt/src/Pure.ML}. +\section{The definition of terms} +There are two kinds of terms in Isabelle, 'raw terms' and 'certified terms'. \isac{} works on raw terms, which are efficient but hard to comprehend. +{\footnotesize\begin{verbatim} + datatype term = + Const of string * typ + | Free of string * typ + | Var of indexname * typ + | Bound of int + | Abs of string * typ * term + | op $ of term * term; + + datatype typ = Type of string * typ list + | TFree of string * sort + | TVar of indexname * sort; +\end{verbatim}}%size % $ +where the definitions of sort and indexname is not relevant in this context. The {\tt typ}e is being inferred during parsing. Parsing creates the other kind of terms, {\tt cterm}. These {\tt cterm}s are encapsulated records, which cannot be composed without the respective Isabelle functions (checking for type correctness), but which then are conveniently displayed as strings (using SML compiler internals -- see below). + +\section{Theories and parsing} +Parsing uses information contained in Isabelles theories $\sim${\tt /src/HOL}. The currently active theory is held in a global variable {\tt thy}; theories can be accessed individually; +{\footnotesize\begin{verbatim} + ML> thy; + val it = + {ProtoPure, CPure, HOL, Ord, Set, subset, equalities, mono, Vimage, Fun, + Prod, Lfp, Relation, Trancl, WF, NatDef, Gfp, Sum, Inductive, Nat, Arith, + Divides, Power, Finite, Equiv, IntDef, Int, Univ, Datatype, Numeral, Bin, + IntArith, WF_Rel, Recdef, IntDiv, NatBin, List, Option, Map, Record, + RelPow, Sexp, String, Calculation, SVC_Oracle, Main, Zorn, Filter, PNat, + PRat, PReal, RealDef, RealOrd, RealInt, RealBin, HyperDef, Descript, ListG, + Tools, Script, Typefix, Atools, RatArith, SqRoot, Differentiate, DiffAppl, + InsSort, Isac} : theory ML> + ML> HOL.thy; + val it = {ProtoPure, CPure, HOL} : theory + ML> + ML> parse; + val it = fn : theory -> string -> cterm option + ML> parse thy "a + b * #3"; + val it = Some "a + b * #3" : cterm option + ML> + ML> val t = (term_of o the) it; + val t = Const (#,#) $ Free (#,#) $ (Const # $ Free # $ Free (#,#)) : term +\end{verbatim}}%size +where {\tt term\_of} and {\tt the} are explained below. The syntax of the list of characters can be read out of Isabelles theories \cite{Isa-obj} {\tt [isabelle]/src/HOL/}\footnote{Or you may use your internetbrowser to look at the files in {\tt [isabelle]/browser\_info}.} +and from theories developed with in \isac{} at {\tt [isac-src]/knowledge/}. Note that the syntax of the terms is different from those displayed at \isac's frontend after conversion to MathML. + + +\section{Displaying terms} +The print depth on the SML top-level can be set in order to produce output in the amount of detail desired: +{\footnotesize\begin{verbatim} + ML> Compiler.Control.Print.printDepth; + val it = ref 4 : int ref + ML> + ML> Compiler.Control.Print.printDepth:= 2; + val it = () : unit + ML> t; + val it = # $ # $ (# $ #) : term + ML> + ML> Compiler.Control.Print.printDepth:= 6; + val it = () : unit + ML> t; + val it = + Const ("op +","[RealDef.real, RealDef.real] => RealDef.real") $ + Free ("a","RealDef.real") $ + (Const ("op *","[RealDef.real, RealDef.real] => RealDef.real") $ + Free ("b","RealDef.real") $ Free ("#3","RealDef.real")) : term +\end{verbatim}}%size % $ +A closer look to the latter output shows that {\tt typ} is output as a string like {\tt cterm}. Other useful settings for the output are: +{\footnotesize\begin{verbatim} + ML> Compiler.Control.Print.printLength; + val it = ref 8 : int ref + ML> Compiler.Control.Print.stringDepth; + val it = ref 250 : int ref +\end{verbatim}}%size +Anyway, the SML output of terms is not very readable; there are functions in the KE to display them: +{\footnotesize\begin{verbatim} + ML> atomt; + val it = fn : term -> unit + ML> atomt t; + *** ------------- + *** Const ( op +) + *** . Free ( a, ) + *** . Const ( op *) + *** . . Free ( b, ) + *** . . Free ( #3, ) + val it = () : unit + ML> + ML> atomty; + val it = fn : theory -> term -> unit + ML> atomty thy t; + *** ------------- + *** Const ( op +, [real, real] => real) + *** . Free ( a, real) + *** . Const ( op *, [real, real] => real) + *** . . Free ( b, real) + *** . . Free ( #3, real) + val it = () : unit +\end{verbatim}}%size +where again the {\tt typ}s are rendered as strings, but more elegantly by use of the information contained in {\tt thy}.. + +\paragraph{Give it a try !} {\bf The mathematics knowledge grows} as it is defined in Isabelle theory by theory. Have a look by your internet browser to the hierarchy of those theories at {\tt [isabelle]/src/HOL/HOL.thy} and its children available on your system. Or you may use your internetbrowser to look at the files in {\tt [isabelle]/browser\_info}. +{\footnotesize\begin{verbatim} + ML> (*-1-*) parse HOL.thy "#2^^^#3"; + *** Inner lexical error at: "^^^#3" + val it = None : cterm option + ML> + ML> (*-2-*) parse HOL.thy "d_d x (a + x)"; + val it = None : cterm option + ML> + ML> + ML> (*-3-*) parse RatArith.thy "#2^^^#3"; + val it = Some "#2 ^^^ #3" : cterm option + ML> + ML> (*-4-*) parse RatArith.thy "d_d x (a + x)"; + val it = Some "d_d x (a + x)" : cterm option + ML> + ML> + ML> (*-5-*) parse Differentiate.thy "d_d x (a + x)"; + val it = Some "d_d x (a + x)" : cterm option + ML> + ML> (*-6-*) parse Differentiate.thy "#2^^^#3"; + val it = Some "#2 ^^^ #3" : cterm option +\end{verbatim}}%size +Don't trust the string representation: if we convert {\tt(*-4-*)} and {\tt(*-6-*)} to terms \dots +{\footnotesize\begin{verbatim} + ML> (*-4-*) val thy = RatArith.thy; + ML> ((atomty thy) o term_of o the o (parse thy)) "d_d x (a + x)"; + *** ------------- + *** Free ( d_d, [real, real] => real) + *** . Free ( x, real) + *** . Const ( op +, [real, real] => real) + *** . . Free ( a, real) + *** . . Free ( x, real) + val it = () : unit + ML> + ML> (*-6-*) val thy = Differentiate.thy; + ML> ((atomty thy) o term_of o the o (parse thy)) "d_d x (a + x)"; + *** ------------- + *** Const ( Differentiate.d_d, [real, real] => real) + *** . Free ( x, real) + *** . Const ( op +, [real, real] => real) + *** . . Free ( a, real) + *** . . Free ( x, real) + val it = () : unit +\end{verbatim}}%size +\dots we see: in {\tt(*-4-*)} we have an arbitrary function {\tt Free ( d\_d, \_)} and in {\tt(*-6-*)} we have the special function constant {\tt Const ( Differentiate.d\_d, \_)} for differentiation, which is defined in {\tt Differentiate.thy} and presumerably is meant. + + +\section{Converting terms} +The conversion from {\tt cterm} to {\tt term} has been shown above: +{\footnotesize\begin{verbatim} + ML> term_of; + val it = fn : cterm -> term + ML> + ML> the; + val it = fn : 'a option -> 'a + ML> + ML> val t = (term_of o the o (parse thy)) "a + b * #3"; + val t = Const (#,#) $ Free (#,#) $ (Const # $ Free # $ Free (#,#)) : term +\end{verbatim}}%size +where {\tt the} unwraps the {\tt term option} --- an auxiliary function from Larry Paulsons basic library at {\tt [isabelle]/src/Pure/library.ML}, which is really worthwile to study for any SML programmer. + +The other conversions are the following, some of which use the {\it signature} {\tt sign} of a theory: +{\footnotesize\begin{verbatim} + ML> sign_of; + val it = fn : theory -> Sign.sg + ML> + ML> cterm_of; + val it = fn : Sign.sg -> term -> cterm + ML> val ct = cterm_of (sign_of thy) t; + val ct = "a + b * #3" : cterm + ML> + ML> Sign.string_of_term; + val it = fn : Sign.sg -> term -> string + ML> Sign.string_of_term (sign_of thy) t; + val it = "a + b * #3" : ctem' + ML> + ML> string_of_cterm; + val it = fn : cterm -> string + ML> string_of_cterm ct; + val it = "a + b * #3" : ctem' +\end{verbatim}}%size + +\section{Theorems} +Theorems are a type, {\tt thm}, even more protected than {\tt cterms}: they are defined as axioms or proven in Isabelle. These definitions and proofs are contained in theories in the directory {\tt[isac-src]/knowledge/}, e.g. the theorem {\tt diff\_sum} in the theory {\tt[isac-src]/knowledge/Differentiate.thy}. Additionally, each theorem has to be recorded for \isac{} in the respective {\tt *.ML}, e.g. {\tt diff\_sum} in {\tt[isac-src]/knowledge/Differentiate.ML} as follows: +{\footnotesize\begin{verbatim} + ML> theorem' := overwritel (!theorem', + [("diff_const",num_str diff_const) + ]); +\end{verbatim}}%size +The additional recording of theorems and other values will disappear in later versions of \isac. + +\chapter{Rewriting} +\section{The arguments for rewriting} +The type identifiers of the arguments and values of the rewrite-functions in \ref{rewrite} differ only in an apostroph: the apostrohped types are re-named strings in order to maintain readability. +{\footnotesize\begin{verbatim} + ML> HOL.thy; + val it = {ProtoPure, CPure, HOL} : theory + ML> "HOL.thy" : theory'; + val it = "HOL.thy" : theory' + ML> + ML> sqrt_right; + val it = fn : rew_ord (* term * term -> bool *) + ML> "sqrt_right" : rew_ord'; + val it = "sqrt_right" : rew_ord' + ML> + ML> eval_rls; + val it = + Rls + {preconds=[],rew_ord=("sqrt_right",fn), + rules=[Thm #,Thm #,Thm #,Thm #,Thm #,Thm #,Thm #,Thm #, + Thm #,Thm #,Thm #,Thm #,Thm #,Calc #,Calc #,...], + scr=Script (Free #)} : rls + ML> "eval_rls" : rls'; + val it = "eval_rls" : rls' + ML> + ML> diff_sum; + val it = "d_d ?bdv (?u + ?v) = d_d ?bdv ?u + d_d ?bdv ?v" : thm + ML> ("diff_sum", "") : thm'; + val it = ("diff_sum","") : thm' +\end{verbatim}}%size +where a {\tt thm'} is a pair, eventually with the string-representation of the respective theorem. + +\section{The functions for rewriting}\label{rewrite} +Rewriting comes along with two equivalent functions, where the first is being actually used within the KE, and the second one is useful for tests: +{\footnotesize\begin{verbatim} + ML> rewrite_; + val it = fn + : theory + -> rew_ord + -> rls -> bool -> thm -> term -> (term * term list) option + ML> + ML> rewrite; + val it = fn + : theory' + -> rew_ord' + -> rls' -> bool -> thm' -> cterm' -> (cterm' * cterm' list) option +\end{verbatim}}%size +The arguments are the following:\\ +\tabcolsep=4mm +\def\arraystretch{1.5} +\begin{tabular}{lp{11.0cm}} + {\tt theory} & the Isabelle theory containing the definitions necessary for parsing the {\tt term} \\ + {\tt rew\_ord}& the rewrite order \cite{nipk:rew-all-that} for ordered rewriting -- see the section \ref{term-order} below. For {\em no} ordered rewriting take {\tt tless\_true}, a dummy order yielding true for all arguments \\ + {\tt rls} & the rule set for evaluating the condition within {\tt thm} in case {\tt thm} is a conditional rule \\ + {\tt bool} & a flag which triggers the evaluation of the eventual condition in {\tt thm}: if {\tt false} then evaluate the condition and according to the result of the evaluation apply {\tt thm} or not (conditional rewriting \cite{nipk:rew-all-that}), if {\tt true} then don't evaluate the condition, but put it into the set of assumptions \\ + {\tt thm} & the theorem used to try to rewrite {\tt term} \\ + {\tt term} & the term eventually rewritten by {\tt thm} \\ +\end{tabular}\\ + +\noindent The respective values of {\tt rewrite\_} and {\tt rewrite} are an {\tt option} of a pair, i.e. {\tt Some(\_,\_)} in case the {\tt term} can be rewritten by {\tt thm} w.r.t. {\tt rew\_ord} and/or {\tt rls}, or {\tt None} if no rewrite is found:\\ +\begin{tabular}{lp{10.4cm}} + {\tt term} & the term rewritten \\ + {\tt term list}& the assumptions eventually generated if the {\tt bool} flag is set to {\tt true} and {\tt thm} is applicable. \\ +\end{tabular}\\ + +\paragraph{Give it a try !} {\bf\dots rewriting is fun~!} many examples can be found in {\tt [isac-src]/tests/\dots}. In {\tt [isac-src]/tests/differentiate.sml} the following can be found: +{\footnotesize\begin{verbatim} + ML> val thy' = "Differentiate.thy"; + val thy' = "Differentiate.thy" : string + ML> val ct = "d_d x (x ^^^ #2 + #3 * x + #4)"; + val ct = "d_d x (x ^^^ #2 + #3 * x + #4)" : cterm' + ML> + ML> val thm = ("diff_sum",""); + val thm = ("diff_sum","") : thm' + ML> val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true + [("bdv","x::real")] thm ct; + val ct = "d_d x (x ^^^ #2 + #3 * x) + d_d x #4" : cterm' + ML> + ML> val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true + [("bdv","x::real")] thm ct; + val ct = "d_d x (x ^^^ #2) + d_d x (#3 * x) + d_d x #4" : cterm' + ML> + ML> val thm = ("diff_prod_const",""); + val thm = ("diff_prod_const","") : thm' + ML> val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true + [("bdv","x::real")] thm ct; + val ct = "d_d x (x ^^^ #2) + #3 * d_d x x + d_d x #4" : cterm' +\end{verbatim}}%size +You can look up the theorems in {\tt [isac-src]/knowledge/Differentiate.thy} and try to apply them until you get the result you would expect if calculating by hand. +\footnote{Hint: At the end you will need {\tt val (ct,\_) = the (rewrite\_set thy' "eval\_rls" false "SqRoot\_simplify" ct);}} + +\paragraph{Give it a try !}\label{cond-rew} {\bf Conditional rewriting} is a more powerful technique then ordinary rewriting, and is closer to the power of programming languages (see the subsequent 'try it out'~!). The following example expands a term to poynomial form: +{\footnotesize\begin{verbatim} + ML> val thy' = "Isac.thy"; + val thy' = "Isac.thy" : string + ML> val ct' = "#3 * a + #2 * (a + #1)"; + val ct' = "#3 * a + #2 * (a + #1)" : cterm' + ML> + ML> val thm' = ("radd_mult_distrib2","?k * (?m + ?n) = ?k * ?m + ?k * ?n"); + val thm' = ("radd_mult_distrib2","?k * (?m + ?n) = ?k * ?m + ?k * ?n") + : thm' + ML> (*1*) val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; + val ct' = "#3 * a + (#2 * a + #2 * #1)" : cterm' + ML> + ML> val thm' = ("radd_assoc_RS_sym","?m1 + (?n1 + ?k1) = ?m1 + ?n1 + ?k1"); + val thm' = ("radd_assoc_RS_sym","?m1 + (?n1 + ?k1) = ?m1 + ?n1 + ?k1") + : thm' + ML> (*2*) val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; + val ct' = "#3 * a + #2 * a + #2 * #1" : cterm' + ML> + ML> val thm' = ("rcollect_right", + "[| ?l is_const; ?m is_const |] ==> ?l * ?n + ?m * ?n = (?l + ?m) * ?n"); + val thm' = + ("rcollect_right", + "[| ?l is_const; ?m is_const |] ==> ?l * ?n + ?m * ?n = (?l + ?m) * ?n") + : thm' + ML> (*3*) val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; + val ct' = "(#3 + #2) * a + #2 * #1" : cterm' + ML> + ML> (*4*) val Some (ct',_) = calculate' thy' "plus" ct'; + val ct' = "#5 * a + #2 * #1" : cterm' + ML> + ML> (*5*) val Some (ct',_) = calculate' thy' "times" ct'; + val ct' = "#5 * a + #2" : cterm' +\end{verbatim}}%size +Note, that the two rules, {\tt radd\_mult\_distrib2} in {\tt(*1*)} and {\tt rcollect\_right} in {\tt(*3*)} would neutralize each other (i.e. a rule set would not terminate), if there would not be the condition {\tt is\_const}. + +\paragraph{Give it a try !} {\bf Functional programming} can, within a certain range, modeled by rewriting. In {\tt [isac-src]/\dots/tests/InsSort.thy} the following rules can be found, which are able to sort a list ('insertion sort'): +{\footnotesize\begin{verbatim} + sort_def "sort ls = foldr ins ls []" + + ins_base "ins [] a = [a]" + ins_rec "ins (x#xs) a = (if x < a then x#(ins xs a) else a#(x#xs))" + + foldr_base "foldr f [] a = a" + foldr_rec "foldr f (x#xs) a = foldr f xs (f a x)" + + if_True "(if True then ?x else ?y) = ?x" + if_False "(if False then ?x else ?y) = ?y" +\end{verbatim}}%size +where {\tt\#} is the list-constructor, {\tt foldr} is the well-known standard function of functional programming, and {\tt if\_True, if\_False} are auxiliary rules. Then the sort may be done by the following rewrites: +{\footnotesize\begin{verbatim} + ML> val thy' = "InsSort.thy"; + val thy' = "InsSort.thy" : theory' + ML> val ct = "sort [#1,#3,#2]" : cterm'; + val ct = "sort [#1,#3,#2]" : cterm' + ML> + ML> val thm = ("sort_def",""); + ML> val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); + val ct = "foldr ins [#1, #3, #2] []" : cterm' + ML> + ML> val thm = ("foldr_rec",""); + ML> val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); + val ct = "foldr ins [#3, #2] (ins [] #1)" : cterm' + ML> + ML> val thm = ("ins_base",""); + ML> val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); + val ct = "foldr ins [#3, #2] [#1]" : cterm' + ML> + ML> val thm = ("foldr_rec",""); + ML> val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); + val ct = "foldr ins [#2] (ins [#1] #3)" : cterm' + ML> + ML> val thm = ("ins_rec",""); + ML> val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); + val ct = "foldr ins [#2] (if #1 < #3 then #1 # ins [] #3 else [#3, #1])" + : cterm' + ML> + ML> val (ct,_) = the (calculate' thy' "le" ct); + val ct = "foldr ins [#2] (if True then #1 # ins [] #3 else [#3, #1])" : cterm' + ML> + ML> val thm = ("if_True","(if True then ?x else ?y) = ?x"); + ML> val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); + val ct = "foldr ins [#2] (#1 # ins [] #3)" : cterm' + ML> + ... + val ct = "sort [#1,#3,#2]" : cterm' +\end{verbatim}}%size + + +\section{Variants of rewriting} +Some of the above examples already used variants of {\tt rewrite} all of which have the same value, and very similar arguments: +{\footnotesize\begin{verbatim} + ML> rewrite_inst_; + val it = fn + : theory + -> rew_ord + -> rls + -> bool + -> (cterm' * cterm') list + -> thm -> term -> (term * term list) option + ML> rewrite_inst; + val it = fn + : theory' + -> rew_ord' + -> rls' + -> bool + -> (cterm' * cterm') list + -> thm' -> cterm' -> (cterm' * cterm' list) option + ML> + ML> rewrite_set_; + val it = fn + : theory -> rls -> bool -> rls -> term -> (term * term list) option + ML> rewrite_set; + val it = fn + : theory' -> rls' -> bool -> rls' -> cterm' -> (cterm' * cterm' list) option + ML> + ML> rewrite_set_inst_; + val it = fn + : theory + -> rls + -> bool + -> (cterm' * cterm') list + -> rls -> term -> (term * term list) option + ML> rewrite_set_inst; + val it = fn + : theory' + -> rls' + -> bool + -> (cterm' * cterm') list + -> rls' -> cterm' -> (cterm' * cterm' list) option +\end{verbatim}}%size + +\noindent The variant {\tt rewrite\_inst} substitutes {\tt (term * term) list} in {\tt thm} before rewriting,\\ +the variant {\tt rewrite\_set} rewrites with a whole rule set {\tt rls} (instead with a {\tt thm} only),\\ +the variant {\tt rewrite\_set\_inst} is a combination of the latter two variants. In order to watch how a term is rewritten theorem by theorem, there is a switch {\tt trace\_rewrite}: +{\footnotesize\begin{verbatim} + ML> toggle; + val it = fn : bool ref -> bool + ML> + ML> toggle trace_rewrite; + val it = true : bool + ML> toggle trace_rewrite; + val it = false : bool +\end{verbatim}}%size + +\section{Rule sets} +Some of the variants of {\tt rewrite} above do not only apply one theorem, but a whole set of theorems, called a 'rule set'. Such a rule set is applied as long one of its elements can be used for a rewrite (which can go forever, i.e. the rule set eventually does not 'terminate'). + +A simple example of a rule set is {\tt rearrange\_assoc} which is defined in {\tt knowledge/RatArith.ML} as: +{\footnotesize\begin{verbatim} + val rearrange_assoc = + Rls{preconds = [], rew_ord = ("tless_true",tless_true), + rules = + [Thm ("radd_assoc_RS_sym",num_str (radd_assoc RS sym)), + Thm ("rmult_assoc_RS_sym",num_str (rmult_assoc RS sym))], + scr = Script ((term_of o the o (parse thy)) + "empty_script") + }:rls; +\end{verbatim}}%size +where +\begin{description} +\item [\tt preconds] are conditions which must be true in order to make the rule set applicable (the empty list evaluates to {\tt true}) +\item [\tt rew\_ord] concerns term orders introduced below in \ref{term-order} +\item [\tt rules] are the theorems to be applied -- in priciple applied in arbitrary order, because all these rule sets should be 'complete' \cite{nipk:rew-all-that} (and actually the theorems are applied in the sequence they appear in this list). The function {\tt num\_str} must be applied to theorems containing numeral constants (and thus is obsolete in this example). {\tt RS} is an infix function applying the theorem {\tt sym} to {\tt radd\_assoc} before storage (the effect see below) +\item [\tt scr] is the script applying the ruleset; it will disappear in later versions of \isac. +\end{description} +These variables evaluate to +{\footnotesize\begin{verbatim} + ML> sym; + val it = "?s = ?t ==> ?t = ?s" : thm + ML> rearrange_assoc; + val it = + Rls + {preconds=[],rew_ord=("tless_true",fn), + rules=[Thm ("radd_assoc_RS_sym","?m1 + (?n1 + ?k1) = ?m1 + ?n1 + ?k1"), + Thm ("rmult_assoc_RS_sym","?m1 * (?n1 * ?k1) = ?m1 * ?n1 * ?k1")], + scr=Script (Free ("empty_script","RealDef.real"))} : rls +\end{verbatim}}%size + +\paragraph{Give it a try !} The above rule set makes an arbitrary number of parentheses disappear which are not necessary due to associativity of {\tt +} and +{\footnotesize\begin{verbatim} + ML> val ct = (string_of_cterm o the o (parse RatArith.thy)) + "a + (b * (c * d) + e)"; + val ct = "a + ((b * (c * d) + e) + f)" : cterm' + ML> rewrite_set "RatArith.thy" "eval_rls" false "rearrange_assoc" ct; + val it = Some ("a + b * c * d + e + f",[]) : (string * string list) option +\end{verbatim}}%size +For acchieving this result the rule set has to be surprisingly busy: +{\footnotesize\begin{verbatim} + ML> toggle trace_rewrite; + val it = true : bool + ML> rewrite_set "RatArith.thy" "eval_rls" false "rearrange_assoc" ct; + ### trying thm 'radd_assoc_RS_sym' + ### rewrite_set_: a + b * (c * d) + e + ### trying thm 'radd_assoc_RS_sym' + ### trying thm 'rmult_assoc_RS_sym' + ### rewrite_set_: a + b * c * d + e + ### trying thm 'rmult_assoc_RS_sym' + ### trying thm 'radd_assoc_RS_sym' + ### trying thm 'rmult_assoc_RS_sym' + val it = Some ("a + b * c * d + e",[]) : (string * string list) option +\end{verbatim}}%size + + +\section{Calculate numeric constants} +As soon as numeric constants are in adjacent subterms (see the example on p.\pageref{cond-rew}), they can be calculated by the function +{\footnotesize\begin{verbatim} + ML> calculate; + val it = fn : theory' -> string -> cterm' -> (cterm' * thm') option + ML> calculate_; + val it = fn : theory -> string -> term -> (term * (string * thm)) option +\end{verbatim}}%size +where the {\tt string} in the arguments defines the algebraic operation to be calculated. The function returns the result of the calculation, and as second element in the pair the theorem applied. The following algebraic operations are available: +{\footnotesize\begin{verbatim} + ML> calc_list; + val it = + ref + [("plus",("op +",fn)), + ("times",("op *",fn)), + ("cancel_",("cancel",fn)), + ("power",("pow",fn)), + ("sqrt",("sqrt",fn)), + ("Var",("Var",fn)), + ("Length",("Length",fn)), + ("Nth",("Nth",fn)), + ("power",("pow",fn)), + ("le",("op <",fn)), + ("leq",("op <=",fn)), + ("is_const",("is'_const",fn)), + ("is_root_free",("is'_root'_free",fn)), + ("contains_root",("contains'_root",fn)), + ("ident",("ident",fn))] + : (string * (string * (string -> term -> theory -> + (string * term) option))) list ref +\end{verbatim}}%size +These operations can be used in the following way. +{\footnotesize\begin{verbatim} + ML> calculate' "Isac.thy" "plus" "#1 + #2"; + val it = Some ("#3",("#add_#1_#2","\"#1 + #2 = #3\"")) : (string * thm') option + ML> + ML> calculate' "Isac.thy" "times" "#2 * #3"; + val it = Some ("#6",("#mult_#2_#3","\"#2 * #3 = #6\"")) + : (string * thm') option + ML> + ML> calculate' "Isac.thy" "power" "#2 ^^^ #3"; + val it = Some ("#8",("#power_#2_#3","\"#2 ^^^ #3 = #8\"")) + : (string * thm') option + ML> + ML> calculate' "Isac.thy" "cancel_" "#9 // #12"; + val it = Some ("#3 // #4",("#cancel_#9_#12","\"#9 // #12 = #3 // #4\"")) + : (string * thm') option + ML> + ML> ... +\end{verbatim}}%size + + + +\chapter{Term orders}\label{term-order} +Orders on terms are indispensable for the purpose of rewriting to normal forms in associative - commutative domains \cite{nipk:rew-all-that}, and for rewriting to normal forms necessary for matching models to problems, see sect.\ref{pbt}. +\section{Examples for term orders} +It is not trivial to construct a relation $<$ on terms such that it is really an order, i.e. a transitive and antisymmetric relation. These orders are 'recursive path orders' \cite{nipk:rew-all-that}. Some orders implemented in the knowledgebase at {\tt [isac-src]/knowledge/\dots}, %FIXXXmat0201a +e.g. +{\footnotesize\begin{verbatim} + ML> sqrt_right; + val it = fn : bool -> theory -> term * term -> bool + ML> tless_true; + val it = fn : 'a -> bool +\end{verbatim}}%size +where the bool argument is a switch for tracing the checks on the respective subterms (and theory is necessary for displyinging the (sub-)terms as strings in the case of 'true'). The order {\tt tless\_true} is a dummy always yielding {\tt true}, and {\tt sqrt\_right} prefers a square root shifted to the right within a term: +{\footnotesize\begin{verbatim} + ML> val t1 = (term_of o the o (parse thy)) "(sqrt a) + b"; + val t1 = Const # $ (# $ #) $ Free (#,#) : term + ML> + ML> val t2 = (term_of o the o (parse thy)) "b + (sqrt a)"; + val t2 = Const # $ Free # $ (Const # $ Free #) : term + ML> + ML> sqrt_right false SqRoot.thy (t1, t2); + val it = false : bool + ML> sqrt_right false SqRoot.thy (t2, t1); + val it = true : bool +\end{verbatim}}%size +The many checks performed recursively through all subterms can be traced throughout the algorithm in {\tt [isac-src]/knowledge/SqRoot.ML} by setting the flag to true: +{\footnotesize\begin{verbatim} + ML> val t1 = (term_of o the o (parse thy)) "a + b*(sqrt c) + d"; + val t1 = Const (#,#) $ (# $ # $ (# $ #)) $ Free ("d","RealDef.real") : term + ML> + ML> val t2 = (term_of o the o (parse thy)) "a + (sqrt b)*c + d"; + val t2 = Const (#,#) $ (# $ # $ (# $ #)) $ Free ("d","RealDef.real") : term + ML> + ML> sqrt_right true SqRoot.thy (t1, t2); + t= f@ts= "op +" @ "[a + b * sqrt c,d]" + u= g@us= "op +" @ "[a + sqrt b * c,d]" + size_of_term(t,u)= (8, 8) + hd_ord(f,g) = EQUAL + terms_ord(ts,us) = LESS + ------- + t= f@ts= "op +" @ "[a,b * sqrt c]" + u= g@us= "op +" @ "[a,sqrt b * c]" + size_of_term(t,u)= (6, 6) + hd_ord(f,g) = EQUAL + terms_ord(ts,us) = LESS + ------- + t= f@ts= "a" @ "[]" + u= g@us= "a" @ "[]" + size_of_term(t,u)= (1, 1) + hd_ord(f,g) = EQUAL + terms_ord(ts,us) = EQUAL + ------- + t= f@ts= "op *" @ "[b,sqrt c]" + u= g@us= "op *" @ "[sqrt b,c]" + size_of_term(t,u)= (4, 4) + hd_ord(f,g) = EQUAL + terms_ord(ts,us) = LESS + ------- + t= f@ts= "b" @ "[]" + u= g@us= "sqrt" @ "[b]" + size_of_term(t,u)= (1, 2) + hd_ord(f,g) = LESS + terms_ord(ts,us) = LESS + ------- + val it = true : bool +\end{verbatim}}%size + + + +\section{Ordered rewriting} +Rewriting faces problems in just the most elementary domains, which are all associative and commutative w.r.t. {\tt +} and {\tt *} --- the law of commutativity applied within a rule set causes this set not to terminate~! One method to cope with this difficulty is ordered rewriting, where a rewrite is only done if the resulting term is smaller w.r.t. a term order (with some additional properties called 'rewrite orders' \cite{nipk:rew-all-that}). + +Such a rule set {\tt ac\_plus\_times}, called an AC-rewrite system, can be found in {\tt[isac-src]/knowledge/RathArith.ML}: +{\footnotesize\begin{verbatim} + val ac_plus_times = + Rls{preconds = [], rew_ord = ("term_order",term_order), + rules = + [Thm ("radd_commute",radd_commute), + Thm ("radd_left_commute",radd_left_commute), + Thm ("radd_assoc",radd_assoc), + Thm ("rmult_commute",rmult_commute), + Thm ("rmult_left_commute",rmult_left_commute), + Thm ("rmult_assoc",rmult_assoc)], + scr = Script ((term_of o the o (parse thy)) + "empty_script") + }:rls; + val ac_plus_times = + Rls + {preconds=[],rew_ord=("term_order",fn), + rules=[Thm ("radd_commute","?m + ?n = ?n + ?m"), + Thm ("radd_left_commute","?x + (?y + ?z) = ?y + (?x + ?z)"), + Thm ("radd_assoc","?m + ?n + ?k = ?m + (?n + ?k)"), + Thm ("rmult_commute","?m * ?n = ?n * ?m"), + Thm ("rmult_left_commute","?x * (?y * ?z) = ?y * (?x * ?z)"), + Thm ("rmult_assoc","?m * ?n * ?k = ?m * (?n * ?k)")], + scr=Script (Free ("empty_script","RealDef.real"))} : rls +\end{verbatim}}%size +Note that the theorems {\tt radd\_left\_commute} and {\tt rmult\_left\_commute} are really necessary in order to make the rule set 'confluent'~! + + +\paragraph{Give it a try !} Ordered rewriting is one technique to produce polynomial normal from from arbitrary integer terms: +{\footnotesize\begin{verbatim} + ML> val ct' = "#3 * a + b + #2 * a"; + val ct' = "#3 * a + b + #2 * a" : cterm' + ML> + ML> (*-1-*) radd_commute; val thm' = ("radd_commute","") : thm'; + val it = "?m + ?n = ?n + ?m" : thm + val thm' = ("radd_commute","") : thm' + ML> val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; + val ct' = "#2 * a + (#3 * a + b)" : cterm' + ML> + ML> (*-2-*) rdistr_right_assoc_p; val thm' = ("rdistr_right_assoc_p","") : thm'; + val it = "?l * ?n + (?m * ?n + ?k) = (?l + ?m) * ?n + ?k" : thm + val thm' = ("rdistr_right_assoc_p","") : thm' + ML> val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; + val ct' = "(#2 + #3) * a + b" : cterm' + ML> + ML> (*-3-*) + ML> val Some (ct',_) = calculate thy' "plus" ct'; + val ct' = "#5 * a + b" : cterm' +\end{verbatim}}%size %FIXXXmat0201b ... calculate ! +This looks nice, but if {\tt radd\_commute} is applied automatically in {\tt (*-1-*)} without checking the resulting term to be 'smaller' w.r.t. a term order, then rewritin goes on forever (i.e. it does not 'terminate') \dots +{\footnotesize\begin{verbatim} + ML> val ct' = "#3 * a + b + #2 * a" : cterm'; + val ct' = "#3 * a + b + #2 * a" : cterm' + ML> val thm' = ("radd_commute","") : thm'; + val thm' = ("radd_commute","") : thm' + ML> + ML> val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; + val ct' = "#2 * a + (#3 * a + b)" : cterm' + ML> val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; + val ct' = "#3 * a + b + #2 * a" : cterm' + ML> val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; + val ct' = "#2 * a + (#3 * a + b)" : cterm' + .......... +\end{verbatim}}%size + +Ordered rewriting with the above AC-rewrite system {\tt ac\_plus\_times} performs a kind of bubble sort which can be traced: +{\footnotesize\begin{verbatim} + ML> toggle trace_rewrite; + val it = true : bool + ML> + ML> rewrite_set "RatArith.thy" "eval_rls" false "ac_plus_times" ct; + ### trying thm 'radd_commute' + ### not: "a + (b * (c * d) + e)" > "b * (c * d) + e + a" + ### rewrite_set_: a + (e + b * (c * d)) + ### trying thm 'radd_commute' + ### not: "a + (e + b * (c * d))" > "e + b * (c * d) + a" + ### not: "e + b * (c * d)" > "b * (c * d) + e" + ### trying thm 'radd_left_commute' + ### not: "a + (e + b * (c * d))" > "e + (a + b * (c * d))" + ### trying thm 'radd_assoc' + ### trying thm 'rmult_commute' + ### not: "b * (c * d)" > "c * d * b" + ### not: "c * d" > "d * c" + ### trying thm 'rmult_left_commute' + ### not: "b * (c * d)" > "c * (b * d)" + ### trying thm 'rmult_assoc' + ### trying thm 'radd_commute' + ### not: "a + (e + b * (c * d))" > "e + b * (c * d) + a" + ### not: "e + b * (c * d)" > "b * (c * d) + e" + ### trying thm 'radd_left_commute' + ### not: "a + (e + b * (c * d))" > "e + (a + b * (c * d))" + ### trying thm 'radd_assoc' + ### trying thm 'rmult_commute' + ### not: "b * (c * d)" > "c * d * b" + ### not: "c * d" > "d * c" + ### trying thm 'rmult_left_commute' + ### not: "b * (c * d)" > "c * (b * d)" + ### trying thm 'rmult_assoc' + val it = Some ("a + (e + b * (c * d))",[]) : (string * string list) option \end{verbatim}}%size +Notice that {\tt +} is left-associative where the parentheses are omitted for {\tt (a + b) + c = a + b + c}, but not for {\tt a + (b + c)}. Ordered rewriting necessarily terminates with parentheses which could be omitted due to associativity. + + +\chapter{The hierarchy of problem types}\label{pbt} +\section{The standard-function for 'matching'} +Matching \cite{nipk:rew-all-that} is a technique used within rewriting, and used by \isac{} also for (a generalized) 'matching' a problem with a problem type. The function which tests for matching has the following signature: +{\footnotesize\begin{verbatim} + ML> matches; + val it = fn : theory -> term -> term -> bool +\end{verbatim}}%size +where the first of the two {\tt term} arguments is the particular term to be tested, and the second one is the pattern: +{\footnotesize\begin{verbatim} + ML> val t = (term_of o the o (parse thy)) "#3 * x^^^#2 = #1"; + val t = Const (#,#) $ (# $ # $ (# $ #)) $ Free ("#1","RealDef.real") : term + ML> + ML> val p = (term_of o the o (parse thy)) "a * b^^^#2 = c"; + val p = Const (#,#) $ (# $ # $ (# $ #)) $ Free ("c","RealDef.real") : term + ML> atomt p; + *** ------------- + *** Const ( op =) + *** . Const ( op *) + *** . . Free ( a, ) + *** . . Const ( RatArith.pow) + *** . . . Free ( b, ) + *** . . . Free ( #2, ) + *** . Free ( c, ) + val it = () : unit + ML> + ML> free2var; + val it = fn : term -> term + ML> + ML> val pat = free2var p; + val pat = Const (#,#) $ (# $ # $ (# $ #)) $ Var ((#,#),"RealDef.real") : term + ML> Sign.string_of_term (sign_of thy) pat; + val it = "?a * ?b ^^^ #2 = ?c" : cterm' + ML> atomt pat; + *** ------------- + *** Const ( op =) + *** . Const ( op *) + *** . . Var ((a, 0), ) + *** . . Const ( RatArith.pow) + *** . . . Var ((b, 0), ) + *** . . . Free ( #2, ) + *** . Var ((c, 0), ) + val it = () : unit +\end{verbatim}}%size % $ +Note that the pattern {\tt pat} contains so-called {\it scheme variables} decorated with a {\tt ?} (analoguous to theorems). The pattern is generated by the function {\tt free2var}. This format of the pattern is necessary in order to obtain results like these: +{\footnotesize\begin{verbatim} + ML> matches thy t pat; + val it = true : bool + ML> + ML> val t2 = (term_of o the o (parse thy)) "x^^^#2 = #1"; + val t2 = Const (#,#) $ (# $ # $ Free #) $ Free ("#1","RealDef.real") : term + ML> matches thy t2 pat; + val it = false : bool + ML> + ML> val pat2 = (term_of o the o (parse thy)) "?u^^^#2 = ?v"; + val pat2 = Const (#,#) $ (# $ # $ Free #) $ Var ((#,#),"RealDef.real") : term + ML> matches thy t2 pat2; + val it = true : bool +\end{verbatim}}%size % $ + +\section{Accessing the hierarchy} +The hierarchy of problem types is encapsulated; it can be accessed by the following functions. {\tt show\_ptyps} retrieves all leaves of the hierarchy (here in an early version for testing): +{\footnotesize\begin{verbatim} + ML> show_ptyps; + val it = fn : unit -> unit + ML> show_ptyps(); + [ + ["e_pblID"], + ["equation", "univariate", "linear"], + ["equation", "univariate", "plain_square"], + ["equation", "univariate", "polynomial", "degree_two", "pq_formula"], + ["equation", "univariate", "polynomial", "degree_two", "abc_formula"], + ["equation", "univariate", "squareroot"], + ["equation", "univariate", "normalize"], + ["equation", "univariate", "sqroot-test"], + ["function", "derivative_of"], + ["function", "maximum_of", "on_interval"], + ["function", "make"], + ["tool", "find_values"], + ["functional", "inssort"] + ] + val it = () : unit +\end{verbatim}}%size +The retrieve function for individual problem types is {\tt get\_pbt} +\footnote{A function providing better readable output is in preparation}. Note that its argument, the 'problem identifier' {\tt pblID}, has the strings listed in reverse order w.r.t. the hierarchy, i.e. from the leave to the root. This order makes the {\tt pblID} closer to a natural description: +{\footnotesize\begin{verbatim} + ML> get_pbt; + val it = fn : pblID -> pbt + ML> get_pbt ["squareroot", "univariate", "equation"]; + val it = + {met=[("SqRoot.thy","square_equation")], + ppc=[("#Given",(Const (#,#),Free (#,#))), + ("#Given",(Const (#,#),Free (#,#))), + ("#Given",(Const (#,#),Free (#,#))), + ("#Find",(Const (#,#),Free (#,#)))], + thy={ProtoPure, CPure, HOL, Ord, Set, subset, equalities, mono, Vimage, Fun, + Prod, Lfp, Relation, Trancl, WF, NatDef, Gfp, Sum, Inductive, Nat, + Arith, Divides, Power, Finite, Equiv, IntDef, Int, Univ, Datatype, + Numeral, Bin, IntArith, WF_Rel, Recdef, IntDiv, NatBin, List, Option, + Map, Record, RelPow, Sexp, String, Calculation, SVC_Oracle, Main, + Zorn, Filter, PNat, PRat, PReal, RealDef, RealOrd, RealInt, RealBin, + HyperDef, Descript, ListG, Tools, Script, Typefix, Atools, RatArith, + SqRoot}, + where_=[Const ("SqRoot.contains'_root","bool => bool") $ + Free ("e_","bool")]} : pbt +\end{verbatim}}%size %$ +where the records fields hold the following data: +\begin{description} +\item [\tt thy]: the theory necessary for parsing the formulas +\item [\tt ppc]: the items of the problem type, divided into those {\tt Given}, the precondition {\tt Where} and the output item(s) {\tt Find}. The items of {\tt Given} and {\tt Find} are all headed by so-called descriptions, which determine the type. These descriptions are defined in {\tt [isac-src]/Isa99/Descript.thy}. +\item [\tt met]: the list of methods solving this problem type.\\ +\end{description} + +The following function adds or replaces a problem type (after having it prepared using {\tt prep\_pbt}) +{\footnotesize\begin{verbatim} + ML> store_pbt; + val it = fn : pbt * pblID -> unit + ML> store_pbt + (prep_pbt SqRoot.thy + (["newtype","univariate","equation"], + [("#Given" ,["equality e_","solveFor v_","errorBound err_"]), + ("#Where" ,["contains_root (e_::bool)"]), + ("#Find" ,["solutions v_i_"]) + ], + [("SqRoot.thy","square_equation")])); + val it = () : unit +\end{verbatim}}%size +When adding a new type with argument {\tt pblID}, an immediate parent must already exist in the hierarchy (this is the one with the tail of {\tt pblID}). + +\section{Internals of the datastructure} +This subsection only serves for the implementation of the hierarchy browser and can be skipped by the authors of math knowledge. + +A problem type is described by the following record type (in the file {\tt [isac-src]/globals.sml}, the respective functions are in {\tt [isac-src]/ME/ptyps.sml}), and held in a global reference variable: +{\footnotesize\begin{verbatim} + type pbt = + {thy : theory, (* the nearest to the root, + which allows to compile that pbt *) + where_: term list, (* where - predicates *) + ppc : ((string * (* fields "#Given","#Find" *) + (term * (* description *) + term)) (* id *) + list), + met : metID list}; (* methods solving the pbt *) + datatype ptyp = + Ptyp of string * (* key within pblID *) + pbt list * (* several pbts with different domIDs*) + ptyp list; + val e_Ptyp = Ptyp ("empty",[],[]); + + type ptyps = ptyp list; + val ptyps = ref ([e_Ptyp]:ptyps); +\end{verbatim}}%size +The predicates in {\tt where\_} (i.e. the preconditions) usually are defined in the respective theory in {\tt[isac-src]/knowledge}. Most of the predicates are not defined by rewriting, but by SML-code contained in the respective {\tt *.ML} file. + +Each item is headed by a so-called description which provides some guidance for interactive input. The descriptions are defined in {\tt[isac-src]/Isa99/Descript.thy}. + + + +\section{Match a formalization with a problem type}\label{pbl} +A formalization is {\it match}ed with a problem type which yields a problem. A formal description of this kind of {\it match}ing can be found in \\{\tt ftp://ft.ist.tugraz.at/projects/isac/publ/calculemus01.ps.gz}. A formalization of an equation is e.g. +{\footnotesize\begin{verbatim} + ML> val fmz = ["equality (#1 + #2 * x = #0)", + "solveFor x", + "solutions L"] : fmz; + val fmz = ["equality (#1 + #2 * x = #0)","solveFor x","solutions L"] : fmz +\end{verbatim}}%size +Given a formalization (and a specification of the problem, i.e. a theory, a problemtype, and a method) \isac{} can solve the respective problem automatically. The formalization must match the problem type for this purpose: +{\footnotesize\begin{verbatim} + ML> match_pbl; + val it = fn : fmz -> pbt -> match' + ML> + ML> match_pbl fmz (get_pbt ["univariate","equation"]); + val it = + Matches' + {Find=[Correct "solutions L"], + Given=[Correct "equality (#1 + #2 * x = #0)",Correct "solveFor x"], + Relate=[],Where=[Correct "matches (?a = ?b) (#1 + #2 * x = #0)"],With=[]} + : match' + ML> + ML> match_pbl fmz (get_pbt ["linear","univariate","equation"]); + val it = + Matches' + {Find=[Correct "solutions L"], + Given=[Correct "equality (#1 + #2 * x = #0)",Correct "solveFor x"], + Relate=[], + Where=[Correct + "matches ( x = #0) (#1 + #2 * x = #0) | + matches ( ?b * x = #0) (#1 + #2 * x = #0) | + matches (?a + x = #0) (#1 + #2 * x = #0) | + matches (?a + ?b * x = #0) (#1 + #2 * x = #0)"], + With=[]} : match' + ML> + ML> match_pbl fmz (get_pbt ["squareroot","univariate","equation"]); + val it = + NoMatch' + {Find=[Correct "solutions L"], + Given=[Correct "equality (#1 + #2 * x = #0)",Correct "solveFor x", + Missing "errorBound err_"],Relate=[], + Where=[False "contains_root #1 + #2 * x = #0 "],With=[]} : match' +\end{verbatim}}%size +The above formalization does not match the problem type \\{\tt["squareroot","univariate","equation"]} which is explained by the tags: +\begin{tabbing} +123\=\kill +\> {\tt Missing:} the item is missing in the formalization as required by the problem type\\ +\> {\tt Superfl:} the item is not required by the problem type\\ +\> {\tt Correct:} the item is correct, or the precondition ({\tt Where}) is true\\ +\> {\tt False:} the precondition ({\tt Where}) is false\\ +\> {\tt Incompl:} the item is incomlete, or not yet input.\\ +\end{tabbing} + + + +\section{Refine a problem specification} +The challenge in constructing the problem hierarchy is, to design the branches in such a way, that problem refinement can be done automatically (as it is done in algebra system e.g. by a internal hierarchy of equations). + +For this purpose the hierarchy must be built using the following rules: Let $F$ be a formalization and $P$ and $P_i,\:i=1\cdots n$ problem types, where the $P_i$ are specialized problem types w.r.t. $P$ (i.e. $P$ is a parent node of $P_i$), then +{\small +\begin{enumerate} +\item for all $F$ matching some $P_i$ must follow, that $F$ matches $P$ +\item an $F$ matching $P$ should not have more than {\em one} $P_i,\:i=1\cdots n-1$ with $F$ matching $P_i$ (if there are more than one $P_i$, the first one will be taken) +\item for all $F$ matching some $P$ must follow, that $F$ matches $P_n$\\ +\end{enumerate}}%small +\noindent Let us give an example for the point (1.) and (2.) first: +{\footnotesize\begin{verbatim} + ML> refine; + val it = fn : fmz -> pblID -> match list + ML> + ML> val fmz = ["equality (sqrt(#9+#4*x)=sqrt x + sqrt(#5+x))", + "solveFor x","errorBound (eps=#0)", + "solutions L"]; + ML> + ML> refine fmz ["univariate","equation"]; + *** pass ["equation","univariate"] + *** pass ["equation","univariate","linear"] + *** pass ["equation","univariate","plain_square"] + *** pass ["equation","univariate","polynomial"] + *** pass ["equation","univariate","squareroot"] + val it = + [Matches + (["univariate","equation"], + {Find=[Correct "solutions L"], + Given=[Correct "equality (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x))", + Correct "solveFor x",Superfl "errorBound (eps = #0)"],Relate=[], + Where=[Correct + "matches (?a = ?b) (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x))"], + With=[]}), + NoMatch + (["linear","univariate","equation"], + {Find=[Correct "solutions L"], + Given=[Correct "equality (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x))", + Correct "solveFor x",Superfl "errorBound (eps = #0)"],Relate=[], + Where=[False "(?a + ?b * x = #0) (sqrt (#9 + #4 * x#"], + With=[]}), + NoMatch + (["plain_square","univariate","equation"], + {Find=[Correct "solutions L"], + Given=[Correct "equality (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x))", + Correct "solveFor x",Superfl "errorBound (eps = #0)"],Relate=[], + Where=[False + "matches (?a + ?b * x ^^^ #2 = #0)"], + With=[]}), + NoMatch + (["polynomial","univariate","equation"], + {Find=[Correct "solutions L"], + Given=[Correct "equality (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x))", + Correct "solveFor x",Superfl "errorBound (eps = #0)"],Relate=[], + Where=[False + "is_polynomial_in sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x) x"], + With=[]}), + Matches + (["squareroot","univariate","equation"], + {Find=[Correct "solutions L"], + Given=[Correct "equality (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x))", + Correct "solveFor x",Correct "errorBound (eps = #0)"],Relate=[], + Where=[Correct + "contains_root sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x) "], + With=[]})] : match list +\end{verbatim}}%size}%footnotesize\label{refine} +This example shows, that in order to refine an {\tt["univariate","equation"]}, the formalization must match respective respective problem type (rule (1.)) and one of the descendants which should match selectively (rule (2.)). + +If no one of the descendants of {\tt["univariate","equation"]} match, rule (3.) comes into play: The {\em last} problem type on this level ($P_n$) provides for a special 'problem type' {\tt["normalize"]}. This node calls a method transforming the equation to a (or another) normal form, which then may match. Look at this example: +{\footnotesize\begin{verbatim} + ML> val fmz = ["equality (x+#1=#2)", + "solveFor x","errorBound (eps=#0)", + "solutions L"]; + [...] + ML> + ML> refine fmz ["univariate","equation"]; + *** pass ["equation","univariate"] + *** pass ["equation","univariate","linear"] + *** pass ["equation","univariate","plain_square"] + *** pass ["equation","univariate","polynomial"] + *** pass ["equation","univariate","squareroot"] + *** pass ["equation","univariate","normalize"] + val it = + [Matches + (["univariate","equation"], + {Find=[Correct "solutions L"], + Given=[Correct "equality (x + #1 = #2)",Correct "solveFor x", + Superfl "errorBound (eps = #0)"],Relate=[], + Where=[Correct "matches (?a = ?b) (x + #1 = #2)"],With=[]}), + NoMatch + (["linear","univariate","equation"], + [...] + With=[]}), + NoMatch + (["squareroot","univariate","equation"], + {Find=[Correct "solutions L"], + Given=[Correct "equality (x + #1 = #2)",Correct "solveFor x", + Correct "errorBound (eps = #0)"],Relate=[], + Where=[False "contains_root x + #1 = #2 "],With=[]}), + Matches + (["normalize","univariate","equation"], + {Find=[Correct "solutions L"], + Given=[Correct "equality (x + #1 = #2)",Correct "solveFor x", + Superfl "errorBound (eps = #0)"],Relate=[],Where=[],With=[]})] + : match list +\end{verbatim}}%size +The problem type $P_n$, {\tt["normalize","univariate","equation"]}, will transform the equation {\tt x + \#1 = \#2} to the normal form {\tt \#-1 + x = \#0}, which then will match {\tt["linear","univariate","equation"]}. + +This recursive search on the problem hierarchy can be done within a proof state. This leads to the next section. + + +\chapter{Methods} +A problem type can have one ore more methods solving a respective problem. A method is described by means of another new program language. The language itself looks like a simple functional language, but constructs an imperative proof-state behind the scenes (thus liberating the programer from dealing with technical details and also prohibiting incorrect construction of the proof tree). The interpreter of 'scripts' written in this language evaluates the scriptexpressions, and also delivers certain parts of the script itself for discussion with the user. + +\section{The scripts' syntax} +The syntax of scripts follows the definition given in Backus-normal-form: +{\it +\begin{tabbing} +123\=123\=expr ::=\=$|\;\;$\=\kill +\>script ::= {\tt Script} id arg$\,^*$ = body\\ +\>\>arg ::= id $\;|\;\;($ ( id :: type ) $)$\\ +\>\>body ::= expr\\ +\>\>expr ::= \>\>{\tt let} id = expr $($ ; id = expr$)^*$ {\tt in} expr\\ +\>\>\>$|\;$\>{\tt if} prop {\tt then} expr {\tt else} expr\\ +\>\>\>$|\;$\>listexpr\\ +\>\>\>$|\;$\>id\\ +\>\>\>$|\;$\>seqex id\\ +\>\>seqex ::= \>\>{\tt While} prop {\tt Do} seqex\\ +\>\>\>$|\;$\>{\tt Repeat} seqex\\ +\>\>\>$|\;$\>{\tt Try} seqex\\ +\>\>\>$|\;$\>seqex {\tt Or} seqex\\ +\>\>\>$|\;$\>seqex {\tt @@} seqex\\ +\>\>\>$|\;$\>tac $($ id $|$ listexpr $)^*$\\ +\>\>type ::= id\\ +\>\>tac ::= id +\end{tabbing}} +where {\it id} is an identifier with the usual syntax, {\it prop} is a proposition constructed by Isabelles logical operators (see \cite{Isa-obj} {\tt [isabelle]/src/HOL/HOL.thy}), {\it listexpr} (called {\bf list-expression}) is constructed by Isabelles list functions like {\tt hd, tl, nth} described in {\tt [isabelle]/src/HOL/List.thy}, and {\it type} are (virtually) all types declared in Isabelles version 99. + +Expressions containing some of the keywords {\tt let}, {\tt if} etc. are called {\bf script-expressions}. + +Tactics {\it tac} are (curried) functions. For clarity and simplicity reasons, {\it listexpr} must not contain a {\it tac}, and {\it tac}s must not be nested, + + +\section{Control the flow of evaluation} +The flow of control is managed by the following script-expressions called {\it tacticals}. +\begin{description} +\item{{\tt while} prop {\tt Do} expr id} +\item{{\tt if} prop {\tt then} expr {\tt else} expr} +\end{description} +While the the above script-expressions trigger the flow of control by evaluating the current formula, the other expressions depend on the applicability of the tactics within their respective subexpressions (which in turn depends on the proofstate) +\begin{description} +\item{{\tt Repeat} expr id} +\item{{\tt Try} expr id} +\item{expr {\tt Or} expr id} +\item{expr {\tt @@} expr id} +\end{description} + +\begin{description} +\item xxx + +\end{description} + +\chapter{Do a calculational proof} +First we list all the tactics available so far (this list may be extended during further development of \isac). + +\section{Tactics for doing steps in calculations} +\input{tactics} + +\section{The functionality of the math engine} +A proof is being started in the math engine {\tt me} by the tactic +\footnote{In the present version a tactic is of type {\tt mstep}.} + {\tt Init\_Proof}, and interactively promoted by other tactics. On input of each tactic the {\tt me} returns the resulting formula and the next tactic applicable. The proof is finished, when the {\tt me} proposes {\tt End\_Proof} as the next tactic. + +We show a calculation (calculational proof) concerning equation solving, where the type of equation is refined automatically: The equation is given by the respective formalization ... +{\footnotesize\begin{verbatim} + ML> val fmz = ["equality ((x+#1)*(x+#2)=x^^^#2+#8)","solveFor x", + "errorBound (eps=#0)","solutions L"]; + val fmz = + ["equality ((x+#1)*(x+#2)=x^^^#2+#8)","solveFor x","errorBound (eps=#0)", + "solutions L"] : string list + ML> + ML> val spec as (dom, pbt, met) = ("SqRoot.thy",["univariate","equation"], + ("SqRoot.thy","no_met")); + val dom = "SqRoot.thy" : string + val pbt = ["univariate","equation"] : string list + val met = ("SqRoot.thy","no_met") : string * string +\end{verbatim}}%size +... and the specification {\tt spec} of a domain {\tt dom}, a problem type {\tt pbt} and a method {\tt met}. Note that the equation is such, that it is not immediatly clear, what type it is in particular (it could be a polynomial of degree 2; but, for sure, the type is some specialized type of a univariate equation). Thus, no method ({\tt no\_met}) can be specified for solving the problem. + +Nevertheless this specification is sufficient for automatically solving the equation --- the appropriate method will be found by refinement within the hierarchy of problem types. + + +\section{Initialize the calculation} +The start of a new proof requires the following initializations: The proof state is given by a proof tree {\tt ptree} and a position {\tt pos'}; both are empty at the beginning. The tactic {\tt Init\_Proof} is, like all other tactics, paired with an identifier of type {\tt string} for technical reasons. +{\footnotesize\begin{verbatim} + ML> val (mID,m) = ("Init_Proof",Init_Proof (fmz, (dom,pbt,met))); + val mID = "Init_Proof" : string + val m = + Init_Proof + (["equality ((x+#1)*(x+#2)=x^^^#2+#8)","solveFor x","errorBound (eps=#0)", + "solutions L"],("SqRoot.thy",[#,#],(#,#))) : mstep + ML> + ML> val (p,_,f,nxt,_,pt) = me (mID,m) e_pos' c EmptyPtree; + val p = ([],Pbl) : pos' + val f = Form' (PpcKF (0,EdUndef,0,Nundef,(#,#))) : mout + val nxt = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"]) + : string * mstep + val pt = + Nd + (PblObj + {branch=#,cell=#,env=#,loc=#,meth=#,model=#,origin=#,ostate=#,probl=#, + result=#,spec=#},[]) : ptree + \end{verbatim}}%size +The mathematics engine {\tt me} returns the resulting formula {\tt f} of type {\tt mout} (which in this case is a problem), the next tactic {\tt nxt}, and a new proof state ({\tt ptree}, {\tt pos'}). + +We can convince ourselves, that the problem is still empty, by increasing {\tt Compiler.Control.Print.printDepth}: +{\footnotesize\begin{verbatim} + ML> Compiler.Control.Print.printDepth:=8; (*4 default*) + val it = () : unit + ML> + ML> f; + val it = + Form' + (PpcKF + (0,EdUndef,0,Nundef, + (Problem [], + {Find=[Incompl "solutions []"], + Given=[Incompl "equality",Incompl "solveFor"],Relate=[], + Where=[False "matches (?a = ?b) e_"],With=[]}))) : mout +\end{verbatim}}%size +Recall, please, the format of a problem as presented in sect.\ref{pbl} on p.\pageref{pbl}; such an 'empty' problem can be found above encapsulated by several constructors containing additional data (necessary for the dialog guide, not relevant here).\\ + +{\it In the sequel we will omit output of the {\tt me} if it is not important for the respective context}.\\ + +In general, the dialog guide will hide the following two tactics {\tt Refine\_Tacitly} and {\tt Model\_Problem} from the user. +{\footnotesize\begin{verbatim} + ML> nxt; + val it = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"]) + : string * mstep + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val nxt = ("Model_Problem",Model_Problem ["normalize","univariate","equation"]) + : string * mstep + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; +\end{verbatim}}%size + + +\section{The phase of modeling} +comprises the input of the items of the problem; the {\tt me} can help by use of the formalization tacitly transferred by {\tt Init\_Proof}. In particular, the {\tt me} in general 'knows' the next promising tactic; the first one has been returned by the (hidden) tactic {\tt Model\_Problem}. + +{\footnotesize\begin{verbatim} + ML> nxt; + val it = + ("Add_Given",Add_Given "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)") + : string * mstep + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val nxt = ("Add_Given",Add_Given "solveFor x") : string * mstep + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val nxt = ("Add_Find",Add_Find "solutions L") : string * mstep + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val f = Form' (PpcKF (0,EdUndef,0,Nundef,(#,#))) : mout +\end{verbatim}}%size +\noindent Now the problem is 'modeled', all items are input. We convince ourselves by increasing {\tt Compiler.Control.Print.printDepth} once more. +{\footnotesize\begin{verbatim} + ML> Compiler.Control.Print.printDepth:=8; + ML> f; + val it = + Form' + (PpcKF + (0,EdUndef,0,Nundef, + (Problem [], + {Find=[Correct "solutions L"], + Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", + Correct "solveFor x"],Relate=[],Where=[],With=[]}))) : mout +\end{verbatim}}%size +%One of the input items is considered {\tt Superfluous} by the {\tt me} consulting the problem type {\tt ["univariate","equation"]}. The {\tt ErrorBound}, however, could become important in case the equation only could be solved by some iteration method. + +\section{The phase of specification} +This phase provides for explicit determination of the domain, the problem type, and the method to be used. In particular, the search for the appropriate problem type is being supported. There are two tactics for this purpose: {\tt Specify\_Problem} generates feedback on how a candidate of a problem type matches the current problem, and {\tt Refine\_Problem} provides help by the system, if the user gets lost. +{\footnotesize\begin{verbatim} +ML> nxt; + val it = ("Specify_Domain",Specify_Domain "SqRoot.thy") : string * mstep + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val nxt = + ("Specify_Problem",Specify_Problem ["normalize","univariate","equation"]) + : string * mstep + val pt = + Nd + (PblObj + {branch=#,cell=#,env=#,loc=#,meth=#,model=#,origin=#,ostate=#,probl=#, + result=#,spec=#},[]) : ptree +\end{verbatim}}%size +The {\tt me} is smart enough to know the appropriate problem type (transferred tacitly with {\tt Init\_Proof}). In order to challenge the student, the dialog guide may hide this information; then the {\tt me} works as follows. +{\footnotesize\begin{verbatim} + ML> val nxt = ("Specify_Problem", + Specify_Problem ["polynomial","univariate","equation"]); + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val f = Form' (PpcKF (0,EdUndef,0,Nundef,(#,#))) : mout + val nxt = + ("Refine_Problem",Refine_Problem ["normalize","univariate","equation"]) + : string * mstep + ML> + ML> val nxt = ("Specify_Problem", + Specify_Problem ["linear","univariate","equation"]); + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val f = + Form' + (PpcKF + (0,EdUndef,0,Nundef, + (Problem ["linear","univariate","equation"], + {Find=[Correct "solutions L"], + Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", + Correct "solveFor x"],Relate=[], + Where=[False + "matches (?a + ?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)"], + With=[]}))) : mout +\end{verbatim}}%size +Again assuming that the dialog guide hide the next tactic proposed by the {\tt me}, and the student gets lost, {\tt Refine\_Problem} always 'knows' the way out, if applied to the problem type {\tt["univariate","equation"]}. +{\footnotesize\begin{verbatim} + ML> val nxt = ("Refine_Problem", + Refine_Problem ["linear","univariate","equation + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val f = Problems (RefinedKF [NoMatch #]) : mout + ML> + ML> Compiler.Control.Print.printDepth:=9;f;Compiler.Control.Print.printDepth:=4; + val f = + Problems + (RefinedKF + [NoMatch + (["linear","univariate","equation"], + {Find=[Correct "solutions L"], + Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", + Correct "solveFor x"],Relate=[], + Where=[False + "matches (?a + ?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)"], + With=[]})]) : mout + ML> + ML> val nxt = ("Refine_Problem",Refine_Problem ["univariate","equation"]); + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val f = + Problems + (RefinedKF [Matches #,NoMatch #,NoMatch #,NoMatch #,NoMatch #,Matches #]) + : mout + ML> + ML> + ML> Compiler.Control.Print.printDepth:=9;f;Compiler.Control.Print.printDepth:=4; + val f = + Problems + (RefinedKF + [Matches + (["univariate","equation"], + {Find=[Correct "solutions L"], + Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", + Correct "solveFor x"],Relate=[], + Where=[Correct + With=[]}), + NoMatch + (["linear","univariate","equation"], + {Find=[Correct "solutions L"], + Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", + Correct "solveFor x"],Relate=[], + Where=[False + "matches (?a + ?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)"], + With=[]}), + NoMatch + ... + ... + Matches + (["normalize","univariate","equation"], + {Find=[Correct "solutions L"], + Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", + Correct "solveFor x"],Relate=[],Where=[],With=[]})]) : mout +\end{verbatim}}%size +The tactic {\tt Refine\_Problem} returns all matches to problem types along the path traced in the problem hierarchy (anlogously to the authoring tool for refinement in sect.\ref{refine} on p.\pageref{refine}) --- a lot of information to be displayed appropriately in the hiearchy browser~! + +\section{The phase of solving} +This phase starts by invoking a method, which acchieves the normal form within two tactics, {\tt Rewrite rnorm\_equation\_add} and {\tt Rewrite\_Set SqRoot\_simplify}: +{\footnotesize\begin{verbatim} + ML> nxt; + val it = ("Apply_Method",Apply_Method ("SqRoot.thy","norm_univar_equation")) + : string * mstep + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val f = + Form' (FormKF (~1,EdUndef,1,Nundef,"(x + #1) * (x + #2) = x ^^^ #2 + #8")) + val nxt = + ("Rewrite", Rewrite + ("rnorm_equation_add","~ ?b =!= #0 ==> (?a = ?b) = (?a + #-1 * ?b = #0)")) + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val f = + Form' (FormKF (~1,EdUndef,1,Nundef, + "(x + #1) * (x + #2) + #-1 * (x ^^^ #2 + #8) = #0")) : mout + val nxt = ("Rewrite_Set",Rewrite_Set "SqRoot_simplify") : string * mstep + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val f = Form' (FormKF (~1,EdUndef,1,Nundef,"#-6 + #3 * x = #0")) : mout + val nxt = ("Subproblem",Subproblem ("SqRoot.thy",[#,#])) : string * mstep +\end{verbatim}}%size +Now the normal form {\tt \#-6 + \#3 * x = \#0} is the input to a subproblem, which again allows for specification of the type of equation, and the respective method: +{\footnotesize\begin{verbatim} + ML> nxt; + val it = ("Subproblem",Subproblem ("SqRoot.thy",["univariate","equation"])) + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val f = + Form' (FormKF + (~1,EdUndef,1,Nundef,"Subproblem (SqRoot.thy, [univariate, equation])")) + : mout + val nxt = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"]) + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val nxt = ("Model_Problem",Model_Problem ["linear","univariate","equation"]) +\end{verbatim}}%size +As required, the tactic {\tt Refine ["univariate","equation"]} selects the appropriate type of equation from the problem hierarchy, which can be seen by the tactic {\tt Model\_Problem ["linear","univariate","equation"]} prosed by the system. + +Again the whole phase of modeling and specification follows; we skip it here, and \isac's dialog guide may decide to do so as well. + + +\section{The final phase: check the post-condition} +The type of problems solved by \isac{} are so-called 'example construction problems' as shown above. The most characteristic point of such a problem is the post-condition. The handling of the post-condition in the given context is an open research question. + +Thus the post-condition is just mentioned, in our example for both, the problem and the subproblem: +{\footnotesize\begin{verbatim} + ML> nxt; + val it = ("Check_Postcond",Check_Postcond ["linear","univariate","equation"]) + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val f = Form' (FormKF (~1,EdUndef,1,Nundef,"[x = #2]")) : mout + val nxt = + ("Check_Postcond",Check_Postcond ["normalize","univariate","equation"]) + ML> + ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val f = Form' (FormKF (~1,EdUndef,0,Nundef,"[x = #2]")) : mout + val nxt = ("End_Proof'",End_Proof') : string * mstep +\end{verbatim}}%size +The next tactic proposed by the system, {\tt End\_Proof'} indicates that the proof has finished successfully.\\ + +{\it The tactics proposed by the system need {\em not} be followed by the user; the user is free to choose other tactics, and the system will report, if this is applicable at the respective proof state, or not~! The reader may try out~!} + + + +\part{Systematic description} + + +\chapter{The structure of the knowledge base} + +\section{Tactics and data} +First we view the ME from outside, i.e. we regard tactics and relate them to the knowledge base (KB). W.r.t. the KB we address the atomic items which have to be implemented in detail by the authors of the KB +\footnote{Some of these items are fetched by the tactics from intermediate storage within the ME, and not directly from the KB.} +. The items are listed in alphabetical order in Tab.\ref{kb-items} on p.\pageref{kb-items}. +{\begin{table}[h] +\caption{Atomic items of the KB} \label{kb-items} +%\tabcolsep=0.3mm +\begin{center} +\def\arraystretch{1.0} +\begin{tabular}{lp{9.0cm}} +abbrevation & description \\ +\hline +&\\ +{\it calc\_list} +& associationlist of the evaluation-functions {\it eval\_fn}\\ +{\it eval\_fn} +& evaluation-function for numerals and for predicates coded in SML\\ +{\it eval\_rls } +& ruleset {\it rls} for simplifying expressions with {\it eval\_fn}s\\ +{\it fmz} +& formalization, i.e. a minimal formula representation of an example \\ +{\it met} +& a method, i.e. a datastructure holding all informations for the solving phase ({\it rew\_ord}, {\it scr}, etc.)\\ +{\it metID} +& reference to a {\it met}\\ +{\it op} +& operator as key to an {\it eval\_fn} in a {\it calc\_list}\\ +{\it pbl} +& problem, i.e. a node in the problem-hierarchy\\ +{\it pblID} +& reference to a {\it pbl}\\ +{\it rew\_ord} +& rewrite-order\\ +{\it rls} +& ruleset, i.e. a datastructure holding theorems {\it thm} and operators {\it op} for simplification (with a {\it rew\_ord})\\ +{\it Rrls} +& ruleset for 'reverse rewriting' (an \isac-technique generating stepwise rewriting, e.g. for cancelling fractions)\\ +{\it scr} +& script describing algorithms by tactics, part of a {\it met} \\ +{\it norm\_rls} +& special ruleset calculating a normalform, associated with a {\it thy}\\ +{\it spec} +& specification, i.e. a tripel ({\it thyID, pblID, metID})\\ +{\it subs} +& substitution, i.e. a list of variable-value-pairs\\ +{\it term} +& Isabelle term, i.e. a formula\\ +{\it thm} +& theorem\\ +{\it thy} +& theory\\ +{\it thyID} +& reference to a {\it thy} \\ +\end{tabular}\end{center}\end{table} +} +The relations between tactics and data items are shown in Tab.\ref{tac-kb}on p.\pageref{tac-kb}. +{\def\arraystretch{1.2} +\begin{table}[h] +\caption{Which tactic uses which KB's item~?} \label{tac-kb} +\tabcolsep=0.3mm +\begin{center} +\begin{tabular}{|ll||cccc|ccc|cccc|} \hline +tactic &input & & & &norm\_& &rew\_&rls &eval\_&eval\_&calc\_& \\ + & &thy &scr &Rrls&rls &thm &ord &Rrls&fn &rls &list &dsc\\ +\hline\hline +Init\_Proof + &fmz & x & & & x & & & & & & & x \\ + &spec & & & & & & & & & & & \\ +\hline +\multicolumn{13}{|l|}{model phase}\\ +\hline +Add\_* &term & x & & & x & & & & & & & x \\ +FormFK &model & x & & & x & & & & & & & x \\ +\hline +\multicolumn{13}{|l|}{specify phase}\\ +\hline +Specify\_Theory + &thyID & x & & & x & & & & x & x & & x \\ +Specify\_Problem + &pblID & x & & & x & & & & x & x & & x \\ +Refine\_Problem + &pblID & x & & & x & & & & x & x & & x \\ +Specify\_Method + &metID & x & & & x & & & & x & x & & x \\ +Apply\_Method + &metID & x & x & & x & & & & x & x & & x \\ +\hline +\multicolumn{13}{|l|}{solve phase}\\ +\hline +Rewrite,\_Inst + &thm & x & x & & & x &met & & x &met & & \\ +Rewrite, Detail + &thm & x & x & & & x &rls & & x &rls & & \\ +Rewrite, Detail + &thm & x & x & & & x &Rrls & & x &Rrls & & \\ +Rewrite\_Set,\_Inst + &rls & x & x & & & & & x & x & x & & \\ +Calculate + &op & x & x & & & & & & & & x & \\ +Substitute + &subs & x & & & x & & & & & & & \\ + & & & & & & & & & & & & \\ +SubProblem + &spec & x & x & & x & & & & x & x & & x \\ + &fmz & & & & & & & & & & & \\ +\hline +\end{tabular}\end{center}\end{table} +} + +\section{\isac's theories} +\isac's theories build upon Isabelles theories for high-order-logic (HOL) up to the respective development of real numbers ({\tt HOL/Real}). Theories have a special format defined in \cite{Isa-ref} and the suffix {\tt *.thy}; usually theories are paired with SML-files having the same filename and the suffix {\tt *.ML}. + +\isac's theories represent the deductive part of \isac's knowledge base, the hierarchy of theories is structured accordingly. The {\tt *.ML}-files, however, contain {\em all} data of the other two axes of the knowledge base, the problems and the methods (without presenting their respective structure, which is done by the problem browser and the method browser, see \ref{pbt}). + +Tab.\ref{theories} on p.\pageref{theories} lists the basic theories planned to be implemented in version \isac.1. We expext the list to be expanded in the near future, actually, have a look to the theory browser~! + +The first three theories in the list do {\em not} belong to \isac's knowledge base; they are concerned with \isac's script-language for methods and listed here for completeness. +{\begin{table}[h] +\caption{Theories in \isac-version I} \label{theories} +%\tabcolsep=0.3mm +\begin{center} +\def\arraystretch{1.0} +\begin{tabular}{lp{9.0cm}} +theory & description \\ +\hline +&\\ +ListI.thy +& assigns identifiers to the functions defined in {\tt Isabelle2002/src/HOL/List.thy} and (intermediatly~?) defines some more list functions\\ +ListI.ML +& {\tt eval\_fn} for the additional list functions\\ +Tools.thy +& functions required for the evaluation of scripts\\ +Tools.ML +& the respective {\tt eval\_fn}s\\ +Script.thy +& prerequisites for scripts: types, tactics, tacticals,\\ +Script.ML +& sets of tactics and functions for internal use\\ +& \\ +\hline +& \\ +Typefix.thy +& an intermediate hack for escaping type errors\\ +Descript.thy +& {\it description}s for the formulas in {\it model}s and {\it problem}s\\ +Atools +& (re-)definition of operators; general predicates and functions for preconditions; theorems for the {\tt eval\_rls}\\ +Float +& floating point numerals\\ +Equation +& basic notions for equations and equational systems\\ +Poly +& polynomials\\ +PolyEq +& polynomial equations and equational systems \\ +Rational.thy +& additional theorems for rationals\\ +Rational.ML +& cancel, add and simplify rationals using (a generalization of) Euclids algorithm; respective reverse rulesets\\ +RatEq +& equations on rationals\\ +Root +& radicals; calculate normalform; respective reverse rulesets\\ +RootEq +& equations on roots\\ +RatRootEq +& equations on rationals and roots (i.e. on terms containing both operations)\\ +Vect +& vector analysis\\ +Trig +& trigonometriy\\ +LogExp +& logarithms and exponential functions\\ +Calculus +& nonstandard analysis\\ +Diff +& differentiation\\ +DiffApp +& applications of differentiaten (maxima-minima-problems)\\ +Test +& (old) data for the test suite\\ +Isac +& collects all \isac-theoris.\\ +\end{tabular}\end{center}\end{table} +} + + +\section{Data in {\tt *.thy}- and {\tt *.ML}-files} +As already mentioned, theories come in pairs of {\tt *.thy}- and {\tt *.ML}-files with the same respective filename. How data are distributed between the two files is shown in Tab.\ref{thy-ML} on p.\pageref{thy-ML}. +{\begin{table}[h] +\caption{Data in {\tt *.thy}- and {\tt *.ML}-files} \label{thy-ML} +\tabcolsep=2.0mm +\begin{center} +\def\arraystretch{1.0} +\begin{tabular}{llp{7.7cm}} +file & data & description \\ +\hline +& &\\ +{\tt *.thy} +& consts +& operators, predicates, functions, script-names ('{\tt Script} name \dots{\tt arguments}') +\\ +& rules +& theorems: \isac{} uses Isabelles theorems if possible; additional theorems analoguous to such existing in Isabelle get the Isabelle-identifier attached an {\it I} +\\& &\\ +{\tt *.ML} +& {\tt theory' :=} +& the theory defined by the actual {\tt *.thy}-file is made accessible to \isac +\\ +& {\tt eval\_fn} +& evaluation function for operators and predicates, coded on the meta-level (SML); the identifier of such a function is a combination of the keyword {\tt eval\_} with the identifier of the function as defined in {\tt *.thy} +\\ +& {\tt *\_simplify} +& the canonical simplifier for the actual theory, i.e. the identifier for this ruleset is a combination of the theories identifier and the keyword {\tt *\_simplify} +\\ +& {\tt norm\_rls :=} +& the canonical simplifier {\tt *\_simplify} is stored such that it is accessible for \isac +\\ +& {\tt rew\_ord' :=} +& the same for rewrite orders, if needed outside of one particular ruleset +\\ +& {\tt ruleset' :=} +& the same for rulesets (ordinary rulesets, reverse rulesets and {\tt eval\_rls}) +\\ +& {\tt calc\_list :=} +& the same for {\tt eval\_fn}s, if needed outside of one particular ruleset (e.g. for a tactic {\tt Calculate} in a script) +\\ +& {\tt store\_pbl} +& problems defined within this {\tt *.ML}-file are made accessible for \isac +\\ +& {\tt methods :=} +& methods defined within this {\tt *.ML}-file are made accessible for \isac +\\ +\end{tabular}\end{center}\end{table} +} +The order of the data-items within the theories should adhere to the order given in this list. + +\section{Formal description of the problem-hierarchy} +%for Richard Lang + +\section{Script tactics} +The tactics actually promote the calculation: they construct the prooftree behind the scenes, and they are the points during evaluation where the script-interpreter transfers control to the user. Here we only describe the sytax of the tactics; the semantics is described on p.\pageref{user-tactics} below in context with the tactics the student uses ('user-tactics'): there is a 1-to-1 correspondence between user-tactics and script-tactics. + + + + + +\part{Authoring on the knowledge} + + +\section{Add a theorem} +\section{Define and add a problem} +\section{Define and add a predicate} +\section{Define and add a method} +\section{} +\section{} +\section{} +\section{} + + + +\newpage +\bibliography{bib/isac,bib/from-theses} + +\end{document} \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/mat-eng.sml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/mat-eng.sml Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,519 @@ +(* cut and paste for math.tex +*) + +(*2.2. *) +"a + b * 3"; +str2term "a + b * 3"; +val term = str2term "a + b * 3"; +atomt term; +atomty term; + +(*2.3. Theories and parsing*) + + > Isac.thy; +val it = + {ProtoPure, CPure, HOL, Set, Typedef, Fun, Product_Type, Lfp, Gfp, + Sum_Type, Relation, Record, Inductive, Transitive_Closure, + Wellfounded_Recursion, NatDef, Nat, NatArith, Divides, Power, + SetInterval, Finite_Set, Equiv, IntDef, Int, Datatype_Universe, + Datatype, Numeral, Bin, IntArith, Wellfounded_Relations, Recdef, IntDiv, + IntPower, NatBin, NatSimprocs, Relation_Power, PreList, List, Map, + Hilbert_Choice, Main, Lubs, PNat, PRat, PReal, RealDef, RealOrd, + RealInt, RealBin, RealArith0, RealArith, RComplete, RealAbs, RealPow, + Ring_and_Field, Complex_Numbers, Real, ListG, Tools, Script, Typefix, + Float, ComplexI, Descript, Atools, Simplify, Poly, Rational, PolyMinus, + Equation, LinEq, Root, RootEq, RatEq, RootRat, RootRatEq, PolyEq, Vect, + Calculus, Trig, LogExp, Diff, DiffApp, Integrate, EqSystem, Biegelinie, + AlgEin, Test, Isac} : Theory.theory + +Group.thy +suche nach '*' Link: http://www.cl.cam.ac.uk/research/hvg/Isabelle/dist/library/HOL/Groups.html +locale semigroup = + fixes f :: "'a => 'a => 'a" (infixl "*" 70) + assumes assoc [ac_simps]: "a * b * c = a * (b * c)" + +> parse; +val it = fn : Theory.theory -> string -> Thm.cterm Library.option + + + +> (*-1-*); +> parse HOL.thy "2^^^3"; +*** Inner lexical error at: "^^^3" +val it = None : Thm.cterm Library.option +> (*-2-*); +> parse HOL.thy "d_d x (a + x)"; +val it = None : Thm.cterm Library.option +> (*-3-*); +> parse Rational.thy "2^^^3"; +val it = Some "2 ^^^ 3" : Thm.cterm Library.option +> (*-4-*); +val Some t4 = parse Rational.thy "d_d x (a + x)"; +val t4 = "d_d x (a + x)" : Thm.cterm +> (*-5-*); +val Some t5 = parse Diff.thy "d_d x (a + x)"; +val t5 = "d_d x (a + x)" : Thm.cterm + + +> term_of; +val it = fn : Thm.cterm -> Term.term +> term_of t4; +val it = + Free ("d_d", "[RealDef.real, RealDef.real] => RealDef.real") $ + Free ("x", "RealDef.real") $ + (Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $ + Free ("a", "RealDef.real") $ Free ("x", "RealDef.real")) +: Term.term +> term_of t5; +val it = + Const ("Diff.d_d", "[RealDef.real, RealDef.real] => RealDef.real") $ + Free ("x", "RealDef.real") $ + (Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $ + Free ("a", "RealDef.real") $ Free ("x", "RealDef.real")) +: Term.term + +> print_depth; +val it = fn : int -> unit + + + + + +> (*-4-*) val thy = Rational.thy; +val thy = + {ProtoPure, CPure, HOL, Set, Typedef, Fun, Product_Type, Lfp, Gfp, + Sum_Type, Relation, Record, Inductive, Transitive_Closure, + Wellfounded_Recursion, NatDef, Nat, NatArith, Divides, Power, + SetInterval, Finite_Set, Equiv, IntDef, Int, Datatype_Universe, + Datatype, Numeral, Bin, IntArith, Wellfounded_Relations, Recdef, IntDiv, + IntPower, NatBin, NatSimprocs, Relation_Power, PreList, List, Map, + Hilbert_Choice, Main, Lubs, PNat, PRat, PReal, RealDef, RealOrd, + RealInt, RealBin, RealArith0, RealArith, RComplete, RealAbs, RealPow, + Ring_and_Field, Complex_Numbers, Real, ListG, Tools, Script, Typefix, + Float, ComplexI, Descript, Atools, Simplify, Poly, Rational} +: Theory.theory +> ((atomty) o term_of o the o (parse thy)) "d_d x (a + x)"; + +*** +*** Free (d_d, [real, real] => real) +*** . Free (x, real) +*** . Const (op +, [real, real] => real) +*** . . Free (a, real) +*** . . Free (x, real) +*** + +val it = () : unit +> (*-5-*) val thy = Diff.thy; +val thy = + {ProtoPure, CPure, HOL, Set, Typedef, Fun, Product_Type, Lfp, Gfp, + Sum_Type, Relation, Record, Inductive, Transitive_Closure, + Wellfounded_Recursion, NatDef, Nat, NatArith, Divides, Power, + SetInterval, Finite_Set, Equiv, IntDef, Int, Datatype_Universe, + Datatype, Numeral, Bin, IntArith, Wellfounded_Relations, Recdef, IntDiv, + IntPower, NatBin, NatSimprocs, Relation_Power, PreList, List, Map, + Hilbert_Choice, Main, Lubs, PNat, PRat, PReal, RealDef, RealOrd, + RealInt, RealBin, RealArith0, RealArith, RComplete, RealAbs, RealPow, + Ring_and_Field, Complex_Numbers, Real, Calculus, Trig, ListG, Tools, + Script, Typefix, Float, ComplexI, Descript, Atools, Simplify, Poly, + Equation, LinEq, Root, RootEq, Rational, RatEq, RootRat, RootRatEq, + PolyEq, LogExp, Diff} : Theory.theory + +> ((atomty) o term_of o the o (parse thy)) "d_d x (a + x)"; + +*** +*** Const (Diff.d_d, [real, real] => real) +*** . Free (x, real) +*** . Const (op +, [real, real] => real) +*** . . Free (a, real) +*** . . Free (x, real) +*** + +val it = () : unit + + + +> print_depth 1; +val it = () : unit +> term_of t4; +val it = + Free ("d_d", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $ ... +: Term.term + + +> print_depth 1; +val it = () : unit +> term_of t5; +val it = + Const ("Diff.d_d", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $ + ... : Term.term + + + +-------------------------------------------ALT... +explode it; + \footnote{ + print_depth 9; + explode "a + b * 3"; + } + +(*unschoen*) + +-------------------------------------------ALT... + HOL.thy; + parse; + parse thy "a + b * 3"; + val t = (term_of o the) it; + term_of; + +(*2.3. Displaying terms*) + print_depth; + ////Compiler.Control.Print.printDepth; +? Compiler.Control.Print.printDepth:= 2; + t; + ?Compiler.Control.Print.printDepth:= 6; + t; + ?Compiler.Control.Print.printLength; + ?Compiler.Control.Print.stringDepth; + atomt; + atomt t; + atomty; + atomty thy t; +(*Give it a try: the mathematics knowledge grows*) + parse HOL.thy "2^^^3"; + parse HOL.thy "d_d x (a + x)"; + ?parse RatArith.thy "#2^^^#3"; + ?parse RatArith.thy "d_d x (a + x)"; + parse Differentiate.thy "d_d x (a + x)"; + ?parse Differentiate.thy "#2^^^#3"; +(*don't trust the string representation*) + ?val thy = RatArith.thy; + ((atomty thy) o term_of o the o (parse thy)) "d_d x (a + x)"; + ?val thy = Differentiate.thy; + ((atomty thy) o term_of o the o (parse thy)) "d_d x (a + x)"; + +(*2.4. Converting terms*) + term_of; + the; + val t = (term_of o the o (parse thy)) "a + b * 3"; + + sign_of; + cterm_of; + val ct = cterm_of (sign_of thy) t; + + Sign.string_of_term; + Sign.string_of_term (sign_of thy) t; + + string_of_cterm; + string_of_cterm ct; + +(*2.5. Theorems *) + ?theorem' := overwritel (!theorem', + [("diff_const",num_str diff_const) + ]); + +(** 3. Rewriting **) +(*3.1. The arguments for rewriting*) + HOL.thy; + "HOL.thy" : theory'; + sqrt_right; + "sqrt_right" : rew_ord'; + eval_rls; + "eval_rls" : rls'; + diff_sum; + ("diff_sum", "") : thm'; + +(*3.2. The functions for rewriting*) + rewrite_; + rewrite; + +> val thy' = "Diff.thy"; +val thy' = "Diff.thy" : string +> val ct = "d_d x (a * 3 + b)"; +val ct = "d_d x (a * 3 + b)" : string +> val thm = ("diff_sum",""); +val thm = ("diff_sum", "") : string * string +> val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true + [("bdv","x::real")] thm ct; +val ct = "d_d x (a * 3) + d_d x b" : cterm' +> val thm = ("diff_prod_const",""); +val thm = ("diff_prod_const", "") : string * string +> val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true + [("bdv","x::real")] thm ct; +val ct = "a * d_d x 3 + d_d x b" : cterm' + + + +> val thy' = "Diff.thy"; +val thy' = "Diff.thy" : string +> val ct = "d_d x (a + a * (2 + b))"; +val ct = "d_d x (a + a * (2 + b))" : string +> val thm = ("diff_sum",""); +val thm = ("diff_sum", "") : string * string +> val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true + [("bdv","x::real")] thm ct; +val ct = "d_d x a + d_d x (a * (2 + b))" : cterm' + +> val thm = ("diff_prod_const",""); +val thm = ("diff_prod_const", "") : string * string +> val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true + [("bdv","x::real")] thm ct; +val ct = "d_d x a + a * d_d x (2 + b)" : cterm' + + + +(*Give it a try: rewriting*) + val thy' = "Diff.thy"; + val ct = "d_d x (x ^^^ 2 + 3 * x + 4)"; + val thm = ("diff_sum",""); + val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true [("bdv","x::real")] thm ct; + val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true [("bdv","x::real")] thm ct; + val thm = ("diff_prod_const",""); + val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true [("bdv","x::real")] thm ct; +(*Give it a try: conditional rewriting*) + val thy' = "Isac.thy"; + val ct' = "3 * a + 2 * (a + 1)"; + val thm' = ("radd_mult_distrib2","?k * (?m + ?n) = ?k * ?m + ?k * ?n"); + (*1*) val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; + val thm' = ("radd_assoc_RS_sym","?m1 + (?n1 + ?k1) = ?m1 + ?n1 + ?k1"); + ?(*2*) val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; + ?val thm' = ("rcollect_right", + "[| ?l is_const; ?m is_const |] ==> ?l * ?n + ?m * ?n = (?l + ?m) * ?n"); + ?(*3*) val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; + ?(*4*) val Some (ct',_) = calculate thy' "plus" ct'; + ?(*5*) val Some (ct',_) = calculate thy' "times" ct'; + +(*Give it a try: functional programming*) + val thy' = "InsSort.thy"; + val ct = "sort [#1,#3,#2]" : cterm'; + + val thm = ("sort_def",""); + ?val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); + + val thm = ("foldr_rec",""); + ?val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); + + val thm = ("ins_base",""); + ?val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); + + val thm = ("foldr_rec",""); + ?val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); + + val thm = ("ins_rec",""); + ?val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); + + ?val (ct,_) = the (calculate thy' "le" ct); + + val thm = ("if_True","(if True then ?x else ?y) = ?x"); + ?val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); + +(*3.3. Variants of rewriting*) + rewrite_inst_; + rewrite_inst; + + rewrite_set_; + rewrite_set; + + rewrite_set_inst_; + rewrite_set_inst; + + toggle; + toggle trace_rewrite; + +(*3.4. Rule sets*) + sym; + rearrange_assoc; + +(*Give it a try: remove parentheses*) + ?val ct = (string_of_cterm o the o (parse RatArith.thy)) + "a + (b * (c * d) + e)"; + ?rewrite_set "RatArith.thy" "eval_rls" false "rearrange_assoc" ct; + + toggle trace_rewrite; + ?rewrite_set "RatArith.thy" "eval_rls" false "rearrange_assoc" ct; + +(*3.5. Calculate numeric constants*) + calculate; + calculate_; + + ?calc_list; + ?calculate "Isac.thy" "plus" "#1 + #2"; + ?calculate "Isac.thy" "times" "#2 * #3"; + ?calculate "Isac.thy" "power" "#2 ^^^ #3"; + ?calculate "Isac.thy" "cancel_" "#9 // #12"; + + +(** 4. Term orders **) +(*4.1. Exmpales for term orders*) + sqrt_right; + tless_true; + + val t1 = (term_of o the o (parse thy)) "(sqrt a) + b"; + val t2 = (term_of o the o (parse thy)) "b + (sqrt a)"; + ?sqrt_right false SqRoot.thy (t1, t2); + ?sqrt_right false SqRoot.thy (t2, t1); + + val t1 = (term_of o the o (parse thy)) "a + b*(sqrt c) + d"; + val t2 = (term_of o the o (parse thy)) "a + (sqrt b)*c + d"; + ?sqrt_right true SqRoot.thy (t1, t2); + +(*4.2. Ordered rewriting*) + ac_plus_times; + +(*Give it a try: polynomial (normal) form*) + val ct' = "#3 * a + b + #2 * a"; + val thm' = ("radd_commute","") : thm'; + ?val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; + val thm' = ("rdistr_right_assoc_p","") : thm'; + ?val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; + ?val Some (ct',_) = calculate thy' "plus" ct'; + + val ct' = "3 * a + b + 2 * a" : cterm'; + val thm' = ("radd_commute","") : thm'; + ?val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; + ?val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; + ?val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; + + toggle trace_rewrite; + ?rewrite_set "RatArith.thy" "eval_rls" false "ac_plus_times" ct; + + +(** 5. The hierarchy of problem types **) +(*5.1. The standard-function for 'matching'*) + matches; + + val t = (term_of o the o (parse thy)) "3 * x^^^2 = 1"; + val p = (term_of o the o (parse thy)) "a * b^^^2 = c"; + atomt p; + free2var; + val pat = free2var p; + matches thy t pat; + + val t2 = (term_of o the o (parse thy)) "x^^^2 = 1"; + matches thy t2 pat; + + val pat2 = (term_of o the o (parse thy)) "?u^^^2 = ?v"; + matches thy t2 pat2; + +(*5.2. Accessing the hierarchy*) + show_ptyps; + show_ptyps(); + get_pbt; + ?get_pbt ["squareroot", "univariate", "equation"]; + + store_pbt; + ?store_pbt + (prep_pbt SqRoot.thy + (["newtype","univariate","equation"], + [("#Given" ,["equality e_","solveFor v_","errorBound err_"]), + ("#Where" ,["contains_root (e_::bool)"]), + ("#Find" ,["solutions v_i_"]) + ], + [("SqRoot.thy","square_equation")])); + show_ptyps(); + +(*5.3. Internals of the datastructure*) +(*5.4. Match a problem with a problem type*) + ?val fmz = ["equality (#1 + #2 * x = #0)", + "solveFor x", + "solutions L"] : fmz; + match_pbl; + ?match_pbl fmz (get_pbt ["univariate","equation"]); + ?match_pbl fmz (get_pbt ["linear","univariate","equation"]); + ?match_pbl fmz (get_pbt ["squareroot","univariate","equation"]); + +(*5.5. Refine a problem specification *) + refine; + ?val fmz = ["equality (sqrt(#9+#4*x)=sqrt x + sqrt(#5+x))", + "solveFor x","errorBound (eps=#0)", + "solutions L"]; + ?refine fmz ["univariate","equation"]; + + ?val fmz = ["equality (x+#1=#2)", + "solveFor x","errorBound (eps=#0)", + "solutions L"]; + ?refine fmz ["univariate","equation"]; + + +(* 6. Do a calculational proof *) + ?val fmz = ["equality ((x+#1) * (x+#2) = x^^^#2+#8)","solveFor x", + "errorBound (eps=#0)","solutions L"]; + val spec as (dom, pbt, met) = ("SqRoot.thy",["univariate","equation"], + ("SqRoot.thy","no_met")); + +(*6.1. Initialize the calculation*) + val p = e_pos'; val c = []; + ?val (mID,m) = ("Init_Proof",Init_Proof (fmz, (dom,pbt,met))); + ?val (p,_,f,nxt,_,pt) = me (mID,m) p c EmptyPtree; + + ?Compiler.Control.Print.printDepth:=8; + ?f; + ?Compiler.Control.Print.printDepth:=4; + + ?nxt; + ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + +(*6.2. The phase of modeling*) + ?nxt; + ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + + ?Compiler.Control.Print.printDepth:=8; + ?f; + ?Compiler.Control.Print.printDepth:=4; + +(*6.3. The phase of specification*) + ?nxt; + ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + + + val nxt = ("Specify_Problem", + Specify_Problem ["polynomial","univariate","equation"]); + ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + + val nxt = ("Specify_Problem", + Specify_Problem ["linear","univariate","equation"]); + ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + ?Compiler.Control.Print.printDepth:=8;f;Compiler.Control.Print.printDepth:=4; + + val nxt = ("Refine_Problem", + Refine_Problem ["linear","univariate","equation"]); + ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + ?Compiler.Control.Print.printDepth:=9;f;Compiler.Control.Print.printDepth:=4; + + val nxt = ("Refine_Problem",Refine_Problem ["univariate","equation"]); + ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + ?Compiler.Control.Print.printDepth:=9;f;Compiler.Control.Print.printDepth:=4; + + ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + +(*6.4. The phase of solving*) + nxt; + ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + + val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + +(*6.5. The final phase: check the postcondition*) + ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + val (p,_,f,nxt,_,pt) = me nxt p [1] pt; + + + + + + diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/mlehnfeld/bib.bib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/mlehnfeld/bib.bib Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,26 @@ +@Book{Nipkow-Paulson-Wenzel:2002, + author = {Tobias Nipkow and Lawrence C. Paulson and Markus Wenzel}, + title = {{Isabelle/HOL} --- A Proof Assistant for Higher-Order Logic}, + publisher = {Springer}, + series = {LNCS}, + volume = 2283, + year = 2002} + +@Article{plmms10, + author = {Florian Haftmann and Cezary Kaliszyk and Walther Neuper}, + title = {{CTP}-based programming languages~? Considerations about an experimental design}, + journal = {ACM Communications in Computer Algebra}, + year = {2010}, + volume = {44}, + number = {1/2}, + pages = {27-41}, + doi = {10.1145/1838599.1838621} +} + +@Manual{isar-impl, + title = {The {Isabelle/Isar} Implementation}, + author = {Makarius Wenzel}, + month = {30 January}, + year = {2011}, + note = {With contributions by Florian Haftmann and Larry Paulson} +} diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/mlehnfeld/overview.odg Binary file doc-isac/mlehnfeld/overview.odg has changed diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/mlehnfeld/presentation.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/mlehnfeld/presentation.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,469 @@ +% $Header: /cvsroot/latex-beamer/latex-beamer/solutions/conference-talks/conference-ornate-20min.en.tex,v 1.7 2007/01/28 20:48:23 tantau Exp $ + +\documentclass{beamer} + +% This file is a solution template for: + +% - Talk at a conference/colloquium. +% - Talk length is about 20min. +% - Style is ornate. + + + +% Copyright 2004 by Till Tantau . +% +% In principle, this file can be redistributed and/or modified under +% the terms of the GNU Public License, version 2. +% +% However, this file is supposed to be a template to be modified +% for your own needs. For this reason, if you use this file as a +% template and not specifically distribute it as part of a another +% package/program, I grant the extra permission to freely copy and +% modify this file as you see fit and even to delete this copyright +% notice. + + +\mode +{ + \usetheme{Hannover} + % or ... + + \setbeamercovered{transparent} + % or whatever (possibly just delete it) +} + +%\usepackage{setspace} %for "\begin{onehalfspace}" +\usepackage[english]{babel} +% or whatever + +\usepackage[utf8]{inputenc} +% or whatever + +\usepackage{times} +\usepackage[T1]{fontenc} +% Or whatever. Note that the encoding and the font should match. If T1 +% does not look nice, try deleting the line with the fontenc. + +\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} +\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} + +\title[\isac: Computation \& Deduction] % (optional, use only with long paper titles) +{Integrating Computation and Deduction\\ + in the \isac-System} + +\subtitle{Projektpraktikum: Introducing Isabelle's Contexts} + +\author[Lehnfeld] % (optional, use only with lots of authors) +{Mathias~Lehnfeld} +% - Give the names in the same order as the appear in the paper. +% - Use the \inst{?} command only if the authors have different +% affiliation. + +\institute % (optional, but mostly needed) +{ + Vienna University of Technology\\ + Institute of Computer Languages +} +% - Use the \inst command only if there are several affiliations. +% - Keep it simple, no one is interested in your street address. + +% \date[CFP 2003] % (optional, should be abbreviation of conference name) +% {Conference on Fabulous Presentations, 2003} +% - Either use conference name or its abbreviation. +% - Not really informative to the audience, more for people (including +% yourself) who are reading the slides online + +% \subject{Theoretical Computer Science} +% This is only inserted into the PDF information catalog. Can be left +% out. + + + +% If you have a file called "university-logo-filename.xxx", where xxx +% is a graphic format that can be processed by latex or pdflatex, +% resp., then you can add a logo as follows: + +% \pgfdeclareimage[height=0.5cm]{university-logo}{university-logo-filename} +% \logo{\pgfuseimage{university-logo}} + + + +% Delete this, if you do not want the table of contents to pop up at +% the beginning of each subsection: +\AtBeginSubsection[] +{ + \begin{frame}{Outline} + \tableofcontents[currentsection,currentsubsection] + \end{frame} +} + + +% If you wish to uncover everything in a step-wise fashion, uncomment +% the following command: + +%\beamerdefaultoverlayspecification{<+->} + + +\begin{document} + +\begin{frame} + \titlepage +\end{frame} + +\begin{frame}{Outline} + \tableofcontents + % You might wish to add the option [pausesections] +\end{frame} + + +% Structuring a talk is a difficult task and the following structure +% may not be suitable. Here are some rules that apply for this +% solution: + +% - Exactly two or three sections (other than the summary). +% - At *most* three subsections per section. +% - Talk about 30s to 2min per frame. So there should be between about +% 15 and 30 frames, all told. + +% - A conference audience is likely to know very little of what you +% are going to talk about. So *simplify*! +% - In a 20min talk, getting the main ideas across is hard +% enough. Leave out details, even if it means being less precise than +% you think necessary. +% - If you omit details that are vital to the proof/implementation, +% just say so once. Everybody will be happy with that. + +\section[Introduction]{Introduction: Isabelle and \isac} +%\subsection[Isabelle \& \isac]{Isabelle and \isac} +\begin{frame} + \frametitle{Isabelle and \isac} +The task of this ``Projektpraktikum'' (6 ECTS) was to +\begin{itemize} +\item study the concept of ``context'' in the theorem prover \textbf{Isabelle} from TU Munich +\item study basic concepts of the math assistant \sisac{} from TU Graz +\pause +\item redesign \sisac{} with respect to contexts + \begin{itemize} + \item use contexts for type inference of user input + \item handle preconditions of specifications + \item clarify the transfer of context data from sub-programs to the calling program + \end{itemize} +\pause +\item introduce contexts to \sisac{} according to the new design +\item use the coding standards of Isabelle2011 for new code. +\end{itemize} +\end{frame} + +%\subsection[Computation \& Deduction]{Computation and Deduction in a Lucas-Interpreter} +\begin{frame} + \frametitle{Computation and Deduction in a Lucas-Interpreter} + \includegraphics[width=100mm]{overview.pdf} +\end{frame} + +\section[Contributions]{Contributions of the project to \isac} +\subsection[Contexts]{Isabelle's Contexts, advantages and use} +\begin{frame} + \frametitle{Advantages of Isabelle's Contexts} +Isabelle's context replaced theories because \dots: +\begin{itemize} +\item theories are static containers of \textit{all} logical data +\item contexts are \textit{dynamic} containers of logical data: + \begin{itemize} + \item functions for storing and retrieving various logical data + \item functions for type inference + \item provide data for Isabelle's automated provers + \end{itemize} +%\item e.g. theories have no direct functions for type inference +%\item replace function \texttt{parseNEW} +%\item assumptions \& environment $\rightarrow$ context +\item allow to conform with scopes for subprograms. +\end{itemize} +\end{frame} + +\begin{frame} + \frametitle{Isabelle's context mechanism} + \texttt{\small{ + \begin{tabbing} +xx\=xx\=in\=\kill +%xx\=xx\=xx\=xx\=\kill +%datatype Isac\_Ctxt =\\ +%\>\>Env of term * term\\ +%\>| Asm of term;\\ +%\\ +structure ContextData = \alert{Proof\_Data}\\ +\>~(\alert{type T} = term list\\ +\>\>\alert{fun init \_} = []);\\ +\\ +%local\\ +%\>fun insert\_ctxt data = ContextData\alert{.map} (fn xs => distinct (data@xs));\\ +%in\\ +%\>fun insert\_assumptions asms = map (fn t => Asm t) asms |> insert\_ctxt;\\ +%\>fun insert\_environments envs = map (fn t => Env t) envs |> insert\_ctxt;\\ +%end\\ +fun insert\_assumptions asms = \\ +\>\>\>ContextData\alert{.map} (fn xs => distinct (asms@xs));\\ +\\ +%local\\ +%\>fun unpack\_asms (Asm t::ts) = t::(unpack\_asms ts)\\ +%\>\>| unpack\_asms (Env \_::ts) = unpack\_asms ts\\ +%\>\>| unpack\_asms [] = [];\\ +%\>fun unpack\_envs (Env t::ts) = t::(unpack\_envs ts)\\ +%\>\>| unpack\_envs (Asm \_::ts) = unpack\_envs ts\\ +%\>\>| unpack\_envs [] = [];\\ +%in\\ +%\>fun get\_assumptions ctxt = ContextData.get ctxt |> unpack\_asms;\\ +%\>fun get\_environments ctxt = ContextData.get ctxt |> unpack\_envs;\\ +%end +fun get\_assumptions ctxt = ContextData\alert{.get} ctxt;\\ +\\ +\\ +val declare\_constraints : \\ +\>\>\>term -> Proof.context -> Proof.context + \end{tabbing} + }} +\end{frame} + +\begin{frame} + \frametitle{Usage of Contexts} + \texttt{\footnotesize{ + \begin{tabbing} +xx\=xx\=xx\=xx\=xx\=\kill +fun transfer\_asms\_from\_to from\_ctxt to\_ctxt =\\ +\> let\\ +\>\> val to\_vars = get\_assumptions to\_ctxt |> map vars |> flat\\ +\>\> fun transfer [] to\_ctxt = to\_ctxt\\ +\>\>\> | transfer (from\_asm::fas) to\_ctxt =\\ +\>\>\>\>\> if inter op = (vars from\_asm) to\_vars = []\\ +\>\>\>\>\> then transfer fas to\_ctxt\\ +\>\>\>\>\> else transfer fas (insert\_assumptions [from\_asm] to\_ctxt)\\ +\> in transfer (get\_assumptions from\_ctxt) to\_ctxt end\\ +\\ +fun parse thy str =\\ +\>(let val t = (\alert{typ\_a2real} o numbers\_to\_string)\\ +\>\>\>\>(\alert{Syntax.read\_term\_global thy} str)\\ +\>\>in SOME (cterm\_of thy t) end)\\ +\>\>\>handle \_ => NONE;\\ +\\ +fun parseNEW ctxt str = \\ +\>\>\>SOME (\alert{Syntax.read\_term ctxt} str |> numbers\_to\_string)\\ +\>\>\>handle \_ => NONE; + \end{tabbing} + }} + + +\end{frame} + +\subsection[Redesign]{Redesign of \isac{} using contexts} +\begin{frame} + \frametitle{Redesign of \isac{} using contexts} +\begin{center} DEMO \end{center} +\end{frame} + +\begin{frame} + \frametitle{Deduction simplifies computation} +\small{ +%\begin{onehalfspace} +\begin{tabbing} +xxx\=xxx\=\kill + \`$\mathit{(some)}\;\mathit{assumptions}$\\ +$\mathit{solve}\;(\frac{x}{x ^ 2 - 6 * x + 9} - \frac{1}{x ^ 2 - 3 * x} = \frac{1}{x}, x)$\\ +% \`$x ^ 2 - 6 * x + 9\not=0\land x ^ 2 - 3 * x\not=0$\\ +%\>$\frac{x}{x ^ 2 - 6 * x + 9} - \frac{1}{x ^ 2 - 3 * x} = \frac{1}{x}$ \\ \\ +%\>$\frac{x}{x ^ 2 + -1 * (6 * x) + 9} + \frac{-1 * 1}{x ^ 2 + -1 * (3 * x)} = \frac{1}{x}$ \\ \\ +\>$\frac{3 + -1 * x + x ^ 2}{9 * x + -6 * x ^ 2 + x ^ 3} = \frac{1}{x}$ \\ + \`$x\not=3\land x\not=0$\\ +\>$(3 + -1 * x + x ^ 2) * x = 1 * (9 * x + -6 * x ^ 2 + x ^ 3)$ \\ +\>$\mathit{solve}\;((3 + -1 * x + x ^ 2) * x = 1 * (9 * x + -6 * x ^ 2 + x ^ 3), x)$ \\ +%\>\>$(3 + -1 * x + x ^ 2) * x = 1 * (9 * x + -6 * x ^ 2 + x ^ 3)$ \\ +%\>\>$(3 + -1 * x + x ^ 2) * x - 1 * (9 * x + -6 * x ^ 2 + x ^ 3) = 0$ \\ +\>\>$(3 + -1 * x + x ^ 2) * x - (9 * x + -6 * x ^ 2 + x ^ 3) = 0$ \\ +\>\>$-6 * x + 5 * x ^ 2 = 0$ \\ +\>\>$\mathit{solve}\;(-6 * x + 5 * x ^ 2 = 0, x)$ \\ +\>\>$[x = 0, x = \frac{6}{5}]$ \\ + \`$x = 0\land x = \frac{6}{5}$\\ +\>$[\alert{x = 0}, x = \frac{6}{5}]$ \\ + \`\alert{$\mathit{Check\_Elementwise}\;\mathit{Assumptions}:x\not=0\land x = 0$}\\ +\>$[x = \frac{6}{5}]$ \\ +$[x = \frac{6}{5}]$ +\end{tabbing} +} +%\end{onehalfspace} +\end{frame} + +\begin{frame} + \frametitle{More ``deduction'', \\less ``computation''} +\footnotesize{\tt +\begin{tabbing} +xx\=xx\=xx\=xx\=xx\=xx\=\kill +Script Solve\_root\_equation (e\_e::bool) (v\_v::real) = \\ +\> (let e\_e = ((Try (Rewrite\_Set norm\_equation False)) \@\@ \\ +\>\>\> (Try (Rewrite\_Set Test\_simplify False))) e\_e; \\ +\>\> (L\_L::bool list) = \\ +\>\>\> (SubProblem (Test', \\ +\>\>\>\> [linear,univariate,equation,test]\\ +\>\>\>\> [Test,solve\_linear]) \\ +\>\>\>\> [BOOL e\_e, REAL v\_v]) \\ +\> in \alert{Check\_elementwise L\_L \{(v\_v::real). Assumptions\}})\\ +\end{tabbing} +} +\small{ +``Deductive'' part of Lucas-Interpretation relives the ``computational'' part: \alert{one statement becomes obsolete~!} +} +\end{frame} + + +\begin{frame} + \frametitle{Redesign of \isac{} using contexts} +Advantages of the redesign: +\begin{itemize} +\item type inference by \textit{local} contexts\\ +\pause + \alert{now user-input without type constraints~!} +\pause +\item consistent handling of logical data + \begin{itemize} + \item preconditions and partiality conditions in contexts + \item transfer of context data into subprograms clarified + \item transfer of context data from subprograms clarified + \end{itemize} +\pause + \alert{now some statements become obsolete.}\\ +\end{itemize} +\pause +Now Lucas-interpretation shifts efforts from ``computation'' further to ``deduction''. +\end{frame} + + + +\subsection[Code Improvement]{Improvement of functional code} +\begin{frame} + \frametitle{Improvement of functional code} + \begin{itemize} + \item \textbf{code conventions}: Isabelle2011 published coding standards first time + \item \textbf{combinators}: Isabelle2011 introduced a library containing the following combinators: +\\\vspace{0.2cm} +\tiny{\tt% + val |$>$ : 'a * ('a -$>$ 'b) -$>$ 'b\\ + val |-$>$ : ('c * 'a) * ('c -$>$ 'a -$>$ 'b) -$>$ 'b\\ + val |$>>$ : ('a * 'c) * ('a -$>$ 'b) -$>$ 'b * 'c\\ + val ||$>$ : ('c * 'a) * ('a -$>$ 'b) -$>$ 'c * 'b\\ + val ||$>>$ : ('c * 'a) * ('a -$>$ 'd * 'b) -$>$ ('c * 'd) * 'b\\ + val \#$>$ : ('a -$>$ 'b) * ('b -$>$ 'c) -$>$ 'a -$>$ 'c\\ + val \#-$>$ : ('a -$>$ 'c * 'b) * ('c -$>$ 'b -$>$ 'd) -$>$ 'a -$>$ 'd\\ + val \#$>>$ : ('a -$>$ 'c * 'b) * ('c -$>$ 'd) -$>$ 'a -$>$ 'd * 'b\\ + val \#\#$>$ : ('a -$>$ 'c * 'b) * ('b -$>$ 'd) -$>$ 'a -$>$ 'c * 'd\\ + val \#\#$>>$ : ('a -$>$ 'c * 'b) * ('b -$>$ 'e * 'd) -$>$ 'a -$>$ ('c * 'e) * 'd\\ +} + \end{itemize} +\end{frame} + +\begin{frame} + \frametitle{Example with combinators} + \texttt{\footnotesize{ + \begin{tabbing} +xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=\kill +fun prep\_ori [] \_ \_ = ([], e\_ctxt)\\ +\>| prep\_ori fmz thy pbt =\\ +\>\>\>let\\ +\>\>\>\>val ctxt = ProofContext.init\_global thy \\ +\>\>\>\>\> |> fold declare\_constraints fmz\\ +\>\>\>\>val ori = \\ +\>\>\>\>\> map (add\_field thy pbt o split\_dts o the o parseNEW ctxt) fmz\\ +\>\>\>\>\>\> |> add\_variants\\ +\>\>\>\>val maxv = map fst ori |> max\\ +\>\>\>\>val maxv = if maxv = 0 then 1 else maxv\\ +\>\>\>\>val oris = coll\_variants ori\\ +\>\>\>\>\> |> map (replace\_0 maxv |> apfst)\\ +\>\>\>\>\> |> add\_id\\ +\>\>\>\>\> |> map flattup\\ +\>\>\>in (oris, ctxt) end; + \end{tabbing} + }} +\dots which probably can be further polished. +\end{frame} + +%\subsection[Future Development]{Preparation of Future Development} +%\begin{frame} +% \frametitle{Preparation of Future Development} +% +%% "Script Solve_root_equation (e_e::bool) (v_v::real) = " ^ +%% " (let e_e = ((Try (Rewrite_Set norm_equation False)) @@ " ^ +%% " (Try (Rewrite_Set Test_simplify False))) e_e; " ^ +%% " (L_L::bool list) = " ^ +%% " (SubProblem (Test', " ^ +%% " [linear,univariate,equation,test]," ^ +%% " [Test,solve_linear]) " ^ +%% " [BOOL e_e, REAL v_v]) " ^ +%% " in Check_elementwise L_L {(v_v::real). Assumptions}) " +%\end{frame} +% +%\begin{frame} +% \frametitle{Preparation of Future Development} +% \begin{itemize} +% \item logical data for Isabelle provers in contexts +% \item \isac{} programming language more compact\\ +% $\rightarrow$ context built automatically +% \end{itemize} +%\end{frame} + + +\section[Problems]{Problems encountered in the project} +\begin{frame} + \frametitle{Problems encountered in the project} + \begin{itemize} + \item new Isabelle release in February 2011: update \sisac{} first +\pause + \item lines of code (LOC) in Isabelle and \sisac{}\\ \vspace{0.2cm} +\textit{ + \begin{tabular}{lrl} + src/ & 1700 & $\,$k LOC\\ + src/Pure/ & 70 & k LOC\\ + src/Provers/ & 8 & k LOC\\ + src/Tools/ & 800 & k LOC\\ + src/Tools/isac/ & 37 & k LOC\\ + src/Tools/isac/Knowledge & 16 & k LOC + \end{tabular} +} +\pause + \item changes scattered throughout the code ($\rightarrow$ grep) +\pause + \item documentation of Isabelle very ``technical'' (no API) +\pause + \item documentation of \sisac{} not up to date + \end{itemize} +\end{frame} + +%\begin{frame} +% \frametitle{Lines of Code} +% \begin{tabular}{lr} +% src/ & 1700 k \\ +% src/Pure/ & 70 k \\ +% src/Provers/ & 8 k \\ +% src/Tools/ & 800 k \\ +% src/Tools/isac/ & 37 k \\ +% src/Tools/isac/Knowledge & 16 k \\ +% \end{tabular} +%\end{frame} + +\section{Summary} +\begin{frame} + \frametitle{Summary} +The project succeeded in all goals: +\begin{itemize} +\item implemented Isabelle's contexts in \sisac{} such that +\item user input requires no type constraints anymore +\item consistent logical data is prepared for Isabelle's provers +\end{itemize} +\pause +The course of the project was close to the plan: +\begin{itemize} +\item faster in writing new code +\item slower in integrating the code into \sisac +\end{itemize} +\pause +The project provided essential prerequisites for further development of the Lucas-interpreter. +\end{frame} + +\end{document} + + diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/mlehnfeld/projektbericht.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/mlehnfeld/projektbericht.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,575 @@ +\documentclass[a4paper,12pt]{article} +% +\usepackage[ngerman]{babel} +\usepackage[utf8]{inputenc} +\usepackage{ngerman} +\usepackage{graphicx} +\bibliographystyle{alpha} + +\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} +\def\sisac{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} + +\begin{document} + +\title{\Large {\bf Verbindung von 'Computation' und 'Deduction' im \isac{}-System}\\~\\ + Projektpraktikum am Institut für Computersprachen,\\Technische Universit\"at Wien\\ +\vspace{0.7cm} +\large{Betreuer: Univ.-Prof. Dr. Jens Knoop}} +\author{Mathias Lehnfeld\\ + {\tt mathias.lehnfeld@gmx.at}} +%pdflatex creates an empty page 1 and the titlepage on page 2 ?!?... +%\thanks{Betreuer: Univ.-Prof. Dr. Jens Knoop, Technische Universit\"at Wien\\ +% Dr. Walther Neuper, Technische Universit\"at Graz} +\date{30. Mai 2011} +\maketitle +\clearpage +\tableofcontents +\clearpage + + +\section{Zur Aufgabenstellung} +Das \sisac{}-Projekt entwickelt einen {\it math assistant} aufbauend auf den +{\it theorem prover} Isabelle. Der Kern des \sisac{}-Systems ist ein +{\it Lucas-Interpreter}, der automatisch Benutzerführung für schrittweises +Problemlösen erzeugt: Der nächste Schritt wird von einem Programm +berechnet ({\it computation}); {\it deduction} wird gefordert, wenn der Benutzer +eine Formel eingibt (die Ableitbarkeit der Formel aus dem {\it context} ist +zu beweisen).\\ +\\ +Die Aufgabenstellung im Rahmen des Projektpraktikums besteht darin, das +in Isabelle verfügbare Konzept {\it context} in den Lucas-Interpreter +einzubauen. Dies schließt grundlegende Design-Überlegungen ein, verlangt +tiefes Eindringen in den umfangreichen Code von zwei Softwareprodukten, +{\it Isabelle} und \sisac{} und bedeutet daher Zusammenarbeit mit den jeweiligen +Entwicklerteams.\\ +\\ +Ein erfolgreicher Einbau der Isabelle-{\it context}s in den +Lucas-Interpreter wird \sisac{}s Fähigkeit, Benutzereingaben zu +interpretieren, wesentlich erweitern: {\it context}s stellen Isabelles +automatischen Beweisern die notwendigen Daten bereit. + + +\section{Planung des Projektes} +\subsection{Ist-Zustand vor dem Projekt} +Das Isabelle Konzept der {\it context}s findet derzeit in \sisac{} noch keine Verwendung. Dadurch entstehen gewisse Einschränkungen bezüglich der Interpretation durch den Lucas-Interpreter, weil Rechenschritte nicht unter Berücksichtigung aller Faktoren ihres Kontexts betrachtet werden können. Derzeit werden Zusicherungen und Umgebungsdaten in einer \sisac{}-spezifischen Datenstruktur verwaltet, die Zugriffe auf Isabelles Prover nicht direkt unterstützen. + +\subsection{Geplanter Soll-Zustand nach dem Projekt} +\sisac{}s Lucas-Interpreter ist nun schlanker und nimmt Isabelles {\it context}s bei der Interpretation von Benutzereingaben in Anspruch. Spezifikationen werden mit Isabelles eigenen Datenstrukturen verwaltet. Zusicherungen und Typen von Variablen werden im Lucas-Interpreter in {\it context}s behandelt. + +\subsection{Zeitplanung f\"ur das Projekt} +Die Planung f\"ur das Projekt sah folgende Meilensteine vor (Details siehe \ref{ms-desc}): +\begin{enumerate} +\item \textbf{Voraussetzungen zum Arbeitsbeginn schaffen} (10.02. -- 18.02.) + %Beschreibung siehe \ref{ms1_desc} +\item \textbf{\isac{} auf die letzte Isabelle-Release updaten} (21.02. -- 25.02.) + %Beschreibung siehe \ref{ms2_desc} +\item \textbf{Parsen aus \textit{contexts}} (28.02. -- 04.03.) + %Beschreibung siehe \ref{ms3_desc} +\item \textbf{Spezifikationsphase mit \textit{context}s} (07.03. -- 11.03.) + %Beschreibung siehe \ref{ms4_desc} +\item \textbf{L\"osungsphase mit \textit{context}s} (14.03. -- 18.03.) + %Beschreibung siehe \ref{ms5_desc} +\end{enumerate} + +\section{Konzepte und L\"osungen} +\subsection{Architektur von \isac} +Die Grafik auf Seite \pageref{architektur} gibt einen \"Uberblick \"uber die Architektur von \sisac: + +\begin{figure} [htb] +\begin{center} + \includegraphics[width=120mm]{overview.pdf} +\end{center} +\caption{Lucas-interpreter und Isabelle} +\label{architektur} +\end{figure} +Die Mathematik-Engine von \sisac{} ist nach dem Konzept eines ``Lucas-Interpreters'' (LI) gebaut. Ein LI interpretiert drei Arten von Daten: +\begin{enumerate} +\item\label{spec}\textbf{Spezifikationen}: diese beschreiben ein Problem der angewandten Mathematik durch die Ein- und Ausgabedaten, die ``precondition'' (Pr\"adikate auf den Eingabedaten) und eine ``postcondition'' (eine Relation zwischen Ein- und Ausgabedaten). Spezifikationen stellen den \textit{applikations-orientierten} Aspekt der Mathematik dar. +\item \textbf{Programme}: beschreiben den Algorithmus zur L\"osung des spezifizierten Problems. \sisac's Programmsprache ist funktional und hat keine Ein- oder Ausgabe-Statements \cite{plmms10}. Sie kann aber auf Funktionalit\"aten des Computer Theorem Provers (CTP) Isabelle \cite{Nipkow-Paulson-Wenzel:2002} zugreifen. Programme stellen den \textit{algorithmischen} Aspekt der Mathematik dar. +\item \textbf{Theorien}: beinhalten die Definitionen, Axiome und Theoreme, die einer bestimmten Rechnung der angewandten Mathematik zugrundeliegen. \sisac{} verwendet die ``theories'' von Isabelle in vollem Umfang. Theorien stellen den \textit{deduktiven} Aspekt der Mathematik dar. +\end{enumerate} + +Die Funktionalit\"at eines LI kann in kurzer Form durch die folgenden drei Anspr\"uche erkl\"art werden\footnote{siehe http://www.ist.tugraz.at/isac/index.php/Description}: + +\begin{enumerate} +\item \textbf{Benutzereingaben pr\"ufen}: Benutzereingaben sollen so gro\3z\"ugig wie m\"oglich verarbeitet werden. Bei einem gegebenen Problem aus der angewandten Mathematik als formale Spezifikation, wird mit den jeweiligen ``preconditions'' ein ``context'' erzeugt. Nun kann ein Isabelle ``prover'' die Ableitbarkeit einer Benutzereingabe aus dem ``context'' \"uberpr\"ufen. Der ``context'' wird Schritt f\"ur Schritt durch Benutzereingaben erweitert, bis ein Ergebnis vorliegt, das beweisbar die ``postcondition'' aus der Spezifikation erf\"ullt. +\item \textbf{Den Benutzer anleiten}: Wei\3 der Lernende nicht mehr weiter, so kann das System den n\"achsten Schritt vorschlagen und den Benutzer so Schritt f\"ur Schritt zum Ergebnis f\"uhren. Ein \sisac{}-Programm wird so interpretiert, wie es bei einem Debugger passiert; die Breakpoints (i.e. Schritte) sind als bestimmte Statements im Programm definiert, die notwendigerweise zum Verlauf der Rechnung bzw. deren Aufbau geh\"oren. An den Breakpoints kann der Benutzer frei entscheiden, ob er den n\"achsten Schritt generieren lassen m\"ochte oder ob er versucht, selbst weiter zu rechnen. Die Herausforderung f\"ur den \textit{Lucas-Interpreter} ist, mit beliebigen Benutzereingaben umgehen zu k\"onnen. +\item \textbf{Schritte erkl\"aren}: Bei Interesse hat der Lernende Zugang zu dem Wissen, das f\"ur einen mechanisierten \textit{math assistant} zur L\"osung mathematischer Probleme von N\"oten ist: Definitionen, Axiome und Theoreme (erfasst in ``theories''\footnote{siehe http://www.ist.tugraz.at/projects/isac/www/kbase/thy/index\_thy.html}), Spezifikationen von Problemklassen\footnote{siehe z.B. http://www.ist.tugraz.at/projects/isac/www/kbase/pbl/index\_pbl.html} und Programme, um die Probleme zu l\"osen\footnote{siehe http://www.ist.tugraz.at/projects/isac/www/kbase/met/index\_met.html}. Theoretisch ist dieses Wissen ausreichend, automatisch Erkl\"arungen f\"ur die einzelnen Schritte zu generieren. Das Hintergrundwissen liegt zwar in mathematischer Formulierung vor, es ist jedoch fraglich, wie dies in eine Form gebracht werden kann, die den Lernenden nicht \"uberfordert. +\end{enumerate} + +\subsection{Isabelles Konzept von ``contexts''} +Die Beschreibung dieses bew\"ahrten Konzeptes findet sich in einem internen Papier zur Implementierung von Isabelles Beweissprache Isar \cite{isar-impl}. Isabelle stellt einen sehr generellen Funktor zur Verf\"ugung: + +{\tt +\begin{tabbing} +xx\=xx\=in\=\kill +structure ContextData = {Proof\_Data}\\ +\>~({type T} = term list\\ +\>\>{fun init \_} = []);\\ +\\ +fun insert\_assumptions asms = \\ +\>\>\>ContextData{.map} (fn xs => distinct (asms@xs));\\ +\\ +fun get\_assumptions ctxt = ContextData{.get} ctxt;\\ +\\ +\\ +val declare\_constraints : \\ +\>\>\>term -> Proof.context -> Proof.context +\end{tabbing} +} +Das Einzige, was die Definition eines''contexts'' braucht, ist die Spezifikation eines Typs \textit{type T} und einer Funktion \textit{fun init \_} f\"ur den Funktor \textit{Proof\_Data}. Dieser stellt dann die Zugriffsfunktionen \textit{ContextData.map} und \textit{ContextData.get} zur Verf\"ugung. + +Die Funktion \textit{declare\_constraints} liefert eine wichtige Funktionalit\"at: Ein \textit{term} angewandt auf einen \textit{Proof.context} ergibt einen neuen \textit{Proof.context}, der f\"ur das Parsen von Strings verwendet werden kann: +{\tt +\begin{tabbing} +xx\=xx\=xx\=xx\=xx\=\kill +fun parseNEW ctxt str = \\ +\>\>\>SOME ({Syntax.read\_term ctxt} str |> numbers\_to\_string)\\ +\>\>\>handle \_ => NONE; + \end{tabbing} +} +\textit{Syntax.read\_term ctxt} entnimmt dem ``context'' die Typinformation, die vorher durch \textit{declare\_constraints} zugef\"uhrt wurde. Da die \textit{fun parse} vor Beginn dieses Projektes keine ``contexts'' zur Verf\"ugung hatte, setzte sie mittels \textit{typ\_a2real} einfach alle unbestimmten Typen auf \textit{real}: +{\tt +\begin{tabbing} +xx\=xx\=xx\=xx\=xx\=\kill +fun parse thy str =\\ +\>(let val t = ({typ\_a2real} o numbers\_to\_string)\\ +\>\>\>\>({Syntax.read\_term\_global thy} str)\\ +\>\>in SOME (cterm\_of thy t) end)\\ +\>\>\>handle \_ => NONE;\\ + \end{tabbing} +} + +\subsection{Die Initialisierung von ``contexts''}\label{init-ctxt} +``Contexts'' werden an zwei Stellen von Lucas-Interpretation initialisiert: am Beginn der Spezifikationsphase und zu Beginn der L\"osungsphase. + +\begin{enumerate} +\item\label{init-ctxt-spec}{Die Spezifikations-Phase} dient der Erstellung einer formalen Spezifikation (siehe \ref{spec})\footnote{Da bekannterma\3en formales Spezifizieren schwierig ist, kann es durch entsprechende Dialog-Einstellung dem LI \"uberlassen werden.}. Der ``context'' wird mittels \textit{declare\_constraints} mit den Typdeklarationen aller vorkommenden Variablen initialisiert. + +Im Falle eines Rootproblems kommen die Variablen von einer ``formalization'', einer Kurzbeschreibung der Eingabedaten durch einen Autor. Im Falle eines Subproblems kommen die Variablen von den ``actual arguments'' des Subprogrammes. + +\item\label{init-ctxt-solve}{Die L\"osungsphase} erzeugt die Rechenschritte aus dem spezifizierten Programm. Zu Beginn der Interpretation des Programmes wird der ``context'' initialisiert mit + \begin{enumerate} + \item den Typdeklarationen aller in der Spezifikation vorkommenden Variablen mittels \textit{declare\_constraints} + \item den ``preconditions'' des (interaktiv oder automatisch) spezifizierten Programmes, genauer: mit den ``preconditions'' des zugeh\"origen Guards, der meist gleich der Spezifikation ist + \end{enumerate} +\end{enumerate} + + +\subsection{Aufbau von ``contexts'' in der Interpretation}\label{partiality} +W\"ahrend der Interpretation eines Programmes baut der Lucas-Interpreter einen ``context'' auf, indem er alle relevanten ``preconditions'', andere Pr\"adikate -- insbesondere ``partiality conditions'' -- einsammelt. Eine ``partiality condition'' ist zum Beispiel $x\not=0$, die eine Division durch $0$ verhindert. + +Am Ende eines Programmes soll der ``context'' hinreichend logische Information enthalten, sodass Isabelles automatische Beweiser die ``postcondition'' automatisch beweisen k\"onnen (das ist eine k\"unftige Entwicklungsaufgabe!). + +\subsection{Transfer von ``contexts'' aus Subprogrammen}\label{transfer} +``contexts'' folgen den \"ublichen Scope-Regeln von Programmsprachen mit Blockstruktur, wie schon die Initialisierung von ``contexts'' gezeigt hat. Die Behandlung von ``contexts'' bei der R\"uckkehr aus Subprogrammen erfolgt durch folgende Funktionen: +{\tt +\begin{tabbing} +xx\=xx\=xx\=xx\=xx\=\kill +fun transfer\_asms\_from\_to from\_ctxt to\_ctxt =\\ +\> let\\ +\>\> val to\_vars = get\_assumptions to\_ctxt |> map vars |> flat\\ +\>\> fun transfer [] to\_ctxt = to\_ctxt\\ +\>\>\> | transfer (from\_asm::fas) to\_ctxt =\\ +\>\>\>\>\> if inter op = (vars from\_asm) to\_vars = []\\ +\>\>\>\>\> then transfer fas to\_ctxt\\ +\>\>\>\>\> else transfer fas (insert\_assumptions [from\_asm] to\_ctxt)\\ +\> in transfer (get\_assumptions from\_ctxt) to\_ctxt end\\ + \end{tabbing} +} +Folgende Daten werden aus dem Sub-``context'' in den ``context'' des aufrufenden Programmes zur\"uckgegeben: +\begin{enumerate} +\item die R\"uckgabewerte des Subprogrammes, sofern sie vom Typ \textit{bool} sind +\item alle \textit{assumptions}, die eine Variable enthalten, die auch einer der R\"uckgabewerte enth\"alt +\item alle \textit{assumptions}, die eine Variable enthalten, die in einem Term des aufrufenden Programmes enthalten sind\footnote{in diesem Punkt sind die Scope-Regeln schw\"acher als sonst bei Subprogrammen}. Der Unterschied begr\"undet sich darin, dass Rechnungen vorzugsweise mit Variablennamen vorgehen, die block\"ubergreifend g\"ultig sind. +\item\label{conflict} \textbf{nicht zur\"uckgegeben} werden R\"uckgabewerte des Subprogrammes dann, wenn sie im Widerspruch zum ``context'' des aufrunfenden Programmes stehen \footnote{Dieser Punkt wurde erst zu Ende der vorliegenden Arbeit gekl\"art und ist zur Zeit ihrer Fertigstellung nicht implementiert~!}. Hier ist ein Beispiel: +\end{enumerate} + +\begin{tabbing} +xxx\=xxx\=\kill + \`$\mathit{(some)}\;\mathit{assumptions}$\\ +$\mathit{solve}\;(\frac{x}{x ^ 2 - 6 * x + 9} - \frac{1}{x ^ 2 - 3 * x} = \frac{1}{x}, x)$\\ + \`$x ^ 2 - 6 * x + 9\not=0\land x ^ 2 - 3 * x\not=0$\\ +\>$\frac{x}{x ^ 2 - 6 * x + 9} - \frac{1}{x ^ 2 - 3 * x} = \frac{1}{x}$ \\ \\ +\>$\frac{x}{x ^ 2 + -1 * (6 * x) + 9} + \frac{-1 * 1}{x ^ 2 + -1 * (3 * x)} = \frac{1}{x}$ \\ \\ +\>$\frac{3 + -1 * x + x ^ 2}{9 * x + -6 * x ^ 2 + x ^ 3} = \frac{1}{x}$ \\ + \`$x\not=3\land x\not=0$\\ +\>$(3 + -1 * x + x ^ 2) * x = 1 * (9 * x + -6 * x ^ 2 + x ^ 3)$ \\ +\>$\mathit{solve}\;((3 + -1 * x + x ^ 2) * x = 1 * (9 * x + -6 * x ^ 2 + x ^ 3), x)$ \\ +\>\>$(3 + -1 * x + x ^ 2) * x = 1 * (9 * x + -6 * x ^ 2 + x ^ 3)$ \\ +\>\>$(3 + -1 * x + x ^ 2) * x - 1 * (9 * x + -6 * x ^ 2 + x ^ 3) = 0$ \\ +\>\>$(3 + -1 * x + x ^ 2) * x - (9 * x + -6 * x ^ 2 + x ^ 3) = 0$ \\ +\>\>$-6 * x + 5 * x ^ 2 = 0$ \\ +\>\>$\mathit{solve}\;(-6 * x + 5 * x ^ 2 = 0, x)$ \\ +\>\>$[x = 0, x = \frac{6}{5}]$ \\ + \`$x = 0\land x = \frac{6}{5}$\\ +\>$[{x = 0}, x = \frac{6}{5}]$ \\ + \`{$\mathit{Check\_Elementwise}\;\mathit{Assumptions}:x\not=0\land x = 0$}\\ +\>$[x = \frac{6}{5}]$ \\ +$[x = \frac{6}{5}]$ +\end{tabbing} +Aufgrund von Punkt \ref{conflict}. oben wird es m\"oglich, aus dem Programm, das obige Rechnung erzeugt, das Statement \textit{Check\_Elementwise Assumptions} zu streichen: +{\tt +\begin{tabbing} +xx\=xx\=xx\=xx\=xx\=xx\=\kill +Script Solve\_root\_equation (e\_e::bool) (v\_v::real) = \\ +\> (let e\_e = ((Try (Rewrite\_Set norm\_equation False)) \@\@ \\ +\>\>\> (Try (Rewrite\_Set Test\_simplify False))) e\_e; \\ +\>\> (L\_L::bool list) = \\ +\>\>\> (SubProblem (Test', \\ +\>\>\>\> [linear,univariate,equation,test]\\ +\>\>\>\> [Test,solve\_linear]) \\ +\>\>\>\> [BOOL e\_e, REAL v\_v]) \\ +\> in {Check\_Elementwise L\_L \{(v\_v::real). Assumptions\}})\\ +\end{tabbing} +} +Hiermit geht die Entwicklung des Konzeptes von Lucas-Interpretation einen Schritt in die begonnene Richtung weiter, die Verschiebung des Programmieraufwandes von ``computation'' (im herk\"ommlichen Programmieren) auf ``deduction'' (im Spezifizieren von Programmeigenschaften) zu unterst\"utzen. + +\subsection{\"Uberblick: ``contexts'' bei Lucas-Interpretation} + +Im Folgenden betrachten wir ein Bespiel für die Lösung einer Aufgabe durch \sisac. Die gegebenen Codeausschnitte sind nur Teile des gesamten Programmes. Der vollständige Code befindet sich in Anhang \ref{demo-code}. + +\paragraph{Formulierung der Aufgabenstellung und Spezifikation}~\\ + +Erklärung siehe \ref{init-ctxt-spec}. +\begin{verbatim} +val fmz = ["equality (x+1=(2::real))", "solveFor x", "solutions L"]; +val (dI',pI',mI') = + ("Test", ["sqroot-test","univariate","equation","test"], + ["Test","squ-equ-test-subpbl1"]); +val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))]; +\end{verbatim} +\textit{fmz} enthält also die zwei Eingabegrößen und die gesuchte Ausgabegröße, also die Liste aller Lösungen für \textit{x} in der Gleichung $x + 1 = 2$. Die zweite Zeile definiert den Namen der ``theory'' mit dem deduktiven Hintergrundwissen, die Spezifikation in Form einer Liste und das zu verwendende Programm.\\ +\textit{CalcTreeTEST} erzeugt schlie\3lich die grundlegenden Datenstrukturen für die folgenden Berechnungen. Beispielsweise wird ein ``context'' erzeugt, der nun im Baum \textit{pt} an der Position \textit{p} steht. +\begin{verbatim} +val ctxt = get_ctxt pt p; +val SOME known_x = parseNEW ctxt "x + y + z"; +val SOME unknown = parseNEW ctxt "a + b + c"; +\end{verbatim} +Dies erzeugt folgenden Output: +\begin{verbatim} +val ctxt = : Proof.context +val known_x = + Const ("Groups.plus_class.plus", + "RealDef.real => RealDef.real => RealDef.real") $ + (Const ("Groups.plus_class.plus", + "RealDef.real => RealDef.real => RealDef.real") $ + Free ("x", "RealDef.real") $ Free ("y", "RealDef.real")) $ + Free ("z", "RealDef.real"): + term +val unknown = + Const ("Groups.plus_class.plus", "'a => 'a => 'a") $ + (Const ("Groups.plus_class.plus", "'a => 'a => 'a") + $ Free ("a", "'a") $ Free ("b", "'a")) $ + Free ("c", "'a"): + term +\end{verbatim} +Der Output dieser Zeilen zeigt die neue Funktionalität anhand der Erkennung des Typs \textit{real} für die Variablen \textit{x}, \textit{y} und \textit{z} mittels Typinferenz, im Gegensatz zu den Unbekannten \textit{a}, \textit{b} und \textit{c} (unbekannter Typ \textit{'a}. + +\paragraph{Beginn der Interpretation}~\\ + +Nach einigen Schritten der Mathematik-Engine ist die Spezifikationsphase beendet und die Interpretation des Programmes kann beginnen. Die ``precondition'' ist in den Assumptions enthalten: +\begin{verbatim} +get_assumptions_ pt p |> terms2strs +\end{verbatim} +Output: +\begin{verbatim} +val it = ["precond_rootmet x"]: string list +\end{verbatim} + +\paragraph{Bearbeitung eines Subproblems}~\\ + +Einige Ausführungsschritte später startet der Interpreter mit der Gleichung $-1 + x = 0$ ein Subproblem, beginnt dort wiederum mit Spezifikationsphase und setzt mit der Lösungsphase fort.\\ +In einem Zwischenschritt bestehen die lokalen Assumptions aus der Annahme, dass die Gleichung mit der Gleichheitsregel zu matchen ist: +\begin{verbatim} +["matches (?a = ?b) (-1 + x = 0)"]: string list +\end{verbatim} +Nach künstlichem Einfügen zweier Assumptions und Beendigung des Subproblems steht eine Lösung für \textit{x} in den Assumptions:\\ +\texttt{[\dq{}matches (?a = ?b) (-1 + x = 0)\dq{}, \dq{}x < sub\_asm\_out\dq{}, \dq{}{\bf x = 1}\dq{}, \dq{}precond\_rootmet x\dq{}]: string list}\\ +\\ +Bei der Rückkehr aus dem Subproblem könnte eine erzeugte Lösung aufgrund einer Bedingungsverletzung wieder wegfallen, hier ist das nicht der Fall. Die Überprüfung dieser Bedingungen (siehe \ref{partiality}) geschieht beim Transfer des lokalen ``contexts'' in den übergeordneten (hier der des Rootproblems, siehe \ref{transfer}). + +\paragraph{Abschluss der Berechnung}~\\ + +Nach den letzten Aufrufen der Mathematik-Engine stehen alle Schritte fest: +\begin{verbatim}[ +(([], Frm), solve (x + 1 = 2, x)), +(([1], Frm), x + 1 = 2), +(([1], Res), x + 1 + -1 * 2 = 0), +(([2], Res), -1 + x = 0), +(([3], Pbl), solve (-1 + x = 0, x)), +(([3,1], Frm), -1 + x = 0), +(([3,1], Res), x = 0 + -1 * -1), +(([3,2], Res), x = 1), +(([3], Res), [x = 1]), +(([4], Res), [x = 1]), +(([], Res), [x = 1])] +\end{verbatim} + +\section{Beschreibung der Meilensteine}\label{ms-desc} +\subsection{Voraussetzungen zum Arbeitsbeginn schaffen}\label{ms1_desc} +Die Komplexit\"at \sisac{}s, welches auf Konzepten von Isabelle aufbaut und die tief ins System eingreifenden Ver\"anderungen in den bevorstehenden Meilensteinen machen eine intensive Auseinandersetzung mit Isabelle, insbesondere mit dem Konzept der ``contexts'', und dem \sisac-Code notwendig. Darunter fallen neben dem Lesen von Dokumentationen auch die gezielte Suche von Anwendungsf\"allen im bestehenden Code, sowie das Studieren von Coding Standards und ein Vertrautmachen mit den im \sisac-Team \"ublichen Workflows. + +\subsection{\isac{} auf die letzte Isabelle-Release updaten}\label{ms2_desc} +Die Arbeit mit den Isabelle {\it context}s wird Anfragen in isabelle-dev@ +erfordern. isabelle-dev@ beantwortet Fragen i.A. nur f\"ur die aktuelle +Release. Überraschenderweise wurde zwei Wochen vor Beginn des Projektpraktikums eine neue Release +veröffentlicht. Daher muss auf diese vor Arbeitsbeginn upgedatet werden. + +\subsection{Parsen aus {\it context}s}\label{ms3_desc} +Bisher nahm \sisac{} für jede Variable den Typ {\it real} an. Variablen, Terme und Pr\"adikate sollen nun beim ersten Auftreten im {\it context} eingetragen werden. User-Input wird mithilfe des {\it context}s mittels Typinferenz typgerecht geparst. Die Verwendungen der bestehenden \textit{parse}-Funktion m\"ussen im ganzen System ersetzt und angepasst werden. + +\subsection{Spezifikationsphase mit {\it context}s}\label{ms4_desc} +\sisac{} sah für die Spezifikation eine Datenstruktur vor, die interaktives Spezifizieren effizient unterstützt. Diese Datenstruktur soll nun durch {\it context}s ersetzt werden. Dadurch ist die bisherige Fixierung auf {\it real} aufgehoben und beliebige Typen werden fehlerfrei behandelt. Dieser Schritt macht weitere Eingriffe in grundlegende Funktionen und Datenstrukturen des Systems notwendig. + +\subsection{L\"osungsphase mit {\it context}s}\label{ms5_desc} +Der Lucas-Interpreter speicherte Assumptions (precondition, partiality conditions, etc.) in einer eigenen Datenstruktur im Rechenbaum. Nun sollen Assumptions im {\it context} verwaltet werden. Dazu sind Schreib- und Lesefunktionen zu implementieren und alle Verwendungen von Assumptions entsprechend anzupassen. + +\section{Bericht zum Projektverlauf} + +\subsection{Voraussetzungen zum Arbeitsbeginn schaffen} +Die Größe der Projekte {\it Isabelle} und \sisac{} sowie deren Abgrenzung haben den Weg zu meinem schließlichen Verständnis der Aufgabenstellung etwas langwierig gestaltet. Dazu kamen nicht geplante, organisatorische Vorbereitungen, wie die Erstellung einer Projektbeschreibung und des -planes. Die lange Vorbereitung hat sich aber positiv auf den weiteren Verlauf des Projektes ausgewirkt. + +\subsection{\isac{} auf die letzte Isabelle-Release updaten} +Da die Veröffentlichung der {\it Isabelle}-Version 2009-2 noch nicht lange zurück lag, kam {\it Isabelle2011} mit vielen grundlegenden Änderungen im System kurz vor Projektbeginn sehr überraschend. Die Mailingliste der Entwickler beantwortet nur Fragen zur aktuellen Release, weshalb ein entsprechendes Update von \sisac{} vor Arbeitsbeginn notwendig war.\\ +Dieser Arbeitsschritt beanspruchte wesentlich mehr Zeit als ursprünglich geplant. Als \sisac{} schließlich erfolgreich kompilierte funktionierte eine große Zahl der Tests nicht mehr. Dies machte die selbstständige Arbeit für mich vorerst unmöglich. Ich konnte jedoch in persönlicher Zusammenarbeit mit Walther Neuper meine Fähigkeiten einbringen. Die Notwendigkeit dieser persönlichen Zusammenarbeit verzögerte den Projektverlauf. + +\subsection{Parsen aus {\it context}s} +In diesem Schritt konnte ich besonders Syntax und Funktionsweise von StandardML, die praktischen, {\it Isabelle}-eigenen Operatoren und die Arbeitsweise mit der Entwicklungsumgebung kennen lernen. Dieser Meilenstein konnte in recht kurzer Zeit abgeschlossen werden. + +\subsection{Spezifikationsphase mit {\it context}s} +Hier konnte ich sehr viel selbstständig arbeiten. Zu Beginn verlief alles völlig problemlos, die Suche nach einem bestimmten Fehler beanspruchte dann aber mit Abstand die meiste Zeit, hatte jedoch zur Folge, dass ich mich sehr intensiv mit dem System auseinandersetzen musste und damit einige Kernfunktionen kennen und verstehen lernte und teilweise sogar etwas optimieren konnte. +Insgesamt verlief diese Phase trotz der langwierigen Fehlersuche nicht viel langsamer als geplant. + +\subsection{L\"osungsphase mit {\it context}s} +Die Integration von {\it context}s in die Lösungsphase zur Ersetzung der ursprünglichen behandlung von Assertions konnte in enger Zusammenarbeit mit Herrn Neuper fertiggestellt werden, persönliche Termine auf beiden Seiten verlängerten aber den zeitlichen Verlauf. Der Code des Lucas-Interpreters ist jetzt sauberer und die Logik vereinfacht. + + +\section{Abschließende Bemerkungen} +Rückblickend betrachte ich das Projektpraktikum als sehr positive Erfahrung, da ich das Gefühl habe, etwas nicht Unwesentliches zur Erweiterung von \sisac{} beigetragen zu haben. Die persönliche Zusammenarbeit mit Akademikern und auch die Verrichtung einer Arbeit, die nach Abschluss gebraucht und verwendet wird, ist eine Erfahrung, die in meinem Studium nicht selbstverständlich ist und um die ich mich sehr bemüht habe. + +Der %nicht zuletzt +durch das überraschend notwendig gewordene Update +von Isabelle2009-2 auf Isabelle2011 +bedingte zähe Verlauf bis ich endlich wirklich an der eigentlichen Aufgabenstellung arbeiten konnte, %war etwas ernüchternd, +verlange einies Umdisponieren, +da ich gehofft hatte, das Praktikum bis spätestens Ende März abschließen zu können. Die zeitliche Verzögerung des Projektes wurde jedoch durch gro\3es Entgegenkommen des Institutes in der Terminsetzung am Ende des Projektes ausgeglichen; daf\"ur bin ich Herrn Professor Knoop sehr zu Dank verpflichtet. Lehrreich war f\"ur mich auch die Einbindung der Abschlusspr\"asentation in die Vortragsreihe des Institutes f\"ur Computersprachen und dem Feedback von dort; auch daf\"ur herzlichen Dank. + +Die Zusammenarbeit mit \sisac-Entwicklung an der Technischen Universit\"at Graz \"uber Herrn Neuper hat %jedenfalls +sehr gut funktioniert und aus meiner Sicht haben wir uns sehr gut verstanden. Das hat ein produktives %entspanntes +Arbeitsklima ermöglicht. + +%Abgesehen von der zeitlichen Verzögerung des Projektes freue ich mich über den erfolgreichen Abschluss der geplanten Aufgaben und deren interessanten Charakter. + +\clearpage + +\bibliography{bib} + +\clearpage + +\appendix +%\section*{Anhang} +\section{Demobeispiel}\label{demo-code} +\begin{verbatim} + +theory All_Ctxt imports Isac begin + +text {* all changes of context are demonstrated in a mini example. + see test/../mstools.sml --- all ctxt changes in minimsubpbl x+1=2 --- *} + +section {* start of the mini example *} + +ML {* + val fmz = ["equality (x+1=(2::real))", "solveFor x", "solutions L"]; + val (dI',pI',mI') = + ("Test", ["sqroot-test","univariate","equation","test"], + ["Test","squ-equ-test-subpbl1"]); + val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))]; +*} + +section {* start of specify phase *} + +text {* variables known from formalisation provide type-inference + for further input *} + +ML {* + val ctxt = get_ctxt pt p; + val SOME known_x = parseNEW ctxt "x + y + z"; + val SOME unknown = parseNEW ctxt "a + b + c"; +*} + +ML {* + val (p,_,f,nxt,_,pt) = me nxt p [] pt; + val (p,_,f,nxt,_,pt) = me nxt p [] pt; + val (p,_,f,nxt,_,pt) = me nxt p [] pt; + val (p,_,f,nxt,_,pt) = me nxt p [] pt; + val (p,_,f,nxt,_,pt) = me nxt p [] pt; + val (p,_,f,nxt,_,pt) = me nxt p [] pt; + val (p,_,f,nxt,_,pt) = me nxt p [] pt; + val (p,_,f,nxt,_,pt) = me nxt p [] pt; +*} + +section {* start interpretation of method *} + +text {* preconditions are known at start of + interpretation of (root-)method *} + +ML {* + get_assumptions_ pt p |> terms2strs; +*} + +ML {* +val (p,_,f,nxt,_,pt) = me nxt p [] pt; +val (p,_,f,nxt,_,pt) = me nxt p [] pt; +val (p,_,f,nxt,_,pt) = me nxt p [] pt; +*} + +section {* start a subproblem: specification *} + +text {* variables known from arguments of (sub-)method + provide type-inference for further input *} + +ML {* + val ctxt = get_ctxt pt p; + val SOME known_x = parseNEW ctxt "x+y+z"; + val SOME unknown = parseNEW ctxt "a+b+c"; +*} + +ML {* + val (p,_,f,nxt,_,pt) = me nxt p [] pt; + val (p,_,f,nxt,_,pt) = me nxt p [] pt; + val (p,_,f,nxt,_,pt) = me nxt p [] pt; + val (p,_,f,nxt,_,pt) = me nxt p [] pt; + val (p,_,f,nxt,_,pt) = me nxt p [] pt; + val (p,_,f,nxt,_,pt) = me nxt p [] pt; + val (p,_,f,nxt,_,pt) = me nxt p [] pt; + val (p,_,f,nxt,_,pt) = me nxt p [] pt; +*} + +section {* interpretation of subproblem's method *} + +text {* preconds are known at start of interpretation of (sub-)method *} + +ML {* + get_assumptions_ pt p |> terms2strs +*} + +ML {* + val (p,_,f,nxt,_,pt) = me nxt p [] pt; +*} + +ML {* + "artifically inject assumptions"; + val (SOME (iform, cform), SOME (ires, cres)) = get_obj g_loc pt (fst p); + val ctxt = insert_assumptions [str2term "x < sub_asm_out", + str2term "a < sub_asm_local"] cres; + val pt = update_loc' pt (fst p) (SOME (iform, cform), SOME (ires, ctxt)); +*} + +ML {* +val (p,_,f,nxt,_,pt) = me nxt p [] pt; +val (p,_,f,nxt,_,pt) = me nxt p [] pt; +*} + +section {* finish subproblem, return to calling method*} + +text {* transfer non-local assumptions and result from sub-method + to root-method. + non-local assumptions are those contaning a variable known + in root-method. +*} + +ML {* + terms2strs (get_assumptions_ pt p); +*} + +ML {* + val (p,_,f,nxt,_,pt) = me nxt p [] pt; + val (p,_,f,nxt,_,pt) = me nxt p [] pt; +*} + +section {* finish Lucas interpretation *} + +text {* assumptions collected during lucas-interpretation + for proof of postcondition *} + +ML {* + terms2strs (get_assumptions_ pt p); +*} + +ML {* + show_pt pt; +*} + +end +\end{verbatim} + +\section{Stundenliste} + +\subsection*{Voraussetzungen zum Arbeitsbeginn schaffen} +\begin{tabular}[t]{lll} + {\bf Datum} & {\bf Stunden} & {\bf Beschreibung} \\ + 10.02.2011 & 2:00 & Besprechung der Problemstellung \\ + 11.02.2011 & 1:30 & {\it context}s studieren, Isabelle/Mercurial Installation \\ + 18.02.2011 & 0:15 & meld/tortoisehg installieren \\ + 20.02.2011 & 1:00 & Projektbeschreibung, jedit Probleme \\ + 25.02.2011 & 1:00 & Ausarbeitung Meilensteine \\ + 26.02.2011 & 1:00 & Ausarbeitung Ist-/Soll-Zustand, {\it context}s studieren\\ + 28.02.2011 & 1:15 & Einführungsbeispiel {\it context}s \\ + 28.02.2011 & 1:15 & Projektplan erstellen, formatieren \\ + 01.03.2011 & 1:00 & Projektplan überarbeiten, Stundenlisten \\ +\end{tabular} + +\subsection*{\isac{} auf die letzte Isabelle-Release updaten} +\begin{tabular}[t]{lll} + {\bf Datum} & {\bf Stunden} & {\bf Beschreibung} \\ + 18.02.2011 & 2:45 & Anpassungen an Isabelle2011 \\ + 20.02.2011 & 2:45 & Update auf Isabelle2011, Fehlersuche \\ + 21.02.2011 & 6:30 & ... \\ + 25.02.2011 & 5:30 & ... \\ + 26.02.2011 & 4:30 & ... \\ + 03.03.2011 & 5:00 & ... \\ + 04.03.2011 & 6:00 & Tests reparieren \\ +\end{tabular} + +\subsection*{Parsen aus \textit{contexts}} +\begin{tabular}[t]{lll} + {\bf Datum} & {\bf Stunden} & {\bf Beschreibung} \\ + 02.03.2011 & 1:30 & vorbereitendes Übungsbeispiel \\ + 03.03.2011 & 1:00 & ... \\ + 04.03.2011 & 5:00 & Funktion {\tt parseNEW} schreiben \\ + 05.03.2011 & 3:00 & Funktion {\tt vars} anpassen, {\tt declare\_constraints} neu \\ + 07.03.2011 & 8:45 & {\tt parseNEW}, Spezifikationen studieren \\ + 08.03.2011 & 6:00 & {\it context} in zentrale Datenstrukturen einbauen \\ + 09.03.2011 & 2:00 & Fehlersuche {\it context}-Integration \\ +\end{tabular} + +\subsection*{Spezifikationsphase mit \textit{context}s} +\begin{tabular}[t]{lll} + {\bf Datum} & {\bf Stunden} & {\bf Beschreibung} \\ + 10.03.2011 & 2:30 & {\it context} in {\tt prep\_ori} und {\tt appl\_add} einbauen\\ + 11.03.2011 & 5:45 & {\tt appl\_add} überarbeiten \\ + 12.03.2011 & 5:15 & Fehlersuche \\ + 14.03.2011 & 2:00 & ... \\ + 16.03.2011 & 2:30 & ... \\ + 17.03.2011 & 1:45 & ... \\ + 18.03.2011 & 4:45 & ..., Optimierung \\ + 19.03.2011 & 5:30 & ... \\ + 21.03.2011 & 3:00 & Abschluss Spezifikationsphase \\ +\end{tabular} + +\subsection*{L\"osungsphase mit \textit{context}s} +\begin{tabular}[t]{lll} + {\bf Datum} & {\bf Stunden} & {\bf Beschreibung} \\ + 22.03.2011 & 4:30 & {\it context} in Funktion {\tt solve} einbauen\\ + 23.03.2011 & 4:45 & Tests reparieren \\ + 24.03.2011 & 3:30 & ... \\ + 25.03.2011 & 2:00 & ... \\ + 03.04.2011 & 4:00 & ... \\ + 05.04.2011 & 8:00 & Optimierung \\ + 06.04.2011 & 7:15 & L\"osung Exponentenoperator \\ + 07.04.2011 & 7:00 & ... \\ + 12.04.2011 & 3:30 & Projektbericht \\ +\end{tabular} + +\end{document} diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/msteger/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/msteger/README Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,2 @@ +bakk-arbeit/ contains stylefiles required for Bernhard Aichernig's format. +These probably go to a shared directory. \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/msteger/bakk-arbeit/CLEANUP --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/msteger/bakk-arbeit/CLEANUP Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,10 @@ +rm *.dvi +rm *.bbl +rm *.blg +rm *.aux +rm *.log +rm *.nav +rm *.out +rm *.snm +rm *.toc +rm *~ diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/msteger/bakk-arbeit/content.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/msteger/bakk-arbeit/content.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,607 @@ +\chapter{Definition der Aufgabenstellung} +\section{Detaillierte Beschreibung der Aufgabenstellung} +Zu Beginn des Projekts wurden einige Vorgaben und Ziele des Projektes erarbeitet und im Laufe des Projekts angepasst wo notwendig. Es wurde bewusst auf eine zu einschr\"ankende Aufgabenstellung verzichtet, da Entwicklungen und Erarbeitungen von verschiedenen Umsetzungsstrategien erw\"unscht war. + +Hauptaugenmerk war dabei auf die Erstellung eines jEdit-Plugins gelegt worden, das als Vorarbeit zu Back's Structured Derivations dienen soll. Mit anderen Worten, es sollte so viel Plugin-Code, wie im begrenzten Projektzeitraum m\"oglich, implementiert werden. + +Weiters sollte eine Projektstruktur aufgebaut werden, die die Initialisierungsarbeiten von weiterf\"uhrende bzw. nachfolgende Projekten erleichtert und somit verk\"urzt. Dabei sollte darauf geachtet werden, dass die vom Isabelleteam bereits verwendete Projekthierarchie soweit wie m\"oglich \"ubernommen bzw. erweitert wird. +Die nachfolgende Auflistung soll die wichtigsten Tasks nochmals zusammenfassen: +\begin{enumerate} +\item Relevante Isabelle Komponenten identifizieren und studieren +\item Installation der Standard-Komponenten +\item Entwicklungsumgebung vom Isabelle-Team kopieren +\item Relevante Komponenten implementieren +\begin{itemize} +\item jEdit Plugin f\"ur SD +\item zugeh\"origen Parser +\item nicht vorgesehen: SD-Interpreter in Isar (SML) +\end{itemize} +\end{enumerate} +In Abs.\ref{zusammenfassung} wird r\"uckblickend zusammengefasst, welche dieser Punkte in welchem Ausma\ss{} in dieser Bachelor-Arbeit erledigt wurden. + +\chapter{Beleuchtung der Projekt-relevanten Technologien} +Dieses Kapitel soll die vielen unterschiedlichen Technologien, die im Rahmen dieser Arbeit verwendet oder zumindest ber\"uhrt wurden, beleuchten und dem Leser helfen, nachfolgende Zusammenh\"ange zu verstehen. Nat\"urlich kann in keines der folgenden Themen sehr tief eingestiegen werden. Viel mehr sollen die nachfolgenden Ausf\"uhrungen einen groben \"Uberblick \"uber die einzelnen Technologien geben. +\section{Back's Structured Derivations} +Wie in der Aufgabenstellung bereits beschrieben, war die Erstellung eines Structured Derivation Plugins das Hauptziel dieser Arbeit. Aus diesem Grund wird in diesem Absatz kurz auf die von Prof. Ralph-Johan Back einf\"uhrten Structured Derivations eingegangen und dessen Eigenschaften bzw. Zusammenh\"ange beschrieben. + +Das nachfolgende Beispiel zeigt ein einfaches Beispiel, wie eine Formel mittels SD dargestellt bzw. umgeformt werden kann: + +%{\footnotesize +\begin{tabbing} +123,\=1234\=1234\=1234\=1234\=1234\=1234\=123\=\kill +\>$\bullet$\>Simplify $(1 - x) * (x ^ 2 + 1) + x ^ 3 - x ^ 2$\\ +\> \>$(1 - x) * (x ^ 2 + 1) + x ^ 3 - x ^ 2$\\ +\>$\equiv$\>$\{ {\it RewriteSet}\;{\it purify}\}$\\ +\> \>$(1 + -1 * x) * (x ^ 2 + 1) + x ^ 3 + -1 * x ^ 2$\\ +\>$\equiv$\>$\{{\it RewriteSet}\;{\it simplify\_pure}\}$\\ +\> \>$\bullet$\>$(1 + -1 * x) * (x ^ 2 + 1) + x ^ 3 + -1 * x ^ 2$\\ +\> \>$\equiv$\>$\{{\it RewriteSet}\;{\it expand\_poly\_}\}$ \\ +\> \> \>$1 * x ^ 2 + 1 * 1 + (-1 * x * x ^ 2 + -1 * x * 1) + x ^ 3 +-1 * x ^ 2$\\ +\> \>$\equiv$\>\vdots\\ +\> \> \>$1 + -1 * x + 0 * x ^ 2 + 0 * x ^ 3$\\ +\> \>$\equiv$\>$\{{\it RewriteSet}\;{\it reduce\_012\_}\}$ \\ +\> \> \>$1 + -1 * x$\\ +\>\dots\>$1 + -1 * x$\\ +\>$\equiv$\>$\{{\it RewriteSet}\;{\it beautify}\}$\\ +\> \>$1-x$ +\end{tabbing} +%} + +Dieses Beispiel kann wie folgt interpretiert werden: +\begin{enumerate} +\item Die erste Zeile ist als Angabe bzw. Ausgangspunkt der Berechnung zu verstehen. +\item Nun folgt der eigentliche Ablauf einer Umformung mittels SD: Mit der Formel in der zweiten Zeile beginnt die Berechnung. +\item Die n\"achste Zeile gibt nun an, wie die Formel aus der direkt dar\"uberliegenden Zeile umgeformt bzw. aufbereitet wird. Es ist also eine Beschreibung bzw. die passende Rechenregel, um von der Ausgangsformel auf die nachfolgende Formel schlie{\ss}en zu k\"onnen. +\item Aus dieser Rechenvorschrift ergibt sich die Formel in der n\"achsten Zeile. +\item Dieser Ablauf wiederholt sich und zieht sich \"uber die weiteren Berechnungen. +\end{enumerate} + +Back liefert mit SD eine sehr gute Darstellungs- und Verbarbeitungs-Richtlinie, die einerseits dem Leser/Anwender hilft, da durch die Regel- bzw. Beschreibungs-Zeile klar gestellt wird, wie der letzte Berechnungsschritt durchgef\"uhrt wurde. Andererseits bringt SD auch f\"ur den Programmierer einen klaren Vorteil, da \"uber die vorgestellten Sonderzeichen das Parsen von \textit{SD-Code} vereinfacht bzw. direkt (ohne extra Schl\"usselw\"orter einf\"uhren zu m\"ussen) m\"oglich ist. + +\section{Der Texteditor jEdit}\label{jEdit} +% http://www.jedit.org/ +% http://de.wikipedia.org/wiki/JEdit +% http://www.chip.de/downloads/jEdit_19235021.html +% +jEdit ist ein in Java geschriebener und als Open-Source-Projekt erh\"altlicher Texteditor, der vor allem durch sein sehr gut entwickeltes und ebenso einfaches Plugin-Management-System sehr effektiv eingesetzt werden kann. Solche Plugins k\"{o}nnen direkt in jEdit installiert oder durch manuelles Hinzuf\"{u}gen eines Plugin-Paketes genutzt werden. Dadurch ist dieser Editor sehr flexibel in der Anwendung und kann den eigenen Bed\"{u}rfnissen perfekt angepasst werden. +Diese Umst\"ande sind wohl auch der Grund, warum sich die Entwickler von Isabelle f\"ur diesen Editor entschieden haben. Hierbei ist zu erw\"{a}hnen, dass hier eine etwas modifizierte bzw. an Isabelle angepasste Version verwendet wird. Es empfiehlt sich daher, immer die aktuelle Version des Isabelle-jEdit-Editors (zB. aus dem Bundle erh\"{a}ltlich auf der Isabelle-Homepage) zu verwenden, da hier diverse Voreinstellungen vorgenommen wurden. In weiterer Folge wird mit jEdit immer diese modifizierte Version des Editors in Verbindung gebracht, da die Verwendung der Grundversion aus oben genannten Gr\"{u}nden nicht zu empfehlen bzw. sinnvoll ist. +Weiters sollte noch erw\"ahnt werden, dass es rund um jEdit einen sehr guten Support via Mailinglist gibt und man wirklich rasch Hilfestellung bekommen kann. + +\subsection{Das Plugin-System} +% http://jedit.org/users-guide/writing-plugins-part.html +Wie im vorigen Abschnitt bereits erw\"ahnt, ist es sehr einfach und bequem m\"oglich, geeignete Plugins zu installieren bzw. zu verwenden. Es stehen bereits sehr viele verschiedenste Plugins auf der jEdit-Homepage zur Verf\"{u}gung. Diese werden ebenfalls als Open-Source-Projekte angeboten und es bietet sich daher an, bereits verf\"ugbare und funktionierende Plugins als Teil eines neuen Plugins zu verwenden und gegebenenfalls kleine Modifikationen oder Erweiterungen an den Plugins durchzuf\"{u}hren. Im Beispiel von Isabelle wurden unter anderem die Plugins \textit{Sidekick} und \textit{Konsole} verwendet. Dabei ist es m\"oglich, dass Java-Plugins mit Scala-Plugins kombiniert werden, da diese auch problemlos miteinander kommunizieren k\"{o}nnen. +jEdit bietet einen Plugin-Manager an, mit dem sich sehr einfach bereits installierte Plugins verwalten und updaten lassen und es ist auch m\"{o}glich, neue Plugins direkt zu installieren. +Weiters bietet sich die M\"oglichkeit, selbst implementierte Plugins direkt zu den bereits vorhandenen jEdit-Plugins hizuzuf\"{u}gen. Dazu muss das erzeugte "Plugin".jar Paket ledigich in den jars-Ordner verschoben werden. Beim Start von jEdit wird das neue Plugin automatisch erkannt und hinzugef\"{u}gt. Man muss aber darauf achten, dass \"{A}nderungen nur nach einem Neustart von jEdit \"{u}bernommen werden. + + +\subsection{Pluginstruktur} +Ein solches jEdit-Plugin muss nat\"{u}rlich ein gewisses Design umsetzen, um von jEdit korrekt ausgef\"{u}hrt werden zu k\"{o}nnen. Grunds\"{a}tzlich besteht ein solches Plugin aus den eigentlichen Sourcefiles und einigen XML- und Property-Datein. +Ein m\"{o}glicher Aufbau kann dem Beispiel-Plugin "QuickNotepad"\footnote{http://jedit.org/users-guide/writing-plugins-part.html}, das auf der jEdit-Homepage zu finden ist, entnommen bzw. als Ausgangspunkt f\"{u}r die Entwicklung eines eigenen Plugins herangezogen werden. Weitere Informationen k\"{o}nnen auch dem Paper "Userinterfaces for Computer Theorem Provers" entnommen werden. + +\section{Isabelle} +Isabelle ist einer der f\"{u}hrenden CTPs und an dessen Weiterentwicklung wird st\"{a}ndig gearbeitet. Der letzte gro{\ss}e Schritt betraf den Umstieg von reinem ML auf die "Mischsprache" Scala(mit funktionalen sowie imperativen Sprachanteilen). Weiters wurde der in die Jahre gekommene Proof General und der damit in Verbindung stehende Editor Emacs durch den vielseitigen Editor jEdit ersetzt. Dadurch ergeben sich auch f\"{u}r das laufende \sisac-Projekt an der TU Graz neue M\"{o}glichkeiten. Wichtig im Zusammenhang mit dieser Beschreibung ist zu erw\"{a}hnen, dass hier in weiterer Folge nur noch f\"{u}r jEdit bzw. Scala relevante Teile von Isabelle behandelt und beschrieben werden. Weiters ist wichtig zu wissen, dass f\"{u}r die bereits bestehende Struktur rund um Isablle-jEdit zwei Isabelle-Pakete zum Einsatz kommen. Auf diese Pakete soll in den n\"{a}chsten Passagen eingegangen werden. + +\subsection{Isabelle-Pure} +In diesem Plugin ist der eigentliche CTP-Teil von Isabelle verpackt. Das bedeutet im weiteren Sinn, dass es hier keine grafische Verarbeitung der Daten gibt, sondern der Zugriff von aussen erforderich ist, um den CTP mit Daten zu versorgen und diese nach deren Verabreitung in Isabelle-Pure auszuwerten. Also ist nur hier eine Schnittstelle zum eigentlichen Proofer m\"{o}glich und deshalb ist dieses Plugin f\"{u}r das \sisac-Projekt von zentraler Bedeutung. Standardm\"{a}{\ss}ig ist bereits ein Pure.jar-Paket f\"{u}r jEdit vorhanden. Um SD umsetzten zu k\"{o}nnen, muss hier eine Schnittstelle zu Isabelle-Pure implementiert werden. Nach diesem Schritt kann das Plugin Pure.jar neu gebaut werden. +Eine Auflistung der f\"ur das Isabelle-Pure-Packet ben\"otigten Scala-Source-Filles kann Anhang B.2 entnommen werden. + +\subsection{Isabelle-jEdit} +Dieser Teil von Isabelle repr\"{a}sentiert das Frontend in jEdit. Hier wird also die grafische Aufbereitung der von Isabelle-Pure berechneten Daten \"{u}bernommen. Dieses Plugin zeigt sehr sch\"{o}n, wie bereits bestehende Plugins weiter genutzt und erweitert werden k\"{o}nnen. +An diesem Plugin wird von Seiten der Isabelle-Entwickler sehr stark weitergearbeitet. Darum sollten hier wohl nicht zu viele, am besten nat\"{u}rlich keine \"{A}nderungen, vorgenommen werden. Der Umstand, dass sich einzelne Plugins ganz einfach in einem anderen mitverwenden lassen, macht es m\"{o}glich, dass das \sisac-Plugin sehr einfach, im Idealfall von Seiten der Isabelle-Entwickler, in das Isabelle-jEdit-Plugin integriert werden kann. + +\subsection{Paketstruktur von Isabelle} +Durch die Komplexit\"{a}t des Isabelle-Entwicklungs-Aufbaus soll hier eine Auflistung aller relevanten jar-Pakete erfolgen. Alle Pakete befinden sich innerhalb der Ordnerstruktur von ISABELLE\_HOME. Darum wird ab hier immer von diesem Verzeichnis ausgegangen. +Die nachfolgende Auflistung zeigt alle Pakete, die f\"{u}r SD bzw. {\sisac} von Bedeutung sind und und wo diese zu finden sind. + + +\begin{itemize} +\item \textit{contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars:} \textbf{Isabelle-jEdit.jar, Pure.jar, SideKick.jar, ...} Der Ordner contrib ist in der Repository-Version nicht vorhanden! Dieser kann dem Isabelle-Bundle entnommen werden. Hier befinden sich alle ben\"{o}tigten Zusatztools f\"{u}r Isabelle und darunter eben auch jEdit. In dem oben angef\"{u}hrten Ordner liegen alle Plugins bzw. dorthin werden alle Plugins kopiert, die zusammen mit jEdit gestartet werden sollen. +\item \textit{lib/classes:} \textbf{isabelle-scala.jar, pure.jar;} Standardm\"{a}{\ss}ig ist dieser Ordner nicht vorhanden. Erst durch Erzeugen der angef\"{u}hrten jar's werden dieser Ordner und die Pakete erstellt. +\item \textit{src/Tools/jEdit/dist/jars:} \textbf{Isabelle-jEdit.jar, Pure.jar, SideKick.jar, jedit.jar, ...} +\item \textit{src/Tools/jEditC/dist/jars:} \textbf{Isabelle-jEdit.jar, Pure.jar, SideKick.jar, jedit.jar, ...} Diese beiden obigen Verzeichnisse sind, wie man an der sehr \"{a}hnlichen Pfadstruktur erkennen kann, \"{a}quivalent, wobei der zweite Pfad zum \sisac-Entwicklungsverzeichnis geh\"{o}rt. Hier sind die f\"{u}r das Isabelle-jEdit- bzw. \sisac-Plugin ben\"{o}tigten Plugins und Pakete plus das erzeugte Plugin zu finden. +\item \textit{src/Tools/jEditC/contrib/jEdit/build/jars:} \textbf{Isabelle-jEdit.jar, Pure.jar, SideKick.jar, jedit.jar, ...} Diesen Aufbau ben\"{o}tigt man nur, wenn man das jEdit-Isac-Projekt direkt in NetBeans debuggen m\"{o}chte. Man erkennt, dass in diesem Verzeichnis der vollst\"{a}ndige Quellcode von jEdit plus allen Plugins, die zusammen mit jEdit gestartet werden sollen, hier zu finden sind. Wie aber bereits erw\"{a}hnt, ist vom direkten Debuggen generell abzuraten bzw. sollte dies nur f\"ur schwer nachvollziebare Abl\"aufe ohne Isabelle-Beteiligung angewendet werden. +\end{itemize} + +Siehe dazu auch Anhang B. Dort sind alle relevanten jar-Pakete noch einmal aufgelistet und entsprechend gruppiert. + +\section{Die Programmiersprache Scala} +Urspr\"{u}nglich wurde Isabelle rein in ML entwickelt. Erst vor ein paar Jahren wurde mit der \"{U}bersetzung von einigen Teilen in Scala begonnen. Grund genug, sich hier kurz diese neue und sehr vielseitige Sprache etwas genauer anzusehen. + +\subsection{Grundlage der Sprache} +Scala \cite{odersky:scala06} ist eine objektorientierte Sprache, die sehr \"{a}hnlich zu Java aufgebaut wurde. Dadurch wird die Einarbeitung in diese Programmiersprache f\"{u}r Java-Programmierer sehr vereinfacht. Neben den Vorteilen einer objektorientierten Sprache deckt Scala aber auch die Bed\"{u}rfnisse der funktionalen Programmierung \cite{pl:milner97} ab. Dies, und vorallem auch das von Erlang \cite{armstrong:erlang96} \"ubernommene und sehr gut umgesetzte Actorprinzip \cite{Haller:2009:SAU:1496391.1496422,scala:jmlc06}, sind wohl die Hauptgr\"unde, warum sich das Isabelle-Entwicklungsteam f\"{u}r diese Sprache entschieden hat. Wie bereits erw\"{a}hnt, ist Scala sehr \"{a}hnlich aufgebaut wie Java und hat nebenbei noch den gro{\ss}en Vorteil, dass Scala-Executables in der JVM (Java virtual Machine) ausf\"{u}hrbar sind. Dadurch ist die Plattformunabh\"{a}ngigkeit garantiert und es besteht ein direkter Zusammenhang zwischen Scala und Java der auch bei der jEdit-Plugin-Entwicklung ausgenutzt bzw. verwendet wird. + +Dieser direkte Zusammenhang zwischen Java und Scala soll anhand der Grafik-Bibliotheken Swing gezeigt bzw. die Vorteile, die daraus resultieren, beleuchtet werden. + +Beide Sprachen stellen diese Grafik-Bibliotheken zur Verf\"{u}gung (und darin auch eigene Shapes und Funktionalit\"{a}t). Es ist jedoch m\"{o}glich, Java-Bibliotheken, wie eben Java-Swing in Scala zu verwenden. Ein JButton(Java) kann zum Beispiel mittels \textit{import javax.swing.JButton} in Scala eingebunden und damit sofort verwendet werden. Auch Scala stellt in seiner Swing-Bibliothek einen Button zur Verf\"{u}gung: \textit{scala.swing.Button}. Es wird nahezu dieselbe Funktionalit\"{a}t angeboten und teilweise die Erzeugung bzw. Verwendung vereinfacht. Man kann sich nun fragen, warum sich die Scala-Entwickler einerseits die M\"{u}he gemacht haben, die Verwendung Java-Swing, wie in Java selbst, m\"{o}glich zu machen und andererseits mit Scala-Swing eine nahezu idente Alternative geschaffen haben. + +Die Antwort darauf zeigt, wie die Objektorientiertheit von Scala in vielen Bereichen ausgenutzt wurde, um die Sprache mit Funktionalit\"{a}t auszur\"{u}sten, denn es wurde kein neues Konzept f\"{u}r diese Grafikklassen entworfen, sondern Wrapper-Objekte/ Methoden/Klassen erstellt, die das Arbeiten mit diesen Grafikkomponenten erleichtern soll. +Ein Letztes Problem bleibt noch: Es ist zwar sehr einfach ein Java-Swing-Objekt an einen Scala-Swing-Container (zb. Frame) anzubinden, da eine Konvertierung einer Java-Komponente in ein Scala-\"{a}quivalent problemlos m\"{o}glich ist. Jedoch ist oft auch die Konvertierung einer Scala- in eine Java-Komponente n\"{o}tig. Dies kann ganz einfach mittels \textit(peer)-Befehl der Komponente erreicht werden. + +Das angef\"{u}hrte Beispiel soll zeigen, wie vielseitig Scala sein kann und welch enormes Potenzial in dieser noch sehr jungen Sprache steckt. Nat\"{u}rlich gibt es dazu eine sehr gut aufgebaute Entwickler-Homepage\footnote{http://www.scala-lang.org/}, die Tutorials, Plugin f\"{u}r diverse IDEs und weitere n\"{u}tzliche Hilfestellungen f\"{u}r Scala-Neulinge bereitstellt. + +\subsection{Scala, Java und jEdit} +Wie im letzten Abschnitt bereits beschrieben, kommen bei jEdit Java- sowie auch Scala-Komponenten zum Einsatz bzw. werden sogar zu logischen Einheiten kombiniert. So ist zum Beispiel jEdit selbst rein in Java geschrieben und das Plugin Isabelle-jEdit rein in Scala. Trotzdem gibt es \"{u}berhaupt kein Problem, diese beiden jar-File miteinander bzw. ineinander in der JVM zu nutzen. Es geht sogar so weit, dass es m\"{o}glich ist, dass das Plugin Isabelle-jEdit bereits vorhandene und rein in Java geschriebene Plugins erweitert und nutzt. Dieses Zusammenspiel zwischen Objekten aus zwei verschiedenen Sprachen ist doch recht au\ss ergew\"{o}hnlich und kann bzw. sollte nat\"{u}rlich auch f\"{u}r SD bzw. {\sisac} ausgenutzt werden! + +\subsection{Der Isabelle-Scala-Layer} +Es sollten nun die Grundlegenden Eigenschaften von Scala bekannt sein. Die Einf\"uhrung des Scala-Layers ab Isabelle-Version 2009 war ein grosser Schritt f\"ur das Isabelle Projekt. Das Scala-Actor-Konzept erm\"oglicht die asynchrone Verarbeitung von einzelnen Beweisteilen und ist einer der massgeblichen Gr\"unde f\"ur die Einf\"uhrung des Scala-Layer. + +In diesem Absatz sollen nun die Eigenschaften des Scala-Layers und die damit verbundenen Chancen f\"ur das Isac- bzw. SD-Projektes +erarbeitet werden. + +\begin{figure} +\begin{center} +\includegraphics[width=100mm]{../fig-reuse-ml-scala-SD.png} +\end{center} +\label{fig-reuse-ml-scala} +\caption{Der Scala-Layer zwischen Java und SML} +\end{figure} + +Wie %Fig.\ref{fig-reuse-ml-scala} WARUM GEHT DAS NICHT ??? +Fig.3.1 +zeigt, verbindet der Scala-Layer die Java Virtual Maschine (JVM) und den in Standart-ML (SML) geschriebenen Isabelle-Kern. Dabei wird ein internes Protokoll verwendet, dass den Datenaustausch zwischen jEdit und Isabelle/Isar erm\"oglicht. Dieses Protokoll ist im Moment noch (bewusst) ohne API ausgef\"uhrt. Aus diesem Grund musste eine Schnittstelle definiert werden, um den Datenaustausch des SD-Plugins (JVM) mit dem SD-Interpreter m\"oglich zu machen. Siehe dazu den Absatz "Verbindung zum Isabelle-Pure Plugin herstellen". Man kann aus diesem Umstand ableiten, dass die Isabelle-Entwickler mit diesem eingezogenen Scala-Layer und dem damit verbundenen internen Protokoll, auf eine konsistente Verwaltung der Theorie-Bibliotheken abzielen. Mit anderen Worten wird dem Anwendungsprogrammierer der direkte Zugriff auf die Isabelle/Isar-Komponente verwehrt. Der Anwender sollte hier also nicht angreifen sonder die Isabelle-Theorien entsprechend erweitern. + +\chapter{Konfiguration und Implementation der Komponenten} +Dieses Kapitel soll nun anhand der bereits gewonnen Erkenntnise illustrieren, wie die Entwicklungsumgebung vom Isabelle-Team kopiert wurde und wie wichtigsten Schritte zum SD-Plugin f\"{u}r jEdit wahrscheinlich aussehen werden. Wobei einige Schritte parallel und dadurch nat\"{u}rlich sehr gut im Team umgesetzt werden k\"{o}nnen. Eine genaue Aufstellung aller beteiligten Files k\"onnen dem Anhang \ref{files-SD-plugin} entnommen werden. + +\section{Konfiguration des Netbeans- (NB-) Projektes} +Um in k\"unftigen Entwicklungsvorhaben effizient kooperieren zu k\"onnen, wurde das NB-Projekt genau nach den Vorgaben des Isabelle-Teams konfiguriert. Voraussetzung f\"ur die Konfiguration sind die Files aus dem Repository laut Anhang \ref{files-SD-plugin}. Die Konfiguration des NB-Projektes ``testSD-jedit'' erfolgt in folgenden Schritten: + +\begin{enumerate} +\item Softwarekomponenten aus dem Isabelle\_bundle checken; diese sind alle im Verzeichnis {\tt contrib}: + \begin{enumerate} + \item {\tt contrib/scala-\dots} Scala-Compiler und Runtime-System + \item {\tt contrib/scala-\dots} jEdit + \item {\tt src/Tools/jEditC} der Code f\"ur das Test-Plugin + \end{enumerate} +\item Konfigurations-Files von Netbeans im ``Files''-View checken; Achtung: die Files beeinflussen sich gegenseitig, direkte Eingriffe sind problematisch: +\begin{enumerate} +\item {\tt build.xml} wurde direkt aus dem Template in {\tt src/Tools/jEdit/} erzeugt; von hier nimmt NB die Daten um Daten in (Teilen von den) anderen Konfigurations-Files zu \"andern; NB nimmt hier keine automatischen Ver\"anderungen vor. +\item {\tt nbproject/build-impl.xml} z.T. automatisch erzeugt aus {\tt build.xml} und z.T. untenstehenden Files +\item {\tt nbproject/genfiles.properties} +\item {\tt nbproject/project.properties}, z.B. Projekt-Name +\item {\tt nbproject/project.xml} +\end{enumerate} +\item Sacla-plugin installieren laut {\tt http://wiki.netbeans.org/Scala69}, +\begin{enumerate} +\item insbesonders siehe ``Install with NetBeans 6.9'' +\item nach {\tt /usr/local/netbeans.../plugins/scala/} kopieren +\end{enumerate} +\item Scala-plugin in NB installieren +\begin{enumerate} +\item Men\"u $>$ Tools $>$ Plugins $>$ Downloaded $>$ Add Plugins +\item alle Files von {\tt /usr/local/netbeans\dots/plugins/scala/} ausw\"ahlen +\item Fenster in ``Add Plugins'' zeigt alle ausgew\"alten Files +\item $<$Install$>$ ruft den Wizzard auf, $<$Next$>$ erzeugt i.A. ein ``Warning'' das zu \"ubergehen ist +\item Funktionstest: Men\"ue $>$ Files $>$ New Project: zeigt Scala als ``Categories'' +\end{enumerate} +\item Neues Projekt ``testSD-jedit'' konfigurieren +\begin{enumerate} +\item Men\"u $>$ Open Project (weil schon aus dem Repository die notwendigen Files vorhanden sind) +\item /src/Tools/jeditC: Reference Problems, weil jEdit die Plugins von \ref{plugins} braucht +\item Funktionskontrolle: ``Projects''-View zeigt das neue Projekt.\\ + Die Konfigurations-Files sind v\"ollig getrennt von denen anderer Projekte~! +\item\label{reference-pbl} Referenz-Probleme beheben; das zeigt auch eventuell fehlende Files: +\begin{enumerate} +\item ``Projects''-View $>$ rightMouse $>$ Resolve Reference Problems: Fenster zeigt dieListe der fehlenden Dateien; $<$Next$>$ +\item Files holen aus ``Tools'' $>$ Libraries: \"uber Filebrowser aus dem Isabelle\_bundle holen {\tt contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars} +\item\label{plugins} ``New Library'' +\begin{enumerate} +\item Cobra-renderer: cobra.jar +\item Console: Console.jar +\item ErrorList: ErrorList.jar +\item Hyperlinks: Hyperlinks.jar +\item Isabelle-Pure: Pure.jar +\item Rhino-JavaScript: js.jar +\item Scala-compiler: scala-compiler.jar +\item SideKick: SideKick.jar +\end{enumerate} +\item Funktions-Kontrollen +\begin{enumerate} +\item das kleine gelbe Warndreieck im ``Projects''-View ist verschwunden +\item im ``Projects''-View sind nun 2 Ordner: {\tt src} und {\tt Libraries} +\end{enumerate} +\end{enumerate} +\item jEdit-Paket zum ``testSD-jedit''-Projekt hinzuf\"ugen +\begin{enumerate} +\item ``Project''-View $>$ rightMouse $>$ Add Jar/Folder: Filebrowser +\item /contrib/jedit.../jedit.jar +\item Funktions-Kontrolle: ist in ``Projects''/Libraries/jedit.jar +\end{enumerate} +\item Das neue Projekt ``testSD-jedit'' zum Hauptprojekt machen: ``Project''-View $>$ rightMouse $>$ Set as Main Project; Funktions-Kontrolle: der Projektname ist boldface. +\end{enumerate} +\item den neuen Isabelle/Scala-Layer ({\tt Pure.jar}) erzeugen mit {\tt bin/testSD}; siehe Pkt.\ref{build-isa-scala} unten. +\end{enumerate} + +\noindent Ab nun wird die Konfiguration \"uber ``trial and error'' zu Ende gef\"uhrt; die unten angef\"uhrten Fehler entstanden durch Umbenennung des Projektes von ``isac-jedit'' auf ``testSD-jedit'' w\"ahrend der oben beschriebenen Installation. +\begin{enumerate} +\item Build des Plugins schl\"agt fehl: Men\"u $>$ Build Main + \begin{enumerate} + \item Fehler: {\it Target ``Isac-impl.jar'' does not exist in the project ``testSD-jedit''. It is used from target ``debug''} + \begin{enumerate} + \item\label{restart-NB} Versuch + \begin{itemize} + \item {\tt build-impl.xml} l\"oschen + \item NetBeans neu starten, stellt build-impl.xml automatisch aus build.xml wieder her + \item \dots hat in diesem Fall nicht geholfen + \end{itemize} + \item Versuch zur Vermutung: Projekt wurde umbenannt von ``Isac'' in ``testSD-jedit'', entsprechende Eintr\"age in den Konfigurations-Dateien wurden automatisch richtig ersetzt, aber nicht in {\tt build.xml} + \begin{itemize} + \item in {\tt build.xml} query-replace ``isac-jedit'' in ``testSD-jedit'' + \end{itemize} + \end{enumerate} + \item Fehler: {\it Problem: failed to create task or type scalac} + \begin{enumerate} + \item Versuch: Pfad zum Scala bekanntgeben + \begin{itemize} + \item {\tt /usr/local/netbeans-6.9.1/etc/netbeans.conf}: netbeans\_default\_options= \dots richtigen Scala-Pfad setzen + \item build-impl.xml l\"oschen + \item NetBeans neu starten (siehe \ref{restart-NB}). + \end{itemize} + \end{enumerate} + \item Wenn Fehler: {\it /usr/local/isabisac/src/Tools/jEditC/\${project.jEdit}/modes does not exist} + \begin{enumerate} + \item grep -r "project.jEdit" * + \item {\tt nbproject/project.properties}: project.jEdit=contrib/jEdit + \end{enumerate} + \end{enumerate}%??indent +\item Fehlersuche in den Project Files, nicht in {\tt build.xml}:\\ +{\it src/Tools/jEditC/src/testSD.scala:225: error: value Isac is not a member of package isabelle} + \begin{enumerate} + \item den Link zu {\tt testSD.scala:22} folgen + \item\label{build-intermed} als Zwischenschritt eine noch nicht erzeugte Class ``Isac'' auskommentieren; siehe Pkt.\ref{build-intermed-end} unten\\ +val str1: String = isabelle.Isac.parse(``Testdaten aus dem Parser!'')\\ + val str1: String = ``TEST'' //isabelle.Isac.parse(``Testdaten aus dem Parser!'') + \item nochmals Men\"u $>$ Build (Hammer) \dots successful (wegen auskommentierter Zeile) + \item in der Konsole beobachten, welche Files kopiert werden und vergleichen mit {\tt build.xml}, z.B. + $<$target name=''-pre-jar''$>$ + $<$target name=''-post-jar''$>$ + \item {\tt bin/testSD} ausf\"uhren \dots + \item =dots stellt den entscheidender Schritt dar: ein neues {\tt Pure.jar} wurde erzeugt; dieses ist nun erweitert mit einer class {\tt Isac}; diese Klasse wurde erzeugt durch Code in \\{\tt scr/Pure/Isac/isac.scala} + \item\label{build-intermed-end} den Zwischenschritt Pkt.\ref{build-intermed} oben r\"uckg\"angig machen:\\ + ``val str1: String = isabelle.Isac.parse(``Testdaten aus dem Parser!'')".\\ + Dieser Befehl braucht das {\em neue} {\tt Pure.jar} am richtigen Platz \dots + \item \dots das Shellscript {\tt bin/testSD\_jedit} erzeugt dieses {\tt Pure.jar} + \end{enumerate} +\item\label{build-isa-scala} Fehler beim Exekutieren von {\tt bin/testSD} + \begin{enumerate} + \item einfach auf die ``error messages'' schauen, eg. {\it src/Pure/: no such file or directory} \dots + \item \dots hei\ss t, dass das Skript nicht vom richtigen Pfad {\tt \~{\,}\~{\,}} gestartet wurde --- dieses Skript sollte also verbessert werden. + \item Funktionstest: \\ + \#\#\#\\ + \#\#\# Building Isabelle/Scala layer\\ + \#\#\# + \end{enumerate} +\item Fehlermeldung beim Starten des Plugins aus NB, die \"ubergehen sind: +\begin{verbatim} +/home/neuper/.jedit/jars/Console.jar: +Two copies installed. Please remove one of the two copies. +/home/neuper/.jedit/jars/Hyperlinks.jar: +Two copies installed. Please remove one of the two copies. +/home/neuper/.jedit/jars/SideKick.jar: +Two copies installed. Please remove one of the two copies. +/home/neuper/.jedit/jars/ErrorList.jar: +Two copies installed. Please remove one of the two copies. +\end{verbatim} +Fehler zu beseitigen mit {\tt rm -r \~/jedit/jars} +\item \textit{Referenzproblem} auf {\tt Pure.jar}: siehe Pkt.\ref{reference-pbl} auf S.\pageref{reference-pbl}. + +%$<$ $>$ +%Men\"u $>$ $>$ $>$ $>$ $>$ $>$ +%``Project''-View $>$ rightMouse $>$ $>$ $>$ $>$ $>$ +%\item +% \begin{enumerate} +% \item +% \begin{enumerate} +% \item +% \begin{itemize} +% \item +% \begin{itemize} +% \item +% \item +% \item +% \end{itemize} +% \item +% \item +% \end{itemize} +% \item +% \item +% \end{enumerate} +%\item +%\item +%\end{enumerate} +%\item +%\begin{enumerate} +%\item +%\begin{enumerate} +%\item +%\begin{itemize} +%\item +%\begin{itemize} +%\item +%\item +%\item +%\end{itemize} +%\item +%\item +%\end{itemize} +%\item +%\item +%\end{enumerate} +%\item +%\item +%\end{enumerate} +\end{enumerate} + + +\section{Implementation der jEdit Komponenten} + +\subsection{Erstellen des Plugin-Ger\"{u}sts} +Hier gilt es, erstmal den Umfang der gew\"{u}nschten Anforderungen an das Plugin so genau wie m\"{o}glich zu identifizieren. Hat man eine sehr genaue Vorstellung, wie das GUI des Plugins aussehen wird und welche Zusatz-Features angeboten werden sollen, so kann man gezielt unter den bereits bestehenden Plugins f\"{u}r jEdit nach n\"{u}tzlichen Plugins suchen, die in das SD-Plugin (m\"{o}glicherweise durch kleine Modifikationen) integriert werden k\"{o}nnen. Dies spart einerseits sehr viel Zeit und ist nebenbei genau die Art von Programmierung, die durch die offnene Plugin-Struktur von jEdit gef\"{o}rdert wird. + +Hat man nun die Planung abgeschlossen und m\"{o}glicherweise n\"{u}tzliche Plugins gefunden, kann mit der Programmierung des GUIs begonnen werden. Man sollte hier beachten, dass man von Beginn an festlegt, ob mit Scala- oder Java-Swing Komponenten gearbeitet werden soll. Es ist zwar m\"{o}glich, beide Formen zu mischen, doch aus Klarheitsgr\"{u}nden sollte man sich f\"{u}r eine Art entscheiden. Wobei hier die Empfehlung im Moment eher noch Richtung Java-Swing geht, da man hier eigentlich f\"{u}r jede Art von Problem bzw. Aufgabe bereits HowTo's im Web finden kann. Da bei Scala-Swing nur Wrapper auf die Java-Swing-Libraries gesetzt wurden, entsteht dadurch auch keinerlei Performance-Verlust. + +Es existiert bereits ein beispielhaftes Plugin am \sisac-Repository. Da der grunds\"{a}tzliche Aufbau eines jEdit-Plugins soweit umgesetzt wurde und bereits lauff\"{a}hig ist, sollte man dieses wohl als Ausgangspunkt verwenden. Die direkte Verwendung eines Isabelle-Klons ist wohl zu Beginn nicht zu empfehlen bzw. sollte meiner Meinung nach die Integration von Isac in Isabelle bzw. die Verwachsung der beiden Plugins das Fernziel sein und dadurch w\"{u}rde der Klon-Vorgang wohl eher Probleme schaffen als sie zu l\"{o}sen. + +\subsection{Erzeugung des Plugins} +Hat man die Planung des Plugin-Ger\"{u}sts abgeschlossen und die eigentliche Implementationsphase begonnen, kann dieses Plugin getestet bzw. erzeugt und via jEdit ausgef\"{u}hrt werden. Dazu muss zuerst das jar-File erzeugt und danach in den jEdit-Pluginsordner verschoben werden. Die Erzeugung kann nat\"{u}rlich direkt mittels NetBeans durchgef\"{u}hrt werden. Doch es ist auch m\"{o}glich dies via Kommandline durchzuf\"{u}hren. Folgende Schritte illustrieren wie die Erzeugung und der Kopiervorgang des Plugins durchgef\"{u}hrt werden k\"{o}nnen(Ausschnitt aus dem Skript isac\_jedit, Anhang C): +\begin{enumerate} +\item Das Plugin kann mittels Kommandline folgenderma{\ss}en erstellt werden: \\ \textit{cd ISABELLE\_HOME/src/Tools/isac/jEdit} $\rightarrow$ \textit{ant jar} +\item Nun kann das das neue Plugin ganz einfach kopiert werden \textit{cp contrib/jEdit/build/ // jars/Isac.jar ../../../../contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/} +\item jEdit ausf\"{u}hren und testen +\end{enumerate} + +\subsection{Verbindung zum Isabelle-Pure Plugin herstellen} +Der n\"{a}chste Schritt sieht nun die Versorgung des GUIs mit Daten vor. Da das jEdit-Plugin selbst nicht rechnen/interpretieren kann, m\"{u}ssen Daten an den Isabelle-Kern, also das Isabelle-Pure-Plugin, {\tt Pure.jar}, weitergegeben werden. Dort k\"{o}nnen die Daten verwertet und aufbereitet zur\"{u}ck an das Frontend gereicht werden. + +\begin{figure} +\begin{center} +\includegraphics[width=100mm]{../fig-jedit-plugins-SD.png} +\end{center} +\label{fig-jedit-plugins-SD} +\caption{jEdit Plugins und die Verbindung zu Isabelle} +\end{figure} + +%Fig.\ref{fig-jedit-plugins-SD} WARUM GEHT DAS NICHT ??? +Fig.4.1 zeigt die involvierten Komponenten und ihren Zusammenhang. + +Der Zusammenhang zwischen dem Kern von Isabelle, Isabelle-Pure und dem Plugin wird folgenderma\ss en hergestellt: Zun\"{a}chst wird {\tt Pure.jar} leicht modifiziert, danach neu erstellt und zuletzt zu den restlichen jEdit-Plugins hinzugef\"{u}gt. Dies wurde auf der aktuellen Version am Repository bereits erledigt. Folgende Schritte wurden dazu gesetzt und sind wieder n\"{o}tig, da sicher weitere Modifikationen an der Datei Pure.jar n\"{o}tig sein werden. + + +\begin{enumerate} +\item Um den \sisac-Teil im Isabelle-Pure genau abzugrenzen, wurde ein Ordner \textit{Isac} angelegt und ein Testfile \textit{isac.scala} erstellt. +\item Nun muss diese File nat\"{u}rlich dem Make-Skript \textit{ISABELLE\_HOME/src/Pure/build-jars} hizugef\"{u}gt werden, um beim Erzeugen des jar-Files mitverpackt zu werden. +\item Nun kann Pure.jar mittels Kommandline erstellt werden: \textit{cd /src/Pure} $\rightarrow$ \textit{../../bin/isabelle env ./build-jars} +\item Nun kann das das neue Plugin ganz einfach kopiert werden \textit{cp ../../lib/classes/Pure.jar ../../contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/} +\item jEdit ausf\"{u}hren und testen +\end{enumerate} +Alle die oben angef\"{u}hrten Punkte, sowie das Erzeugen und Kopieren des Plugins selbst, werden vom Script isac\_jedit erledigt. +Das Skript kann dem Anhang C entnommen werden. + +\section{``Run Configurations''} +Zwischen Isabelle2009-2 und Isabelle2011 hat sich viel ge\"andert. Jetzt mit Isabelle2011 sieht es folgenderma\ss en aus: + +Am Anfang der Plugin-Entwicklung wird man versuchen, ohne eine Verbindung zu Isabelle auszukommen; in sp\"ateren Phase wird man genau diese Verbindung brauchen. Starten eines Plugins in NB mit gleichzeitigem Hochfahren von Isabelle ist schwierig. + +Folgende M\"oglichkeiten gibt es beim Debuggen: + +\begin{enumerate} +\item Man macht alles in Netbeans. Mit dem -Disabelle.home=... sollte man + die Applikation direkt aus der IDE starten und profilen/debuggen + k\"onnen. Das war der urspr\"ungliche Plan des ganzen Setups, d.h. der + Grund warum er so kompliziert ist. + +\item Man startet aus der Shell \"uber "isabelle jedit -d" und verbindet + dann den Netbeans debugger (oder jeden anderen JVM debugger) \"uber + den hier ausgegebenen Port. + +\item Man startet "isabelle jedit", geht dann in das "Console" Plugin und + w\"ahlt dort das "Scala" Sub-Plugin aus. Nach ca. 5s Bedenkzeit steht + der interaktive Scala toplevel innerhalb von Isabelle/jEdit zur + Verf\"ugung. Nun kann man direkt Dinge auswerten etc. und schauen was + passiert. + + Auf dem Cambridge Workshop 2010, {\tt T06\_System.thy} sind Beispiele zu finden. + Siehe subsection Isabelle/Scala. Man aktuviert dazu Isabelle/jEdit + mit obigem thy File und kopiert die Scala snippets aus dem Text + zeilenweise in das Console/Scala Fenster. + +\item Man streut einfach {\tt System.err.println} in seinen Code ein. +\end{enumerate} +Die M\"oglichkeiten (3) oder (4) sind zu bevorzugen. + +Ferner gibt es einige externe JVM Diagnose-Tools. Zu nennen sind {\tt jvisualvm} oder {\tt jconsole} um threads, heaps, profiles etc. anzuschauen, da sich das alles gerne verheddert. + +Richtig koordiniertes Hochfahren aller Komponenten braucht ein Shellscript wie {\tt isabelle jedit}. + +\section{Umsetzung des SD-Parsers} +Aus diversen Gr\"{u}nden wurde dieser Punkt im Zuge dieser Projektarbeit nicht mehr umgesetzt sonder nach hinten verschoben. Jedoch gibt es bereits eine Version des Parsers in ML und diese kann in einigen Arbeitsstunden in Zusammenarbeit mit Herrn Neuper in Scala \"{u}bersetzt und eingesetzt werden. + +Es ist bereits ein Parser in ML im Isabelle-Verzeichnis vorhanden, \textit{src/Pure/isar/ parse.ML}. Hier werden sogannte "parse combinators" verwendet. Dasselbe wird in n\"{a}chster Zeit von Seiten des Isabelle-Team auch f\"{u}r den Scala-Parse implementiert. Dadurch lassen sich hieraus auch wichtige Erkenntnisse gewinnen und dies spricht ebenfalls f\"{u}r die Verschiebung dieses Milestones nach hinten. + + +\chapter{Ausblick: Von SD- zum \isac-Plugin} +Die obigen Schritte sind n\"{o}tig, um das vorl\"{a}ufige Plugin SD umzusetzen. Nat\"{u}rlich beginnt danach die spannende Arbeit erst so richtig. Ist erst mal ein funktionierender SD-Parser vorhanden, kann dieser immer weiter verbessert und verfeinert werden, bis man auch damit beginnen kann, ihn f\"{u}r das \sisac-Projekt zu nutzen. + +Daneben kann an der Weiterentwicklung des GUIs gearbeitet werden und die ersten Schritte zur Ann\"{a}herung an das Isabelle-Plugin k\"{o}nnen hier erfolgen. + +\chapter{Zusammenfassung und R\"{u}ckblick} +Zusammenfassend wird nun ein \"Uberblick gegeben, welche Milestones erledigt wurden und welche nicht; Details dazu finden sich in Anhang A. %TODO +Abschlie{\ss}end gebe ich einen R\"uckblick auf meine pers\"onlichen Erfahrungen aus dieser Bakkalaureats-Arbeit. + +\section{Zusammenfassung}\label{zusammenfassung} +Folgende Milestones wurden erfolgreich abgeschlossen: +\begin{enumerate} +\item Relevante Isabelle Komponenten dokumentiert + +\item Installation der Standard-Komponenten: +\begin{itemize} +\item Mercurial Versioncontrol +\item NetBeans IDE +\item Standard Isabelle Bundle +\end{itemize} + +\item Entwicklungsumgebung vom Isabelle-Team kopieren +\begin{itemize} +\item Isabelle-Sources vom Repository M\"unchen (Java, Scala, ML) +\item jEdit als NetBeans Projekt definiert +\end{itemize} + +\item Relevante Komponenten implementieren +\begin{itemize} +\item jEdit Plugin f\"ur SD +\item Verbindung des Plugins zu Isabelle +\item zugeh\"origen Parser: nur ein Test in SML +\end{itemize} +\end{enumerate} + +\noindent Aus Zeitgr\"unden war {\em nicht} m\"oglich, ein komplettes SD-Plugin zu implementieren; dazu w\"are auch ein Interpreter f\"ur SD auf der ML-Seite n\"otig gewesen. + +\paragraph{Voraussetzungen f\"ur k\"unftige Entwicklung} geschaffen: +\begin{enumerate} +\item f\"ur die Implementation von ``structured derivations'' in Isabelle \dots +\item \dots als Vorarbeit f\"ur jEdit als k\"unftiges \isac-Frontend +\item f\"ur Mitarbeit an k\"unftiger Integration von Isabelle in Entwicklungswerkzeuge (Testcase-Generation etc). +\end{enumerate} + +\section{R\"uckblick} +Isabelle ist ein sehr gro\ss es Softwarepacket mit mehreren Millionen LOC. Daher gestaltete sich die Einarbeitungsphase sehr schwierig und kostet sehr viel Zeit. Erschwerend kam hinzu, dass ich von Beginn an mit mehreren, f\"{u}r mich noch ganz neue, Technologien arbeiten musste. Diese Herausforderungen schon zu Beginn machten die Arbeit an \sisac{ }von Beginn an spannend. Hier ist mir vorallem die gemeinsam mit meinem Betreuer Herrn Walther Neuper durchgef\"{u}hrte Installationsarbeit von Isabelle in Erinnerung geblieben. Nie zuvor hatte ich f\"{u}r eine Installation von Software so lange gebraucht - eine ganz neue, wichtige Erfahrung. + +Einer der bedeutensten Milesteine war r\"{u}ckblickend wohl, die Verzeichnisstruktur von Isabelle grunds\"atzlich verstanden zu haben. Bei einem Softwarepacket von dieser Gr\"{o}{\ss}e war es wichtig zu wissen, wo man Files suchen/modifizieren/einf\"{u}gen muss, um den gew\"{u}nschten Effekt erreichen zu k\"onnen. + +Der n\"achste wichtige Schritt war das bereits teilweise bestehende NetBeansprojekt lauff\"ahig zu machen und mir damit zum ersten mal selbst das jEdit-Isabelle-Plugin erzeugen zu k\"onnen. Dies war ein sehr bedeutsamer Schritt, da ich hier zum einen NetBeans und dessen Konfiguration besser kennenlernen konnte und zum anderen sehr viel \"{u}ber die Pluginstruktur eines jEdit-Plugins lernen konnte. Zu Beginn machte mir hier der Mix aus Scala-, Java-, XML- und diversen Config-Files Probleme. + +Bis jetzt hatte ich eigentlich noch nicht wirklich mit der Programmierung des Plugins begonnen doch es waren schon zig Arbeitsstunden rein f\"{u}r Einarbeitungs- und Vorbereitungsaufgaben verstrichen - wieder eine neue Erfahrung f\"{u}r mich. Nach einigen Test- bzw. Beispielprogrammen um die Sprache Scala etwas kennenzulernen, begann die wohl spannenste Phase im Projektverlauf. Das in Java geschriebene Beispielplugin "Quick-Notepad" wurde in Scala \"{u}bersetzt und etwas abge\"andert. + +Der letzte wirklich bedeutende Schritt war Herstellung der Verbindung zwischen Isabelle-Pure und \sisac. Dieser Punkt ist sehr wichtig, da ohne diese Schnittstelle die Planung des SD-Parser nicht m\"oglich gewesen w\"are. Der letzte Schritt, also die Implementation des SD-Parsers wurde aufgeschoben, da es derzeit seitens des Isabelle-Teams ebenfalls Bestrebungen gibt, einen neuen Scala-Parser zu designen und wir von diesen Erkenntnissen mit Sicherheit in der Zunkft profitieren k\"onnen. + +%Abschlie{\ss}end m\"ochte ich mich bei meinem Betreuer Herrn Walther Neuper sehr herzlich f\"{u}r die gute Betreuung und die spannenden Entwicklungsstuden bedanken. Es war eine sehr lehrreiche und interessante Projektarbeit! + +%\chapter{Milestones und Arbeitsprotokolle} +%\section{Inhaltliche Voraussetzungen erarbeitet: beendet am 27.09.2010} +%\begin{itemize} +%\item Kenntnis der Grundlagen und Anwendung von CTP: beendet am 03.08.2010 +%\item Charakteristika der Programmsprache Scala: beendet am 27.09.2010 +%\item Scala Actors: beendet am 12.08.2010 +%\end{itemize} +%\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} +%\hline +%Datum & T\"atigkeit & Einheiten \\ \hline +%12.07.2010 & Meeting: erste Besprechung und Erkl\"{a}rungen zu Isabelle, Isac und CTPs & 2 \\ \hline +%15.07.2010 & Recherche \"{u}ber Isabelle und CTPs & 3 \\ \hline +%20.07.2010 & Meeting: Besprechen der grunds\"{a}tzlichen Vorgangsweise und Ziele & 1 \\ \hline +%23.07.2010 & Isabelle: Ziele, Techniken (ML) und Zusammenh\"{a}nge mit Isac abkl\"{a}ren & 1 \\ \hline +%30.07.2010 & Ende der Einarbeitungstage: weitere Vorgensweise \"{u}ber Backs 'structured derivations'; Begriffserkl\"{a}rung & 3 \\ \hline +%01.08.2010 & Recherche: Buch f\"{u}r Scala & 2 \\ \hline +%03.08.2010 & Isabelle bestehende Technologie studieren & 4 \\ \hline +%05.08.2010 & Einarbeiten in Scala: Unterschiede zu Java indentifizieren & 1 \\ \hline +%06.08.2010 & Einarbeiten in Scala: Unterschiede zu Java indentifizieren, erste Beispielfiles & 4 \\ \hline +%08.08.2010 & Einarbeiten in Scala: funktionale Seite von Scala & 2 \\ \hline +%09.08.2010 & Einarbeiten in Scala: Testfiles mit Scala-Swing & 5 \\ \hline +%12.08.2010 & Studieren von Papers zu Scala Actors & 3 \\ \hline +%24.09.2010 & Scala: Arbeiten mit Klassen und Schnittstellen & 3 \\ \hline +%25.09.2010 & Scala: Experimente mit Java in Scala-Source & 6 \\ \hline +%27.09.2010 & Scala: Testfiles zu "Funktional vs Imperativ" & 4 \\ \hline \hline +% & Anzahl der Einheiten & 44 \\ +%\hline +%\end{tabular} +% +% +%\section{Technische Voraussetzungen hergestellt: beendet am 02.08.2010} +%\begin{itemize} +%\item Isabelle installiert, Filestruktur bekannt: beendet am 02.08.2010 +%\item Scala in NetBeans eingebunden: beendet am 22.07.2010 +%\item Mercurial installiert und einrichten des Repositories: beendet am 19.07.2010 +%\end{itemize} +%\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} +%\hline +%Datum & T\"atigkeit & Einheiten \\ \hline +%19.07.2010 & Beginn der Installationsarbeiten: Repo klonen und testen & 6 \\ \hline +%20.07.2010 & Installationsarbeiten, Einarbeiten in Filestruktur & 7 \\ \hline +%21.07.2010 & Einarbeiten in Filestruktur & 6 \\ \hline +%22.07.2010 & Vorbereitungen: NetBeans, JDK und Scala installieren. Scala in NetBeans integrieren & 8 \\ \hline +%23.07.2010 & Isabelle-jEdit-Plugin mittels NetBeans ausf\"{u}hren: testen & 5 \\ \hline +%27.07.2010 & Isabelle-jEdit-Plugin: \"{a}nderungen an der Projektstruktur & 7 \\ \hline +%28.07.2010 & Experimente mit Isabelle-jEdit-Plugin & 6 \\ \hline +%29.07.2010 & Identifikations der Parse-Einstiegsstelle & 5 \\ \hline +%30.07.2010 & Experimente mit Isabelle-jEdit-Plugin, Besprechung \"{u}ber Erfahrungen mit Filestruktur & 4 \\ \hline +%02.08.2010 & Installationen und einrichten des Repos auf meinen Laptop & 6 \\ \hline \hline +% & Anzahl der Einheiten & 60 \\ +%\hline +%\end{tabular} +% +%\section{NetBeans-Projekt aufgesetzt: beendet am 02.08.2010} +%\begin{itemize} +%\item Grundlegende Projektstruktur f\"ur ISAC hergestellt: beendet am 02.08.2010 +%\item jEdit-Plugin: XML-Files f\"{u}r ISAC vorbereitet: beendet am 22.07.2010 +%\item jEdit-Plugin: Source files geschrieben: beendet am 19.07.2010 +%\end{itemize} +%\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} +%\hline +%Datum & T\"atigkeit & Einheiten \\ \hline +%10.08.2010 & Projektstruktur anlegen, build.xml anpassen & 7 \\ \hline +%11.08.2010 & jEdit-Plugin-Struktur studieren: Howto durcharbeiten & 5 \\ \hline +%21.08.2010 & bestehende jEdit-Plugins (Java) durcharbeiten & 3 \\ \hline +%22.08.2010 & Kopieren des Isabelle-jEdit-Plugins, Umarbeiten f\"{u}r ISAC & 3 \\ \hline +%24.08.2010 & Umarbeiten des Isabelle-Plugins f\"{u}r ISAC & 6 \\ \hline +%26.08.2010 & Problem mit Isabelle-Umgebungsvariable: Suche nach L\"{o}sungen & 3 \\ \hline +%28.08.2010 & Recherchen zum Umgebungsvariable-Problem, Arbeiten mit den Isabelle-Shell-Skripts & 2 \\ \hline +%29.08.2010 & Experimente mit den Path-Varialbe der jvm & 3 \\ \hline +%30.08.2010 & Isabelle-jEdit-Plugin endlich vollst\"{a}ndig lauff\"{a}hig gebracht & 4 \\ \hline +%01.09.2010 & Arbeiten an der jEdit-ISAC-Projektstruktur & 3 \\ \hline +%04.09.2010 & Umarbeiten des Isabelle-Plugins f\"{u}r ISAC & 5 \\ \hline +%20.09.2010 & Einrichten des Laptops f\"{u}r Isabelle-Isac & 4 \\ \hline +%22.09.2010 & Meeting: Fortschrittsbericht, kurze Einf\"{u}hrung f\"{u}r Mitstreiter & 3 \\ \hline +% +%29.09.2010 & Neue Vorgehensweise: QuickNotepad-Plugin(QN) wird in Scala \"{u}bersetzt und f\"{u}r ISAC entsprechend angepasst: Arbeit an den XML-Files & 4 \\ \hline +%30.09.2010 & QN: Start mit \"{u}bersetzten der Sourcefiles & 5 \\ \hline +%02.10.2010 & QN: \"{U}bersetzten der Sourcefiles & 6 \\ \hline +%04.10.2010 & QN: \"{U}bersetzten der Sourcefiles: Problem bei Interface & 3 \\ \hline +%05.10.2010 & QN: QN vollst\"andig in Scala \"{u}bersetzt, testen & 2 \\ \hline \hline +% & Anzahl der Einheiten & 71 \\ +%\hline +%\end{tabular} +% +%\section{Experimentelle Parser implementiert: beendet am 04.03.2011} +%\begin{itemize} +%\item Experimente mit dem SideKick-Parser abgeschlossen: beendet am 03.02.2011 +%\item Verbindung zu Isabelle-Pure hergestellt: beendet am 04.03.2011 +%\item Implementierung des Scala-Parsers: aufgeschoben +%\end{itemize} +%\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} +%\hline +%Datum & T\"atigkeit & Einheiten \\ \hline +%28.01.2011 & Testen des SideKick-Parsers im Isabelle-Plugin & 2 \\ \hline +%29.01.2011 & Leichte Modifikationen des SideKick-Parsers im Isabelle-Plugin & 1 \\ \hline +%08.02.2011 & Besprechung zum Abschluss der praktischen Arbeiten & 1 \\ \hline +%16.02.2011 & Erstellen des Isabelle-Pur jar-Files & 1 \\ \hline +%19.02.2011 & Behebung des Problems mit den Umgebungsvariablen & 1 \\ \hline +%03.03.2011 & Erzeugung des Pure.jar Package m\"{o}glich & 2 \\ \hline +%04.04.2011 & Verbindung zwischen Plugin und Isabelle-Pure hergestellt und getestet & 3 \\ \hline +%08.04.2011 & Besprechung: Implementierung des experimentellen Parsers wird nicht mehr durchgef\"{u}hrt & 1 \\ \hline \hline +% & Anzahl der Einheiten & 12 \\ +%\hline +%\end{tabular} +% +%\section{Verfassen der Dokumentation und abschliesende Arbeiten: beendet am TO.DO.2011} +%\begin{itemize} +%\item Bacc.-Protokoll fertiggestellt: beendet am 01.03.2011 +%\item Dokumentation: erste Version fertiggestellt: beendet am 28.04.2011 +%\item Dokumentation abgeschlossen: beendet am TO.DO.2011 +%\end{itemize} +%\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} +%\hline +%Datum & T\"atigkeit & Einheiten \\ \hline +%01.03.2011 & Besprechung zum Ablauf der Dokumentationsarbeiten: Protokoll und Dokumentation & 1 \\ \hline +%01.03.2011 & Erstellen des Protokolls & 2 \\ \hline +%08.03.2011 & Besprechung zur Doku und zur Schnittstelle zu Isabelle-Pure & 1 \\ \hline +%17.03.2011 & Dokumentation schreiben & 2 \\ \hline +%19.03.2011 & Dokumentation schreiben & 3 \\ \hline +%24.04.2011 & Dokumentation schreiben & 2 \\ \hline +%25.04.2011 & Dokumentation schreiben & 4 \\ \hline +%27.04.2011 & Dokumentation schreiben & 2 \\ \hline +%28.04.2011 & Dokumentation: Fertigstellen der ersten Version & 3 \\ \hline \hline +% & Anzahl der Einheiten & 20 \\ +%\hline +%\end{tabular} +% +%\section{Pr\"asentation der Arbeit im IST-Seminar }% am ..(*)...} diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/msteger/bakk-arbeit/master_thesis.bib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/msteger/bakk-arbeit/master_thesis.bib Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,187 @@ +% Add your bibtex entries + +@Book{aichernig:uni-iist-02, + editor = {Aichernig, Bernhard K. and Maibaum, Tom}, + title = {Formal Methods at the Crossroads. From Panacea to Foundational Support. +{10th Anniversary Colloquium of UNU/IIST, the International Institute for Software Technology of The United Nations University}}, + publisher = {Springer-Verlag}, + year = {2003}, + volume = {2757}, + series = {Lecture Notes in Computer Science}, + address = {Lisbon, Portugal}, + month = {March 18-20, 2002} +} + +@InCollection{aichernig:mut-test, + author = {Aichernig, Bernhard}, + title = {A systematic introduction to mutation testing in unifying theories of programming}, + booktitle = {Testing Techniques in Software Engineering}, + pages = {243--287}, + publisher = {Springer Berlin / Heidelberg}, + year = {2010}, + editor = {Borba, Paulo and Cavalcanti, Ana and Sampaio, Augusto and Woodcook, Jim}, + volume = {6153}, + series = {Lecture Notes in Computer Science} +} + +@inproceedings{Aspinall:2007:FIP:1420412.1420429, + author = {Aspinall, David and L\"{u}th, Christoph and Winterstein, Daniel}, + title = {A Framework for Interactive Proof}, + booktitle = {Proceedings of the 14th symposium on Towards Mechanized Mathematical Assistants: 6th International Conference}, + series = {Calculemus '07 / MKM '07}, + year = {2007}, + isbn = {978-3-540-73083-5}, + location = {Hagenberg, Austria}, + pages = {161--175}, + numpages = {15}, + url = {http://dx.doi.org/10.1007/978-3-540-73086-6_15}, + doi = {http://dx.doi.org/10.1007/978-3-540-73086-6_15}, + acmid = {1420429}, + publisher = {Springer-Verlag}, + address = {Berlin, Heidelberg}, +} + +@Book{armstrong:erlang96, + author = {Armstrong, Joe and others}, + title = {Concurrent Programming in Erlang}, + publisher = {Prentice Hall}, + year = {1996} +} + +@TechReport{odersky:scala06, + author = {Odersky, Martin and others}, + title = {An Overview of the Scala Programming Language}, + institution = {\'Ecole Polytechnique F\'ed\'erale de Lausanne (EPFL)}, + year = {2006}, + type = {Technical Report LAMP-REPORT-2006-001}, + address = {1015 Lausanne, Switzerland}, + note = {Second Edition}, + annote = {http://www.scala-lang.org/sites/default/files/linuxsoft_archives/docu/files/ScalaOverview.pdf} +} + +@article{Haller:2009:SAU:1496391.1496422, + author = {Haller, Philipp and Odersky, Martin}, + title = {Scala Actors: Unifying thread-based and event-based programming}, + journal = {Theor. Comput. Sci.}, + volume = {410}, + issue = {2-3}, + month = {February}, + year = {2009}, + issn = {0304-3975}, + pages = {202--220}, + numpages = {19}, + url = {http://portal.acm.org/citation.cfm?id=1496391.1496422}, + doi = {10.1016/j.tcs.2008.09.019}, + acmid = {1496422}, + publisher = {Elsevier Science Publishers Ltd.}, + address = {Essex, UK}, + keywords = {Actors, Concurrent programming, Events, Threads}, +} + +@InProceedings{scala:jmlc06, + author = {Philipp Haller and Martin Odersky}, + title = {Event-Based Programming without Inversion of Control}, + booktitle = {Proc. Joint Modular Languages Conference}, + year = 2006, + series = {Springer LNCS} +} + + +@InProceedings{makarius:isa-scala-jedit, + author = {Makarius Wenzel}, + title = {Asyncronous Proof Processing with {Isabelle/Scala} and {Isabelle/jEdit}}, + booktitle = {User Interfaces for Theorem Provers (UITP 2010)}, + year = {2010}, + editor = {C. Sacerdoti Coen and D. Aspinall}, + address = {Edinburgh, Scotland}, + month = {July}, + organization = {FLOC 2010 Satellite Workshop}, + note = {http://www4.in.tum.de/~wenzelm/papers/async-isabelle-scala.pdf} +} + +@Book{db:dom-eng, + author = {Bj{\o}rner, Dines}, + title = {Domain Engineering. Technology Management, Research and Engineering}, + publisher = {JAIST Press}, + year = {2009}, + month = {Feb}, + series = {COE Research Monograph Series}, + volume = {4}, + address = {Nomi, Japan} +} + +@inproceedings{Haftmann-Nipkow:2010:code, + author = {Florian Haftmann and Tobias Nipkow}, + title = {Code Generation via Higher-Order Rewrite Systems}, + booktitle = {Functional and Logic Programming, 10th International +Symposium: {FLOPS} 2010}, + year = {2010}, + publisher = {Springer}, + series = {Lecture Notes in Computer Science}, + volume = {6009} +} + +@Manual{coq1999, + title = {The Coq Proof Assistant}, + author = {Barras, B. and others}, + organization = {INRIA-Rocquencourt - CNRS-ENS Lyon}, + month = {July}, + year = {1999}, + pnote={},status={cited},source={mkm01.caprotti},location={} +} + +@Book{meta-ML, + author = {Gordon,M. and Milner,R. and Wadsworth,C. P.}, + title = {Edinburgh LCF: A Mechanised Logic of Computation}, + publisher = { Springer-Verlag}, + year = {1979}, + volume = {78}, + series = {Lecture Notes in Computer Science} +} + +@book{Paulson:Isa94, + title={Isabelle: a generic theorem prover}, + author={Paulson, Lawrence C. }, publisher={Springer-Verlag},year={1994}, + volume={828},series={Lecture Notes in Computer Science},address={},edition={},month={}, + note={With contributions by Topias Nipkow}, + status={},source={},location={-} + } + +@Book{pl:milner97, + author = {Robin Milner and Mads Tofte and Robert Harper and David MacQueen}, + title = {The Definition of Standard ML (Revised)}, + publisher = {The MIT Press}, + year = 1997, + address = {Cambridge, London}, + annote = {97bok375} +} + +@Article{back-grundy-wright-98, + author = {Back, Ralph and Grundy, Jim and von Wright, Joakim}, + title = {Structured Calculational Proof}, + journal = {Formal Aspects of Computing}, + year = {1998}, + number = {9}, + pages = {469-483} +} + +@Manual{isar-impl, + title = {The {Isabelle/Isar} Implementation}, + author = {Makarius Wenzel}, + month = {April 19}, + year = {2009}, + note = {With contributions by Florian Haftmann and Larry Paulson} +} + +@InProceedings{wenzel:isar, + author = {Wenzel, Markus}, + title = {Isar - a Generic Interpretative Approach to Readable Formal Proof Documents}, + booktitle = {Theorem Proving in Higher Order Logics}, + year = {1999}, + editor = {G. Dowek, A. Hirschowitz, C. Paulin, L. Thery}, + series = {LNCS 1690}, + organization = {12th International Conference TPHOLs'99}, + publisher = {Springer} +} + + diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/msteger/bakk-arbeit/thesis-acknowl.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/msteger/bakk-arbeit/thesis-acknowl.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,55 @@ +%\begin{changemargin}{1.5cm}{1.5cm} + +%\chapter*{Acknowledgements} +%\addcontentsline{toc}{chapter}{Acknowledgements} + + + +\begin{center} +{\Large\bfseries Acknowledgements} +\end{center} +%\vspace*{3mm} + +\begin{changemargin}{1.5cm}{1.5cm} +I would like to thank Professor Berhard Aichernig for having prepared the grounds for this thesis by his work on test case generation and in particular in his interest in the computer theorem prover Isabelle. + +His general surveys on computer theorem proving, on programming languages in general, on functional programming in particular and on respective advantages in upcoming multi-core computing were inspiring and they motivate the directions for my future studies. + +Many thanks also to Walther Neuper, who was always available for the many intricacies of Isabelle/Isar and the technicalities involved when doing a bachelor project and writing a thesis. + +\begin{flushright} +Marco Steger \\ {\small Graz, June 30, 2011} +\end{flushright} +\end{changemargin} + +\selectlanguage{austrian} + +\vspace*{5mm} + +\begin{center} +{\Large\bfseries Danksagung} +\end{center} +%\vspace*{0mm} + +\begin{changemargin}{1.5cm}{1.5cm} +Ich mchte mich herzlich bei allen bedanken, die diese Bakkalaureats-Arbeit unterst\"utzt haben. + +Herr Professor Bernhard Aichernig hat die Voraussetzungen f\"ur die Themenstellung der Arbeit durch seine F\&E in Test-Case-Generation geschaffen; Isabelle geh\"ort auch zu seinem Tool-Set. + +Besonder inspirierend waren seine \"Uberblicks-Informationen zu Computer Theorem Proving, zu Programm-Sprachen im Allgemeinen und zu funktionalen Sprachen im Besonderen, die ihre Vorteile bei den kommenden Multi-Core-Prozessoren zum Tragen bringen werden; diese Informationen werden auch meine Entscheidung f\"ur Wahlf\"acher in den kommenden Semestern motivieren. + +Walther Neuper war immer hilfreich in allen technischen Fragen zu Isabelle/Isar und in organisatorischen Fragen zu Bachelor-Projekt und -Thesis. + +\begin{flushright} +Marco Steger \\ {\small Graz, am 30 Juni 2011} +\end{flushright} +\end{changemargin} + +\selectlanguage{english} + + + + + + + diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/msteger/bakk-arbeit/thesis-appendix.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/msteger/bakk-arbeit/thesis-appendix.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,339 @@ +\chapter{Milestones und Arbeitsprotokolle}\label{milestones} %\ref doesnt work outside this file ?!? +\section{Inhaltliche Voraussetzungen erarbeitet: beendet am 27.09.2010} +\begin{itemize} +\item Kenntnis der Grundlagen und Anwendung von CTP: beendet am 03.08.2010 +\item Charakteristika der Programmsprache Scala: beendet am 27.09.2010 +\item Scala Actors: beendet am 12.08.2010 +\end{itemize} +\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} +\hline +Datum & T\"atigkeit & Einheiten \\ \hline +12.07.2010 & Meeting: erste Besprechung und Erkl\"{a}rungen zu Isabelle, Isac und CTPs & 2 \\ \hline +15.07.2010 & Recherche \"{u}ber Isabelle und CTPs & 3 \\ \hline +20.07.2010 & Meeting: Besprechen der grunds\"{a}tzlichen Vorgangsweise und Ziele & 1 \\ \hline +23.07.2010 & Isabelle: Ziele, Techniken (ML) und Zusammenh\"{a}nge mit Isac abkl\"{a}ren & 1 \\ \hline +30.07.2010 & Ende der Einarbeitungstage: weitere Vorgensweise \"{u}ber Backs 'structured derivations'; Begriffserkl\"{a}rung & 3 \\ \hline +01.08.2010 & Recherche: Buch f\"{u}r Scala & 2 \\ \hline +03.08.2010 & Isabelle bestehende Technologie studieren & 4 \\ \hline +05.08.2010 & Einarbeiten in Scala: Unterschiede zu Java indentifizieren & 1 \\ \hline +06.08.2010 & Einarbeiten in Scala: Unterschiede zu Java indentifizieren, erste Beispielfiles & 4 \\ \hline +08.08.2010 & Einarbeiten in Scala: funktionale Seite von Scala & 2 \\ \hline +09.08.2010 & Einarbeiten in Scala: Testfiles mit Scala-Swing & 5 \\ \hline +12.08.2010 & Studieren von Papers zu Scala Actors & 3 \\ \hline +24.09.2010 & Scala: Arbeiten mit Klassen und Schnittstellen & 3 \\ \hline +25.09.2010 & Scala: Experimente mit Java in Scala-Source & 6 \\ \hline +27.09.2010 & Scala: Testfiles zu "Funktional vs Imperativ" & 4 \\ \hline \hline + & Anzahl der Einheiten & 44 \\ +\hline +\end{tabular} + + +\section{Technische Voraussetzungen hergestellt: beendet am 02.08.2010} +\begin{itemize} +\item Isabelle installiert, Filestruktur bekannt: beendet am 02.08.2010 +\item Scala in NetBeans eingebunden: beendet am 22.07.2010 +\item Mercurial installiert und einrichten des Repositories: beendet am 19.07.2010 +\end{itemize} +\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} +\hline +Datum & T\"atigkeit & Einheiten \\ \hline +19.07.2010 & Beginn der Installationsarbeiten: Repo klonen und testen & 6 \\ \hline +20.07.2010 & Installationsarbeiten, Einarbeiten in Filestruktur & 7 \\ \hline +21.07.2010 & Einarbeiten in Filestruktur & 6 \\ \hline +22.07.2010 & Vorbereitungen: NetBeans, JDK und Scala installieren. Scala in NetBeans integrieren & 8 \\ \hline +23.07.2010 & Isabelle-jEdit-Plugin mittels NetBeans ausf\"{u}hren: testen & 5 \\ \hline +27.07.2010 & Isabelle-jEdit-Plugin: \"{a}nderungen an der Projektstruktur & 7 \\ \hline +28.07.2010 & Experimente mit Isabelle-jEdit-Plugin & 6 \\ \hline +29.07.2010 & Identifikations der Parse-Einstiegsstelle & 5 \\ \hline +30.07.2010 & Experimente mit Isabelle-jEdit-Plugin, Besprechung \"{u}ber Erfahrungen mit Filestruktur & 4 \\ \hline +02.08.2010 & Installationen und einrichten des Repos auf meinen Laptop & 6 \\ \hline \hline + & Anzahl der Einheiten & 60 \\ +\hline +\end{tabular} + +\section{NetBeans-Projekt aufgesetzt: beendet am 02.08.2010} +\begin{itemize} +\item Grundlegende Projektstruktur f\"ur ISAC hergestellt: beendet am 02.08.2010 +\item jEdit-Plugin: XML-Files f\"{u}r ISAC vorbereitet: beendet am 22.07.2010 +\item jEdit-Plugin: Source files geschrieben: beendet am 19.07.2010 +\end{itemize} +\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} +\hline +Datum & T\"atigkeit & Einheiten \\ \hline +10.08.2010 & Projektstruktur anlegen, build.xml anpassen & 7 \\ \hline +11.08.2010 & jEdit-Plugin-Struktur studieren: Howto durcharbeiten & 5 \\ \hline +21.08.2010 & bestehende jEdit-Plugins (Java) durcharbeiten & 3 \\ \hline +22.08.2010 & Kopieren des Isabelle-jEdit-Plugins, Umarbeiten f\"{u}r ISAC & 3 \\ \hline +24.08.2010 & Umarbeiten des Isabelle-Plugins f\"{u}r ISAC & 6 \\ \hline +26.08.2010 & Problem mit Isabelle-Umgebungsvariable: Suche nach L\"{o}sungen & 3 \\ \hline +28.08.2010 & Recherchen zum Umgebungsvariable-Problem, Arbeiten mit den Isabelle-Shell-Skripts & 2 \\ \hline +29.08.2010 & Experimente mit den Path-Varialbe der jvm & 3 \\ \hline +30.08.2010 & Isabelle-jEdit-Plugin endlich vollst\"{a}ndig lauff\"{a}hig gebracht & 4 \\ \hline +01.09.2010 & Arbeiten an der jEdit-ISAC-Projektstruktur & 3 \\ \hline +04.09.2010 & Umarbeiten des Isabelle-Plugins f\"{u}r ISAC & 5 \\ \hline +20.09.2010 & Einrichten des Laptops f\"{u}r Isabelle-Isac & 4 \\ \hline +22.09.2010 & Meeting: Fortschrittsbericht, kurze Einf\"{u}hrung f\"{u}r Mitstreiter & 3 \\ \hline + +29.09.2010 & Neue Vorgehensweise: QuickNotepad-Plugin(QN) wird in Scala \"{u}bersetzt und f\"{u}r ISAC entsprechend angepasst: Arbeit an den XML-Files & 4 \\ \hline +30.09.2010 & QN: Start mit \"{u}bersetzten der Sourcefiles & 5 \\ \hline +02.10.2010 & QN: \"{U}bersetzten der Sourcefiles & 6 \\ \hline +04.10.2010 & QN: \"{U}bersetzten der Sourcefiles: Problem bei Interface & 3 \\ \hline +05.10.2010 & QN: QN vollst\"andig in Scala \"{u}bersetzt, testen & 2 \\ \hline \hline + & Anzahl der Einheiten & 71 \\ +\hline +\end{tabular} + +\section{Experimentelle Parser implementiert: beendet am 04.03.2011} +\begin{itemize} +\item Experimente mit dem SideKick-Parser abgeschlossen: beendet am 03.02.2011 +\item Verbindung zu Isabelle-Pure hergestellt: beendet am 04.03.2011 +\item Implementierung des Scala-Parsers: aufgeschoben +\end{itemize} +\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} +\hline +Datum & T\"atigkeit & Einheiten \\ \hline +28.01.2011 & Testen des SideKick-Parsers im Isabelle-Plugin & 2 \\ \hline +29.01.2011 & Leichte Modifikationen des SideKick-Parsers im Isabelle-Plugin & 1 \\ \hline +08.02.2011 & Besprechung zum Abschluss der praktischen Arbeiten & 1 \\ \hline +16.02.2011 & Erstellen des Isabelle-Pur jar-Files & 1 \\ \hline +19.02.2011 & Behebung des Problems mit den Umgebungsvariablen & 1 \\ \hline +03.03.2011 & Erzeugung des Pure.jar Package m\"{o}glich & 2 \\ \hline +04.04.2011 & Verbindung zwischen Plugin und Isabelle-Pure hergestellt und getestet & 3 \\ \hline +08.04.2011 & Besprechung: Implementierung des experimentellen Parsers wird nicht mehr durchgef\"{u}hrt & 1 \\ \hline \hline + & Anzahl der Einheiten & 12 \\ +\hline +\end{tabular} + +\section{Verfassen der Dokumentation und abschliesende Arbeiten: beendet am 30.Juni 2011} +\begin{itemize} +\item Bacc.-Protokoll fertiggestellt: beendet am 01.03.2011 +\item Dokumentation: erste Version fertiggestellt: beendet am 28.04.2011 +\item Dokumentation abgeschlossen: beendet am 30.Juni 2011 +\end{itemize} +\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} +\hline +Datum & T\"atigkeit & Einheiten \\ \hline +01.03.2011 & Besprechung zum Ablauf der Dokumentationsarbeiten: Protokoll und Dokumentation & 1 \\ \hline +01.03.2011 & Erstellen des Protokolls & 2 \\ \hline +08.03.2011 & Besprechung zur Doku und zur Schnittstelle zu Isabelle-Pure & 1 \\ \hline +17.03.2011 & Dokumentation schreiben & 2 \\ \hline +19.03.2011 & Dokumentation schreiben & 3 \\ \hline +24.04.2011 & Dokumentation schreiben & 2 \\ \hline +25.04.2011 & Dokumentation schreiben & 4 \\ \hline +27.04.2011 & Dokumentation schreiben & 2 \\ \hline +28.04.2011 & Dokumentation: Fertigstellen der ersten Version & 3 \\ \hline \hline + & Anzahl der Einheiten & 20 \\ +\hline +\end{tabular} + +\section{Pr\"asentation der Arbeit im IST-Seminar: beendet am 21.06.2011} +\begin{itemize} +\item Pr\"asentation fertiggestellt: beendet am 19.06.2011 +\item Pr\"asentation: abgehalten am 21.06.2011 +\end{itemize} +\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} +\hline +Datum & T\"atigkeit & Einheiten \\ \hline +06.06.2011 & Planung der Pr\"asentation & 2 \\ \hline +16.06.2011 & Verfassen der Pr\"asentation & 2 \\ \hline +18.06.2011 & Verfassen der Pr\"asentation & 3 \\ \hline +19.06.2011 & Pr\"asentation: Feinschliff & 2 \\ \hline +20.06.2011 & Vorbereiten der Pr\"asentation& 3 \\ \hline +21.06.2011 & Abhaltung und nachfolgende Diskussion & 1 \\ \hline \hline + & Anzahl der Einheiten & 13 \\ + \hline +\end{tabular} + +\chapter{Filestruktur Isabelle} +\section{jar-Packete} +\textbf{----- for "isabelle jedit \&"; contained in Isabelle\_bundle} \\ +./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jedit.jar \\ +./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/LatestVersion.jar \\ +./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/SideKick.jar \\ +./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/Console.jar \\ +./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/Pure.jar \\ +./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/Isac.jar \\ +./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/scala-compiler.jar \\ +./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/Isabelle-jEdit.jar \\ +./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/cobra.jar \\ +./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/js.jar \\ +./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/Hyperlinks.jar \\ +./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/scala-swing.jar \\ +./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/scala-library.jar \\ +./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/QuickNotepad.jar \\ +./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/ErrorList.jar \\ +\textbf{----- scala system; contained in Isabelle\_bundle} \\ +./contrib/scala-2.8.1.final/misc/sbaz/scala-bazaars.jar \\ +./contrib/scala-2.8.1.final/misc/sbaz/sbaz-tests.jar \\ +./contrib/scala-2.8.1.final/misc/scala-devel/plugins/continuations.jar \\ +./contrib/scala-2.8.1.final/lib/scala-compiler.jar \\ +./contrib/scala-2.8.1.final/lib/scalap.jar \\ +./contrib/scala-2.8.1.final/lib/scala-swing.jar \\ +./contrib/scala-2.8.1.final/lib/scala-library.jar \\ +./contrib/scala-2.8.1.final/lib/jline.jar \\ +./contrib/scala-2.8.1.final/lib/scala-dbc.jar \\ +./contrib/scala-2.8.1.final/src/scala-library-src.jar \\ +./contrib/scala-2.8.1.final/src/scala-swing-src.jar \\ +./contrib/scala-2.8.1.final/src/scala-compiler-src.jar \\ +./contrib/scala-2.8.1.final/src/scala-dbc-src.jar \\ +./contrib/scala-2.8.1.final/src/sbaz-src.jar \\ +\textbf{----- Isars entry to SML from Scala-layer; } \\ +\textit{created according to 4.3.\#3 }\\ +./lib/classes/isabelle-scala.jar \\ +./lib/classes/Pure.jar \\\\ +\textit{\textbf{===== all below for NetBeans}} \\\\ +\textbf{----- standard Isabelle, started by $$ in NetBeans} \\ + \textit{description in 2.2.2} \\ +./src/Tools/jEdit/dist/jars/jedit.jar \\ +./src/Tools/jEdit/dist/jars/SideKick.jar \\ +./src/Tools/jEdit/dist/jars/Console.jar \\ +./src/Tools/jEdit/dist/jars/Pure.jar \\ +./src/Tools/jEdit/dist/jars/scala-compiler.jar \\ +./src/Tools/jEdit/dist/jars/Isabelle-jEdit.jar \\ +./src/Tools/jEdit/dist/jars/cobra.jar \\ +./src/Tools/jEdit/dist/jars/js.jar \\ +./src/Tools/jEdit/dist/jars/Hyperlinks.jar \\ +./src/Tools/jEdit/dist/jars/scala-swing.jar \\ +./src/Tools/jEdit/dist/jars/scala-library.jar \\ +./src/Tools/jEdit/dist/jars/ErrorList.jar \\ +\textbf{----- source of jEdit, required for $$ in NetBeans; \\} + adapted from NetBeans' webpages, \\ + \textit{description in 2.2.3.\#5} \\ +./src/Tools/jEditC/contrib/jEdit/build/jars/SideKick.jar \\ +./src/Tools/jEditC/contrib/jEdit/build/jars/Console.jar \\ +./src/Tools/jEditC/contrib/jEdit/build/jars/Pure.jar \\ +./src/Tools/jEditC/contrib/jEdit/build/jars/Isac.jar \\ +./src/Tools/jEditC/contrib/jEdit/build/jars/QuickNPScala.jar \\ +./src/Tools/jEditC/contrib/jEdit/build/jars/scala-compiler.jar \\ +./src/Tools/jEditC/contrib/jEdit/build/jars/Isabelle-jEdit.jar \\ +./src/Tools/jEditC/contrib/jEdit/build/jars/cobra.jar \\ +./src/Tools/jEditC/contrib/jEdit/build/jars/js.jar \\ +./src/Tools/jEditC/contrib/jEdit/build/jars/Hyperlinks.jar \\ +./src/Tools/jEditC/contrib/jEdit/build/jars/scala-swing.jar \\ +./src/Tools/jEditC/contrib/jEdit/build/jars/scala-library.jar \\ +./src/Tools/jEditC/contrib/jEdit/build/jars/ErrorList.jar \\ +./src/Tools/jEditC/contrib/jEdit/build/jEdit.jar \\ +\textbf{----- demo plugin, started by $$ in NetBeans \\} + \textit{description in 2.2.3.\#4} \\ +./src/Tools/jEditC/dist/jars/SideKick.jar \\ +./src/Tools/jEditC/dist/jars/Console.jar \\ +./src/Tools/jEditC/dist/jars/Pure.jar \\ +./src/Tools/jEditC/dist/jars/Isac.jar \\ +./src/Tools/jEditC/dist/jars/scala-compiler.jar \\ +./src/Tools/jEditC/dist/jars/cobra.jar \\ +./src/Tools/jEditC/dist/jars/js.jar \\ +./src/Tools/jEditC/dist/jars/Hyperlinks.jar \\ +./src/Tools/jEditC/dist/jars/scala-swing.jar \\ +./src/Tools/jEditC/dist/jars/scala-library.jar \\ +./src/Tools/jEditC/dist/jars/ErrorList.jar \\ + +\section{Scala-Files: Isabelle-Pure} +\textbf{General:}\\ +./src/Pure/General/xml.scala\\ +./src/Pure/General/linear\_set.scala\\ +./src/Pure/General/symbol.scala\\ +./src/Pure/General/exn.scala\\ +./src/Pure/General/position.scala\\ +./src/Pure/General/scan.scala\\ +./src/Pure/General/xml\_data.scala\\ +./src/Pure/General/yxml.scala\\ +./src/Pure/General/markup.scala\\ +./src/Pure/General/sha1.scala\\ +./src/Pure/General/timing.scala\\ +./src/Pure/General/pretty.scala\\ +\textbf{Concurent:}\\ +./src/Pure/Concurrent/volatile.scala\\ +./src/Pure/Concurrent/future.scala\\ +./src/Pure/Concurrent/simple\_thread.scala\\ +\textbf{Thy:}\\ +./src/Pure/Thy/html.scala\\ +./src/Pure/Thy/completion.scala\\ +./src/Pure/Thy/thy\_header.scala\\ +./src/Pure/Thy/thy\_syntax.scala\\ +./src/Pure/Isac/isac.scala\\ +./src/Pure/library.scala\\ +\textbf{Isar:}\\ +./src/Pure/Isar/keyword.scala\\ +./src/Pure/Isar/outer\_syntax.scala\\ +./src/Pure/Isar/token.scala\\ +./src/Pure/Isar/parse.scala\\ +\textbf{Isac:}\\ +\textit{./src/Pure/Isac/isac.scala}\\ +\textbf{System:}\\ +./src/Pure/System/gui\_setup.scala\\ +./src/Pure/System/isabelle\_system.scala\\ +./src/Pure/System/swing\_thread.scala\\ +./src/Pure/System/download.scala\\ +./src/Pure/System/session\_manager.scala\\ +./src/Pure/System/standard\_system.scala\\ +./src/Pure/System/isabelle\_syntax.scala\\ +./src/Pure/System/session.scala\\ +./src/Pure/System/platform.scala\\ +./src/Pure/System/cygwin.scala\\ +./src/Pure/System/event\_bus.scala\\ +./src/Pure/System/isabelle\_process.scala\\ +\textbf{PIDE}\\ +./src/Pure/PIDE/document.scala\\ +./src/Pure/PIDE/markup\_tree.scala\\ +./src/Pure/PIDE/text.scala\\ +./src/Pure/PIDE/command.scala\\ +./src/Pure/PIDE/isar\_document.scala \\ + + +\chapter{Das Skript \textit{isac\_jedit}} + +\textit{ +\#$!$/usr/bin/env bash +cd src/Pure/ \\ +echo "Building Pure.jar" \\ +../../bin/isabelle env ./build-jars \\ +echo "copying Pure.jar to contrib/jedit" \\ +cp ../../lib/classes/Pure.jar ../../contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/ \\ +echo "Building Isac.jar" \\ +cd /home/gadei/isac/isa/src/Tools/jEditC \\ +ant jar \\ +cd /home/gadei/isac/isa/src/Pure/ \\ +echo "copying Isac.jar to contrib/jedit" \\ +cp ../Tools/jEditC/contrib/jEdit/build/jars/Isac.jar ../../contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/ \\ +echo "Done!" \\ +} + +\chapter{Filestruktur f\"ur die Entwicklung des SD-Plugins}\label{files-SD-plugin} + +\textbf{src/Tools/jEditC/}build.xml\\ +\textbf{src/Tools/jEditC/}makedist\\ +\textbf{src/Tools/jEditC/}manifest.mf\\ +\textbf{src/Tools/jEditC/}README\_BUILD\\ +\textbf{src/Tools/jEditC/build/*}\\ +\textbf{src/Tools/jEditC/contrib/*}\\ +\textbf{src/Tools/jEditC/dist/*}\\ +\textbf{src/Tools/jEditC/plugin/}build.xml\\ +\textbf{src/Tools/jEditC/plugin/}changes40.txt\\ +\textbf{src/Tools/jEditC/plugin/}changes42.txt\\ +\textbf{src/Tools/jEditC/plugin/}description.html\\ +\textbf{src/Tools/jEditC/plugin/}testSDActions.java\\ +\textbf{src/Tools/jEditC/plugin/}testSD.iml\\ +\textbf{src/Tools/jEditC/plugin/}testSD.java\\ +\textbf{src/Tools/jEditC/plugin/}testSDOptionPane.java\\ +\textbf{src/Tools/jEditC/plugin/}testSDPlugin.java\\ +\textbf{src/Tools/jEditC/plugin/}testSDTextArea.java\\ +\textbf{src/Tools/jEditC/plugin/}testSDToolPanel.java\\ +\textbf{src/Tools/jEditC/plugin/}plugin\\ +\textbf{src/Tools/jEditC/plugin/}README.txt\\ +\textbf{src/Tools/jEditC/nbproject/*}\\ +\textbf{src/Tools/jEditC/src/}actions.xml\\ +\textbf{src/Tools/jEditC/src/}changes40.txt\\ +\textbf{src/Tools/jEditC/src/}changes42.txt\\ +\textbf{src/Tools/jEditC/src/}description.html\\ +\textbf{src/Tools/jEditC/src/}dockables.xml\\ +\textbf{src/Tools/jEditC/src/}testSDActions.scala\\ +\textbf{src/Tools/jEditC/src/}testSD.iml\\ +\textbf{src/Tools/jEditC/src/}testSDOptionPane.scala\\ +\textbf{src/Tools/jEditC/src/}testSDPlugin.scala\\ +\textbf{src/Tools/jEditC/src/}testSD.props\\ +\textbf{src/Tools/jEditC/src/}testSD.scala\\ +\textbf{src/Tools/jEditC/src/}testSDTextArea.scala\\ +\textbf{src/Tools/jEditC/src/}testSDToolPanel.scala\\ +\textbf{src/Tools/jEditC/src/}manifest.mf\\ +\textbf{src/Tools/jEditC/src/}README.txt\\ +\textbf{src/Tools/jEditC/src/}users-guide.xml \\ \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/msteger/bakk-arbeit/thesis-biblio.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/msteger/bakk-arbeit/thesis-biblio.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,15 @@ +{ + +%\bibliographystyle{plain} +\bibliographystyle{alpha} + + +% the names of the bib files used + +\phantomsection +\addcontentsline{toc}{chapter}{Bibliography} +\bibliography{master_thesis.bib} + +} + + diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/msteger/bakk-arbeit/thesis-conclusion.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/msteger/bakk-arbeit/thesis-conclusion.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,2 @@ +\chapter{Concluding Remarks} +... \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/msteger/bakk-arbeit/thesis-contents.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/msteger/bakk-arbeit/thesis-contents.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,25 @@ +{ +\setlength{\parskip}{3pt plus 3pt minus 3pt} % compact table of contents + +\tableofcontents + +\listoffigures +%\addcontentsline{toc}{chapter}{List of Figures} + +{ +% format sections to chapters for this scope +\titleformat{\section}{\bf\huge}{\thesection\quad}{0em}{} +\titlespacing*{\section}{0em}{-2em}{1.5em} +\def\chapter*#1{\section*{#1}} + +%\vspace*{20mm} +%\listoftables +%%\addcontentsline{toc}{chapter}{List of Tables} +% +%\vspace*{20mm} +%\lstlistoflistings +%%\addcontentsline{toc}{chapter}{List of Listings} + +} +} + diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/msteger/bakk-arbeit/thesis-intro.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/msteger/bakk-arbeit/thesis-intro.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,9 @@ +\chapter{Einf\"{u}hrung} +Europa ist bei Computer Theorem Provern (CTP) weltweit f\"uhrend, die zwei prominenten Prover sind Coq \cite{coq1999} und Isabelle \cite{Paulson:Isa94}. +Im Zuge der Weiterentwicklung der Informatik als Ingenieurs-Disziplin werden auch Anwendungsgebiete zunehmend mathematisiert \cite{db:dom-eng}, was wiederum CTP vermehrt auf den Plan ruft. +CTP sind bis dato in H\"anden eines relativ kleinen Kreises von Experten, von denen der Gro{\ss}teil wiederum im akademischen Bereich arbeitet und nur ein kleiner Teil in der Industrie. Diese Experten bevorzugen Keyboard-Shortcuts (vor Men\"us), reine Texte (ohne mathematische Sonderzeichen) und benutzen auch mit gro{\ss}em Aufwand hergestellte CTP-Entwicklungs-Umgebungen nicht, zum Beispiel die CoqIDE. + +Nachdem CTP nun unaufhaltsam in Entwicklungs-Umgebungen von Software- Ingenieuren vorzudringen beginnen (siehe zum Beispiel \cite{aichernig:uni-iist-02,aichernig:mut-test}),% \cite{wolff10-boogie}, +stellt sich die Herausforderung neu, Frontends f\"ur die t\"agliche Entwicklungsarbeit mit integrierten CTP zu entwerfen. Einer der Vorschl\"age, wie Theorem Prover mit Front-ends zu verbinden w\"are, findet sich in \cite{Aspinall:2007:FIP:1420412.1420429}. Isabelle geht einen anderen Weg, indem es sich aktuellen technischen Herausforderungen stellt \cite{makarius:isa-scala-jedit}: Multicore-Maschinen versprechen erh\"ohten Durchsatz, falls Teile von Beweisen parallel abgearbeitet werden k\"onnen. Isabelles Entwurf sieht vor, die Programmsprache Scala (insbesonders seine Actor-Library) als Bindeglied zwischen der Mathematik-Sprache SML und der g\"angisten Plattform f\"ur GUIs vor, der Java-Virtual-Maschine. + +Die Bachelorarbeit l\"auft im Rahmen des ISAC-Projektes. ISACs experimenteller Mathematik-Assistant baut auf dem SML-Teil von Isabelle auf und es ist geplant, auch sein Frontend in entsprechend geplanten Schritten an die aktuelle Entwicklung von Isabelle anzuschlie{\ss}en. Der erste Schritt geht einen Umweg, um die Technologie kennen zu lernen: Nicht ISACs Rechnungen (mit aufw\"andigen Interaktionen), sondern Backs 'structured derivations' (SD) \cite{back-grundy-wright-98} sollen auf jEdit und Isabelle aufgesetzt werden. Die Bachelorarbeit liefert die Machbarkeits-Studie f\"ur diesen Schritt. diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/msteger/bakk-arbeit/thesis-macros.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/msteger/bakk-arbeit/thesis-macros.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,67 @@ +% macros and definitions + +\newcommand\fname{\begingroup \smaller\urlstyle{tt}\Url} + +\newcommand\vname{\begingroup \smaller\urlstyle{tt}\Url} + + +% for class names, define our own url style + +\makeatletter % protect @ names + +% \url@letstyle: New URL sty to premit break at any letters. +% Based on \url@ttstyle + +\def\Url@letdo{% style assignments for tt fonts or T1 encoding +\def\UrlBreaks{\do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j\do\k\do\l% + \do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t\do\u\do\v\do\w\do\x% + \do\y\do\z% + \do\A\do\B\do\C\do\D\do\E\do\F\do\G\do\H\do\I\do\J\do\K\do\L% + \do\M\do\N\do\O\do\P\do\Q\do\R\do\S\do\T\do\U\do\V\do\W\do\X% + \do\Y\do\Z% +}% +\def\UrlBigBreaks{\do\.\do\@\do\\\do\/\do\!\do\_\do\|\do\%\do\;\do\>\do\]% + \do\)\do\,\do\?\do\'\do\+\do\=\do\#\do\:\do@url@hyp}% +\def\UrlNoBreaks{\do\(\do\[\do\{\do\<}% (unnecessary) +\def\UrlSpecials{\do\ {\ }}% +\def\UrlOrds{\do\*\do\-\do\~}% any ordinary characters that aren't usually +\Urlmuskip = 0mu plus 1mu% +} + +\def\url@letstyle{% +\@ifundefined{selectfont}{\def\UrlFont{\sf}}{\def\UrlFont{\sffamily}}\Url@letdo +} + +\makeatother % unprotect @ names + + +\newcommand\cname{\begingroup \smaller\urlstyle{let}\Url} + + +\newcommand{\imgcredit}[1] +{% +\small +[#1] +} + + +\newcommand{\chapquote}[2] +{% +\begin{quote} +\emph{% +``#1''% +}% +\begin{flushright} +{\scriptsize \sffamily [#2]}% +\end{flushright} +\end{quote} +} + + +% \urlfootnote{url}{day}{month}{year} +\newcommand{\murlfootnote}[4]{\footnote{\url{{#1}} (last visit {#4}-{#3}-{#2})}} +\newcommand{\murlfootnotebreak}[4]{\footnote{\url{{#1}}\\ \hspace*{6mm}(last visit {#4}-{#3}-{#2})}} + +% change margin command +\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]} +\let\endchangemargin=\endlist \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/msteger/bakk-arbeit/thesis-preamble.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/msteger/bakk-arbeit/thesis-preamble.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,183 @@ +\usepackage[ % set page and margin sizes + a4paper, + twoside=false, + top=10mm, + bottom=10mm, + left=20mm, + right=20mm, + bindingoffset=10mm, + head=10mm, + foot=10mm, + headsep=10mm, + footskip=10mm, + includeheadfoot, +]{geometry} + +\usepackage{times} % use PostScript fonts +%\usepackage{ngerman} % causes ! Illegal parameter number in definition of \grmn@originalTeX. \penalty l.53 \selectlanguage{austrian} +\usepackage{relsize} % relative font sizes \smaller \larger + +\usepackage[iso-8859-1]{inputenx} % so can use Umlaut chars �, � + +\usepackage{textcomp} % symbols such as \texttimes and \texteuro + +\usepackage[bf]{titlesec} +% format chapter captions (vorher \Huge) +\titleformat{\chapter}{\bf\huge}{\thechapter\quad}{0em}{} +\titlespacing*{\chapter}{0em}{-2em}{1.5em} + +% use caption and subfig (caption2 and subfigure are now obsolete) +\usepackage[ + position=bottom, + margin=1cm, + font=small, + labelfont={bf,sf}, + format=hang, + indention=0mm, +]{caption,subfig} + +\captionsetup[subfigure]{ + margin=0pt, + parskip=0pt, + hangindent=0pt, + indention=0pt, + singlelinecheck=true, +} + + + +% fancyhdr to make nice headers and footers +% and deal with long chapter names + +\usepackage{fancyhdr} % headers and footers +\pagestyle{fancy} % must call to set defaults before redefining + +\renewcommand{\headrulewidth}{0mm} +\renewcommand{\footrulewidth}{0mm} +\fancyhf{} + +\fancyhead[R]{\thepage} + +\fancyhead[L]{ + \parbox[t]{0.8\textwidth}{\nouppercase{\leftmark}} +} + + +% \usepackage{tabularx} % for better tables +\usepackage{multirow} +\usepackage{listings} % for listings of source code +\usepackage{amsmath} + + +\usepackage[austrian,english]{babel} % load babel *before* natbib or jurabib + + +\usepackage[square]{natbib} % natbib but with my own knat.bst + % made with the custom-bib package + +\usepackage{url} +\def\UrlFont{\small\ttfamily} + +\usepackage{latexsym} + +\usepackage{color} +\definecolor{lightgrey}{gray}{0.8} +% \definecolor{darkgreen}{rgb}{0,0.2,0} +% \definecolor{darkblue}{rgb}{0,0,0.2} +% \definecolor{darkred}{rgb}{0.2,0,0} + + + +\usepackage{ifpdf} + +%begin{latexonly} +\ifpdf + % pdflatex + \usepackage[pdftex]{graphicx} + \DeclareGraphicsExtensions{.pdf,.jpg,.png} + \pdfcompresslevel=9 + \pdfpageheight=297mm + \pdfpagewidth=210mm + \usepackage{rotating} % sidewaystable + \usepackage[ % hyperref should be last package loaded + pdftex, + pdftitle={Automating Test Case Generation from Transition Systems via Symbolic Execution and SAT Solving}, + pdfsubject={Master's Thesis}, + pdfauthor={Elisabeth Joebstl}, + pdfkeywords={Model-Based Testing, Conformance Testing, Automated Test Case Generation, Input Output Symbolic Transition Systems, Symbolic Execution, SMT Solving}, + bookmarks, + bookmarksnumbered, + linktocpage, + pagebackref, + colorlinks, + linkcolor=black, + anchorcolor=black, + citecolor=black, + urlcolor=black, + pdfview={FitH}, + pdfstartview={Fit}, + pdfpagemode=UseOutlines, % open bookmarks in Acrobat + plainpages=false, % avoids duplicate page number problem + pdfpagelabels, % avoids duplicate page number problem + ]{hyperref} + + \renewcommand*{\backref}[1]{} + \renewcommand*{\backrefalt}[4]{ + \ifcase #1 + (Not cited.) + \or + (Cited on page~#2.) + \else + (Cited on pages~#2.) + \fi + } + + \renewcommand*{\backrefsep}{, } + \renewcommand*{\backreftwosep}{ and~} + \renewcommand*{\backreflastsep}{ and~} + +\else + % latex + \usepackage{rotating} % sidewaystable + \usepackage{graphicx} + \DeclareGraphicsExtensions{.eps} +\fi +%end{latexonly} + + +% \includeonly{intro,biblio} % selective inclusion + + + +\newcommand{\halfh}{9.5cm} % height of figures for 2 per page +\newcommand{\thirdh}{6cm} % height of figures for 3 per page + + +\setlength{\parskip}{3pt plus 1pt minus 0pt} % vert. space before a paragraph + + +\setcounter{tocdepth}{2} % lowest section level entered in ToC % TODO FIXXME: wieder auf 1 zurcksetzen? +\setcounter{secnumdepth}{2} % lowest section level still numbered + + +\input{thesis-macros} + + +% Reduce vertical distance between items +% itemize +\let\origitemize\itemize +\def\itemize{\origitemize\itemsep0pt} +%enumerate +\let\origenumerate\enumerate +\def\enumerate{\origenumerate\itemsep0pt} + + +% FIXXME: bessere Positionierung der Graphiken +%\setcounter{totalnumber}{8} +%\setcounter{topnumber}{5} +%\setcounter{bottomnumber}{5} + +%\renewcommand{\topfraction}{0.999} +%\renewcommand{\bottomfraction}{0.999} +%\renewcommand{\textfraction}{0.0005} + diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/msteger/bakk-arbeit/thesis-title.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/msteger/bakk-arbeit/thesis-title.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,205 @@ +% --- English Title Page ------------------------------------------------ +\begin{titlepage} +\begin{center} +\vspace*{8mm} +{\LARGE Bachelor's Thesis}\\ + +\vspace{16mm} + +{\huge \bf Userinterfaces for Computer Theorem Provers\\ + Feasibility Study in the \isac-Projekt\\} + +\vspace{16mm} + +{\LARGE Marco Steger\textsuperscript{1}}\\ + +\vspace{16mm} + +{\Large +Institute for Software Technology (IST)\\ +Graz University of Technology\\ +A-8010 Graz, Austria\\} + +\vspace{16mm} + +%TODO TU - figure; Line 26, 76 +%\begin{figure}[!ht] +%\centerline{\includegraphics[width=4cm,keepaspectratio=true]{fig/tug}} +%\end{figure} + +\vspace{16mm} + +{\large +\begin{tabular}{ll} +Advisor: & Ass.Prof. Dipl.-Ing. Dr.techn.\ Bernhard Aichernig\\[0.5ex] +%TODO Aichernig???? +Co-Advisor: & Dr.techn.\ Walther Neuper +\end{tabular}} + +\vfill +{\large Graz, 30.06.2011} +\vspace{15mm} +\end{center} + +\noindent +\underline{\hspace*{3cm}}\\ +{\footnotesize +\textsuperscript{1} E-mail: m.steger@student.tugraz.at\\ +\copyright ~ Copyright 2011 by the author} + + + +% --- German Title Page ------------------------------------------------- +\selectlanguage{austrian} + +\newpage +\begin{center} +\vspace*{8mm} +{\LARGE Bachelorarbeit}\\ + +\vspace{16mm} + +{\huge \bf Userinterfaces f\"ur Computer Theorem Prover\\ + Machbarkeits-Studie im \isac-Projekt\\} + +\vspace{16mm} + +{\LARGE Marco Steger\textsuperscript{1}}\\ + +\vspace{16mm} + +{\Large +Institut f\"ur Softwaretechnologie (IST)\\ +Technische Universit\"at Graz\\ +A-8010 Graz\\} + +\vspace{16mm} + +%\begin{figure}[!ht] +%\centerline{\includegraphics[width=4cm,keepaspectratio=true]{fig/tug}} +%\end{figure} + +\vspace{16mm} + +%TODO Aichernig???? +{\large +\begin{tabular}{ll} +Gutachter: & Ass.Prof. Dipl.-Ing. Dr.techn.\ Bernhard Aichernig\\[0.5ex] +Mitbetreuer: & Dr.techn.\ Walther Neuper +\end{tabular}} + +\vspace{16mm} +{\large Graz, 30.05.2011} + +\vfill +Diese Arbeit ist in deutscher Sprache verfasst. +\end{center} + +\noindent +\underline{\hspace*{3cm}}\\ +{\footnotesize +\textsuperscript{1} E-Mail: m.steger@student.tugraz.at\\ +\copyright ~ Copyright 2011, Marco Steger} +\end{titlepage} + +\selectlanguage{english} + + +% --- English Abstract -------------------------------------------------- +\pagestyle{plain} +\pagenumbering{roman} +\newpage + +\vspace*{25mm} + +\begin{changemargin}{15mm}{15mm} +\begin{center} +{\Large\bfseries Abstract} +\end{center} +\vspace*{7mm} + +The computer theorem prover Isabelle switches from a user interface for expert users to a user interface which is more powerful and which serves integration of Isabelle into other tools for software engineers. + +This bachelor thesis in ``Telematik'' introduces the specific components underlying Isabelle's new user interface, the scala-layer for asyncronous editing of proof documents, the Java-based editor jEdit together with the respective plugin mechanisms; and the thesis documents the current organization of these components in Isabelle and sets up the whole system, Isabelle, Scala and jEdit in the IDE NetBeans copying the configuration of the Isabelle developer team. This setup is explored in the implementation of a test-plugin, and the experiences are documented in detail. + +Thus the prerequisites are given for cooperation in the further development of Isabelle's future front-end and respective integration into development tools like test case generators for software engineers. + +\vspace{5mm} +\noindent +{\large\bfseries Keywords:} +computer theorem prover, Isabelle, user-interface, jEdit, plugin, Scala, actors, asynconous communication, proof document, structured derivations + + + +% --- German Abstract --------------------------------------------------- +\selectlanguage{austrian} +\newpage + +\vspace*{10mm} + +\begin{center} +{\Large\bfseries Kurzfassung} +\end{center} +\vspace*{2mm} + +Der Theoremprover Isabelle befindet sich im \"Ubergang von einer Oberfl\"ache f\"ur akademische Benutzer zu einem generellen Frontend, das in verschiedenste softwaretechnische Tools eingebunden werden kann. + +Die vorliegende Bachelorarbeit in Telematik f\"uhrt in die speziellen, dem Frontend zugrundleliegenden Konzepte und Komponenten (Scala-Layer f\"ur asynchrone Bearbeitung von Beweisdokumenten, jEdit mit Plugins, Parser) ein, dokumentiert die momentane Organisation dieser Komponenten im Isabelle System und setzt das gesamte System in einer integrierten Entwicklungsungebung auf. Dieses Setup wird in der Implementation eines Test-Plugins erprobt. Die Erfahrungen mit diesem Test werden ausf\"uhrlich dokumentiert. + +Hiermit sind die organisatorischen und softwaretechnische Voraussetzungen daf\"ur geschaffen, dass ein Team an der Technischen Universi\"at Graz an der Entwicklung des kommenden Frontends f\"ur den Theoremprover Isabelle und seiner Integration in Entwicklungswerkzeuge teilhaben kann. + +\vspace{5mm} +\noindent +{\large\bfseries Schlagworte:} +Computer Theorem Proving, Isabelle, User-Interface, jEdit, Plugin, Scala, Actors, Asyncrone Kommunikation, Beweis-Dokument, Structured Derivations + +\selectlanguage{english} +\end{changemargin} + + +% --- Pledge ------------------------------------------------------------ +\newpage +\vspace*{20mm} + +\begin{center} +{\Large\bfseries Statutory Declaration} +\end{center} +\vspace{5mm} +\noindent +I declare that I have authored this thesis independently, that I have not used other than the declared +sources/resources, and that I have explicitly marked all material which has been quoted either +literally or by content from the used sources. + +\vspace{2cm} + +\noindent +\begin{tabular}{ccc} +\hspace*{6cm} & \hspace*{2cm} & \hspace*{6.7cm}\\ +\dotfill & & \dotfill\\ +place, date & & (signature)\\ +\end{tabular} + +\vspace{35mm} + + +\selectlanguage{austrian} + +\begin{center} +{\Large\bfseries Eidesstattliche Erkl\"arung} +\end{center} +\vspace{5mm} +\noindent +Ich erkl\"are an Eides statt, dass ich die vorliegende Arbeit selbstst\"andig verfasst, andere als die +angegebenen Quellen/Hilfsmittel nicht benutzt, und die den benutzten Quellen w\"ortlich und inhaltlich +entnommenen Stellen als solche kenntlich gemacht habe. + +\vspace{2cm} + +\noindent +\begin{tabular}{ccc} +\hspace*{6cm} & \hspace*{2cm} & \hspace*{6.7cm}\\ +\dotfill & & \dotfill\\ +Ort, Datum & & (Unterschrift)\\ +\end{tabular} + +\selectlanguage{english} diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/msteger/bakk-arbeit/thesis.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/msteger/bakk-arbeit/thesis.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,72 @@ +\documentclass[11pt]{report} +%\usepackage{ngerman} +\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} +\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} + +\include{thesis-preamble} + +\begin{document} + +\lstset{ % set parameters for listings + language=, + basicstyle=\small, + tabsize=2, + xleftmargin=2mm, + xrightmargin=2mm, + float=htb, + frame=shadowbox, + framexleftmargin=2mm, + rulesepcolor=\color{lightgrey}, + numbers=left, + numberstyle=\scriptsize, + extendedchars, + breaklines, + showtabs=false, + showspaces=false, + showstringspaces=false, + keywordstyle=\bfseries, + identifierstyle=\ttfamily, + stringstyle=, + captionpos=b, + abovecaptionskip=\abovecaptionskip, + belowcaptionskip=\belowcaptionskip, + aboveskip=\floatsep, +} + + +%\frontmatter +\normalsize +\pagestyle{empty} % for title pages + +\pagenumbering{alph} +\include{thesis-title} % Title Pages, Abstracts, Pledge +\include{thesis-acknowl} % Acknowledgements +\include{thesis-contents} % Table of Contents, List of Figures, List of Tables + + +%\mainmatter +\pagestyle{fancy} % for main pages +\pagenumbering{arabic} % for main pages + +\include{thesis-intro} % Introduction +\include{content} +% \include{your main files} + +%\include{thesis-conclusion} % Conclusion and Future Work + + +\appendix +% \noappendicestocpagenum +% \addappheadtotoc + +\include{thesis-appendix} % Appendix A + + +%\backmatter +\include{thesis-biblio} % Bibliography +%%%\bibliographystyle{plain} +%%%\bibliography{master_thesis} +% \include{glossary} % Glossary +% \include{index} % Index + +\end{document} \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/msteger/bakk-plan.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/msteger/bakk-plan.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,141 @@ +\documentclass{article} +\usepackage{a4} +\usepackage{times} +\usepackage{latexsym} + +\bibliographystyle{alpha} +\usepackage{graphicx} + +\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} +\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} +\def\Problem{ {\tt Problem }} + + +\title{Userinterfaces f\"ur Computer Theorem Prover\\ + Machbarkeits-Studie im Isac-Projekt +} + +\author{Marco Steger\\ +Bachelorarbeit Telematik\\ +am Institut f\"ur Softwaretechnologie\\ +TU Graz} + +\begin{document} +\maketitle +%\newpage +\section{Zur Aufgabenstellung der Bachelorarbeit}\label{intro} +Computer Theorem Prover (CTP) sind bis dato in H\"anden eines relativ kleinen Kreises von Experten, von denen der Gro{\ss}teil wiederum im akademischen Bereich arbeitet und nur ein kleiner Teil in der Industrie. Diese Experten bevorzugen Keyboard-Shortcuts (vor Men\"us), reine Texte (ohne mathematische Sonderzeichen) und benutzen auch mit gro{\ss}em Aufwand hergestellte CTP-Entwicklungs-Umgebungen nicht, zum Beispiel die CoqIDE. + +Nachdem CTP nun unaufhaltsam in Entwicklungs-Umgebungen von Software-Ingenieuren vorzudringen beginnen, stellt sich die Herausforderung neu, Frontends f\"ur die t\"agliche Entwicklungsarbeit mit integrierten CTP zu entwerfen. +Isabelle stellt sich dieser Herausforderung motiviert durch eine aktuelle technische Entwicklung: Multicore-Maschinen versprechen erh\"ohten Durchsatz, falls Teile von Beweisen parallel abgearbeitet werden k\"onnen. Isabelles Entwurf sieht vor, die Programmsprache Scala (insbesonders seine Actor-Library) als Bindeglied zwischen der Mathematik-Sprache SML und der g\"angisten Plattform f\"ur GUIs vor, der Java-Virtual-Maschine. + +Die Bachelorarbeit l\"auft im Rahmen des ISAC-Projektes. ISACs experimenteller Mathematik-Assistant baut auf dem SML-Teil von Isabelle auf und es ist geplant, auch sein Frontend in entsprechend geplanten Schritten an die aktuelle Entwicklung von Isabelle anzuschlie{\ss}en. Der erste Schritt geht einen Umweg, um die Technologie kennen zu lernen: Nicht ISACs Rechnungen (mit aufw\"andigen Interaktionen), sondern Backs 'structured derivations' sollen auf jEdit und Isabelle aufgesetzt werden. Die Bachelorarbeit liefert die Machbarkeits-Studie f\"ur diesen Schritt. + +%\newpage + +\section{Ist-Zustand zu Projektbeginn} +ISAC wird als Eclipse-Projekt entwickelt, das das JavaSwing-Frontend und auch die SML-Mathematik-Engine (samt einer alten Isabelle-Version) umfasst. Isabelles kommende jEdit/Scala-Technologie ist schwer in Eclipse zu integrieren. Zwei Frontends, das alte JavaSwing und das neue jEdit, st\"oren sich gegenseitig in einer einzigen Entwicklungs-Umgebung. + +Sowohl zu jEdit als auch zu Scala und NetBeans bestehen keine Erfahrungen im ISAC-Projekt. + +\section{Planung: Soll-Zustand am Projektende} +ISAC ist in die Isabelle-Entwicklung integriert, die ISAC-Entwicklung l\"auft in einem updatebaren Repository von Isabelle. F\"ur das in Entwicklung befindliche jEdit-Frontend von Isabelle ist ein NetBeans-Projekt aufgesetzt. +Wesentliche Vorarbeiten haben die Herausforderungen gekl\"art, die sich aus der Zielsetzung ergeben: Backs 'structured derivations' \"uber das neue jEdit-GUI eingeben und von Isabelle checken lassen. + +%\newpage + +\section{Milestones und Arbeitsprotokolle} +\subsection{Inhaltliche Voraussetzungen erarbeitet: am 27.09.2010} +\begin{itemize} +\item Kenntnis der Grundlagen und Anwendung von CTP: am 03.08.2010 +\item Charakteristika der Programmsprache Scala: 27.09.2010 +\item Scala Actors: am 12.08.2010 +\end{itemize} +\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} +\hline +Datum & T\"atigkeit & Einheiten \\ \hline +12.07.2010 & Meeting: erste Besprechung und Erklärungen zu Isabelle, Isac und CTPs & 2 \\ \hline +15.07.2010 & Recherche über Isabelle und CTPs & 3 \\ \hline +20.07.2010 & Meeting: Besprechen der grundsätzlichen Vorgangsweise und Ziele & 1 \\ \hline +23.07.2010 & Isabelle: Ziele, Techniken (ML) und Zusammenhänge mit Isac abklären & 1 \\ \hline +30.07.2010 & Ende der Einarbeitungstage: weitere Vorgensweise über Backs 'structured derivations'; Begriffserklärung & 3 \\ \hline +01.08.2010 & Recherche: Buch für Scala & 2 \\ \hline +03.08.2010 & Isabelle bestehende Technologie studieren & 4 \\ \hline +05.08.2010 & Einarbeiten in Scala: Unterschiede zu Java indentifizieren & 1 \\ \hline +06.08.2010 & Einarbeiten in Scala: Unterschiede zu Java indentifizieren, erste Beispielfiles & 4 \\ \hline +08.08.2010 & Einarbeiten in Scala: funktionale Seite von Scala & 2 \\ \hline +09.08.2010 & Einarbeiten in Scala: Testfiles mit Scala-Swing & 5 \\ \hline +12.08.2010 & Studieren von Papers zu Scala Actors & 3 \\ \hline +24.09.2010 & Scala: Arbeiten mit Klassen und Schnittstellen & 3 \\ \hline +25.09.2010 & Scala: Experimente mit Java in Scala-Source & 6 \\ \hline +27.09.2010 & Scala: Testfiles zu "Funktional vs Imperativ" & 4 \\ \hline + & Anzahl der Einheiten & 44 \\ +\hline +\end{tabular} + + +\subsection{Technische Voraussetzungen hergestellt: am 02.08.2010} +\begin{itemize} +\item Isabelle installiert, Filestruktur bekannt: am 02.08.2010 +\item Scala in NetBeans eingebunden: am 22.07.2010 +\item Mercurial installiert und einrichten des Repositories: 19.07.2010 +\end{itemize} +\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} +\hline +Datum & T\"atigkeit & Einheiten \\ \hline +19.07.2010 & Beginn der Installationsarbeiten: Repo klonen und testen & 6 \\ \hline +20.07.2010 & Installationsarbeiten, Einarbeiten in Filestruktur & 7 \\ \hline +21.07.2010 & Einarbeiten in Filestruktur & 6 \\ \hline +22.07.2010 & Vorbereitungen: NetBeans, JDK und Scala installieren. Scala in NetBeans integrieren & 8 \\ \hline +23.07.2010 & Isabelle-jEdit-Plugin mittels NetBeans ausführen: testen & 5 \\ \hline +27.07.2010 & Isabelle-jEdit-Plugin: Änderungen an der Projektstruktur & 7 \\ \hline +28.07.2010 & Experimente mit Isabelle-jEdit-Plugin & 6 \\ \hline +29.07.2010 & Identifikations der Parse-Einstiegsstelle & 5 \\ \hline +30.07.2010 & Experimente mit Isabelle-jEdit-Plugin, Besprechung über Erfahrungen mit Filestruktur & 4 \\ \hline +02.08.2010 & Installationen und einrichten des Repos auf meinen Laptop & 6 \\ \hline \hline + & Anzahl der Einheiten & 60 \\ +\hline +\end{tabular} + +\subsection{NetBeans-Projekt aufgesetzt }% am ..(*)...} +\begin{itemize} +\item Grundlegende Projektstruktur f\"ur ISAC hergestellt: am 02.08.2010 +\item jEdit-Plugin: XML-Files für ISAC vorbereitet: am 22.07.2010 +\item jEdit-Plugin: Source files geschrieben: 19.07.2010 +\end{itemize} +\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} +\hline +Datum & T\"atigkeit & Einheiten \\ \hline +10.08.2010 & Projektstruktur anlegen, build.xml anpassen & 7 \\ \hline +11.08.2010 & jEdit-Plugin-Struktur studieren: Howto durcharbeiten & 5 \\ \hline +21.08.2010 & bestehende jEdit-Plugins (Java) durcharbeiten & 3 \\ \hline +22.08.2010 & Kopieren des Isabelle-jEdit-Plugins, Umarbeiten für ISAC & 3 \\ \hline +24.08.2010 & Umarbeiten des Isabelle-Plugins für ISAC & 6 \\ \hline +26.08.2010 & Problem mit Isabelle-Umgebungsvariable: Suche nach Lösungen & 3 \\ \hline +28.08.2010 & Recherchen zum Umgebungsvariable-Problem, Arbeiten mit den Isabelle-Shell-Skripts & 2 \\ \hline +29.08.2010 & Experimente mit den Path-Varialbe der jvm & 3 \\ \hline +30.08.2010 & Isabelle-jEdit-Plugin endlich vollständig lauffähig gebracht & 4 \\ \hline +01.09.2010 & Arbeiten an der jEdit-ISAC-Projektstruktur & 3 \\ \hline +04.09.2010 & Umarbeiten des Isabelle-Plugins für ISAC & 5 \\ \hline +20.09.2010 & Einrichten des Laptops für Isabelle-Isac & 4 \\ \hline +22.09.2010 & Meeting: Fortschrittsbericht, kurze Einführung für Mitstreiter & 3 \\ \hline + +29.09.2010 & Neue Vorgehensweise: QuickNotepad-Plugin(QN) wird in Scala übersetzt und für ISAC entsprechend angepasst: Arbeit an den XML-Files & 4 \\ \hline +30.09.2010 & QN: Start mit übersetzten der Sourcefiles & 5 \\ \hline +02.10.2010 & QN: Übersetzten der Sourcefiles & 6 \\ \hline +04.10.2010 & QN: Übersetzten der Sourcefiles: Problem bei Interface & 3 \\ \hline +05.10.2010 & QN: QN vollständig in Scala übersetzt, testen & 2 \\ \hline \hline + & Anzahl der Einheiten & 71 \\ +\hline +\end{tabular} + +\subsection{Experimentelle Parser implementiert}% am ..(*)...} +\subsection{Pr\"asentation der Arbeit im IST-Seminar }% am ..(*)...} +%\newpage + +\section{Zusammenfassung und R\"uckblick} + + +%\bibliography{CTP-userinterfaces} +%\bibliography{bib/math-eng,bib/bk,bib/RISC_2,bib/isac,bib/pl,bib/math,bib/pl} +\end{document} \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/msteger/bakk-presentation.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/msteger/bakk-presentation.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,445 @@ +% /usr/share/doc/latex-beamer/solutions/conference-talks/conference-ornate-20min.en.tex + +\documentclass{beamer} +\mode +{ + \usetheme{Hannover} + \setbeamercovered{transparent} +} +\usepackage[english]{babel} +\usepackage[latin1]{inputenc} +\usepackage{times} +\usepackage{ngerman} +\usepackage[T1]{fontenc} +%\usepackage{graphicx} + +\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} +\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} + +\title[Isabelle Frontend] +{Userinterfaces \\f\"ur Computer Theorem Prover,\\ + Machbarkeits-Studie im \isac-Projekt +} +\subtitle{Bachelorarbeit Telematik} + +\author{Marco Steger} +\institute{Institut f\"ur Software Technologie\\ + Technische Universit\"at Graz} + +\date{21.06.2011} +%\subject{Formal specification of math assistants} +% This is only inserted into the PDF information catalog + +% Delete this, if you do not want the table of contents to pop up at +% the beginning of each subsection: +\AtBeginSubsection[] +{ + \begin{frame} + \frametitle{Outline} + \tableofcontents[currentsection,currentsubsection] + \end{frame} +} + + +% If you wish to uncover everything in a step-wise fashion, uncomment +% the following command: +%\beamerdefaultoverlayspecification{<+->} + + +\begin{document} +\begin{frame} + \titlepage +\end{frame} + +\begin{frame} + \frametitle{Outline} + \tableofcontents + % You might wish to add the option [pausesections] +\end{frame} + +\section[Stutus quo]{Ausgangssituation: das k\"unftige Isabelle Front-end} +\subsection[Isabelle]{Der Theoremprover Isabelle} +\begin{frame} + \frametitle{Der Theoremprover Isabelle} +\begin{itemize} +\item Anwendungen von Isabelle + \begin{itemize} + \item Mechanisieren von Mathematik Theorien + \begin{itemize} + \item nat\"urliche, reelle, komplexe Zahlen, Listen, Lattices, \dots + \item Gr\"obner Basen, Integral/Differential, Taylorreihen, \dots + \item High Order Logics, Logic of Computable Functions, \dots + \end{itemize} +\pause + \item Math.Grundlagen f\"ur Softwaretechnologie + \begin{itemize} + \item Hoare Logic, Temporal Logic of Actions, Hoare for Java + \item Theory for Unix file-system security, for state spaces, \dots + \item Archive of Formal Proofs {\tiny\tt http://afp.sourceforge.net} + \end{itemize} + \end{itemize} +\pause +\item Integration von Isabelle in Entwicklungstools + \begin{itemize} + \item Boogie --- Verification Condition Generator + \item $\mathbf{\pi}d.e$ Projekt: Unterst\"utzung Domain-spezifischen CTPs + \item Test Case Generators (TUG) ? + \end{itemize} +\pause +\item Isar, die Beweissprache von Isabelle + \begin{itemize} + %\item Demo $\sqrt{2}\not\in{\cal R}\;\;\;$ + \item Demo 'Allgemeine Dreiecke' +\pause +\alert{Beweisteile asynchron interpretiert} + \end{itemize} +\end{itemize} +\end{frame} + +\subsection[Scala-Layer]{Die Konzeption des Scala-Layers} +\begin{frame}\frametitle{Die Konzeption des Scala-Layers} +\begin{figure} +\begin{center} +\includegraphics[width=100mm]{fig-reuse-ml-scala-SD} +\end{center} +%\nocaptionrule\caption{Reuse of Isabelle/Isar's Scala API.} +\label{fig-reuse-ml-scala} +\end{figure} +\end{frame} + +\begin{frame}\frametitle{Kommunikationsprotokoll \\Scala --- SML} +\begin{itemize} +\item Das Protokoll ist \textbf{asynchron}: \\ +verschiedene Teile eines Beweises werden in verschiedenen Threads interpretiert +\pause +\item Die Threads werden von Scala-\textbf{``Actors''} verwaltet (``Actors'' von der Programmsprache Erlang \"ubernommen) +\pause +\item \alert{Das Protokoll hat \textbf{kein API} nach aussen:}\\ +\pause +Der Scala-Layer zielt auf konsistente Verwaltung gro\3er, verteilter Theorie-Bibliotheken\\ +\pause +Anwendungsprogrammierer sollen nicht hier eingreifen, sondern Isabelle Theorien erweitern\\ +\pause +\alert{\textit{!~Grunds\"atzliches Problem f\"ur das Projekt ``SD''~!}} +\end{itemize} +\end{frame} + +\subsection[Integration]{Isabelles Filestruktur im \"Ubergangsstadium} + + +\begin{frame}\frametitle{Isabelle Files: *.scala} +{\tiny +\textbf{\$ find -name ``*.scala''}\\ +./src/Pure/General/xml.scala\\ +./src/Pure/General/linear\_set.scala\\ + +./src/Pure/General/symbol.scala\\ +./src/Pure/General/exn.scala\\ +./src/Pure/General/position.scala\\ +./src/Pure/General/scan.scala\\ +./src/Pure/General/xml\_data.scala\\ +./src/Pure/General/yxml.scala\\ +./src/Pure/General/markup.scala\\ +:\\ +./src/Pure/General/sha1.scala\\ +./src/Pure/General/timing.scala\\ +./src/Pure/General/pretty.scala\\ +.\\ +./src/Pure/Concurrent/volatile.scala\\ +./src/Pure/Concurrent/future.scala\\ +./src/Pure/Concurrent/simple\_thread.scala\\ +.\\ +./src/Pure/Thy/html.scala\\ +./src/Pure/Thy/completion.scala\\ +./src/Pure/Thy/thy\_header.scala\\ +./src/Pure/Thy/thy\_syntax.scala\\ +./src/Pure/Isac/isac.scala\\ +./src/Pure/library.scala\\ +.\\ +./src/Pure/Isar/keyword.scala\\ +./src/Pure/Isar/outer\_syntax.scala\\ +./src/Pure/Isar/token.scala\\ +./src/Pure/Isar/parse.scala\\ +.\\ +./src/Pure/System/gui\_setup.scala\\ +./src/Pure/System/isabelle\_system.scala\\ +./src/Pure/General/timing.scala\\ +./src/Pure/General/pretty.scala\\ +.\\ +./src/Pure/Concurrent/volatile.scala\\ +./src/Pure/Concurrent/future.scala\\ +./src/Pure/Concurrent/simple\_thread.scala\\ +.\\ +./src/Pure/Thy/html.scala\\ +./src/Pure/Thy/completion.scala\\ +./src/Pure/Thy/thy\_header.scala\\ +./src/Pure/Thy/thy\_syntax.scala\\ +./src/Pure/Isac/isac.scala\\ +./src/Pure/library.scala\\ +.\\ +./src/Pure/Isar/keyword.scala\\ +./src/Pure/Isar/outer\_syntax.scala\\ +./src/Pure/Isar/token.scala\\ +./src/Pure/Isar/parse.scala\\ +.\\ +./src/Pure/System/gui\_setup.scala\\ +./src/Pure/System/isabelle\_system.scala\\ +./src/Pure/System/swing\_thread.scala\\ +./src/Pure/System/download.scala\\ +./src/Pure/System/session\_manager.scala\\ +./src/Pure/System/standard\_system.scala\\ +./src/Pure/System/isabelle\_syntax.scala\\ +./src/Pure/System/session.scala\\ +./src/Pure/System/platform.scala\\ +./src/Pure/System/cygwin.scala\\ +./src/Pure/System/event\_bus.scala\\ +./src/Pure/System/isabelle\_process.scala\\ +.\\ +./src/Pure/PIDE/document.scala\\ +./src/Pure/PIDE/markup\_tree.scala\\ +./src/Pure/PIDE/text.scala\\ +./src/Pure/PIDE/command.scala\\ +./src/Pure/PIDE/isar\_document.scala +} +\end{frame} + + + +\subsection[jEdit]{Das Frontend: jEdit und ``plugins''} +\begin{frame}\frametitle{Das Frontend: \\jEdit und ``plugins''} +\begin{itemize} +\item \textbf{jEdit} \textit{``is a mature programmer's text editor with hundreds (counting the time developing \textbf{plugins}) of person-years of development behind it.''} +\pause +\item Also: Die Funktionalit\"at von jEdit wird \"uber ``plugins'' bestimmt +\pause +\item Isabelle verwendet eine Reihe davon + \begin{itemize} + \item der Parser ``Sidekick'' + \item Console f\"ur jEdit-Komponenten + \item + Scala + \item + Ml + \item etc + \end{itemize} +\pause +\item jEdit ist ``open source'' mit gro\3er Community +\pause +\item Anfragen an Mailinglisten von jEdit (ohne Scala-plugin!) und Isabelle +\end{itemize} +\end{frame} + +\section[Projektarbeit]{Projekt: Vorarbeiten f\"ur ``structured derivations'' (SD)} +\subsection[Aufgabenstellung]{Definition der Aufgabenstellung} +\begin{frame}\frametitle{Definition der Aufgabenstellung} +Aufgabenstellung: \\Feasibility-Study zur Implementierung von ``structured~derivations'' (SD) in Isabelle.\\ + +\textit{``Die Implementierung soweit vorantreiben wie im gegebenen Studenausma\3 m\"oglich~!''}\\ + +Milestones: +\begin{enumerate} +\item Relevante Isabelle Komponenten identifizieren und studieren +\item Installation der Standard-Komponenten +\item Entwicklungsumgebung vom Isabelle-Team kopieren +\item Relevante Komponenten implementieren + \begin{itemize} + \item jEdit Plugin f\"ur SD + \item zugeh\"origen Parser + \item nicht vorgesehen: SD-Interpreter in Isar (SML) + \end{itemize} +\end{enumerate} +\end{frame} + +%\subsection[Beispiel SD]{Beispiel ``structured derivation'' (SD)} +\begin{frame}\frametitle{Beispiel ``structured~derivation''~(SD)} +{\footnotesize +\begin{tabbing} +123,\=1234\=1234\=1234\=1234\=1234\=1234\=123\=\kill +\>$\bullet$\>Simplify $(1 - x) * (x ^ 2 + 1) + x ^ 3 - x ^ 2$\\ +\> \>$(1 - x) * (x ^ 2 + 1) + x ^ 3 - x ^ 2$\\ +\>$\equiv$\>$\{ {\it RewriteSet}\;{\it purify}\}$\\ +\> \>$(1 + -1 * x) * (x ^ 2 + 1) + x ^ 3 + -1 * x ^ 2$\\ +\>$\equiv$\>$\{{\it RewriteSet}\;{\it simplify\_pure}\}$\\ +\> \>$\bullet$\>$(1 + -1 * x) * (x ^ 2 + 1) + x ^ 3 + -1 * x ^ 2$\\ +\> \>$\equiv$\>$\{{\it RewriteSet}\;{\it expand\_poly\_}\}$ \\ +\> \> \>$1 * x ^ 2 + 1 * 1 + (-1 * x * x ^ 2 + -1 * x * 1) + x ^ 3 +-1 * x ^ 2$\\ +\> \>$\equiv$\>\vdots\\ +\> \> \>$1 + -1 * x + 0 * x ^ 2 + 0 * x ^ 3$\\ +\> \>$\equiv$\>$\{{\it RewriteSet}\;{\it reduce\_012\_}\}$ \\ +\> \> \>$1 + -1 * x$\\ +\>\dots\>$1 + -1 * x$\\ +\>$\equiv$\>$\{{\it RewriteSet}\;{\it beautify}\}$\\ +\> \>$1-x$ +\end{tabbing} +} +\end{frame} + +\subsection[NetBeans]{Konfiguration des Projektes in der NetBeans IDE} +\begin{frame}\frametitle{Konfiguration in NetBeans} +Mehrere Run-Konfigurationen sind praktisch: +\begin{itemize} +\item Start von jEdit + Plug-ins aus NetBeans + \begin{itemize} + \item Exekution der fertig kompilierten jEdit.jar + \item Exkution der eingebundenen jEdit Sources: \\zum Debuggen ! + \end{itemize} +\item Start von jEdit aus der Konsole +\end{itemize} +\vspace{0.2cm} \pause +Dementsprechend komplex sind die Konfigurations-Files: +\begin{center} +\begin{tabular}{l r l} +build.xml & 102 & LOCs\\ +project.xml & 25 & LOCs\\ +project.properties & 85 & LOCs\\ +build-impl.xml & 708 & LOCs\\ + & & (teilw. automatisch generiert)\end{tabular} +\end{center} +\end{frame} + +\subsection[Implementation]{Komponenten zur Implementation von SD} + +\begin{frame}\frametitle{Die Konzeption des Scala-Layers} +\begin{figure} +\includegraphics[width=100mm]{fig-jedit-plugins-SD} +\label{Frontend des jEdit} +\end{figure} +\end{frame} + +\begin{frame}\frametitle{jEdit-Plugin} +\begin{itemize} +\item Aufbau: Ein Plugin besteht aus: +\pause + \begin{itemize} + \item Source-Files: \textbf{Scala} + \pause + \item Property file + \pause + \item XML-Files: \textit{``glue code''} zwischen \textbf{Java} (Editor) und \textbf{Scala} (Plugin) + \end{itemize} +%\pause +%\item Bestehendes Java-Plugin in Scala transferieren +%\pause +%\item Neue Ordnerstruktur in bestehende Isabelle-Ordner-Hierachie integrieren +\end{itemize} +\end{frame} + +\begin{frame}\frametitle{Sources des jEdit Plugins} +{\tiny +src/Tools/jEditC\textbf{\$ ls -l *}\\ +build.xml\\ +%makedist\\ +%manifest.mf\\ +%README\_BUILD\\ +\textbf{build/*}\\ +\textbf{contrib/*}\\ +\textbf{dist/*}\\ +\textbf{plugin/}build.xml\\ +\textbf{plugin/}changes40.txt\\ +\textbf{plugin/}changes42.txt\\ +\textbf{plugin/}description.html\\ +\textbf{plugin/}IsacActions.java\\ +\textbf{plugin/}Isac.iml\\ +\textbf{plugin/}Isac.java\\ +\textbf{plugin/}IsacOptionPane.java\\ +\textbf{plugin/}IsacPlugin.java\\ +\textbf{plugin/}IsacTextArea.java\\ +\textbf{plugin/}IsacToolPanel.java\\ +\textbf{plugin/}plugin\\ +\textbf{plugin/}README.txt\\ +\textbf{nbproject/*}\\ +\textbf{src/}actions.xml\\ +\textbf{src/}changes40.txt\\ +\textbf{src/}changes42.txt\\ +\textbf{src/}description.html\\ +\textbf{src/}dockables.xml\\ +\textbf{src/}IsacActions.scala\\ +\textbf{src/}Isac.iml\\ +\textbf{src/}IsacOptionPane.scala\\ +\textbf{src/}IsacPlugin.scala\\ +\textbf{src/}Isac.props\\ +\textbf{src/}Isac.scala\\ +\textbf{src/}IsacTextArea.scala\\ +\textbf{src/}IsacToolPanel.scala\\ +\textbf{src/}manifest.mf\\ +\textbf{src/}README.txt\\ +\textbf{src/}users-guide.xml +} +\end{frame} + +\begin{frame}\frametitle{Anforderungen an das Versuchs-Plugin} +Folgende Funktionalit\"at wurde zu Testzwecken umgesetzt: +\pause +\begin{itemize} + \item Grunds\"atzlicher Aufbau eines GUIs + \pause + \item Kopieren von Text zwischen den einzelnen Buffers + \pause + \begin{itemize} + \item \alert{Somit auch Zugriff auf andere Plugins!} + \end{itemize} + \pause + \item Ansatz f\"ur die Einbindung des SD-Parsers + \pause + \begin{itemize} + \item Zugriff auf Isabelle-Pure: \alert{parsen von SD parallel zu Isabelle/Isar} + \end{itemize} + \pause + \item \textit{DEMO} +\end{itemize} +\end{frame} + + +%\subsection[Parser]{Ein funktionaler Parser f\"ur SD (in SML)} + +\section[Summary]{Zusammenfassung} +\begin{frame}\frametitle{Zusammenfassung} +Folgende Milestones wurden erfolgreich abgeschlossen: +\begin{enumerate} +\item Relevante Isabelle Komponenten dokumentiert +\pause +\item Installation der Standard-Komponenten: + \begin{itemize} + \item Mercurial Versioncontrol + \item NetBeans IDE + \item Standard Isabelle Bundle + \end{itemize} + \pause +\item Entwicklungsumgebung vom Isabelle-Team kopieren + \begin{itemize} + \item Isabelle-Sources vom Repository M\"unchen (Java, Scala, ML) + \item jEdit als NetBeans Projekt definiert + \end{itemize} + \pause +\item Relevante Komponenten implementieren + \begin{itemize} + \item jEdit Plugin f\"ur SD + \item Verbindung des Plugins zu Isabelle + \item zugeh\"origen Parser: nur ein Test in SML + \end{itemize} +\end{enumerate} +\end{frame} + +\begin{frame}\frametitle{Zusammenfassung} +\pause +\alert{$\mathbf{- - -}$}\\ +Aus Zeitgr\"unden nicht m\"oglich: ein komplettes SD-Plugin;\\ +dazu w\"are auch ein Interpreter auf der ML-Seite n\"otig.\\ +\vspace{0.3cm} +\alert{$\mathbf{+ + +}$}\\ +\pause +Voraussetzungen f\"ur k\"unftige Entwicklung geschaffen: +\begin{enumerate} +\item f\"ur die Implementation von ``structured derivations'' in Isabelle \dots +\item \dots als Vorarbeit f\"ur jEdit als k\"unftiges \isac-Frontend +\item f\"ur Mitarbeit an k\"unftiger Integration von Isabelle in Entwicklungswerkzeuge (Testcase-Generation etc). +\end{enumerate} +\end{frame} + +\begin{frame}\frametitle{} +\begin{center} +\LARGE{Danke f\"ur die Aufmerksamkeit !} +\end{center} +\end{frame} + +\end{document} + + diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/msteger/bibliografie.bib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/msteger/bibliografie.bib Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,15 @@ +@article{wolff10-boogie, + author = {Sascha B{\"o}hme and + Michal Moskal and + Wolfram Schulte and + Burkhart Wolff}, + title = {HOL-Boogie - An Interactive Prover-Backend for the Verifying + C Compiler}, + journal = {J. Autom. Reasoning}, + volume = {44}, + number = {1-2}, + year = {2010}, + pages = {111-144}, + ee = {http://dx.doi.org/10.1007/s10817-009-9142-9}, + bibsource = {DBLP, http://dblp.uni-trier.de} +} \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/msteger/dirs-all-jars.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/msteger/dirs-all-jars.txt Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,79 @@ +----- for "isabelle jedit &"; contained in Isabelle_bundle +./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jedit.jar +./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/LatestVersion.jar +./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/SideKick.jar +./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/Console.jar +./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/Pure.jar +./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/Isac.jar +./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/scala-compiler.jar +./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/Isabelle-jEdit.jar +./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/cobra.jar +./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/js.jar +./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/Hyperlinks.jar +./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/scala-swing.jar +./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/scala-library.jar +./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/QuickNotepad.jar +./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/ErrorList.jar +----- scala system; contained in Isabelle_bundle +./contrib/scala-2.8.1.final/misc/sbaz/scala-bazaars.jar +./contrib/scala-2.8.1.final/misc/sbaz/sbaz-tests.jar +./contrib/scala-2.8.1.final/misc/scala-devel/plugins/continuations.jar +./contrib/scala-2.8.1.final/lib/scala-compiler.jar +./contrib/scala-2.8.1.final/lib/scalap.jar +./contrib/scala-2.8.1.final/lib/scala-swing.jar +./contrib/scala-2.8.1.final/lib/scala-library.jar +./contrib/scala-2.8.1.final/lib/jline.jar +./contrib/scala-2.8.1.final/lib/scala-dbc.jar +./contrib/scala-2.8.1.final/src/scala-library-src.jar +./contrib/scala-2.8.1.final/src/scala-swing-src.jar +./contrib/scala-2.8.1.final/src/scala-compiler-src.jar +./contrib/scala-2.8.1.final/src/scala-dbc-src.jar +./contrib/scala-2.8.1.final/src/sbaz-src.jar +----- Isars entry to SML from Scala-layer; created according to 3.3.#3{enumerate} +./lib/classes/isabelle-scala.jar +./lib/classes/Pure.jar +===== all below for NetBeans +----- standard Isabelle, started by in NetBeans + description in 2.2.2 +./src/Tools/jEdit/dist/jars/jedit.jar +./src/Tools/jEdit/dist/jars/SideKick.jar +./src/Tools/jEdit/dist/jars/Console.jar +./src/Tools/jEdit/dist/jars/Pure.jar +./src/Tools/jEdit/dist/jars/scala-compiler.jar +./src/Tools/jEdit/dist/jars/Isabelle-jEdit.jar +./src/Tools/jEdit/dist/jars/cobra.jar +./src/Tools/jEdit/dist/jars/js.jar +./src/Tools/jEdit/dist/jars/Hyperlinks.jar +./src/Tools/jEdit/dist/jars/scala-swing.jar +./src/Tools/jEdit/dist/jars/scala-library.jar +./src/Tools/jEdit/dist/jars/ErrorList.jar +----- source of jEdit, required for in NetBeans; + adapted from NetBeans' webpages, + description in 2.2.3.#5 +./src/Tools/jEditC/contrib/jEdit/build/jars/SideKick.jar +./src/Tools/jEditC/contrib/jEdit/build/jars/Console.jar +./src/Tools/jEditC/contrib/jEdit/build/jars/Pure.jar +./src/Tools/jEditC/contrib/jEdit/build/jars/Isac.jar +./src/Tools/jEditC/contrib/jEdit/build/jars/QuickNPScala.jar +./src/Tools/jEditC/contrib/jEdit/build/jars/scala-compiler.jar +./src/Tools/jEditC/contrib/jEdit/build/jars/Isabelle-jEdit.jar +./src/Tools/jEditC/contrib/jEdit/build/jars/cobra.jar +./src/Tools/jEditC/contrib/jEdit/build/jars/js.jar +./src/Tools/jEditC/contrib/jEdit/build/jars/Hyperlinks.jar +./src/Tools/jEditC/contrib/jEdit/build/jars/scala-swing.jar +./src/Tools/jEditC/contrib/jEdit/build/jars/scala-library.jar +./src/Tools/jEditC/contrib/jEdit/build/jars/ErrorList.jar +./src/Tools/jEditC/contrib/jEdit/build/jEdit.jar +----- demo plugin, started by in NetBeans + description in 2.2.3.#4 +./src/Tools/jEditC/dist/jars/SideKick.jar +./src/Tools/jEditC/dist/jars/Console.jar +./src/Tools/jEditC/dist/jars/Pure.jar +./src/Tools/jEditC/dist/jars/Isac.jar +./src/Tools/jEditC/dist/jars/scala-compiler.jar +./src/Tools/jEditC/dist/jars/cobra.jar +./src/Tools/jEditC/dist/jars/js.jar +./src/Tools/jEditC/dist/jars/Hyperlinks.jar +./src/Tools/jEditC/dist/jars/scala-swing.jar +./src/Tools/jEditC/dist/jars/scala-library.jar +./src/Tools/jEditC/dist/jars/ErrorList.jar diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/msteger/fig-jedit-plugins-SD.odg Binary file doc-isac/msteger/fig-jedit-plugins-SD.odg has changed diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/msteger/fig-jedit-plugins-SD.png Binary file doc-isac/msteger/fig-jedit-plugins-SD.png has changed diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/msteger/fig-reuse-ml-scala-SD.odg Binary file doc-isac/msteger/fig-reuse-ml-scala-SD.odg has changed diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/msteger/fig-reuse-ml-scala-SD.png Binary file doc-isac/msteger/fig-reuse-ml-scala-SD.png has changed diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/msteger/official_docu/Doku.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/msteger/official_docu/Doku.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,540 @@ +\chapter{Definition der Aufgabenstellung} +\section{Detaillierte Beschreibung der Aufgabenstellung} +Zu Beginn des Projekts wurden einige Vorgaben und Ziele des Projektes erarbeitet und im Laufe des Projekts etwas angepasst. Es wurde bewusst auf eine zu einschr\"ankende Aufgabenstellung verzichtet, da Entwicklungen und Erarbeitungen von verschiedenen Umsetzungsstrategien erw\"unscht war. + +Hauptaugenmerk war dabei auf die Erstellung eines jEdit-Plugins, dass die Verarbeitung von Back's Structured Derivations m\"oglich machen soll, gelegt worden. Mit anderen Worten, es sollte so viel Plugin-Code, wie im begrenzten Projektzeitraum m\"oglich, implementiert werden. + +Weiters sollte eine Projektstruktur aufgebaut werden, die die Initialisierungsarbeiten von weiterf\"uhrende bzw. nachfolgende Projekten erleichtert und somit verk\"urzt. Dabei sollte darauf geachtet werden, dass die vom Isabelleteam bereits verwendete Projekthierarchie soweit wie m\"oglich \"ubernommen bzw. erweitert wird. +Die nachfolgende Auflistung soll die wichtigsten Tasks nochmals zusammenfassen: +\begin{enumerate} +\item Relevante Isabelle Komponenten identifizieren und studieren +\item Installation der Standard-Komponenten +\item Entwicklungsumgebung vom Isabelle-Team kopieren +\item Relevante Komponenten implementieren + \begin{itemize} + \item jEdit Plugin f\"ur SD + \item zugeh\"origen Parser + \item nicht vorgesehen: SD-Interpreter in Isar (SML) + \end{itemize} +\end{enumerate} + +\chapter{Beleuchtung der Projekt-relevanten Technologien} +Dieses Kapitel soll die vielen unterschiedlichen Technologien, die im Rahmen dieser Arbeit verwendet oder zumindest ber\"uhrt wurden, beleuchten und dem Leser helfen, nachfolgende Zusammenh\"ange zu verstehen. Nat\"urlich kann in keines der folgenden Themen sehr tief eingestiegen werden. Viel mehr sollen die nachfolgenden Ausf\"uhrungen einen groben \"Uberblick \"uber die einzelnen Technologien geben. +\section{Back's Structured Derivations} +Wie in der Aufgabenstellung bereits beschrieben, war die Erstellung eines Structured Derivation Plugins das Hauptziel dieser Arbeit. Aus diesem Grund wird in diesem Absatz kurz auf die von Prof. Ralph-Johan Back einf\"uhrten Structured Derivations eingegangen und dessen Eigenschaften bzw. Zusammenh\"ange beschrieben. + +Das nachfolgende Beispiel zeigt ein einfaches Beispiel, wie eine Formel mittels SD dargestellt bzw. umgeformt werden kann: + +%{\footnotesize +\begin{tabbing} +123,\=1234\=1234\=1234\=1234\=1234\=1234\=123\=\kill +\>$\bullet$\>Simplify $(1 - x) * (x ^ 2 + 1) + x ^ 3 - x ^ 2$\\ +\> \>$(1 - x) * (x ^ 2 + 1) + x ^ 3 - x ^ 2$\\ +\>$\equiv$\>$\{ {\it RewriteSet}\;{\it purify}\}$\\ +\> \>$(1 + -1 * x) * (x ^ 2 + 1) + x ^ 3 + -1 * x ^ 2$\\ +\>$\equiv$\>$\{{\it RewriteSet}\;{\it simplify\_pure}\}$\\ +\> \>$\bullet$\>$(1 + -1 * x) * (x ^ 2 + 1) + x ^ 3 + -1 * x ^ 2$\\ +\> \>$\equiv$\>$\{{\it RewriteSet}\;{\it expand\_poly\_}\}$ \\ +\> \> \>$1 * x ^ 2 + 1 * 1 + (-1 * x * x ^ 2 + -1 * x * 1) + x ^ 3 +-1 * x ^ 2$\\ +\> \>$\equiv$\>\vdots\\ +\> \> \>$1 + -1 * x + 0 * x ^ 2 + 0 * x ^ 3$\\ +\> \>$\equiv$\>$\{{\it RewriteSet}\;{\it reduce\_012\_}\}$ \\ +\> \> \>$1 + -1 * x$\\ +\>\dots\>$1 + -1 * x$\\ +\>$\equiv$\>$\{{\it RewriteSet}\;{\it beautify}\}$\\ +\> \>$1-x$ +\end{tabbing} +%} + +Dieses Beispiel kann wie folgt interpretiert werden: +\begin{enumerate} +\item Die erste Zeile ist als Angabe bzw. Ausgangspunkt der Berechnung zu verstehen. +\item Nun folgt der eigentliche Ablauf einer Umformung mittels SD: Mit der Formel in der zweiten Zeile beginnt die Berechnung. +\item Die n\"achste Zeile gibt nun an, wie die Formel aus der direkt dar\"uberliegenden Zeile umgeformt bzw. aufbereitet wird. Es ist also eine Beschreibung bzw. die passende Rechenregel, um von der Ausgangsformel auf die nachfolgende Formel schlie{\ss}en zu k\"onnen. +\item Aus dieser Rechenvorschrift ergibt sich die Formel in der n\"achsten Zeile. +\item Dieser Ablauf wiederholt sich und zieht sich \"uber die weiteren Berechnungen. +\end{enumerate} + +Back liefert mit SD eine sehr gute Darstellungs- und Verbarbeitungs-Richtlinie, die einerseits dem Leser/Anwender hilft, da durch die Regel- bzw. Beschreibungs-Zeile klar gestellt wird, wie der letzte Berechnungsschritt durchgef\"uhrt wurde. Andererseits bringt SD auch f\"ur den Programmierer einen klaren Vorteil, da \"uber die vorgestellten Sonderzeichen das Parsen von \textit{SD-Code} vereinfacht bzw. direkt (ohne extra Schl\"usselw\"orter einf\"uhren zu m\"ussen) m\"oglich ist. + +\section{Der Texteditor jEdit}\label{jEdit} +% http://www.jedit.org/ +% http://de.wikipedia.org/wiki/JEdit +% http://www.chip.de/downloads/jEdit_19235021.html +% +jEdit ist ein in Java geschriebener und als Open-Source-Projekt erh\"altlicher Texteditor, der vor allem durch sein sehr gut entwickeltes und ebenso einfaches Plugin-Management-System sehr effektiv eingesetzt werden kann. Solche Plugins k\"{o}nnen direkt in jEdit installiert oder durch manuelles Hinzuf\"{u}gen eines Plugin-Paketes genutzt werden. Dadurch ist dieser Editor sehr flexibel in der Anwendung und kann den eigenen Bed\"{u}rfnissen perfekt angepasst werden. +Diese Umst\"ande sind wohl auch der Grund, warum sich die Entwickler von Isabelle f\"ur diesen Editor entschieden haben. Hierbei ist zu erw\"{a}hnen, dass hier eine etwas modifizierte bzw. an Isabelle angepasste Version verwendet wird. Es empfiehlt sich daher, immer die aktuelle Version des Isabelle-jEdit-Editors (zB. aus dem Bundle erh\"{a}ltlich auf der Isabelle-Homepage) zu verwenden, da hier diverse Voreinstellungen vorgenommen wurden. In weiterer Folge wird mit jEdit immer diese modifizierte Version des Editors in Verbindung gebracht, da die Verwendung der Grundversion aus oben genannten Gr\"{u}nden nicht zu empfehlen bzw. sinnvoll ist. +Weiters sollte noch erw\"ahnt werden, dass es rund um jEdit einen sehr guten Support via Mailinglist gibt und man wirklich rasch Hilfestellung bekommen kann. + +\subsection{Das Plugin-System} +% http://jedit.org/users-guide/writing-plugins-part.html +Wie im vorigen Abschnitt bereits erw\"ahnt, ist es sehr einfach und bequem m\"oglich, geeignete Plugins zu installieren bzw. zu verwenden. Es stehen bereits sehr viele verschiedenste Plugins auf der jEdit-Homepage zur Verf\"{u}gung. Diese werden ebenfalls als Open-Source-Projekte angeboten und es bietet sich daher an, bereits verf\"ugbare und funktionierende Plugins als Teil eines neuen Plugins zu verwenden und gegebenenfalls kleine Modifikationen oder Erweiterungen an den Plugins durchzuf\"{u}hren. Im Beispiel von Isabelle wurden unter anderem die Plugins \textit{Sidekick} und \textit{Konsole} verwendet. Dabei ist es m\"oglich, dass Java-Plugins mit Scala-Plugins kombiniert werden, da diese auch problemlos miteinander kommunizieren k\"{o}nnen. +jEdit bietet einen Plugin-Manager an, mit dem sich sehr einfach bereits installierte Plugins verwalten und updaten lassen und es ist auch m\"{o}glich, neue Plugins direkt zu installieren. +Weiters bietet sich die M\"oglichkeit, selbst implementierte Plugins direkt zu den bereits vorhandenen jEdit-Plugins hizuzuf\"{u}gen. Dazu muss das erzeugte "Plugin".jar Paket ledigich in den jars-Ordner verschoben werden. Beim Start von jEdit wird das neue Plugin automatisch erkannt und hinzugef\"{u}gt. Man muss aber darauf achten, dass \"{A}nderungen nur nach einem Neustart von jEdit \"{u}bernommen werden. + + +\subsection{Pluginstruktur} +Ein solches jEdit-Plugin muss nat\"{u}rlich ein gewisses Design umsetzen, um von jEdit korrekt ausgef\"{u}hrt werden zu k\"{o}nnen. Grunds\"{a}tzlich besteht ein solches Plugin aus den eigentlichen Sourcefiles und einigen XML- und Property-Datein. +Ein m\"{o}glicher Aufbau kann dem Beispiel-Plugin "QuickNotepad"\footnote{http://jedit.org/users-guide/writing-plugins-part.html}, das auf der jEdit-Homepage zu finden ist, entnommen bzw. als Ausgangspunkt f\"{u}r die Entwicklung eines eigenen Plugins herangezogen werden. Weitere Informationen k\"{o}nnen auch dem Paper "Userinterfaces for Computer Theorem Provers" entnommen werden. + +\section{Isabelle} +Isabelle ist einer der f\"{u}hrenden CTPs und an dessen Weiterentwicklung wird st\"{a}ndig gearbeitet. Der letzte gro{\ss}e Schritt betraf den Umstieg von reinem ML auf die "Mischsprache" Scala(mit funktionalen sowie imperativen Sprachanteilen). Weiters wurde der in die Jahre gekommene Proof General und der damit in Verbindung stehende Editor Emacs durch den vielseitigen Editor jEdit ersetzt. Dadurch ergeben sich auch f\"{u}r das laufende \sisac-Projekt an der TU Graz neue M\"{o}glichkeiten. Wichtig im Zusammenhang mit dieser Beschreibung ist zu erw\"{a}hnen, dass hier in weiterer Folge nur noch f\"{u}r jEdit bzw. Scala relevante Teile von Isabelle behandelt und beschrieben werden. Weiters ist wichtig zu wissen, dass f\"{u}r die bereits bestehende Struktur rund um Isablle-jEdit zwei Isabelle-Pakete zum Einsatz kommen. Auf diese Pakete soll in den n\"{a}chsten Passagen eingegangen werden. + +\subsection{Isabelle-Pure} +In diesem Plugin ist der eigentliche CTP-Teil von Isabelle verpackt. Das bedeutet im weiteren Sinn, dass es hier keine grafische Verarbeitung der Daten gibt, sondern der Zugriff von aussen erforderich ist, um den CTP mit Daten zu versorgen und diese nach deren Verabreitung in Isabelle-Pure auszuwerten. Also ist nur hier eine Schnittstelle zum eigentlichen Proofer m\"{o}glich und deshalb ist dieses Plugin f\"{u}r das \sisac-Projekt von zentraler Bedeutung. Standardm\"{a}{\ss}ig ist bereits ein Pure.jar-Paket f\"{u}r jEdit vorhanden. Um SD umsetzten zu k\"{o}nnen, muss hier eine Schnittstelle zu Isabelle-Pure implementiert werden. Nach diesem Schritt kann das Plugin Pure.jar neu gebaut werden. +Eine Auflistung der f\"ur das Isabelle-Pure-Packet ben\"otigten Scala-Source-Filles kann Anhang B.2 entnommen werden. + +\subsection{Isabelle-jEdit} +Dieser Teil von Isabelle repr\"{a}sentiert das Frontend in jEdit. Hier wird also die grafische Aufbereitung der von Isabelle-Pure berechneten Daten \"{u}bernommen. Dieses Plugin zeigt sehr sch\"{o}n, wie bereits bestehende Plugins weiter genutzt und erweitert werden k\"{o}nnen. +An diesem Plugin wird von Seiten der Isabelle-Entwickler sehr stark weitergearbeitet. Darum sollten hier wohl nicht zu viele, am besten nat\"{u}rlich keine \"{A}nderungen, vorgenommen werden. Der Umstand, dass sich einzelne Plugins ganz einfach in einem anderen mitverwenden lassen, macht es m\"{o}glich, dass das \sisac-Plugin sehr einfach, im Idealfall von Seiten der Isabelle-Entwickler, in das Isabelle-jEdit-Plugin integriert werden kann. + +\subsection{Paketstruktur von Isabelle} +Durch die Komplexit\"{a}t des Isabelle-Entwicklungs-Aufbaus soll hier eine Auflistung aller relevanten jar-Pakete erfolgen. Alle Pakete befinden sich innerhalb der Ordnerstruktur von ISABELLE\_HOME. Darum wird ab hier immer von diesem Verzeichnis ausgegangen. +Die nachfolgende Auflistung zeigt alle Pakete, die f\"{u}r SD bzw. {\sisac} von Bedeutung sind und und wo diese zu finden sind. + + +\begin{itemize} +\item \textit{contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars:} \textbf{Isabelle-jEdit.jar, Pure.jar, SideKick.jar, ...} Der Ordner contrib ist in der Repository-Version nicht vorhanden! Dieser kann dem Isabelle-Bundle entnommen werden. Hier befinden sich alle ben\"{o}tigten Zusatztools f\"{u}r Isabelle und darunter eben auch jEdit. In dem oben angef\"{u}hrten Ordner liegen alle Plugins bzw. dorthin werden alle Plugins kopiert, die zusammen mit jEdit gestartet werden sollen. +\item \textit{lib/classes:} \textbf{isabelle-scala.jar, pure.jar;} Standardm\"{a}{\ss}ig ist dieser Ordner nicht vorhanden. Erst durch Erzeugen der angef\"{u}hrten jar's werden dieser Ordner und die Pakete erstellt. +\item \textit{src/Tools/jEdit/dist/jars:} \textbf{Isabelle-jEdit.jar, Pure.jar, SideKick.jar, jedit.jar, ...} +\item \textit{src/Tools/jEditC/dist/jars:} \textbf{Isabelle-jEdit.jar, Pure.jar, SideKick.jar, jedit.jar, ...} Diese beiden obigen Verzeichnisse sind, wie man an der sehr \"{a}hnlichen Pfadstruktur erkennen kann, \"{a}quivalent, wobei der zweite Pfad zum \sisac-Entwicklungsverzeichnis geh\"{o}rt. Hier sind die f\"{u}r das Isabelle-jEdit- bzw. \sisac-Plugin ben\"{o}tigten Plugins und Pakete plus das erzeugte Plugin zu finden. +\item \textit{src/Tools/jEditC/contrib/jEdit/build/jars:} \textbf{Isabelle-jEdit.jar, Pure.jar, SideKick.jar, jedit.jar, ...} Diesen Aufbau ben\"{o}tigt man nur, wenn man das jEdit-Isac-Projekt direkt in NetBeans debuggen m\"{o}chte. Man erkennt, dass in diesem Verzeichnis der vollst\"{a}ndige Quellcode von jEdit plus allen Plugins, die zusammen mit jEdit gestartet werden sollen, hier zu finden sind. Wie aber bereits erw\"{a}hnt, ist vom direkten Debuggen generell abzuraten bzw. sollte dies nur f\"ur schwer nachvollziebare Abl\"aufe ohne Isabelle-Beteiligung angewendet werden. +\end{itemize} + +Siehe dazu auch Anhang B. Dort sind alle relevanten jar-Pakete noch einmal aufgearbeitet und entsprechend gruppiert. + +\section{Die Programmiersprache Scala} +Urspr\"{u}nglich wurde Isabelle rein in ML entwickelt. Erst vor ein paar Jahren wurde mit der \"{U}bersetzung von einigen Teilen in Scala begonnen. Grund genug, sich hier kurz diese neue und sehr vielseitige Sprache etwas genauer anzusehen. + +\subsection{Grundlage der Sprache} +Scala ist eine objektorientierte Sprache, die sehr \"{a}hnlich zu Java aufgebaut wurde. Dadurch wird die Einarbeitung in diese Programmiersprache f\"{u}r Java-Programmierer sehr vereinfacht. Neben den Vorteilen einer objektorientierten Sprache deckt Scala aber auch die Bed\"{u}rfnisse der funktionalen Programmierung ab. Dies, und vorallem auch das von Erlang \"ubernommene und sehr gut umgesetzte Actorprinzip, sind wohl die Hauptgr\"unde, warum sich das Isabelle-Entwicklungsteam f\"{u}r diese Sprache entschieden hat. Wie bereits erw\"{a}hnt, ist Scala sehr \"{a}hnlich aufgebaut wie Java und hat nebenbei noch den gro{\ss}en Vorteil, dass Scala-Executables in der JVM (Java virtual Machine) ausf\"{u}hrbar sind. Dadurch ist die Plattformunabh\"{a}ngigkeit garantiert und es besteht ein direkter Zusammenhang zwischen Scala und Java der auch bei der jEdit-Plugin-Entwicklung ausgenutzt bzw. verwendet wird. + +Dieser direkte Zusammenhang zwischen Java und Scala soll anhand der Grafik-Bibliotheken Swing gezeigt bzw. die Vorteile, die daraus resultieren, beleuchtet werden. + +Beide Sprachen stellen diese Grafik-Bibliotheken zur Verf\"{u}gung (und darin auch eigene Shapes und Funktionalit\"{a}t). Es ist jedoch m\"{o}glich, Java-Bibliotheken, wie eben Java-Swing in Scala zu verwenden. Ein JButton(Java) kann zum Beispiel mittels \textit{import javax.swing.JButton} in Scala eingebunden und damit sofort verwendet werden. Auch Scala stellt in seiner Swing-Bibliothek einen Button zur Verf\"{u}gung: \textit{scala.swing.Button}. Es wird nahezu dieselbe Funktionalit\"{a}t angeboten und teilweise die Erzeugung bzw. Verwendung vereinfacht. Man kann sich nun fragen, warum sich die Scala-Entwickler einerseits die M\"{u}he gemacht haben, die Verwendung Java-Swing, wie in Java selbst, m\"{o}glich zu machen und andererseits mit Scala-Swing eine nahezu idente Alternative geschaffen haben. + +Die Antwort darauf zeigt, wie die Objektorientiertheit von Scala in vielen Bereichen ausgenutzt wurde, um die Sprache mit Funktionalit\"{a}t auszur\"{u}sten, denn es wurde kein neues Konzept f\"{u}r diese Grafikklassen entworfen, sondern Wrapper-Objekte/ Methoden/Klassen erstellt, die das Arbeiten mit diesen Grafikkomponenten erleichtern soll. +Ein Letztes Problem bleibt noch: Es ist zwar sehr einfach ein Java-Swing-Objekt an einen Scala-Swing-Container (zb. Frame) anzubinden, da eine Konvertierung einer Java-Komponente in ein Scala-\"{a}quivalent problemlos m\"{o}glich ist. Jedoch ist oft auch die Konvertierung einer Scala- in eine Java-Komponente n\"{o}tig. Dies kann ganz einfach mittels \textit(peer)-Befehl der Komponente erreicht werden. + +Das angef\"{u}hrte Beispiel soll zeigen, wie vielseitig Scala sein kann und welch enormes Potenzial in dieser noch sehr jungen Sprache steckt. Nat\"{u}rlich gibt es dazu eine sehr gut aufgebaute Entwickler-Homepage\footnote{http://www.scala-lang.org/}, die Tutorials, Plugin f\"{u}r diverse IDEs und weitere n\"{u}tzliche Hilfestellungen f\"{u}r Scala-Neulinge bereitstellt. + +\subsection{Scala, Java und jEdit} +Wie im letzten Abschnitt bereits beschrieben, kommen bei jEdit Java- sowie auch Scala-Komponenten zum Einsatz bzw. werden sogar zu logischen Einheiten kombiniert. So ist zum Beispiel jEdit selbst rein in Java geschrieben und das Plugin Isabelle-jEdit rein in Scala. Trotzdem gibt es \"{u}berhaupt kein Problem, diese beiden jar-File miteinander bzw. ineinander in der JVM zu nutzen. Es geht sogar so weit, dass es m\"{o}glich ist, dass das Plugin Isabelle-jEdit bereits vorhandene und rein in Java geschriebene Plugins erweitert und nutzt. Dieses Zusammenspiel zwischen Objekten aus zwei verschiedenen Sprachen ist doch recht au\ss ergew\"{o}hnlich und kann bzw. sollte nat\"{u}rlich auch f\"{u}r SD bzw. {\sisac} ausgenutzt werden! + +\subsection{Der Isabelle-Scala-Layer} +Es sollten nun die Grundlegenden Eigenschaften von Scala bekannt sein. Die Einf\"uhrung des Scala-Layers ab Isabelle-Version 2009 war ein grosser Schritt f\"ur das Isabelle Projekt. Das Scala-Actor-Konzept erm\"oglicht die asynchrone Verarbeitung von einzelnen Beweisteilen und ist einer der massgeblichen Gr\"unde f\"ur die Einf\"uhrung des Scala-Layer. + +Dieser Absatz sollen nun die Eigenschaften des Scala-Layers und die damit verbundenen Chancen f\"ur das Isac- bzw. SD-Projektes +erarbeitet werden. + +\begin{figure} +\begin{center} +\includegraphics[width=100mm]{../fig-reuse-ml-scala-SD} +\end{center} +\label{fig-reuse-ml-scala} +\end{figure} + +Der Scala-Layer verbindet die Java Virtual Maschine (JVM) und den in Standart-ML (SML) geschriebenen Isabelle-Kern. Dabei wird ein internes Protokoll verwendet, dass den Datenaustausch zwischen jEdit und Isabelle/Isar erm\"oglicht. Dieses Protokoll ist im Moment noch (bewusst) ohne API ausgef\"uhrt. Aus diesem Grund musste eine Schnittstelle definiert werden, um den Datenaustausch des SD-Plugins (JVM) mit dem SD-Interpreter m\"oglich zu machen. Siehe dazu den Absatz "Verbindung zum Isabelle-Pure Plugin herstellen". Man kann aus diesem Umstand ableiten, dass die Isabelle-Entwickler mit diesem eingezogenen Scala-Layer und dem damit verbundenen internen Protokoll, auf eine konsistente Verwaltung der Theorie-Bibliotheken abzielen. Mit anderen Worten wird dem Anwendungsprogrammierer der direkte Zugriff auf die Isabelle/Isar-Komponente verwehrt. Der Anwender sollte hier also nicht angreifen sonder die Isabelle-Theorien entsprechend erweitern. + +\chapter{Konfiguration und Implementation der Komponenten} +Dieses Kapitel soll nun anhand der bereits gewonnen Erkenntnise illustrieren, wie die Entwicklungsumgebung vom Isabelle-Team kopiert wurde und wie wichtigsten Schritte zum SD-Plugin f\"{u}r jEdit wahrscheinlich aussehen werden. Wobei einige Schritte parallel und dadurch nat\"{u}rlich sehr gut im Team umgesetzt werden k\"{o}nnen. Eine genaue Aufstellung aller beteiligten Files k\"onnen dem Anhang D entnommen werden. + +\section{Konfiguration des Netbeans Projektes} +Um in k\"unftigen Entwicklungsvorhaben effizient kooperieren zu k\"onnen, wurde das Netbeans-Projekt genau nach den Vorgaben des Isabelle-Teams konfiguriert. + +\begin{enumerate} +\item Konfigurations-Files von Netbeans in ``Files''-View; beeinflussen sich gegenseitig + \begin{enumerate} + \item build.xml (aus template erzeugt, keine automatischen Ver\"anderunen) + \item nbproject/build-impl.xml (z.T. automatische Ver\"anderunen) + \item nbproject/project.xml (z.T. automatische Ver\"anderunen) + \item TODO + \end{enumerate} +\item Sacla-plugin installieren laut http://wiki.netbeans.org/Scala69, + \begin{enumerate} + \item von ``Install with NetBeasn 6.9'' + \item nach /usr/local/netbeans.../plugins/scala + \end{enumerate} +\item Scala-plugin installiert in NetBeans + \begin{enumerate} + \item Men\"u $>$ Tools $>$ Plugins $>$ Downloaded $>$ Add Plugins + \item alle Files von /usr/local/netbeans.../plugins/scala/ + \item Fenster zeigt alle ausgew\"alten Files + \item $<$Install$>$ calls Wizzard $<$Next$>$ probably accept Warning + \item Funktionstest: Men\"ue $>$ Files $>$ New Project: zeigt Scala als ``Categories'' + \end{enumerate} +\item Neues Projekt ``isac-jedit'' konfigurieren + \begin{enumerate} + \item Men\"u $>$ Open Project (weil schon aus dem Repository die notwendigen Files vorhanden sind) + \item /src/Tools/jeditC: Reference Problems, weil jEdit folgende Plugins braucht + \item Funktionskontrolle: ``Projects''-View zeigt das neue Projekt + \item Die Konfigurations-Files sind v\"ollig getrennt von anderen Projekten + \item Referenz-Probleme beheben; das zeigt auch eventuell fehlende Files + \begin{enumerate} + \item ``Projects''-View $>$ rightMouse $>$ Resolve Reference Problems: Fenster zeigt dieListe der fehlenden Dateien; $<$Next$>$ + \item Files holen aus ``Tools'' $>$ Libraries: \"uber Filebrowser aus dem Isabelle\_bundle holen contrib/jEdit---/jars + \item ``New Library'' + \begin{enumerate} + \item Cobra-renderer: cobra.jar + \item Console: Console.jar + \item ErrorList: ErrorList.jar + \item Hyperlinks: Hyperlinks.jar + \item Isabelle-Pure: Pure.jar + \item Rhino-JavaScript: js.jar + \item Scala-compiler: scala-compiler.jar + \item SideKick: SideKick.jar + \end{enumerate} + \item Funktions-Kontrollen + \begin{enumerate} + \item das kleine gelbe Warndreieck im ``Projects''-View ist verschwunden + \item im ``Projects''-View 2 Ordner: ``src'' und ``Libraries'' + \end{enumerate} + \end{enumerate} + \item jEdit-Paket zum ``isac-jedit''-Projekt hinzuf\"ugen + \begin{enumerate} + \item ``Project''-View $>$ rightMouse $>$ Add Jar/Folder: Filebrowser + \item /contrib/jedit.../jedit.jar + \item Funktions-Kontrolle: ist in ``Projects''/Libraries/jedit.jar + \end{enumerate} + \item Das neue Projekt ``isac-jedit'' zum Hauptprojekt machen: ``Project''-View $>$ rightMouse $>$ Set as Main Project; Funktions-Kontrolle: der Projektname ist boldface. + \end{enumerate} +\item Ab nun wird die Konfiguration \"uber ``trial and error'' zu Ende gef\"uhrt + \begin{enumerate} + \item Men\"u $>$ Build Main + \begin{enumerate} + \item Wenn: Target ``Isac-impl.jar'' does not exist in the project ``isac-jedit''. It is used from target ``debug'' + \begin{enumerate} + \item Versuch + \begin{itemize} + \item build-impl.xml l\"oschen + \item NetBeans neu starten, stellt build-impl.xml automatisch aus build.xml wieder her + \item \dots hat in diesem Fall nicht geholfen + \end{itemize} + \item Versuch zur Vermutung: Projekt wurde umbenannt von ``Isac'' in ``isac-jedit'', und das machte build.xml inkonsistent + \begin{itemize} + \item in build.xml query-replace ``Isac'' in ``isac-jedit'' + \item TODO? + \item + \end{itemize} + \end{enumerate} + \item Wenn: Problem: failed to create tsk or type scalac + \begin{enumerate} + \item Versuch: Pfad zum Scala bekanntgeben + \begin{itemize} + \item /usr/local/netbeans-6.9.1/etc/netbeans.conf: netbeans\_default\_options= richtigen Scala-Pfad setzen + \item build-impl.xml l\"oschen + \item NetBeans neu starten. + \end{itemize} + \end{enumerate} + \item Wenn Fehler: ``/usr/local/isabisac/src/Tools/jEditC/\${project.jEdit}/modes does not exist'' + \begin{enumerate} + \item grep -r "project.jEdit" * + \item nbproject/project.properties:project.jEdit=contrib/jEdit + \item TODO? + \end{enumerate} + \end{enumerate} + \end{enumerate} +\item error in project files, not in build.xml etc (1) + \begin{enumerate} + \item follow link to testSD.scala:22 + \item val str1: String = isabelle.Isac.parse(``Testdaten aus dem Parser!'')\\ + val str1: String = ``TEST'' //isabelle.Isac.parse(``Testdaten aus dem Parser!'')\\ + \item build once again ... successful\\ + \item watch in console what is being copied and compare build.xml, + $<$target name=''-pre-jar''$>$ + $<$target name=''-post-jar''$>$ + \item essential: a new Pure.jar has been generated, which has been extended with a new class ``Isac''; this class has been defined in scr/Pure/Isac/isac.scala + \item restore ``val str1: String = isabelle.Isac.parse(``Testdaten aus dem Parser!'')" requires new Pure.jar at the right place \dots + \item \dots the shellscript bin/testSD\_jedit creates this new Pure.jar + \end{enumerate} +\item error in bin/testSD + \begin{enumerate} + \item look at error messages, eg. src/Pure/: no such file or directory \dots + \item \dots means that the script has not been started from $\approx\approx$ --- this behaviour shall be improved a.s.a.p. + \item function test: \\ + \#\#\#\\ + \#\#\# Building Isabelle/Scala layer\\ + \#\#\#\\ + \item + \item + \end{enumerate} +$<$ $>$ +Men\"u $>$ $>$ $>$ $>$ $>$ $>$ +``Project''-View $>$ rightMouse $>$ $>$ $>$ $>$ $>$ +\item + \begin{enumerate} + \item + \begin{enumerate} + \item + \begin{itemize} + \item + \begin{itemize} + \item + \item + \item + \end{itemize} + \item + \item + \end{itemize} + \item + \item + \end{enumerate} + \item + \item + \end{enumerate} +\item + \begin{enumerate} + \item + \begin{enumerate} + \item + \begin{itemize} + \item + \begin{itemize} + \item + \item + \item + \end{itemize} + \item + \item + \end{itemize} + \item + \item + \end{enumerate} + \item + \item + \end{enumerate} +\end{enumerate} + + +\section{Implementation der jEdit Komponenten} + +\subsection{Erstellen des Plugin-Ger\"{u}sts} +Hier gilt es, erstmal den Umfang der gew\"{u}nschten Anforderungen an das Plugin so genau wie m\"{o}glich zu identifizieren. Hat man eine sehr genaue Vorstellung, wie das GUI des Plugins aussehen wird und welche Zusatz-Features angeboten werden sollen, so kann man gezielt unter den bereits bestehenden Plugins f\"{u}r jEdit nach n\"{u}tzlichen Plugins suchen, die in das SD-Plugin (m\"{o}glicherweise durch kleine Modifikationen) integriert werden k\"{o}nnen. Dies spart einerseits sehr viel Zeit und ist nebenbei genau die Art von Programmierung, die durch die offnene Plugin-Struktur von jEdit gef\"{o}rdert wird. + +Hat man nun die Planung abgeschlossen und m\"{o}glicherweise n\"{u}tzliche Plugins gefunden, kann mit der Programmierung des GUIs begonnen werden. Man sollte hier beachten, dass man von Beginn an festlegt, ob mit Scala- oder Java-Swing Komponenten gearbeitet werden soll. Es ist zwar m\"{o}glich, beide Formen zu mischen, doch aus Klarheitsgr\"{u}nden sollte man sich f\"{u}r eine Art entscheiden. Wobei hier die Empfehlung im Moment eher noch Richtung Java-Swing geht, da man hier eigentlich f\"{u}r jede Art von Problem bzw. Aufgabe bereits HowTo's im Web finden kann. Da bei Scala-Swing nur Wrapper auf die Java-Swing-Libraries gesetzt wurden, entsteht dadurch auch keinerlei Performance-Verlust. + +Es existiert bereits ein beispielhaftes Plugin am \sisac-Repository. Da der grunds\"{a}tzliche Aufbau eines jEdit-Plugins soweit umgesetzt wurde und bereits lauff\"{a}hig ist, sollte man dieses wohl als Ausgangspunkt verwenden. Die direkte Verwendung eines Isabelle-Klons ist wohl zu Beginn nicht zu empfehlen bzw. sollte meiner Meinung nach die Integration von Isac in Isabelle bzw. die Verwachsung der beiden Plugins das Fernziel sein und dadurch w\"{u}rde der Klon-Vorgang wohl eher Probleme schaffen als sie zu l\"{o}sen. + +\subsection{Erzeugung des Plugins} +Hat man die Planung des Plugin-Ger\"{u}sts abgeschlossen und die eigentliche Implementationsphase begonnen, kann dieses Plugin getestet bzw. erzeugt und via jEdit ausgef\"{u}hrt werden. Dazu muss zuerst das jar-File erzeugt und danach in den jEdit-Pluginsordner verschoben werden. Die Erzeugung kann nat\"{u}rlich direkt mittels NetBeans durchgef\"{u}hrt werden. Doch es ist auch m\"{o}glich dies via Kommandline durchzuf\"{u}hren. Folgende Schritte illustrieren wie die Erzeugung und der Kopiervorgang des Plugins durchgef\"{u}hrt werden k\"{o}nnen(Ausschnitt aus dem Skript isac\_jedit, Anhang C): +\begin{enumerate} +\item Das Plugin kann mittels Kommandline folgenderma{\ss}en erstellt werden: \\ \textit{cd ISABELLE\_HOME/src/Tools/isac/jEdit} $\rightarrow$ \textit{ant jar} +\item Nun kann das das neue Plugin ganz einfach kopiert werden \textit{cp contrib/jEdit/build/ // jars/Isac.jar ../../../../contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/} +\item jEdit ausf\"{u}hren und testen +\end{enumerate} + +\subsection{Verbindung zum Isabelle-Pure Plugin herstellen} +Der n\"{a}chste Schritt sieht nun die Versorgung des GUIs mit Daten vor. Da das jEdit-Plugin selbst nicht rechnen/interpretieren kann, m\"{u}ssen Daten an den Isabelle-Kern, also das Isabelle-Pure-Plugin weitergegeben werden. Dort k\"{o}nnen die Daten verwertet und aufbereitet zur\"{u}ck an das Frontend gereicht werden. + +\begin{figure} +\begin{center} +\includegraphics[width=100mm]{../fig-jedit-plugins-SD} +\end{center} +\label{fig-jedit-plugins-SD} +\end{figure} + +Um diesen Schritt setzen zu k\"{o}nnen, muss eine Schnittstelle zwischen dem Kern von Isabelle, Isabelle-Pure und dem Plugin hergestellt werden. Dazu muss zun\"{a}chst Pure.jar leicht modifiziert, danach neu erstellt und zuletzt zu den restlichen jEdit-Plugins hinzugef\"{u}gt werden. Dies wurde auf der aktuellen Version am Repository bereits erledigt. Folgende Schritte wurden dazu gesetzt und sind wieder n\"{o}tig, da sicher weitere Modifikationen an der Datei Pure.jar n\"{o}tig sein werden. + + +\begin{enumerate} +\item Um den \sisac-Teil im Isabelle-Pure genau abzugrenzen, wurde ein Ordner \textit{Isac} angelegt und ein Testfile \textit{isac.scala} erstellt. +\item Nun muss diese File nat\"{u}rlich dem Make-Skript \textit{ISABELLE\_HOME/src/Pure/build-jars} hizugef\"{u}gt werden, um beim Erzeugen des jar-Files mitverpackt zu werden. +\item Nun kann Pure.jar mittels Kommandline erstellt werden: \textit{cd /src/Pure} $\rightarrow$ \textit{../../bin/isabelle env ./build-jars} +\item Nun kann das das neue Plugin ganz einfach kopiert werden \textit{cp ../../lib/classes/Pure.jar ../../contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/} +\item jEdit ausf\"{u}hren und testen +\end{enumerate} +Alle die oben angef\"{u}hrten Punkte, sowie das Erzeugen und Kopieren des Plugins selbst, werden vom Script isac\_jedit erledigt. +Das Skript kann dem Anhang C entnommen werden. + +\section{Umsetzung des SD-Parsers} +Aus diversen Gr\"{u}nden wurde dieser Punkt im Zuge dieser Projektarbeit nicht mehr umgesetzt sonder nach hinten verschoben. Jedoch gibt es bereits eine Version des Parsers in ML und diese kann in einigen Arbeitsstunden in Zusammenarbeit mit Herrn Neuper in Scala \"{u}bersetzt und eingesetzt werden. + +Es ist bereits ein Parser in ML im Isabelle-Verzeichnis vorhanden, \textit{src/Pure/isar/ parse.ML}. Hier werden sogannte "parse combinators" verwendet. Dasselbe wird in n\"{a}chster Zeit von Seiten des Isabelle-Team auch f\"{u}r den Scala-Parse implementiert. Dadurch lassen sich hieraus auch wichtige Erkenntnisse gewinnen und dies spricht ebenfalls f\"{u}r die Verschiebung dieses Milestones nach hinten. + + +\chapter{Ausblick: Von SD- zum \isac-Plugin} +Die obigen Schritte sind n\"{o}tig, um das vorl\"{a}ufige Plugin SD umzusetzen. Nat\"{u}rlich beginnt danach die spannende Arbeit erst so richtig. Ist erst mal ein funktionierender SD-Parser vorhanden, kann dieser immer weiter verbessert und verfeinert werden, bis man auch damit beginnen kann, ihn f\"{u}r das \sisac-Projekt zu nutzen. + +Daneben kann an der Weiterentwicklung des GUIs gearbeitet werden und die ersten Schritte zur Ann\"{a}herung an das Isabelle-Plugin k\"{o}nnen hier erfolgen. + +\chapter{Zusammenfassung und R\"{u}ckblick} +Zusammenfassend wird nun ein \"Uberblick gegeben, welche Milestones erledigt wurden und welche nicht; Details dazu finden sich in Anhang A. %TODO +Abschlie{\ss}end gebe ich einen R\"uckblick auf meine pers\"onlichen Erfahrungen aus dieser Bakkalaureats-Arbeit. + +\section{Zusammenfassung} +Folgende Milestones wurden erfolgreich abgeschlossen: +\begin{enumerate} +\item Relevante Isabelle Komponenten dokumentiert + +\item Installation der Standard-Komponenten: + \begin{itemize} + \item Mercurial Versioncontrol + \item NetBeans IDE + \item Standard Isabelle Bundle + \end{itemize} + +\item Entwicklungsumgebung vom Isabelle-Team kopieren + \begin{itemize} + \item Isabelle-Sources vom Repository M\"unchen (Java, Scala, ML) + \item jEdit als NetBeans Projekt definiert + \end{itemize} + +\item Relevante Komponenten implementieren + \begin{itemize} + \item jEdit Plugin f\"ur SD + \item Verbindung des Plugins zu Isabelle + \item zugeh\"origen Parser: nur ein Test in SML + \end{itemize} +\end{enumerate} + +\noindent Aus Zeitgr\"unden war {\em nicht} m\"oglich, ein komplettes SD-Plugin zu implementieren; dazu w\"are auch ein Interpreter f\"ur SD auf der ML-Seite n\"otig gewesen. + +\paragraph{Voraussetzungen f\"ur k\"unftige Entwicklung} geschaffen: +\begin{enumerate} +\item f\"ur die Implementation von ``structured derivations'' in Isabelle \dots +\item \dots als Vorarbeit f\"ur jEdit als k\"unftiges \isac-Frontend +\item f\"ur Mitarbeit an k\"unftiger Integration von Isabelle in Entwicklungswerkzeuge (Testcase-Generation etc). +\end{enumerate} + +\section{R\"uckblick} +Isabelle ist ein sehr gro\ss es Softwarepacket mit mehreren Millionen LOC. Daher gestaltete sich die Einarbeitungsphase sehr schwierig und kostet sehr viel Zeit. Erschwerend kam hinzu, dass ich von Beginn an mit mehreren, f\"{u}r mich noch ganz neue, Technologien arbeiten musste. Diese Herausforderungen schon zu Beginn machten die Arbeit an \sisac{ }von Beginn an spannend. Hier ist mir vorallem die gemeinsam mit meinem Betreuer Herrn Walther Neuper durchgef\"{u}hrte Installationsarbeit von Isabelle in Erinnerung geblieben. Nie zuvor hatte ich f\"{u}r eine Installation von Software so lange gebraucht - eine ganz neue, wichtige Erfahrung. + +Einer der bedeutensten Milesteine war r\"{u}ckblickend wohl, die Verzeichnisstruktur von Isabelle grunds\"atzlich verstanden zu haben. Bei einem Softwarepacket von dieser Gr\"{o}{\ss}e war es wichtig zu wissen, wo man Files suchen/modifizieren/einf\"{u}gen muss, um den gew\"{u}nschten Effekt erreichen zu k\"onnen. + +Der n\"achste wichtige Schritt war das bereits teilweise bestehende NetBeansprojekt lauff\"ahig zu machen und mir damit zum ersten mal selbst das jEdit-Isabelle-Plugin erzeugen zu k\"onnen. Dies war ein sehr bedeutsamer Schritt, da ich hier zum einen NetBeans und dessen Konfiguration besser kennenlernen konnte und zum anderen sehr viel \"{u}ber die Pluginstruktur eines jEdit-Plugins lernen konnte. Zu Beginn machte mir hier der Mix aus Scala-, Java-, XML- und diversen Config-Files Probleme. + +Bis jetzt hatte ich eigentlich noch nicht wirklich mit der Programmierung des Plugins begonnen doch es waren schon zig Arbeitsstunden rein f\"{u}r Einarbeitungs- und Vorbereitungsaufgaben verstrichen - wieder eine neue Erfahrung f\"{u}r mich. Nach einigen Test- bzw. Beispielprogrammen um die Sprache Scala etwas kennenzulernen, begann die wohl spannenste Phase im Projektverlauf. Das in Java geschriebene Beispielplugin "Quick-Notepad" wurde in Scala \"{u}bersetzt und etwas abge\"andert. + +Der letzte wirklich bedeutende Schritt war Herstellung der Verbindung zwischen Isabelle-Pure und \sisac. Dieser Punkt ist sehr wichtig, da ohne diese Schnittstelle die Planung des SD-Parser nicht m\"oglich gewesen w\"are. Der letzte Schritt, also die Implementation des SD-Parsers wurde aufgeschoben, da es derzeit seitens des Isabelle-Teams ebenfalls Bestrebungen gibt, einen neuen Scala-Parser zu designen und wir von diesen Erkenntnissen mit Sicherheit in der Zunkft profitieren k\"onnen. + +%Abschlie{\ss}end m\"ochte ich mich bei meinem Betreuer Herrn Walther Neuper sehr herzlich f\"{u}r die gute Betreuung und die spannenden Entwicklungsstuden bedanken. Es war eine sehr lehrreiche und interessante Projektarbeit! + +%\chapter{Milestones und Arbeitsprotokolle} +%\section{Inhaltliche Voraussetzungen erarbeitet: beendet am 27.09.2010} +%\begin{itemize} +%\item Kenntnis der Grundlagen und Anwendung von CTP: beendet am 03.08.2010 +%\item Charakteristika der Programmsprache Scala: beendet am 27.09.2010 +%\item Scala Actors: beendet am 12.08.2010 +%\end{itemize} +%\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} +%\hline +%Datum & T\"atigkeit & Einheiten \\ \hline +%12.07.2010 & Meeting: erste Besprechung und Erkl\"{a}rungen zu Isabelle, Isac und CTPs & 2 \\ \hline +%15.07.2010 & Recherche \"{u}ber Isabelle und CTPs & 3 \\ \hline +%20.07.2010 & Meeting: Besprechen der grunds\"{a}tzlichen Vorgangsweise und Ziele & 1 \\ \hline +%23.07.2010 & Isabelle: Ziele, Techniken (ML) und Zusammenh\"{a}nge mit Isac abkl\"{a}ren & 1 \\ \hline +%30.07.2010 & Ende der Einarbeitungstage: weitere Vorgensweise \"{u}ber Backs 'structured derivations'; Begriffserkl\"{a}rung & 3 \\ \hline +%01.08.2010 & Recherche: Buch f\"{u}r Scala & 2 \\ \hline +%03.08.2010 & Isabelle bestehende Technologie studieren & 4 \\ \hline +%05.08.2010 & Einarbeiten in Scala: Unterschiede zu Java indentifizieren & 1 \\ \hline +%06.08.2010 & Einarbeiten in Scala: Unterschiede zu Java indentifizieren, erste Beispielfiles & 4 \\ \hline +%08.08.2010 & Einarbeiten in Scala: funktionale Seite von Scala & 2 \\ \hline +%09.08.2010 & Einarbeiten in Scala: Testfiles mit Scala-Swing & 5 \\ \hline +%12.08.2010 & Studieren von Papers zu Scala Actors & 3 \\ \hline +%24.09.2010 & Scala: Arbeiten mit Klassen und Schnittstellen & 3 \\ \hline +%25.09.2010 & Scala: Experimente mit Java in Scala-Source & 6 \\ \hline +%27.09.2010 & Scala: Testfiles zu "Funktional vs Imperativ" & 4 \\ \hline \hline +% & Anzahl der Einheiten & 44 \\ +%\hline +%\end{tabular} +% +% +%\section{Technische Voraussetzungen hergestellt: beendet am 02.08.2010} +%\begin{itemize} +%\item Isabelle installiert, Filestruktur bekannt: beendet am 02.08.2010 +%\item Scala in NetBeans eingebunden: beendet am 22.07.2010 +%\item Mercurial installiert und einrichten des Repositories: beendet am 19.07.2010 +%\end{itemize} +%\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} +%\hline +%Datum & T\"atigkeit & Einheiten \\ \hline +%19.07.2010 & Beginn der Installationsarbeiten: Repo klonen und testen & 6 \\ \hline +%20.07.2010 & Installationsarbeiten, Einarbeiten in Filestruktur & 7 \\ \hline +%21.07.2010 & Einarbeiten in Filestruktur & 6 \\ \hline +%22.07.2010 & Vorbereitungen: NetBeans, JDK und Scala installieren. Scala in NetBeans integrieren & 8 \\ \hline +%23.07.2010 & Isabelle-jEdit-Plugin mittels NetBeans ausf\"{u}hren: testen & 5 \\ \hline +%27.07.2010 & Isabelle-jEdit-Plugin: \"{a}nderungen an der Projektstruktur & 7 \\ \hline +%28.07.2010 & Experimente mit Isabelle-jEdit-Plugin & 6 \\ \hline +%29.07.2010 & Identifikations der Parse-Einstiegsstelle & 5 \\ \hline +%30.07.2010 & Experimente mit Isabelle-jEdit-Plugin, Besprechung \"{u}ber Erfahrungen mit Filestruktur & 4 \\ \hline +%02.08.2010 & Installationen und einrichten des Repos auf meinen Laptop & 6 \\ \hline \hline +% & Anzahl der Einheiten & 60 \\ +%\hline +%\end{tabular} +% +%\section{NetBeans-Projekt aufgesetzt: beendet am 02.08.2010} +%\begin{itemize} +%\item Grundlegende Projektstruktur f\"ur ISAC hergestellt: beendet am 02.08.2010 +%\item jEdit-Plugin: XML-Files f\"{u}r ISAC vorbereitet: beendet am 22.07.2010 +%\item jEdit-Plugin: Source files geschrieben: beendet am 19.07.2010 +%\end{itemize} +%\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} +%\hline +%Datum & T\"atigkeit & Einheiten \\ \hline +%10.08.2010 & Projektstruktur anlegen, build.xml anpassen & 7 \\ \hline +%11.08.2010 & jEdit-Plugin-Struktur studieren: Howto durcharbeiten & 5 \\ \hline +%21.08.2010 & bestehende jEdit-Plugins (Java) durcharbeiten & 3 \\ \hline +%22.08.2010 & Kopieren des Isabelle-jEdit-Plugins, Umarbeiten f\"{u}r ISAC & 3 \\ \hline +%24.08.2010 & Umarbeiten des Isabelle-Plugins f\"{u}r ISAC & 6 \\ \hline +%26.08.2010 & Problem mit Isabelle-Umgebungsvariable: Suche nach L\"{o}sungen & 3 \\ \hline +%28.08.2010 & Recherchen zum Umgebungsvariable-Problem, Arbeiten mit den Isabelle-Shell-Skripts & 2 \\ \hline +%29.08.2010 & Experimente mit den Path-Varialbe der jvm & 3 \\ \hline +%30.08.2010 & Isabelle-jEdit-Plugin endlich vollst\"{a}ndig lauff\"{a}hig gebracht & 4 \\ \hline +%01.09.2010 & Arbeiten an der jEdit-ISAC-Projektstruktur & 3 \\ \hline +%04.09.2010 & Umarbeiten des Isabelle-Plugins f\"{u}r ISAC & 5 \\ \hline +%20.09.2010 & Einrichten des Laptops f\"{u}r Isabelle-Isac & 4 \\ \hline +%22.09.2010 & Meeting: Fortschrittsbericht, kurze Einf\"{u}hrung f\"{u}r Mitstreiter & 3 \\ \hline +% +%29.09.2010 & Neue Vorgehensweise: QuickNotepad-Plugin(QN) wird in Scala \"{u}bersetzt und f\"{u}r ISAC entsprechend angepasst: Arbeit an den XML-Files & 4 \\ \hline +%30.09.2010 & QN: Start mit \"{u}bersetzten der Sourcefiles & 5 \\ \hline +%02.10.2010 & QN: \"{U}bersetzten der Sourcefiles & 6 \\ \hline +%04.10.2010 & QN: \"{U}bersetzten der Sourcefiles: Problem bei Interface & 3 \\ \hline +%05.10.2010 & QN: QN vollst\"andig in Scala \"{u}bersetzt, testen & 2 \\ \hline \hline +% & Anzahl der Einheiten & 71 \\ +%\hline +%\end{tabular} +% +%\section{Experimentelle Parser implementiert: beendet am 04.03.2011} +%\begin{itemize} +%\item Experimente mit dem SideKick-Parser abgeschlossen: beendet am 03.02.2011 +%\item Verbindung zu Isabelle-Pure hergestellt: beendet am 04.03.2011 +%\item Implementierung des Scala-Parsers: aufgeschoben +%\end{itemize} +%\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} +%\hline +%Datum & T\"atigkeit & Einheiten \\ \hline +%28.01.2011 & Testen des SideKick-Parsers im Isabelle-Plugin & 2 \\ \hline +%29.01.2011 & Leichte Modifikationen des SideKick-Parsers im Isabelle-Plugin & 1 \\ \hline +%08.02.2011 & Besprechung zum Abschluss der praktischen Arbeiten & 1 \\ \hline +%16.02.2011 & Erstellen des Isabelle-Pur jar-Files & 1 \\ \hline +%19.02.2011 & Behebung des Problems mit den Umgebungsvariablen & 1 \\ \hline +%03.03.2011 & Erzeugung des Pure.jar Package m\"{o}glich & 2 \\ \hline +%04.04.2011 & Verbindung zwischen Plugin und Isabelle-Pure hergestellt und getestet & 3 \\ \hline +%08.04.2011 & Besprechung: Implementierung des experimentellen Parsers wird nicht mehr durchgef\"{u}hrt & 1 \\ \hline \hline +% & Anzahl der Einheiten & 12 \\ +%\hline +%\end{tabular} +% +%\section{Verfassen der Dokumentation und abschliesende Arbeiten: beendet am TO.DO.2011} +%\begin{itemize} +%\item Bacc.-Protokoll fertiggestellt: beendet am 01.03.2011 +%\item Dokumentation: erste Version fertiggestellt: beendet am 28.04.2011 +%\item Dokumentation abgeschlossen: beendet am TO.DO.2011 +%\end{itemize} +%\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} +%\hline +%Datum & T\"atigkeit & Einheiten \\ \hline +%01.03.2011 & Besprechung zum Ablauf der Dokumentationsarbeiten: Protokoll und Dokumentation & 1 \\ \hline +%01.03.2011 & Erstellen des Protokolls & 2 \\ \hline +%08.03.2011 & Besprechung zur Doku und zur Schnittstelle zu Isabelle-Pure & 1 \\ \hline +%17.03.2011 & Dokumentation schreiben & 2 \\ \hline +%19.03.2011 & Dokumentation schreiben & 3 \\ \hline +%24.04.2011 & Dokumentation schreiben & 2 \\ \hline +%25.04.2011 & Dokumentation schreiben & 4 \\ \hline +%27.04.2011 & Dokumentation schreiben & 2 \\ \hline +%28.04.2011 & Dokumentation: Fertigstellen der ersten Version & 3 \\ \hline \hline +% & Anzahl der Einheiten & 20 \\ +%\hline +%\end{tabular} +% +%\section{Pr\"asentation der Arbeit im IST-Seminar }% am ..(*)...} diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/tactics.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/tactics.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,26 @@ +\chapter{\isac s tactics} + +\begin{description} +\item{\bf Init\_Proof\_Hid (dialogmode, formalization, specification)} transfers the arguments to the math engine, the latter two in order to solve the example automatically. The tactic is not intended to be used by the student; it generates a proof tree with an empty model. +\item{\bf Init\_Proof} generates a proof tree with an empty model. +\item{\bf Model\_Problem problem} determines a problemtype (eventually found in the hierarchy) to be used for modeling. +\item{\bf Add\_Given, Add\_Find, Add\_Relation formula} inputs a formula to the respective field in a model (necessary as long as there is no facility for the user to input formula directly, and not only select the respective tactic plus formula from a list). +\item{\bf Specify\_Theory theory, Specify\_Problem problem, Specify\_Method method} specifies the respective element of the knowledgebase. +\item{\bf Refine\_Problem problem} searches for a matching problem in the hierarchy below 'problem'. +\item{\bf Apply\_Method method} finishes the model and specification phase and starts the solve phase. +\item{\bf Free\_Solve} initiates the solve phase without guidance by a method. +\item{\bf Rewrite theorem} applies 'theorem' to the current formula and transforms it accordingly (if possible -- otherwise error). +\item{\bf Rewrite\_Asm theorem} is the same tactic as 'Rewrite', but stores an eventual assumption of the theorem (instead of evaluating the assumption, i.e. the condition) +\item{\bf Rewrite\_Set ruleset} similar to 'Rewrite', but applies a whole set of theorems ('ruleset'). +\item{\bf Rewrite\_Inst (substitution, theorem), Rewrite\_Set\_Inst (substitution, ruleset)} similar to the respective tactics, but substitute a constant (e.g. a bound variable) in 'theorem' before application. +\item{\bf Calculate operation} calculates the result of numerals w.r.t. 'operation' (plus, minus, times, cancel, pow, sqrt) within the current formula. +\item{\bf Substitute substitution} applies 'substitution' to the current formula and transforms it accordingly. +\item{\bf Take formula} starts a new sequence of calculations on 'formula' within an already ongoing calculation. +\item{\bf Subproblem (theory, problem)} initiates a subproblem within a calculation. +\item{\bf Function formula} calls a function, where 'formula' contains the function name, e.g. 'Function (solve $1+2x+3x^2=0\;\;\;x$)'. In this case the modelling and specification phases are suppressed by default, i.e. the solving phase of this subproblem starts immediately. +\item{\bf Split\_And, Conclude\_And, Split\_Or, Conclude\_Or, Begin\_Trans, End\_Trans, Begin\_Sequ, End\_Sequ, Split\_Intersect, End\_Intersect} concern the construction of particular branches of the prooftree; usually suppressed by the dialog guide. +\item{\bf Check\_elementwise assumptions} w.r.t. the current formula which comprises elements in a list. +\item{\bf Or\_to\_List} transforms a conjunction of equations to a list of equations (a questionable tactic in equation solving). +\item{\bf Check\_postcond:} check the current formula w.r.t. the postcondition on finishing the resepctive (sub)problem. +\item{\bf End\_Proof} finishes a proof and delivers a result only if 'Check\_postcond' has been successful before. +\end{description} \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/template_master_thesis.zip Binary file doc-isac/template_master_thesis.zip has changed diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/template_thesis_prelim.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/template_thesis_prelim.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,42 @@ +\documentclass{report} +\usepackage{a4} +\usepackage{times} +\usepackage{latexsym} +%\bibliographystyle{alpha} +\bibliographystyle{abbrv} +\usepackage{graphicx} + +\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} +\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} + +\title{Tentative Title:\\ + TODO} +\author{n.n.\\ +{\tt TODO@xxx.at}} + +\begin{document} +\maketitle +\abstract{ +TODO +} + +\chapter{Background} + +\chapter{Goal} + +\chapter{State of the Art} + +\chapter{Thesis Structure} + +\chapter{Timeline} +Milestones + +\section{TODO} + +\section{TODO} + +\section{TODO} + + +%\bibliography{bib/TODO} +\end{document} diff -r 7f3760f39bdc -r f8845fc8f38d doc-isac/tleh/ferialprakt.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc-isac/tleh/ferialprakt.tex Tue Sep 17 09:50:52 2013 +0200 @@ -0,0 +1,96 @@ +\documentclass[a4paper,12pt]{article} +%usepackage{ngerman} + + +\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} +\def\sisac{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} + +\title{Ferialpraxis\\ am Institut f\"ur Softwaretechnologie\\ + der Technischen Universit\"at Graz\\ + Arbeitsprotokoll} +\author{Thomas Leh\\ + t.leh@gmx.at} +\date{\today} + +\begin{document} +\maketitle + +\section{Pers\"ohnliche Zielsetzung} +Im letzen Sommer vor der Maturaklasse wollte ich mich schon \"uber +Studienm\"oglichkeiten informieren. +Meine Interessen liegen im Bereich der Computerwissenschaften und ich war +deshalb froh, die Praktikumsstelle bekommen zu haben. +Dabei wollte ich Folgendes erzielen: +\begin{itemize}\itemsep1pt +\item Genereller Einblick in die Software-Entwicklung +\item Einblick ins Programmieren +\item Informationen \"uber die Studienrichtung Informatik auf der TU +\item Arbeitserfahrung im Bereich der Informatik +\end{itemize} +\newpage +\section{Arbeitsprotokoll} +\begin{center} +\begin{tabular}{l|l|r} +Datum & T\"atigkeit & Std. \\ \hline +12.7.11 + & Demonstration des ``educational math assistant \sisac'' &7.5 \\ + & Demonstration des Theorem Provers Isabelle & \\ + & Einf\"uhrung Linux, objektorientierte/funktionale Programmierung& \\ + & Installation: Isabelle, \sisac-core, Mercurial & \\ \hline +13.7.11 & Einf\"uhrung Latex und ML Basic & 7.5 \\ + & Konfiguration von Mercurial & \\ + & ML Basics \"Ubungen & \\\hline +14.7.11 & Einf\"uhrung ML Functions und ML Combinators &7.5 \\ + & \"Ubungen ML Functions und ML Combinators s & \\ \hline +15.7.11& Einf\"uhrung ML Datastructure &7.5 \\ + & Ml Datastructure \"Ubungen & \\ + & Informationen \"uber Rewriting und MathEngine & \\ \hline +18.7.11 & Einf\"uhrung in die Fehlersuche (ISAC-Tests) & 7.5 \\ + & Fehlersuche im Directory ``Frontend'' & \\ \hline +19.7.11 & Fehlersuche im Directory ``Knowledge'' & 7.5 \\ + & Uncommanding funktionierender Tests & \\ \hline +20.7.11 & Einf\"uhrung Fehlerbeseitigung (ISAC-Tests) & 7.5 \\ + & Fehlerbeseitigung im File polyminus.sml & \\ \hline +21.7.11 & Informationen \"uber Studienrichtungen der Informatik & 7.5 \\ + & Fehlerbeseitigung im File integrate.sml & \\ \hline +22.7.11 & Fehlersuche in der File ``diffapp'' & 7.5 \\ +& Beseitigung des Fehlers & \\ \hline +25.7.11 & Fehlersuche in der File ``diff.sml'' & 7.5\\ +& Fehlerbeseitigung in der File ``diff.sml``& \\\hline +26.7.11 & updaten des ``scr'' Directories & 7.5 \\ +& Fehlersuche im ``scr'' Directory & \\ \hline +27.7.11 & updaten des ``scr'' Directories & 7.5 \\ +& Fehlerbehebung in den Files eqsystem.thy, atools.thy & \\ \hline +28.7.11 & Abschluss: Check des builds, check aller Tests & 7.5 \\ + & Fertigstellung des Protokolls & \\ \hline +29.7.11 & Austausch mit Ferialpraktikanten von anderen Fakult\"aten & 7.5 \\ +\end{tabular} +\end{center} +\newpage +\section{R\"uckblick auf das Praktikum} + + + +\paragraph{Im Bereich der Software-Entwicklung} wurden meine Erwartungen +erf\"ullt. Ich wei\ss \ jetzt wie bei einem gr\"o\ss eren Software-Projekt +gearbeitet wird und habe mich mit den Umgang mit der Versionsverwaltungssoftware +Mercurial vertraut gemacht. Des weiteren wurde mir die wichtige Rolle von Tests in +Software-Projekten bewusst gemacht. + +\paragraph{Von der Programmierung} habe ich mir einen gro\ss en \"Überblick + verschaffen k\"onnen. Dabei habe ich vorallem einiges zum Thema ``Funktionales +Programmieren (SML)'' erfahren und wurde mit dem Editor-Programm ``Jedit'' +vertraut gemacht. + +\paragraph{Informationen \"uber die Studienrichtungen der Informatik} konnte ich +auch gewinnen. Ich habe Zug\"ange bei tugonline in Erfahrung gebracht und habe +mich \"uber die Studienrichtungen Informatik, Telematik und Softwareentwicklung- +Wirtschaft informiert. + +\paragraph{Arbeitserfahrung} konnte ich auch einige erlangen. Es herrschte eine +sehr komplexe, und vor allem ungewohnte Arbeitsumgebung (Linux,Mercurial,Isabelle) +an die es sich zu gew\"ohnen galt. Es wurde mit mehreren dutzend Files mit einigen +tausend Programmzeilen gearbeitet. + + +\end{document} diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/CTP-userinterfaces.bib --- a/src/Doc/isac/CTP-userinterfaces.bib Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,161 +0,0 @@ -@inproceedings{Aspinall:2007:FIP:1420412.1420429, - author = {Aspinall, David and L\"{u}th, Christoph and Winterstein, Daniel}, - title = {A Framework for Interactive Proof}, - booktitle = {Proceedings of the 14th symposium on Towards Mechanized Mathematical Assistants: 6th International Conference}, - series = {Calculemus '07 / MKM '07}, - year = {2007}, - isbn = {978-3-540-73083-5}, - location = {Hagenberg, Austria}, - pages = {161--175}, - numpages = {15}, - url = {http://dx.doi.org/10.1007/978-3-540-73086-6_15}, - doi = {http://dx.doi.org/10.1007/978-3-540-73086-6_15}, - acmid = {1420429}, - publisher = {Springer-Verlag}, - address = {Berlin, Heidelberg}, -} - -@Book{armstrong:erlang96, - author = {Armstrong, Joe and others}, - title = {Concurrent Programming in Erlang}, - publisher = {Prentice Hall}, - year = {1996} -} - -@TechReport{odersky:scala06, - author = {Odersky, Martin and others}, - title = {An Overview of the Scala Programming Language}, - institution = {\'Ecole Polytechnique F\'ed\'erale de Lausanne (EPFL)}, - year = {2006}, - type = {Technical Report LAMP-REPORT-2006-001}, - address = {1015 Lausanne, Switzerland}, - note = {Second Edition}, - annote = {http://www.scala-lang.org/sites/default/files/linuxsoft_archives/docu/files/ScalaOverview.pdf} -} - -@article{Haller:2009:SAU:1496391.1496422, - author = {Haller, Philipp and Odersky, Martin}, - title = {Scala Actors: Unifying thread-based and event-based programming}, - journal = {Theor. Comput. Sci.}, - volume = {410}, - issue = {2-3}, - month = {February}, - year = {2009}, - issn = {0304-3975}, - pages = {202--220}, - numpages = {19}, - url = {http://portal.acm.org/citation.cfm?id=1496391.1496422}, - doi = {10.1016/j.tcs.2008.09.019}, - acmid = {1496422}, - publisher = {Elsevier Science Publishers Ltd.}, - address = {Essex, UK}, - keywords = {Actors, Concurrent programming, Events, Threads}, -} - -@InProceedings{scala:jmlc06, - author = {Philipp Haller and Martin Odersky}, - title = {Event-Based Programming without Inversion of Control}, - booktitle = {Proc. Joint Modular Languages Conference}, - year = 2006, - series = {Springer LNCS} -} - - -@InProceedings{makarius:isa-scala-jedit, - author = {Makarius Wenzel}, - title = {Asyncronous Proof Processing with {Isabelle/Scala} and {Isabelle/jEdit}}, - booktitle = {User Interfaces for Theorem Provers (UITP 2010)}, - year = {2010}, - editor = {C. Sacerdoti Coen and D. Aspinall}, - address = {Edinburgh, Scotland}, - month = {July}, - organization = {FLOC 2010 Satellite Workshop}, - note = {http://www4.in.tum.de/~wenzelm/papers/async-isabelle-scala.pdf} -} - -@Book{db:dom-eng, - author = {Bj{\o}rner, Dines}, - title = {Domain Engineering. Technology Management, Research and Engineering}, - publisher = {JAIST Press}, - year = {2009}, - month = {Feb}, - series = {COE Research Monograph Series}, - volume = {4}, - address = {Nomi, Japan} -} - -@inproceedings{Haftmann-Nipkow:2010:code, - author = {Florian Haftmann and Tobias Nipkow}, - title = {Code Generation via Higher-Order Rewrite Systems}, - booktitle = {Functional and Logic Programming, 10th International -Symposium: {FLOPS} 2010}, - year = {2010}, - publisher = {Springer}, - series = {Lecture Notes in Computer Science}, - volume = {6009} -} - -@Manual{coq1999, - title = {The Coq Proof Assistant}, - author = {Barras, B. and others}, - organization = {INRIA-Rocquencourt - CNRS-ENS Lyon}, - month = {July}, - year = {1999}, - pnote={},status={cited},source={mkm01.caprotti},location={} -} - -@Book{meta-ML, - author = {Gordon,M. and Milner,R. and Wadsworth,C. P.}, - title = {Edinburgh LCF: A Mechanised Logic of Computation}, - publisher = { Springer-Verlag}, - year = {1979}, - volume = {78}, - series = {Lecture Notes in Computer Science} -} - -@book{Paulson:Isa94, - title={Isabelle: a generic theorem prover}, - author={Paulson, Lawrence C. }, publisher={Springer-Verlag},year={1994}, - volume={828},series={Lecture Notes in Computer Science},address={},edition={},month={}, - note={With contributions by Topias Nipkow}, - status={},source={},location={-} - } - -@Book{pl:milner97, - author = {Robin Milner and Mads Tofte and Robert Harper and David MacQueen}, - title = {The Definition of Standard ML (Revised)}, - publisher = {The MIT Press}, - year = 1997, - address = {Cambridge, London}, - annote = {97bok375} -} - -@Article{back-grundy-wright-98, - author = {Back, Ralph and Grundy, Jim and von Wright, Joakim}, - title = {Structured Calculational Proof}, - journal = {Formal Aspects of Computing}, - year = {1998}, - number = {9}, - pages = {469-483} -} - -@Manual{isar-impl, - title = {The {Isabelle/Isar} Implementation}, - author = {Makarius Wenzel}, - month = {April 19}, - year = {2009}, - note = {With contributions by Florian Haftmann and Larry Paulson} -} - -@InProceedings{wenzel:isar, - author = {Wenzel, Markus}, - title = {Isar - a Generic Interpretative Approach to Readable Formal Proof Documents}, - booktitle = {Theorem Proving in Higher Order Logics}, - year = {1999}, - editor = {G. Dowek, A. Hirschowitz, C. Paulin, L. Thery}, - series = {LNCS 1690}, - organization = {12th International Conference TPHOLs'99}, - publisher = {Springer} -} - - diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/CTP-userinterfaces.tex --- a/src/Doc/isac/CTP-userinterfaces.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,445 +0,0 @@ -\documentclass{article} -\usepackage{a4} -\usepackage{times} -\usepackage{latexsym} -\bibliographystyle{alpha} -\usepackage{graphicx} - -\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} -\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} -\def\Problem{ {\tt Problem }} - -\title{Userinterfaces for Computer Theorem Provers.\\ - Contributions to Isabelle -} - -\author{G. Schafhauser, A. Schulhofer, M. Steger\\ -Knowledge Management Institute (KMI)\\ -TU Graz} - -\begin{document} -\maketitle -\abstract{ -This paper accompanies a pre-study on a sub-project planned within the \sisac-project. The goal of this sub-project is to extend the userinterface of the theorem prover Isabelle such, that Structured Derivations according to R.J.Back are interactively processed. The sub-project is one step towards using the upcoming Isabelle/Isar/Scala layer for \sisac. - -The paper comprises three parts: (1) Ample space is given to background information about the state of the art in user interfaces for theorem provers and about the upcoming requirements for future developments. (2) focuses the strategy of Isabelle and decisions in order to cope with future requirements. (3) provides a protocol of preparatory work for the sub-project. - -By the way, this paper shall serve as an entry point for students interested in joining the the work propared.} - -\section{Introduction}\label{intro} -Computer Theorem Provers (CTPs \footnote{The term CTP is used to address two different things in this paper: (1) the academic discipline comprising respective theories as well as (2) the products developed within this discipline, the provers and the respective technology.}) have a tradition as long as Computer Algebra Systems (CAS), another kind of mathematics assistants. However, CTPs task of proving is more challenging than calculating; so, in contrary to CASs, CTPs are not yet in widespread use --- not yet, because CTPs are on the step into industrial use in the current decade: Safe-critical software requires to be proven correct more and more \cite{db:dom-eng}, and the technology of CTP becomes ready to accomplish the task of efficiently proving hundreds of proof obligations. - -The present shift of the predominant user group from academic experts to software engineers raises novel user requirements for graphical user interfaces (GUI) of CTP. CTPs will become components of integrated development environments, and the knowledge bases have to scale up to industrial size. - -Two issues are particularly challenging: First, future knowledge bases (containing specifications, programs, tests etc) will under joint construction of many engineers. So requirements concerning cooperative work arise as already known from distributed repositories and version management. - -Second, CTP tends to exhaust resources in memory and in run-time. So, CTP will take profit from multicore processors upcoming in this decade --- and CTP are best suited to meet the architectural challenges raised by parallel programming, since this kind of mathematics assistants generally follow rigorous architectural principles and are comparably easy to adapt to these challenges \cite{makarius:isa-scala-jedit}. - -\medskip The paper is organised as follows: First a survey on CTP is given, Sect.\ref{ctp-techn} introduces two prominent CTPs, Sect.\ref{gui-coq-isa} describes their present user interfaces and Sect.\ref{gui-requir} goes into details with the novel requirements mentioned. Then Isabelle's plans for re-designing the user interface are presented: Sect.\ref{ml-users} motivates the strategy of how to approach the users' world, Sect.\ref{scala-medi} describes the rather recent programming language Scala connecting the world of languages for mathematics with the users' world and Sect.\ref{actors} goes into details with Scala's actor library. Finally possible contributions of the \sisac-team at TUG are discussed and prerequisites for such contributions presented: Sect.\ref{struct-der} presents a format for calculations particularly appropriate for education, which requires CTP support, Sect.\ref{plugin} describes plug-in technology required and Sect.\ref{netbeans} notes crucial details of proper project set-up in an integrated development environment. - -%Georg -\section{State of the art in CTP Interfaces} - -\subsection{A European technology: Coq and Isabelle}\label{ctp-techn} -% http://en.wikipedia.org/wiki/Coq\\ -% http://coq.inria.fr/ -% -% http://en.wikipedia.org/wiki/Isabelle\_(theorem\_prover)\\ -% http://isabelle.in.tum.de/index.html -% -%why math -- functional: some of the languages have been specifically designed for constructing software for symbolic computation (SC). -%%+ required for \ref{ml-users} -% -%SC http://en.wikipedia.org/wiki/Symbolic\_computation -%% mainly does not compute numerical values, but terms containing variables like functions (symbols) -% -%The LCF project -%http://hopl.murdoch.edu.au/showlanguage.prx?exp=8177 -%specifically designed a 'meta language' (ML) -%http://en.wikipedia.org/wiki/ML\_(programming\_language) -%\cite{pl:milner97} -%for developing CTP -\subsubsection{Standard ML} -Standard ML is a general-purpose, modular, functional programming language \cite{pl:milner97}. -Programs written in Standard ML consist of expressions to be evaluated, as opposed to statements or commands. -Functional programming languages constitute a family very different of object orientated languages, see Sect. \ref{ml-users}. ML originated from the LCF-project(Logic for Computable Functions)\cite{meta-Ml}, where it had been developed as a meta language. Since ML has been standardised this family of language is called Standard ML. Important for the logical foundation of SML is the $\lambda$-calculus. -%http://en.wikipedia.org/wiki/Standard_M -\subsubsection{Coq} -Coq is an interactive theorem prover, developed in France. -It is programmed in Objective Caml, an ML based programming language. -It has the ability to express mathematical assertions and check proof of mathematical assertions. -Furthermore Coq includes automatic theorem proving tactics and decision procedures. -Properties, programs and proofs are written a functional programming language called the Calculus of Inductive Constructions (CIC). -Proof development in Coq is done through a language of tactics that allows a user-guided proof process \cite{coq1999}. -Another feature of Coq is “that it can automatically extract executable programs from specifications, as either Objective Caml -or Haskell source code.“ -There are many easy-to-read introductions to Coq \footnote{http://coq.inria.fr/a-short-introduction-to-coq} on the internet. -\subsubsection{Isabelle} -Isabelle is an interactive theorem proving framework for high-level natural deduction proofs \cite{Paulson:Isa94}, written in Standard ML. -Isabelle is developed at University of Cambridge, Technische Universit\"at M\"unchen -and Universit\'e Paris-Sud. Isabelle is called a framework, because it implements several object logics. -The most widespread logic of Isabelle is Isabelle/HOL, short for higher-order logic. -Isabelle/HOL includes several specification tools, e.g. for data-types, inductive definitions and functions with complex pattern matching. -Proofs are written in the structured proof language Isar \cite{wenzel:isar}.Isabelle implements several tools, e.g. a reasoner, a simplifier and powerful automatic provers(Sledgehammer), increase the user's productivity in theorem proving. -Isabelle provides notational support: new notations can be introduced, using normal mathematical symbols. -Definitions and proofs may include \LaTeX{} source, from which Isabelle can automatically generate typeset documents. -Isabelle/HOL allows to turn executable specifications directly into code in SML, OCaml, and Haskell \cite{Haftmann-Nipkow:2010:code}. -%(http://www.cl.cam.ac.uk/research/hvg/Isabelle/overview.html) -\subsection{Userinterfaces for CTP: Coq and Isabelle}\label{gui-coq-isa} -% CoqIDE, .. -% http://coq.inria.fr/what-is-coq?q=node/57\\ -% earlier than Isabelle/jEdit -% -% ProofGeneral for Isabelle -% http://proofgeneral.inf.ed.ac.uk/\\ -% emacs stone age ? -\subsubsection{Coq Integrated Development Environment} -CoqIDE\footnote{http://coq.inria.fr/V8.1/refman/Reference-Manual016.html}, short for Coq Integrated Development Environment, is a graphical interface for Coq. It is written in Ocaml. -Its main purpose is to allow the user to navigate forward and backward into a Coq file, -executing corresponding commands or undoing them respectively. -There are several buffers for helping to write proof scripts. -Among all these buffers, there is always one which is the current running buffer, whose name is displayed on a green background, -which is the one where Coq commands are currently executed. -CoqIDE provides also a feedback system for the user. -Therefore the background is green when a command succeeds, otherwise an error message is displayed in the message window and the error location is underlined red. -CoqIDE offers only basic editing commands, therefore it is possible to launch another more sophisticated text editor. -Furthermore CoqIde provides a proof wizard “for automatically trying to solve the current goal using simple tactics.” -Another features of this IDE are the customisation options, which can be accessed by the Edit menu. -This allows the user to change the appearance of the IDE. - - -\begin{figure}[htbp] -\centering -%\includegraphics[bb=0 0 10 10]{coqide.png} -\includegraphics[scale=0.20]{fig/coqide} -\caption{CoqIDE main screen} -\end{figure} - - -%(http://coq.inria.fr/V8.1/refman/Reference-Manual016.html) -\subsubsection{Proof General for Isabelle} -Proof General is a generic front-end for proof assistants \cite{Aspinall:2007:FIP:1420412.1420429}, based on the text editor Emacs. -It has been developed at the University of Edinburgh with contributions from other sites. -Proof General supports the following proof assistants: Isabelle, Coq, PhoX, LEGO. -It is used to write proof scripts. A Proof Script is a sequence of commands sent to theorem prover. -The communication between the user and the theorem prover takes place via two or more Emacs text widgets. -Therefore the user sees only the output from the latest proof step. - - -Isabelle/Isar\footnote{http://proofgeneral.inf.ed.ac.uk/} Proof General has full support for multiple file scripting, with dependencies between theories communicated between Isabelle and Proof General. -There is full support for Unicode Tokens, using the Isabelle print mode for X Symbol tokens. Many Isabelle theories have X Symbol syntax already defined -and it's easy to add to your own theories. -%(http://proofgeneral.inf.ed.ac.uk/fileshow.php?file=releases%2FProofGeneral%2Fisar%2FREADME) -\begin{figure}[htbp] -\centering -\includegraphics[scale=0.30]{fig/pgisabelle} -\caption{Proof General for Isabelle}% -\end{figure} - -\subsubsection{Isabelle/Jedit} -jEdit is a text editor for programmers, written in Java. -Compared to fully-featured IDEs, such as Eclipse or NetBeans, jEdit is much -smaller and better focused on its primary task of text editing. -The general look of the Isabelle/jEdit plug-in is similar to existing Java IDEs \cite{makarius:isa-scala-jedit}. -The main Isabelle/jEdit plug-in consists of ten small Scala files that augment some key jEdit components in order to provide a metaphor of asynchronous proof document editing. -Isabelle/jEdit integrates the jEdit 4.3.2 framework and some further jEdit plug-ins. -It also implements custom-made 'IsabelleText Unicode' font that actually contains the usual Isabelle symbols that users expect from long -years of Proof General X-Symbol support. -The editor provides useful feedback, via semantic information from the processed document in the background. -A lot of information can be directly attached -to the source text, via colouring, tool-tips, pop-ups etc. - -\subsection{Upcoming requirements for userinterfaces in CTP}\label{gui-requir} -% @ interaction close to tty (Telegraph)\\ -% BUT: separate parts in {\em one} proof could be processed in parallel -% -% @ http://www.informatik.uni-bremen.de/uitp/ -% -% @ ... see\\ -% http://www4.in.tum.de/~wenzelm/papers/async-isabelle-scala.pdf,\\ -% http://www4.in.tum.de/~wenzelm/papers/parallel-isabelle.pdf -"After several decades, most proof assistants are still centred around TTY-based interaction in a -tight read-eval-print loop. -All Emacs-based GUI's for CTPs follow this synchronous -model based on single commands with immediate response, meaning that the editor waits for the -prover after each command", according to \cite{makarius:isa-scala-jedit}. As to multicore politics of leading semiconductor chip manufacturer, parallelism in software technology has become an issue. -Therefore the support of parallelism in CTP technology improves the performance and multiuser support. -%So it is necessary to use proof documents instead of proof scripts. -%Proof scripts are sequences of commands however proof documents are structured texts. -%So the proof document idea seems to guarantee the perfect support for parallelism in the CTP technology. -Proof language Isar is structured such, that different parts can be interpreted in parallel. For instance, some might employ an -an automated prover for some minutes, while the user wants to proceed with other parts of the same proof. -A well-established concept able to cope with such parallel processing in actors, as introduced by Erlang. -This will be discussed in more detail in Sect. \ref{actors} - - -%Andreas -\section{Isabelle's plans for new userinterfaces}\label{gui-plans} - -The following observations lead to novel requirements for CTPS' userinterface: - -\begin{itemize} -\item theorem proving will be integrated into software development -\item hundreds of proof obligations are generated during a software verification process -\item so the final goal of Isabelle's planning is integration with other software development tools in an integrated development environment (IDE) -\item still many principal issues need to be clarified with respect to integration of CTP and other development tools. So engaging into details makes no sense at the present, and Isabelle will approach the final goal via experimental intermediate steps of integration -\item favourite IDE is jEdit, because it is clearer than Eclipse or NetBeans. The reason behind this choice follows in section \ref{plugin} -\end{itemize} - -These indicate design decisions are sketched in the sequel. - -\subsection{Connect ML-world to the users' world via JVM}\label{ml-users} -In Sect.\ref{ctp-techn} reasons have been given, why mathematics software at the state-of-the-art cannot be written in Java or the like. On the other side, Sect.\ref{gui-requir} stated requirements for mathematical userinterfaces, which cannot be accomplished by ML-like languages. These requirements can be best accomplished by languages like Java, which have powerful libraries available for convenient assembly of GUIs. - -\paragraph{Example: a functional mathematics engine} as the experimental one in the \sisac-project is given by the following signature: -{\it -\begin{tabbing} -\=xx\=xxxxxxxxxxxxxxxxxxxxxxxxx\=\kill -\>signature INTERPRETER =\\ -\>sig\\ -\>\>type calcstate\\ -\>\>type step = formula * position * tactic\\ -\>\> \\ -\>\>val do\_next : program $\rightarrow$ calcstate $\rightarrow$ (calcstate * step)\\ -\>\>val apply\_tactic : program $\rightarrow$ calcstate $\rightarrow$ position $\rightarrow$ tactic $\rightarrow$ (calcstate * step list)\\ -\>\>val apply\_formula : program $\rightarrow$ calcstate $\rightarrow$ position $\rightarrow$ formula $\rightarrow$ (calcstate * step list)\\ -\>end -\end{tabbing}} -The three essential functions are \textit{do\_next}, which reads a \textit{program} for determining the next \textit{step} in a calculation, the function \textit{apply\_tactic}, which applies a \textit{tactic} input by the user to the current \textit{position} in a calculation and thus may produce a list of \textit{step}s and the function \textit{apply\_formula}, which applies an input \textit{formula} accordingly. - -Now, the point with functional programming is, that the functions do {\em not} cause persistent updates in some memory, rather: all three functions above take the current state of the calculation, \textit{calcstate}, as an argument and after they have done they work return the updated \textit{calcstate}. - -There are several advantages of this kind of programming: more straight forward verification, which is not discussed here, and other features. For instance, given the three functions above, it is easy to undo steps of calculations, or go back to an earlier step of calculations: one just needs to store the \textit{calcstate}s (in a list), even without knowing the details of the \textit{calcstate}, which thus can be encapsulated for internal access only. - -\paragraph{Example: an object-oriented wrapper} as required for embedding the above mathematics engine into an object-oriented system. Such a wrapper may look like this: -{\footnotesize -\begin{verbatim} - public class Calcstate - { - private Program program_; - private Tree calcstate_; - private Position position_; - - public Calcstate(Program program) {...} - public Step do_next() {...} - public List apply_tactic(Tactic tactic) {...} - public List apply_formular(Formular formular) {...} - } -\end{verbatim} -} -\subsection{Scala as a mediator between ML and JVM}\label{scala-medi} -Scala \footnote{http://www.scala-lang.org} is a hybrid programming language. It combines object-oriented programming and functional programming. Scala runs on the Java Virtual Machine and is byte-code compatible with existing Java programs. The compilation model of Scala is nearly the same as the Java's model. So existing tools, libraries and applications can be used with Scala. The syntax of Scala is similar to Java and ML. A number of keywords plus the block syntax is adopted from Java and from ML the syntax for type annotation and declaration. The source-code is typically reduced, concisely and more compact compared to equivalent Java code \footnote{http://www.scalasolutions.com/scala}. - -Scala is pure object-oriented, this means every value is an object \cite{odersky:scala06}. The same is true for primitive data types, because compiler-generated byte code is using primitive data types. Known design patterns from OOP can be used with Scala as well. "Data types and behaviours of objects are described by classes and traits" \footnote{http://en.wikipedia.org/wiki/Scala\_(programming\_language)}. Traits not only consist of definitions, they also can contain implementations of methods. To avoid the problems of multiple inheritance, classes are able to extend various traits, this is a flexible mixin-based mechanism. The keyword Object is used to implement a Singleton-Class. - -In Scala every function is a value, hence Scala is also a functional language \cite{odersky:scala06}. Functions in Scala are first-class objects, this means it is possible to pass a function as a parameter, return a function from a subroutine, or assign to a variable. Scala also supports case classes, which are used for pattern matching. Case classes are regular classes which export their constructor parameters \footnote{http://de.wikipedia.org/wiki/Scala\_(Programmiersprache)}. Furthermore Scala allows functions to be nested. - -Scala is more statically typed than Java, but is able to infer types by usage. So most static type declarations are optional. This static type system ensures a safe and coherent use of abstraction. Scala supports \footnote{http://en.wikipedia.org/wiki/Scala\_(programming\_language)}: - -\begin{itemize} -\item generic classes -\item variance annotations -\item upper and lower type bounds -\item classes and abstract types as object members -\item compound types -\item explicitly typed self references -\item views -\item polymorphic methods -\end{itemize} - -Static types need no explicit declaration but can be given to give the code some clarity. - -Scala supports threads, but the Scala library contains an actor model inspired from Erlang \cite{armstrong:erlang96}. Concurrency and Scala actors follow in the next section. - -\subsection{Support for parallel processing}\label{actors} -Concurrency has lately become more and more attention, because multicore processors make concurrency very important for efficient program execution, by running multiple threads parallel and so concurrent programming gets indispensable and distributed computing, web services and mobile environments are naturally concurrent. A very attractive model is message-based concurrency, which is based on the actor model. - -An actor is a concurrent process that executes a function. The state of an actor gets never shared, so it doesn't need to compete for locks of shared data. Actors own a mailbox where incoming messages are stored in. A mailbox is mainly a queue with actors, which operate as several producers and one consumer. Actors share data by sending messages which are sent asynchronously. Messages are unchangeable, so they don't require a lock. By creating new actors, by sending messages to known actors, or changing its behaviour, an actor is able to reply to a message. The actor-based process is combined with pattern matching for messages. - -The Erlang programming language is a functional programming language that supports message-based concurrency, which operates with actors. It was developed for real-time control systems. Such systems are telephone exchanges, network simulators and distributed resource controllers \cite{scala:jmlc06}. These systems use a very popular lightweight implementation and a large number of concurrent processes, which can be active simultaneously. - -Operating system threads and threads of virtual machines are too heavyweight for the implementation of such processes. The standard concurrency for mainstream platforms were shared-memory threads with locks. Such a platform is the Java Virtual Machine (JVM), which suffers from high memory consumption and context-switching overhead. -The most disadvantageous consequences are \cite{scala:jmlc06}: -\begin{enumerate} -\item quick exhaustion of virtual address space -\item locking mechanisms often lack suitable contention managers -\end{enumerate} - -For that reasons Erlang uses lightweight concurrent processes by its own run time system and not by the underlying operating system \cite{scala:jmlc06} and the computations on these platforms are often modelled in an event-driven style, which is complicated and error-prone. -\paragraph{Two different strategies for concurrency} are being used for implementation. This two strategies often follow different programming models, the benefit of thread-based models is that they are easier to use, but they still suffer from the memory consumption and the context-switching. The event-based models are just the opposite of the thread-based, they are more efficient, but in massive designs they are very difficult. - -\subparagraph{Thread-based implementation:} The behaviour of a concurrent process is defined by implementing a thread-specific method. The execution state is maintained by an associated thread stack \cite{Haller:2009:SAU:1496391.1496422}. -Supports blocking operations and can be executed on multicore processors in parallel. - -\subparagraph{Event-based implementation:} The behaviour is defined by a number of (non-nested) event-handlers which are called from inside an event loop. The execution state of a concurrent process is maintained by an associated record or object \cite{Haller:2009:SAU:1496391.1496422}. Targets to a large number of actor which can be active simultaneously, because they are more lightweight. - -\paragraph{Actors in Scala} are based on actors in Erlang. Scala uses the basic thread model of Erlang, but on the other hand all higher-level functions got implemented in the Scala library as classes or methods. The Scala-actors are a unification of the implementation models mentioned above and they are compatible with normal Virtual Machine (VM) thread. Normal VM threads can use the same communication and monitoring capabilities, because they are treated like an actor. A message-based concurrency seems to be more secure than shared-memory with locks, because accessing an actor's mailbox is race-free. The advantage of a implementation in a library is that it can be flexibly extended and adapted to new needs. The library makes use of Scala abstraction opportunities, like partial functions and pattern matching. - -The main idea of this model is that an actor is able to wait for a message by using two different operations, which try to remove a message from the current actor's mailbox. To do so, a partial function must be given to the operation, that specifies a set of message patterns. These are {\itshape receive} and {\itshape react}. 'An actor can suspend with a full thread stack (receive) or it can suspend with just a continuation closure (react)' \cite{Haller:2009:SAU:1496391.1496422}. The first operation of an actor to wait for an message is equal to thread-based programming and the second operation to event-based programming. - -\subparagraph{receive:} The current actor's mailbox get scanned and if there is one message which matches one of the patterns declared in the partial function, the message is removed from the mailbox and the partial function is applied to the message, the result is returned. The declaration of receive: -$$\mathit{def}\;\mathit{receive}\mathit{[R]}(f: \mathit{PartialFunction}[Any, R]): \mathit{R}$$ -Otherwise the current thread blocks. Thus the receiving actor has the ability to execute normally when receiving a message which matches. Note that receive retains the complete call stack of the receiving actor; the actor’s behaviour is therefore a sequential program which corresponds to thread-based programming \cite{Haller:2009:SAU:1496391.1496422}. -\subparagraph{react:} The action which is specified in the partial function is the last code that the current actor executes, if the message is matching. The declaration of react: -$$\mathit{def}\;\mathit{react}(f: \mathit{PartialFunction}[Any, Unit]): \mathit{Nothing}$$ -The partial function gets registered by the current actor and the underlying thread gets released. React has the return type Nothing, this means that the method never returns normally. When the actor receives a matching message, the earlier registered partial function gets called and the actor's execution gets continued. The partial function f which corresponds to a set of event handlers \cite{Haller:2009:SAU:1496391.1496422}. - -For this implementation multiple actors are executed by multiple threads and therefore a thread pool is used. Whenever it is necessary the pool can be re sized, to support the operations of the thread-based and event-based model. If only operations of the event-based model are executed then the thread pool could be fixed. To avoid system-included deadlocks, if some actors use thread-based operations, the thread pool has to grow, because if there are outstanding tasks and every worker thread is occupied by a blocked actor, new threads are necessary. - -Since the communication between actors takes place through asynchronous message passing, asynchronous operations get executed, tasks have to be created and submitted to a thread pool for execution. A new task is created, when an actor spawns a new actor or a message, which enables an actor to continue, is send to an actor which is suspended in a react operation or by calling react, where a message can be immediately removed from the mailbox \cite{Haller:2009:SAU:1496391.1496422}. - -% Marco -\section{Planned contributions at TU Graz} - -\subsection{Make Isabelle process structured derivations}\label{struct-der} -Structured Derivations (SD) is a format for calculational reasoning, which has been established by \cite{back-grundy-wright-98}. This is an example calculation: -{\it\begin{tabbing} -123\=123\=123\=123\=123\=123\=123\=123\=123\=123\=123\=123\=\kill -\> $\bullet$\> \Problem [ maximum\_by, calculus ]\\ -\>\> $\vdash$\> $A = 2\cdot u\cdot v - u^2$\\ -\>\> $\bullet$\> \Problem [make, diffable, funtion]\\ -\>\> \dots\> $\overline{A}(\alpha) = 8\cdot r^2\cdot\sin\alpha\cdot\cos\alpha - 4\cdot r^2\cdot(\sin\alpha)^2$\\ -\>\> $\bullet$\> \Problem [on\_interval, for\_maximum, differentiate, function]\\ -\>\>\> $\vdash$\> $\overline{A}(\alpha) = 8\cdot r^2\cdot\sin\alpha\cdot\cos\alpha - 4\cdot r^2\cdot(\sin\alpha)^2$\\ -\>\>\> $\bullet$\> \Problem [differentiate, funtion]\\ -\>\>\> \dots\> $\overline{A}^\prime(\alpha) = 8\cdot r^2\cdot(-(\sin\alpha)^2+(\cos\alpha)^2 - 2\cdot\sin\alpha\cdot\cos\alpha)$\\ -\>\>\> $\bullet$\> \Problem [on\_interval, goniometric, equation]\\ -\>\>\> \dots\> $\alpha = \tan^{-1}(-1+\sqrt{2})$\\ -\>\> \dots\> $\alpha = \tan^{-1}(-1+\sqrt{2})$\\ -\>\> $\bullet$\> \Problem [tool, find\_values]\\ -\>\> \dots\> [ $u=0.23\cdot r, \:v=0.76\cdot r$ ]\\ -\> \dots\> [ $u=0.23\cdot r, \:v=0.76\cdot r$ ] %TODO calculate ! -\end{tabbing}} -The plan is to use the machinery provided Isabelle/Isar as a 'logical operating system' ~\cite{isar-impl} and adapt the machinery such that is accepts SC in parallel to the Isar proof language~\cite{wenzel:isar}. - -This plan involves the following details. - -\subsection{Add a plug-in to jEdit}\label{plugin} - % file structure, copied from example project ... -%Die von jEdit verfolgte Strategie im Bezug auf plug-in Management und natürlich generell die totale Offenlegegung des Codes ist für ein Projekt wie Isabelle und auch für das Isac-Project an der TU ideal. plug-ins lassen sich sehr einfach anfügen und durch die riesige Vielfalt von bereits bestehenden plug-ins ist auch die Adaption von plug-ins möglich bzw. zu empfehlen, denn warum sollte nicht bereits funktionierender Code verwendet werden?\\ -The importance of connecting the ML-world with the world of user interfaces has been is discussed in Sect.\ref{ml-users}. jEdit follows these lines, it is an open-source, Java-based text editor that works on Windows, Mac OS X, and Linux. A big advantage of jEdit is, that there is a very good and also simple way to use and write a plug-in. There are a lot of useful and powerful plug-ins available in the net and it is also possible to use a existing plug-in as part of a new one. Because of this facts, jEdit is very suitable for a project like Isabelle and also for the \sisac-project at TU-Graz. - -Each jEdit plug-in\footnote{To get more information about the jEdit infrastructure see: http://jedit.org/users-guide/plugin-intro} basically consists of source files, written in Java or Scala, XML-files and property files. The XML-Files are important for the administration of a plug-in and provides information like the name, author, ... of the plug-in. They are also containing small pieces of BeanShell code which is executed upon a user request. (Like pressing the 'start plugin' button.) So the XML-files provide the “glue” between user input and specific plug-in routines located in the source files. As you see, this files are used as interface between the plug-in and the jEdit engine itself. - -Based on the jEdit API, you are allowed to design your code quit freely and don't have to use a prescribed way to implement your ideas. - - -%isabell plugin beschreiben!!!!!!!! -The Isabelle-team also follow use this plug-in structure. In the next paragraph the involved files will be described. The jEdit-Isabelle plug-in consists of: -\begin{itemize} -\item 14 Scala-source-files -\item 3 XML-files -\item 1 property file -\end{itemize} -%Das vom Isabelle-Team erstellte jEdit plug-in folgt natürlich auch dem oben erklärten Muster. Es wird nun genauer auf dieses plug-in eingegangen. The plugin consits of 14 scala-source-files, three xml-files and one property-file. -\begin{description} -\item[Isabelle.props] The property-file \textit{Isabelle.props} contains general information about the Isabelle plug-in and the needed dependencies between Isabelle and the other used plug-ins like sidekick. -\item[dockables.xml] The XML-file \textit{dockables.xml} is used to create the needed dock-able windows which are important to set up the GUI of the plug-in. -\item[actions.xml] In the file \textit{actions.xml}, the dockable windows are added to the window-manager \textit{wm} and there is also some BeanShell-code to activate the Isabelle-GUI. -\item[services.xml] The last XML-file is \textit{services.xml} and is used to create instances of needed jEdit plug-ins. -\end{description} -This four files are located in the folder \textit{plugin}.\\ - -The more interesting files, the scala-files of the plug-in, can be found in the 'src/jedit'-directory. In this directory you can find the file \textit{Dummy.java} which is a dummy class and is simply used to make javadoc work. Just forget about this file. Also there is a folder/package \textit{jedit} which contains all Scala-source-files. Now it is time to take a closer look on the source-files: -\begin{description} -\item[plugin.scala] The file \textit{plugin.scala} is the main-file of the Isabelle plug-in and there are two important parts. First the \textit{Isabelle object}. This object contains data like name and path and also few basic functions. The second part is the \textit{class Plugin} which is derived from EBPlugin. Here the basic methods \textit{handleMessage}, \textit{start} and \textit{stop} are implemented. Each jEdit plug-in should have this methods because they are very important for the handling of the plug-in! -\item[dockable.scala] jEdit and also the Isabelle plug-in work with dock-able windows. This means that you can move around each single window and dock it somewhere on the screen. So it is possible to customise the jEdit-GUI. To support this, the file \textit{dockable.scala} is needed. The file \textit{output-dockable.scala} is derived from \textit{dockable.scala} and is used to print the result/output in a dock-able window. The same thing with \textit{protocol-dockable.scala} and \textit{raw-output-dockable.scala}. -\item[scala-console.scala] The next interesting file is \textit{scala-console.scala} with the main-class Scala-Console. This class is used to expand the Console plug-in in a way, that it is possible to interpret Scala-code with a Shell inside of jEdit. -\item[isabelle-sidekick.scala] The file \textit{isabelle-sidekick.scala} is related to the file \textit{scala-console.scala} because it is also used to adapt the plug-in Sidekick for Isabelle. -\item[document-model.scala, document-view.scala] The files \textit{document-model.scala} and \textit{document-view.scala} are used to connect the jEdit-buffer/the text-area to Isabelle. Both classes offer, upon others, methods to activate and deactivate this features. -\end{description} -There also some other source-files but they aren’t discussed here, because the main goal of this paragraph is to give a basic idea how a jEdit plug-in should be set up and the remaining files are not as important for the Isabelle plug-in structure. -%\begin{itemize} -%\item $html_panel.scala$ -%\item $isabelle_encoding.scala$ -%\item $isabelle_hyperlinks.scala$ -%\item $isabelle_options.scala$ -%\item $isabelle_token_maker.scala$ -%\item $isabelle_hyperlinks.scala$ -%\end{itemize} - - -% Like each other jEdit-Plugin also this - -%Das Konzept des frei wählbaren Designs ist am Beginn villeicht etwas schwierig umzusetzten, da es leichter ist, sich irgendwo anzulehnen bzw. ein bereits bestehendes sowie funktionierendes Konzept zu übernehmen. So wurden auch die ersten Schritte an der TU gemacht. Zu diesem Zweck wurde das von den Entwicklern von jEdit zur Verfügung gestellte plugin 'QuickNotepad' übernommen und in Scala übersetzt. Obwohl Scala eng mit Java verknüpft ist, war doch einiges an 'rewritting' notwendig bis das Scala-plugin lauffähig wurde. Die benötigten XML-files konnten dazu nahezu unberührt gelassen werden.\\ - -\subsection{Details of NetBeans projects}\label{netbeans} -% Scala + Java: html project files -As described in the last paragraph, jEdit is a open-source-project. The jEdit-developers use a NetBeans-project to produce the source-code and so it is beneficial to use a NetBeans project too, because there is a quite good documentation about setting up a NetBeans-project with the jEdit-source. See http://wiki.netbeans.org/NetbeansedJEdit for further information.\\\\ -If you want to set up a new jEdit plug-in project you have to attend that you have to create some source-files and that there must be a connection to the jEdit-source because you will need to exchange data with the jEdit engine. This could probably look like: \textit{jEdit.getProperty("options.isabelle.isabelle")}\\ -As shown above, the jEdit-source is needed to compile and build your plug-in. There are two ways to organise your project: -\begin{itemize} -\item with jEdit source code - two projects in one -\item with jedit.jar library -\end{itemize} -\subsubsection{Plug-in with jEdit-source} -It is a good way to download the jEdit source as NetBeans project because then it is possible to add another sub-project to the existing jEdit-NetBeans-project. As you see it is also possible to mix Scala and Java. A big advantage is, that debugging will now work really fine. If you want to set up a project like this, you should complete the following steps. -\begin{enumerate} -\item {Create a new NetBeans-project for your plug-in like \textit{example-plugin}. This will probably be a Scala-Project.} -\item Download (and try out) the \textit{jEdit-NetBeans-project} -\item at project \textit{example-plugin}: \textit{Project-browser} $\rightarrow$ Right-click at \textit{Libraries} $\rightarrow$ \textit{add Project...} and then choose the \textit{jEdit-NetBeans-project}. -\item at project \textit{example-plugin}: \textit{Project-browser} $\rightarrow$ Right-click at project-name-label $\rightarrow$ \textit{Properties} $\rightarrow$ \textit{Run} $\rightarrow$ \textit{Main Class:} org.gjt.sp.jedit.jEdit -\item compile and run -\end{enumerate} - -\subsubsection{Plug-in with jedit.jar} -It is also possible to use the \textit{jedit.jar} file. This file is already included in \$ISABELLE-HOME/contrib/jedit-4.3.2. Now you just have to follow this steps: -\begin{enumerate} -\item {Create a new NetBeans-project for your plug-in like \textit{example-plugin}. This will probably be a Scala-Project.} -\item at project \textit{example-plugin}: \textit{Project-browser} $\rightarrow$ Right-click at \textit{Libraries} $\rightarrow$ \textit{add JAR/Folder...} and then choose the \textit{jedit.jar} file. -\item at project \textit{example-plugin}: \textit{Project-browser} $\rightarrow$ Right-click at project-name-label $\rightarrow$ \textit{Properties} $\rightarrow$ \textit{Run} $\rightarrow$ \textit{Main Class:} org.gjt.sp.jedit.jEdit -\item compile and run -\end{enumerate} -This are two different ways to get started. It is difficult to say what is better because both versions have advantages. Now it is time to start coding your own plug-in but there are still a few things to think about. Remember, that a plug-in consists of source-, XML- and property-files. On default, NetBeans will just pack the source-files in the \textit{example-plugin.jar}-package. So you have to add a copy/move-routine in the \textit{build.xml} file of your NetBeans-project to get a complemented package. -\begin{itemize} -\item $\langle target name="-pre-jar"\rangle$ -\item $ \langle copy $file="plugin/services.xml" todir="\${build.classes.dir}" $/\rangle$ -\item $ \langle copy $file="plugin/dockables.xml" todir="\${build.classes.dir}" $/\rangle$ -\item $ \langle copy $file="plugin/actions.xml" todir="\${build.classes.dir}" $/\rangle$ -\item $ \langle copy $file="plugin/Isabelle.props" todir="\${build.classes.dir}" $/\rangle$ -\item $ \langle /target\rangle$ -\end{itemize} -%* kurze aufzählung der xml-netbeans-files + erklärung\\ -\subsubsection{NetBeans project files} -As you see in the paragraph above, it is also important to have basic knowledge about NetBeans, the project structure and how to change the operational sequences. A typical NetBeans-project consist of the source- and library-files and administrative XML- and property-files. In this paragraph the administrative part of the project is of note. The most important file is \textit{build.xml}. This file can be found in the project directory. There is also a folder \textit{nbproject} which contains the remaining XML- and property-files and also a folder \textit{private}, where individual user information about the project is stored. The files in this \textit{private} folder are not important to describe (and they should not be pushed on the repository!). - -A build-file like \textit{build.xml} contains one project and at least one (default) target. Targets contain task elements. Each task element of the build-file can have an id attribute and can later be referred to by the value supplied to this. So the id has to be unique. Such targets can be "run", "debug", "build", ... and can have dependencies to other targets. Tasks define what should happen, if a target is executed. So like in the example above, the target is \textit{pre-jar}, that means that this things will happen before the jar-package is packed. The tasks of this target are copying some files into the package. - -The files inside the \textit{nbproject}-folder are not so important because some of it are generated from \textit{build.xml} and changes in this files are useless. Just the file project.properties is really interesting because this file gives a nice and tight overview about the project settings. - -\subsection{Use interfaces between Java and Scala}\label{java-scala} -% how are data exchanged between Scala and Java ... -jEdit is completely written in Java and the required plugin(s) for \sisac{ }will be coded in Scala - so there must be ways to exchange data between Java and Scala. One way is to connect this two worlds with the in 4.2 described XML-files. Here you need to use a third type of code to get an interface between Java and Scala code. But there is also a way to get a direct connection. - -This link should be shown on the graphic-library \textit{Swing}. In both languages it is possible to use Swing which provides a lot of different shapes and useful functionality. So there is a Java-Swing and also a Scala-Swing-library. Now it is interesting to examine the connection between this two libraries. - -In Scala a direct use of Java-Libs (like Java-Swing) is possible. So if you are Java-Programmer and want to use Java-Swing in Scala, you can simply type\\ \textit{import javax.swing.JButton}\footnote{http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/JButton.html} to work with a Java-button. But you can also use the Scala-equivalent \textit{scala.swing.Button}\footnote{http://www.scala-lang.org/api/current/scala/swing/Button.html}. This two button-types will provide nearly the same functionality. - -So what is the idea of creating a nearly similar library a second time? Why have the Scala-developers done such extra work? The answer is, that they have tried to improve and simplify the usage of the Swing-library(and many other libs too!). So big parts of this Scala-Libraries are just Wrapper-objects, Wrapper-Classes and Wrapper-Methods of already existing parts in Java-Libraries. Needless to say that they also added new useful shapes and functionality. -But there is one important question left: Is it possible to mix Scala- and Java-objects? And yes, it is possible. There is a really easy way to convert a Scala-object to the Java-equivalent: -\begin{enumerate} -\item \textit{import javax.swing.JButton} -\item \textit{import scala.swing.Button} -\item \textit{var b: scala.swing.Button} -\item \textit{var jb: javax.swing.JButton} -\item \textit{jb = b.peer} -\end{enumerate} -As the example above illustrates, a conversion of Scala- to Java-objects is possible. It looks easy but also a little bit useless. Why should you need this? Just imagine that there is a plug-in written in Scala and one coded in Java. With this connection between Scala and Java, it would be easy to connect this two plug-ins! -%Diesen direkten Zusammenhang zwischen Java und Scala soll anhand der Grafik-Bibliotheken Swing. Beide Sprachen stellen diese Grafik-Bibliotheken zur Verfügung (und darin auch eigene Shapes und Funktionalität). Es ist jedoch möglich, Java-Bibliotheken, wie eben auch Java-Swing in Scala zu verwenden. Ein JButton kann zum Beispiel mittels \textit{import javax.swing.JButton} eingebunden und damit sofort auch verwendet werden. Auch Scala stellt in seiner Swing-Bibliothek zur Verfügung: \textit{scala.swing.Button}. Es wird nahezu die selbe Funktionalität angeboten und teilweise die Erzeugung bzw. Verwendung vereinfacht(???). Man kann sich nun fragen, warum sich die Scala-Entwickler einerseit die Mühe gemacht haben die Verwendung Java-Swing, wie in Java selbst, möglich zu machen und andererseits mit Scala-Swing eine nahezu idente Alternative geschaffen haben. Die Antwort darauf zeigt wie der objektorientierte Teil von Scala in vielen Bereichen aufgebaut wurden. Es wurde kein neues Konzept für diese Grafikklassen entworfen sondern Wrapper-Objekte/Methoden/Klassen erstellt, die das Arbeiten mit diesen Grafikkomponenten erleichtern soll. Ein Letztes Problem bleibt noch: Es ist zwar sehr einfach ein Java-Swing-Objekt an einen Scala-Swing-Container (zb. Frame) anzubinden, da eine Konvertierung von Java-Komponente in ein Scala-Äquivalent ist problemlos möglich. ... -\section{Conclusion and future work} -This paper collected background information on the topic of userinterfaces for theorem provers, which is not covered by the standard curriculum at Graz University of Technology: Computer theorem proving, respective interfaces and novel challenges for userinterfaces raised by integration of CTP into software engineering tools within the current decade. - -The general background information has been related to students' knowledge already gained during studies: functional and object-oriented programming paradigm, programming languages with focus on Scala and Scala's specific concept to handle asynchronous processing of proof documents, the concept of actors. - -An important part of the paper is a protocol of preparatory work already done on project-setup and software components required for the next goal which is: extend the theorem prover Isabelle with Structured Derivations. - -This part is considered an appropriate to start realising this goal and to prepare for future work, which will join the \sisac-project with front-of-the-wave technology in computer theorem proving and respective userinterfaces. - -\bigskip\noindent {\Large\textbf{Acknowledgements}} - -\medskip\noindent The authors thank the lecturer of 'Verfassen wissenschaftlicher Arbeiten' in winter semester 2010/11, Dipl.-Ing. Dr.techn. Markus Strohmaier, for his support on working on the topic they are interested in.\\ -The leader of the \sisac-project expresses his pleasure about the efficient collaboration between the institutes IICM and IST at TUG. - -\bibliography{CTP-userinterfaces} -%\bibliography{bib/math-eng,bib/bk,bib/RISC_2,bib/isac,bib/pl,bib/math,bib/pl} -\end{document} \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/akargl/ferialprakt.tex --- a/src/Doc/isac/akargl/ferialprakt.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -\message{ !name(ferialprakt.tex)}\documentclass[a4paper,12pt]{article} -\usepackage{ngerman} -\usepackage{longtable} - - -\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} -\def\sisac{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} - -\title{Ferialpraxis\\ am Institut f\"ur Softwaretechnologie\\ - der Technischen Universit\"at Graz\\ \ - \\Arbeitsprotokoll} -\author{Alexander Kargl\\ - akargl@brgkepler.net} -\date{\today} - -\begin{document} - -\message{ !name(ferialprakt.tex) !offset(-3) } - -\maketitle -$\;$\\ -\vspace{0.2cm} -\section{Urspr\"ungliche Erwartungen} -In den letzten Sommerferien vor der Maturaklasse wollte ich mich genauer \"uber die Studienrichtungen im Bereich Informatik an der TU Graz informieren. Meine Interessen tendierten bereits in diese Richtung, aber ich war mir noch nicht sicher, ob das die richtige Entscheidung ist. - -Ich hatte das Gl\"uck ein Praktikum am Insitut f\"ur Softwaretechnologie absolvieren zu d\"urfen. Ich hoffte dadurch: -\begin{itemize} - \item einen Einblick in die Programmierung und Entstehung von gr\"o\3eren Softwareprojekten zu erhalten - \item neue Programmiertechniken und Sprachen kennenzulernen - \item und au\3erdem gleich wertvolle Erfahrung im Arbeitsleben sammeln zu k\"onnen -\end{itemize} - -\newpage -\section{Arbeitsprotokoll} -\begin{center} -\begin{tabular}{l|l||r} -\textbf{Datum} &\textbf{T\"atigkeit} & \textbf{Std.} \\[1pt] \hline \hline\noalign{\smallskip} -12.7.2011 - & Demonstration von ``educational math assistant \isac{}'', Isabelle & 1.6\\ - %& Demonstration des Theorem Provers & 0.6\\ - & Einf\"uhrung Linux, objektorientierte/funktionale Programmierung& 2.0\\ - & Installation: Isabelle, \isac-core, Mercurial & 3.0\\[3pt] \hline\noalign{\smallskip} -13.7.2011 - & Einf\"uhrung Latex, Konfiguration von Mercurial & 2.6 \\ - %& & 1.6 \\ - & ML-Programmierung/Einf\"uhrung & 5.0 \\[3pt] \hline\noalign{\smallskip} -14.7.2011 - & Einf\"uhrung und \"Ubung ML II & 4.6 \\ -% & Programmierung ML & 2.0 \\ - & Erstellung v. Beispielen f\"ur Kombinatoren in ML & 3.0 \\[3pt] \hline\noalign{\smallskip} -15.7.2011 - & Einf\"uhrung ML/\isac\ IV & 2.1 \\ - & ML- Programmierung & 5.5 \\ \hline \hline\noalign{\smallskip} -18.7.2011 - & Fehlersuche/Debugging Isac-Tests & 7.6 \\[3pt] \hline\noalign{\smallskip} -19.7.2011 - & Tests zu korrigiertem CompleteCalc auskommentiert & 7.6 \\ - & interface.sml calchead.sml ctree.sml mathengine.sml rewtools.sml & \\[3pt] \hline\noalign{\smallskip} -20.7.2011 - & Fehlersuche/Debugging Isac-Tests & 7.6 \\[3pt] \hline\noalign{\smallskip} -21.7.2011 - & Alle Fehler in Frontend/interface.sml behoben & 7.6 \\ - & Beginn zugeh\"orige Tests auskommentieren & 7.6 \\[3pt] \hline\noalign{\smallskip} -22.7.2011 - & Information \"uber Studienrichtungen etc. & 1.1 \\ - & Fehlersuche/Debugging Isac-Tests & 6.5 \\[3pt] \hline \hline\noalign{\smallskip} -25.7.2011 - & Fehlersuche/Debugging Isac-Tests & 7.6 \\[3pt] \hline\noalign{\smallskip} -26.7.2011 - & Beginn: systematisches Aufr\"aumen von auskommentierten Tests & 7.6 \\ - & Interpret/appl.sml Interpret/ctree.sml ProgLang/calculate.sml & \\[3pt] \hline\noalign{\smallskip} -27.7.2011 - & Fehlersuche/Debugging Isac-Tests & 7.6 \\[3pt] \hline\noalign{\smallskip} -28.7.2011 - & Fehlersuche/Debugging Isac-Tests & 3.6 \\ - & Fertigstellung Protokoll & 4.0 \\[3pt] \hline\noalign{\smallskip} -29.7.2011 - & Austausch mit Ferialpraktikanten anderer Studienrichtungen & 1.0 \\ - & Arbeit mit Robotern & 5.0 \\[3pt] \hline\noalign{\smallskip} -\end{tabular} -\end{center} -Die Arbeiten am Update der Tests sind in das Repository des \isac-Projektes hochgeladen worden und sind auf {\tt https://intra.ist.tugraz.at/hg/isa/} einzusehen. - - -\newpage -\section{R\"uckblick auf das Praktikum} -Meine Erwartungen haben sich gr\"o\3tenteils alle erf\"ullt und ich habe viel Neues dazugelernt: -\begin{itemize} - \item Grundlagen funktionaler Programmierung (SML) - \item Zusammenarbeit an einem gro\3sem Softwareprojekt mit mehreren Programmierern (Benutzung von Versionsverwaltungssystemen (Mercurial) , Kommentaren etc.) - \item Grundz\"uge der Funktionsweise eines Theorem Provers (Isabelle) - \item ``Test driven development'' - Verifizierung von Softwarekomponenten - \item schnelle Einarbeitung in neue komplexe Arbeitsumgebungen und Problemstellungen -\end{itemize} -Alles in allem hat sich dieses Praktikum f\"ur mich in jeder Hinsicht gelohnt. - - - -\end{document} - -\message{ !name(ferialprakt.tex) !offset(-78) } diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/chuber/Functions.thy --- a/src/Doc/isac/chuber/Functions.thy Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -theory Functions imports Main begin - -fun fib :: "nat \ nat" -where -"fib 0 = 1" -| "fib (Suc 0) = 1" -| "fib (Suc (Suc n)) = fib n + fib (Suc n)" - -thm fib.simps - -(*"fib (Suc (Suc n))"*) - -lemma "fib 0 = 1" -by simp -lemma "fib (Suc 0) = 1" -by simp -lemma "fib (Suc (Suc (Suc 0))) = (Suc (Suc (Suc 0)))" -by simp - -(*fun sep :: "’a \ ’a list \ ’a list" -where -"sep a (x#y#xs) = x # a # sep a (y # xs)" -| "sep a xs -= xs"*) - - -end diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/chuber/bakk_thesis_prelim.tex --- a/src/Doc/isac/chuber/bakk_thesis_prelim.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -\documentclass[12pt]{article} -\usepackage{a4} -\usepackage{times} -\usepackage{latexsym} -\bibliographystyle{alpha} -%\bibliographystyle{abbrv} -\usepackage{graphicx} - -\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} -\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} - -\title{Tentative Title:\\ - Theory of Functional Programming\\ - Introduced by Isabelle and \isac} -\author{n.n\\ -{\tt TODO@xxx.at}} - -\begin{document} -\maketitle -%\abstract{ -%TODO -%} - -\section{Background} - -``Functional programing'' (FP) is one of the leading paradigms in programming besides ``object oriented programming'' %\cite{?} -and ``logic (or constraint) programming'' \cite{?}. One advantage of FP are general and elegant approaches to the mathematical theory of programming \cite{?}. - -Presently FP gains importance in face of the ``multi-core crisis'' \cite{?}: functional programs are ready to exploit many cores in parallel. In spite of this fact, at Graz University of Technology (TUG) FP has vanished during recent years, and it is of actual importance to include FP again in education. - -In order to support such education this thesis will compile a course based on advanced tools developed in the intersection between computer science and mathematics: The computer theorem prover Isabelle \cite{Nipkow-Paulson-Wenzel:2002} and the educational math assistant \sisac. - -\section{Goal} - -The goal of this thesis is generation of interactive course material on FP and respective theory of programming, implemented in Isabelle and \sisac. - -The material shall use most recent developments, for instance the ``function package'' \cite{krauss:funs,krauss:termination07,krauss:partial06} recently implemented in Isabelle. This package supports all what is needed for programming and proving properties of programs. - -Although addressing most recent developments and theory at the state of the art, the material also shall serve in early phases of programming. Experience shows, that in early phases (in analogy to doing mathematics \cite{?}) proceeding step by step in a program is important for learning. This will be done by implementing selected programs into \sisac. - -The interactive course material shall serve in certain courses at TUG and in the recently established ``entry and orientation phase'' (Studien-Eingangs und -Orientierungs Phase, STEOP). - -\section{State of the Art} -The thesis cover a wide range of topics some of which will be presented in more detail to be agreed on. - -\paragraph{Theory of functional programming ?} -TODO - -\paragraph{Proof tools for FP} -Isabelle's function package \cite{krauss:funs} is the most advanced in comparison to other provers. It supports two different way of function definitions, one providing full automation (applicable in simple cases) and another featuring interactive proofs of termination. - -The function package covers the full range of FP: mutual, nested and higher-order recursion, partiality - -The other European computer theorem prover, Coq \cite{}, has less powerful support for FP (TODO) - -\paragraph{Didactics of FP} is concern of very different opinions: At some universities FP is addressed in introductory courses, while at other universities FP is considered an abstract topic addressed in higher semesters. The choice between these extreme alternatives seems to be related to principcal considerations on software construction \cite{aichernig:ingenieur}. - -The planned course might provide a bridge between the alternatives, addressing novices as well as advanced students by employing computer theorem provers. - -\paragraph{Educational math assistants,} if based on computer theorem proving, are appropriate to serve introduction to FP in a specific way: If considering evaluation of functional programs as rewriting, there is an obstacle. Empirical data show that students do not learn to apply rules at high-school --- for instance, the cannot apply the law of distributivity in algebra consciously, they do algebra in the same way they they use their mother language. - -The experimental system \sisac{}\footnote{http://www.ist.tugraz.at/projects/isac/} developed at TU Graz seems appropriate to provide experience in rigorous application of rewrite rules as a prerequisite to understand evaluation in FP. - - -\section{Thesis Structure} - -The main result of this thesis is the interactive course material, accompanied by a thesis. - -\paragraph{The interactive course material} will be implemented as Isabelle theories. Isabelle provides a document preparation system for theories which shall lead for a twofold presentation of the course: as (a) pdf-file(s) and as theories supporting interactive learning. - -For stepwise exercises in \sisac{} an additional Isabelle theory is required, which contains the specifications and programs for the respective exercises in ML-sections. - -\paragraph{The thesis} completes the work as required for a bakkalaureate. - -%general survey on FP -% -%description of the state of the art in proof tools specialized on FP -% -%didactic consideration about the course (what has been omitted, ...) -% -%future work, probably extending the course to more advanced topics -% -%future work, extending the course to more elementary topics, probably usable at high school -% -%... -% -%... - - -\section{Timeline} - -The main work shall be done during this summer as much as possible. - -%Milestones -%\subsection{TODO} -%study introductory material for Isabelle; contact Alexander Kraus and others for similar course material -% -%\subsection{TODO} -%\sisac =''= - -\bibliography{references} -\end{document} diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/chuber/references.bib --- a/src/Doc/isac/chuber/references.bib Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ - -@InCollection{krauss:partial06, - author = {Alexander Krauss}, - title = {Partial recursive functions in higher-order logic}, - booktitle = {Automated Reasoning (IJCAR 2006)}, - pages = {589-603}, - publisher = {Springer Verlag}, - year = {2006}, - editor = {Ulrich Furbach and Natarajan Shankar}, - volume = {4130}, - series = {Lecture Notes in Artificial Intelligence}, - doi = {http://dx.doi.org/10.1007/11814771_48} -} - -@InCollection{krauss:termination07, - author = {Lukas Bulwahn, Alexander Krauss, and Tobias Nipkow}, - title = {Finding lexicographic orders for termination proofs in Isabelle/HOL}, - booktitle = {Theorem Proving in Higher Order Logics (TPHOLs 2007)}, - pages = {38-53}, - publisher = {Springer Verlag}, - year = {2007}, - editor = {Schneider and J. Brandt}, - volume = {4732}, - series = {Lecture Notes in Computer Science}, - doi = {http://dx.doi.org/10.1007/978-3-540-74591-4_5} -} - -@Article{aichernig:ingenieur, - author = {Bernhard K. Aichernig and Peter Lucas}, - title = {Softwareentwicklung --- eine {I}ngenieursdisziplin!(?)}, - journal = {Telematik, Zeitschrift des Telematik-Ingenieur-Verbandes (TIV)}, - year = {1998}, - volume = {4}, - number = {2}, - pages = {2-8}, - note = {http://www.ist.tu-graz.ac.at/publications}, - annote = {} -} - -@Book{Nipkow-Paulson-Wenzel:2002, - author = {Tobias Nipkow and Lawrence C. Paulson and Markus Wenzel}, - title = {{Isabelle/HOL} --- A Proof Assistant for Higher-Order Logic}, - publisher = {Springer}, - series = {LNCS}, - volume = 2283, - year = 2002 -} -@PhdThesis{krauss:funs, - author = {Alexander Krauss}, - title = {Automating Recursive Definitions and Termination Proofs in Higher-Order Logic}, - school = {Technische Universit\"at M\"unchen}, - year = {2009}, - OPTnote = {http://www4.in.tum.de/~krauss/diss/} -} - diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/dmeindl/Hauptdatei.tex --- a/src/Doc/isac/dmeindl/Hauptdatei.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,168 +0,0 @@ -\documentclass[12pt,a4paper]{article} -\usepackage{a4} -\usepackage[naustrian]{babel} -\usepackage[latin1]{inputenc} -\usepackage{calc} -\usepackage{amsmath} -\usepackage{epsfig} -\usepackage{graphicx} -\usepackage{xcolor} -\usepackage{amsfonts} - - -% Seitenrder einstellen und Hhe der Seitenzahlen -\usepackage{geometry} -\geometry{a4paper, left=2.5cm, right=2cm, top=3cm, bottom=2.8cm} -\setlength{\footskip}{2cm} - - -\newcommand{\R}{\mathbb R} -%\newcommand{\N}{\mathbb N} -%\newcommand{\Q}{\mathbb Q} -%\newcommand{\C}{\mathbb C} - -%Zhler definieren und Starwert setzen: -\newcounter{ctr} -\setcounter{ctr}{0} - -\newcounter{Teubner} -\newcounter{Klingenberg} -\newcounter{T} -\newcounter{Vo} -\newcounter{Se} -\newcounter{E} -\newcounter{Bwl} -\newcounter{Int} -\newcounter{Prim} -\newcounter{Z} -\setcounter{Z}{0} -\setcounter{Teubner}{1} -\setcounter{Klingenberg}{2} -\setcounter{T}{1} -\setcounter{Vo}{7} -\setcounter{Se}{2} -\setcounter{E}{3} -\setcounter{Bwl}{4} -\setcounter{Int}{5} -\setcounter{Prim}{6} - -%BSP -\newenvironment{myBsp}{ - \begin{list}{\textbf{\textsc{Bsp:}}}{ - \setlength{\labelwidth}{8Pc} - \setlength{\labelsep}{0.5Pc} - \setlength{\rightmargin}{0Pc} - \setlength{\leftmargin}{2Pc} - \setlength{\parsep}{0ex plus 0.5ex} - \setlength{\listparindent}{1em} - \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex} - \setlength{\topsep}{0.5Pc} - }} - {\end{list} -} - - -%Lemma -\newenvironment{myLemma}{ - \begin{list}{\textsc{\textbf{Lemma:\ \ \ }}}{ - \setlength{\labelsep}{-0.5Pc} - \setlength{\leftmargin}{1Pc} - \setlength{\parsep}{0ex plus 0.5ex} - \setlength{\listparindent}{1em} - \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex} - \setlength{\topsep}{0.5Pc} - }} - {\end{list} -} -%Korollar -\newenvironment{myKorollar}{ - \begin{list}{\textsc{\textbf{Korollar: }}}{ - \setlength{\labelwidth}{8Pc} - \setlength{\labelsep}{0.5Pc} - \setlength{\rightmargin}{0Pc} - \setlength{\leftmargin}{4Pc} - \setlength{\parsep}{0ex plus 0.5ex} - \setlength{\listparindent}{1em} - \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex} - \setlength{\topsep}{0.5Pc} - }} - {\end{list} -} - -%Theorem -\newenvironment{myTheorem}{ - \begin{list}{\textsc{\textbf{Theorem: }}}{ - \setlength{\labelwidth}{8Pc} - \setlength{\labelsep}{0.5Pc} - \setlength{\rightmargin}{0Pc} - \setlength{\leftmargin}{5Pc} - \setlength{\parsep}{0ex plus 0.5ex} - \setlength{\listparindent}{1em} - \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex} - \setlength{\topsep}{0.5Pc} - }} - {\end{list} -} - - -%Proportion -\newenvironment{myProp}{ - \begin{list}{\textsc{\textbf{Proportion: }}}{ - \setlength{\labelwidth}{8Pc} - \setlength{\labelsep}{0.5Pc} - \setlength{\rightmargin}{0Pc} - \setlength{\leftmargin}{4Pc} - \setlength{\parsep}{0ex plus 0.5ex} - \setlength{\listparindent}{1em} - \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex} - \setlength{\topsep}{0.5Pc} - }} - {\end{list} -} - -%Farben - -\newcommand{\red}[1]{\textcolor[rgb]{0.7,0,0}{\bf #1}} -\newcommand{\rd}[1]{\color{red}{#1}} -\newcommand{\white}[1]{\textcolor[rgb]{1,0,0}{\bf #1}} -\newcommand{\w}[1]{\color{white}{#1}} -\newcommand{\g}[1]{\color{myColor}{#1}} - -\usepackage{color} -\definecolor{myColor}{rgb}{0.9,0.9,0.9}% Wir definieren im RGB-Farbraum - - -\newcommand{\myDef}[1]{\parbox{\columnwidth}{\addtocounter{ctr}{1}{\w .}\\[-0.2cm]\textbf{Definition\ \Nummer:}\\#1}} -\newcommand{\mySatz}[2]{\colorbox{myColor}{\parbox{\columnwidth}{\addtocounter{ctr}{1}{\g .}\\[-0.2cm]\textbf{Satz\ \Nummer:}\ #1\\ #2}}} -\newcommand{\myBeweis}[1]{\textit{\textbf{Beweis:}\\ #1}} -\newcommand{\myAlg}[2]{\parbox{\columnwidth}{\addtocounter{ctr}{1}\textbf{Algorithmus\ \Nummer:}\ \ #1\\#2}} -\newcommand{\myProg}[1]{\fbox{\parbox{\columnwidth}{#1}}} - -\newcommand{\add}[1]{\addtocounter{#1}{1}} -\newcommand{\zahl}[1]{\setcounter{#1}{Z}} -\newcommand{\Q}[2]{\parbox{\columnwidth}{$^{[\arabic{#1}/#2]}$ }} - -\newcommand{\Nummer}{\thesection.\arabic{ctr}} - -%------------------------------------------------------------- Beginn ----------------------------------------------------------------------- - -\title{Greates common divisor \\ for multivariable Polynomials} -\author{By\\Diana Meindl\\meindl$_-$diana@yahoo.com} -\date{} - -\begin{document} -\maketitle -{\w .}\\[12cm] -\begin{center} -Presented to \\ -A.Univ.Prof. Dipl.-Ing. Dr. Wolfgang Schreiner (RISC Insitute)\\ -and\\ -Dr. techn. Walther Neuper (Institut fr Softwaretechnologie, TU Graz) -\end{center} -\newpage -%\tableofcontents -\newpage -\input{proposal} -\newpage - -\end{document} \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/dmeindl/proposal.tex --- a/src/Doc/isac/dmeindl/proposal.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,504 +0,0 @@ -%WN mit diesen 3 Zeichen beginnen meine Kommentare -%WN111107: bitte spellchecker dr"uberlaufen lassen !!! - -\documentclass[12pt,a4paper]{article} -\bibliographystyle{alpha} -\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} -\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} -%\usepackage{a4} -%\usepackage[naustrian]{babel} -%\usepackage[latin1]{inputenc} -%\usepackage{calc} -%\usepackage{amsmath} -%\usepackage{epsfig} -%\usepackage{graphicx} -%\usepackage{xcolor} -%\usepackage{amsfonts} -% -%WN BITTE DIESE DEFINITIONEN WEGLASSEN ... -%% Seitenrder einstellen und Hhe der Seitenzahlen -%\usepackage{geometry} -%\geometry{a4paper, left=2.5cm, right=2cm, top=3cm, bottom=2.8cm} -%\setlength{\footskip}{2cm} -% -% -%%Zhler definieren und Starwert setzen: -%\newcommand{\R}{\mathbb R} -%%\newcommand{\N}{\mathbb N} -%%\newcommand{\Q}{\mathbb Q} -%%\newcommand{\C}{\mathbb C} -% -% -%\newcounter{ctr} -%\setcounter{ctr}{0} -% -%\newcounter{Teubner} -%\newcounter{Klingenberg} -%\newcounter{T} -%\newcounter{Vo} -%\newcounter{Se} -%\newcounter{E} -%\newcounter{Bwl} -%\newcounter{Int} -%\newcounter{Prim} -%\newcounter{Z} -%\setcounter{Z}{0} -%\setcounter{Teubner}{1} -%\setcounter{Klingenberg}{2} -%\setcounter{T}{1} -%\setcounter{Vo}{7} -%\setcounter{Se}{2} -%\setcounter{E}{3} -%\setcounter{Bwl}{4} -%\setcounter{Int}{5} -%\setcounter{Prim}{6} -%%BSP -%\newenvironment{myBsp}{ -% \begin{list}{\textbf{\textsc{Bsp:}}}{ -% \setlength{\labelwidth}{8Pc} -% \setlength{\labelsep}{0.5Pc} -% \setlength{\rightmargin}{0Pc} -% \setlength{\leftmargin}{2Pc} -% \setlength{\parsep}{0ex plus 0.5ex} -% \setlength{\listparindent}{1em} -% \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex} -% \setlength{\topsep}{0.5Pc} -% }} -% {\end{list} -%} -% -% -%%Lemma -%\newenvironment{myLemma}{ -% \begin{list}{\textsc{\textbf{Lemma:\ \ \ }}}{ -% \setlength{\labelsep}{-0.5Pc} -% \setlength{\leftmargin}{1Pc} -% \setlength{\parsep}{0ex plus 0.5ex} -% \setlength{\listparindent}{1em} -% \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex} -% \setlength{\topsep}{0.5Pc} -% }} -% {\end{list} -%} -%%Korollar -%\newenvironment{myKorollar}{ -% \begin{list}{\textsc{\textbf{Korollar: }}}{ -% \setlength{\labelwidth}{8Pc} -% \setlength{\labelsep}{0.5Pc} -% \setlength{\rightmargin}{0Pc} -% \setlength{\leftmargin}{4Pc} -% \setlength{\parsep}{0ex plus 0.5ex} -% \setlength{\listparindent}{1em} -% \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex} -% \setlength{\topsep}{0.5Pc} -% }} -% {\end{list} -%} -% -%%Theorem -%\newenvironment{myTheorem}{ -% \begin{list}{\textsc{\textbf{Theorem: }}}{ -% \setlength{\labelwidth}{8Pc} -% \setlength{\labelsep}{0.5Pc} -% \setlength{\rightmargin}{0Pc} -% \setlength{\leftmargin}{5Pc} -% \setlength{\parsep}{0ex plus 0.5ex} -% \setlength{\listparindent}{1em} -% \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex} -% \setlength{\topsep}{0.5Pc} -% }} -% {\end{list} -%} -% -% -%%Proportion -%\newenvironment{myProp}{ -% \begin{list}{\textsc{\textbf{Proportion: }}}{ -% \setlength{\labelwidth}{8Pc} -% \setlength{\labelsep}{0.5Pc} -% \setlength{\rightmargin}{0Pc} -% \setlength{\leftmargin}{4Pc} -% \setlength{\parsep}{0ex plus 0.5ex} -% \setlength{\listparindent}{1em} -% \setlength{\itemsep}{1ex plus 0.5ex minus 0.2ex} -% \setlength{\topsep}{0.5Pc} -% }} -% {\end{list} -%} -% -%%Farben -% -%\newcommand{\red}[1]{\textcolor[rgb]{0.7,0,0}{\bf #1}} -%\newcommand{\rd}[1]{\color{red}{#1}} -%\newcommand{\white}[1]{\textcolor[rgb]{1,0,0}{\bf #1}} -%\newcommand{\w}[1]{\color{white}{#1}} -%\newcommand{\g}[1]{\color{myColor}{#1}} -% -%\usepackage{color} -%\definecolor{myColor}{rgb}{0.9,0.9,0.9}% Wir definieren im RGB-Farbraum -% -% -%\newcommand{\myDef}[1]{\parbox{\columnwidth}{\addtocounter{ctr}{1}{\w .}\\[-0.2cm]\textbf{Definition\ \Nummer:}\\#1}} -%\newcommand{\mySatz}[2]{\colorbox{myColor}{\parbox{\columnwidth}{\addtocounter{ctr}{1}{\g .}\\[-0.2cm]\textbf{Satz\ \Nummer:}\ #1\\ #2}}} -%\newcommand{\myBeweis}[1]{\textit{\textbf{Beweis:}\\ #1}} -%\newcommand{\myAlg}[2]{\parbox{\columnwidth}{\addtocounter{ctr}{1}\textbf{Algorithmus\ \Nummer:}\ \ #1\\#2}} -%\newcommand{\myProg}[1]{\fbox{\parbox{\columnwidth}{#1}}} -% -%\newcommand{\add}[1]{\addtocounter{#1}{1}} -%\newcommand{\zahl}[1]{\setcounter{#1}{Z}} -%\newcommand{\Q}[2]{\parbox{\columnwidth}{$^{[\arabic{#1}/#2]}$ }} -% -%\newcommand{\Nummer}{\thesection.\arabic{ctr}} -% -%---------- --------------------------------------------------- Beginn ----------------------------------------------------------------------- - -\title{Greatest Common Divisor \\ for Multivariate Polynomials} -\author{Diana Meindl\\meindl\_diana@yahoo.com} -\date{\today} - -\begin{document} -\maketitle -%{\w .}\\[12cm] -%\begin{center} -%Presented to \\ -%A.Univ.Prof. Dipl.-Ing. Dr. Wolfgang Schreiner (RISC Insitute)\\ -%and\\ -%Dr. techn. Walther Neuper (Institut fr Softwaretechnologie, TU Graz) -%\end{center} -%\newpage -%{\w .}\hspace{6.5cm}\textbf{Abstact}\\[0.5cm] - -\abstract{ -This is a proposal for a Masters Thesis at RISC, the Research Institute for Symbolic Computation at Linz University.\\ - -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. - -This proposal claims for novelty with respect to the context of implementation, an implementation as a CAS-feature 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. Thus the proposed implementation of GCD and cancellation follows an actual demand. - -If the implementation is successful, it is planned to be included into the distribution of Isabelle, one of the two dominating CTPs in Europe. As part of the Isabelle distribution it will also serve the {\sisac} project aiming at an educational math assistant under development at RISC Linz and Graz University of Technology. -} - -\newpage -%WN vorerst zu Zwecken der "Ubersicht lassen ... -\tableofcontents - -\section{Background} -The \sisac-project is a research and development project launched at the Institute for Software Technology of the Graz University of Technology (TUG) and now continued at the Research Institute for Symbolic Computation (RISC) of University of Linz and at the Institute for Information Systems and Computer Media (IICM) of TUG. The resulting \sisac{} prototype is a ``transparent single-stepping system for applied mathematics'' based on the computer theorem prover Isabelle. The prototype has been proven useful in field tests at Austrain schools \cite{imst-htl06-SH,imst-htl07-SH,imst-hpts08-SH} and is now extended for wider use. - -Authoring knowledge in \sisac{} provides a strict separation of concerns between authoring math knowledge and authoring dialogues. The latter is pursued at IICM, the former is concern of this thesis. Math authoring is done by use of a CTP-based programming language \cite{plmms10} or by use of SML \cite{pl:milner97} as the meta language and implementation language of Isabelle. Since the code resulting from this thesis shall serve Isabelle, it will be written in SML. Via Isabelle distribution this thesis shall also serve \sisac; a re-implementation in \sisac's CTP-based language is planned as a subsequent project -- this will make cancellation transparent for singe-stepping. - -%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). -%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. -%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. - -TODO.WN111107 bitte googeln und je einen Absatz kopieren + zitieren woher (PLAGIATsgefahr):\\ -European provers: Isabelle \cite{Nipkow-Paulson-Wenzel:2002}, Coq \cite{Huet_all:94}\\ -American provers: PVS~\cite{pvs}, ACL2~\footnote{http://userweb.cs.utexas.edu/~moore/acl2/}\\ - -\section{Goal of the thesis} -\subsection{Current situation} -At the presetn time there is no implimentation for the problem of canceling fractions in Isabelle, and a deficient one in \sisac. But because canceling is important for calculating with fractions a new implimentation is necessary. - -\subsection{Problem} -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, where it will be used by \sisac{} as well. - -%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) ... -\bigskip -A 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 describes the problem as follows: -\begin{verbatim} -Eine erste Idee, wie die Integration der Diplomarbeit f"ur -einen Benutzer von Isabelle aussehen k"onnte, w"are zum -Beispiel im - - lemma cancel: - assumes asm3: "x2 - x*y \ 0" and asm4: "x \ 0" - shows "(x2 - y2) / (x2 - x*y) = (x + y) / (x::real)" - apply (insert asm3 asm4) - apply simp - sorry - -die Assumptions - - asm1: "(x2 - y2) = (x + y) * (x - y)" and asm2: "x2 - x*y = x * (x - y)" - -im Hintergrund automatisch zu erzeugen (mit der Garantie, -dass "(x - y)" der GCD ist) und sie dem Simplifier (f"ur die -Rule nonzero_mult_divide_mult_cancel_right) zur Verf"ugung zu -stellen, sodass anstelle von "sorry" einfach "done" stehen kann. -Und weiters w"are eventuell asm3 zu "x - y \ 0" zu vereinfachen, -eine Rewriteorder zum Herstellen einer Normalform festzulegen, etc. -\end{verbatim} -%WN und eine bessere Motivation f"ur eine Master Thesis kann ich mir auch nicht vorstellen ... -Response of Prof. Nipkow: - -\begin{verbatim} -Unser Spezialist fuer die mathematischen Theorien ist Johannes H"olzl. -Etwas allgemeinere Fragen sollten auf jeden Fall an isabelle-dev@ -gestellt werden. - -Viel Erfolg bei der Arbeit! -Tobias Nipkow -\end{verbatim} - - -\subsection{Expected results} -Implementation of algorithms for the different problems, and find out which one will be the best for the specific requirements in Isabelle.\\ -The program should accomplish: -\begin{itemize} -\item Real and rational coefficients. Maybe also imaginary coefficients. -\item Canceling and adding multivariate polynomials, when they are in normal form. -\end{itemize} -The program will be written in the functional programming language SML with appropriate comments. The resulting code shall meet the coding standards of Isabelle \cite{isar-impl} p.3-10. The integration of the code into the Isabelle distribution will be done by the Isabelle developer team. - -\section{State of the art} -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. - -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. - -\subsection{Computer Algebra and Proof Assistants} -%WN achtung: diese subsection is fast w"ortlich kopiert aus \cite{plmms10} -- also in der Endfassung bitte "uberarbeiten !!! -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.) - -First, many CTPs already have CAS-like functionality, -especially for domains like arithmetic. They provide the user -with conversions, tactics or decision procedures that solve -problems in a particular domain. Such decision procedures present -in the standard library of HOL Light~\footnote{http://www.cl.cam.ac.uk/~jrh13/hol-light/} are used inside the -prototype described in Sect.\ref{cas-funct} on p.\pageref{part-cond} for arithmetic's, -symbolic differentiation and others. - -Similarly some CAS systems provide environments that allow -logical reasoning and proving properties within the system. Such -environments are provided either as logical -extensions (e.g.~\cite{logicalaxiom}) or are implemented within a -CAS using its language~\cite{theorema00}. - -There are numerous architectures for information exchange between -CAS and CTP with different levels of \emph{degree of trust} -between the prover and the CAS. In principle, there are several approaches. -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: -\begin{enumerate} -\item Just adopt the CAS result without any check. Isabelle internally marks such results. -\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. -\item Generate a derivation of the result within CTP; in Isabelle this is called ``proof reconstruction''. -\end{enumerate} -A longer list of frameworks for -information exchange and bridges between systems can be found -in~\cite{casproto}. - -There are many approaches to defining partial functions in proof -assistants. Since we would like the user to define functions -without being exposed to the underlying logic of the proof -assistant we only mention some automated mechanisms for defining -partial functions in the logic of a CTP. -Krauss~\cite{krauss} has developed a framework for defining -partial recursive functions in Isabelle/HOL, which formally -proves termination by searching for lexicographic combinations of -size measures. Farmer~\cite{farmer} implements a scheme for -defining partial recursive functions in \textrm{IMPS}. - -\subsection{Motivation for CAS-functionality in CTP} -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}. - -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}. - -Harrison also says that ``CAS are ill-defined'' and gives, among others, an example relevant for this thesis on cancellation: TODO.WN111104 search for ... meromorphic functions in http://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-428.ps.gz - -\medskip -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. - -\subsection{Simplification within CTP} -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. -%WN: bitte mit Anfragen an die Mailing-Listen nachpr"ufen: Coq, HOL, ACL2, PVS - -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}. - -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. - -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 -{%\footnotesize --- HILFT NICHTS -\begin{verbatim} -Hi everyone, - -in the following snippet, applying the simplifier causes an error: - ------------------------------------------- -theory Scratch - imports Complex_Main -begin - -lemma - shows "(3 / 2) * ln n = ((6 * k * ln n) / n) * ((1 / 2 * n / k) / 2)" -apply simp ------------------------------------------- - -outputs - ------------------------------------------- -Proof failed. -(if n = 0 then 0 else 6 * (k * ln n) / 1) * 2 / (4 * k) = -2 * (Numeral1 * (if n = 0 then 0 else 6 * (k * ln n) / 1)) / (2 * (2 * k)) - 1. n \not= Numeral0 \rightarrow k * (ln n * (2 * 6)) / (k * 4) = k * (ln n * 12) / (k * 4) -1 unsolved goal(s)! -The error(s) above occurred for the goal statement: -(if n = 0 then 0 else 6 * (k * ln n) / 1) * 2 / (4 * k) = -2 * (Numeral1 * (if n = 0 then 0 else 6 * (k * ln n) / 1)) / (2 * (2 * k)) ------------------------------------------- -\end{verbatim} -} -Mail ``Re: simproc divide\_cancel\_factor produces error'' on Fri, 16 Sep 2011 22:33:36 +0200 -\begin{verbatim} -> > After the release, I'll have to think about doing a complete overhaul -> > of all of the cancellation simprocs. -You are very welcome to do so. Before you start, call on me and I will -write down some ideas I had long ago (other may want to join, too). -\end{verbatim} -%WN: bist du schon angemeldet in den Mailing-Listen isabelle-users@ und isabelle-dev@ ? WENN NICHT, DANN WIRD ES H"OCHSTE ZEIT !!! - -\subsection{Open Issues with CAS-functionality in CTP}\label{cas-funct} -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) !!! -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{}. - -\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}. -\cite{cezary-phd} gives an introductory example (floated to p.\pageref{fig:casproto}) which will be referred to in the sequel. -\input{thol.tex} -%WN das nachfolgende Format-Problem l"osen wir sp"ater ... -\begin{figure}[hbt] -\begin{center} -\begin{holnb} - In1 := vector [\&2; \&2] - vector [\&1; \&0] + vec 1 - Out1 := vector [\&2; \&3] - In2 := diff (diff (\Lam{}x. \&3 * sin (\&2 * x) + - \&7 + exp (exp x))) - Out2 := \Lam{}x. exp x pow 2 * exp (exp x) + - exp x * exp (exp x) + -- \&12 * sin (\&2 * x) - In3 := N (exp (\&1)) 10 - Out3 := #2.7182818284 + ... (exp (\&1)) 10 F - In4 := x + \&1 - x / \&1 + \&7 * (y + x) pow 2 - Out4 := \&7 * x pow 2 + \&14 * x * y + \&7 * y pow 2 + \&1 - In5 := sum (0,5) (\Lam{}x. \&x * \&x) - Out5 := \&30 - In6 := sqrt (x * x) assuming x > &1 - Out6 := x -\end{holnb} -\end{center} -\caption{\label{fig:casproto}Example interaction with the prototype - CAS-like input-response loop. For the user input given in the - \texttt{In} lines, the system produces the output in \texttt{Out} - lines together with HOL Light theorems that state the equality - between the input and the output.} -\end{figure} -In lines {\tt In6, Out6} this examples shows how to reliably simplify $\sqrt{x}$. \cite{caspartial} gives more details on handling side conditions in formalized partial functions. - -Analoguous to this example, cancellations (this thesis is concerned with) like -$$\frac{x^2-y^2}{x^2-x\cdot y}=\frac{x+y}{x}\;\;\;\;{\it assuming}\;x-y\not=0\land x\not=0$$ -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. - -\paragraph{Multi-valued functions:}\label{multi-valued} -\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 ... -%TODO.WN111104 ... zur Erkl"arung ein paar Beispiele von http://en.wikipedia.org/wiki/Multivalued_function - -\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. - -\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, -\begin{eqnarray} - \exists x_s.\;x_s\in S &\Rightarrow& f(x_s) = 0 \\\label{is-solut} - x_s\in S &\Leftarrow& \exists x_s.\;f(x_s) = 0 \label{all-solut} -\end{eqnarray} -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}. - -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. - -\subsection{Algorithms for cancellation of multivariate polynomials} -The most appropriate book for implementing the required algorithms in this thesis is \cite{Winkler:96}. TODO.WN111104 welche noch ? - -\section{Thesis structure} -The proposed table of contents of the thesis on the chapter level is as follows: -\begin{enumerate} - \item Introduction (2-3 pages) - \item Computer Algebra Systems (CAS) (5 - 7 pages)\\ - Which different CAS exists and whats the focus of them. - \item The \sisac{}-Project (5 - 7 pages)\\ - This chapter will describe the \sisac{}-Project and the goals of the project. - \item Univariate Polynomials (15-20 pages)\\ - This chapter will describe different Algorithms for univariate polynomials, with different coefficients. - \item Multivariate Polynomials (20-25 pages)\\ - This chapter will describe different Algorithms for multivariate polynomials, with different coefficients - \item Functional programming and SML(2-5 pages)\\ - The basic idea of this programming languages. - \item Implimentation in \sisac{}-Project (15-20 pages) - \item Conclusion (2-3 pages) -\end{enumerate} -%\newpage - -\section{Timeline} -%Werd nie fertig.\\ -\begin{center} - \begin{tabular}{|l|l|l|} - \hline - \textbf{Time}&\textbf{Thesis}&\textbf{Project}\\ - \hline - & Functional programming & Learning the basics and the idea\\ - & & of funcional programming\\ - \hline - & Different CAS & Can they handle the problem \\ - & &and which algorithm do they use?\\ \hline - & Univariate Polynomials & Implementation of the Algorithm\\ - & & for univariate Polynomials \\ \hline - & Multivariate Polynomials & Implementation of the Algorithm\\ - & & for multivariate Polynomials \\ \hline - & The \sisac-Project &\\ \hline - & Conclusion and Introduction & Find good examples for testing\\ - \hline - \end{tabular} - \end{center} - -%WN oben an passender stelle einf"ugen -\cite{einf-funct-progr} - - -\bibliography{bib/math-eng,bib/didact,bib/bk,bib/RISC_2,bib/isac,bib/pl,bib/math,references} -%\section{Bibliography} -%%mindestens 10 -%\begin{enumerate} -% \item Bird/Wadler, \textit{Einfhrung in die funktionale Programmierung}, Carl Hanser and Prentice-Hall International, 1992 -% \item Franz Winkler, \textit{Polynomial Algorithms in Computer Algebra}, Springer,1996 -% \item %M. Mignotte, \textit{An inequality about factors of polynomial} -% \item %M. Mignotte, \textit{Some useful bounds} -% \item %W. S. Brown and J. F. Traub. \textit{On euclid's algorithm and the theory of subresultans}, Journal of the ACM (JACM), 1971 -% \item %Bruno Buchberger, \textit{Algorhimic mathematics: Problem types, data types, algorithm types}, Lecture notes, RISC Jku A-4040 Linz, 1982 -% -% \item %Tateaki Sasaki and Masayuki Suzuki, \textit{Thre new algorithms for multivariate polynomial GCD}, J. Symbolic Combutation, 1992 -% \item -% \item -% \item -%\end{enumerate} - -\end{document} - -ALLES UNTERHALB \end{document} WIRD VON LATEX NICHT BERUECKSICHTIGT -WN110916 grep-ing through Isabelle code: - -neuper@neuper:/usr/local/isabisac/src$ find -name "*umeral*" -./HOL/ex/Numeral.thy -./HOL/Tools/nat_numeral_simprocs.ML -./HOL/Tools/numeral_syntax.ML -./HOL/Tools/numeral.ML -./HOL/Tools/numeral_simprocs.ML -./HOL/Matrix/ComputeNumeral.thy -./HOL/Library/Numeral_Type.thy -./HOL/Numeral_Simprocs.thy -./HOL/Import/HOL/numeral.imp -./HOL/Code_Numeral.thy -./HOL/Nat_Numeral.thy -./ZF/Tools/numeral_syntax.ML -./Provers/Arith/cancel_numeral_factor.ML -./Provers/Arith/cancel_numerals.ML -./Provers/Arith/combine_numerals.ML - -neuper@neuper:/usr/local/isabisac/src$ find -name "*ancel*" -./HOL/Tools/abel_cancel.ML -./Provers/Arith/cancel_div_mod.ML -./Provers/Arith/cancel_numeral_factor.ML Paulson 2000 !!! -./Provers/Arith/cancel_sums.ML -./Provers/Arith/cancel_numerals.ML Paulson 2000 diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/dmeindl/references.bib --- a/src/Doc/isac/dmeindl/references.bib Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,296 +0,0 @@ -@proceedings{DBLP:conf/mkm/2007, - editor = {Manuel Kauers and - Manfred Kerber and - Robert Miner and - Wolfgang Windsteiger}, - title = {Towards Mechanized Mathematical Assistants, 14th Symposium, - Calculemus 2007, 6th International Conference, MKM 2007, - Hagenberg, Austria, June 27-30, 2007, Proceedings}, - booktitle = {Calculemus/MKM}, - publisher = {Springer}, - series = {Lecture Notes in Computer Science}, - volume = {4573}, - year = {2007}, - isbn = {978-3-540-73083-5}, - bibsource = {DBLP, http://dblp.uni-trier.de} -} - -@proceedings{DBLP:conf/cade/2006, - editor = {Ulrich Furbach and - Natarajan Shankar}, - title = {Automated Reasoning, Third International Joint Conference, - IJCAR 2006, Seattle, WA, USA, August 17-20, 2006, Proceedings}, - booktitle = {IJCAR}, - publisher = {Springer}, - series = {Lecture Notes in Computer Science}, - volume = {4130}, - year = {2006}, - isbn = {3-540-37187-7}, - bibsource = {DBLP, http://dblp.uni-trier.de} -} - -@proceedings{DBLP:conf/iwfm/1999, - editor = {Andrew Butterfield and - Klemens Haegele}, - title = {3rd Irish Workshop on Formal Methods, Galway, Eire, July - 1999}, - booktitle = {IWFM}, - publisher = {BCS}, - series = {Workshops in Computing}, - year = {1999}, - bibsource = {DBLP, http://dblp.uni-trier.de} -} - -@proceedings{DBLP:conf/aisc/2008, - editor = {Serge Autexier and - John Campbell and - Julio Rubio and - Volker Sorge and - Masakazu Suzuki and - Freek Wiedijk}, - title = {Intelligent Computer Mathematics, 9th International Conference, - AISC 2008, 15th Symposium, Calculemus 2008, 7th International - Conference, MKM 2008, Birmingham, UK, July 28 - August 1, - 2008. Proceedings}, - booktitle = {AISC/MKM/Calculemus}, - publisher = {Springer}, - series = {Lecture Notes in Computer Science}, - volume = {5144}, - year = {2008}, - isbn = {978-3-540-85109-7}, - bibsource = {DBLP, http://dblp.uni-trier.de} -} - -@InProceedings{wn:lucas-interp-12, - author = {Neuper, Walther}, - title = {Automated Generation of User Guidance by Combining Computation and Deduction}, - booktitle = {THedu'11: CTP-compontents for educational software}, - year = {2012}, - editor = {Quaresma, Pedro}, - publisher = {EPTCS}, - note = {To appear} -} - -@InProceedings{davenp-multival-10, - author = {Davenport, James}, - title = {The Challenges of Multivalued "Functions"}, - booktitle = {Proceedings of the Conferences on Intelligent Computer Mathematics (CICM)}, - year = {2010} -} - -@PhdThesis{cezary-phd, - author = {Kalisyk, Cezary}, - title = {Correctness and Availability. Building Computer Algebra on top of Proof Assistants and making Proof Assistants available over the Web}, - school = {Radboud University Nijmegen}, - year = {2009}, - type = {IPA Dissertation Series 2009-18}, - note = {Promotor Herman Geuvers} -} - -@Book{bb-loos, - editor = {Buchberger, Bruno and Collins, George Edwin and Loos, - R\"udiger and Albrecht, Rudolf}, - title = {Computer Algebra. Symbolic and Algebraic Computation}, - publisher = {Springer Verlag}, - year = {1982}, - edition = {2} -} - -@Book{term-nets, - author = {Charniak, E. and Riesbeck, C. K. and McDermott, D. V.}, - title = {Artificial Intelligence Programming}, - publisher = {Lawrence Erlbaum Associates}, - year = {1980}, - note = {(Chapter 14)} -} - -@Book{db:dom-eng, - author = {Bj{\o}rner, Dines}, - title = {Domain Engineering. Technology Management, Research and Engineering}, - publisher = {JAIST Press}, - year = {2009}, - month = {Feb}, - series = {COE Research Monograph Series}, - volume = {4}, - address = {Nomi, Japan} -} - -@techreport{harr:thesis, - author={Harrison, John R.}, - title={Theorem proving with the real numbers}, - institution={University of Cambridge, Computer Laboratory},year={1996}, - type={Technical Report},number={408},address={},month={November}, - note={},status={},source={},location={loc?} - } - -@InProceedings{damas-milner-82, - author = {Damas, Luis and Milner, Robin}, - title = {Principal type-schemes for functional programs}, - booktitle = {9th Symposium on Principles of programming languages (POPL'82)}, - pages = {207-212}, - year = {1982}, - editor = {ACM} -} - -@Article{Milner-78, - author = {Milner, R.}, - title = {A Theory of Type Polymorphism in Programming}, - journal = {Journal of Computer and System Science (JCSS)}, - year = {1978}, - number = {17}, - pages = {348-374} -} - -@Article{Hindley-69, - author = {Hindley, R.}, - title = {The Principal Type-Scheme of an Object in Combinatory Logic}, - journal = {Transactions of the American Mathematical Society}, - year = {1969}, - volume = {146}, - pages = {29-60} -} - -@article{seeingroots, - author = {Jeffrey, D.J. and Norman, A.C.}, - title = {Not seeing the roots for the branches: multivalued functions in computer algebra}, - journal = {SIGSAM Bull.}, - volume = {38}, - number = {3}, - year = {2004}, - issn = {0163-5824}, - pages = {57--66}, - doi = {http://doi.acm.org/10.1145/1040034.1040036}, - publisher = {ACM}, - address = {New York, NY, USA}, - } - -@PhdThesis{russellphd, - author = {Russell O'Connor}, - title = {Incompleteness and Completeness.}, - school = {Radboud University Nijmegen}, - year = {2009}, -} - -@inproceedings{caspartial, - author = {Cezary Kaliszyk}, - title = {Automating Side Conditions in Formalized Partial Functions}, - booktitle = {AISC/MKM/Calculemus}, - year = {2008}, - pages = {300-314}, - ee = {http://dx.doi.org/10.1007/978-3-540-85110-3_26}, - crossref = {DBLP:conf/aisc/2008}, - bibsource = {DBLP, http://dblp.uni-trier.de} -} - -@inproceedings{farmer, - author = {Farmer, William M.}, - title = {A Scheme for Defining Partial Higher-Order Functions by - Recursion.}, - booktitle = {IWFM}, - year = {1999}, - crossref = {DBLP:conf/iwfm/1999}, - bibsource = {DBLP, http://dblp.uni-trier.de} -} - -@inproceedings{krauss, - author = {Krauss, Alexander}, - title = {Partial Recursive Functions in Higher-Order Logic}, - booktitle = {IJCAR}, - year = {2006}, - pages = {589-603}, - ee = {http://dx.doi.org/10.1007/11814771_48}, - crossref = {DBLP:conf/cade/2006}, - bibsource = {DBLP, http://dblp.uni-trier.de} -} - -@inproceedings{casproto, - author = {Cezary Kaliszyk and - Freek Wiedijk}, - title = {Certified Computer Algebra on Top of an Interactive Theorem - Prover}, - booktitle = {Calculemus}, - year = {2007}, - pages = {94-105}, - ee = {http://dx.doi.org/10.1007/978-3-540-73086-6_8}, - crossref = {DBLP:conf/mkm/2007}, - bibsource = {DBLP, http://dblp.uni-trier.de} -} - -@inproceedings{theorema00, - author = "Buchberger, B. and - Dupre, C. and - Jebelean, T. and - Kriftner, F. and - Nakagawa, K. and - Vasaru, D. and - Windsteiger, W.", - title = "{The Theorema Project: A Progress Report}", - booktitle = "Symbolic Computation and Automated Reasoning - (Proceedings of CALCULEMUS 2000, Symposium on the Integration of - Symbolic Computation and Mechanized Reasoning)", - editor = "Kerber, M. and - Kohlhase, M.", - publisher = "A.K.~Peters", - address = "Natick, Massachusetts", - isbn = "1-56881-145-4", - year = 2000 -} - -@inproceedings{logicalaxiom, - author = {E. Poll and S. Thompson}, - title = {{Adding the axioms to Axiom: Towards a system of automated reasoning in Aldor}}, - booktitle = {Calculemus and Types '98}, - year = {1998}, - place = {Eindhoven, The Netherlands}, - month = {July}, - note = {Also as technical report 6-98, Computing Laboratory, University of Kent} -} - -@InProceedings{pvs, - author = {Owre, S. and Rajan, S. and Rushby, J. and Shankar, N. and Srivas, M.}, - title = {{PVS}: Combining specification, proof checking, and model checking}, - booktitle = {Computer-Aided Verification}, - pages = {411-414}, - year = {1996}, - editor = {Alur, R. and Henzinger, T.A.}, - organization = {CAV'96}, - annote = {} -} - -@Book{Nipkow-Paulson-Wenzel:2002, - author = {Tobias Nipkow and Lawrence C. Paulson and Markus Wenzel}, - title = {{Isabelle/HOL} --- A Proof Assistant for Higher-Order Logic}, - publisher = {Springer}, - series = {LNCS}, - volume = 2283, - year = 2002 -} - -@Manual{Huet_all:94, - author = {Huet, G. and Kahn, G. and and Paulin-Mohring, C.}, - title = {The Coq Proof Assistant}, - institution = {INRIA-Rocquencourt}, - year = {1994}, - type = {Tutorial}, - number = {Version 5.10}, - address = {CNRS-ENS Lyon}, - status={},source={Theorema},location={-} -} - -@Book{einf-funct-progr, - author = {Richard Bird and Philip Wadler}, - title = {Introduction to Functional Programming}, - publisher = {Prentice Hall}, - year = 1988, - editor = {C. A. R. Hoare}, - series = {Prentice Hall International Series in Computer Science}, - address = {New York, London, Toronto, Sydney, Tokyo}, - annote = {88bok371} -} -@Book{Winkler:96, - author = {F. Winkler}, - title = {{Polynomial Algorithms in Computer Algebra}}, - publisher = {Springer-Verlag Wien New York}, - year = {1996} -} - diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/dmeindl/thol.tex Binary file src/Doc/isac/dmeindl/thol.tex has changed diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/fig/coqide.png Binary file src/Doc/isac/fig/coqide.png has changed diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/fig/jrocnik/isac-Ztrans-math-3.png Binary file src/Doc/isac/fig/jrocnik/isac-Ztrans-math-3.png has changed diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/fig/jrocnik/math-universe-small.png Binary file src/Doc/isac/fig/jrocnik/math-universe-small.png has changed diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/fig/jrocnik/math-universe.odg Binary file src/Doc/isac/fig/jrocnik/math-universe.odg has changed diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/fig/jrocnik/math-universe.png Binary file src/Doc/isac/fig/jrocnik/math-universe.png has changed diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/fig/pgisabelle.png Binary file src/Doc/isac/fig/pgisabelle.png has changed diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/CLEANUP --- a/src/Doc/isac/jrocnik/CLEANUP Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -rm *.dvi -rm *.bbl -rm *.blg -rm *.aux -rm *.log -rm *.nav -rm *.out -rm *.snm -rm *.toc -rm *~ diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/FFT.thy --- a/src/Doc/isac/jrocnik/FFT.thy Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,532 +0,0 @@ -(* Title: Fast Fourier Transform - Author: Clemens Ballarin , started 12 April 2005 - Maintainer: Clemens Ballarin -*) - -theory FFT -imports Complex_Main -begin - -text {* We formalise a functional implementation of the FFT algorithm - over the complex numbers, and its inverse. Both are shown - equivalent to the usual definitions - of these operations through Vandermonde matrices. They are also - shown to be inverse to each other, more precisely, that composition - of the inverse and the transformation yield the identity up to a - scalar. - - The presentation closely follows Section 30.2 of Cormen \textit{et - al.}, \emph{Introduction to Algorithms}, 2nd edition, MIT Press, - 2003. *} - - -section {* Preliminaries *} - -lemma of_nat_cplx: - "of_nat n = Complex (of_nat n) 0" - by (induct n) (simp_all add: complex_one_def) - - -text {* The following two lemmas are useful for experimenting with the - transformations, at a vector length of four. *} - -lemma Ivl4: - "{0..<4::nat} = {0, 1, 2, 3}" -proof - - have "{0..<4::nat} = {0..i=0..<4::nat. x i) = x 0 + x 1 + x 2 + x 3" - by (simp add: Ivl4 eval_nat_numeral) - - -text {* A number of specialised lemmas for the summation operator, - where the index set is the natural numbers *} - -lemma setsum_add_nat_ivl_singleton: - assumes less: "m < (n::nat)" - shows "f m + setsum f {m<.. {m<.. g i = f i" - shows "f m + setsum g {m<.. g i = f i" - and h: "!!i. [| k <= i; i < n |] ==> h i = f i" - shows "setsum g {m.. ((%i. Suc (2*i)) ` {0.. ((%i. Suc (2*i)) ` {0..i::nat = 0..<2*n. f i) = (\i = 0..i = 0..i::nat = 0..<2*n. f i) = - setsum f (op * 2 ` {0..i = 0..i = 0.. complex" where - "root n == cis (2*pi/(real (n::nat)))" - -lemma sin_periodic_pi_diff [simp]: "sin (x - pi) = - sin x" - by (simp add: sin_diff) - -lemma sin_cos_between_zero_two_pi: - assumes 0: "0 < x" and pi: "x < 2 * pi" - shows "sin x \ 0 \ cos x \ 1" -proof - - { assume "0 < x" and "x < pi" - then have "sin x \ 0" by (auto dest: sin_gt_zero_pi) } - moreover - { assume "x = pi" - then have "cos x \ 1" by simp } - moreover - { assume pi1: "pi < x" and pi2: "x < 2 * pi" - then have "0 < x - pi" and "x - pi < pi" by arith+ - then have "sin (x - pi) \ 0" by (auto dest: sin_gt_zero_pi) - with pi1 pi2 have "sin x \ 0" by simp } - ultimately show ?thesis using 0 pi by arith -qed - - -subsection {* Basic Lemmas *} - -lemma root_nonzero: - "root n ~= 0" - apply (unfold root_def) - apply (unfold cis_def) - apply auto - apply (drule sin_zero_abs_cos_one) - apply arith - done - -lemma root_unity: - "root n ^ n = 1" - apply (unfold root_def) - apply (simp add: DeMoivre) - apply (simp add: cis_def) - done - -lemma root_cancel: - "0 < d ==> root (d * n) ^ (d * k) = root n ^ k" - apply (unfold root_def) - apply (simp add: DeMoivre) - done - -lemma root_summation: - assumes k: "0 < k" "k < n" - shows "(\i=0..i=0..i=0..i=0.. root (2 * n) ^ n = - 1" - txt {* Note the space between @{text "-"} and @{text "1"}. *} - using root_cancel [where n = 2 and k = 1] - apply (simp only: mult_ac) - apply (simp add: complex_one_def) - done - - -section {* Discrete Fourier Transformation *} - -text {* - We define operations @{text DFT} and @{text IDFT} for the discrete - Fourier Transform and its inverse. Vectors are simply functions of - type @{text "nat => complex"}. *} - -text {* - @{text "DFT n a"} is the transform of vector @{text a} - of length @{text n}, @{text IDFT} its inverse. *} - -definition DFT :: "nat => (nat => complex) => (nat => complex)" where - "DFT n a == (%i. \j=0.. (nat => complex) => (nat => complex)" where - "IDFT n a == (%i. (\k=0..j = 0..<2 * m. root (2 * m) ^ (i * j) * a j) = - (\j = 0..j = 0..j = 0..j = 0..j = 0..<2 * m. root (2 * m) ^ (i * j) * a j) = - (\j = 0..j = 0..j = 0..j = 0..j = 0..<2 * m. a j / root (2 * m) ^ (i * j)) = - (\j = 0..j = 0..j = 0..j = 0..j = 0..<2 * m. a j / root (2 * m) ^ (i * j)) = - (\j = 0..j = 0..j = 0..j = 0.. (inverse a) ^ (n-m) = (a^m) / (a^n)" - apply (induct n m rule: diff_induct) - apply (simp add: nonzero_power_inverse - nonzero_inverse_eq_divide [THEN sym] nz) - apply simp - apply (simp add: nz) - done - -lemma power_diff_rev_if: - assumes nz: "(a::'a::field) ~= 0" - shows "(a^m) / (a^n) = (if n <= m then a ^ (m-n) else (1/a) ^ (n-m))" -proof (cases "n <= m") - case True with nz show ?thesis - by (simp add: power_diff) -next - case False with nz show ?thesis - by (simp add: power_diff_inverse nonzero_inverse_eq_divide [THEN sym]) -qed - -lemma power_divides_special: - "(a::'a::field) ~= 0 ==> - a ^ (i * j) / a ^ (k * i) = (a ^ j / a ^ k) ^ i" - by (simp add: nonzero_power_divide power_mult [THEN sym] mult_ac) - -theorem DFT_inverse: - assumes i_less: "i < n" - shows "IDFT n (DFT n a) i = of_nat n * a i" - using [[linarith_split_limit = 0]] - apply (unfold DFT_def IDFT_def) - apply (simp add: setsum_divide_distrib) - apply (subst setsum_commute) - apply (simp only: times_divide_eq_left [THEN sym]) - apply (simp only: power_divides_special [OF root_nonzero]) - apply (simp add: power_diff_rev_if root_nonzero) - apply (simp add: setsum_divide_distrib [THEN sym] - setsum_left_distrib [THEN sym]) - proof - - from i_less have i_diff: "!!k. i - k < n" by arith - have diff_i: "!!k. k < n ==> k - i < n" by arith - - let ?sum = "%i j n. setsum (op ^ (if i <= j then root n ^ (j - i) - else (1 / root n) ^ (i - j))) {0..j = 0..j = 0..j = i..j = i..j\{i} \ {i<..j\{i<.. (nat => complex) => (nat => complex)" where - "FFT 0 a = a" -| "FFT (Suc k) a = - (let (x, y) = (FFT k (%i. a (2*i)), FFT k (%i. a (2*i+1))) - in (%i. if i < 2^k - then x i + (root (2 ^ (Suc k))) ^ i * y i - else x (i- 2^k) - (root (2 ^ (Suc k))) ^ (i- 2^k) * y (i- 2^k)))" - -primrec IFFT :: "nat => (nat => complex) => (nat => complex)" where - "IFFT 0 a = a" -| "IFFT (Suc k) a = - (let (x, y) = (IFFT k (%i. a (2*i)), IFFT k (%i. a (2*i+1))) - in (%i. if i < 2^k - then x i + (1 / root (2 ^ (Suc k))) ^ i * y i - else x (i - 2^k) - - (1 / root (2 ^ (Suc k))) ^ (i - 2^k) * y (i - 2^k)))" - -text {* Finally, for vectors of length @{text "2 ^ k"}, - @{text DFT} and @{text FFT}, and @{text IDFT} and - @{text IFFT} are equivalent. *} - -theorem DFT_FFT: - "!!a i. i < 2 ^ k ==> DFT (2 ^ k) a i = FFT k a i" -proof (induct k) - case 0 - then show ?case by (simp add: DFT_def) -next - case (Suc k) - assume i: "i < 2 ^ Suc k" - show ?case proof (cases "i < 2 ^ k") - case True - then show ?thesis apply simp apply (simp add: DFT_lower) - apply (simp add: Suc) done - next - case False - from i have "i - 2 ^ k < 2 ^ k" by simp - with False i show ?thesis apply simp apply (simp add: DFT_upper) - apply (simp add: Suc) done - qed -qed - -theorem IDFT_IFFT: - "!!a i. i < 2 ^ k ==> IDFT (2 ^ k) a i = IFFT k a i" -proof (induct k) - case 0 - then show ?case by (simp add: IDFT_def) -next - case (Suc k) - assume i: "i < 2 ^ Suc k" - show ?case proof (cases "i < 2 ^ k") - case True - then show ?thesis apply simp apply (simp add: IDFT_lower) - apply (simp add: Suc) done - next - case False - from i have "i - 2 ^ k < 2 ^ k" by simp - with False i show ?thesis apply simp apply (simp add: IDFT_upper) - apply (simp add: Suc) done - qed -qed - -schematic_lemma "map (FFT (Suc (Suc 0)) a) [0, 1, 2, 3] = ?x" - by simp - -end diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/Makefile --- a/src/Doc/isac/jrocnik/Makefile Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -## targets - -default: thesis clean -all: thesis docu present clean -thesis: thesis clean -docu: docu clean -present: present1 present2 clean -cadgme: cadgme clean - - -## dependencies - - -## settings - -LATEX = latex -PDFLATEX = pdflatex -BIBTEX = bibtex -RAIL = rail -a -SEDINDEX = ./sedindex -FIXBOOKMARKS = perl -pi fixbookmarks.pl - -DEFAULT_GARBAGE = *.aux *.log *.toc *.idx *.rai *.rao *.bbl *.ind *.ilg *.blg *.out *.lof -DEFAULT_OUTPUT = *.dvi jrocnik_present1.pdf jrocnik_present2.pdf jrocnik_bakk.pdf *.ps -GARBAGE = -OUTPUT = - -## special targets - -.DELETE_ON_ERROR: - -## actions - -nothing: - -clean: - @rm -f $(DEFAULT_GARBAGE) $(GARBAGE) - -mrproper: - @rm -f $(DEFAULT_GARBAGE) $(DEFAULT_OUTPUT) $(GARBAGE) $(OUTPUT) - -THESIS_NAME = jrocnik_bakk -THESIS_FILES = jrocnik_bakk.tex - -DOCU_NAME = Inverse_Z_Transform/doc/Inverse_Z_Transform -DOCU_FILES = Inverse_Z_Transform/doc/root.tex - -PRESENT1_NAME = jrocnik_present1 -PRESENT1_FILES = jrocnik_present1.tex - -PRESENT2_NAME = jrocnik_present2 -PRESENT2_FILES = jrocnik_present2.tex - -CADGME_NAME = jrocnik_cadgme -CADGME_FILES = cadgme.tex - -thesis: $(THESIS_NAME).pdf - -$(THESIS_NAME).pdf: $(THESIS_FILES) - $(PDFLATEX) $(THESIS_NAME) - $(BIBTEX) $(THESIS_NAME) - $(PDFLATEX) $(THESIS_NAME) - $(PDFLATEX) $(THESIS_NAME) - -present1: $(PRESENT1_NAME).pdf - -$(PRESENT1_NAME).pdf: $(PRESENT1_FILES) - $(PDFLATEX) $(PRESENT1_NAME) - $(PDFLATEX) $(PRESENT1_NAME) - -present2: $(PRESENT2_NAME).pdf - -$(PRESENT2_NAME).pdf: $(PRESENT2_FILES) - $(PDFLATEX) $(PRESENT2_NAME) - $(PDFLATEX) $(PRESENT2_NAME) - -cadgme: $(CADGME_NAME).pdf - -$(CADGME_NAME).pdf: $(CADGME_FILES) - $(PDFLATEX) $(CADGME_NAME) - $(PDFLATEX) $(CADGME_NAME) diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/TUGlogo.pdf --- a/src/Doc/isac/jrocnik/TUGlogo.pdf Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,219 +0,0 @@ -%PDF-1.3 -% -2 0 obj -<< -/Length 2930 ->> -stream -0 0.957 0.569 0 k -/GS1 gs -0 31.119 20.745 -20.746 re -f -22.819 31.119 20.746 -20.746 re -f -q -1 i -0 41.492 112.876 -41.432 re -W n -45.641 31.119 20.744 -20.746 re -f -10.372 20.746 20.747 -20.686 re -f -Q -35.268 41.492 20.744 -20.746 re -f -0.941 0.82 0.808 0.894 k -1 i -75.104 27.791 m -68.462 27.791 l -68.462 31.11 l -85.581 31.11 l -85.581 27.791 l -78.94 27.791 l -78.94 10.417 l -75.104 10.417 l -75.104 27.791 l -f -q -0 41.492 112.876 -41.432 re -W n -104.828 18.021 m -104.828 16.774 104.604 15.649 104.156 14.646 c -103.708 13.643 103.097 12.79 102.321 12.09 c -101.546 11.387 100.631 10.848 99.57 10.469 c -98.511 10.088 97.359 9.898 96.115 9.898 c -94.873 9.898 93.722 10.088 92.661 10.469 c -91.601 10.848 90.678 11.387 89.895 12.09 c -89.109 12.79 88.497 13.643 88.061 14.646 c -87.621 15.649 87.403 16.774 87.403 18.021 c -87.403 31.11 l -91.241 31.11 l -91.241 18.153 l -91.241 17.648 91.321 17.117 91.485 16.562 c -91.648 16.008 91.919 15.497 92.298 15.029 c -92.676 14.563 93.177 14.178 93.801 13.877 c -94.423 13.576 95.194 13.425 96.115 13.425 c -97.035 13.425 97.808 13.576 98.431 13.877 c -99.054 14.178 99.556 14.563 99.934 15.029 c -100.312 15.497 100.582 16.008 100.746 16.562 c -100.909 17.117 100.991 17.648 100.991 18.153 c -100.991 31.11 l -104.828 31.11 l -104.828 18.021 l -f -83.257 7.566 m -82.496 7.895 81.511 8.052 80.723 8.052 c -78.43 8.052 77.162 6.609 77.162 4.734 c -77.162 2.873 78.401 1.471 80.497 1.471 c -81.032 1.471 81.456 1.523 81.793 1.602 c -81.793 3.987 l -79.71 3.987 l -79.71 5.43 l -83.679 5.43 l -83.679 0.5 l -82.638 0.238 81.553 0.028 80.497 0.028 c -77.316 0.028 75.106 1.51 75.106 4.604 c -75.106 7.737 77.162 9.494 80.497 9.494 c -81.638 9.494 82.538 9.35 83.383 9.113 c -83.257 7.566 l -f -85.62 6.938 m -87.296 6.938 l -87.296 5.403 l -87.324 5.403 l -87.408 6.033 88.182 7.095 89.308 7.095 c -89.491 7.095 89.689 7.095 89.885 7.042 c -89.885 5.272 l -89.717 5.363 89.379 5.416 89.04 5.416 c -87.507 5.416 87.507 3.633 87.507 2.664 c -87.507 0.186 l -85.62 0.186 l -85.62 6.938 l -f -93.587 1.312 m -94.164 1.312 94.614 1.549 94.909 1.916 c -95.219 2.296 95.304 2.781 95.304 3.306 c -94.487 3.306 l -93.644 3.306 92.391 3.175 92.391 2.139 c -92.391 1.563 92.911 1.312 93.587 1.312 c -h -91.376 6.583 m -92.107 6.898 93.094 7.095 93.896 7.095 c -96.105 7.095 97.021 6.242 97.021 4.249 c -97.021 3.384 l -97.021 2.703 97.035 2.191 97.049 1.693 c -97.063 1.182 97.091 0.71 97.134 0.186 c -95.473 0.186 l -95.402 0.539 95.402 0.985 95.389 1.195 c -95.359 1.195 l -94.924 0.448 93.979 0.028 93.122 0.028 c -91.842 0.028 90.588 0.749 90.588 2.034 c -90.588 3.043 91.108 3.633 91.827 3.961 c -92.546 4.289 93.474 4.355 94.263 4.355 c -95.304 4.355 l -95.304 5.442 94.783 5.81 93.671 5.81 c -92.869 5.81 92.066 5.522 91.434 5.076 c -91.376 6.583 l -f -98.569 6.938 m -104.312 6.938 l -104.312 5.495 l -100.707 1.549 l -104.438 1.549 l -104.438 0.186 l -98.414 0.186 l -98.414 1.615 l -102.087 5.574 l -98.569 5.574 l -98.569 6.938 l -f -0 0.957 0.569 0 k -105.965 6.911 6.911 -6.851 re -f -Q -endstream -endobj -3 0 obj -<< -/ProcSet [/PDF ] -/ExtGState << -/GS1 4 0 R ->> ->> -endobj -4 0 obj -<< -/Type /ExtGState -/SA false -/SM 0.02 -/OP false -/op false -/OPM 1 -/BG2 /Default -/UCR2 /Default -/HT /Default -/TR2 /Default ->> -endobj -1 0 obj -<< -/Type /Page -/Parent 5 0 R -/Resources 3 0 R -/Contents 2 0 R ->> -endobj -6 0 obj -<< -/S /D ->> -endobj -7 0 obj -<< -/Nums [0 6 0 R ] ->> -endobj -5 0 obj -<< -/Type /Pages -/Kids [1 0 R] -/Count 1 -/MediaBox [0 0 113 42] ->> -endobj -8 0 obj -<< -/CreationDate (D:20060111234722+13'00') -/ModDate (D:20060111234722+13'00') -/Producer (PSNormalizer.framework) ->> -endobj -9 0 obj -<< -/Type /Catalog -/Pages 5 0 R -/PageLabels 7 0 R ->> -endobj -xref -0 10 -0000000000 65535 f -0000003204 00000 n -0000000016 00000 n -0000002998 00000 n -0000003064 00000 n -0000003349 00000 n -0000003284 00000 n -0000003311 00000 n -0000003429 00000 n -0000003560 00000 n -trailer -<< -/Size 10 -/Root 9 0 R -/Info 8 0 R -/ID [<99444215e2a4a31d5c4ca09b38102d5e><99444215e2a4a31d5c4ca09b38102d5e>] ->> -startxref -3627 -%%EOF diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/Test_Complex.thy --- a/src/Doc/isac/jrocnik/Test_Complex.thy Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -theory Test_Complex imports Isac begin - -section {*terms and operations*} -ML {* - print_depth 999; @{term "Complex 1 (2::real)"}; -*} -ML {* -@{term "Complex 1 2 + Complex 3 4"}; -print_depth 999; str2term "Complex 1 2 + Complex 3 4"; print_depth 999; -*} -ML {* -@{term "Complex 1 2 * Complex 3 4"}; -@{term "Complex 1 2 - Complex 3 4"}; -@{term "Complex 1 2 / Complex 3 4"}; -(*@{term "Complex 1 2 ^ Complex 3 4"}; - Type unification failed: Clash of types "complex" and "nat" - Operator: op ^ (Complex 1 2) :: nat \ complex - Operand: Complex 3 4 :: complex*) -*} -ML {* -term2str @{term "Complex 1 2 + Complex 3 4"}; -term2str @{term "Complex 1 2 / Complex 3 4"}; -*} - -ML {* -val a = @{term "Complex 1 2"}; -atomty a; -val a = str2term "Complex 1 2"; -atomty a; -*} -ML {* -val b = @{term "Complex 3 4"}; -val b = str2term "Complex 3 4"; -(*a + (b::complex); ERROR: term + term*) -*} - -section {*use the operations for simplification*} - - - -subsection {*example 1 -- ADD*} -ML {* - print_depth 1; - val (thy, ro, er) = (@{theory}, tless_true, eval_rls); -*} -ML {* - val thm = @{thm "complex_add"}; - val t = str2term "Complex 1 2 + Complex 3 4"; - val SOME _ = rewrite_ thy ro er true thm t; - val SOME (t', _) = rewrite_ thy ro er true thm t; - "Complex (1 + 3) (2 + 4)" = term2str t'; -*} - - - - -subsection {*example 2 -- ADD, MULT*} -ML {* - -val Simplify_complex = append_rls "Simplify_complex" e_rls - [ Thm ("complex_add",num_str @{thm complex_add}), - Thm ("complex_mult",num_str @{thm complex_mult}), - Rls_ norm_Poly - ]; - -*} -ML {* - -val t = str2term "(Complex 1 2 * (Complex 3 4 + Complex 5 (6::real)))"; -term2str t = "Complex 1 2 * (Complex 3 4 + Complex 5 6)"; -atomty t; - -*} -ML {* - - -val SOME (t, _) = rewrite_set_ thy true Simplify_complex t; - -term2str t = "Complex -12 26"; -atomty t; - -*} - -subsection {*example 3*} -ML {* -val Simplify_complex = append_rls "Simplify_complex" e_rls - [ Thm ("complex_mult",num_str @{thm complex_mult}), - Thm ("complex_inverse",num_str @{thm complex_inverse}), - Rls_ norm_Poly - ]; -*} -ML {* -val t = str2term "inverse (Complex (2::real) (4::real))"; -term2str t = "inverse Complex (2) (4)"; -atomty t; -*} -ML {* -trace_rewrite := true; -val SOME (t, _) = rewrite_set_ thy true Simplify_complex t; -trace_rewrite := false; -term2str t = "Complex -12 26"; -atomty t; -*} - - - -ML {* -trace_rewrite := true; -trace_rewrite := false; -*} - -end - diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/Test_Integral.thy --- a/src/Doc/isac/jrocnik/Test_Integral.thy Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -(* -doc-src/isac/jrocnik$ /usr/local/isabisac/bin/isabelle jedit Test_Integral.thy & -*) - -theory Test_Integral imports "../../../src/HOL/Multivariate_Analysis/Integration" -Integration begin - -ML {* -@{term "Integral s f k"} -*} -ML {* -*} -ML {* -*} - -end - diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/Test_SUM.thy --- a/src/Doc/isac/jrocnik/Test_SUM.thy Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ - -theory Test_SUM imports Isac begin - -section {*trials with implicit function, probably required*} -ML {* -@{term "(%n :: nat. n) 2"}; -@{term "(%n. n) 2"}; -@{term "2"}; -*} -ML {* -@{term "(%n. n+n)"}; -@{term "(%n. n+n) a"}; -@{term "a+a"}; -*} -section {*sums*} -ML {* -val x = @{term "(SUM i = 0..< k. f i)"}; -term2str x -*} -ML {* -*} -ML {* -*} -ML {* -*} - -end - diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/bakkarbeit.tcp --- a/src/Doc/isac/jrocnik/bakkarbeit.tcp Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -[FormatInfo] -Type=TeXnicCenterProjectInformation -Version=4 - -[ProjectInfo] -MainFile=jrocnik_bakk.tex -UseBibTeX=1 -UseMakeIndex=0 -ActiveProfile=LaTeX => PDF (Sumatra) -ProjectLanguage=en -ProjectDialect=US - diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/bakkarbeit.tps --- a/src/Doc/isac/jrocnik/bakkarbeit.tps Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ -[FormatInfo] -Type=TeXnicCenterProjectSessionInformation -Version=2 - -[SessionInfo] -ActiveTab=0 -FrameCount=5 -ActiveFrame=0 - -[Frame0] -Columns=1 -Rows=1 -Flags=2 -ShowCmd=3 -MinPos.x=-1 -MinPos.y=-1 -MaxPos.x=-4 -MaxPos.y=-23 -NormalPos.left=0 -NormalPos.top=0 -NormalPos.right=112 -NormalPos.bottom=299 -Class=CLatexEdit -Document=jrocnik_bakk.tex - -[Frame0_Row0] -cyCur=848 -cyMin=10 - -[Frame0_Col0] -cxCur=992 -cxMin=10 - -[Frame0_View0,0] -Cursor.row=143 -Cursor.column=297 -TopSubLine=145 - -[Frame1] -Columns=1 -Rows=1 -Flags=0 -ShowCmd=1 -MinPos.x=-1 -MinPos.y=-1 -MaxPos.x=-4 -MaxPos.y=-23 -NormalPos.left=44 -NormalPos.top=44 -NormalPos.right=676 -NormalPos.bottom=512 -Class=CLatexEdit -Document=calulations.tex - -[Frame1_Row0] -cyCur=421 -cyMin=10 - -[Frame1_Col0] -cxCur=604 -cxMin=10 - -[Frame1_View0,0] -Cursor.row=52 -Cursor.column=25 -TopSubLine=35 - -[Frame2] -Columns=1 -Rows=1 -Flags=0 -ShowCmd=1 -MinPos.x=-1 -MinPos.y=-1 -MaxPos.x=-4 -MaxPos.y=-23 -NormalPos.left=66 -NormalPos.top=66 -NormalPos.right=698 -NormalPos.bottom=534 -Class=CLatexEdit -Document=bakkarbeit_titlepage.tex - -[Frame2_Row0] -cyCur=421 -cyMin=10 - -[Frame2_Col0] -cxCur=604 -cxMin=10 - -[Frame2_View0,0] -Cursor.row=7 -Cursor.column=0 -TopSubLine=0 - -[Frame3] -Columns=1 -Rows=1 -Flags=0 -ShowCmd=1 -MinPos.x=-1 -MinPos.y=-1 -MaxPos.x=-4 -MaxPos.y=-23 -NormalPos.left=88 -NormalPos.top=88 -NormalPos.right=1134 -NormalPos.bottom=670 -Class=CLatexEdit -Document=preambleForGeneratedDocuments.tex - -[Frame3_Row0] -cyCur=535 -cyMin=10 - -[Frame3_Col0] -cxCur=1018 -cxMin=10 - -[Frame3_View0,0] -Cursor.row=3 -Cursor.column=30 -TopSubLine=0 - -[Frame4] -Columns=1 -Rows=1 -Flags=0 -ShowCmd=1 -MinPos.x=-1 -MinPos.y=-1 -MaxPos.x=-4 -MaxPos.y=-23 -NormalPos.left=110 -NormalPos.top=110 -NormalPos.right=1156 -NormalPos.bottom=692 -Class=CLatexEdit -Document=references.bib - -[Frame4_Row0] -cyCur=535 -cyMin=10 - -[Frame4_Col0] -cxCur=1018 -cxMin=10 - -[Frame4_View0,0] -Cursor.row=24 -Cursor.column=15 -TopSubLine=0 - diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/bakkarbeit_titlepage.tex --- a/src/Doc/isac/jrocnik/bakkarbeit_titlepage.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -\begin{titlepage} - - % Top of the page - \vspace*{-2cm} - \hfill - \begin{minipage}{4cm} - \includegraphics[width=40mm]{./TUGlogo.pdf} - \end{minipage} - - % Center of the page - \begin{center} - \vspace{1cm} - - \normalsize{Baccalaureate Thesis}\\ - - \HRule - \vspace{0.3cm} - \Large{ - \bf Interactive Course Material for Signal Processing based on Isabelle/\isac\\ - } - \HRule - - \vspace{1cm} - \normalsize{conducted at the}\\ - \normalsize{Institute for Software Technology}\\ - \normalsize{Institute of Signal Processing and Speech Communication}\\ - \vspace{0.3cm} - \normalsize{Graz University of Technology}\\ - - \vspace{1cm} - \normalsize{by}\\ - Jan Simon Ro\v{c}nik\\\href{mailto:student.tugraz.at}{\tt jan.rocnik@student.tugraz.at} - - \vspace{1cm} - \normalsize{Supervisor}\\ - Univ.-Prof. Dipl.-Ing. Dr.techn. Franz Wotawa - \vfill - - % Bottom of the page - {\large Graz, \today} - - \end{center} - -\end{titlepage} \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/calulations.tex --- a/src/Doc/isac/jrocnik/calulations.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,202 +0,0 @@ -%\documentclass[a4paper]{scrartcl} -%\usepackage[top=2cm, bottom=2.5cm, left=3cm, right=2cm, footskip=1cm]{geometry} -%\usepackage[german]{babel} -%\usepackage[T1]{fontenc} -%\usepackage[latin1]{inputenc} -%\usepackage{endnotes} -%\usepackage{trfsigns} -%\usepackage{setspace} -% -%\setlength{\parindent}{0ex} -%\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} -%\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} -% -%\begin{document} -%\title{Interactive Course Material for Signal Processing based on Isabelle/\isac} -%\subtitle{Problemsolutions (Calculations)} -%\author{Walther Neuper, Jan Rocnik} -%\maketitle - - -%------------------------------------------------------------------------------ -%FOURIER - -\subsection{Fourier Transformation} -\subsubsection*{Problem\endnote{Problem submitted by Bernhard Geiger. Originally fragment of the exam to \emph{Signaltransformationen VO} from 04.03.2011. Translated from German.}} -\textbf{(a)} Determine the fourier transform for the given rectangular impulse: - -\begin{center} -$x(t)= \left\{ - \begin{array}{lr} - 1 & -1\leq t\geq1\\ - 0 & else - \end{array} - \right.$ -\end{center} - -\textbf{\noindent (b)} Now consider the given delayed impulse, determine its fourie transformation and calculate phase and magnitude: - -\begin{center} -$x(t)= \left\{ - \begin{array}{lr} - 1 & -1\leq t\leq1\\ - 0 & else - \end{array} - \right.$ -\end{center} - -\subsubsection{Solution} -\textbf{(a)} \textsf{Subproblem 1} -\onehalfspace{ -\begin{tabbing} -000\=\kill -\texttt{\footnotesize{01}} \> Definition: $X(j\omega)=\int_\infty^\infty{x(t)\cdot e^{-j\omega t}}$\\ -\`Insert Condition: $x(t) = 1\;$ for $\;\{-1\leq t\;\land\;t\leq 1\}\;$ and $\;x(t)=0\;$ otherwise\\ -\texttt{\footnotesize{02}} \> $X(j\omega)=\int_{-1}^{1}{1\cdot e^{-j\omega t}}$\\ - \` $\int_a^b f\;t\;dt = \int f\;t\;dt\;|_a^b$\\ -\texttt{\footnotesize{03}} \> $\int 1\cdot e^{-j\cdot\omega\cdot t} d t\;|_{-1}^1$\\ - \` pbl: integration in $\cal C$\\ -\texttt{\footnotesize{04}} \> $\left(\frac{1}{-j\cdot\omega}\cdot e^{-j\cdot\omega\cdot t} \;|_{-1}^1\right)$\\ - \` $f\;t\;|_a^b = f\;b-f\;a$\\ -\texttt{\footnotesize{05}} \> $\frac{1}{-j\cdot\omega}\cdot e^{-j\cdot\omega\cdot 1} - \frac{1}{-j\cdot\omega}\cdot e^{-j\cdot\omega\cdot -1}$\\ -\texttt{\footnotesize{06}} \> $\frac{1}{-j\cdot\omega}\cdot e^{-j\cdot\omega} - \frac{1}{-j\cdot\omega}\cdot e^{j\cdot\omega}$\\ -\` Lift $\frac{1}{j\omega}$\\ -\texttt{\footnotesize{07}} \> $\frac{1}{j\cdot\omega}\cdot(e^{j\cdot\omega} - e^{-j\cdot\omega})$\\ - \` trick~!\\ -\texttt{\footnotesize{08}} \> $\frac{1}{\omega}\cdot(\frac{-e^{j\cdot\omega} + e^{-j\cdot\omega}}{j})$\\ - \` table\\ -\texttt{\footnotesize{09}} \> $2\cdot\frac{\sin\;\omega}{\omega}$ -\end{tabbing} -} - -\noindent\textbf{(b)} \textsf{Subproblem 1} -\onehalfspace{ -\begin{tabbing} -000\=\kill -\texttt{\footnotesize{01}} \> Definition: $X(j\omega)=\int_\infty^\infty{x(t)\cdot e^{-j\omega t}}$\\ -\`Insert Condition: $x(t) = 1\;$ for $\;\{1\leq t\;\land\;t\leq 3\}\;$ and $\;x(t)=0\;$ otherwise\\ -\texttt{\footnotesize{02}} \> $X(j\omega)=\int_{-1}^{1}{1\cdot e^{-j\omega t}}$\\ - \` $\int_a^b f\;t\;dt = \int f\;t\;dt\;|_a^b$\\ -\texttt{\footnotesize{03}} \> $\int 1\cdot e^{-j\cdot\omega\cdot t} d t\;|_{1}^3$\\ - \` pbl: integration in $\cal C$\\ -\texttt{\footnotesize{04}} \> $\left(\frac{1}{-j\cdot\omega}\cdot e^{-j\cdot\omega\cdot t} \;|_{1}^3\right)$\\ - \` $f\;t\;|_a^b = f\;b-f\;a$\\ -\texttt{\footnotesize{05}} \> $\frac{1}{-j\cdot\omega}\cdot e^{-j\cdot\omega\cdot 3} - \frac{1}{-j\cdot\omega}\cdot e^{-j\cdot\omega\cdot 1}$\\ -\`Lift $\frac{1}{-j\omega}$\\ -\texttt{\footnotesize{06}} \> $\frac{1}{j\cdot\omega}\cdot(e^{-j\cdot\omega} - e^{-j\cdot\omega3})$\\ - \`Lift $e^{j\omega2}$ (trick)\\ -\texttt{\footnotesize{07}} \> $\frac{1}{j\omega}\cdot e^{j\omega2}\cdot(e^{j\omega} - e^{-j\omega})$\\ -\`Simplification (trick)\\ -\texttt{\footnotesize{08}} \> $\frac{1}{\omega}\cdot e^{j\omega2}\cdot(\frac{e^{j\omega} - e^{-j\omega}}{j})$\\ - \` table\\ -\texttt{\footnotesize{09}} \> $2\cdot e^{j\omega2}\cdot\frac{\sin\;\omega}{\omega}$\\ -\noindent\textbf{(b)} \textsf{Subproblem 2}\\ -\`Definition: $X(j\omega)=|X(j\omega)|\cdot e^{arg(X(j\omega))}$\\ -\`$|X(j\omega)|$ is called \emph{Magnitude}\\ -\`$arg(X(j\omega))$ is called \emph{Phase}\\ -\texttt{\footnotesize{10}} \> $|X(j\omega)|=\frac{2}{\omega}\cdot sin(\omega)$\\ -\texttt{\footnotesize{11}} \> $arg(X(j\omega)=-2\omega$\\ -\end{tabbing} -} -%------------------------------------------------------------------------------ -%CONVOLUTION - -\subsection{Convolution} -\subsubsection*{Problem\endnote{Problem submitted by Bernhard Geiger. Originally part of the SPSC Problem Class 2, Summer term 2008}} -Consider the two discrete-time, linear and time-invariant (LTI) systems with the following impulse response: - -\begin{center} -$h_1[n]=\left(\frac{3}{5}\right)^n\cdot u[n]$\\ -$h_1[n]=\left(-\frac{2}{3}\right)^n\cdot u[n]$ -\end{center} - -The two systems are cascaded seriell. Derive the impulse respinse of the overall system $h_c[n]$. -\subsubsection*{Solution} - -\doublespace{ -\begin{tabbing} -000\=\kill -\texttt{\footnotesize{01}} \> $h_c[n]=h_1[n]*h_2[n]$\\ -\texttt{\footnotesize{02}} \> $h_c[n]=\left(\left(\frac{3}{5}\right)^n\cdot u[n]\right)*\left(\left(-\frac{2}{3}\right)^n\cdot u[n]\right)$\\ -\`Definition: $a^n\cdot u[n]\,*\,b^n\cdot u[n]=\sum\limits_{k=-\infty}^{\infty}{a^k\cdot u[k]\cdot b^{n-k}\cdot u[n-k]}$\\ -\texttt{\footnotesize{03}} \> $h_c[n]=\sum\limits_{k=-\infty}^{\infty}{\left(\frac{3}{5}\right)^k\cdot u[n]\,\cdot \,\left(-\frac{2}{3}\right)^{n-k}\cdot u[n-k]}$\\ -\`$u[n]= \left\{ - \begin{array}{lr} - 1 & for\ n>=0\\ - 0 & else - \end{array} - \right.$\\ -\`We can leave the unitstep through simplification.\\ -\`So the lower limit is 0, the upper limit is n.\\ -\texttt{\footnotesize{04}} \> $h_c[n]=\sum\limits_{k=0}^{n}{\left(\frac{3}{5}\right)^k\cdot \left(-\frac{2}{3}\right)^{n-k}}$\\ -\`Expand\\ -\texttt{\footnotesize{05}} \> $h_c[n]=\sum\limits_{k=0}^{n}{\left(\frac{3}{5}\right)^k\cdot \left(-\frac{2}{3}\right)^{n}\cdot \left(-\frac{2}{3}\right)^{-k}}$\\ -\`Lift\\ -\texttt{\footnotesize{06}} \> $h_c[n]=\left(-\frac{2}{3}\right)^{n}\cdot\sum\limits_{k=0}^{\infty}{\left(\frac{3}{5}\right)^k\cdot \left(-\frac{2}{3}\right)^{-k}}$\\ -\texttt{\footnotesize{07}} \> $h_c[n]=\left(-\frac{2}{3}\right)^{n}\cdot\sum\limits_{k=0}^{n}{\left(\frac{3}{5}\right)^k\cdot \left(-\frac{3}{2}\right)^{k}}$\\ -\texttt{\footnotesize{08}} \> $h_c[n]=\left(-\frac{2}{3}\right)^{n}\cdot\sum\limits_{k=0}^{n}{\left(-\frac{9}{10}\right)^{k}}$\\ -\`Geometric Series: $\sum\limits_{k=0}^{n}{q^k}=\frac{1-q^{n+1}}{1-q}$\\ -\`Now we have to consider the limits again.\\ -\`It is neccesarry to put the unitstep in again.\\ -\texttt{\footnotesize{09}} \> $h_c[n]=\left(-\frac{2}{3}\right)^{n}\cdot\frac{1-\left(-\frac{9}{10}\right)^{n+1}}{1-\left(-\frac{9}{10}\right)}\cdot u[n]$\\ -\texttt{\footnotesize{10}} \> $h_c[n]=\left(-\frac{2}{3}\right)^{n}\cdot\frac{1-\left(-\frac{9}{10}\right)^{n}\cdot\left(-\frac{9}{10}\right)}{1-\left(-\frac{9}{10}\right)}\cdot u[n]$\\ -\texttt{\footnotesize{11}} \> $h_c[n]=\left(-\frac{2}{3}\right)^{n}\cdot\frac{1-\left(-\frac{9}{10}\right)^{n}\cdot\left(-\frac{9}{10}\right)}{\left(\frac{19}{10}\right)}\cdot u[n]$\\ -\texttt{\footnotesize{12}} \> $h_c[n]=\left(-\frac{2}{3}\right)^{n}\cdot \left(1-\left(-\frac{9}{10}\right)^{n}\cdot\left(-\frac{9}{10}\right)\right)\cdot\left(\frac{10}{19}\right)\cdot u[n]$\\ -\`Lift $u[n]$\\ -\texttt{\footnotesize{13}} \> $\left(\frac{10}{19}\cdot\left(-\frac{2}{3}\right)^n+\frac{9}{19}\cdot\left(\frac{3}{5}\right)^n\right)\cdot u[n]$\\ -\end{tabbing} -} - -%------------------------------------------------------------------------------ -%Z-Transformation - -\subsection{Z-Transformation\label{sec:calc:ztrans}} -\subsubsection*{Problem\endnote{Problem submitted by Bernhard Geiger. Originally part of the signal processing problem class 5, summer term 2008.}} -Determine the inverse $\cal{z}$ transform of the following expression. Hint: applay the partial fraction expansion. - -\begin{center} -$X(z)=\frac{3}{z-\frac{1}{4}-\frac{1}{8}z^{-1}},\ \ x[n]$ is absolute summable -\end{center} - -\subsubsection*{Solution} -\onehalfspace{ -\begin{tabbing} -000\=\kill -\textsf{Main Problem}\\ -\texttt{\footnotesize{01}} \> $\frac{3}{z-\frac{1}{4}-\frac{1}{8}z^{-1}}$ \\ -\`Divide through z, neccesary for z-transformation\\ -\texttt{\footnotesize{02}} \> $\frac{3}{z^2-\frac{1}{4}z-\frac{1}{8}}$ \\ -\`Start with partial fraction expansion\\ -\texttt{\footnotesize{03}} \> $\frac{3}{z^2-\frac{1}{4}z-\frac{1}{8}}=\frac{A}{z-z_1}+\frac{B}{z-z_2}$ \\ -\`Eliminate Fractions\\ -\texttt{\footnotesize{04}} \> $3=A(z-z_2)+B(z-z_1)$ \\ -\textsf{Subproblem 1}\\ -\`Setup a linear equation system by inserting the zeros $z_1$ and $z_2$ for $z$\\ -\texttt{\footnotesize{05}} \> $3=A(z_1-z_2)$ \& $3=B(z_2-z_1)$\\ -\texttt{\footnotesize{06}} \> $\frac{3}{z_1-z_2}=A$ \& $\frac{3}{z_2-z_1}=B$\\ -\textsf{Subproblem 2}\\ -\`Determine $z_1$ and $z_2$\\ -\texttt{\footnotesize{07}} \> $z_1=\frac{1}{8}+\sqrt{\frac{1}{64}+\frac{1}{8}}$ \& $z_2=\frac{1}{8}-\sqrt{\frac{1}{64}+\frac{1}{8}}$\\ -\texttt{\footnotesize{08}} \> $z_1=\frac{1}{8}+\sqrt{\frac{9}{64}}$ \& $z_2=\frac{1}{8}-\sqrt{\frac{9}{64}}$\\ -\texttt{\footnotesize{09}} \> $z_1=\frac{1}{8}+\frac{3}{8}$ \& $z_2=\frac{1}{8}-\frac{3}{8}$\\ -\texttt{\footnotesize{10}} \> $z_1=\frac{1}{2}$ \& $z_2=-\frac{1}{4}$\\ -\textsf{Continiue with Subproblem 1}\\ -\`Get the coeffizients $A$ and $B$\\ -\texttt{\footnotesize{11}} \> $\frac{3}{\frac{1}{2}-(-\frac{1}{4})}=A$ \& $\frac{3}{-\frac{1}{4}-\frac{1}{2}}=B$\\ -\texttt{\footnotesize{12}} \> $\frac{3}{\frac{1}{2}+\frac{1}{4}}=A$ \& $\frac{3}{-\frac{1}{4}-\frac{1}{2}}=B$\\ -\texttt{\footnotesize{13}} \> $\frac{3}{\frac{3}{4}}=A$ \& $\frac{3}{-\frac{3}{4}}=B$\\ -\texttt{\footnotesize{14}} \> $\frac{12}{3}=A$ \& $-\frac{12}{3}=B$\\ -\texttt{\footnotesize{15}} \> $4=A$ \& $-4=B$\\ -\textsf{Continiue with Main Problem}\\ -\texttt{\footnotesize{16}} \> $\frac{A}{z-z_1}+\frac{B}{z-z_2}$\\ -\texttt{\footnotesize{17}} \> $\frac{4}{z-\frac{1}{2}}+\frac{4}{z-\left(-\frac{1}{4}\right)}$ \\ -\texttt{\footnotesize{18}} \> $\frac{4}{z-\frac{1}{2}}-\frac{4}{z+\frac{1}{4}}$ \\ -\`Multiply with z, neccesary for z-transformation\\ -\texttt{\footnotesize{19}} \> $\frac{4z}{z-\frac{1}{2}}-\frac{4z}{z+\frac{1}{4}}$ \\ -\texttt{\footnotesize{20}} \> $4\cdot\frac{z}{z-\frac{1}{2}}+(-4)\cdot\frac{z}{z+\frac{1}{4}}$ \\ -\`Transformation\\ -\texttt{\footnotesize{21}} \> $4\cdot\frac{z}{z-\frac{1}{2}}+(-4)\cdot\frac{z}{z+\frac{1}{4}}\ \Ztransf\ 4\cdot\left(-\frac{1}{2}\right)^n\cdot u[n]+(-4)\cdot\left(\frac{1}{4}\right)^n\cdot u[n]$\\ -\end{tabbing} -} -\theendnotes -%\end{document} \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/eJMT-paper/fig/isac-Ztrans-math-3.png Binary file src/Doc/isac/jrocnik/eJMT-paper/fig/isac-Ztrans-math-3.png has changed diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/eJMT-paper/fig/isac-Ztrans-math.pdf Binary file src/Doc/isac/jrocnik/eJMT-paper/fig/isac-Ztrans-math.pdf has changed diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/eJMT-paper/fig/universe.pdf Binary file src/Doc/isac/jrocnik/eJMT-paper/fig/universe.pdf has changed diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/eJMT-paper/jrocnik_eJMT.tex --- a/src/Doc/isac/jrocnik/eJMT-paper/jrocnik_eJMT.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2135 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Electronic Journal of Mathematics and Technology (eJMT) % -% style sheet for LaTeX. Please do not modify sections % -% or commands marked 'eJMT'. % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% eJMT commands % -% % -\documentclass[12pt,a4paper]{article}% % -\usepackage{times} % -\usepackage{amsfonts,amsmath,amssymb} % -\usepackage[a4paper]{geometry} % -\usepackage{fancyhdr} % -\usepackage{color} % -\usepackage[pdftex]{hyperref} % see note below % -\usepackage{graphicx}% % -\hypersetup{ % - a4paper, % - breaklinks % -} % -% % -\newtheorem{theorem}{Theorem} % -\newtheorem{acknowledgement}[theorem]{Acknowledgement} % -\newtheorem{algorithm}[theorem]{Algorithm} % -\newtheorem{axiom}[theorem]{Axiom} % -\newtheorem{case}[theorem]{Case} % -\newtheorem{claim}[theorem]{Claim} % -\newtheorem{conclusion}[theorem]{Conclusion} % -\newtheorem{condition}[theorem]{Condition} % -\newtheorem{conjecture}[theorem]{Conjecture} % -\newtheorem{corollary}[theorem]{Corollary} % -\newtheorem{criterion}[theorem]{Criterion} % -\newtheorem{definition}[theorem]{Definition} % -\newtheorem{example}[theorem]{Example} % -\newtheorem{exercise}[theorem]{Exercise} % -\newtheorem{lemma}[theorem]{Lemma} % -\newtheorem{notation}[theorem]{Notation} % -\newtheorem{problem}[theorem]{Problem} % -\newtheorem{proposition}[theorem]{Proposition} % -\newtheorem{remark}[theorem]{Remark} % -\newtheorem{solution}[theorem]{Solution} % -\newtheorem{summary}[theorem]{Summary} % -\newenvironment{proof}[1][Proof]{\noindent\textbf{#1.} } % -{\ \rule{0.5em}{0.5em}} % -% % -% eJMT page dimensions % -% % -\geometry{left=2cm,right=2cm,top=3.2cm,bottom=4cm} % -% % -% eJMT header & footer % -% % -\newcounter{ejmtFirstpage} % -\setcounter{ejmtFirstpage}{1} % -\pagestyle{empty} % -\setlength{\headheight}{14pt} % -\geometry{left=2cm,right=2cm,top=3.2cm,bottom=4cm} % -\pagestyle{fancyplain} % -\fancyhf{} % -\fancyhead[c]{\small The Electronic Journal of Mathematics% -\ and Technology, Volume 1, Number 1, ISSN 1933-2823} % -\cfoot{% % - \ifnum\value{ejmtFirstpage}=0% % - {\vtop to\hsize{\hrule\vskip .2cm\thepage}}% % - \else\setcounter{ejmtFirstpage}{0}\fi% % -} % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Please place your own definitions here -% -\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} -\def\sisac{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} - -\usepackage{color} -\definecolor{lgray}{RGB}{238,238,238} - -\usepackage{hyperref} - -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% How to use hyperref % -% ------------------- % -% % -% Probably the only way you will need to use the hyperref % -% package is as follows. To make some text, say % -% "My Text Link", into a link to the URL % -% http://something.somewhere.com/mystuff, use % -% % -% \href{http://something.somewhere.com/mystuff}{My Text Link} -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -\begin{document} -% -% document title -% -\title{Trials with TP-based Programming -\\ -for Interactive Course Material}% -% -% Single author. Please supply at least your name, -% email address, and affiliation here. -% -\author{\begin{tabular}{c} -\textit{Jan Ro\v{c}nik} \\ -jan.rocnik@student.tugraz.at \\ -IST, SPSC\\ -Graz University of Technology\\ -Austria\end{tabular} -}% -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% eJMT commands - do not change these % -% % -\date{} % -\maketitle % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% abstract -% -\begin{abstract} - -Traditional course material in engineering disciplines lacks an -important component, interactive support for step-wise problem -solving. Theorem-Proving (TP) technology is appropriate for one part -of such support, in checking user-input. For the other part of such -support, guiding the learner towards a solution, another kind of -technology is required. - -Both kinds of support can be achieved by so-called -Lucas-Interpretation which combines deduction and computation and, for -the latter, uses a novel kind of programming language. This language -is based on (Computer) Theorem Proving (TP), thus called a ``TP-based -programming language''. - -This paper is the experience report of the first ``application -programmer'' using this language for creating exercises in step-wise -problem solving for an advanced lab in Signal Processing. The tasks -involved in TP-based programming are described together with the -experience gained from a prototype of the programming language and of -it's interpreter. - -The report concludes with a positive proof of concept, states -insufficiency usability of the prototype and captures the requirements -for further development of both, the programming language and the -interpreter. -% -\end{abstract}% -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% eJMT command % -% % -\thispagestyle{fancy} % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Please use the following to indicate sections, subsections, -% etc. Please also use \subsubsection{...}, \paragraph{...} -% and \subparagraph{...} as necessary. -% - -\section{Introduction}\label{intro} - -% \paragraph{Didactics of mathematics} -%WN: wenn man in einem high-quality paper von 'didactics' spricht, -%WN muss man am state-of-the-art ankn"upfen -- siehe -%WN W.Neuper, On the Emergence of TP-based Educational Math Assistants -% faces a specific issue, a gap -% between (1) introduction of math concepts and skills and (2) -% application of these concepts and skills, which usually are separated -% into different units in curricula (for good reasons). For instance, -% (1) teaching partial fraction decomposition is separated from (2) -% application for inverse Z-transform in signal processing. -% -% \par This gap is an obstacle for applying math as an fundamental -% thinking technology in engineering: In (1) motivation is lacking -% because the question ``What is this stuff good for?'' cannot be -% treated sufficiently, and in (2) the ``stuff'' is not available to -% students in higher semesters as widespread experience shows. -% -% \paragraph{Motivation} taken by this didactic issue on the one hand, -% and ongoing research and development on a novel kind of educational -% mathematics assistant at Graz University of -% Technology~\footnote{http://www.ist.tugraz.at/isac/} promising to -% scope with this issue on the other hand, several institutes are -% planning to join their expertise: the Institute for Information -% Systems and Computer Media (IICM), the Institute for Software -% Technology (IST), the Institutes for Mathematics, the Institute for -% Signal Processing and Speech Communication (SPSC), the Institute for -% Structural Analysis and the Institute of Electrical Measurement and -% Measurement Signal Processing. -%WN diese Information ist f"ur das Paper zu spezielle, zu aktuell -%WN und damit zu verg"anglich. -% \par This thesis is the first attempt to tackle the above mentioned -% issue, it focuses on Telematics, because these specific studies focus -% on mathematics in \emph{STEOP}, the introductory orientation phase in -% Austria. \emph{STEOP} is considered an opportunity to investigate the -% impact of {\sisac}'s prototype on the issue and others. -% - -Traditional course material in engineering disciplines lacks an -important component, interactive support for step-wise problem -solving. The lack becomes evident by comparing existing course -material with the sheets collected from written exams (in case solving -engineering problems is {\em not} deteriorated to multiple choice -tests) on the topics addressed by the materials. -Theorem-Proving (TP) technology can provide such support by -specific services. An important part of such services is called -``next-step-guidance'', generated by a specific kind of ``TP-based -programming language''. In the -{\sisac}-project~\footnote{http://www.ist.tugraz.at/projects/isac/} such -a language is prototyped in line with~\cite{plmms10} and built upon -the theorem prover Isabelle~\cite{Nipkow-Paulson-Wenzel:2002} -\footnote{http://isabelle.in.tum.de/}. -The TP services are coordinated by a specific interpreter for the -programming language, called -Lucas-Interpreter~\cite{wn:lucas-interp-12}. The language - will be briefly re-introduced in order to make the paper -self-contained. - -The main part of the paper is an account of first experiences -with programming in this TP-based language. The experience was gained -in a case study by the author. The author was considered an ideal -candidate for this study for the following reasons: as a student in -Telematics (computer science with focus on Signal Processing) he had -general knowledge in programming as well as specific domain knowledge -in Signal Processing; and he was {\em not} involved in the development of -{\sisac}'s programming language and interpreter, thus being a novice to the -language. - -The goals of the case study were: (1) to identify some TP-based programs for -interactive course material for a specific ``Advanced Signal -Processing Lab'' in a higher semester, (2) respective program -development with as little advice as possible from the {\sisac}-team and (3) -to document records and comments for the main steps of development in an -Isabelle theory; this theory should provide guidelines for future programmers. -An excerpt from this theory is the main part of this paper. -\par - -\medskip The major example resulting from the case study will be used -as running example throughout this paper. This example requires a -program resembling the size of real-world applications in engineering; -such a size was considered essential for the case study, since there -are many small programs for a long time (mainly concerned with -elementary Computer Algebra like simplification, equation solving, -calculus, etc.~\footnote{The programs existing in the {\sisac} -prototype are found at -http://www.ist.tugraz.at/projects/isac/www/kbase/met/index\_met.html}) - -\paragraph{The mathematical background of the running example} is the -following: In Signal Processing, ``the ${\cal Z}$-transform for -discrete-time signals is the counterpart of the Laplace transform for -continuous-time signals, and they each have a similar relationship to -the corresponding Fourier transform. One motivation for introducing -this generalization is that the Fourier transform does not converge -for all sequences, and it is useful to have a generalization of the -Fourier transform that encompasses a broader class of signals. A -second advantage is that in analytic problems, the ${\cal Z}$-transform -notation is often more convenient than the Fourier transform -notation.'' ~\cite[p. 128]{oppenheim2010discrete}. The ${\cal Z}$-transform -is defined as -\begin{equation*} -X(z)=\sum_{n=-\infty }^{\infty }x[n]z^{-n} -\end{equation*} -where a discrete time sequence $x[n]$ is transformed into the function -$X(z)$ where $z$ is a continuous complex variable. The inverse -function is addressed in the running example and can be determined by -the integral -\begin{equation*} -x[n]=\frac{1}{2\pi j} \oint_{C} X(z)\cdot z^{n-1} dz -\end{equation*} -where the letter $C$ represents a contour within the range of -convergence of the ${\cal Z}$-transform. The unit circle can be a special -case of this contour. Remember that $j$ is the complex number in the -domain of engineering. As this transform requires high effort to -be solved, tables of commonly used transform pairs are used in -education as well as in engineering practice; such tables can be found -at~\cite{wiki:1} or~\cite[Table~3.1]{oppenheim2010discrete} as well. -A completely solved and more detailed example can be found at -~\cite[p. 149f]{oppenheim2010discrete}. - -Following conventions in engineering education and in practice, the -running example solves the problem by use of a table. - -\paragraph{Support for interactive stepwise problem solving} in the -{\sisac} prototype is shown in Fig.\ref{fig-interactive}~\footnote{ Fig.\ref{fig-interactive} also shows the prototype status of {\sisac}; for instance, -the lack of 2-dimensional presentation and input of formulas is the major obstacle for field-tests in standard classes.}: -A student inputs formulas line by line on the \textit{``Worksheet''}, -and each step (i.e. each formula on completion) is immediately checked -by the system, such that at most {\em one inconsistent} formula can reside on -the Worksheet (on the input line, marked by the red $\otimes$). -\begin{figure} [htb] -\begin{center} -\includegraphics[width=140mm]{fig/isac-Ztrans-math-3} -%\includegraphics[width=140mm]{fig/isac-Ztrans-math} -\caption{Step-wise problem solving guided by the TP-based program -\label{fig-interactive}} -\end{center} -\end{figure} -If the student gets stuck and does not know the formula to proceed -with, there is the button \framebox{NEXT} presenting the next formula -on the Worksheet; this feature is called ``next-step-guidance''~\cite{wn:lucas-interp-12}. The button \framebox{AUTO} immediately delivers the -final result in case the student is not interested in intermediate -steps. - -Adaptive dialogue guidance is already under -construction~\cite{gdaroczy-EP-13} and the two buttons will disappear, -since their presence is not wanted in many learning scenarios (in -particular, {\em not} in written exams). - -The buttons \framebox{Theories}, \framebox{Problems} and -\framebox{Methods} are the entry points for interactive lookup of the -underlying knowledge. For instance, pushing \framebox{Theories} in -the configuration shown in Fig.\ref{fig-interactive}, pops up a -``Theory browser'' displaying the theorem(s) justifying the current -step. The browser allows to lookup all other theories, thus -supporting indepentend investigation of underlying definitions, -theorems, proofs --- where the HTML representation of the browsers is -ready for arbitrary multimedia add-ons. Likewise, the browsers for -\framebox{Problems} and \framebox{Methods} support context sensitive -as well as interactive access to specifications and programs -respectively. - -There is also a simple web-based representation of knowledge items; -the items under consideration in this paper can be looked up as -well -~\footnote{\href{http://www.ist.tugraz.at/projects/isac/www/kbase/thy/browser\_info/HOL/HOL-Real/Isac/Inverse\_Z\_Transform.thy}{http://www.ist.tugraz.at/projects/isac/www/kbase/thy/browser\_info/HOL/HOL-Real/Isac/\textbf{Inverse\_Z\_Transform.thy}}} -~\footnote{\href{http://www.ist.tugraz.at/projects/isac/www/kbase/thy/browser\_info/HOL/HOL-Real/Isac/Partial\_Fractions.thy}{http://www.ist.tugraz.at/projects/isac/www/kbase/thy/browser\_info/HOL/HOL-Real/Isac/\textbf{Partial\_Fractions.thy}}} -~\footnote{\href{http://www.ist.tugraz.at/projects/isac/www/kbase/thy/browser\_info/HOL/HOL-Real/Isac/Build\_Inverse\_Z\_Transform.thy}{http://www.ist.tugraz.at/projects/isac/www/kbase/thy/browser\_info/HOL/HOL-Real/Isac/\textbf{Build\_Inverse\_Z\_Transform.thy}}}. - -% can be explained by having a look at -% Fig.\ref{fig-interactive} which shows the beginning of the interactive -% construction of a solution for the problem. This construction is done in the -% right window named ``Worksheet''. -% \par -% User-interaction on the Worksheet is {\em checked} and {\em guided} by -% TP services: -% \begin{enumerate} -% \item Formulas input by the user are {\em checked} by TP: such a -% formula establishes a proof situation --- the prover has to derive the -% formula from the logical context. The context is built up from the -% formal specification of the problem (here hidden from the user) by the -% Lucas-Interpreter. -% \item If the user gets stuck, the program developed below in this -% paper ``knows the next step'' and Lucas-Interpretation provides services -% featuring so-called ``next-step-guidance''; this is out of scope of this -% paper and can be studied in~\cite{gdaroczy-EP-13}. -% \end{enumerate} It should be noted that the programmer using the -% TP-based language is not concerned with interaction at all; we will -% see that the program contains neither input-statements nor -% output-statements. Rather, interaction is handled by the interpreter -% of the language. -% -% So there is a clear separation of concerns: Dialogues are adapted by -% dialogue authors (in Java-based tools), using TP services provided by -% Lucas-Interpretation. The latter acts on programs developed by -% mathematics-authors (in Isabelle/ML); their task is concern of this -% paper. - -\bigskip The paper is structured as follows: The introduction -\S\ref{intro} is followed by a brief re-introduction of the TP-based -programming language in \S\ref{PL}, which extends the executable -fragment of Isabelle's language (\S\ref{PL-isab}) by tactics which -play a specific role in Lucas-Interpretation and in providing the TP -services (\S\ref{PL-tacs}). The main part \S\ref{trial} describes -the main steps in developing the program for the running example: -prepare domain knowledge, implement the formal specification of the -problem, prepare the environment for the interpreter, implement the -program in \S\ref{isabisac} to \S\ref{progr} respectively. -The work-flow of programming, debugging and testing is -described in \S\ref{workflow}. The conclusion \S\ref{conclusion} will -give directions identified for future development. - - -\section{\isac's Prototype for a Programming Language}\label{PL} -The prototype of the language and of the Lucas-Interpreter is briefly -described from the point of view of a programmer. The language extends -the executable fragment of Higher-Order Logic (HOL) in the theorem prover -Isabelle~\cite{Nipkow-Paulson-Wenzel:2002}\footnote{http://isabelle.in.tum.de/}. - -\subsection{The Executable Fragment of Isabelle's Language}\label{PL-isab} -The executable fragment consists of data-type and function -definitions. It's usability even suggests that fragment for -introductory courses \cite{nipkow-prog-prove}. HOL is a typed logic whose type system resembles that of functional programming -languages. Thus there are -\begin{description} -\item[base types,] in particular \textit{bool}, the type of truth -values, \textit{nat}, \textit{int}, \textit{complex}, and the types of -natural, integer and complex numbers respectively in mathematics. -\item[type constructors] allow to define arbitrary types, from -\textit{set}, \textit{list} to advanced data-structures like -\textit{trees}, red-black-trees etc. -\item[function types,] denoted by $\Rightarrow$. -\item[type variables,] denoted by $^\prime a, ^\prime b$ etc, provide -type polymorphism. Isabelle automatically computes the type of each -variable in a term by use of Hindley-Milner type inference -\cite{pl:hind97,Milner-78}. -\end{description} - -\textbf{Terms} are formed as in functional programming by applying -functions to arguments. If $f$ is a function of type -$\tau_1\Rightarrow \tau_2$ and $t$ is a term of type $\tau_1$ then -$f\;t$ is a term of type~$\tau_2$. $t\;::\;\tau$ means that term $t$ -has type $\tau$. There are many predefined infix symbols like $+$ and -$\leq$ most of which are overloaded for various types. - -HOL also supports some basic constructs from functional programming: -{\footnotesize\it\label{isabelle-stmts} -\begin{tabbing} 123\=\kill -01\>$( \; {\tt if} \; b \; {\tt then} \; t_1 \; {\tt else} \; t_2 \;)$\\ -02\>$( \; {\tt let} \; x=t \; {\tt in} \; u \; )$\\ -03\>$( \; {\tt case} \; t \; {\tt of} \; {\it pat}_1 - \Rightarrow t_1 \; |\dots| \; {\it pat}_n\Rightarrow t_n \; )$ -\end{tabbing}} -\noindent The running example's program uses some of these elements -(marked by {\tt tt-font} on p.\pageref{s:impl}): for instance {\tt -let}\dots{\tt in} in lines {\rm 02} \dots {\rm 13}. In fact, the whole program -is an Isabelle term with specific function constants like {\tt -program}, {\tt Take}, {\tt Rewrite}, {\tt Subproblem} and {\tt -Rewrite\_Set} in lines {\rm 01, 03. 04, 07, 10} and {\rm 11, 12} -respectively. - -% Terms may also contain $\lambda$-abstractions. For example, $\lambda -% x. \; x$ is the identity function. - -%JR warum auskommentiert? WN2... -%WN2 weil ein Punkt wie dieser in weiteren Zusammenh"angen innerhalb -%WN2 des Papers auftauchen m"usste; nachdem ich einen solchen -%WN2 Zusammenhang _noch_ nicht sehe, habe ich den Punkt _noch_ nicht -%WN2 gel"oscht. -%WN2 Wenn der Punkt nicht weiter gebraucht wird, nimmt er nur wertvollen -%WN2 Platz f"ur Anderes weg. - -\textbf{Formulae} are terms of type \textit{bool}. There are the basic -constants \textit{True} and \textit{False} and the usual logical -connectives (in decreasing order of precedence): $\neg, \land, \lor, -\rightarrow$. - -\textbf{Equality} is available in the form of the infix function $=$ -of type $a \Rightarrow a \Rightarrow {\it bool}$. It also works for -formulas, where it means ``if and only if''. - -\textbf{Quantifiers} are written $\forall x. \; P$ and $\exists x. \; -P$. Quantifiers lead to non-executable functions, so functions do not -always correspond to programs, for instance, if comprising \\$( -\;{\it if} \; \exists x.\;P \; {\it then} \; e_1 \; {\it else} \; e_2 -\;)$. - -\subsection{\isac's Tactics for Lucas-Interpretation}\label{PL-tacs} -The prototype extends Isabelle's language by specific statements -called tactics~\footnote{{\sisac}'s. These tactics are different from -Isabelle's tactics: the former concern steps in a calculation, the -latter concern proofs.}. For the programmer these -statements are functions with the following signatures: - -\begin{description} -\item[Rewrite:] ${\it theorem}\Rightarrow{\it term}\Rightarrow{\it -term} * {\it term}\;{\it list}$: -this tactic applies {\it theorem} to a {\it term} yielding a {\it -term} and a {\it term list}, the list are assumptions generated by -conditional rewriting. For instance, the {\it theorem} -$b\not=0\land c\not=0\Rightarrow\frac{a\cdot c}{b\cdot c}=\frac{a}{b}$ -applied to the {\it term} $\frac{2\cdot x}{3\cdot x}$ yields -$(\frac{2}{3}, [x\not=0])$. - -\item[Rewrite\_Set:] ${\it ruleset}\Rightarrow{\it -term}\Rightarrow{\it term} * {\it term}\;{\it list}$: -this tactic applies {\it ruleset} to a {\it term}; {\it ruleset} is -a confluent and terminating term rewrite system, in general. If -none of the rules ({\it theorem}s) is applicable on interpretation -of this tactic, an exception is thrown. - -% \item[Rewrite\_Inst:] ${\it substitution}\Rightarrow{\it -% theorem}\Rightarrow{\it term}\Rightarrow{\it term} * {\it term}\;{\it -% list}$: -% -% \item[Rewrite\_Set\_Inst:] ${\it substitution}\Rightarrow{\it -% ruleset}\Rightarrow{\it term}\Rightarrow{\it term} * {\it term}\;{\it -% list}$: - -%SPACEvvv -\item[Substitute:] ${\it substitution}\Rightarrow{\it -term}\Rightarrow{\it term}$: allows to access sub-terms. -%SPACE^^^ - -\item[Take:] ${\it term}\Rightarrow{\it term}$: -this tactic has no effect in the program; but it creates a side-effect -by Lucas-Interpretation (see below) and writes {\it term} to the -Worksheet. - -\item[Subproblem:] ${\it theory} * {\it specification} * {\it -method}\Rightarrow{\it argument}\;{\it list}\Rightarrow{\it term}$: -this tactic is a generalisation of a function call: it takes an -\textit{argument list} as usual, and additionally a triple consisting -of an Isabelle \textit{theory}, an implicit \textit{specification} of the -program and a \textit{method} containing data for Lucas-Interpretation, -last not least a program (as an explicit specification)~\footnote{In -interactive tutoring these three items can be determined explicitly -by the user.}. -\end{description} -The tactics play a specific role in -Lucas-Interpretation~\cite{wn:lucas-interp-12}: they are treated as -break-points where, as a side-effect, a line is added to a calculation -as a protocol for proceeding towards a solution in step-wise problem -solving. At the same points Lucas-Interpretation serves interactive -tutoring and hands over control to the user. The user is free to -investigate underlying knowledge, applicable theorems, etc. And the -user can proceed constructing a solution by input of a tactic to be -applied or by input of a formula; in the latter case the -Lucas-Interpreter has built up a logical context (initialised with the -precondition of the formal specification) such that Isabelle can -derive the formula from this context --- or give feedback, that no -derivation can be found. - -\subsection{Tactics as Control Flow Statements} -The flow of control in a program can be determined by {\tt if then else} -and {\tt case of} as mentioned on p.\pageref{isabelle-stmts} and also -by additional tactics: -\begin{description} -\item[Repeat:] ${\it tactic}\Rightarrow{\it term}\Rightarrow{\it -term}$: iterates over tactics which take a {\it term} as argument as -long as a tactic is applicable (for instance, {\tt Rewrite\_Set} might -not be applicable). - -\item[Try:] ${\it tactic}\Rightarrow{\it term}\Rightarrow{\it term}$: -if {\it tactic} is applicable, then it is applied to {\it term}, -otherwise {\it term} is passed on without changes. - -\item[Or:] ${\it tactic}\Rightarrow{\it tactic}\Rightarrow{\it -term}\Rightarrow{\it term}$: If the first {\it tactic} is applicable, -it is applied to the first {\it term} yielding another {\it term}, -otherwise the second {\it tactic} is applied; if none is applicable an -exception is raised. - -\item[@@:] ${\it tactic}\Rightarrow{\it tactic}\Rightarrow{\it -term}\Rightarrow{\it term}$: applies the first {\it tactic} to the -first {\it term} yielding an intermediate term (not appearing in the -signature) to which the second {\it tactic} is applied. - -\item[While:] ${\it term::bool}\Rightarrow{\it tactic}\Rightarrow{\it -term}\Rightarrow{\it term}$: if the first {\it term} is true, then the -{\it tactic} is applied to the first {\it term} yielding an -intermediate term (not appearing in the signature); the intermediate -term is added to the environment the first {\it term} is evaluated in -etc. as long as the first {\it term} is true. -\end{description} -The tactics are not treated as break-points by Lucas-Interpretation -and thus do neither contribute to the calculation nor to interaction. - -\section{Concepts and Tasks in TP-based Programming}\label{trial} -%\section{Development of a Program on Trial} - -This section presents all the concepts involved in TP-based -programming and all the tasks to be accomplished by programmers. The -presentation uses the running example from -Fig.\ref{fig-interactive} on p.\pageref{fig-interactive}. - -\subsection{Mechanization of Math --- Domain Engineering}\label{isabisac} - -%WN was Fachleute unter obigem Titel interessiert findet sich -%WN unterhalb des auskommentierten Textes. - -%WN der Text unten spricht Benutzer-Aspekte anund ist nicht speziell -%WN auf Computer-Mathematiker fokussiert. -% \paragraph{As mentioned in the introduction,} a prototype of an -% educational math assistant called -% {{\sisac}}\footnote{{{\sisac}}=\textbf{Isa}belle for -% \textbf{C}alculations, see http://www.ist.tugraz.at/isac/.} bridges -% the gap between (1) introducation and (2) application of mathematics: -% {{\sisac}} is based on Computer Theorem Proving (TP), a technology which -% requires each fact and each action justified by formal logic, so -% {{{\sisac}{}}} makes justifications transparent to students in -% interactive step-wise problem solving. By that way {{\sisac}} already -% can serve both: -% \begin{enumerate} -% \item Introduction of math stuff (in e.g. partial fraction -% decomposition) by stepwise explaining and exercising respective -% symbolic calculations with ``next step guidance (NSG)'' and rigorously -% checking steps freely input by students --- this also in context with -% advanced applications (where the stuff to be taught in higher -% semesters can be skimmed through by NSG), and -% \item Application of math stuff in advanced engineering courses -% (e.g. problems to be solved by inverse Z-transform in a Signal -% Processing Lab) and now without much ado about basic math techniques -% (like partial fraction decomposition): ``next step guidance'' supports -% students in independently (re-)adopting such techniques. -% \end{enumerate} -% Before the question is answers, how {{\sisac}} -% accomplishes this task from a technical point of view, some remarks on -% the state-of-the-art is given, therefor follow up Section~\ref{emas}. -% -% \subsection{Educational Mathematics Assistants (EMAs)}\label{emas} -% -% \paragraph{Educational software in mathematics} is, if at all, based -% on Computer Algebra Systems (CAS, for instance), Dynamic Geometry -% Systems (DGS, for instance \footnote{GeoGebra http://www.geogebra.org} -% \footnote{Cinderella http://www.cinderella.de/}\footnote{GCLC -% http://poincare.matf.bg.ac.rs/~janicic/gclc/}) or spread-sheets. These -% base technologies are used to program math lessons and sometimes even -% exercises. The latter are cumbersome: the steps towards a solution of -% such an interactive exercise need to be provided with feedback, where -% at each step a wide variety of possible input has to be foreseen by -% the programmer - so such interactive exercises either require high -% development efforts or the exercises constrain possible inputs. -% -% \subparagraph{A new generation} of educational math assistants (EMAs) -% is emerging presently, which is based on Theorem Proving (TP). TP, for -% instance Isabelle and Coq, is a technology which requires each fact -% and each action justified by formal logic. Pushed by demands for -% \textit{proven} correctness of safety-critical software TP advances -% into software engineering; from these advancements computer -% mathematics benefits in general, and math education in particular. Two -% features of TP are immediately beneficial for learning: -% -% \paragraph{TP have knowledge in human readable format,} that is in -% standard predicate calculus. TP following the LCF-tradition have that -% knowledge down to the basic definitions of set, equality, -% etc~\footnote{http://isabelle.in.tum.de/dist/library/HOL/HOL.html}; -% following the typical deductive development of math, natural numbers -% are defined and their properties -% proven~\footnote{http://isabelle.in.tum.de/dist/library/HOL/Number\_Theory/Primes.html}, -% etc. Present knowledge mechanized in TP exceeds high-school -% mathematics by far, however by knowledge required in software -% technology, and not in other engineering sciences. -% -% \paragraph{TP can model the whole problem solving process} in -% mathematical problem solving {\em within} a coherent logical -% framework. This is already being done by three projects, by -% Ralph-Johan Back, by ActiveMath and by Carnegie Mellon Tutor. -% \par -% Having the whole problem solving process within a logical coherent -% system, such a design guarantees correctness of intermediate steps and -% of the result (which seems essential for math software); and the -% second advantage is that TP provides a wealth of theories which can be -% exploited for mechanizing other features essential for educational -% software. -% -% \subsubsection{Generation of User Guidance in EMAs}\label{user-guid} -% -% One essential feature for educational software is feedback to user -% input and assistance in coming to a solution. -% -% \paragraph{Checking user input} by ATP during stepwise problem solving -% is being accomplished by the three projects mentioned above -% exclusively. They model the whole problem solving process as mentioned -% above, so all what happens between formalized assumptions (or formal -% specification) and goal (or fulfilled postcondition) can be -% mechanized. Such mechanization promises to greatly extend the scope of -% educational software in stepwise problem solving. -% -% \paragraph{NSG (Next step guidance)} comprises the system's ability to -% propose a next step; this is a challenge for TP: either a radical -% restriction of the search space by restriction to very specific -% problem classes is required, or much care and effort is required in -% designing possible variants in the process of problem solving -% \cite{proof-strategies-11}. -% \par -% Another approach is restricted to problem solving in engineering -% domains, where a problem is specified by input, precondition, output -% and postcondition, and where the postcondition is proven by ATP behind -% the scenes: Here the possible variants in the process of problem -% solving are provided with feedback {\em automatically}, if the problem -% is described in a TP-based programing language: \cite{plmms10} the -% programmer only describes the math algorithm without caring about -% interaction (the respective program is functional and even has no -% input or output statements!); interaction is generated as a -% side-effect by the interpreter --- an efficient separation of concern -% between math programmers and dialog designers promising application -% all over engineering disciplines. -% -% -% \subsubsection{Math Authoring in Isabelle/ISAC\label{math-auth}} -% Authoring new mathematics knowledge in {{\sisac}} can be compared with -% ``application programing'' of engineering problems; most of such -% programing uses CAS-based programing languages (CAS = Computer Algebra -% Systems; e.g. Mathematica's or Maple's programing language). -% -% \paragraph{A novel type of TP-based language} is used by {{\sisac}{}} -% \cite{plmms10} for describing how to construct a solution to an -% engineering problem and for calling equation solvers, integration, -% etc~\footnote{Implementation of CAS-like functionality in TP is not -% primarily concerned with efficiency, but with a didactic question: -% What to decide for: for high-brow algorithms at the state-of-the-art -% or for elementary algorithms comprehensible for students?} within TP; -% TP can ensure ``systems that never make a mistake'' \cite{casproto} - -% are impossible for CAS which have no logics underlying. -% -% \subparagraph{Authoring is perfect} by writing such TP based programs; -% the application programmer is not concerned with interaction or with -% user guidance: this is concern of a novel kind of program interpreter -% called Lucas-Interpreter. This interpreter hands over control to a -% dialog component at each step of calculation (like a debugger at -% breakpoints) and calls automated TP to check user input following -% personalized strategies according to a feedback module. -% \par -% However ``application programing with TP'' is not done with writing a -% program: according to the principles of TP, each step must be -% justified. Such justifications are given by theorems. So all steps -% must be related to some theorem, if there is no such theorem it must -% be added to the existing knowledge, which is organized in so-called -% \textbf{theories} in Isabelle. A theorem must be proven; fortunately -% Isabelle comprises a mechanism (called ``axiomatization''), which -% allows to omit proofs. Such a theorem is shown in -% Example~\ref{eg:neuper1}. - -The running example requires to determine the inverse ${\cal Z}$-transform -for a class of functions. The domain of Signal Processing -is accustomed to specific notation for the resulting functions, which -are absolutely capable of being totalled and are called step-response: $u[n]$, where $u$ is the -function, $n$ is the argument and the brackets indicate that the -arguments are discrete. Surprisingly, Isabelle accepts the rules for -$z^{-1}$ in this traditional notation~\footnote{Isabelle -experts might be particularly surprised, that the brackets do not -cause errors in typing (as lists).}: -%\vbox{ -% \begin{example} - \label{eg:neuper1} - {\footnotesize\begin{tabbing} - 123\=123\=123\=123\=\kill - - 01\>axiomatization where \\ - 02\>\> rule1: ``$z^{-1}\;1 = \delta [n]$'' and\\ - 03\>\> rule2: ``$\vert\vert z \vert\vert > 1 \Rightarrow z^{-1}\;z / (z - 1) = u [n]$'' and\\ - 04\>\> rule3: ``$\vert\vert z \vert\vert < 1 \Rightarrow z / (z - 1) = -u [-n - 1]$'' and \\ - 05\>\> rule4: ``$\vert\vert z \vert\vert > \vert\vert$ $\alpha$ $\vert\vert \Rightarrow z / (z - \alpha) = \alpha^n \cdot u [n]$'' and\\ - 06\>\> rule5: ``$\vert\vert z \vert\vert < \vert\vert \alpha \vert\vert \Rightarrow z / (z - \alpha) = -(\alpha^n) \cdot u [-n - 1]$'' and\\ - 07\>\> rule6: ``$\vert\vert z \vert\vert > 1 \Rightarrow z/(z - 1)^2 = n \cdot u [n]$'' - \end{tabbing}} -% \end{example} -%} -These 6 rules can be used as conditional rewrite rules, depending on -the respective convergence radius. Satisfaction from accordance with traditional -notation contrasts with the above word {\em axiomatization}: As TP-based, the -programming language expects these rules as {\em proved} theorems, and -not as axioms implemented in the above brute force manner; otherwise -all the verification efforts envisaged (like proof of the -post-condition, see below) would be meaningless. - -Isabelle provides a large body of knowledge, rigorously proved from -the basic axioms of mathematics~\footnote{This way of rigorously -deriving all knowledge from first principles is called the -LCF-paradigm in TP.}. In the case of the ${\cal Z}$-transform the most advanced -knowledge can be found in the theories on Multivariate -Analysis~\footnote{http://isabelle.in.tum.de/dist/library/HOL/HOL-Multivariate\_Analysis}. However, -building up knowledge such that a proof for the above rules would be -reasonably short and easily comprehensible, still requires lots of -work (and is definitely out of scope of our case study). - -%REMOVED DUE TO SPACE CONSTRAINTS -%At the state-of-the-art in mechanization of knowledge in engineering -%sciences, the process does not stop with the mechanization of -%mathematics traditionally used in these sciences. Rather, ``Formal -%Methods''~\cite{ fm-03} are expected to proceed to formal and explicit -%description of physical items. Signal Processing, for instance is -%concerned with physical devices for signal acquisition and -%reconstruction, which involve measuring a physical signal, storing it, -%and possibly later rebuilding the original signal or an approximation -%thereof. For digital systems, this typically includes sampling and -%quantization; devices for signal compression, including audio -%compression, image compression, and video compression, etc. ``Domain -%engineering''\cite{db:dom-eng} is concerned with {\em specification} -%of these devices' components and features; this part in the process of -%mechanization is only at the beginning in domains like Signal -%Processing. -% -%TP-based programming, concern of this paper, is determined to -%add ``algorithmic knowledge'' to the mechanised body of knowledge. -%% in Fig.\ref{fig:mathuni} on -%% p.\pageref{fig:mathuni}. As we shall see below, TP-based programming -%% starts with a formal {\em specification} of the problem to be solved. -%% \begin{figure} -%% \begin{center} -%% \includegraphics[width=110mm]{../../fig/jrocnik/math-universe-small} -%% \caption{The three-dimensional universe of mathematics knowledge} -%% \label{fig:mathuni} -%% \end{center} -%% \end{figure} -%% The language for both axes is defined in the axis at the bottom, deductive -%% knowledge, in {\sisac} represented by Isabelle's theories. - -\subsection{Preparation of Simplifiers for the Program}\label{simp} - -All evaluation in the prototype's Lucas-Interpreter is done by term rewriting on -Isabelle's terms, see \S\ref{meth} below; in this section some of respective -preparations are described. In order to work reliably with term rewriting, the -respective rule-sets must be confluent and terminating~\cite{nipk:rew-all-that}, -then they are called (canonical) simplifiers. These properties do not go without -saying, their establishment is a difficult task for the programmer; this task is -not yet supported in the prototype. - -The prototype rewrites using theorems only. Axioms which are theorems as well -have been already shown in \S\ref{eg:neuper1} on p.\pageref{eg:neuper1} , we -assemble them in a rule-set and apply them in ML as follows: - -{\footnotesize -\begin{verbatim} - 01 val inverse_z = Rls - 02 {id = "inverse_z", - 03 rew_ord = dummy_ord, - 04 erls = Erls, - 05 rules = [Thm ("rule1", @{thm rule1}), Thm ("rule2", @{thm rule1}), - 06 Thm ("rule3", @{thm rule3}), Thm ("rule4", @{thm rule4}), - 07 Thm ("rule5", @{thm rule5}), Thm ("rule6", @{thm rule6})], - 08 errpatts = [], - 09 scr = ""} -\end{verbatim}} - -\noindent The items, line by line, in the above record have the following purpose: -\begin{description} -\item[01..02] the ML-value \textit{inverse\_z} stores it's identifier -as a string for ``reflection'' when switching between the language -layers of Isabelle/ML (like in the Lucas-Interpreter) and -Isabelle/Isar (like in the example program on p.\pageref{s:impl} on -line {\rm 12}). - -\item[03..04] both, (a) the rewrite-order~\cite{nipk:rew-all-that} -\textit{rew\_ord} and (b) the rule-set \textit{erls} are trivial here: -(a) the \textit{rules} in {\rm 07..12} don't need ordered rewriting -and (b) the assumptions of the \textit{rules} need not be evaluated -(they just go into the context during rewriting). - -\item[05..07] the \textit{rules} are the axioms from p.\pageref{eg:neuper1}; -also ML-functions (\S\ref{funs}) can come into this list as shown in -\S\ref{flow-prep}; so they are distinguished by type-constructors \textit{Thm} -and \textit{Calc} respectively; for the purpose of reflection both -contain their identifiers. - -\item[08..09] are error-patterns not discussed here and \textit{scr} -is prepared to get a program, automatically generated by {\sisac} for -producing intermediate rewrites when requested by the user. - -\end{description} - -%OUTCOMMENTED DUE TO SPACE RESTRICTIONS -% \noindent It is advisable to immediately test rule-sets; for that -% purpose an appropriate term has to be created; \textit{parse} takes a -% context \textit{ctxt} and a string (with \textit{ZZ\_1} denoting ${\cal -% Z}^{-1}$) and creates a term: -% -% {\footnotesize -% \begin{verbatim} -% 01 ML {* -% 02 val t = parse ctxt "ZZ_1 (z / (z - 1) + z / (z - ) + 1)"; -% 03 *} -% 04 val t = Const ("Build_Inverse_Z_Transform.ZZ_1", -% 05 "RealDef.real => RealDef.real => RealDef.real") $ -% 06 (Const (...) $ (Const (...) $ Free (...) $ (Const (...) $ Free (...) -% \end{verbatim}} -% -% \noindent The internal representation of the term, as required for -% rewriting, consists of \textit{Const}ants, a pair of a string -% \textit{"Groups.plus\_class.plus"} for $+$ and a type, variables -% \textit{Free} and the respective constructor \textit{\$}. Now the -% term can be rewritten by the rule-set \textit{inverse\_z}: -% -% {\footnotesize -% \begin{verbatim} -% 01 ML {* -% 02 val SOME (t', asm) = rewrite_set_ @{theory} inverse\_z t; -% 03 term2str t'; -% 04 terms2str asm; -% 05 *} -% 06 val it = "u[n] + ^ n * u[n] + [n]" : string -% 07 val it = "|| z || > 1 & || z || > " : string -% \end{verbatim}} -% -% \noindent The resulting term \textit{t} and the assumptions -% \textit{asm} are converted to readable strings by \textit{term2str} -% and \textit{terms2str}. - -\subsection{Preparation of ML-Functions}\label{funs} -Some functionality required in programming, cannot be accomplished by -rewriting. So the prototype has a mechanism to call functions within -the rewrite-engine: certain redexes in Isabelle terms call these -functions written in SML~\cite{pl:milner97}, the implementation {\em -and} meta-language of Isabelle. The programmer has to use this -mechanism. - -In the running example's program on p.\pageref{s:impl} the lines {\rm -05} and {\rm 06} contain such functions; we go into the details with -\textit{argument\_in X\_z;}. This function fetches the argument from a -function application: Line {\rm 03} in the example calculation on -p.\pageref{exp-calc} is created by line {\rm 06} of the example -program on p.\pageref{s:impl} where the program's environment assigns -the value \textit{X z} to the variable \textit{X\_z}; so the function -shall extract the argument \textit{z}. - -\medskip In order to be recognised as a function constant in the -program source the constant needs to be declared in a theory, here in -\textit{Build\_Inverse\_Z\_Transform.thy}; then it can be parsed in -the context \textit{ctxt} of that theory: - -{\footnotesize -\begin{verbatim} -01 consts -02 argument'_in :: "real => real" ("argument'_in _" 10) -\end{verbatim}} - -%^3.2^ ML {* val SOME t = parse ctxt "argument_in (X z)"; *} -%^3.2^ val t = Const ("Build_Inverse_Z_Transform.argument'_in", "RealDef.real ⇒ RealDef.real") -%^3.2^ $ (Free ("X", "RealDef.real ⇒ RealDef.real") $ Free ("z", "RealDef.real")): term -%^3.2^ \end{verbatim}} -%^3.2^ -%^3.2^ \noindent Parsing produces a term \texttt{t} in internal -%^3.2^ representation~\footnote{The attentive reader realizes the -%^3.2^ differences between interal and extermal representation even in the -%^3.2^ strings, i.e \texttt{'\_}}, consisting of \texttt{Const -%^3.2^ ("argument'\_in", type)} and the two variables \texttt{Free ("X", -%^3.2^ type)} and \texttt{Free ("z", type)}, \texttt{\$} is the term -%^3.2^ constructor. -The function body below is implemented directly in SML, -i.e in an \texttt{ML \{* *\}} block; the function definition provides -a unique prefix \texttt{eval\_} to the function name: - -{\footnotesize -\begin{verbatim} -01 ML {* -02 fun eval_argument_in _ -03 "Build_Inverse_Z_Transform.argument'_in" -04 (t as (Const ("Build_Inverse_Z_Transform.argument'_in", _) $(f $arg))) _ = -05 if is_Free arg (*could be something to be simplified before*) -06 then SOME (term2str t ^"="^ term2str arg, Trueprop $(mk_equality (t, arg))) -07 else NONE -08 | eval_argument_in _ _ _ _ = NONE; -09 *} -\end{verbatim}} - -\noindent The function body creates either \texttt{NONE} -telling the rewrite-engine to search for the next redex, or creates an -ad-hoc theorem for rewriting, thus the programmer needs to adopt many -technicalities of Isabelle, for instance, the \textit{Trueprop} -constant. - -\bigskip This sub-task particularly sheds light on basic issues in the -design of a programming language, the integration of differential language -layers, the layer of Isabelle/Isar and Isabelle/ML. - -Another point of improvement for the prototype is the rewrite-engine: The -program on p.\pageref{s:impl} would not allow to contract the two lines {\rm 05} -and {\rm 06} to - -{\small\it\label{s:impl} -\begin{tabbing} -123l\=123\=123\=123\=123\=123\=123\=((x\=123\=(x \=123\=123\=\kill -\>{\rm 05/06}\>\>\> (z::real) = argument\_in (lhs X\_eq) ; -\end{tabbing}} - -\noindent because nested function calls would require creating redexes -inside-out; however, the prototype's rewrite-engine only works top down -from the root of a term down to the leaves. - -How all these technicalities are to be checked in the prototype is -shown in \S\ref{flow-prep} below. - -% \paragraph{Explicit Problems} require explicit methods to solve them, and within -% this methods we have some explicit steps to do. This steps can be unique for -% a special problem or refindable in other problems. No mather what case, such -% steps often require some technical functions behind. For the solving process -% of the Inverse Z Transformation and the corresponding partial fraction it was -% neccessary to build helping functions like \texttt{get\_denominator}, -% \texttt{get\_numerator} or \texttt{argument\_in}. First two functions help us -% to filter the denominator or numerator out of a fraction, last one helps us to -% get to know the bound variable in a equation. -% \par -% By taking \texttt{get\_denominator} as an example, we want to explain how to -% implement new functions into the existing system and how we can later use them -% in our program. -% -% \subsubsection{Find a place to Store the Function} -% -% The whole system builds up on a well defined structure of Knowledge. This -% Knowledge sets up at the Path: -% \begin{center}\ttfamily src/Tools/isac/Knowledge\normalfont\end{center} -% For implementing the Function \texttt{get\_denominator} (which let us extract -% the denominator out of a fraction) we have choosen the Theory (file) -% \texttt{Rational.thy}. -% -% \subsubsection{Write down the new Function} -% -% In upper Theory we now define the new function and its purpose: -% \begin{verbatim} -% get_denominator :: "real => real" -% \end{verbatim} -% This command tells the machine that a function with the name -% \texttt{get\_denominator} exists which gets a real expression as argument and -% returns once again a real expression. Now we are able to implement the function -% itself, upcoming example now shows the implementation of -% \texttt{get\_denominator}. -% -% %\begin{example} -% \label{eg:getdenom} -% \begin{verbatim} -% -% 01 (* -% 02 *("get_denominator", -% 03 * ("Rational.get_denominator", eval_get_denominator "")) -% 04 *) -% 05 fun eval_get_denominator (thmid:string) _ -% 06 (t as Const ("Rational.get_denominator", _) $ -% 07 (Const ("Rings.inverse_class.divide", _) $num -% 08 $denom)) thy = -% 09 SOME (mk_thmid thmid "" -% 10 (Print_Mode.setmp [] -% 11 (Syntax.string_of_term (thy2ctxt thy)) denom) "", -% 12 Trueprop $ (mk_equality (t, denom))) -% 13 | eval_get_denominator _ _ _ _ = NONE;\end{verbatim} -% %\end{example} -% -% Line \texttt{07} and \texttt{08} are describing the mode of operation the best - -% there is a fraction\\ (\ttfamily Rings.inverse\_class.divide\normalfont) -% splittet -% into its two parts (\texttt{\$num \$denom}). The lines before are additionals -% commands for declaring the function and the lines after are modeling and -% returning a real variable out of \texttt{\$denom}. -% -% \subsubsection{Add a test for the new Function} -% -% \paragraph{Everytime when adding} a new function it is essential also to add -% a test for it. Tests for all functions are sorted in the same structure as the -% knowledge it self and can be found up from the path: -% \begin{center}\ttfamily test/Tools/isac/Knowledge\normalfont\end{center} -% This tests are nothing very special, as a first prototype the functionallity -% of a function can be checked by evaluating the result of a simple expression -% passed to the function. Example~\ref{eg:getdenomtest} shows the test for our -% \textit{just} created function \texttt{get\_denominator}. -% -% %\begin{example} -% \label{eg:getdenomtest} -% \begin{verbatim} -% -% 01 val thy = @{theory Isac}; -% 02 val t = term_of (the (parse thy "get_denominator ((a +x)/b)")); -% 03 val SOME (_, t') = eval_get_denominator "" 0 t thy; -% 04 if term2str t' = "get_denominator ((a + x) / b) = b" then () -% 05 else error "get_denominator ((a + x) / b) = b" \end{verbatim} -% %\end{example} -% -% \begin{description} -% \item[01] checks if the proofer set up on our {\sisac{}} System. -% \item[02] passes a simple expression (fraction) to our suddenly created -% function. -% \item[04] checks if the resulting variable is the correct one (in this case -% ``b'' the denominator) and returns. -% \item[05] handels the error case and reports that the function is not able to -% solve the given problem. -% \end{description} - -\subsection{Specification of the Problem}\label{spec} -%WN <--> \chapter 7 der Thesis -%WN die Argumentation unten sollte sich NUR auf Verifikation beziehen.. - -Mechanical treatment requires to translate a textual problem -description like in Fig.\ref{fig-interactive} on -p.\pageref{fig-interactive} into a {\em formal} specification. The -formal specification of the running example could look like is this -~\footnote{The ``TODO'' in the postcondition indicates, that postconditions -are not yet handled in the prototype; in particular, the postcondition, i.e. -the correctness of the result is not yet automatically proved.}: - -%WN Hier brauchen wir die Spezifikation des 'running example' ... -%JR Habe input, output und precond vom Beispiel eingefügt brauche aber Hilfe bei -%JR der post condition - die existiert für uns ja eigentlich nicht aka -%JR haben sie bis jetzt nicht beachtet WN... -%WN2 Mein Vorschlag ist, das TODO zu lassen und deutlich zu kommentieren. -%JR2 done - -\label{eg:neuper2} -{\small\begin{tabbing} - 123\=123\=postcond \=: \= $\forall \,A^\prime\, u^\prime \,v^\prime.\,$\=\kill - %\hfill \\ - \>Specification:\\ - \> \>input \>: ${\it filterExpression} \;\;X\;z=\frac{3}{z-\frac{1}{4}+-\frac{1}{8}*\frac{1}{z}}, \;{\it domain}\;\mathbb{R}-\{\frac{1}{2}, \frac{-1}{4}\}$\\ - \>\>precond \>: $\frac{3}{z-\frac{1}{4}+-\frac{1}{8}*\frac{1}{z}}\;\; {\it continuous\_on}\; \mathbb{R}-\{\frac{1}{2}, \frac{-1}{4}\}$ \\ - \>\>output \>: stepResponse $x[n]$ \\ - \>\>postcond \>: TODO -\end{tabbing}} - -%JR wie besprochen, kein remark, keine begründung, nur simples "nicht behandelt" - -% \begin{remark} -% Defining the postcondition requires a high amount mathematical -% knowledge, the difficult part in our case is not to set up this condition -% nor it is more to define it in a way the interpreter is able to handle it. -% Due the fact that implementing that mechanisms is quite the same amount as -% creating the programm itself, it is not avaible in our prototype. -% \label{rm:postcond} -% \end{remark} - -The implementation of the formal specification in the present -prototype, still bar-bones without support for authoring, is done -like that: -%WN Kopie von Inverse_Z_Transform.thy, leicht versch"onert: - -{\footnotesize\label{exp-spec} -\begin{verbatim} - 00 ML {* - 01 store_specification - 02 (prepare_specification - 03 "pbl_SP_Ztrans_inv" - 04 ["Jan Rocnik"] - 05 thy - 06 ( ["Inverse", "Z_Transform", "SignalProcessing"], - 07 [ ("#Given", ["filterExpression X_eq", "domain D"]), - 08 ("#Pre" , ["(rhs X_eq) is_continuous_in D"]), - 09 ("#Find" , ["stepResponse n_eq"]), - 10 ("#Post" , [" TODO "])]) - 11 prls - 12 NONE - 13 [["SignalProcessing","Z_Transform","Inverse"]]); - 14 *} -\end{verbatim}} - -Although the above details are partly very technical, we explain them -in order to document some intricacies of TP-based programming in the -present state of the {\sisac} prototype: -\begin{description} -\item[01..02]\textit{store\_specification:} stores the result of the -function \textit{prep\_specification} in a global reference -\textit{Unsynchronized.ref}, which causes principal conflicts with -Isabelle's asynchronous document model~\cite{Wenzel-11:doc-orient} and -parallel execution~\cite{Makarius-09:parall-proof} and is under -reconstruction already. - -\textit{prep\_specification:} translates the specification to an internal format -which allows efficient processing; see for instance line {\rm 07} -below. -\item[03..04] are a unique identifier for the specification within {\sisac} -and the ``mathematics author'' holding the copy-rights. -\item[05] is the Isabelle \textit{theory} required to parse the -specification in lines {\rm 07..10}. -\item[06] is a key into the tree of all specifications as presented to -the user (where some branches might be hidden by the dialogue -component). -\item[07..10] are the specification with input, pre-condition, output -and post-condition respectively; note that the specification contains -variables to be instantiated with concrete values for a concrete problem --- -thus the specification actually captures a class of problems. The post-condition is not handled in -the prototype presently. -\item[11] is a rule-set (defined elsewhere) for evaluation of the pre-condition: \textit{(rhs X\_eq) is\_continuous\_in D}, instantiated with the values of a concrete problem, evaluates to true or false --- and all evaluation is done by -rewriting determined by rule-sets. -\item[12]\textit{NONE:} could be \textit{SOME ``solve ...''} for a -problem associated to a function from Computer Algebra (like an -equation solver) which is not the case here. -\item[13] is a list of methods solving the specified problem (here -only one list item) represented analogously to {\rm 06}. -\end{description} - - -%WN die folgenden Erkl"arungen finden sich durch "grep -r 'datatype pbt' *" -%WN ... -% type pbt = -% {guh : guh, (*unique within this isac-knowledge*) -% mathauthors: string list, (*copyright*) -% init : pblID, (*to start refinement with*) -% thy : theory, (* which allows to compile that pbt -% TODO: search generalized for subthy (ref.p.69*) -% (*^^^ WN050912 NOT used during application of the problem, -% because applied terms may be from 'subthy' as well as from super; -% thus we take 'maxthy'; see match_ags !*) -% cas : term option,(*'CAS-command'*) -% prls : rls, (* for preds in where_*) -% where_: term list, (* where - predicates*) -% ppc : pat list, -% (*this is the model-pattern; -% it contains "#Given","#Where","#Find","#Relate"-patterns -% for constraints on identifiers see "fun cpy_nam"*) -% met : metID list}; (* methods solving the pbt*) -% -%WN weil dieser Code sehr unaufger"aumt ist, habe ich die Erkl"arungen -%WN oben selbst geschrieben. - - - - -%WN das w"urde ich in \sec\label{progr} verschieben und -%WN das SubProblem partial fractions zum Erkl"aren verwenden. -% Such a specification is checked before the execution of a program is -% started, the same applies for sub-programs. In the following example -% (Example~\ref{eg:subprob}) shows the call of such a subproblem: -% -% \vbox{ -% \begin{example} -% \label{eg:subprob} -% \hfill \\ -% {\ttfamily \begin{tabbing} -% ``(L\_L::bool list) = (\=SubProblem (\=Test','' \\ -% ``\>\>[linear,univariate,equation,test],'' \\ -% ``\>\>[Test,solve\_linear])'' \\ -% ``\>[BOOL equ, REAL z])'' \\ -% \end{tabbing} -% } -% {\small\textit{ -% \noindent If a program requires a result which has to be -% calculated first we can use a subproblem to do so. In our specific -% case we wanted to calculate the zeros of a fraction and used a -% subproblem to calculate the zeros of the denominator polynom. -% }} -% \end{example} -% } - -\subsection{Implementation of the Method}\label{meth} -A method collects all data required to interpret a certain program by -Lucas-Interpretation. The \texttt{program} from p.\pageref{s:impl} of -the running example is embedded on the last line in the following method: -%The methods represent the different ways a problem can be solved. This can -%include mathematical tactics as well as tactics taught in different courses. -%Declaring the Method itself gives us the possibilities to describe the way of -%calculation in deep, as well we get the oppertunities to build in different -%rulesets. - -{\footnotesize -\begin{verbatim} - 00 ML {* - 01 store_method - 02 (prep_method - 03 "SP_InverseZTransformation_classic" - 04 ["Jan Rocnik"] - 05 thy - 06 ( ["SignalProcessing", "Z_Transform", "Inverse"], - 07 [ ("#Given", ["filterExpression X_eq", "domain D"]), - 08 ("#Pre" , ["(rhs X_eq) is_continuous_in D"]), - 09 ("#Find" , ["stepResponse n_eq"]), - 10 rew_ord erls - 11 srls prls nrls - 12 errpats - 13 program); - 14 *} -\end{verbatim}} - -\noindent The above code stores the whole structure analogously to a -specification as described above: -\begin{description} -\item[01..06] are identical to those for the example specification on -p.\pageref{exp-spec}. - -\item[07..09] show something looking like the specification; this is a -{\em guard}: as long as not all \textit{Given} items are present and -the \textit{Pre}-conditions is not true, interpretation of the program -is not started. - -\item[10..11] all concern rewriting (the respective data are defined elsewhere): \textit{rew\_ord} is the rewrite order~\cite{nipk:rew-all-that} in case -\textit{program} contains a \textit{Rewrite} tactic; and in case the respective rule is a conditional rewrite-rule, \textit{erls} features evaluating the conditions. The rule-sets -\textit{srls, prls, nrls} feature evaluating (a) the ML-functions in the program (e.g. -\textit{lhs, argument\_in, rhs} in the program on p.\pageref{s:impl}, (b) the pre-condition analogous to the specification in line 11 on p.\pageref{exp-spec} -and (c) is required for the derivation-machinery checking user-input formulas. - -\item[12..13] \textit{errpats} are error-patterns~\cite{gdaroczy-EP-13} for this method and \textit{program} is the variable holding the example from p.\pageref {s:impl}. -\end{description} -The many rule-sets above cause considerable efforts for the -programmers, in particular, because there are no tools for checking -essential features of rule-sets. - -% is again very technical and goes hard in detail. Unfortunataly -% most declerations are not essential for a basic programm but leads us to a huge -% range of powerful possibilities. -% -% \begin{description} -% \item[01..02] stores the method with the given name into the system under a global -% reference. -% \item[03] specifies the topic within which context the method can be found. -% \item[04..05] as the requirements for different methods can be deviant we -% declare what is \emph{given} and and what to \emph{find} for this specific method. -% The code again helds on the topic of the case studie, where the inverse -% z-transformation does a switch between a term describing a electrical filter into -% its step response. Also the datatype has to be declared (bool - due the fact that -% we handle equations). -% \item[06] \emph{rewrite order} is the order of this rls (ruleset), where one -% theorem of it is used for rewriting one single step. -% \item[07] \texttt{rls} is the currently used ruleset for this method. This set -% has already been defined before. -% \item[08] we would have the possiblitiy to add this method to a predefined tree of -% calculations, i.eg. if it would be a sub of a bigger problem, here we leave it -% independend. -% \item[09] The \emph{source ruleset}, can be used to evaluate list expressions in -% the source. -% \item[10] \emph{predicates ruleset} can be used to indicates predicates within -% model patterns. -% \item[11] The \emph{check ruleset} summarizes rules for checking formulas -% elementwise. -% \item[12] \emph{error patterns} which are expected in this kind of method can be -% pre-specified to recognize them during the method. -% \item[13] finally the \emph{canonical ruleset}, declares the canonical simplifier -% of the specific method. -% \item[14] for this code snipset we don't specify the programm itself and keep it -% empty. Follow up \S\ref{progr} for informations on how to implement this -% \textit{main} part. -% \end{description} - -\subsection{Implementation of the TP-based Program}\label{progr} -So finally all the prerequisites are described and the final task can -be addressed. The program below comes back to the running example: it -computes a solution for the problem from Fig.\ref{fig-interactive} on -p.\pageref{fig-interactive}. The reader is reminded of -\S\ref{PL-isab}, the introduction of the programming language: - -{\footnotesize\it\label{s:impl} -\begin{tabbing} -123l\=123\=123\=123\=123\=123\=123\=((x\=123\=(x \=123\=123\=\kill -\>{\rm 00}\>ML \{*\\ -\>{\rm 00}\>val program =\\ -\>{\rm 01}\> "{\tt Program} InverseZTransform (X\_eq::bool) = \\ -\>{\rm 02}\>\> {\tt let} \\ -\>{\rm 03}\>\>\> X\_eq = {\tt Take} X\_eq ; \\ -\>{\rm 04}\>\>\> X\_eq = {\tt Rewrite} prep\_for\_part\_frac X\_eq ; \\ -\>{\rm 05}\>\>\> (X\_z::real) = lhs X\_eq ; \\ %no inside-out evaluation -\>{\rm 06}\>\>\> (z::real) = argument\_in X\_z; \\ -\>{\rm 07}\>\>\> (part\_frac::real) = {\tt SubProblem} \\ -\>{\rm 08}\>\>\>\>\>\>\>\> ( Isac, [partial\_fraction, rational, simplification], [] )\\ -%\>{\rm 10}\>\>\>\>\>\>\>\>\> [simplification, of\_rationals, to\_partial\_fraction] ) \\ -\>{\rm 09}\>\>\>\>\>\>\>\> [ (rhs X\_eq)::real, z::real ]; \\ -\>{\rm 10}\>\>\> (X'\_eq::bool) = {\tt Take} ((X'::real =$>$ bool) z = ZZ\_1 part\_frac) ; \\ -\>{\rm 11}\>\>\> X'\_eq = (({\tt Rewrite\_Set} prep\_for\_inverse\_z) @@ \\ -\>{\rm 12}\>\>\>\>\> $\;\;$ ({\tt Rewrite\_Set} inverse\_z)) X'\_eq \\ -\>{\rm 13}\>\> {\tt in } \\ -\>{\rm 14}\>\>\> X'\_eq"\\ -\>{\rm 15}\>*\} -\end{tabbing}} -% ORIGINAL FROM Inverse_Z_Transform.thy -% "Script InverseZTransform (X_eq::bool) = "^(*([], Frm), Problem (Isac, [Inverse, Z_Transform, SignalProcessing])*) -% "(let X = Take X_eq; "^(*([1], Frm), X z = 3 / (z - 1 / 4 + -1 / 8 * (1 / z))*) -% " X' = Rewrite ruleZY False X; "^(*([1], Res), ?X' z = 3 / (z * (z - 1 / 4 + -1 / 8 * (1 / z)))*) -% " (X'_z::real) = lhs X'; "^(* ?X' z*) -% " (zzz::real) = argument_in X'_z; "^(* z *) -% " (funterm::real) = rhs X'; "^(* 3 / (z * (z - 1 / 4 + -1 / 8 * (1 / z)))*) -% -% " (pbz::real) = (SubProblem (Isac', "^(**) -% " [partial_fraction,rational,simplification], "^ -% " [simplification,of_rationals,to_partial_fraction]) "^ -% " [REAL funterm, REAL zzz]); "^(*([2], Res), 4 / (z - 1 / 2) + -4 / (z - -1 / 4)*) -% -% " (pbz_eq::bool) = Take (X'_z = pbz); "^(*([3], Frm), ?X' z = 4 / (z - 1 / 2) + -4 / (z - -1 / 4)*) -% " pbz_eq = Rewrite ruleYZ False pbz_eq; "^(*([3], Res), ?X' z = 4 * (?z / (z - 1 / 2)) + -4 * (?z / (z - -1 / 4))*) -% " pbz_eq = drop_questionmarks pbz_eq; "^(* 4 * (z / (z - 1 / 2)) + -4 * (z / (z - -1 / 4))*) -% " (X_zeq::bool) = Take (X_z = rhs pbz_eq); "^(*([4], Frm), X_z = 4 * (z / (z - 1 / 2)) + -4 * (z / (z - -1 / 4))*) -% " n_eq = (Rewrite_Set inverse_z False) X_zeq; "^(*([4], Res), X_z = 4 * (1 / 2) ^^^ ?n * ?u [?n] + -4 * (-1 / 4) ^^^ ?n * ?u [?n]*) -% " n_eq = drop_questionmarks n_eq "^(* X_z = 4 * (1 / 2) ^^^ n * u [n] + -4 * (-1 / 4) ^^^ n * u [n]*) -% "in n_eq)" (*([], Res), X_z = 4 * (1 / 2) ^^^ n * u [n] + -4 * (-1 / 4) ^^^ n * u [n]*) -The program is represented as a string and part of the method in -\S\ref{meth}. As mentioned in \S\ref{PL} the program is purely -functional and lacks any input statements and output statements. So -the steps of calculation towards a solution (and interactive tutoring -in step-wise problem solving) are created as a side-effect by -Lucas-Interpretation. The side-effects are triggered by the tactics -\texttt{Take}, \texttt{Rewrite}, \texttt{SubProblem} and -\texttt{Rewrite\_Set} in the above lines {\rm 03, 04, 07, 10, 11} and -{\rm 12} respectively. These tactics produce the respective lines in the -calculation on p.\pageref{flow-impl}. - -The above lines {\rm 05, 06} do not contain a tactics, so they do not -immediately contribute to the calculation on p.\pageref{flow-impl}; -rather, they compute actual arguments for the \texttt{SubProblem} in -line {\rm 09}~\footnote{The tactics also are break-points for the -interpreter, where control is handed over to the user in interactive -tutoring.}. Line {\rm 11} contains tactical \textit{@@}. - -\medskip The above program also indicates the dominant role of interactive -selection of knowledge in the three-dimensional universe of -mathematics. The \texttt{SubProblem} in the above lines -{\rm 07..09} is more than a function call with the actual arguments -\textit{[ (rhs X\_eq)::real, z::real ]}. The programmer has to determine -three items: - -\begin{enumerate} -\item the theory, in the example \textit{Isac} because different -methods can be selected in Pt.3 below, which are defined in different -theories with \textit{Isac} collecting them. -\item the specification identified by \textit{[partial\_fraction, -rational, simplification]} in the tree of specifications; this -specification is analogous to the specification of the main program -described in \S\ref{spec}; the problem is to find a ``partial fraction -decomposition'' for a univariate rational polynomial. -\item the method in the above example is \textit{[ ]}, i.e. empty, -which supposes the interpreter to select one of the methods predefined -in the specification, for instance in line {\rm 13} in the running -example's specification on p.\pageref{exp-spec}~\footnote{The freedom -(or obligation) for selection carries over to the student in -interactive tutoring.}. -\end{enumerate} - -The program code, above presented as a string, is parsed by Isabelle's -parser --- the program is an Isabelle term. This fact is expected to -simplify verification tasks in the future; on the other hand, this -fact causes troubles in error detection which are discussed as part -of the work-flow in the subsequent section. - -\section{Work-flow of Programming in the Prototype}\label{workflow} -The new prover IDE Isabelle/jEdit~\cite{makar-jedit-12} is a great -step forward for interactive theory and proof development. The -{\sisac}-prototype re-uses this IDE as a programming environment. The -experiences from this re-use show, that the essential components are -available from Isabelle/jEdit. However, additional tools and features -are required to achieve acceptable usability. - -So notable experiences are reported here, also as a requirement -capture for further development of TP-based languages and respective -IDEs. - -\subsection{Preparations and Trials}\label{flow-prep} -The many sub-tasks to be accomplished {\em before} the first line of -program code can be written and tested suggest an approach which -step-wise establishes the prerequisites. The case study underlying -this paper~\cite{jrocnik-bakk} documents the approach in a separate -Isabelle theory, -\textit{Build\_Inverse\_Z\_Transform.thy}~\footnote{http://www.ist.tugraz.at/projects/isac/publ/Build\_Inverse\_Z\_Transform.thy}. Part -II in the study comprises this theory, \LaTeX ed from the theory by -use of Isabelle's document preparation system. This paper resembles -the approach in \S\ref{isabisac} to \S\ref{meth}, which in actual -implementation work involves several iterations. - -\bigskip For instance, only the last step, implementing the program -described in \S\ref{meth}, reveals details required. Let us assume, -this is the ML-function \textit{argument\_in} required in line {\rm 06} -of the example program on p.\pageref{s:impl}; how this function needs -to be implemented in the prototype has been discussed in \S\ref{funs} -already. - -Now let us assume, that calling this function from the program code -does not work; so testing this function is required in order to find out -the reason: type errors, a missing entry of the function somewhere or -even more nasty technicalities \dots - -{\footnotesize -\begin{verbatim} -01 ML {* -02 val SOME t = parseNEW ctxt "argument_in (X (z::real))"; -03 val SOME (str, t') = eval_argument_in "" -04 "Build_Inverse_Z_Transform.argument'_in" t 0; -05 term2str t'; -06 *} -07 val it = "(argument_in X z) = z": string\end{verbatim}} - -\noindent So, this works: we get an ad-hoc theorem, which used in -rewriting would reduce \texttt{argument\_in X z} to \texttt{z}. Now we check this -reduction and create a rule-set \texttt{rls} for that purpose: - -{\footnotesize -\begin{verbatim} -01 ML {* -02 val rls = append_rls "test" e_rls -03 [Calc ("Build_Inverse_Z_Transform.argument'_in", eval_argument_in "")] -04 val SOME (t', asm) = rewrite_set_ @{theory} rls t; -05 *} -06 val t' = Free ("z", "RealDef.real"): term -07 val asm = []: term list\end{verbatim}} - -\noindent The resulting term \texttt{t'} is \texttt{Free ("z", -"RealDef.real")}, i.e the variable \texttt{z}, so all is -perfect. Probably we have forgotten to store this function correctly~? -We review the respective \texttt{calclist} (again an -\textit{Unsynchronized.ref} to be removed in order to adjust to -Isabelle/Isar's asynchronous document model): - -{\footnotesize -\begin{verbatim} -01 calclist:= overwritel (! calclist, -02 [("argument_in", -03 ("Build_Inverse_Z_Transform.argument'_in", eval_argument_in "")), -04 ... -05 ]);\end{verbatim}} - -\noindent The entry is perfect. So what is the reason~? Ah, probably there -is something messed up with the many rule-sets in the method, see \S\ref{meth} --- -right, the function \texttt{argument\_in} is not contained in the respective -rule-set \textit{srls} \dots this just as an example of the intricacies in -debugging a program in the present state of the prototype. - -\subsection{Implementation in Isabelle/{\isac}}\label{flow-impl} -Given all the prerequisites from \S\ref{isabisac} to \S\ref{meth}, -usually developed within several iterations, the program can be -assembled; on p.\pageref{s:impl} there is the complete program of the -running example. - -The completion of this program required efforts for several weeks -(after some months of familiarisation with {\sisac}), caused by the -abundance of intricacies indicated above. Also writing the program is -not pleasant, given Isabelle/Isar/ without add-ons for -programming. Already writing and parsing a few lines of program code -is a challenge: the program is an Isabelle term; Isabelle's parser, -however, is not meant for huge terms like the program of the running -example. So reading out the specific error (usually type errors) from -Isabelle's message is difficult. - -\medskip Testing the evaluation of the program has to rely on very -simple tools. Step-wise execution is modeled by a function -\texttt{me}, short for mathematics-engine~\footnote{The interface used -by the front-end which created the calculation on -p.\pageref{fig-interactive} is different from this function}: -%the following is a simplification of the actual function - -{\footnotesize -\begin{verbatim} -01 ML {* me; *} -02 val it = tac -> ctree * pos -> mout * tac * ctree * pos\end{verbatim}} - -\noindent This function takes as arguments a tactic \texttt{tac} which -determines the next step, the step applied to the interpreter-state -\texttt{ctree * pos} as last argument taken. The interpreter-state is -a pair of a tree \texttt{ctree} representing the calculation created -(see the example below) and a position \texttt{pos} in the -calculation. The function delivers a quadruple, beginning with the new -formula \texttt{mout} and the next tactic followed by the new -interpreter-state. - -This function allows to stepwise check the program: - -{\footnotesize\label{ml-check-program} -\begin{verbatim} -01 ML {* -02 val fmz = -03 ["filterExpression (X z = 3 / ((z::real) + 1/10 - 1/50*(1/z)))", -04 "stepResponse (x[n::real]::bool)"]; -05 val (dI,pI,mI) = -06 ("Isac", -07 ["Inverse", "Z_Transform", "SignalProcessing"], -08 ["SignalProcessing","Z_Transform","Inverse"]); -09 val (mout, tac, ctree, pos) = CalcTreeTEST [(fmz, (dI, pI, mI))]; -10 val (mout, tac, ctree, pos) = me tac (ctree, pos); -11 val (mout, tac, ctree, pos) = me tac (ctree, pos); -12 val (mout, tac, ctree, pos) = me tac (ctree, pos); -13 ... -\end{verbatim}} - -\noindent Several dozens of calls for \texttt{me} are required to -create the lines in the calculation below (including the sub-problems -not shown). When an error occurs, the reason might be located -many steps before: if evaluation by rewriting, as done by the prototype, -fails, then first nothing happens --- the effects come later and -cause unpleasant checks. - -The checks comprise watching the rewrite-engine for many different -kinds of rule-sets (see \S\ref{meth}), the interpreter-state, in -particular the environment and the context at the states position --- -all checks have to rely on simple functions accessing the -\texttt{ctree}. So getting the calculation below (which resembles the -calculation in Fig.\ref{fig-interactive} on p.\pageref{fig-interactive}) -is the result of several weeks of development: - -{\small\it\label{exp-calc} -\begin{tabbing} -123l\=123\=123\=123\=123\=123\=123\=123\=123\=123\=123\=123\=\kill -\>{\rm 01}\> $\bullet$ \> {\tt Problem } (Inverse\_Z\_Transform, [Inverse, Z\_Transform, SignalProcessing]) \`\\ -\>{\rm 02}\>\> $\vdash\;\;X z = \frac{3}{z - \frac{1}{4} - \frac{1}{8} \cdot z^{-1}}$ \`{\footnotesize {\tt Take} X\_eq}\\ -\>{\rm 03}\>\> $X z = \frac{3}{z + \frac{-1}{4} + \frac{-1}{8} \cdot \frac{1}{z}}$ \`{\footnotesize {\tt Rewrite} prep\_for\_part\_frac X\_eq}\\ -\>{\rm 04}\>\> $\bullet$\> {\tt Problem } [partial\_fraction,rational,simplification] \`{\footnotesize {\tt SubProblem} \dots}\\ -\>{\rm 05}\>\>\> $\vdash\;\;\frac{3}{z + \frac{-1}{4} + \frac{-1}{8} \cdot \frac{1}{z}}=$ \`- - -\\ -\>{\rm 06}\>\>\> $\frac{24}{-1 + -2 \cdot z + 8 \cdot z^2}$ \`- - -\\ -\>{\rm 07}\>\>\> $\bullet$\> solve ($-1 + -2 \cdot z + 8 \cdot z^2,\;z$ ) \`- - -\\ -\>{\rm 08}\>\>\>\> $\vdash$ \> $\frac{3}{z + \frac{-1}{4} + \frac{-1}{8} \cdot \frac{1}{z}}=0$ \`- - -\\ -\>{\rm 09}\>\>\>\> $z = \frac{2+\sqrt{-4+8}}{16}\;\lor\;z = \frac{2-\sqrt{-4+8}}{16}$ \`- - -\\ -\>{\rm 10}\>\>\>\> $z = \frac{1}{2}\;\lor\;z =$ \_\_\_ \`- - -\\ -\> \>\>\>\> \_\_\_ \`- - -\\ -\>{\rm 11}\>\> \dots\> $\frac{4}{z - \frac{1}{2}} + \frac{-4}{z - \frac{-1}{4}}$ \`\\ -\>{\rm 12}\>\> $X^\prime z = {\cal z}^{-1} (\frac{4}{z - \frac{1}{2}} + \frac{-4}{z - \frac{-1}{4}})$ \`{\footnotesize {\tt Take} ((X'::real =$>$ bool) z = ZZ\_1 part\_frac)}\\ -\>{\rm 13}\>\> $X^\prime z = {\cal z}^{-1} (4\cdot\frac{z}{z - \frac{1}{2}} + -4\cdot\frac{z}{z - \frac{-1}{4}})$ \`{\footnotesize{\tt Rewrite\_Set} prep\_for\_inverse\_z X'\_eq }\\ -\>{\rm 14}\>\> $X^\prime z = 4\cdot(\frac{1}{2})^n \cdot u [n] + -4\cdot(\frac{-1}{4})^n \cdot u [n]$ \`{\footnotesize {\tt Rewrite\_Set} inverse\_z X'\_eq}\\ -\>{\rm 15}\> \dots\> $X^\prime z = 4\cdot(\frac{1}{2})^n \cdot u [n] + -4\cdot(\frac{-1}{4})^n \cdot u [n]$ \`{\footnotesize {\tt Check\_Postcond}} -\end{tabbing}} -The tactics on the right margin of the above calculation are those in -the program on p.\pageref{s:impl} which create the respective formulas -on the left. -% ORIGINAL FROM Inverse_Z_Transform.thy -% "Script InverseZTransform (X_eq::bool) = "^(*([], Frm), Problem (Isac, [Inverse, Z_Transform, SignalProcessing])*) -% "(let X = Take X_eq; "^(*([1], Frm), X z = 3 / (z - 1 / 4 + -1 / 8 * (1 / z))*) -% " X' = Rewrite ruleZY False X; "^(*([1], Res), ?X' z = 3 / (z * (z - 1 / 4 + -1 / 8 * (1 / z)))*) -% " (X'_z::real) = lhs X'; "^(* ?X' z*) -% " (zzz::real) = argument_in X'_z; "^(* z *) -% " (funterm::real) = rhs X'; "^(* 3 / (z * (z - 1 / 4 + -1 / 8 * (1 / z)))*) -% -% " (pbz::real) = (SubProblem (Isac', "^(**) -% " [partial_fraction,rational,simplification], "^ -% " [simplification,of_rationals,to_partial_fraction]) "^ -% " [REAL funterm, REAL zzz]); "^(*([2], Res), 4 / (z - 1 / 2) + -4 / (z - -1 / 4)*) -% -% " (pbz_eq::bool) = Take (X'_z = pbz); "^(*([3], Frm), ?X' z = 4 / (z - 1 / 2) + -4 / (z - -1 / 4)*) -% " pbz_eq = Rewrite ruleYZ False pbz_eq; "^(*([3], Res), ?X' z = 4 * (?z / (z - 1 / 2)) + -4 * (?z / (z - -1 / 4))*) -% " pbz_eq = drop_questionmarks pbz_eq; "^(* 4 * (z / (z - 1 / 2)) + -4 * (z / (z - -1 / 4))*) -% " (X_zeq::bool) = Take (X_z = rhs pbz_eq); "^(*([4], Frm), X_z = 4 * (z / (z - 1 / 2)) + -4 * (z / (z - -1 / 4))*) -% " n_eq = (Rewrite_Set inverse_z False) X_zeq; "^(*([4], Res), X_z = 4 * (1 / 2) ^^^ ?n * ?u [?n] + -4 * (-1 / 4) ^^^ ?n * ?u [?n]*) -% " n_eq = drop_questionmarks n_eq "^(* X_z = 4 * (1 / 2) ^^^ n * u [n] + -4 * (-1 / 4) ^^^ n * u [n]*) -% "in n_eq)" (*([], Res), X_z = 4 * (1 / 2) ^^^ n * u [n] + -4 * (-1 / 4) ^^^ n * u [n]*) - -\subsection{Transfer into the Isabelle/{\isac} Knowledge}\label{flow-trans} -Finally \textit{Build\_Inverse\_Z\_Transform.thy} has got the job done -and the knowledge accumulated in it can be distributed to appropriate -theories: the program to \textit{Inverse\_Z\_Transform.thy}, the -sub-problem accomplishing the partial fraction decomposition to -\textit{Partial\_Fractions.thy}. Since there are hacks into Isabelle's -internals, this kind of distribution is not trivial. For instance, the -function \texttt{argument\_in} in \S\ref{funs} explicitly contains a -string with the theory it has been defined in, so this string needs to -be updated from \texttt{Build\_Inverse\_Z\_Transform} to -\texttt{Atools} if that function is transferred to theory -\textit{Atools.thy}. - -In order to obtain the functionality presented in Fig.\ref{fig-interactive} on p.\pageref{fig-interactive} data must be exported from SML-structures to XML. -This process is also rather bare-bones without authoring tools and is -described in detail in the {\sisac} wiki~\footnote{http://www.ist.tugraz.at/isac/index.php/Generate\_representations\_for\_ISAC\_Knowledge}. - -% \newpage -% ------------------------------------------------------------------- -% -% Material, falls noch Platz bleibt ... -% -% ------------------------------------------------------------------- -% -% -% \subsubsection{Trials on Notation and Termination} -% -% \paragraph{Technical notations} are a big problem for our piece of software, -% but the reason for that isn't a fault of the software itself, one of the -% troubles comes out of the fact that different technical subtopics use different -% symbols and notations for a different purpose. The most famous example for such -% a symbol is the complex number $i$ (in cassique math) or $j$ (in technical -% math). In the specific part of signal processing one of this notation issues is -% the use of brackets --- we use round brackets for analoge signals and squared -% brackets for digital samples. Also if there is no problem for us to handle this -% fact, we have to tell the machine what notation leads to wich meaning and that -% this purpose seperation is only valid for this special topic - signal -% processing. -% \subparagraph{In the programming language} itself it is not possible to declare -% fractions, exponents, absolutes and other operators or remarks in a way to make -% them pretty to read; our only posssiblilty were ASCII characters and a handfull -% greek symbols like: $\alpha, \beta, \gamma, \phi,\ldots$. -% \par -% With the upper collected knowledge it is possible to check if we were able to -% donate all required terms and expressions. -% -% \subsubsection{Definition and Usage of Rules} -% -% \paragraph{The core} of our implemented problem is the Z-Transformation, due -% the fact that the transformation itself would require higher math which isn't -% yet avaible in our system we decided to choose the way like it is applied in -% labratory and problem classes at our university - by applying transformation -% rules (collected in transformation tables). -% \paragraph{Rules,} in {\sisac{}}'s programming language can be designed by the -% use of axiomatizations like shown in Example~\ref{eg:ruledef} -% -% \begin{example} -% \label{eg:ruledef} -% \hfill\\ -% \begin{verbatim} -% axiomatization where -% rule1: ``1 = $\delta$[n]'' and -% rule2: ``|| z || > 1 ==> z / (z - 1) = u [n]'' and -% rule3: ``|| z || < 1 ==> z / (z - 1) = -u [-n - 1]'' -% \end{verbatim} -% \end{example} -% -% This rules can be collected in a ruleset and applied to a given expression as -% follows in Example~\ref{eg:ruleapp}. -% -% \begin{example} -% \hfill\\ -% \label{eg:ruleapp} -% \begin{enumerate} -% \item Store rules in ruleset: -% \begin{verbatim} -% val inverse_Z = append_rls "inverse_Z" e_rls -% [ Thm ("rule1",num_str @{thm rule1}), -% Thm ("rule2",num_str @{thm rule2}), -% Thm ("rule3",num_str @{thm rule3}) -% ];\end{verbatim} -% \item Define exression: -% \begin{verbatim} -% val sample_term = str2term "z/(z-1)+z/(z-)+1";\end{verbatim} -% \item Apply ruleset: -% \begin{verbatim} -% val SOME (sample_term', asm) = -% rewrite_set_ thy true inverse_Z sample_term;\end{verbatim} -% \end{enumerate} -% \end{example} -% -% The use of rulesets makes it much easier to develop our designated applications, -% but the programmer has to be careful and patient. When applying rulesets -% two important issues have to be mentionend: -% \subparagraph{How often} the rules have to be applied? In case of -% transformations it is quite clear that we use them once but other fields -% reuqire to apply rules until a special condition is reached (e.g. -% a simplification is finished when there is nothing to be done left). -% \subparagraph{The order} in which rules are applied often takes a big effect -% and has to be evaluated for each purpose once again. -% \par -% In our special case of Signal Processing and the rules defined in -% Example~\ref{eg:ruledef} we have to apply rule~1 first of all to transform all -% constants. After this step has been done it no mather which rule fit's next. -% -% \subsubsection{Helping Functions} -% -% \paragraph{New Programms require,} often new ways to get through. This new ways -% means that we handle functions that have not been in use yet, they can be -% something special and unique for a programm or something famous but unneeded in -% the system yet. In our dedicated example it was for example neccessary to split -% a fraction into numerator and denominator; the creation of such function and -% even others is described in upper Sections~\ref{simp} and \ref{funs}. -% -% \subsubsection{Trials on equation solving} -% %simple eq and problem with double fractions/negative exponents -% \paragraph{The Inverse Z-Transformation} makes it neccessary to solve -% equations degree one and two. Solving equations in the first degree is no -% problem, wether for a student nor for our machine; but even second degree -% equations can lead to big troubles. The origin of this troubles leads from -% the build up process of our equation solving functions; they have been -% implemented some time ago and of course they are not as good as we want them to -% be. Wether or not following we only want to show how cruel it is to build up new -% work on not well fundamentials. -% \subparagraph{A simple equation solving,} can be set up as shown in the next -% example: -% -% \begin{example} -% \begin{verbatim} -% -% val fmz = -% ["equality (-1 + -2 * z + 8 * z ^^^ 2 = (0::real))", -% "solveFor z", -% "solutions L"]; -% -% val (dI',pI',mI') = -% ("Isac", -% ["abcFormula","degree_2","polynomial","univariate","equation"], -% ["no_met"]);\end{verbatim} -% \end{example} -% -% Here we want to solve the equation: $-1+-2\cdot z+8\cdot z^{2}=0$. (To give -% a short overview on the commands; at first we set up the equation and tell the -% machine what's the bound variable and where to store the solution. Second step -% is to define the equation type and determine if we want to use a special method -% to solve this type.) Simple checks tell us that the we will get two results for -% this equation and this results will be real. -% So far it is easy for us and for our machine to solve, but -% mentioned that a unvariate equation second order can have three different types -% of solutions it is getting worth. -% \subparagraph{The solving of} all this types of solutions is not yet supported. -% Luckily it was needed for us; but something which has been needed in this -% context, would have been the solving of an euation looking like: -% $-z^{-2}+-2\cdot z^{-1}+8=0$ which is basically the same equation as mentioned -% before (remember that befor it was no problem to handle for the machine) but -% now, after a simple equivalent transformation, we are not able to solve -% it anymore. -% \subparagraph{Error messages} we get when we try to solve something like upside -% were very confusing and also leads us to no special hint about a problem. -% \par The fault behind is, that we have no well error handling on one side and -% no sufficient formed equation solving on the other side. This two facts are -% making the implemention of new material very difficult. -% -% \subsection{Formalization of missing knowledge in Isabelle} -% -% \paragraph{A problem} behind is the mechanization of mathematic -% theories in TP-bases languages. There is still a huge gap between -% these algorithms and this what we want as a solution - in Example -% Signal Processing. -% -% \vbox{ -% \begin{example} -% \label{eg:gap} -% \[ -% X\cdot(a+b)+Y\cdot(c+d)=aX+bX+cY+dY -% \] -% {\small\textit{ -% \noindent A very simple example on this what we call gap is the -% simplification above. It is needles to say that it is correct and also -% Isabelle for fills it correct - \emph{always}. But sometimes we don't -% want expand such terms, sometimes we want another structure of -% them. Think of a problem were we now would need only the coefficients -% of $X$ and $Y$. This is what we call the gap between mechanical -% simplification and the solution. -% }} -% \end{example} -% } -% -% \paragraph{We are not able to fill this gap,} until we have to live -% with it but first have a look on the meaning of this statement: -% Mechanized math starts from mathematical models and \emph{hopefully} -% proceeds to match physics. Academic engineering starts from physics -% (experimentation, measurement) and then proceeds to mathematical -% modeling and formalization. The process from a physical observance to -% a mathematical theory is unavoidable bound of setting up a big -% collection of standards, rules, definition but also exceptions. These -% are the things making mechanization that difficult. -% -% \vbox{ -% \begin{example} -% \label{eg:units} -% \[ -% m,\ kg,\ s,\ldots -% \] -% {\small\textit{ -% \noindent Think about some units like that one's above. Behind -% each unit there is a discerning and very accurate definition: One -% Meter is the distance the light travels, in a vacuum, through the time -% of 1 / 299.792.458 second; one kilogram is the weight of a -% platinum-iridium cylinder in paris; and so on. But are these -% definitions usable in a computer mechanized world?! -% }} -% \end{example} -% } -% -% \paragraph{A computer} or a TP-System builds on programs with -% predefined logical rules and does not know any mathematical trick -% (follow up example \ref{eg:trick}) or recipe to walk around difficult -% expressions. -% -% \vbox{ -% \begin{example} -% \label{eg:trick} -% \[ \frac{1}{j\omega}\cdot\left(e^{-j\omega}-e^{j3\omega}\right)= \] -% \[ \frac{1}{j\omega}\cdot e^{-j2\omega}\cdot\left(e^{j\omega}-e^{-j\omega}\right)= -% \frac{1}{\omega}\, e^{-j2\omega}\cdot\colorbox{lgray}{$\frac{1}{j}\,\left(e^{j\omega}-e^{-j\omega}\right)$}= \] -% \[ \frac{1}{\omega}\, e^{-j2\omega}\cdot\colorbox{lgray}{$2\, sin(\omega)$} \] -% {\small\textit{ -% \noindent Sometimes it is also useful to be able to apply some -% \emph{tricks} to get a beautiful and particularly meaningful result, -% which we are able to interpret. But as seen in this example it can be -% hard to find out what operations have to be done to transform a result -% into a meaningful one. -% }} -% \end{example} -% } -% -% \paragraph{The only possibility,} for such a system, is to work -% through its known definitions and stops if none of these -% fits. Specified on Signal Processing or any other application it is -% often possible to walk through by doing simple creases. This creases -% are in general based on simple math operational but the challenge is -% to teach the machine \emph{all}\footnote{Its pride to call it -% \emph{all}.} of them. Unfortunately the goal of TP Isabelle is to -% reach a high level of \emph{all} but it in real it will still be a -% survey of knowledge which links to other knowledge and {{\sisac}{}} a -% trainer and helper but no human compensating calculator. -% \par -% {{{\sisac}{}}} itself aims to adds \emph{Algorithmic Knowledge} (formal -% specifications of problems out of topics from Signal Processing, etc.) -% and \emph{Application-oriented Knowledge} to the \emph{deductive} axis of -% physical knowledge. The result is a three-dimensional universe of -% mathematics seen in Figure~\ref{fig:mathuni}. -% -% \begin{figure} -% \begin{center} -% \includegraphics{fig/universe} -% \caption{Didactic ``Math-Universe'': Algorithmic Knowledge (Programs) is -% combined with Application-oriented Knowledge (Specifications) and Deductive Knowledge (Axioms, Definitions, Theorems). The Result -% leads to a three dimensional math universe.\label{fig:mathuni}} -% \end{center} -% \end{figure} -% -% %WN Deine aktuelle Benennung oben wird Dir kein Fachmann abnehmen; -% %WN bitte folgende Bezeichnungen nehmen: -% %WN -% %WN axis 1: Algorithmic Knowledge (Programs) -% %WN axis 2: Application-oriented Knowledge (Specifications) -% %WN axis 3: Deductive Knowledge (Axioms, Definitions, Theorems) -% %WN -% %WN und bitte die R"ander von der Grafik wegschneiden (was ich f"ur *.pdf -% %WN nicht hinkriege --- weshalb ich auch die eJMT-Forderung nicht ganz -% %WN verstehe, separierte PDFs zu schicken; ich w"urde *.png schicken) -% -% %JR Ränder und beschriftung geändert. Keine Ahnung warum eJMT sich pdf's -% %JR wünschen, würde ebenfalls png oder ähnliches verwenden, aber wenn pdf's -% %JR gefordert werden WN2... -% %WN2 meiner Meinung nach hat sich eJMT unklar ausgedr"uckt (z.B. kann -% %WN2 man meines Wissens pdf-figures nicht auf eine bestimmte Gr"osse -% %WN2 zusammenschneiden um die R"ander weg zu bekommen) -% %WN2 Mein Vorschlag ist, in umserem tex-file bei *.png zu bleiben und -% %WN2 png + pdf figures mitzuschicken. -% -% \subsection{Notes on Problems with Traditional Notation} -% -% \paragraph{During research} on these topic severely problems on -% traditional notations have been discovered. Some of them have been -% known in computer science for many years now and are still unsolved, -% one of them aggregates with the so called \emph{Lambda Calculus}, -% Example~\ref{eg:lamda} provides a look on the problem that embarrassed -% us. -% -% \vbox{ -% \begin{example} -% \label{eg:lamda} -% -% \[ f(x)=\ldots\; \quad R \rightarrow \quad R \] -% -% -% \[ f(p)=\ldots\; p \in \quad R \] -% -% {\small\textit{ -% \noindent Above we see two equations. The first equation aims to -% be a mapping of an function from the reel range to the reel one, but -% when we change only one letter we get the second equation which -% usually aims to insert a reel point $p$ into the reel function. In -% computer science now we have the problem to tell the machine (TP) the -% difference between this two notations. This Problem is called -% \emph{Lambda Calculus}. -% }} -% \end{example} -% } -% -% \paragraph{An other problem} is that terms are not full simplified in -% traditional notations, in {{\sisac}} we have to simplify them complete -% to check weather results are compatible or not. in e.g. the solutions -% of an second order linear equation is an rational in {{\sisac}} but in -% tradition we keep fractions as long as possible and as long as they -% aim to be \textit{beautiful} (1/8, 5/16,...). -% \subparagraph{The math} which should be mechanized in Computer Theorem -% Provers (\emph{TP}) has (almost) a problem with traditional notations -% (predicate calculus) for axioms, definitions, lemmas, theorems as a -% computer program or script is not able to interpret every Greek or -% Latin letter and every Greek, Latin or whatever calculations -% symbol. Also if we would be able to handle these symbols we still have -% a problem to interpret them at all. (Follow up \hbox{Example -% \ref{eg:symbint1}}) -% -% \vbox{ -% \begin{example} -% \label{eg:symbint1} -% \[ -% u\left[n\right] \ \ldots \ unitstep -% \] -% {\small\textit{ -% \noindent The unitstep is something we need to solve Signal -% Processing problem classes. But in {{{\sisac}{}}} the rectangular -% brackets have a different meaning. So we abuse them for our -% requirements. We get something which is not defined, but usable. The -% Result is syntax only without semantic. -% }} -% \end{example} -% } -% -% In different problems, symbols and letters have different meanings and -% ask for different ways to get through. (Follow up \hbox{Example -% \ref{eg:symbint2}}) -% -% \vbox{ -% \begin{example} -% \label{eg:symbint2} -% \[ -% \widehat{\ }\ \widehat{\ }\ \widehat{\ } \ \ldots \ exponent -% \] -% {\small\textit{ -% \noindent For using exponents the three \texttt{widehat} symbols -% are required. The reason for that is due the development of -% {{{\sisac}{}}} the single \texttt{widehat} and also the double were -% already in use for different operations. -% }} -% \end{example} -% } -% -% \paragraph{Also the output} can be a problem. We are familiar with a -% specified notations and style taught in university but a computer -% program has no knowledge of the form proved by a professor and the -% machines themselves also have not yet the possibilities to print every -% symbol (correct) Recent developments provide proofs in a human -% readable format but according to the fact that there is no money for -% good working formal editors yet, the style is one thing we have to -% live with. -% -% \section{Problems rising out of the Development Environment} -% -% fehlermeldungen! TODO - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\end{verbatim} - -\section{Summary and Conclusions}\label{conclusion} - -%JR obvious - -%This paper gives a first experience report about programming with a -%TP-based programming language. - -A brief re-introduction of the novel kind of programming -language by example of the {\sisac}-prototype makes the paper -self-contained. The main section describes all the main concepts -involved in TP-based programming and all the sub-tasks concerning -respective implementation in the {\sisac} prototype: mechanisation of mathematics and domain -modeling, implementation of term rewriting systems for the -rewriting-engine, formal (implicit) specification of the problem to be -(explicitly) described by the program, implementation of the many components -required for Lucas-Interpretation and finally implementation of the -program itself. - -The many concepts and sub-tasks involved in programming require a -comprehensive work-flow; first experiences with the work-flow as -supported by the present prototype are described as well: Isabelle + -Isar + jEdit provide appropriate components for establishing an -efficient development environment integrating computation and -deduction. However, the present state of the prototype is far off a -state appropriate for wide-spread use: the prototype of the program -language lacks expressiveness and elegance, the prototype of the -development environment is hardly usable: error messages still address -the developer of the prototype's interpreter rather than the -application programmer, implementation of the many settings for the -Lucas-Interpreter is cumbersome. - -\subsection{Conclusions for Future Development} -From the above mentioned experiences a successful proof of concept can be concluded: -programming arbitrary problems from engineering sciences is possible, -in principle even in the prototype. Furthermore the experiences allow -to conclude detailed requirements for further development: -\begin{enumerate} -\item Clarify underlying logics such that programming is smoothly -integrated with verification of the program; the post-condition should -be proved more or less automatically, otherwise working engineers -would not encounter such programming. -\item Combine the prototype's programming language with Isabelle's -powerful function package and probably with more of SML's -pattern-matching features; include parallel execution on multi-core -machines into the language design. -\item Extend the prototype's Lucas-Interpreter such that it also -handles functions defined by use of Isabelle's functions package; and -generalize Isabelle's code generator such that efficient code for the -whole definition of the programming language can be generated (for -multi-core machines). -\item Develop an efficient development environment with -integration of programming and proving, with management not only of -Isabelle theories, but also of large collections of specifications and -of programs. -\item\label{CAS} Extend Isabelle's computational features in direction of -\textit{verfied} Computer Algebra: simplification extended by -algorithms beyond rewriting (cancellation of multivariate rationals, -factorisation, partial fraction decomposition, etc), equation solving -, integration, etc. -\end{enumerate} -Provided successful accomplishment, these points provide distinguished -components for virtual workbenches appealing to practitioners of -engineering in the near future. - -\subsection{Preview to Development of Course Material} -Interactive course material, as addressed by the title, -can comprise step-wise problem solving created as a side-effect of a -TP-based program: The introduction \S\ref{intro} briefly shows that Lucas-Interpretation not only provides an -interactive programming environment, Lucas-Interpretation also can -provide TP-based services for a flexible dialogue component with -adaptive user guidance for independent and inquiry-based learning. - -However, the {\sisac} prototype is not ready for use in field-tests, -not only due to the above five requirements not sufficiently -accomplished, but also due to usability of the fron-end, in particular -the lack of an editor for formulas in 2-dimension representation. - -Nevertheless, the experiences from the case study described in this -paper, allow to give a preview to the development of course material, -if based on Lucas-Interpretation: - -\paragraph{Development of material from scratch} is too much effort -just for e-learning; this has become clear with the case study. For -getting support for stepwise problem solving just in {\em one} example -class, the one presented in this paper, involved the following tasks: -\begin{itemize} -\item Adapt the equation solver; since that was too laborous, the -program has been adapted in an unelegant way. -\item Implement an algorithms for partial fraction decomposition, -which is considered a standard normal form in Computer Algebra. -\item Implement a specification for partial fraction decomposition and -locate it appropriately in the hierarchy of specification. -\item Declare definitions and theorems within the theory of -${\cal Z}$-transform, and prove the theorems (which was not done in the -case study). -\end{itemize} -On the other hand, for the one the class of problems implemented, -adding an arbitrary number of examples within this class requires a -few minutes~\footnote{As shown in Fig.\ref{fig-interactive}, an -example is called from an HTML-file by an URL, which addresses an -XML-structure holding the respective data as shown on -p.\pageref{ml-check-program}.} and the support for individual stepwise -problem solving comes for free. - -\paragraph{E-learning benefits from Formal Domain Engineering} which can be -expected for various domains in the near future. In order to cope with -increasing complexity in domain of technology, specific domain -knowledge is beeing mechanised, not only for software technology -\footnote{For instance, the Archive of Formal Proofs -http://afp.sourceforge.net/} but also for other engineering domains -\cite{Dehbonei&94,Hansen94b,db:dom-eng}. This fairly new part of -engineering sciences is called ``domain engineering'' in -\cite{db:SW-engIII}. - -Given this kind of mechanised knowledge including mathematical -theories, domain specific definitions, specifications and algorithms, -theorems and proofs, then e-learning with support for individual -stepwise problem solving will not be much ado anymore; then e-learning -media in technology education can be derived from this knowledge with -reasonable effort. - -\paragraph{Development differentiates into tasks} more separated than -without Lucas-Interpretation and more challenginging in specific -expertise. These are the kinds of experts expected to cooperate in -development of -\begin{itemize} -\item ``Domain engineers'', who accomplish fairly novel tasks -described in this paper. -\item Course designers, who provide the instructional design according -to curricula, together with usability experts and media designers, are -indispensable in production of e-learning media at the state-of-the -art. -\item ``Dialog designers'', whose part of development is clearly -separated from the part of domain engineers as a consequence of -Lucas-Interpretation: TP-based programs are functional, as mentioned, -and are only concerned with describing mathematics --- and not at all -concerned with interaction, psychology, learning theory and the like, -because there are no in/output statements. Dialog designers can expect -a high-level rule-based language~\cite{gdaroczy-EP-13} for describing -their part. -\end{itemize} - -% response-to-referees: -% (2.1) details of novel technology in order to estimate the impact -% (2.2) which kinds of expertise are required for production of e-learning media (instructional design, math authoring, dialog authoring, media design) -% (2.3) what in particular is required for programming new exercises supported by next-step-guidance (expertise / efforts) -% (2.4) estimation of break-even points for development of next-step-guidance -% (2.5) usability of ISAC prototype at the present state -% -% The points (1.*) seem to be well covered in the paper, the points (2.*) are not. So I decided to address the points (2.*) in a separate section §5.1."". - -\bigskip\noindent For this decade there seems to be a window of opportunity opening from -one side inreasing demand for formal domain engineering and from the -other side from TP more and more gaining industrial relevance. Within -this window, development of TP-based educational software can take -benefit from the fact, that the TPs leading in Europe, Coq~\cite{coq-team-10} and -Isabelle are still open source together with the major part of -mechanised knowledge.%~\footnote{NICTA}. - -\bibliographystyle{alpha} -{\small\bibliography{references}} - -\end{document} -% LocalWords: TP IST SPSC Telematics Dialogues dialogue HOL bool nat Hindley -% LocalWords: Milner tt Subproblem Formulae ruleset generalisation initialised -% LocalWords: axiomatization LCF Simplifiers simplifiers Isar rew Thm Calc SML -% LocalWords: recognised hoc Trueprop redexes Unsynchronized pre rhs ord erls -% LocalWords: srls prls nrls lhs errpats InverseZTransform SubProblem IDE IDEs -% LocalWords: univariate jEdit rls RealDef calclist familiarisation ons pos eq -% LocalWords: mout ctree SignalProcessing frac ZZ Postcond Atools wiki SML's -% LocalWords: mechanisation multi diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/eJMT-paper/references.bib --- a/src/Doc/isac/jrocnik/eJMT-paper/references.bib Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,343 +0,0 @@ -@Misc{coq-team-10, - author = {Coq development team}, - title = {Coq 8.3 Reference Manual}, - howpublished = {http://coq.inria.fr/reman}, - year = {2010}, - note = {INRIA} -} - -@Book{db:dom-eng, - author = {Bj{\o}rner, Dines}, - title = {Domain Engineering. Technology Management, Research and Engineering}, - publisher = {JAIST Press}, - year = {2009}, - month = {Feb}, - series = {COE Research Monograph Series}, - volume = {4}, - address = {Nomi, Japan} -} - -@INPROCEEDINGS{Hansen94b, - KEY = "Hansen94", - AUTHOR = "Kirsten Mark Hansen", - EDITOR = "M. Naftalin, T. Denvir, M. Bertran", - TITLE = "Validation of a Railway Interlocking Model", - BOOKTITLE = "FME'94: Industrial Benefit of Formal Methods", - PUBLISHER = "Springer-Verlag", - YEAR = "1994", - MONTH = "October", - PAGES = "582-601", - ANNOTE = "", - COMMENT = "PGL has got the proceedings. ADN" -} - -@INPROCEEDINGS{Dehbonei&94, - KEY = "Dehbonei\&94", - AUTHOR = "Dehbonei, Babak and Mejia, Fernando", - EDITOR = "M. Naftalin, T. Denvir, M. Bertran", - TITLE = "Formal Methods in the Railways Signalling Industry", - BOOKTITLE = "FME'94:Industrial Benefit of Formal Methods", - PUBLISHER = "Springer-Verlag", - YEAR = "1994", - MONTH = "October", - PAGES = "26-34", - ANNOTE = "", - COMMENT = "Peter has got the proceedings. ADN" -} - -@Book{db:SW-engIII, - author = {Bj{\o}rner, Dines}, - title = {Software Engineering}, - publisher = {Springer}, - year = {2006}, - volume = {3}, - series = {Texts in Theoretical Computer Science}, - address = {Berlin, Heidelberg} -} - -@Book{pl:milner97, - author = {Robin Milner and Mads Tofte and Robert Harper and David MacQueen}, - title = {The Definition of Standard ML (Revised)}, - publisher = {The MIT Press}, - year = 1997, - address = {Cambridge, London}, - annote = {97bok375} -} - -@book{nipk:rew-all-that, - title={Term rewriting and all that}, - author={Baader, Franz and Nipkow, Tobias }, - publisher={Cambridge University Press},year={1998}, - volume={},series={},address={},edition={},month={}, - note={},status={},source={},location={IST} - } - -@Misc{jrocnik-bakk, - author = {Jan Rocnik}, - title = {Interactive Course Material for Signal Processing based on Isabelle/{\isac}}, - howpublished = {Bakkalaureate Thesis}, - year = {2012}, - note = {IST, Graz University of Technology, http://www.ist.tugraz.at/projects/isac/publ/jrocnik\_bakk.pdf} -} - -@book{proakis2004contemporary, - title={Contemporary communication systems using MATLAB and Simulink}, - author={Proakis, J.G. and Salehi, M. and Bauch, G.}, - isbn={9780534406172}, - lccn={31054410}, - series={BookWare companion series}, - url={http://books.google.at/books?id=5mXGQgAACAAJ}, - year={2004}, - publisher={Thomson--Brooks/Cole} -} -@book{oppenheim2010discrete, - title={Discrete-time signal processing}, - author={Oppenheim, A.V. and Schafer, R.W.}, - isbn={9780131988422}, - series={Prentice-Hall signal processing series}, - url={http://books.google.at/books?id=mYsoAQAAMAAJ}, - year={2010}, - publisher={Prentice Hall} -} -@manual{wenzel2011system, - title={The Isabelle System Manual}, - author={Wenzel, M. and Berghofer, S.}, - organization={TU Muenchen}, - year={2011}, - month={January} -} -@Book{Nipkow-Paulson-Wenzel:2002, - author = {Tobias Nipkow and Lawrence C. Paulson and Markus Wenzel}, - title = {{Isabelle/HOL} --- A Proof Assistant for Higher-Order Logic}, - publisher = {Springer}, - series = {LNCS}, - volume = 2283, - year = 2002} -@Book{progr-mathematica, - author = {Maeder, Roman E.}, - title = {Programming in Mathematica}, - publisher = {Addison-Wesley}, - address = {Reading, Mass.}, - year = {1997} -} -@Book{prog-maple06, - author = {Aladjav, Victor and Bogdevicius, Marijonas}, - title = {Maple: Programming, Physical and Engineering Problems}, - publisher = {Fultus Corporation}, - year = {2006}, - month = {February 27}, - annote = {ISBN: 1596820802} -} -@Article{plmms10, - author = {Florian Haftmann and Cezary Kaliszyk and Walther Neuper}, - title = {{CTP}-based programming languages~? Considerations about an experimental design}, - journal = {ACM Communications in Computer Algebra}, - year = {2010}, - volume = {44}, - number = {1/2}, - pages = {27-41}, - month = {March/June} -} -@inproceedings{casproto, - author = {Cezary Kaliszyk and - Freek Wiedijk}, - title = {Certified Computer Algebra on Top of an Interactive Theorem - Prover}, - booktitle = {Calculemus}, - year = {2007}, - pages = {94-105}, - ee = {http://dx.doi.org/10.1007/978-3-540-73086-6_8}, - crossref = {DBLP:conf/mkm/2007}, - bibsource = {DBLP, http://dblp.uni-trier.de} -} -@InProceedings{wn:lucas-interp-12, - author = {Neuper, Walther}, - title = {Automated Generation of User Guidance by Combining Computation and Deduction}, - booktitle = {THedu'11: CTP-compontents for educational software}, - year = {2012}, - editor = {Quaresma, Pedro}, - publisher = {EPTCS}, - note = {To appear} -} -@Manual{Huet_all:94, - author = {Huet, G. and Kahn, G. and Paulin-Mohring, C.}, - title = {The Coq Proof Assistant}, - institution = {INRIA-Rocquencourt}, - year = {1994}, - type = {Tutorial}, - number = {Version 5.10}, - address = {CNRS-ENS Lyon}, - status={},source={Theorema},location={-} -} -@TECHREPORT{Back-SD09, - author = {Back, Ralph-Johan}, - title = {Structured Derivations as a Unified Proof Style for Teaching Mathematics}, - institution = {TUCS - Turku Centre for Computer Science}, - year = {2009}, - type = {TUCS Technical Report}, - number = {949}, - address = {Turku, Finland}, - month = {July} -} -@InProceedings{ActiveMath-MAIN11, - author = {Melis, Erica and Siekmann, Jörg}, - title = {An Intelligent Tutoring System for Mathematics}, - booktitle = {Seventh International Conference Artificial Intelligence and Soft Computing (ICAISC)}, - pages = {91-101}, - year = {2004}, - editor = {Rutkowski, L. and Siekmann, J. and Tadeusiewicz, R. and Zadeh, L.A.}, - number = {3070,}, - series = {LNAI}, - publisher = {Springer-Verlag}, - doi = {doi:10.1007/978-3-540-24844-6\_12}} -@TechReport{mat-tutor-cmu-MAIN11, - author = {John R. Anderson}, - title = {Intelligent Tutoring and High School Mathematics}, - institution = {Carnegie Mellon University, Department of Psychology}, - year = {2008}, - type = {Technical Report}, - number = {20}, - note = {http://repository.cmu.edu/psychology/20} -} -@PhdThesis{proof-strategies-11, - author = {Dietrich, Dominik}, - title = {Proof Planning with Compiled Strategies}, - school = {FR 6.2 Informatik, Saarland University}, - year = {2011} -} -@proceedings{DBLP:conf/mkm/2007, - editor = {Manuel Kauers and - Manfred Kerber and - Robert Miner and - Wolfgang Windsteiger}, - title = {Towards Mechanized Mathematical Assistants, 14th Symposium, - Calculemus 2007, 6th International Conference, MKM 2007, - Hagenberg, Austria, June 27-30, 2007, Proceedings}, - booktitle = {Calculemus/MKM}, - publisher = {Springer}, - series = {Lecture Notes in Computer Science}, - volume = {4573}, - year = {2007}, - isbn = {978-3-540-73083-5}, - bibsource = {DBLP, http://dblp.uni-trier.de} -} - -@InProceedings{gdaroczy-EP-13, - author = {Gabriella Dar\'{o}czy and Walther Neuper}, - booktitle = {unknown}, - title = {Error-Patterns within ``Next-Step-Guidance'' in TP-based Educational Systems}, - OPTpages = {TODO-TODO}, - crossref = {eduTPS-12}, - note = {to appear in this publication} -} - - -@Proceedings{eduTPS-12, - title = {Theorem-Prover based Systems for Education (eduTPS)}, - year = {2013}, - OPTkey = {}, - OPTbooktitle = {}, - OPTeditor = {}, - OPTvolume = {}, - OPTnumber = {}, - OPTseries = {}, - OPTaddress = {}, - OPTmonth = {}, - OPTorganization = {}, - publisher = {The Electronic Journal of Mathematics and Technology}, - note = {to appear}, - OPTannote = {} -} - -@Misc{nipkow-prog-prove, - author = {Nipkow, Tobias}, - title = {Programming and Proving in {Isabelle/HOL}}, - howpublished = {contained in the Isabelle distribution}, - month = {May 22}, - year = {2012} -} - -@Book{pl:hind97, - author = {J. Roger Hindley}, - title = {Basic Simple Type Theory}, - publisher = {Cambridge University Press}, - year = 1997, - editor = {S. Abramsky and P. H. Aczel and others}, - number = 42, - series = {Cambridge Tracts in Theoretical Computer Science}, - address = {Cambridge}, - annote = {97bok308} -} - -@Article{Milner-78, - author = {Milner, R.}, - title = {A Theory of Type Polymorphism in Programming}, - journal = {Journal of Computer and System Science (JCSS)}, - year = {1978}, - number = {17}, - volume = {0}, - pages = {348-374} -} - -@inproceedings{Wenzel-11:doc-orient, - author = {Wenzel, Makarius}, - title = {Isabelle as document-oriented proof assistant}, - booktitle = {Proceedings of the 18th Calculemus and 10th international conference on Intelligent computer mathematics}, - series = {MKM'11}, - year = {2011}, - isbn = {978-3-642-22672-4}, - location = {Bertinoro, Italy}, - pages = {244--259}, - numpages = {16}, - url = {http://dl.acm.org/citation.cfm?id=2032713.2032732}, - acmid = {2032732}, - publisher = {Springer-Verlag}, - address = {Berlin, Heidelberg}, -} -@InProceedings{makar-jedit-12, - author = {Makarius Wenzel}, - title = {Isabelle/{jEdit} — a Prover IDE within the {PIDE} framework}, - booktitle = {Conference on Intelligent Computer Mathematics (CICM 2012)}, - year = {2012}, - editor = { J. Jeuring and others}, - number = {7362}, - series = {LNAI}, - publisher = {Springer} -} - -@InProceedings{Makarius-09:parall-proof, - author = {Wenzel, Makarius}, - title = {Parallel Proof Checking in {Isabelle/Isar}}, - booktitle = {ACM SIGSAM 2009 International Workshop on Programming Languages for Mechanized Mathematics Systems (PLMMS)}, - year = {2009}, - editor = {Dos Reis and L. Th\'ery}, - address = {Munich}, - month = {August}, - publisher = {ACM Digital library} -} - -@Book{fm-03, - author = {Jean Francois Monin and Michael G. Hinchey}, - title = {Understanding formal methods}, - publisher = {Springer}, - year = {2003} -} - -@misc{wiki:1, - author = {Wikipedia}, - Title = {Table of common Z-transform pairs}, - year = {2012}, - url = {http://en.wikipedia.org/wiki/Z-transform#Table_of_common_Z-transform_pairs}, - note = {[Online; accessed 31-Oct-2012]} - } - -@InProceedings{kremp.np:assess, - author = {Krempler, Alan and Neuper, Walther}, - title = {Formative Assessment for User Guidance in Single Stepping Systems}, - booktitle = {Interactive Computer Aided Learning, Proceedings of ICL08}, - year = {2008}, - editor = {Aucher, Michael E.}, - address = {Villach, Austria}, - note = {$\,$\\http://www.ist.tugraz.at/projects/isac/publ/icl08.pdf} -} - diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/final/jrocnik_bakk.tex --- a/src/Doc/isac/jrocnik/final/jrocnik_bakk.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,688 +0,0 @@ -% Title: bakkarbeit_jrocnik.tex -% Author: Jan Rocnik -% (c) copyright due to lincense terms. -%2345678901234567890123456789012345678901234567890123456789012345678901234567890 -% 10 20 30 40 50 60 70 80 - -%define document class -\documentclass[a4paper, 12pt]{article} - -%packages for language and input -\usepackage[english]{babel} -\usepackage[T1]{fontenc} -\usepackage[latin1]{inputenc} - -%generel packages -\usepackage{url} -\usepackage{endnotes} -\usepackage{trfsigns} -\usepackage{setspace} -\usepackage[pdfpagelabels]{hyperref} -\usepackage{longtable} - -\usepackage{float} %For restylefloat -\newfloat{example}{ht}{} %self made floats -\floatname{example}{Example} %name for float -\restylefloat{table} %float tables -\floatstyle{ruled} %boxes around floats -\restylefloat{example} %float examples --> boxes -\restylefloat{figure} - -%colors and graphics -\usepackage{graphicx} -\usepackage{color} -\definecolor{lgray}{RGB}{238,238,238} - -%isabelle relevant packages -\usepackage{isabelle,isabellesym} -%\isabellestyle{it} - -%define isac logos -\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} -\def\sisac{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} - -\newcommand{\HRule}{\rule{\linewidth}{0.2mm}} - -%start new even page -\usepackage{ifthen} -\newcommand{\newevenside}{ - \ifthenelse{\isodd{\thepage}}{\newpage}{ - \newpage - \phantom{placeholder} % doesn't appear on page - \thispagestyle{empty} % if want no header/footer - \newpage - } -} - -%this should be the last package used -%\usepackage{pdfsetup} - -%----------// BEGIN DOCUMENT \\----------% - -\begin{document} - -%----------// TITLE PAGE \\----------%1 - -\input{./bakkarbeit_titlepage.tex} -\newpage - -%----------// EMPTY PAGE \\----------%2 - -\setcounter{page}{2} -\thispagestyle{empty}\mbox{}\newpage - -%----------// THANKS \\----------%3 - -\setcounter{page}{3} -\begin{center} - Special Thanks to\\ - \hfill \\ - \emph{Dr.techn. Walther Neuper}\\ - \emph{Dipl.-Ing. Bernhard Geiger} -\end{center} -\thispagestyle{empty} -\newpage - -%----------// EMPTY PAGE \\----------%4 - -%the following command was replaced by \newevenside -%\thispagestyle{empty}\mbox{}\newpage - -%----------// ABSTRACT \\----------%5 - -\newevenside -\begin{abstract} -The Baccalaureate Thesis creates interactivee course material for Signal Processing (SP) based on the experimental educational math assistant Isabelle/{\sisac} ({\em Isa}belle for Transparent {\em C}alculations in Applied Mathematics). -\par The content of the course material is defined together with the Institute for Signal Processing and Speech Communication (SPSC) of Graz University of Technology (TUG). The content is planned to be used in specific lectures and labs of the SPSC and thus is thoroughly concerned with underlying mathematical and physical theory. -One challenge of this thesis is, that much theory required for SPSC is not yet mechanized in Computer Theorem Provers (TP); so this thesis will provide preliminary definitions and theorems (without proofs~!) implemented in Isabelle \emph{theories}. -\par Another challenge is the implementation of interactivee courses: this is done within the educational math assistant Isabelle/{\sisac}, which is under development at Austrian Universities, one of them TU Graz. The present state of {\sisac{}} happens to provide the {\em first} occasion for authoring by a non-member of the {\sisac}-developer team. So this challenge involves alpha-testing of the underlying \emph{TP-based programing language}, because error messages are still not user-friendly and need frequent contact with {\sisac}-developers. -So the practical outcome of this thesis is twofold: -\begin{enumerate} -\item Interactive course material hopefully useful in education within the SPSC and within \emph{STEOP}\footnote{German: "`Studieneingangs- und Orientierungsphase"'}, the introductory orientation phase at TUG, as a preview for students in Telematics on later application of math knowledge introduced in the first semester and -\item A detailed description of technicalities in programing implemented as an interactivee Isabelle/Isar theory, providing future programers with guidelines and {\sisac}-developers with feedback in usability of the CTP-based program language. -\end{enumerate} -\end{abstract} -\clearpage - -%----------// EMPTY PAGE \\----------%6 - -%the following command was replaced by \newevenside -%\thispagestyle{empty}\mbox{}\newpage - -%----------// T O C \\----------%7-9 - -\newevenside - -\pagenumbering{Roman} -%This thesis is structured into a fundamental part introducing the motivation, the basic notions concerning the thesis aswell as the {\sisac{}} project and describing the mathematic base. Further a automatically generated practical part representing the work on {\sisac{}} which can be extended. -\tableofcontents -\clearpage -\pagenumbering{arabic} -\setcounter{page}{10} - -%----------// PART-1 \\----------% - -\newevenside - -\part{Project Fundamentals} - -\section{Introduction} -Didactics of mathematics faces a specific issue, a gap between (1) introduction of math concepts and skills and (2) application of these concepts and skills, which usually are separated into different units in curricula (for good reasons). For instance, (1) teaching partial fraction decomposition is separated from (2) application for inverse Z-transform in signal processing. - -This gap is an obstacle for applying math as an fundamental thinking technology in engineering: In (1) motivation is lacking because the question ``What is this stuff good for~?'' cannot be treated sufficiently, and in (2) the ``stuff'' is not available to students in higher semesters as widespread experience shows. - -\medskip -Motivated by this didactical issue on the one hand, and ongoing R\&D on a novel kind of educational mathematics assistant at Graz University of Technology~\footnote{http://www.ist.tugraz.at/isac/} promising to cope with this issue on the other hand, several institutes are planning to join their expertise: the Institutes for Institute for Information Systems and Computer Media (IICM), the Institute for Software Technology (IST), the Institutes for Mathematics, the Signal Processing and Speech Communication Institute (SPSC), the Institute for Structural Analysis and the Institute of Electrical Measurement and Measurement Signal Processing. -\par This thesis is the first attempt to tackle the above mentioned issue, it focuses on Telematics, because these specific studies focus on mathematics in \emph{STEOP}, the introductory orientation phase. \emph{STEOP} is considered an opportunity to investigate the impact of {\sisac}'s prototype on the issue and others. - -\medskip -The thesis is structured as follows: Part~I concerns theory and project controlling, Part~II the implementation work, where the latter is the main work, Part~III the resume including summary, open questions and conclusion and the appendixes in Part~IV. -\par In part I, Section~\ref{isabisac} gives a brief description of the state-of-the-art for educational math assistants (Section~\ref{emas}) and introduces the notions required for the implementation work (Section~\ref{math-auth}). In particular, Section~\ref{user-guid} explains, why math authoring in {\sisac{}} is {\em not} concerned with interaction (and thus not with user guidance etc at all~!). So a concise description of the thesis' goals needs to be postponed to Section~\ref{sec:goals}. -\par Section~\ref{sp} analyzes a problems defined by the SPSC for the knowledge already provided (Section~\ref{know-isab}, Section~\ref{know-isac}), discusses the selection of problems for implementation (Section~\ref{know-missing}) TODO: further structure ? -%(\S\ref{}) - -\section{Mechanization of Math in Isabelle/ISAC\label{isabisac}} - -%\subsubsection*{Notes on Mechanization of Mathematics} -%This thesis tries to \emph{connect} these two worlds and is one of the first guidelines to implement problem classes in {\sisac}. As we are still in a eary part of development, this is the first thesis dealing within this topic and there is \emph{no} related work to guid through. A more detailed description about this fact can be found in Section \ref{sec:related}. -%The major challenge of the practical part, of this thesis, is, that "connecting the two worlds" involves programing in a CTP-based programing language which is in a very early state of prototyping. There is no concrete experience data ready to grep. -% -As mentioned in the introduction, a prototype of an educational math assistant called {\sisac}\footnote{{\sisac}=\textbf{Isa}belle \cite{Nipkow-Paulson-Wenzel:2002} for \textbf{C}alculations, see http://www.ist.tugraz.at/isac/.} bridges the gap between (1) introducation and (2) application of mathematics: {\sisac} is based on Computer Theorem Proving (TP), a technology which requires each fact and each action justified by formal logic, so {{\sisac{}}} makes justifications transparent to students in interactivee step-wise problem solving. By that way {\sisac} already can serve both: -\begin{enumerate} -\item Introduction of math stuff (in e.g. partial fraction decomposition) by stepwise explaining and exercising respective symbolic calculations with ``next step guidance (NSG)'' and rigorously checking steps freely input by students --- this also in context with advanced applications (where the stuff to be taught in higher semesters can be skimmed through by NSG), and -\item Application of math stuff in advanced engineering courses (e.g. problems to be solved by inverse Z-transform in a Signal Processing Lab) --- and now without much ado about basic math techniques (like partial fraction decomposition): ``next step guidance'' supports students in independently (re-)adopting such techniques. -\end{enumerate} -Before the question is answers, how {\sisac} accomplishes this task from a technical point of view, some remarks on the state-of-the-art is given, therefor follow up Section~\ref{emas}. - -\subsection{Educational Mathematics Assistants (EMAs)}\label{emas} -Educational software in mathematics is, if at all, based on Computer Algebra Systems (CAS, for instance \cite{progr-mathematica,prog-maple06}), Dynamic Geometry Systems (DGS, for instance \footnote{GeoGebra http://www.geogebra.org, Cinderella http://www.cinderella.de/, GCLC http://poincare.matf.bg.ac.rs/~janicic/gclc/}) or spread-sheets. These base technologies are used to program math lessons and sometimes even exercises. The latter are cumbersome: the steps towards a solution of such an interactivee exercise need to be provided with feedback, where at each step a wide variety of possible input has to be foreseen by the programer --- so such interactivee exercises either require high development efforts or the exercises constrain possible inputs. - -A new generation of educational math assistants (EMAs) is emerging presently, which is based on Theorem Proving (TP). TP, for instance Isabelle \cite{Nipkow-Paulson-Wenzel:2002} and Coq \cite{Huet_all:94}, is a technology which requires each fact and each action justified by formal logic. Pushed by demands for \textit{proven} correctness of safety-critical software TP advances into software engineering; from these advancements computer mathematics benefits in general, and math education in particular. Two features of TP are immediately beneficial for learning: - -\paragraph{TP have knowledge in human readable format,} that is in standard predicate calculus. TP following the LCF-tradition have that knowledge down to the basic definitions of set, equality, etc~\footnote{http://isabelle.in.tum.de/dist/library/HOL/HOL.html}; following the typical deductive development of math, natural numbers are defined and their properties proven~\footnote{http://isabelle.in.tum.de/dist/library/HOL/Number\_Theory/Primes.html}, etc. Present knowledge mechanized in TP exceeds high-school mathematics by far, however by knowledge required in software technology, and not in other engineering sciences. - -\paragraph{TP can model the whole problem solving process} in mathematical problem solving {\em within} a coherent logical framework. This is already being done by three projects, by Ralph-Johan Back \cite{Back-SD09}, by ActiveMath \cite{ActiveMath-MAIN11} and by Carnegie Mellon Tutor \cite{mat-tutor-cmu-MAIN11}. - -Having the whole problem solving process within a logical coherent system, such a design guarantees correctness of intermediate steps and of the result (which seems essential for math software); and the second advantage is that TP provides a wealth of theories which can be exploited for mechanizing other features essential for educational software. - -\subsection{Generation of User Guidance in EMAs}\label{user-guid} -One essential feature for educational software is feedback to user input and assistance in coming to a solution. - -\paragraph{Checking user input} by ATP during stepwise problem solving is being accomplished by the three projects mentioned above \cite{Back-SD09,ActiveMath-MAIN11,mat-tutor-cmu-MAIN11} exclusively. They model the whole problem solving process as mentioned above, so all what happens between formalized assumptions (or formal specification) and goal (or fulfilled postcondition) can be mechanized. Such mechanization promises to greatly extend the scope of educational software in stepwise problem solving. - -\paragraph{Next step guidance (NSG)} comprises the system's ability to propose a next step; this is a challenge for TP: either a radical restriction of the search space by restriction to very specific problem classes is required, or much care and effort is required in designing possible variants in the process of problem solving \cite{proof-strategies-11}. - -Another approach is restricted to problem solving in engineering domains, where a problem is specified by input, precondition, output and postcondition, and where the postcondition is proven by ATP behind the scenes \cite{wn:lucas-interp-12}: Here the possible variants in the process of problem solving are provided with feedback {\em automatically}, if the problem is described in a TP-based programing language~\cite{plmms10}: the programer only describes the math algorithm without caring about interaction (the respective program is functional and even has no in/output statements~!); interaction is generated as a side-effect by the interpreter --- an efficient separation of concern between math programers and dialog designers promising application all over engineering disciplines. - - -\subsection{Math Authoring in Isabelle/ISAC\label{math-auth}} -Authoring new mathematics knowledge in {\sisac} can be compared with ``application programing'' of engineering problems; most of such programing uses CAS-based programing languages (CAS = Computer Algebra Systems; e.g. Mathematica's \cite{progr-mathematica} or Maple's programing language \cite{prog-maple06}). - -{\sisac}, however, uses a novel type of TP-based language \cite{plmms10} for describing how to construct a solution to an engineering problem and for calling equation solvers, integration, etc~\footnote{Implementation of CAS-like functionality in TP is not primarily concerned with efficiency, but with a didactic question: What to decide for: for high-brow algorithms at the state-of-the-art or for elementary algorithms comprehensible for students~?} within TP; TP can ensure ``systems that never make a mistake'' \cite{casproto} --- are impossible for CAS which have no logics underlying. - -With writing such TP-based programs authoring is perfect, the application programer is not concerned with interaction or with user guidance: this is concern of a novel kind of program interpreter called Lucas-Interpreter \cite{wn:lucas-interp-12}. This interpreter hands over control to a dialog component at each step of calculation (like a debugger at breakpoints) and calls automated TP to check user input following personalized strategies according to a feedback module. - -\medskip -However ``application programing with TP'' is not done with writing a program: according to the principles of TP, each step must be justified. Such justifications are given by theorems. So all steps must be related to some theorem, if there is no such theorem it must be added to the existing knowledge, which is organized in so-called \textbf{theories} in Isabelle. A theorem must be proven; fortunately Isabelle comprises a mechanism (called ``axiomatization''), which allows to omit proofs. Such a theorem is shown in Example~\ref{eg:neuper1}. - -\begin{example} -{\small\begin{tabbing} -123\=123\=123\=123\=\kill -\hfill \\ -\>axiomatization where \\ -\>\> rule1: "1 = $\delta$ [n]" and\\ -\>\> rule2: "|| z || > 1 ==> z / (z - 1) = u [n]" and\\ -\>\> rule3: "|| z || < 1 ==> z / (z - 1) = -u [-n - 1]" and \\ -\>\> rule4: "|| z || > || $\alpha$ || ==> z / (z - $\alpha$) = $\alpha^n$ * u [n]" and\\ -\>\> rule5: "|| z || < || $\alpha$ || ==> z / (z - $\alpha$) = -($\alpha^n$) * u [-n - 1]" and\\ -\>\> rule6: "|| z || > 1 ==> z/(z - 1)$^2$ = n $\cdot$ u [n]" -\end{tabbing} -} -\caption{Axiomatization in Isabelle\label{eg:neuper1}} -\end{example} - -In order to provide TP with logical facts for checking user input, the Lucas-Interpreter requires a \textbf{specification}. Such a specification is shown in Example~\ref{eg:neuper2}. - -\begin{example} -{\small\begin{tabbing} -123,\=postcond \=: \= $\forall \,A^\prime\, u^\prime \,v^\prime.\,$\=\kill -\hfill \\ -Specification no.1:\\ -%\>input\>: $\{\;r={\it arbitraryFix}\;\}$ \\ -\>input \>: $\{\;r\;\}$ \\ -\>precond \>: $0 < r$ \\ -\>output \>: $\{\;A,\; u,v\;\}$ \\ -\>postcond \>:{\small $\;A=2uv-u^2 \;\land\; (\frac{u}{2})^2+(\frac{v}{2})^2=r^2 \;\land$}\\ -\> \>\>{\small $\;\forall \;A^\prime\; u^\prime \;v^\prime.\;(A^\prime=2u^\prime v^\prime-(u^\prime)^2 \land -(\frac{u^\prime}{2})^2+(\frac{v^\prime}{2})^2=r^2) \Longrightarrow A^\prime \leq A$} \\ -\>props\>: $\{\;A=2uv-u^2,\;(\frac{u}{2})^2+(\frac{v}{2})^2=r^2\;\}$ -\end{tabbing} -} -\caption{Specification for the Lucas-Interpreter\label{eg:neuper2}} -\end{example} - -Such a specification is checked before the execution of a program is started, the same applies for sub-programs. In the following example program (Example~\ref{eg:subprob}) the sub-programs are designated by \ttfamily SubProblem \normalfont: - -\begin{example} -\hfill \\ -{\ttfamily \begin{tabbing} -``(L\_L::bool list) = (\=SubProblem (\=Test','' \\ -``\>\>[linear,univariate,equation,test],'' \\ -``\>\>[Test,solve\_linear])'' \\ -``\>[BOOL equ, REAL z])'' \\ -\end{tabbing} -} -{\small\textit{ - \noindent If a program requires a result which has to be calculated first we can use a subproblem to do so. In our specific case we wanted to calculate the zeros of a fraction and used a subproblem to calculate the zeros of the denominator polynom. - }} -\caption{Usage of Subproblems in Programs\label{eg:subprob}} -\end{example} - - -\subsection{Goals of the Thesis}\label{sec:goals} -Imagine a piece of software would be able to support you by understanding every problem class, upcoming in the first years attending university - wouldn't it be great? -\par {{\sisac{}}} tries to do that, but the current state of the art is miles away from this goal and a single implementation of a problem is not enough to change this circumstance. Through this fact it is all the more essential to try, test, research and document the implementation of problem classes from "`real world"' applications. Responding to the abstract at the begin of this document the thesis has two folds; on the one hand certainly to provide interactivee course material for Signal Processing (which means to implement a single problem provided by the Institute of Signal Processing and Speech Communication (SPSC); follow up Calulcations), and to extract experience data respectively help the {{\sisac{}}}-team by setting up a detailed description of technicalities hacking {\sisac{}} on the other hand. - -All the notions are in place to describe the task ``Interactive Course Material for Signal Processing based on Isabelle/{\sisac}'', the main task of this thesis, appropriately by the following points: -\begin{enumerate} -\item Analyze the problems given by the SPSC Lab for mathematics \textbf{knowledge required}, search the knowledge already available in Isabelle/{\sisac}, estimate efforts required to fill the gap between knowledge required and knowledge available, and finally select problems for implementation accordingly. -\item Implement the selected problems in Isabelle/{\sisac}, which means, in appropriate Isabelle theories \textbf{for each problem} implement: - \begin{enumerate} - \item \textbf{Definitions and theorems} required within the specification (including ``descriptions'' for input variables and output variables) and the program (proofs omitted via ``axiomatization'') - \item \textbf{A specification} which describes the input variables, the preconditions on the input (a challenge for rigorously exact mathematics~!), the output variables and the postcondition, which relates input to output such that the problem is characterized formally (another challenge for rigorously exact mathematics~!) - \item \textbf{A program} describing the algorithm which solves the problem, i.e. which constructs output meeting the postcondition. Programming involves identifying the steps (tactics~!) which create the calculation and calling CAS-functions (simplification, equation solvers, etc) appropriately. Modularization of programs into {\tt SubProblems} has to prepare for re-use of code. - \end{enumerate} -\item Add \textbf{multimedia explanations} to each problem (i.e. to specific definitions, theorems, the specification and the program) such that non-expert students (e.g. within \emph{STEOP}, the introductory orientation phase at TUG) get an idea the problem is about. -\item \textbf{Document the implementation} such that - \begin{enumerate} - \item Interactive course material hopefully useful in education within the SPSC and within \emph{STEOP}, the introductory orientation phase at TUG, as a preview for students in Telematics on later application of math knowledge introduced in the first semester and - \item A detailed description of technicalities in programing implemented as an interactivee Isabelle/Isar theory, providing future programers with guidelines and {\sisac}-developers with feedback in usability of the TP-based program language. - \item subsequent application programers have guidelines for further implementation of interactivee course material in SPSC and other engineering sciences - \item {\sisac{}} developers get feedback for ongoing improvement of the TP-based programing language, the respective development environment and the respective program interpreter (called Lucas-Interpreter) - \item development of knowledge for engineering sciences is being motivated in the Isabelle community. - \end{enumerate} -\end{enumerate} - - -\section{Mechanization of Signal Processing Problems}\label{sp} -\subsection{Relevant Knowledge available in Isabelle}\label{know-isab} -Isabelle is developed now for a long time and so we are able to access a huge range of theories and useful snippets. The main problem according this snip sets is that isabelle still is a theorem proofer and not an algebra system. But due the work of the {\sisac}-development team there are already also many calculation examples provided. -\par The SPSC provided a list of problems which are often done wrong or are misunderstood by students in term of the problem classes. Out of these tasks we tried to extract the core operations and looked up which parts are already implemented or useful. The provided problem classes are: -\begin{itemize} - \item Fourier-Transformation - \item Convolution - \item Inverse Z-Transformation and partial fraction decomposition - \item Index transformation -\end{itemize} - -A survey of these selected Problems on their "`correct"' solution can be found in Appendix~\ref{app:calc}. After manually solving this problems we started checking which of them are able to realizable. As already remarked above, isabelle is just a theorem proover due this fact isabelle only provides some theories which are useful for the provided problem classes. -\par Yet, isabelle also has some problems on traditional notation. For example a theory called FFT is already implemented this theory does not provide methods for solving fourier transformation tasks, it only defines the basic condition a fast Fourier transformed expression has to fulfill. -\par For the problems we had a look-on isabelle did not provide specific theories which can be implemented one by one, so a look at the mechanized knowledge in {\sisac} is the next step, therefore follow up Section~\ref{know-isac}. - -\subsection{Relevant Knowledge available in ISAC}\label{know-isac} -{\sisac} already provides a small registry of useful programs and surveys on using isabelle as for solving problems. These snip sets are things like norming rational numbers, solving variate and univariate equations, substitutions, some simple integrals and so on. For a detailed review on the currently implemented theories a look at the {\sisac} project web-page\footnote{http://www.ist.tugraz.at/projects/isac/www/kbase/pbl/index\_pbl.html} is strongly recommended, as the appreciation for this thesis is no describing all parts of {\sisac} in detail. This would also not be possible as {\sisac} is permanently growing. -\par After we differenced {\sisac} and isabelle we are able to introduce two axes in the project. This axes are the specifications (``application axis'' represented as isabelle) and methods (``algorithmic axis'' represented as {\sisac}). -\par During the first weeks of work on this thesis we decided on implementing the Z-Transformation and particullary the included partial fraction decomposion first. The algoritmix axis therefor already provides the knowledge for the following parts: -\begin{description} -\item[Partial Fractions] We now how to handle them and we are able to illustrate them. -\item[Cancellation of multivariate rational terms] Simplification is possible. -\item[Equations] The possibility of solving linear and second order equations is provided, also the possibility to get the left or right hand side of an equation. -\item[Substitution] We are able to substitute given variables in terms, we are also able to subsitude a list of variables in terms. -\end{description} - -\subsection{Survey on Required Knowledge}\label{know-missing} -Following tables (Table~\ref{tab:eff-four},~\ref{tab:eff-conv},~\ref{tab:eff-ztrans}) are showing the expected development effort for specific problems. The values are only very inaccurately approximations of the real work, but needed as a basis for descieding with which problem to start: - -\begin{table} - \centering - \begin{tabular}{p{4cm}|p{5cm}|rp{2.5cm}} - \textbf{Requirements} & \textbf{Comments} &\textbf{Effort}\\ \hline\hline - solving Integrals & simple via properties table & 20\\ - & \emph{real} & MT\\ \hline - transformation table & simple transform & 20\\ \hline - visualisation & backend & 10\\ \hline - example collection & with explanations & 20\\ \hline\hline - \multicolumn{2}{c|}{} & 70-80\\ - \end{tabular} - - \caption{Fourier-Transformation development effort\label{tab:eff-four}} -\end{table} - - -\begin{table} - \centering - \begin{tabular}{p{4cm}|p{5cm}|rp{2.5cm}} - \textbf{Requirements} & \textbf{Comments} &\textbf{Effort}\\ \hline\hline - simplify rationals & {\sisac} & 0\\ \hline - define $\sum\limits_{i=0}^{n}i$ & partly {\sisac} & 10\\ \hline - simplify sum & termorder & 10\\ - & simplify rules & 20\\ - & use simplify rationals& 0\\ \hline - index adjustments & with unit step & 10\\ \hline - example collection & with explanations & 20\\ \hline\hline - \multicolumn{2}{c|}{} & 70-90\\ - \end{tabular} - - \caption{Convolution Operations development effort\label{tab:eff-conv}} -\end{table} - -\begin{table} - \centering - \begin{tabular}{p{4cm}|p{5cm}|rp{2.5cm}} - \textbf{Requirements} & \textbf{Comments} &\textbf{Effort}\\ \hline\hline - solve for part.fract. & {\sisac}: degree 2 & 0\\ - & complex nomminators & 30\\ - & degree > 2 & MT\\ \hline - simplify polynomial & {\sisac} & 0\\ - simplify rational & {\sisac} & 0\\ \hline - partial fraction & degree 2, & 20\\ - decomposition & specification, method& 30\\ \hline - ${\cal Z}^{-1}$ table & explanations, figures& 20\\ \hline - example collection & with explanations & 20\\ \hline\hline - \multicolumn{2}{c|}{} & 90-120\\ - \end{tabular} - -\caption{Z-Transformation development effort\label{tab:eff-ztrans}} -\end{table} - -As conclusion of the summarized efforts it is evident that only one topic can be tried to realized as a baccalaureate thesis. In accord with Dr. Neuper we decided after some practical tests to start with the implementation of the (Inverse) Z-Transformation. The Reason is that this topic can mostly be done with knowledge which was already tried to be mechanized in {\sisac}. - -\subsection{Formalization of missing knowledge in Isabelle} - -A problem behind is the mechanization of mathematic theories in TP-bases languages. There is still a huge gap between these algorithms and this what we want as a solution - in Example Signal Processing. -\begin{example} - \[ - X\cdot(a+b)+Y\cdot(c+d)=aX+bX+cY+dY - \] - {\small\textit{ - \noindent A very simple example on this what we call gap is the simplification above. It is needles to say that it is correct and also Isabelle for fills it correct - \emph{always}. But sometimes we don't want expand such terms, sometimes we want another structure of them. Think of a problem were we now would need only the coefficients of $X$ and $Y$. This is what we call the gap between mechanical simplification and the solution. - }} - \caption{Correct but not useful}\label{eg:gap} -\end{example} -Until we are not able to fill this gap we have to live with it but first have a look on the meaning of this statement: -\par Mechanized math starts from mathematical models and \emph{hopefully} proceeds to match physics. Academic engineering starts from physics (experimentation, measurement) and then proceeds to mathematical modeling and formalization. The process from a physical observance to a mathematical theory is unavoidable bound of setting up a big collection of standards, rules, definition but also exceptions. These are the things making mechanization that difficult. -\begin{example} - \[ - m,\ kg,\ s,\ldots - \] - {\small\textit{ - \noindent Think about some units like that one's above. Behind each unit there is a discerning and very accurate definition: One Meter is the distance the light travels, in a vacuum, through the time of 1 / 299.792.458 second; one kilogram is the weight of a platinum-iridium cylinder in paris; and so on. But are these definitions usable in a computer mechanized world?! - }} - \caption{Units in measurement}\label{eg:units} -\end{example} -\par A computer or a TP-System builds on programs with predefined logical rules and does not know any mathematical trick (follow up example \ref{eg:trick}) or recipe to walk around difficult expressions. -\begin{example} -\[ \frac{1}{j\omega}\cdot\left(e^{-j\omega}-e^{j3\omega}\right)= \] -\[ \frac{1}{j\omega}\cdot e^{-j2\omega}\cdot\left(e^{j\omega}-e^{-j\omega}\right)= - \frac{1}{\omega}\, e^{-j2\omega}\cdot\colorbox{lgray}{$\frac{1}{j}\,\left(e^{j\omega}-e^{-j\omega}\right)$}= \] -\[ \frac{1}{\omega}\, e^{-j2\omega}\cdot\colorbox{lgray}{$2\, sin(\omega)$} \] - {\small\textit{ - \noindent Sometimes it is also useful to be able to apply some \emph{tricks} to get a beautiful and particularly meaningful result, which we are able to interpret. But as seen in this example it can be hard to find out what operations have to be done to transform a result into a meaningful one. - }} - \caption{Mathematic tricks}\label{eg:trick} -\end{example} -For such a system the only possibility is to work through its known definitions and stops if none of these fits. Specified on Signal Processing or any other application it is often possible to walk through by doing simple creases. This creases are in generell based on simple math operatiopms but the challenge is to teach the machine \emph{all}\footnote{Its pride to call it \emph{all}.} of them. Unfortunately the goal of TP Isabelle is to reach a high level of \emph{all} but it in real it will still be a survey of knowledge which links to other knowledge and {\sisac{}} a trainer and helper but no human compensating calculator. -\par {{\sisac{}}} itself aims to adds an \emph{application} axis (formal specifications of problems out of topics from Signal Processing, etc.) and an \emph{algorithmic} axis to the \emph{deductive} axis of physical knowledge. The result is a three-dimensional universe of mathematics seen in Figure~\ref{fig:mathuni}. - -\begin{figure} -\hfill \\ - \begin{center} - \includegraphics[scale=0.7]{math-universe} - \end{center} - \caption{Three-dimensional universe of mathematics\label{fig:mathuni}} -\end{figure} - -\subsection{Notes on Problems with Traditional Notation} -Due the thesis work we discovers sever ell problems of traditional notations. Some of them have been known in computer science for many years now and are still unsolved, one of them aggregates with the so called \emph{Lambda Calculus}, Example~\ref{eg:lamda} provides a look on the problem that embarrassed us. - -\begin{example} - -\[ f(x)=\ldots\; \quad R \rightarrow \quad R \] - - -\[ f(p)=\ldots\; p \in \quad R \] - - {\small\textit{ - \noindent Above we see two equations. The first equation aims to be a mapping of an function from the reell range to the reell one, but when we change only one letter we get the second equation which usually aims to insert a reel point $p$ into the reell function. In computer science now we have the problem to tell the machine (TP) the difference between this two notations. This Problem is called Lambda Calculus. - }} - \caption{Towards the Lambda Calculus\label{eg:lamda}} -\end{example} - -An other problem is that terms are not full simplified in traditional notations, in {\sisac} we have to simplify them complete to check weather results are compatible or not. in e.g. the solutions of an second order linear equation is an rational in {\sisac} but in tradition we keep fractions as long as possible and as long as they aim to be 'beautiful' (1/8, 5/16,...). - -The math which should be mechanized in Computer Theorem Provers (\emph{TP}) has (almost) a problem with traditional notations (predicate calculus) for axioms, definitions, lemmas, theorems as a computer program or script is not able to interpret every Greek or Latin letter and every Greek, Latin or whatever calculations symbol. Also if we would be able to handle these symbols we still have a problem to interpret them at all. (Follow up \hbox{Example \ref{eg:symbint1}}) - -\begin{example} - \[ - u\left[n\right] \ \ldots \ unitstep - \] - {\small\textit{ - \noindent The unitstep is something we need to solve Signal Processing problem classes. But in {{\sisac{}}} the rectangular brackets have a different meaning. So we abuse them for our requirements. We get something which is not defined, but usable. The Result is syntax only without semantic. - }} - \caption{Expression Interpretation}\label{eg:symbint1} -\end{example} - -\noindent In different problems, symbols and letters have different meanings and ask for different ways to get through. (Follow up \hbox{Example \ref{eg:symbint2}}) -\begin{example} - \[ - \widehat{\ }\ \widehat{\ }\ \widehat{\ } \ \ldots \ exponent - \] - {\small\textit{ - \noindent For using exponents the three widehat symbols are required. The reason for that is due the development of {{\sisac{}}} the single widehat and also the double were already in use for different operations. - }} - \caption{Symbol Interpretation}\label{eg:symbint2} -\end{example} -Exclusive from the input, also the output can be a problem. We are familiar with a specified notations and style taught in university but a computer program has no knowledge of the form proved by a professor and the machines themselves also have not yet the possibilities to print every symbol (correct) Recent developments provide proofs in a human readable format but according to the fact that there is no money for good working formel editors yet, the style is one thing we have to live with. - -\section{Project Controlling} -We decided to split the thesis into five Iteration defined in Section~\ref{sec:milesurv}. As there is also a lot of work to do outer the thesis we accord on an increased contact by mail. For the coordination of the whole {\sisac} files i got access to the mercurial repository. We also appointed on periodic team meetings. - -\subsection{Survey on Milestones\label{sec:milesurv}} -Doing something completely new requires a good controlling, the thesis itself also needs it. After the first meetings and the definition of the intrinsic work we decided on splitting the thesis into the following iterations. -\begin{description} - \item[1st Iteration] Information Collection - \item[2nd Iteration] Problem Selection - \item[3rd Iteration] Implementation - \item[4th Iteration] Thesis Writing - \item[5th Iteration] Finalization -\end{description} -A more detailed description of this milestones can be found in Section~\ref{sec:detmile}. - -\subsection{Milestone Details\label{sec:detmile}} -\begin{description} - \item[Information Collection] The first iteration starts by an introduction to the {\sisac} System and ends up with the first presentation. Listeners of the first presentation were \em Dr. Walther Neuper \normalfont and \em DI Bernhard Geiger\normalfont. We talked about common SPSC problems and the possibilities of realize them in the {\sisac} System. In preparation of the Presentation \em DI Geiger \normalfont sent us a few example problems and we had a experimental survey about the realization effort. - \item[Problem Selection] In the second iteration we collected informations about the knowledge mechanized in {\sisac} (cf. Section~\ref{know-isab}). After the first iteration it was clear that implementing of problems in {\sisac} requires a higher effort than originally expected due this fact the second iteration ends up on the decision which of the provided problems is going to be implemented. We wrote and collected a handful of experimental scripts regarding sums, Fourier transformation and partial fraction decomposition. - \item[Implementation] Unfortunately the biggest and most important part is the implementation. The iteration started with the decision on the problem and ends up by finishing the test Script (seen in Part~\ref{part:impl}) as well as the integration of this work into the {\sisac}-Knowledge. For a better controlling and result of this iteration we had severe ll regular meetings (\em Dr. Neuper \normalfont and \em Jan Ro\v{c}nik\normalfont) and contact over e-mail to assess the state of the {\sisac}-developers work. - \item[Thesis Writing] One part of this thesis is generated automatically out of \ttfamily Build\_Inverse\_Z\_Transform\normalfont. Maybe this part well be the most important result of the thesis as it will be used as a documentation for the upcoming developers. Due this fact this iteration started also contemporaneous with the implementation but ends up separate after finishing the implementation with describing the needed theory and background. - \item[Finalization] The work ends up with the last iteration - finalization. It is started by completing the written thesis and the preparation of the second presentation which concludes this project. In the second presentation we will have demonstrated our realized problem embedded in the new {\sisac}-frontend as well as the work, hiding behind. We will also want to give a clear view about the power of {\sisac} and animate the attending agents to go on working within this project. -\end{description} - -%\clearpage - -%----------// PART 2 \\----------% - -\newevenside - -\part{Implementation\label{part:impl}} -\input{./preambleForGeneratedDocuments.tex} -\par Please be aware that this is only a part of the thesis output, also follow up the theories and according tests that have been improved or created by me and are involved to the work on this thesis: -\begin{itemize} -\item \ttfamily Partial\_Fractions.thy \normalfont - \ttfamily partial\_fractions.sml \normalfont -\item \ttfamily Inverse\_Z\_Transformation.thy \normalfont - \ttfamily inverse\_z\_transformation.sml \normalfont -\item \ttfamily Rational.thy \normalfont - \ttfamily rational.sml \normalfont -\end{itemize} -\HRule -%\setcounter{section}{0} -\input{../../../test/Tools/isac/ADDTESTS/course/SignalProcess/document/Build_Inverse_Z_Transform} - -\clearpage - -%----------// PART 3 \\----------% - -\newevenside -\part{Thesis Summary and Review} -\section{Related Work}\label{sec:related} -Unusual for a Baccalaureate Thesis, there is {\em no} related work; this requires explanation. -Of course, this thesis relies on front-of-the wave computer mathematics, on TP. But {{\sisac{}}} uses TP in a very specific way, which is too weakly related to other work: programing in the TP-based language and rigorous formal specification of problems in Signal Processing where the main tasks in the practical part of this thesis. The major challenge for the practical work was given by the fact, that the work concerned alpha-testing of the TP-based programing environment. -\par Another area of work could be considered as related work: authoring of e-learning content. However, {{\sisac{}}} provides division of concern such that the practical part of this thesis could focus on computer mathematics; this work was not concerned with interaction (the TP-based programing language has neither input statements nor output statements), nor with dialog guidance nor with any kind of learning theory. -\par These two reasons are given for the unusual statement, that there is no related work to be discussed in this thesis. - -\section{Issues and Open Questions} -At the end of the first Iteration we agreed on a view issues that might have to be accomplished during the thesis. This Issues were: -\begin{itemize} - \item What knowledge is already mechanized in \emph{Isabelle}? - \item How can missing theorems and definitions be mechanized? - \item What is the effort for such mechanization? - \item How do calculations look like, by using mechanized knowledge? - \item What problems and subproblems have to be solved? - \item Which problems are already implemented in {\sisac}? - \item How are the new problems specified ({\sisac})? - \item Which variants of programs in {\sisac} solve the problems? - \item What is the contents of the interactive course material (Figures, etc.)? -\end{itemize} -The significant part of this list was declared during the thesis. Next sections will review the most important items, regardless they where accomplished or not. - -\subsection{Accomplished} -We discovered the process how missing theorems and definitions can be mechanized and used this knowledge to implement new material. Now we ware able to solve partial fractions, we built theorems, specification and program. We completed the background work for interactive solving them. The same thing applies to the inverse Z-transformation with partial fractions; we built theorems, specification and program to step through an amount of exercises. But the most important accomplished part is the Isabelle theory (\ttfamily Build\_Inverse\_Z\_Transform.thy\normalfont) indicating issues for the coming {\sisac}-developers. Until we were not able to fulfill all the things we wanted, this is the most recent work and will be the headstone for the further work on {\sisac}. -\par Expect the necessary theories for solving the mentioned part and the guideline we also put tests for the new theories to the system and added some new methods to existing theories with their according tests. Also we were able to answer the questions about the mechanized knowledge in \emph{isabelle} and {\sisac}. We checked the required effort to add new material to the system and we walked through the question what subproblems have to be solved and how they are declared, when adding new material. Now we also know how problems are declared and which variants exist to solve them. All this can be found in this thesis. -\subsection{Partially Accomplished} -As already told upwards, we accomplished a guideline for upcoming {\sisac}-developers this was a very important and necessary task; but through upcoming changes in the development environment and programing language there is a need for more descriptions and informations. This changes are not yet fulfilled and so it was not possible to include a correct guideline fot them in our example theory or this thesis. -\par Also we were not able to provide a representative count of example problems for partial fractions or the inverse Z-Transformation. We are able to say that our accomplished material can handle one problem each, exactly as we wanted and it is toughed but due to less time we have no more experience data. -\subsection{Not Accomplished} -The properly longest item is the list with the not accomplished issues, but there is no need to count this as a negative aspect due the fact that we collected experience data for following needs: -\par We were not able to put explanations, figures to examples, theorem descriptions and problem description to our course material. The reason for that was the time at one side and the ongoing restructuration of the system on the other side. -\par Only a sufficient number of topics was implemented. There were more problems to solve than we expected. We were only able to implement one from the SPSC given tasks m entered in Appendix~\ref{app:calc}. Due this fact the material we got as an output of the thesis will be no support for labs or lectures at the SPSC and also no material for the STEOP, which also was a big wish at the beginning. -\subsection{Open Questions and Work} -At the end of this thesis there is now part left unattended, but many parts that require beauty corrections and many parts that require a few more manpower. This upcoming open tasks are: -\begin{itemize} - \item What is the contents of the interactive course material (Figures, etc.)? - \item What are the pre and post conditions of the problems? - \item How would a correct implementation of the Z-Transformation look like? - \item What do students expect of this implementation? -\end{itemize} -To complete the task of creating course material describing the needed steps to do a partial fraction or inverse Z-Transformation in {\sisac} the real effort is not conceivable. But for a first usable version only a few steps are left to do this steps would be: -\begin{enumerate} - \item Cleanup the\ttfamily InverseZTransformation.thy\normalfont file and put it into the {\sisac} knowledge tree like it was done with\ttfamily PartialFractions.thy\normalfont. - \item Create a good example program and test it. - \item Describe the used theories with the mathematic definitions and background. - \item Add figures and small examples. -\end{enumerate} -There are also needs on finishing other parts to get a complete part of course material but this would be the steps to get a first usable version. - -\section{Conclusion and Personal Experience} -After working on {\sisac} for month, it is hard do find the right words about the system. For sure the system itself is a great idea and it would have been a big relaxation if i would have been able to use this system in the last years for sever ell subjects. But for me the biggest disadvantage of {\sisac} is the frontend until there is no mathematical notation and visualisation of simply fractions i don't think that i or other students would be able to use it for learning. I also think that for learning there is no need of complex examples or complex solutions, examples have to be simple but also have to cover all necessary steps of a calculation. Unfortunately there exist different learning types and I'm a visual one, what is also the explanation for my maybe drastic explanation. -\par About the backend, what finally was my main work there is not much left to say. The programing language requires a long time to work in and to find out how decelerations work and how isabelle and {\sisac} is build up, maybe this period of collecting informations is to long for a Bakk. Thesis. Also it is hard to find informations about the theories until there was no related work and no usable documentation wether for {\sisac} nor for isabelle or ML. -\par When working within the {\sisac} sources you often hung up on problems which would be simple to solve but are hard to discover, therefor it was often necessary to make breaks and define concrete steps on problem solving. Also when having a plan of the upcoming implementation I had to break myself out to do not to much step at once. Often its better to implement small parts and test, write tests and wait then hurrying up. An other aspect is that it was necessary to build {\sisac} from scratch after every change; this and the fact that my finally theories had over 1000 lines often made the development process to a stop and go dilemma. -\par Finally I have to say a big \bfseries thank you \normalfont to Dr.~Neuper who invested a lot of his time in my thesis and the {\sisac} project, I remember some hard and long meetings but finally I look back glad. - -\subsection{Anecdotes} -At the very beginning of the thesis i made some calculations and thoughed of every step more than twice. This calculations were the ground stone of my work, we build every step in the calculation following up the real calculations - when doing them by hand. Time went on and after adding the last commands to the programm for applying the transformation ruleset i compared the results - oh wonder there was a mistake in my calculation :) -\begin{center} -Thank you {\sisac}! -\end{center} - -%----------// BIB \\-----------% - -\renewcommand{\refname}{\section{References}} -\bibliographystyle{alpha} -\bibliography{references} -\clearpage - -%----------// APPENDIX \\-----------% -\newevenside -\part{Appendix} -\appendix -%----------// WORK TIME \\-----------% - - -\section{Record of Working Time} -\begin{footnotesize} -\begin{longtable}{l p{6.5cm} c c r} -{\bf Date} & {\bf Description} & {\bf Begin} & {\bf End} & {\bf Dur.}\\ -\hline \hline -\endhead - -\hline - \multicolumn{5}{r}{{Continued on next page}} \\ -\hline -\endfoot - -\hline -\hline -\endlastfoot - -\multicolumn{5}{l}{Start 1st Iteration} \\ -\hline -29.06.2011 & Meeting Dr. Neuper and DI Geiger & 15:00 & 17:30 & 2,50 \\ -02.07.2011 & Working on Examples from DI Geiger & 20:00 & 21:30 & 1,50 \\ -03.07.2011 & Working on Examples from DI Geiger & 21:00 & 22:45 & 1,75 \\ -05.07.2011 & Meeting Dr. Neuper, Information Exchange & 10:00 & 13:00 & 3,00 \\ -06.07.2011 & Installing Isabelle & 20:00 & 22:30 & 2,50 \\ -07.07.2011 & Meeting Dr. Neuper, present-1 & 14:45 & 16:15 & 1,50 \\ -18.07.2011 & Meeting Dr. Neuper, present-1 Structure & 14:15 & 16:00 & 1,75 \\ -19.07.2011 & Meeting Dr. Neuper, present-1 Content & 07:20 & 09:20 & 2,00\\ -19.07.2011 & Meeting Dr. Neuper & 10:00 & 12:00 & 2,00\\ -21.07.2011 & HG Error Correction, Latex for Thesis & 11:10 & 14:00 & 2,83\\ -22.07.2011 & Meeting Dr. Neuper & 10:00 & 12:00 & 2,00\\ -23.07.2011 & Latex for Calculations & 13:45 & 16:30 & 2,75\\ -24.07.2011 & Meeting Dr. Neuper, present-1 & 20:10 & 20:40 & 0,50\\ -25.07.2011 & Meeting Dr. Neuper, present-1 & 15:15 & 17:55 & 2,67\\ -26.07.2011 & Work on Test\_Complex.thy & 10:45 & 12:10 & 1,42\\ -27.07.2011 & present-1 (Dr. Neuper, DI Geiger) & 10:00 & 12:00 & 2,00\\ -\hline -\multicolumn{5}{l}{End 1st Iteration} \\ -\multicolumn{5}{l}{Start 2nd Iteration} \\ -\hline -02.09.2011 & Meeting Dr. Neuper, Latex for Thesis & 08:30 & 10:20 & 1,83\\ -05.09.2011 & Meeting Dr. Neuper, Partial\_Frations.thy & 09:30 & 12:45 & 3,25\\ -05.09.2011 & Partial\_Fractions.thy & 17:10 & 18:30 & 1,33\\ -06.09.2011 & Documentation Partial\_Fractions.thy & 10:00 & 13:15 & 3,25\\ -07.09.2011 & Meeting Dr. Neuper, ML Introduction & 10:00 & 12:50 & 2,83\\ -08.09.2011 & Preparing Scripts for Latex Output & 19:00 & 22:45 & 3,75\\ -09.09.2011 & Preparing Scripts for Latex Output & 11:40 & 15:00 & 3,33\\ -10.09.2011 & Meeting Dr. Neuper, Latex Output, HG Errors & 10:00 & 12:00 & 2,00\\ -\hline -\multicolumn{5}{l}{End 2nd Iteration} \\ -\multicolumn{5}{l}{Start 3rd and 4th Iteration} \\ -\hline -14.09.2011 & Start on Inverse\_Z\_Transf. Script & 09:10 & 12:25 & 3,25\\ -16.09.2011 & Information Exchange Sums & 13:15 & 16:00 & 2,75\\ -19.09.2011 & Programming on Inverse\_Z\_Transf. & 10:00 & 13:10 & 3,17\\ -20.09.2011 & Meeting Dr. Neuper, Inverse\_Z\_Transf. Script & 15:30 & 18:10 & 2,67\\ -23.09.2011 & New IsaMakefile for Latex generation & 13:00 & 14:30 & 1,50\\ -23.09.2011 & Meeting Dr. Neuper, Inverse\_Z\_Transf. Script & 14:30 & 17:30 & 3,00\\ -26.09.2011 & Partial\_Fractions.thy, get\_Argument & 13:30 & 16:15 & 2,75\\ -27.09.2011 & Meeting Dr. Neuper, HG Error & 09:00 & 12:20 & 3,33\\ -28.09.2011 & Meeting Dr. Neuper, Hierarchy Reconstruction & 10:00 & 12:30 & 2,50\\ -01.10.2011 & Some Testing & 10:00 & 11:00 & 1,00\\ -02.10.2011 & Inverse\_Z\_Transf. Errors & 15:00 & 16:10 & 1,17\\ -06.10.2011 & Meeting Dr. Neuper & 15:00 & 17:50 & 2,83\\ -07.10.2011 & Meeting Dr. Neuper, Inverse\_Z\_Transf. Script & 15:00 & 16:50 & 1,83\\ -09.10.2011 & Work on Thesis & 16:30 & 18:45 & 2,25\\ -11.10.2011 & Meeting Dr. Neuper, Abstract & 14:10 & 17:10 & 3,00\\ -13.10.2011 & Work on Thesis, Implemention part & 08:30 & 10:00 & 1,50\\ -18.10.2011 & Work on Thesis & 20:30 & 22:50 & 2,33\\ -19.10.2011 & Work on Thesis & 21:20 & 23:40 & 2,33\\ -20.10.2011 & Work on Thesis & 08:45 & 10:45 & 2,00\\ -25.10.2011 & Meeting Dr. Neuper: thesis review & 08:00 & 10:00 & 2,00\\ -25.10.2011 & Reorganising after meeting & 20:10 & 23:50 & 3,67\\ -26.10.2011 & Reorganising after meeting, examples in thesis & 08:30 & 11:10 & 2,67\\ -07.11.2011 & Meeting Preparation & 16:30 & 17:15 & 0,75\\ -08.11.2011 & Meeting Dr. Neuper: thesis addons & 16:00 & 17:30 & 1,50\\ -12.11.2011 & Reorganization after meeting & 21:10 & 22:30 & 1,33\\ -20.11.2011 & Review of Inv\_Z\_Trans & 10:15 & 13:30 & 3,25\\ -21.11.2011 & get\_numerator & 12:15 & 14:30 & 2,25\\ -23.11.2011 & get\_numerator & 20:30 & 21:15 & 0,75\\ -24.11.2011 & get\_numerator final & 14:10 & 15:30 & 1,33\\ -28.11.2011 & tried to go on in build\_inverse\_ & 11:00 & 13:10 & 2,17\\ -01.12.2012 & Tuning Invers\_Z\_Tansf. Script & 16:15 & 19:30 & 3,25\\ -04.12.2012 & Moved Some Tests to Knowledge & 15:30 & 18:15 & 2,75\\ -05.12.2012 & Tuning Invers\_Z\_Tansf. Script & 13:10 & 14:15 & 1,08\\ -08.12.2012 & Inverse\_Z\_Tansf. Script, Factors from Solution & 14:30 & 16:15 & 1,75\\ -10.12.2012 & Moved Some Tests to Knowledge & 20:10 & 23:00 & 2,83\\ -11.12.2012 & Inverse\_Z\_Tansf. Script, PBZ Ansatz & 10:10 & 12:30 & 2,33\\ -12.12.2012 & Inverse\_Z\_Tansf. Script, Subsitution & 09:00 & 11:30 & 2,50\\ -16.12.2012 & Tuning Invers\_Z\_Tansf. Script & 17:15 & 18:45 & 1,50\\ -19.12.2012 & Tuning Invers\_Z\_Tansf. Script & 19:00 & 20:30 & 1,50\\ -14.01.2012 & Inverse\_Z\_Tansf. Script, Substitution & 18:45 & 20:30 & 1,75\\ -22.01.2012 & Inverse\_Z\_Transf. Script, Calc Coeff. & 20:10 & 21:45 & 1,58\\ -12.02.2012 & Inverse\_Z\_Transf. Script & 17:30 & 19:00 & 1,50\\ -13.02.2012 & Finished Work on Inverse\_Z\_Transf. Script & 19:30 & 22:10 & 2,67\\ -14.02.2012 & Formatting for Latex output & 09:00 & 14:45 & 5,75\\ -15.02.2012 & Formatting for Latex output & 10:00 & 15:30 & 5,50\\ -16.02.2012 & Going on Work on Thesis & 14:45 & 18:30 & 3,75\\ -17.02.2012 & Tuning Invers\_Z\_Tansf. Script & 18:30 & 19:45 & 1,25\\ -19.02.2012 & Meeting Dr. Neuper, present-2 & 09:00 & 13:30 & 4,50\\ -19.02.2012 & Meeting Dr. Neuper, Integration of work to Isac & 15:00 & 19:10 & 4,17\\ -20.02.2012 & Meeting Dr. Neuper, Integration of work to Isac & 09:00 & 12:45 & 3,75\\ -20.02.2012 & Meeting Dr. Neuper, Integration of work to Isac & 14:10 & 18:30 & 4,33\\ -\hline -\multicolumn{5}{l}{End 3rd Iteration}\\ -\hline -20.02.2012 & Finishing Thesis & 20:30 & 22:50 & 2,33\\ -21.02.2012 & Finishing Thesis & 13:30 & 14:45 & 1,25\\ -02.03.2012 & Finishing Thesis & 15:45 & 19:00 & 3,25\\ -06.03.2012 & Finishing Thesis & 09:15 & 10:30 & 1,25\\ -07.03.2012 & Finishing Thesis & 13:15 & 16:00 & 2,75\\ -\hline -\multicolumn{5}{l}{End 4th Iteration} \\ -\multicolumn{5}{l}{Start 5th Iteration} \\ -\hline -26.02.2012 & Preparing present-2 & 09:30 & 13:00 & 3,5 \\ -20.03.2012 & Preparing present-2 & 14:00 & 16:30 & 2,5 \\ -08.05.2012 & Meeting Dr. Neuper, present-2, work on isac & 08:00 & 12:00 & 4,0 \\ -08.05.2012 & present-2 & 14:00 & 15:00 & 1,0 \\ -\hline -\multicolumn{5}{l}{End 5th Iteration} \\ -\hline -\multicolumn{4}{l}{Total working time:} & 203 \\ -\end{longtable} -\end{footnotesize} - -%----------// CALCULATIONS \\-----------% - -\newevenside -\section{Calculations\label{app:calc}} -\input{calulations} -\end{document} - diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/final/jrocnik_present1.tex --- a/src/Doc/isac/jrocnik/final/jrocnik_present1.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,434 +0,0 @@ - -\documentclass{beamer} - - -\mode -{ - \usetheme{Hannover} - \setbeamercovered{transparent} -} - -\usepackage[english]{babel} -\usepackage[utf8]{inputenc} -\usepackage{times} -\usepackage[T1]{fontenc} - -\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} -\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} - -\title[SPSC in \isac] % (optional, use only with long paper titles) -{Interactive Course Material\\ for Signal Processing\\ based on Isabelle/\isac} - -\subtitle{Baccalaureate Thesis} - -\author[Ro\v{c}nik] -{Jan Rocnik} - -\institute % (optional, but mostly needed) -{ - Technische Universit\"at Graz\\ - Institut f\"ur TODO -} - -% If you have a file called "university-logo-filename.xxx", where xxx -% is a graphic format that can be processed by latex or pdflatex, -% resp., then you can add a logo as follows: - -% \pgfdeclareimage[height=0.5cm]{university-logo}{university-logo-filename} -% \logo{\pgfuseimage{university-logo}} - - - -% Delete this, if you do not want the table of contents to pop up at -% the beginning of each subsection: -\AtBeginSubsection[] -{ - \begin{frame}{Outline} - \tableofcontents[currentsection,currentsubsection] - \end{frame} -} - -\begin{document} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Title Page %% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{frame} - \titlepage -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Table of Contents %% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{frame}{Outline} - \tableofcontents - % You might wish to add the option [pausesections] -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%---------------------------------------------------------------%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\section[Intro]{Introduction} - -\begin{frame}{Issues to be Accomplished} - -\begin{itemize} - -\item What knowledge is already mechanised in \emph{Isabelle}? -\item How can missing theorems and definitions be mechanised? -\item What is the effort for such mechanisation? -\item How do calculations look like, by using mechanised knowledge? -\item What problems and subproblems have to be solved? -\item Which problems are already implemented in \sisac? -\item How are the new problems specified (\sisac)? -\item Which variantes of programms in \sisac\ solve the problems? -\item What is the contents of the interactiv course material (Figures, etc.)? - -\end{itemize} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%---------------------------------------------------------------%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\section[Fourier]{Fourier transformation} -\subsection[Fourier]{Fourier transform} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Fourier INTRO %% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{frame}\frametitle{Fourier Transformation: Introduction} -Possibilities: -\begin{itemize} -\item Transform operation by using property-tables -\item Transform operation by using integral -\end{itemize} -Also Important: -\begin{itemize} -\item Visualisation?! -\end{itemize} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Transform expl SPEC %% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{frame}\frametitle{Fourier Transformation: Specification} -{\footnotesize - -Determine the fourier transform for the given rectangular impulse: - -\begin{center} -$x(t)= \left\{ - \begin{array}{lr} - 1 & -1\leq t\leq1\\ - 0 & else - \end{array} - \right.$ -\end{center} - -\hrulefill - -\begin{tabbing} -1\=postcond \=: \= \= $\;\;\;\;$\=\kill -\>given \>:\> piecewise\_function \\ -\> \> \> \>$fun (x (t::real),\ x=1\ ((t>=-1)\ \&\ (t<=1)),\ x=0)$\\ -\>precond \>:\> TODO\\ -\>find \>:\> $X(j\cdot\omega)$\\ -\>postcond \>:\> TODO\\ -\end{tabbing} - -} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Transform expl REQ %% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{frame}\frametitle{Fourier Transform: Development effort} -{\small -\begin{center} -\begin{tabular}{l|l|r} -requirements & comments &effort\\ \hline\hline -solving Intrgrals & simple via propertie table & 20\\ - & \emph{real} & MT\\ \hline -transformation table & simple transform & 20\\ \hline -visualisation & backend & 10\\ \hline -example collection & with explanations & 20\\ \hline\hline - & & 70-80\\ -\end{tabular} -\end{center} -effort --- in 45min units\\ -MT --- thesis ``Integrals'' (mathematics) -} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%--------------------FOURIER---Conclusion-----------------------%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{frame}{Fourier Transformation: Summary} -\begin{itemize} - -\item Standard integrals can be solved with tables -\item No real integration (yet avaible) -\item Math \emph{tricks} difficult to implement - - -\end{itemize} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%-----------------------------------------------------------------% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\section[LTI Systems]{LTI systems} -\subsection[Convolution]{Convolution (Faltung)} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% LTI INTRO %% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{frame}\frametitle{Convolution: Introduction} -\begin{itemize} -\item Calculation include sums -\item Demonstrative examples -\item Visualisation is important -\end{itemize} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% LTI SPEC %% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{frame}\frametitle{Convolution: Specification} -{\footnotesize - -Consider the two discrete-time, linear and time-invariant (LTI) systems with the following impulse response: - -\begin{center} -$h_1[n]=\left(\frac{3}{5}\right)^n\cdot u[n]$\\ -$h_1[n]=\left(-\frac{2}{3}\right)^n\cdot u[n]$ -\end{center} - -The two systems are cascaded seriell. Derive the impulse respinse of the overall system $h_c[n]$. - -\hrulefill - -\begin{tabbing} -1\=postcond \=: \= \= $\;\;\;\;$\=\kill -\>given \>:\> Signals h1[n], h2[n] \\ -\> \> \> \>((h1[n]=(3/5)\textasciicircum{}n*u[n]),\,h2[n]=(-2/3)\textasciicircum{}n*u[n]))\\ - -\>precond \>:\> TODO\\ -\>find \>:\> $h1[n]\,*\,h2[n]$\\ -\>postcond \>:\> TODO\\ -\end{tabbing} - -} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% LTI REQ %% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{frame}\frametitle{Convolution: Development effort} -{\small -\begin{center} -\begin{tabular}{l|l|r} -requirements & comments &effort\\ \hline\hline -simplify rationals & \sisac & 0\\ \hline -define $\sum\limits_{i=0}^{n}i$ & partly \sisac & 10\\ \hline -simplify sum & termorder & 10\\ - & simplify rules & 20\\ - & use simplify rationals& 0\\ \hline -index adjustments & with unit step & 10\\ \hline -example collection & with explanations & 20\\ \hline\hline - & & 70-90\\ -\end{tabular} -\end{center} -effort --- in 45min units\\ -} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%--------------------LTI-------Conclusion-----------------------%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{frame}{Convolution: Summary} -\begin{itemize} - -\item Standard example -\item Straight forward -\item Challenge are sum limits - -\end{itemize} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%-----------------------------------------------------------------% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\section[Z-transform]{Z-Transform} -\subsection[(Inverse) Z-Transform]{(Inverse) Z-Transform} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Z-Transform INTRO %% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{frame}\frametitle{(Inverse) ${\cal Z}$-Transformation: Introduction} -\begin{itemize} -\item Pure Transformation is simple to realise with Z-Transform Properties (Table) -\item Partial Fraction are just math simplifications -\end{itemize} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Z-Transform SPEC %% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{frame}\frametitle{(Inverse) Z-Transformation: Specification} -{\footnotesize - -Determine the inverse z transform of the following expression. Hint: applay the partial fraction expansion. - -\begin{center} -$X(z)=\frac{3}{z-\frac{1}{4}-\frac{1}{8}z^{-1}},\ \ x[n]$ is absolute summable -\end{center} - - -\hrulefill - -\begin{tabbing} -1\=postcond \=: \= \= $\;\;\;\;$\=\kill -\>given \>:\> Expression of z \\ -\> \> \> \>(X (z::complex),3/(z-1/4-1/8\,z\textasciicircum{}(-1)))\\ -\>precond \>:\> TODO\\ -\>find \>:\> Expression of n\\ -\> \> \> \>$h[n]$\\ -\>postcond \>:\> TODO\\ -\end{tabbing} - -} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Z expl REQ %% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -\begin{frame}\frametitle{(Inverse) Z-Transformation: Development effort} -{\small -\begin{center} -\begin{tabular}{l|l|r} -requirements & comments &effort\\ \hline\hline -solve for part.fract. & \sisac: degree 2 & 0\\ - & complex nomminators & 30\\ - & degree > 2 & MT\\ \hline -simplify polynomial & \sisac & 0\\ -simplify rational & \sisac & 0\\ \hline -part.fract.decomposition& degree 2 & \\ - & specification, method& 30\\ \hline -${\cal Z}^{-1}$ table & & 20\\ - & explanations, figures& 20\\ \hline -example collection & with explanations & 20\\ \hline\hline - & & 90-120\\ -% & & 1 MT -\end{tabular} -\end{center} -effort --- in 45min units\\ -MT --- thesis ``factorization'' (mathematics) -} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%--------------------Z-TRANS---Conclusion-----------------------%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{frame}{(Inverse) Z-Transformation: Summary} -\begin{itemize} - -\item No \emph{higher} math operations -\item Different subproblems of math (equation systems, etc.) -\item Both directions have the same effort - -\end{itemize} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%-----------------------------------------------------------------% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\section[Conclusions]{Conclusions} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%--------------------------DEMONSTRATION--------------------------% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{frame}{Demonstration} - -\centering{Demonstration} - -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%--------------------------CONCLUSION-----------------------------% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{frame}{Conclusions} - -Design Challanges: - -{\small -\begin{itemize} - -\item Pre and Post conditions -\item Exact mathematic behind functions -\item Accurate mathematic notation - -\end{itemize} -} - -Goals: -{\small -\begin{itemize} - -\item Spot the power of \sisac -\item Implementation of generell but simple math problems -\item Setting up a good first guideline (documentation) for furher problem implemenations - -\end{itemize} - -\centering{Efforts are only approximations, due we have no \emph{real} experience data!} -} - -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%--------------------------TIME LINE------------------------------% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{frame}{Comming up} - -{\small -\begin{tabular}{l r} - -Juli 2011 & project startup\\ -Juli 2011 & information collection, 1st presentation\\ -August 2011 & extern traineeship\\ -September 2011 & main work\\ -after Oktober & finishing, documentation\\ - -\end{tabular} -} - -\end{frame} - - -\end{document} - - diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/final/jrocnik_present2.tex --- a/src/Doc/isac/jrocnik/final/jrocnik_present2.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,299 +0,0 @@ -\documentclass[% -%handout, % prints handouts (=no animations, for printed version) -%mathserif -%xcolor=pst, -14pt -% fleqn -]{beamer} - -\usepackage{beamerthemedefault} - -\usepackage{color} -\definecolor{lgray}{RGB}{238,238,238} - -\useoutertheme[subsection=false]{smoothbars} -\useinnertheme{circles} - -\setbeamercolor{block title}{fg=black,bg=gray} -\setbeamercolor{block title alerted}{use=alerted text,fg=black,bg=alerted text.fg!75!bg} -\setbeamercolor{block title example}{use=example text,fg=black,bg=example text.fg!75!bg} -\setbeamercolor{block body}{parent=normal text,use=block title,bg=block title.bg!25!bg} -\setbeamercolor{block body alerted}{parent=normal text,use=block title alerted,bg=block title alerted.bg!25!bg} -\setbeamercolor{block body example}{parent=normal text,use=block title example,bg=block title example.bg!25!bg} - -%activate hyperlinks at the end -%\usepackage{hyperref} - -\usepackage[english]{babel} -\usepackage[utf8]{inputenc} -\usepackage{array} -\usepackage{setspace} - -\definecolor{tug}{rgb}{0.96862,0.14509,0.27450} - -\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} -\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} - -\setbeamertemplate{headline}[text line]{ - \begin{beamercolorbox}[wd=\paperwidth,ht=8ex,dp=4ex]{} - \insertnavigation{0.85\paperwidth} - \raisebox{-10pt}{\includegraphics[width=15mm]{tuglogo}}\vskip2pt - \hskip-1pt\rule{\paperwidth}{0.3pt} - \end{beamercolorbox} -} - -\setbeamertemplate{navigation symbols}{} - -\definecolor{gray}{rgb}{0.8,0.8,0.8} -\setbeamercolor{footline}{fg=black,bg=gray} - -% Fusszeile mit Autor, Titel und Foliennummer / Gesamtfolienzahl -\setbeamertemplate{footline}[text line]{ - \hskip-1pt - \begin{beamercolorbox}[wd=\paperwidth]{footline} - \rule{\paperwidth}{0.3pt} - \colorbox{tug}{\rule{3pt}{0pt}\rule{0pt}{3pt}} - \textbf{\rule{0pt}{5pt}\insertshortauthor\hfill\insertshortinstitute\hfill% - \insertshorttitle\rule{1em}{0pt}} - \rule{\paperwidth}{0.3pt} - \end{beamercolorbox} - \begin{beamercolorbox}[wd=\paperwidth,ht=2ex,dp=2ex]{white} - \end{beamercolorbox} -}% - -%% Titelblatt-Einstellungen -\institute[IST, SPSC]{Institute for Software Technology\\Institute of Signal Processing and Speech Communication\\Graz University of Technology} -\title[ISAC for Signal Processing]{Interactive Course Material for\\ Signal Processing based on\\ Isabelle/\isac} -\subtitle{Baccalaureate Thesis} -\author{Jan Rocnik} -\date{\today} - -% Subject and Keywords for PDF -\subject{Final presentation of Baccalaureate Thesis} -\keywords{Isac, Isabelle, ist, spsc, thesis, course material} - -\titlegraphic{\includegraphics[width=20mm]{tuglogo}} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\begin{document} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{frame}[plain] - \frametitle{} - \titlepage -\end{frame} - - - -\begin{frame} - \frametitle{Contents} - \begin{spacing}{0.3} - \tableofcontents[hideallsubsections % - % ,pausesections - ] % erzeugt Inhaltsverzeichnis - \end{spacing} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{Introduction} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\subsection{isabelle} -\begin{frame} - \frametitle{What is Isabelle?} - \begin{spacing}{1.5} - \begin{itemize} - \item Generic Proof Assistant - \item Formula proofing in logical calculus - \item Developed in Cambridge, Muenchen and Paris - \end{itemize} - \end{spacing} -\end{frame} - -\subsection{isac} -\begin{frame} - \frametitle{What is {\isac}?} - \begin{spacing}{1.5} - \begin{itemize} - \item \textcolor{tug}{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal A}$}belle for~{}\textcolor{tug}{${\cal C}$}alculations - \item Interactive Course Material - \item Learning Coach - \item Developed at Austrian Universities - \end{itemize} - \end{spacing} -\end{frame} - -\subsection{motivation} -\begin{frame} - \frametitle{Motivation - {\isac{}}'s~Potential} - \begin{itemize} - \item Stepwise solving of engineering problems\\ - {\small $\rightarrow$ \textcolor{tug}{Consistent Framework}} - \item Explaining underlying knowledge\\ - {\small $\rightarrow$ \textcolor{tug}{Transparent Content, Access to Multimedia Content}} - \item Checking steps input by the student\\ - {\small $\rightarrow$ \textcolor{tug}{Proof Situation}} - \item Assessing stepwise problem solving\\ - {\small $\rightarrow$ \textcolor{tug}{One system for tutoring and assessment}} - \end{itemize} -\end{frame} - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{Thesis Definition} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{frame} - \frametitle{Thesis Definition} - %---> Follow up thesis abstract! <---% - \begin{spacing}{1.2} - \begin{itemize} - \item Creation of interactive course material\\ - {\small Based on problems given by SPSC} - \item Content should be usable\ldots - \begin{itemize} - \item in Signalprocessing Problem Classes - \item in \emph{STEOP} - \end{itemize} - \item Guideline for upcoming TP-Programmers. - \item Feedback of usability\\ - {\small (TP-Programming-Language)} - \end{itemize} - \end{spacing} -\end{frame} - -\subsection{issues} -\begin{frame} - \frametitle{Issues to Accomplish I} - \begin{spacing}{1.4} - \begin{itemize} - \item What knowledge is mechanized in Isabelle?\\ - {\small How about new?} - \item What problems are implemented in {\sisac{}}?\\ - {\small How about new?} - \item What is the effort? - \end{itemize} - \end{spacing} -\end{frame} - -\begin{frame} - \frametitle{Issues to Accomplish II} -\begin{spacing}{1.4} -\begin{itemize} - \item How look calculations like?\\ - {\small Ansatzs, Subproblems?} - \item How are problems specified?\\ - {\small Given, Pre-/Postcondition, Find?} - \item What is the contents of the interactive course material?\\ - {\small Figures, Explanations,\ldots} -\end{itemize} -\end{spacing} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{Details} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\subsection{Technical Survey} -\begin{frame} - \frametitle{Technical Survey I {\normalsize Mechanizing Knowledge}} - \begin{spacing}{1.5} - \begin{itemize} - \item Not enough knowledge is mechanized\\ - {\small Equation Solving, Integrals,\ldots} - \item Computer Mathematicians required!\\ - {\small Mathematics: Equation solving, Engineer: Z-Transform} - \item RISC Linz, Mathematics TU Graz - \end{itemize} - \end{spacing} -\end{frame} - -\begin{frame} - \frametitle{Technical Survey II {\normalsize Notation Problems} } - \begin{spacing}{1.5} - \begin{itemize} - \item Different brackets have different meanings\\ - {\small $u[n] \neq u(n)$\ldots in Math; but also in the source code} - \item Simplification, tricks and beauty\\ - {\small $X\cdot(a+b)+Y\cdot(c+d)=aX+bX+cY+dY$}\\ - {\small $\frac{1}{j\omega}\cdot\left(e^{-j\omega}-e^{j3\omega}\right)=\frac{1}{j\omega}\cdot e^{-j2\omega}\cdot\left(e^{j\omega}-e^{-j\omega}\right)=$}\\ - {\small $=\frac{1}{\omega}\, e^{-j2\omega}\cdot\colorbox{lgray}{$\frac{1}{j}\,\left(e^{j\omega}-e^{-j\omega}\right)$}=\frac{1}{\omega}\,e^{-j2\omega}\cdot\colorbox{lgray}{$2\, sin(\omega)$} $} - \end{itemize} - \end{spacing} -\end{frame} - -\subsection{Demonstration} -\begin{frame} - \frametitle{Demonstration of {\isac}} - \begin{spacing}{1.5} - \begin{itemize} - \item {\Large Development Environment} (Backend) - \vspace{15mm} - \item {\Large Math Assistant} (Frontend) - \end{itemize} - \end{spacing} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{Summary} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\subsection{Accomplished Work} -\begin{frame} - \frametitle{Accomplished Work} - \begin{itemize} - \item Partial Fractions\\ {\small Theorems, Specification, Program} - \item Inverse Z-Transform with Partial Fractions\\ {\small Theorems, Specification, Program} - \item Isabelle Theory indicating issues\\ {\small Preparation for {\sisac{}}-developers} - \end{itemize} -\end{frame} - -\subsection{Partially Accomplished} -\begin{frame} - \frametitle{Partially Accomplished} - \begin{spacing}{1.4} - \begin{itemize} - \item Guidelines for Upcoming TP-Programmers\\ - {\small \textbf{Note:} Development environment and languages changes} - \item Examples - \end{itemize} - \end{spacing} -\end{frame} - -\subsection{Not Accomplished} -\begin{frame} - \frametitle{Not Accomplished} - \begin{spacing}{1.2} - \begin{itemize} - \item Content of interactive course material\\ - {\small Figures, Explanations,\ldots} - \item A sufficient count of implementations - \item No support of labs and lectures atm - \item No material for \emph{STEOP} atm - \end{itemize} - \end{spacing} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{Conclusion} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{frame} - \frametitle{Conclusion} - \begin{spacing}{1.2} - \begin{itemize} - \item TP-based language not ready - \item Programming guideline not yet sufficient - \item Hope for usability in enginieering studies - \vspace{5mm} - \item Hard to spend 200h on 1 programm - \item \isac{} pointed at my own error - \end{itemize} - \end{spacing} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\end{document} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% EOF \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/fixbookmarks.pl --- a/src/Doc/isac/jrocnik/fixbookmarks.pl Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ - -s/\\([a-zA-Z]+)\s*/$1/g; -s/\$//g; -s/^BOOKMARK/\\BOOKMARK/g; diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/isabelle.sty --- a/src/Doc/isac/jrocnik/isabelle.sty Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,218 +0,0 @@ -%% -%% macros for Isabelle generated LaTeX output -%% - -%%% Simple document preparation (based on theory token language and symbols) - -% isabelle environments - -\newcommand{\isabellecontext}{UNKNOWN} - -\newcommand{\isastyle}{\UNDEF} -\newcommand{\isastyleminor}{\UNDEF} -\newcommand{\isastylescript}{\UNDEF} -\newcommand{\isastyletext}{\normalsize\rm} -\newcommand{\isastyletxt}{\rm} -\newcommand{\isastylecmt}{\rm} - -%symbol markup -- \emph achieves decent spacing via italic corrections -\newcommand{\isamath}[1]{\emph{$#1$}} -\newcommand{\isatext}[1]{\emph{#1}} -\DeclareRobustCommand{\isascriptstyle}{\def\isamath##1{##1}\def\isatext##1{\mbox{\isastylescript##1}}} -\newcommand{\isactrlsub}[1]{\emph{\isascriptstyle${}\sb{#1}$}} -\newcommand{\isactrlsup}[1]{\emph{\isascriptstyle${}\sp{#1}$}} -\newcommand{\isactrlisub}[1]{\emph{\isascriptstyle${}\sb{#1}$}} -\newcommand{\isactrlisup}[1]{\emph{\isascriptstyle${}\sp{#1}$}} -\DeclareRobustCommand{\isactrlbsub}{\emph\bgroup\math{}\sb\bgroup\mbox\bgroup\isastylescript} -\DeclareRobustCommand{\isactrlesub}{\egroup\egroup\endmath\egroup} -\DeclareRobustCommand{\isactrlbsup}{\emph\bgroup\math{}\sp\bgroup\mbox\bgroup\isastylescript} -\DeclareRobustCommand{\isactrlesup}{\egroup\egroup\endmath\egroup} -\newcommand{\isactrlbold}[1]{{\bfseries\upshape\boldmath#1}} -\newcommand{\isactrlloc}[1]{{\bfseries\upshape\boldmath#1}} - -\newenvironment{isaantiq}{{\isacharat\isacharbraceleft}}{{\isacharbraceright}} -\newcommand{\isaantiqopen}{\isakeyword{\isacharbraceleft}} -\newcommand{\isaantiqclose}{\isakeyword{\isacharbraceright}} - -\newdimen\isa@parindent\newdimen\isa@parskip - -\newenvironment{isabellebody}{% -\isamarkuptrue\par% -\isa@parindent\parindent\parindent0pt% -\isa@parskip\parskip\parskip0pt% -\isastyle}{\par} - -\newenvironment{isabelle} -{\begin{trivlist}\begin{isabellebody}\item\relax} -{\end{isabellebody}\end{trivlist}} - -\newcommand{\isa}[1]{\emph{\isastyleminor #1}} - -\newcommand{\isaindent}[1]{\hphantom{#1}} -\newcommand{\isanewline}{\mbox{}\par\mbox{}} -\newcommand{\isasep}{} -\newcommand{\isadigit}[1]{#1} - -\newcommand{\isachardefaults}{% -\chardef\isacharbang=`\!% -\chardef\isachardoublequote=`\"% -\chardef\isachardoublequoteopen=`\"% -\chardef\isachardoublequoteclose=`\"% -\chardef\isacharhash=`\#% -\chardef\isachardollar=`\$% -\chardef\isacharpercent=`\%% -\chardef\isacharampersand=`\&% -\chardef\isacharprime=`\'% -\chardef\isacharparenleft=`\(% -\chardef\isacharparenright=`\)% -\chardef\isacharasterisk=`\*% -\chardef\isacharplus=`\+% -\chardef\isacharcomma=`\,% -\chardef\isacharminus=`\-% -\chardef\isachardot=`\.% -\chardef\isacharslash=`\/% -\chardef\isacharcolon=`\:% -\chardef\isacharsemicolon=`\;% -\chardef\isacharless=`\<% -\chardef\isacharequal=`\=% -\chardef\isachargreater=`\>% -\chardef\isacharquery=`\?% -\chardef\isacharat=`\@% -\chardef\isacharbrackleft=`\[% -\chardef\isacharbackslash=`\\% -\chardef\isacharbrackright=`\]% -\chardef\isacharcircum=`\^% -\chardef\isacharunderscore=`\_% -\def\isacharunderscorekeyword{\_}% -\chardef\isacharbackquote=`\`% -\chardef\isacharbackquoteopen=`\`% -\chardef\isacharbackquoteclose=`\`% -\chardef\isacharbraceleft=`\{% -\chardef\isacharbar=`\|% -\chardef\isacharbraceright=`\}% -\chardef\isachartilde=`\~% -\def\isacharverbatimopen{\isacharbraceleft\isacharasterisk}% -\def\isacharverbatimclose{\isacharasterisk\isacharbraceright}% -} - -\newcommand{\isaliteral}[2]{#2} -\newcommand{\isanil}{} - - -% keyword and section markup - -\newcommand{\isakeyword}[1] -{\emph{\bf\def\isachardot{.}\def\isacharunderscore{\isacharunderscorekeyword}% -\def\isacharbraceleft{\{}\def\isacharbraceright{\}}#1}} -\newcommand{\isacommand}[1]{\isakeyword{#1}} - -\newcommand{\isamarkupheader}[1]{\section{#1}} -\newcommand{\isamarkupchapter}[1]{\chapter{#1}} -\newcommand{\isamarkupsection}[1]{\section{#1}} -\newcommand{\isamarkupsubsection}[1]{\subsection{#1}} -\newcommand{\isamarkupsubsubsection}[1]{\subsubsection{#1}} -\newcommand{\isamarkupsect}[1]{\section{#1}} -\newcommand{\isamarkupsubsect}[1]{\subsection{#1}} -\newcommand{\isamarkupsubsubsect}[1]{\subsubsection{#1}} - -\newif\ifisamarkup -\newcommand{\isabeginpar}{\par\ifisamarkup\relax\else\medskip\fi} -\newcommand{\isaendpar}{\par\medskip} -\newenvironment{isapar}{\parindent\isa@parindent\parskip\isa@parskip\isabeginpar}{\isaendpar} -\newenvironment{isamarkuptext}{\par\isastyletext\begin{isapar}}{\end{isapar}} -\newenvironment{isamarkuptxt}{\par\isastyletxt\begin{isapar}}{\end{isapar}} -\newcommand{\isamarkupcmt}[1]{{\isastylecmt--- #1}} - - -% styles - -\def\isabellestyle#1{\csname isabellestyle#1\endcsname} - -\newcommand{\isabellestyledefault}{% -\renewcommand{\isastyle}{\small\tt\slshape}% -\renewcommand{\isastyleminor}{\small\tt\slshape}% -\renewcommand{\isastylescript}{\footnotesize\tt\slshape}% -\isachardefaults% -} -\isabellestyledefault - -\newcommand{\isabellestylett}{% -\renewcommand{\isastyle}{\small\tt}% -\renewcommand{\isastyleminor}{\small\tt}% -\renewcommand{\isastylescript}{\footnotesize\tt}% -\isachardefaults% -} - -\newcommand{\isabellestyleit}{% -\renewcommand{\isastyle}{\small\it}% -\renewcommand{\isastyleminor}{\it}% -\renewcommand{\isastylescript}{\footnotesize\it}% -\renewcommand{\isacharunderscorekeyword}{\mbox{-}}% -\renewcommand{\isacharbang}{\isamath{!}}% -\renewcommand{\isachardoublequote}{\isanil}% -\renewcommand{\isachardoublequoteopen}{\isanil}% -\renewcommand{\isachardoublequoteclose}{\isanil}% -\renewcommand{\isacharhash}{\isamath{\#}}% -\renewcommand{\isachardollar}{\isamath{\$}}% -\renewcommand{\isacharpercent}{\isamath{\%}}% -\renewcommand{\isacharampersand}{\isamath{\&}}% -\renewcommand{\isacharprime}{\isamath{\mskip2mu{'}\mskip-2mu}}% -\renewcommand{\isacharparenleft}{\isamath{(}}% -\renewcommand{\isacharparenright}{\isamath{)}}% -\renewcommand{\isacharasterisk}{\isamath{*}}% -\renewcommand{\isacharplus}{\isamath{+}}% -\renewcommand{\isacharcomma}{\isamath{\mathord,}}% -\renewcommand{\isacharminus}{\isamath{-}}% -\renewcommand{\isachardot}{\isamath{\mathord.}}% -\renewcommand{\isacharslash}{\isamath{/}}% -\renewcommand{\isacharcolon}{\isamath{\mathord:}}% -\renewcommand{\isacharsemicolon}{\isamath{\mathord;}}% -\renewcommand{\isacharless}{\isamath{<}}% -\renewcommand{\isacharequal}{\isamath{=}}% -\renewcommand{\isachargreater}{\isamath{>}}% -\renewcommand{\isacharat}{\isamath{@}}% -\renewcommand{\isacharbrackleft}{\isamath{[}}% -\renewcommand{\isacharbackslash}{\isamath{\backslash}}% -\renewcommand{\isacharbrackright}{\isamath{]}}% -\renewcommand{\isacharunderscore}{\mbox{-}}% -\renewcommand{\isacharbraceleft}{\isamath{\{}}% -\renewcommand{\isacharbar}{\isamath{\mid}}% -\renewcommand{\isacharbraceright}{\isamath{\}}}% -\renewcommand{\isachartilde}{\isamath{{}\sp{\sim}}}% -\renewcommand{\isacharbackquoteopen}{\isatext{\raise.3ex\hbox{$\scriptscriptstyle\langle$}}}% -\renewcommand{\isacharbackquoteclose}{\isatext{\raise.3ex\hbox{$\scriptscriptstyle\rangle$}}}% -\renewcommand{\isacharverbatimopen}{\isamath{\langle\!\langle}}% -\renewcommand{\isacharverbatimclose}{\isamath{\rangle\!\rangle}}% -} - -\newcommand{\isabellestylesl}{% -\isabellestyleit% -\renewcommand{\isastyle}{\small\sl}% -\renewcommand{\isastyleminor}{\sl}% -\renewcommand{\isastylescript}{\footnotesize\sl}% -} - - -% tagged regions - -%plain TeX version of comment package -- much faster! -\let\isafmtname\fmtname\def\fmtname{plain} -\usepackage{comment} -\let\fmtname\isafmtname - -\newcommand{\isafold}[1]{\emph{$\langle\mathord{\mathit{#1}}\rangle$}} - -\newcommand{\isakeeptag}[1]% -{\includecomment{isadelim#1}\includecomment{isatag#1}\csarg\def{isafold#1}{}} -\newcommand{\isadroptag}[1]% -{\excludecomment{isadelim#1}\excludecomment{isatag#1}\csarg\def{isafold#1}{}} -\newcommand{\isafoldtag}[1]% -{\includecomment{isadelim#1}\excludecomment{isatag#1}\csarg\def{isafold#1}{\isafold{#1}}} - -\isakeeptag{theory} -\isakeeptag{proof} -\isakeeptag{ML} -\isakeeptag{visible} -\isadroptag{invisible} - -\IfFileExists{isabelletags.sty}{\usepackage{isabelletags}}{} diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/isabellesym.sty --- a/src/Doc/isac/jrocnik/isabellesym.sty Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,358 +0,0 @@ -%% -%% definitions of standard Isabelle symbols -%% - -\newcommand{\isasymzero}{\isamath{\mathbf{0}}} %requires amssymb -\newcommand{\isasymone}{\isamath{\mathbf{1}}} %requires amssymb -\newcommand{\isasymtwo}{\isamath{\mathbf{2}}} %requires amssymb -\newcommand{\isasymthree}{\isamath{\mathbf{3}}} %requires amssymb -\newcommand{\isasymfour}{\isamath{\mathbf{4}}} %requires amssymb -\newcommand{\isasymfive}{\isamath{\mathbf{5}}} %requires amssymb -\newcommand{\isasymsix}{\isamath{\mathbf{6}}} %requires amssymb -\newcommand{\isasymseven}{\isamath{\mathbf{7}}} %requires amssymb -\newcommand{\isasymeight}{\isamath{\mathbf{8}}} %requires amssymb -\newcommand{\isasymnine}{\isamath{\mathbf{9}}} %requires amssymb -\newcommand{\isasymA}{\isamath{\mathcal{A}}} -\newcommand{\isasymB}{\isamath{\mathcal{B}}} -\newcommand{\isasymC}{\isamath{\mathcal{C}}} -\newcommand{\isasymD}{\isamath{\mathcal{D}}} -\newcommand{\isasymE}{\isamath{\mathcal{E}}} -\newcommand{\isasymF}{\isamath{\mathcal{F}}} -\newcommand{\isasymG}{\isamath{\mathcal{G}}} -\newcommand{\isasymH}{\isamath{\mathcal{H}}} -\newcommand{\isasymI}{\isamath{\mathcal{I}}} -\newcommand{\isasymJ}{\isamath{\mathcal{J}}} -\newcommand{\isasymK}{\isamath{\mathcal{K}}} -\newcommand{\isasymL}{\isamath{\mathcal{L}}} -\newcommand{\isasymM}{\isamath{\mathcal{M}}} -\newcommand{\isasymN}{\isamath{\mathcal{N}}} -\newcommand{\isasymO}{\isamath{\mathcal{O}}} -\newcommand{\isasymP}{\isamath{\mathcal{P}}} -\newcommand{\isasymQ}{\isamath{\mathcal{Q}}} -\newcommand{\isasymR}{\isamath{\mathcal{R}}} -\newcommand{\isasymS}{\isamath{\mathcal{S}}} -\newcommand{\isasymT}{\isamath{\mathcal{T}}} -\newcommand{\isasymU}{\isamath{\mathcal{U}}} -\newcommand{\isasymV}{\isamath{\mathcal{V}}} -\newcommand{\isasymW}{\isamath{\mathcal{W}}} -\newcommand{\isasymX}{\isamath{\mathcal{X}}} -\newcommand{\isasymY}{\isamath{\mathcal{Y}}} -\newcommand{\isasymZ}{\isamath{\mathcal{Z}}} -\newcommand{\isasyma}{\isamath{\mathrm{a}}} -\newcommand{\isasymb}{\isamath{\mathrm{b}}} -\newcommand{\isasymc}{\isamath{\mathrm{c}}} -\newcommand{\isasymd}{\isamath{\mathrm{d}}} -\newcommand{\isasyme}{\isamath{\mathrm{e}}} -\newcommand{\isasymf}{\isamath{\mathrm{f}}} -\newcommand{\isasymg}{\isamath{\mathrm{g}}} -\newcommand{\isasymh}{\isamath{\mathrm{h}}} -\newcommand{\isasymi}{\isamath{\mathrm{i}}} -\newcommand{\isasymj}{\isamath{\mathrm{j}}} -\newcommand{\isasymk}{\isamath{\mathrm{k}}} -\newcommand{\isasyml}{\isamath{\mathrm{l}}} -\newcommand{\isasymm}{\isamath{\mathrm{m}}} -\newcommand{\isasymn}{\isamath{\mathrm{n}}} -\newcommand{\isasymo}{\isamath{\mathrm{o}}} -\newcommand{\isasymp}{\isamath{\mathrm{p}}} -\newcommand{\isasymq}{\isamath{\mathrm{q}}} -\newcommand{\isasymr}{\isamath{\mathrm{r}}} -\newcommand{\isasyms}{\isamath{\mathrm{s}}} -\newcommand{\isasymt}{\isamath{\mathrm{t}}} -\newcommand{\isasymu}{\isamath{\mathrm{u}}} -\newcommand{\isasymv}{\isamath{\mathrm{v}}} -\newcommand{\isasymw}{\isamath{\mathrm{w}}} -\newcommand{\isasymx}{\isamath{\mathrm{x}}} -\newcommand{\isasymy}{\isamath{\mathrm{y}}} -\newcommand{\isasymz}{\isamath{\mathrm{z}}} -\newcommand{\isasymAA}{\isamath{\mathfrak{A}}} %requires eufrak -\newcommand{\isasymBB}{\isamath{\mathfrak{B}}} %requires eufrak -\newcommand{\isasymCC}{\isamath{\mathfrak{C}}} %requires eufrak -\newcommand{\isasymDD}{\isamath{\mathfrak{D}}} %requires eufrak -\newcommand{\isasymEE}{\isamath{\mathfrak{E}}} %requires eufrak -\newcommand{\isasymFF}{\isamath{\mathfrak{F}}} %requires eufrak -\newcommand{\isasymGG}{\isamath{\mathfrak{G}}} %requires eufrak -\newcommand{\isasymHH}{\isamath{\mathfrak{H}}} %requires eufrak -\newcommand{\isasymII}{\isamath{\mathfrak{I}}} %requires eufrak -\newcommand{\isasymJJ}{\isamath{\mathfrak{J}}} %requires eufrak -\newcommand{\isasymKK}{\isamath{\mathfrak{K}}} %requires eufrak -\newcommand{\isasymLL}{\isamath{\mathfrak{L}}} %requires eufrak -\newcommand{\isasymMM}{\isamath{\mathfrak{M}}} %requires eufrak -\newcommand{\isasymNN}{\isamath{\mathfrak{N}}} %requires eufrak -\newcommand{\isasymOO}{\isamath{\mathfrak{O}}} %requires eufrak -\newcommand{\isasymPP}{\isamath{\mathfrak{P}}} %requires eufrak -\newcommand{\isasymQQ}{\isamath{\mathfrak{Q}}} %requires eufrak -\newcommand{\isasymRR}{\isamath{\mathfrak{R}}} %requires eufrak -\newcommand{\isasymSS}{\isamath{\mathfrak{S}}} %requires eufrak -\newcommand{\isasymTT}{\isamath{\mathfrak{T}}} %requires eufrak -\newcommand{\isasymUU}{\isamath{\mathfrak{U}}} %requires eufrak -\newcommand{\isasymVV}{\isamath{\mathfrak{V}}} %requires eufrak -\newcommand{\isasymWW}{\isamath{\mathfrak{W}}} %requires eufrak -\newcommand{\isasymXX}{\isamath{\mathfrak{X}}} %requires eufrak -\newcommand{\isasymYY}{\isamath{\mathfrak{Y}}} %requires eufrak -\newcommand{\isasymZZ}{\isamath{\mathfrak{Z}}} %requires eufrak -\newcommand{\isasymaa}{\isamath{\mathfrak{a}}} %requires eufrak -\newcommand{\isasymbb}{\isamath{\mathfrak{b}}} %requires eufrak -\newcommand{\isasymcc}{\isamath{\mathfrak{c}}} %requires eufrak -\newcommand{\isasymdd}{\isamath{\mathfrak{d}}} %requires eufrak -\newcommand{\isasymee}{\isamath{\mathfrak{e}}} %requires eufrak -\newcommand{\isasymff}{\isamath{\mathfrak{f}}} %requires eufrak -\newcommand{\isasymgg}{\isamath{\mathfrak{g}}} %requires eufrak -\newcommand{\isasymhh}{\isamath{\mathfrak{h}}} %requires eufrak -\newcommand{\isasymii}{\isamath{\mathfrak{i}}} %requires eufrak -\newcommand{\isasymjj}{\isamath{\mathfrak{j}}} %requires eufrak -\newcommand{\isasymkk}{\isamath{\mathfrak{k}}} %requires eufrak -\newcommand{\isasymll}{\isamath{\mathfrak{l}}} %requires eufrak -\newcommand{\isasymmm}{\isamath{\mathfrak{m}}} %requires eufrak -\newcommand{\isasymnn}{\isamath{\mathfrak{n}}} %requires eufrak -\newcommand{\isasymoo}{\isamath{\mathfrak{o}}} %requires eufrak -\newcommand{\isasympp}{\isamath{\mathfrak{p}}} %requires eufrak -\newcommand{\isasymqq}{\isamath{\mathfrak{q}}} %requires eufrak -\newcommand{\isasymrr}{\isamath{\mathfrak{r}}} %requires eufrak -\newcommand{\isasymss}{\isamath{\mathfrak{s}}} %requires eufrak -\newcommand{\isasymtt}{\isamath{\mathfrak{t}}} %requires eufrak -\newcommand{\isasymuu}{\isamath{\mathfrak{u}}} %requires eufrak -\newcommand{\isasymvv}{\isamath{\mathfrak{v}}} %requires eufrak -\newcommand{\isasymww}{\isamath{\mathfrak{w}}} %requires eufrak -\newcommand{\isasymxx}{\isamath{\mathfrak{x}}} %requires eufrak -\newcommand{\isasymyy}{\isamath{\mathfrak{y}}} %requires eufrak -\newcommand{\isasymzz}{\isamath{\mathfrak{z}}} %requires eufrak -\newcommand{\isasymalpha}{\isamath{\alpha}} -\newcommand{\isasymbeta}{\isamath{\beta}} -\newcommand{\isasymgamma}{\isamath{\gamma}} -\newcommand{\isasymdelta}{\isamath{\delta}} -\newcommand{\isasymepsilon}{\isamath{\varepsilon}} -\newcommand{\isasymzeta}{\isamath{\zeta}} -\newcommand{\isasymeta}{\isamath{\eta}} -\newcommand{\isasymtheta}{\isamath{\vartheta}} -\newcommand{\isasymiota}{\isamath{\iota}} -\newcommand{\isasymkappa}{\isamath{\kappa}} -\newcommand{\isasymlambda}{\isamath{\lambda}} -\newcommand{\isasymmu}{\isamath{\mu}} -\newcommand{\isasymnu}{\isamath{\nu}} -\newcommand{\isasymxi}{\isamath{\xi}} -\newcommand{\isasympi}{\isamath{\pi}} -\newcommand{\isasymrho}{\isamath{\varrho}} -\newcommand{\isasymsigma}{\isamath{\sigma}} -\newcommand{\isasymtau}{\isamath{\tau}} -\newcommand{\isasymupsilon}{\isamath{\upsilon}} -\newcommand{\isasymphi}{\isamath{\varphi}} -\newcommand{\isasymchi}{\isamath{\chi}} -\newcommand{\isasympsi}{\isamath{\psi}} -\newcommand{\isasymomega}{\isamath{\omega}} -\newcommand{\isasymGamma}{\isamath{\Gamma}} -\newcommand{\isasymDelta}{\isamath{\Delta}} -\newcommand{\isasymTheta}{\isamath{\Theta}} -\newcommand{\isasymLambda}{\isamath{\Lambda}} -\newcommand{\isasymXi}{\isamath{\Xi}} -\newcommand{\isasymPi}{\isamath{\Pi}} -\newcommand{\isasymSigma}{\isamath{\Sigma}} -\newcommand{\isasymUpsilon}{\isamath{\Upsilon}} -\newcommand{\isasymPhi}{\isamath{\Phi}} -\newcommand{\isasymPsi}{\isamath{\Psi}} -\newcommand{\isasymOmega}{\isamath{\Omega}} -\newcommand{\isasymbool}{\isamath{\mathrm{I}\mkern-3.8mu\mathrm{B}}} -\newcommand{\isasymcomplex}{\isamath{\mathrm{C}\mkern-15mu{\phantom{\mathrm{t}}\vrule}\mkern9mu}} -\newcommand{\isasymnat}{\isamath{\mathrm{I}\mkern-3.8mu\mathrm{N}}} -\newcommand{\isasymrat}{\isamath{\mathrm{Q}\mkern-16mu{\phantom{\mathrm{t}}\vrule}\mkern10mu}} -\newcommand{\isasymreal}{\isamath{\mathrm{I}\mkern-3.8mu\mathrm{R}}} -\newcommand{\isasymint}{\isamath{\mathsf{Z}\mkern-7.5mu\mathsf{Z}}} -\newcommand{\isasymleftarrow}{\isamath{\leftarrow}} -\newcommand{\isasymlongleftarrow}{\isamath{\longleftarrow}} -\newcommand{\isasymrightarrow}{\isamath{\rightarrow}} -\newcommand{\isasymlongrightarrow}{\isamath{\longrightarrow}} -\newcommand{\isasymLeftarrow}{\isamath{\Leftarrow}} -\newcommand{\isasymLongleftarrow}{\isamath{\Longleftarrow}} -\newcommand{\isasymRightarrow}{\isamath{\Rightarrow}} -\newcommand{\isasymLongrightarrow}{\isamath{\Longrightarrow}} -\newcommand{\isasymleftrightarrow}{\isamath{\leftrightarrow}} -\newcommand{\isasymlongleftrightarrow}{\isamath{\longleftrightarrow}} -\newcommand{\isasymLeftrightarrow}{\isamath{\Leftrightarrow}} -\newcommand{\isasymLongleftrightarrow}{\isamath{\Longleftrightarrow}} -\newcommand{\isasymmapsto}{\isamath{\mapsto}} -\newcommand{\isasymlongmapsto}{\isamath{\longmapsto}} -\newcommand{\isasymmidarrow}{\isamath{\relbar}} -\newcommand{\isasymMidarrow}{\isamath{\Relbar}} -\newcommand{\isasymhookleftarrow}{\isamath{\hookleftarrow}} -\newcommand{\isasymhookrightarrow}{\isamath{\hookrightarrow}} -\newcommand{\isasymleftharpoondown}{\isamath{\leftharpoondown}} -\newcommand{\isasymrightharpoondown}{\isamath{\rightharpoondown}} -\newcommand{\isasymleftharpoonup}{\isamath{\leftharpoonup}} -\newcommand{\isasymrightharpoonup}{\isamath{\rightharpoonup}} -\newcommand{\isasymrightleftharpoons}{\isamath{\rightleftharpoons}} -\newcommand{\isasymleadsto}{\isamath{\leadsto}} %requires amssymb -\newcommand{\isasymdownharpoonleft}{\isamath{\downharpoonleft}} %requires amssymb -\newcommand{\isasymdownharpoonright}{\isamath{\downharpoonright}} %requires amssymb -\newcommand{\isasymupharpoonleft}{\isamath{\upharpoonleft}} %requires amssymb -\newcommand{\isasymupharpoonright}{\isamath{\upharpoonright}} %requires amssymb -\newcommand{\isasymrestriction}{\isamath{\restriction}} %requires amssymb -\newcommand{\isasymColon}{\isamath{\mathrel{::}}} -\newcommand{\isasymup}{\isamath{\uparrow}} -\newcommand{\isasymUp}{\isamath{\Uparrow}} -\newcommand{\isasymdown}{\isamath{\downarrow}} -\newcommand{\isasymDown}{\isamath{\Downarrow}} -\newcommand{\isasymupdown}{\isamath{\updownarrow}} -\newcommand{\isasymUpdown}{\isamath{\Updownarrow}} -\newcommand{\isasymlangle}{\isamath{\langle}} -\newcommand{\isasymrangle}{\isamath{\rangle}} -\newcommand{\isasymlceil}{\isamath{\lceil}} -\newcommand{\isasymrceil}{\isamath{\rceil}} -\newcommand{\isasymlfloor}{\isamath{\lfloor}} -\newcommand{\isasymrfloor}{\isamath{\rfloor}} -\newcommand{\isasymlparr}{\isamath{\mathopen{(\mkern-3mu\mid}}} -\newcommand{\isasymrparr}{\isamath{\mathclose{\mid\mkern-3mu)}}} -\newcommand{\isasymlbrakk}{\isamath{\mathopen{\lbrack\mkern-3mu\lbrack}}} -\newcommand{\isasymrbrakk}{\isamath{\mathclose{\rbrack\mkern-3mu\rbrack}}} -\newcommand{\isasymlbrace}{\isamath{\mathopen{\lbrace\mkern-4.5mu\mid}}} -\newcommand{\isasymrbrace}{\isamath{\mathclose{\mid\mkern-4.5mu\rbrace}}} -\newcommand{\isasymguillemotleft}{\isatext{\flqq}} %requires babel -\newcommand{\isasymguillemotright}{\isatext{\frqq}} %requires babel -\newcommand{\isasymbottom}{\isamath{\bot}} -\newcommand{\isasymtop}{\isamath{\top}} -\newcommand{\isasymand}{\isamath{\wedge}} -\newcommand{\isasymAnd}{\isamath{\bigwedge}} -\newcommand{\isasymor}{\isamath{\vee}} -\newcommand{\isasymOr}{\isamath{\bigvee}} -\newcommand{\isasymforall}{\isamath{\forall\,}} -\newcommand{\isasymexists}{\isamath{\exists\,}} -\newcommand{\isasymnexists}{\isamath{\nexists\,}} %requires amssymb -\newcommand{\isasymnot}{\isamath{\neg}} -\newcommand{\isasymbox}{\isamath{\Box}} %requires amssymb -\newcommand{\isasymdiamond}{\isamath{\Diamond}} %requires amssymb -\newcommand{\isasymturnstile}{\isamath{\vdash}} -\newcommand{\isasymTurnstile}{\isamath{\models}} -\newcommand{\isasymtturnstile}{\isamath{\vdash\!\!\!\vdash}} -\newcommand{\isasymTTurnstile}{\isamath{\mid\!\models}} -\newcommand{\isasymstileturn}{\isamath{\dashv}} -\newcommand{\isasymsurd}{\isamath{\surd}} -\newcommand{\isasymle}{\isamath{\le}} -\newcommand{\isasymge}{\isamath{\ge}} -\newcommand{\isasymlless}{\isamath{\ll}} -\newcommand{\isasymggreater}{\isamath{\gg}} -\newcommand{\isasymlesssim}{\isamath{\lesssim}} %requires amssymb -\newcommand{\isasymgreatersim}{\isamath{\gtrsim}} %requires amssymb -\newcommand{\isasymlessapprox}{\isamath{\lessapprox}} %requires amssymb -\newcommand{\isasymgreaterapprox}{\isamath{\gtrapprox}} %requires amssymb -\newcommand{\isasymin}{\isamath{\in}} -\newcommand{\isasymnotin}{\isamath{\notin}} -\newcommand{\isasymsubset}{\isamath{\subset}} -\newcommand{\isasymsupset}{\isamath{\supset}} -\newcommand{\isasymsubseteq}{\isamath{\subseteq}} -\newcommand{\isasymsupseteq}{\isamath{\supseteq}} -\newcommand{\isasymsqsubset}{\isamath{\sqsubset}} %requires amssymb -\newcommand{\isasymsqsupset}{\isamath{\sqsupset}} %requires amssymb -\newcommand{\isasymsqsubseteq}{\isamath{\sqsubseteq}} -\newcommand{\isasymsqsupseteq}{\isamath{\sqsupseteq}} -\newcommand{\isasyminter}{\isamath{\cap}} -\newcommand{\isasymInter}{\isamath{\bigcap\,}} -\newcommand{\isasymunion}{\isamath{\cup}} -\newcommand{\isasymUnion}{\isamath{\bigcup\,}} -\newcommand{\isasymsqunion}{\isamath{\sqcup}} -\newcommand{\isasymSqunion}{\isamath{\bigsqcup\,}} -\newcommand{\isasymsqinter}{\isamath{\sqcap}} -\newcommand{\isasymSqinter}{\isamath{\bigsqcap\,}} %requires stmaryrd -\newcommand{\isasymsetminus}{\isamath{\setminus}} -\newcommand{\isasympropto}{\isamath{\propto}} -\newcommand{\isasymuplus}{\isamath{\uplus}} -\newcommand{\isasymUplus}{\isamath{\biguplus\,}} -\newcommand{\isasymnoteq}{\isamath{\not=}} -\newcommand{\isasymsim}{\isamath{\sim}} -\newcommand{\isasymdoteq}{\isamath{\doteq}} -\newcommand{\isasymsimeq}{\isamath{\simeq}} -\newcommand{\isasymapprox}{\isamath{\approx}} -\newcommand{\isasymasymp}{\isamath{\asymp}} -\newcommand{\isasymcong}{\isamath{\cong}} -\newcommand{\isasymsmile}{\isamath{\smile}} -\newcommand{\isasymequiv}{\isamath{\equiv}} -\newcommand{\isasymfrown}{\isamath{\frown}} -\newcommand{\isasymJoin}{\isamath{\Join}} %requires amssymb -\newcommand{\isasymbowtie}{\isamath{\bowtie}} -\newcommand{\isasymprec}{\isamath{\prec}} -\newcommand{\isasymsucc}{\isamath{\succ}} -\newcommand{\isasympreceq}{\isamath{\preceq}} -\newcommand{\isasymsucceq}{\isamath{\succeq}} -\newcommand{\isasymparallel}{\isamath{\parallel}} -\newcommand{\isasymbar}{\isamath{\mid}} -\newcommand{\isasymplusminus}{\isamath{\pm}} -\newcommand{\isasymminusplus}{\isamath{\mp}} -\newcommand{\isasymtimes}{\isamath{\times}} -\newcommand{\isasymdiv}{\isamath{\div}} -\newcommand{\isasymcdot}{\isamath{\cdot}} -\newcommand{\isasymstar}{\isamath{\star}} -\newcommand{\isasymbullet}{\boldmath\isamath{\mathchoice{\displaystyle{\cdot}}{\textstyle{\cdot}}{\scriptstyle{\bullet}}{\scriptscriptstyle{\bullet}}}} -\newcommand{\isasymcirc}{\isamath{\circ}} -\newcommand{\isasymdagger}{\isamath{\dagger}} -\newcommand{\isasymddagger}{\isamath{\ddagger}} -\newcommand{\isasymlhd}{\isamath{\lhd}} %requires amssymb -\newcommand{\isasymrhd}{\isamath{\rhd}} %requires amssymb -\newcommand{\isasymunlhd}{\isamath{\unlhd}} %requires amssymb -\newcommand{\isasymunrhd}{\isamath{\unrhd}} %requires amssymb -\newcommand{\isasymtriangleleft}{\isamath{\triangleleft}} -\newcommand{\isasymtriangleright}{\isamath{\triangleright}} -\newcommand{\isasymtriangle}{\isamath{\triangle}} -\newcommand{\isasymtriangleq}{\isamath{\triangleq}} %requires amssymb -\newcommand{\isasymoplus}{\isamath{\oplus}} -\newcommand{\isasymOplus}{\isamath{\bigoplus\,}} -\newcommand{\isasymotimes}{\isamath{\otimes}} -\newcommand{\isasymOtimes}{\isamath{\bigotimes\,}} -\newcommand{\isasymodot}{\isamath{\odot}} -\newcommand{\isasymOdot}{\isamath{\bigodot\,}} -\newcommand{\isasymominus}{\isamath{\ominus}} -\newcommand{\isasymoslash}{\isamath{\oslash}} -\newcommand{\isasymdots}{\isamath{\dots}} -\newcommand{\isasymcdots}{\isamath{\cdots}} -\newcommand{\isasymSum}{\isamath{\sum\,}} -\newcommand{\isasymProd}{\isamath{\prod\,}} -\newcommand{\isasymCoprod}{\isamath{\coprod\,}} -\newcommand{\isasyminfinity}{\isamath{\infty}} -\newcommand{\isasymintegral}{\isamath{\int\,}} -\newcommand{\isasymointegral}{\isamath{\oint\,}} -\newcommand{\isasymclubsuit}{\isamath{\clubsuit}} -\newcommand{\isasymdiamondsuit}{\isamath{\diamondsuit}} -\newcommand{\isasymheartsuit}{\isamath{\heartsuit}} -\newcommand{\isasymspadesuit}{\isamath{\spadesuit}} -\newcommand{\isasymaleph}{\isamath{\aleph}} -\newcommand{\isasymemptyset}{\isamath{\emptyset}} -\newcommand{\isasymnabla}{\isamath{\nabla}} -\newcommand{\isasympartial}{\isamath{\partial}} -\newcommand{\isasymRe}{\isamath{\Re}} -\newcommand{\isasymIm}{\isamath{\Im}} -\newcommand{\isasymflat}{\isamath{\flat}} -\newcommand{\isasymnatural}{\isamath{\natural}} -\newcommand{\isasymsharp}{\isamath{\sharp}} -\newcommand{\isasymangle}{\isamath{\angle}} -\newcommand{\isasymcopyright}{\isatext{\rm\copyright}} -\newcommand{\isasymregistered}{\isatext{\rm\textregistered}} -\newcommand{\isasymhyphen}{\isatext{\rm-}} -\newcommand{\isasyminverse}{\isamath{{}^{-1}}} -\newcommand{\isasymonesuperior}{\isamath{{}^1}} -\newcommand{\isasymonequarter}{\isatext{\rm\textonequarter}} %requires textcomp -\newcommand{\isasymtwosuperior}{\isamath{{}^2}} -\newcommand{\isasymonehalf}{\isatext{\rm\textonehalf}} %requires textcomp -\newcommand{\isasymthreesuperior}{\isamath{{}^3}} -\newcommand{\isasymthreequarters}{\isatext{\rm\textthreequarters}} %requires textcomp -\newcommand{\isasymordfeminine}{\isatext{\rm\textordfeminine}} -\newcommand{\isasymordmasculine}{\isatext{\rm\textordmasculine}} -\newcommand{\isasymsection}{\isatext{\rm\S}} -\newcommand{\isasymparagraph}{\isatext{\rm\P}} -\newcommand{\isasymexclamdown}{\isatext{\rm\textexclamdown}} -\newcommand{\isasymquestiondown}{\isatext{\rm\textquestiondown}} -\newcommand{\isasymeuro}{\isatext{\textgreek{\euro}}} %requires greek babel -\newcommand{\isasympounds}{\isamath{\pounds}} -\newcommand{\isasymyen}{\isatext{\yen}} %requires amssymb -\newcommand{\isasymcent}{\isatext{\textcent}} %requires textcomp -\newcommand{\isasymcurrency}{\isatext{\textcurrency}} %requires textcomp -\newcommand{\isasymdegree}{\isatext{\rm\textdegree}} %requires textcomp -\newcommand{\isasymamalg}{\isamath{\amalg}} -\newcommand{\isasymmho}{\isamath{\mho}} %requires amssymb -\newcommand{\isasymlozenge}{\isamath{\lozenge}} %requires amssymb -\newcommand{\isasymwp}{\isamath{\wp}} -\newcommand{\isasymwrong}{\isamath{\wr}} -\newcommand{\isasymstruct}{\isamath{\diamond}} -\newcommand{\isasymacute}{\isatext{\'\relax}} -\newcommand{\isasymindex}{\isatext{\i}} -\newcommand{\isasymdieresis}{\isatext{\"\relax}} -\newcommand{\isasymcedilla}{\isatext{\c\relax}} -\newcommand{\isasymhungarumlaut}{\isatext{\H\relax}} -\newcommand{\isasymspacespace}{\isamath{~~}} -\newcommand{\isasymmodule}{\isamath{\langle}\isakeyword{module}\isamath{\rangle}} -\newcommand{\isasymsome}{\isamath{\epsilon\,}} diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/jrocnik_cadgme.tex --- a/src/Doc/isac/jrocnik/jrocnik_cadgme.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,281 +0,0 @@ -\documentclass[% -%handout, % prints handouts (=no animations, for printed version) -%mathserif -%xcolor=pst, -14pt -% fleqn -]{beamer} - -\usepackage{beamerthemedefault} - -\usepackage{color} -\definecolor{lgray}{RGB}{238,238,238} -\definecolor{gray}{rgb}{0.8,0.8,0.8} - -\useoutertheme[subsection=false]{smoothbars} -%\useinnertheme{circles} - -\setbeamercolor{block title}{fg=black,bg=gray} -\setbeamercolor{block title alerted}{use=alerted text,fg=black,bg=alerted text.fg!75!bg} -\setbeamercolor{block title example}{use=example text,fg=black,bg=example text.fg!75!bg} -\setbeamercolor{block body}{parent=normal text,use=block title,bg=block title.bg!25!bg} -\setbeamercolor{block body alerted}{parent=normal text,use=block title alerted,bg=block title alerted.bg!25!bg} -\setbeamercolor{block body example}{parent=normal text,use=block title example,bg=block title example.bg!25!bg} - -%activate hyperlinks at the end -%\usepackage{hyperref} - -\usepackage[english]{babel} -\usepackage[utf8]{inputenc} -\usepackage{array} -\usepackage{setspace} -\usepackage{url} - -\definecolor{tug}{rgb}{0.96862,0.14509,0.27450} - -\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} -\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} - -\setbeamertemplate{headline}[text line]{ - \begin{beamercolorbox}[wd=\paperwidth,ht=8ex,dp=4ex]{} - \insertnavigation{0.85\paperwidth} - \raisebox{-10pt}{\includegraphics[width=15mm]{tuglogo}}\vskip2pt - \hskip-1pt\rule{\paperwidth}{0.3pt} - \end{beamercolorbox} -} - -\setbeamertemplate{navigation symbols}{} -\setbeamercolor{footline}{fg=black,bg=gray} - -% Fusszeile mit Autor, Titel und Foliennummer / Gesamtfolienzahl -\setbeamertemplate{footline}[text line]{ - \hskip-1pt - \begin{beamercolorbox}[wd=\paperwidth]{footline} - \rule{\paperwidth}{0.3pt} - \colorbox{tug}{\rule{3pt}{0pt}\rule{0pt}{3pt}} - \textbf{\rule{0pt}{5pt}\insertshortauthor\hfill\insertshortinstitute\hfill% - \insertshorttitle\rule{1em}{0pt}} - \rule{\paperwidth}{0.3pt} - \end{beamercolorbox} - \begin{beamercolorbox}[wd=\paperwidth,ht=2ex,dp=2ex]{white} - \end{beamercolorbox} -}% - -%% Titelblatt-Einstellungen -\institute[IST]{Institute for Software Technology\\Graz University of Technology} -\title[ISAC for Signal Processing]{Interactive Course Material by TP-based Programming} -\subtitle{A Case Study} -\author{Jan Ro\v{c}nik} -\date{24. June 2012} - -% Subject and Keywords for PDF -\subject{CADGME Presentation} -\keywords{interactive course material, signal processing, z transform, TP-based programming -language, Lucas-Interpreter, Theorem Proving} - -\titlegraphic{\includegraphics[width=20mm]{tuglogo}} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\begin{document} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{frame}[plain] - \frametitle{} - \titlepage -\end{frame} - - - -%\begin{frame} -% \frametitle{Contents} -% \begin{spacing}{0.3} -% \tableofcontents[hideallsubsections % -% % ,pausesections -% ] % erzeugt Inhaltsverzeichnis -% \end{spacing} -%\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{Introduction} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\subsection{isabelle} -\begin{frame} - \frametitle{What is Isabelle?} - \begin{spacing}{2} - \begin{itemize} - \item Interactive Theorem Prover (Interactice TP) - \item Large body of mechanized math knowledge - \item Developed in Cambridge, Munich and Paris - \end{itemize} - \end{spacing} -\end{frame} - -\subsection{isac} -\begin{frame} - \frametitle{What is {\isac}?} - \begin{spacing}{1.7} - \begin{itemize} - \item \textcolor{tug}{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal A}$}belle for~{}\textcolor{tug}{${\cal C}$}alculations - \item Interactive Course Material - \item Learning Coach - \item Developed at Austrian Universities - \end{itemize} - \end{spacing} -\end{frame} - -\subsection{motivation} -\begin{frame} - \frametitle{{\isac{}} for Interactive Course Material} - \begin{itemize} - \item Stepwise solving of engineering problems\\ - {\small $\rightarrow$ \textcolor{tug}{One Framework for all phases of problem solving}} - \item Explaining underlying knowledge\\ - {\small $\rightarrow$ \textcolor{tug}{Transparent Content, Access to Multimedia Content}} - \item Checking steps input by the student\\ - {\small $\rightarrow$ \textcolor{tug}{Proof Situation}} - \item Assessing stepwise problem solving\\ - {\small $\rightarrow$ \textcolor{tug}{One system for tutoring and assessment}} - \end{itemize} -\end{frame} - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{Material Creation} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\subsection{steps} -\begin{frame} - \frametitle{Course Material Creation {\normalsize Iterations}} %tasks? work flow? - \begin{spacing}{1.3} - \begin{enumerate} - \item Problem Analysis\\ - {\small Variants of problem solving steps} %example partial fractions - \item \textbf{Analysis of mechanized knowledge}\\ - {\small Existing and missing knowledge} - \item \textbf{Programming in a TP based language (TP-PL)} - \item Additional Content\\ - {\small Multimedia explanations for underlying knowledge} - \end{enumerate} - \end{spacing} -\end{frame} - -\subsection{issues} -\begin{frame} - \frametitle{Issues to Accomplish {\normalsize Information Collection}} - \begin{spacing}{1.3} - \begin{itemize} - \item What knowledge is mechanized in Isabelle?\\ - {\small Theorems, Definitions, Numbers,\ldots} - \item What knowledge is mechanized in {\isac{}}?\\ - {\small Problem specifications, Programs,\ldots} - \item What additional explanations are required?\\ - {\small Figures, Examples,\ldots} - \end{itemize} - \end{spacing} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{Details} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\subsection{Technical Survey} -%\begin{frame} -% \frametitle{Technical Survey I {\normalsize Mechanizing Knowledge}} -% \begin{spacing}{1.5} -% \begin{itemize} -% \item Not enough knowledge is mechanized\\ -% {\small Equation Solving, Integrals,\ldots} -% \item Computer Mathematicians required!\\ -% {\small Mathematics: Equation solving, Engineer: Z-Transform} -% \item RISC Linz, Mathematics TU Graz -% \end{itemize} -% \end{spacing} -%\end{frame} - -%\begin{frame} -% \frametitle{Technical Survey II {\normalsize Representation Problems} } -% \begin{spacing}{1.9} -% \begin{itemize} -% \item Different brackets have different meanings\\ -% {\small $u[n]$ is a specific function application :) } -% \item We need Symbols, Indizes and Hochzahlen -% \item Different Representations for different purpos %winkel in polar oder kartesischen koordinaten usw. -% \end{itemize} -% \end{spacing} -%\end{frame} - -\begin{frame} - \frametitle{Representation Problems} - \begin{spacing}{1.4} - \begin{center} - - \begin{itemize} - \item Can meaning of symbols be varied?\\ - {\small $u[n]$ is a specific function in Signal Processing} - \item Simplification, tricks and beauty - \end{itemize} - - {\small $X\cdot(a+b)+Y\cdot(c+d)=aX+bX+cY+dY$}\\ - \vspace{3mm} - {\small $\frac{1}{j\omega}\cdot\left(e^{-j\omega}-e^{j3\omega}\right)=\frac{1}{j\omega}\cdot e^{-j2\omega}\cdot\left(e^{j\omega}-e^{-j\omega}\right)=$}\\ - {\small $=\frac{1}{\omega}\, e^{-j2\omega}\cdot\colorbox{lgray}{$\frac{1}{j}\,\left(e^{j\omega}-e^{-j\omega}\right)$}=\frac{1}{\omega}\,e^{-j2\omega}\cdot\colorbox{lgray}{$2\, sin(\omega)$} $} - - - \end{center} - \end{spacing} -\end{frame} - -\subsection{Demonstration} -\begin{frame} - \frametitle{Demonstration} - \begin{spacing}{1.5} - \begin{itemize} - \item Backend - \begin{itemize} - \item Equation solving - \item Notation problems, Working with Rulesets - \item Framework expansion - \item My Work - \end{itemize} - \end{itemize} - \end{spacing} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{Summary} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\subsection{conclusion} -\begin{frame} - \frametitle{Conclusion} - \begin{spacing}{1.2} - \begin{itemize} - \item Proof of concept for TP-PL succesfull - \item Usability of TP-PL not sufficient - \item Requirements for improved usability clarified - \vspace{5mm} - \item Unacceptable to spend 200h on 1 program - \item \isac{} pointed at my own error - \end{itemize} - \end{spacing} -\end{frame} - -\subsection{contact} -\begin{frame} - \frametitle{Contact} - \begin{spacing}{1.7} - \begin{tabular}{lr} - Isabelle & \small \texttt{\href{isabelle.in.tum.de}{isabelle.in.tum.de}}\\ - The {\isac}-Project & \small \texttt{\href{www.ist.tugraz.at/isac}{www.ist.tugraz.at/isac}}\\ - Project leader & \small \texttt{\href{mailto:wneuper@ist.tugraz.at}{wneuper@ist.tugraz.at}}\\ - Jan Rocnik & \small \texttt{\href{mailto:jan.rocnik@student.tugraz.at}{jan.rocnik@student.tugraz.at}} - \end{tabular} - \end{spacing} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\end{document} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% EOF \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/math-universe.png Binary file src/Doc/isac/jrocnik/math-universe.png has changed diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/pdfsetup.sty --- a/src/Doc/isac/jrocnik/pdfsetup.sty Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -%% -%% default hyperref setup (both for pdf and dvi output) -%% - -\usepackage{color} -\definecolor{linkcolor}{rgb}{0,0,0.5} -\usepackage[colorlinks=true,linkcolor=linkcolor,citecolor=linkcolor,filecolor=linkcolor,pagecolor=linkcolor,urlcolor=linkcolor]{hyperref} diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/preambleForGeneratedDocuments.tex --- a/src/Doc/isac/jrocnik/preambleForGeneratedDocuments.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -\section*{Preamble} -This part gives a detailed review on the development and testing process of new programms. All of the following part is automatically generated out of an {\sisac{}}-theory file (\texttt{.thy} - extension). In this case the file is called \texttt{Build\_Inverse\_Z\_Transform} it can be found in the {\sisac{}} directory: -\begin{center}\texttt{test/Tools/isac/ADDTESTS/course/}\end{center} -{\sisac{}} provides inbuild tools for translating theories into latex documents. To set up such an envoriemt a file called \texttt{isacmakefile} is needed. Further information about this automatic generation can be found in \cite{wenzel2011system}. -\par The following theory can be modified and used as a guiedline for implementing new material. Everything found here is just a snapshot of the work by \today. \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/references.bib --- a/src/Doc/isac/jrocnik/references.bib Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,142 +0,0 @@ -@book{proakis2004contemporary, - title={Contemporary communication systems using MATLAB and Simulink}, - author={Proakis, J.G. and Salehi, M. and Bauch, G.}, - isbn={9780534406172}, - lccn={31054410}, - series={BookWare companion series}, - url={http://books.google.at/books?id=5mXGQgAACAAJ}, - year={2004}, - publisher={Thomson--Brooks/Cole} -} -@book{oppenheim2010discrete, - title={Discrete-time signal processing}, - author={Oppenheim, A.V. and Schafer, R.W.}, - isbn={9780131988422}, - series={Prentice-Hall signal processing series}, - url={http://books.google.at/books?id=mYsoAQAAMAAJ}, - year={2010}, - publisher={Prentice Hall} -} -@manual{wenzel2011system, - title={The Isabelle System Manual}, - author={Wenzel, M. and Berghofer, S.}, - organization={TU Muenchen}, - year={2011}, - month={January} -} -@Book{Nipkow-Paulson-Wenzel:2002, - author = {Tobias Nipkow and Lawrence C. Paulson and Markus Wenzel}, - title = {{Isabelle/HOL} --- A Proof Assistant for Higher-Order Logic}, - publisher = {Springer}, - series = {LNCS}, - volume = 2283, - year = 2002} -@Book{progr-mathematica, - author = {Maeder, Roman E.}, - title = {Programming in Mathematica}, - publisher = {Addison-Wesley}, - address = {Reading, Mass.}, - year = {1997} -} -@Book{prog-maple06, - author = {Aladjav, Victor and Bogdevicius, Marijonas}, - title = {Maple: Programming, Physical and Engineering Problems}, - publisher = {Fultus Corporation}, - year = {2006}, - month = {February 27}, - annote = {ISBN: 1596820802} -} -@Article{plmms10, - author = {Florian Haftmann and Cezary Kaliszyk and Walther Neuper}, - title = {{CTP}-based programming languages~? Considerations about an experimental design}, - journal = {ACM Communications in Computer Algebra}, - year = {2010}, - volume = {44}, - number = {1/2}, - pages = {27-41} %, - %month = {March/June}, - %note = {http://www.ist.tugraz.at/projects/isac/publ/plmms-10.pdf} -} -@inproceedings{casproto, - author = {Cezary Kaliszyk and - Freek Wiedijk}, - title = {Certified Computer Algebra on Top of an Interactive Theorem - Prover}, - booktitle = {Calculemus}, - year = {2007}, - pages = {94-105}, - ee = {http://dx.doi.org/10.1007/978-3-540-73086-6_8}, - crossref = {DBLP:conf/mkm/2007}, - bibsource = {DBLP, http://dblp.uni-trier.de} -} -@InProceedings{wn:lucas-interp-12, - author = {Neuper, Walther}, - title = {Automated Generation of User Guidance by Combining Computation and Deduction}, - booktitle = {THedu'11: CTP-compontents for educational software}, - year = {2012}, - editor = {Quaresma, Pedro}, - publisher = {EPTCS}, - note = {To appear} -} -@Manual{Huet_all:94, - author = {Huet, G. and Kahn, G. and Paulin-Mohring, C.}, - title = {The Coq Proof Assistant}, - institution = {INRIA-Rocquencourt}, - year = {1994}, - type = {Tutorial}, - number = {Version 5.10}, - address = {CNRS-ENS Lyon}, - status={},source={Theorema},location={-} -} -@TECHREPORT{Back-SD09, - author = {Back, Ralph-Johan}, - title = {Structured Derivations as a Unified Proof Style for Teaching Mathematics}, - institution = {TUCS - Turku Centre for Computer Science}, - year = {2009}, - type = {TUCS Technical Report}, - number = {949}, - address = {Turku, Finland}, - month = {July} -} -@InProceedings{ActiveMath-MAIN11, - author = {Melis, Erica and Siekmann, Jrg}, - title = {An Intelligent Tutoring System for Mathematics}, - booktitle = {Seventh International Conference Artificial Intelligence and Soft Computing (ICAISC)}, - pages = {91-101}, - year = {2004}, - editor = {Rutkowski, L. and Siekmann, J. and Tadeusiewicz, R. and Zadeh, L.A.}, - number = {3070,}, - series = {LNAI}, - publisher = {Springer-Verlag}, - doi = {doi:10.1007/978-3-540-24844-6\_12}} -@TechReport{mat-tutor-cmu-MAIN11, - author = {John R. Anderson}, - title = {Intelligent Tutoring and High School Mathematics}, - institution = {Carnegie Mellon University, Department of Psychology}, - year = {2008}, - type = {Technical Report}, - number = {20}, - note = {http://repository.cmu.edu/psychology/20} -} -@PhdThesis{proof-strategies-11, - author = {Dietrich, Dominik}, - title = {Proof Planning with Compiled Strategies}, - school = {FR 6.2 Informatik, Saarland University}, - year = {2011} -} -@proceedings{DBLP:conf/mkm/2007, - editor = {Manuel Kauers and - Manfred Kerber and - Robert Miner and - Wolfgang Windsteiger}, - title = {Towards Mechanized Mathematical Assistants, 14th Symposium, - Calculemus 2007, 6th International Conference, MKM 2007, - Hagenberg, Austria, June 27-30, 2007, Proceedings}, - booktitle = {Calculemus/MKM}, - publisher = {Springer}, - series = {Lecture Notes in Computer Science}, - volume = {4573}, - year = {2007}, - isbn = {978-3-540-73083-5}, - bibsource = {DBLP, http://dblp.uni-trier.de} -} diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/sedindex --- a/src/Doc/isac/jrocnik/sedindex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -#! /bin/sh -# -#sedindex - shell script to create indexes, preprocessing LaTeX's .idx file -# -# puts strings prefixed by * into \tt font -# terminator characters for strings are |!@{} -# -# a space terminates the \tt part to allow \index{*NE theorem}, etc. -# -# change *"X"Y"Z"W to "X"Y"Z"W@{\tt "X"Y"Z"W} -# change *"X"Y"Z to "X"Y"Z@{\tt "X"Y"Z} -# change *"X"Y to "X"Y@{\tt "X"Y} -# change *"X to "X@{\tt "X} -# change *IDENT to IDENT@{\tt IDENT} -# where IDENT is any string not containing | ! or @ -# FOUR backslashes: to escape the shell AND sed -sed -e "s~\*\(\".\".\".\".\)~\1@{\\\\tt \1}~g -s~\*\(\".\".\".\)~\1@{\\\\tt \1}~g -s~\*\(\".\".\)~\1@{\\\\tt \1}~g -s~\*\(\".\)~\1@{\\\\tt \1}~g -s~\*\([^ |!@{}][^ |!@{}]*\)~\1@{\\\\tt \1}~g" $1.idx | makeindex -c -q -o $1.ind diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/jrocnik/wn-notes.txt --- a/src/Doc/isac/jrocnik/wn-notes.txt Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -WN110711 -HOL/Multivariate_Analysis/ -######################### _multi_variate ... nothing else found - -src$ grep -r "interior " * -========================== -HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -definition "interior S = {x. \T. open T \ x \ T \ T \ S}" - -grep -r "definition \"interval" * -================================= -HOL/Multivariate_Analysis/Brouwer_Fixpoint.thy -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -definition "interval_bij = (\ (a::'a,b::'a) (u::'a,v::'a) (x::'a::ordered_euclidean_space). - (\\ i. u$$i + (x$$i - a$$i) / (b$$i - a$$i) * (v$$i - u$$i))::'a)" - - -??? "{a<.. {c..d} \ s" ?definition interval? - -src$ grep -r ".nti.eriv" * -========================= -1 file except isac: -# HOL/Multivariate_Analysis/Derivative.thy -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -header {* Kurzweil-Henstock Gauge Integration in many dimensions. *} -definition differentiable :: "('a::real_normed_vector \ 'b::real_normed_vector) \ 'a net \ bool" (infixr "differentiable" 30) where - "f differentiable net \ (\f'. (f has_derivative f') net)" - -definition differentiable_on :: "('a::real_normed_vector \ 'b::real_normed_vector) \ 'a set \ bool" (infixr "differentiable'_on" 30) where - "f differentiable_on s \ (\x\s. f differentiable (at x within s))" - -definition "frechet_derivative f net = (SOME f'. (f has_derivative f') net)" - -/ -========================= -HOL/Multivariate_Analysis/Integration.thy -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -header {* Kurzweil-Henstock Gauge Integration in many dimensions. *} -definition "integral i f \ SOME y. (f has_integral y) i" - -/ -========================= -HOL/Multivariate_Analysis/Real_Integration.thy -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -text{*We follow John Harrison in formalizing the Gauge integral.*} - -definition Integral :: "real set \ (real \ real) \ real \ bool" where - "Integral s f k = (f o dest_vec1 has_integral k) (vec1 ` s)" - -Multivariate_Analysis/L2_Norm.thy:header {* Square root of sum of squares *} - - -################################################################################ -### sum -################################################################################ -src/HOL$ grep -r " sum " * -========================== -ex/Summation.thy:text {* The formal sum operator. *} -ex/Termination.thy:function sum :: "nat \ nat \ nat" -ex/Termination.thy: "sum i N = (if i > N then 0 else i + sum (Suc i) N)" -Isar_Examples/Summation.thy -~~~~~~~~~~~~~~~~~~~~~~~~~~~ -text {* The sum of natural numbers $0 + \cdots + n$ equals $n \times - -Series.thy -~~~~~~~~~~ -header{*Finite Summation and Infinite Series*} - -Deriv.thy -~~~~~~~~~ -definition - deriv :: "['a::real_normed_field \ 'a, 'a, 'a] \ bool" - --{*Differentiation: D is derivative of function f at x*} - ("(DERIV (_)/ (_)/ :> (_))" [1000, 1000, 60] 60) where - "DERIV f x :> D = ((%h. (f(x + h) - f x) / h) -- 0 --> D)" diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/mat-eng-de.lot --- a/src/Doc/isac/mat-eng-de.lot Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -\addvspace {10\p@ } -\addvspace {10\p@ } -\addvspace {10\p@ } -\addvspace {10\p@ } -\addvspace {10\p@ } -\addvspace {10\p@ } -\addvspace {10\p@ } -\addvspace {10\p@ } -\contentsline {table}{\numberline {8.1}{\ignorespaces Kleinste Teilchen des KB}}{37} -\contentsline {table}{\numberline {8.2}{\ignorespaces Welche tactics verwenden die Teile des KB\nobreakspace {}?}}{38} -\contentsline {table}{\numberline {8.3}{\ignorespaces theory von der ersten Version von ${\cal I}\mkern -2mu{\cal S}\mkern -5mu{\cal AC}$}}{39} -\contentsline {table}{\numberline {8.4}{\ignorespaces Daten in {\tt *.thy}- und {\tt *.ML}-files}}{40} diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/mat-eng-de.pdf Binary file src/Doc/isac/mat-eng-de.pdf has changed diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/mat-eng-de.tex --- a/src/Doc/isac/mat-eng-de.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1354 +0,0 @@ -\documentclass[11pt,a4paper,headline,headcount,towside,nocenter]{report} -\usepackage{latexsym} - -%\usepackage{ngerman} -%\grmn@dq@error ...and \dq \string #1 is undefined} -%l.989 ...tch the problem type \\{\tt["squareroot", -% "univ -\bibliographystyle{alpha} - -\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} -\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} - -\title{\isac \\ - Experimente zur Computermathematik\\[1.0ex] - und\\[1.0ex] - Handbuch f\"ur Autoren der\\ - Mathematik-Wissensbasis\\[1.0ex]} -\author{Alexandra Hirn und Eva Rott\\ - \tt isac-users@ist.tugraz.at\\[1.0ex]} -\date{\today} - -\begin{document} -\maketitle -\newpage -\tableofcontents -\newpage -\listoftables -\newpage - -\chapter{Einleitung} -Dies ist die \"Ubersetzung der dersten Kapitel einer englischen Version \footnote{http://www.ist.tugraz.at/projects/isac/publ/mat-eng.pdf}, auf den Stand von \sisac{} 2008 gebracht. Die \"Ubersetzung und Anpassung erfolgte durch die Autorinnen im Rahmen einer Ferialpraxis am Institut f\"ur Softwaretechnologie der TU Graz. - -Diese Version zeichnet sich dadurch aus, dass sie von ``Nicht-Computer-Freaks'' f\"ur ``Nicht-Computer-Freaks'' geschrieben wurde. - -\section{``Authoring'' und ``Tutoring''} -\paragraph{TO DO} Mathematik lernen -- verschiedene Autoren -- Isabelle -Die Grundlage f\"ur \isac{} bildet Isabelle. Dies ist ein ``theorem prover'', der von L. Paulson und T. Nipkow entwickelt wird und Hard- und Software pr\"uft. -\section{Der Inhalt des Dokuments} -\paragraph{TO DO} {Als Anleitung:} Dieses Dokument beschreibt das Kerngebiet (KE) von \isac{}, das Gebiet der mathematics engine (ME) im Kerngebiet und die verschiedenen Funktionen wie das Umschreiben und der Vergleich. - -\isac{} und KE wurden in SML geschrieben, die Sprache in Verbindung mit dem Vorg\"anger des theorem Provers Isabelle entwickelt. So kam es, dass in diesem Dokument die Ebene ASCII als SML Code pr\"asentiert wird. Der Leser wird vermutlich erkennen, dass der \isac{} Benutzer eine vollkommen andere Sichtweise auf eine grafische Benutzeroberfl\"ache bekommt. - -Das Dokument ist eigenst\"andig; Basiswissen \"uber SML (f\"ur eine Einf\"uhrung siehe \cite{Paulson:91}), Terme und Umschreibung wird vorrausgesetzt. - -%The interfaces will be moderately exended during the first phase of development of the mathematics knowledge. The work on the subprojects defined should {\em not} create interfaces of any interest to a user or another author of knowledge except identifiers (of type string) for theorems, rulesets etc. - -Hinweis: SML Code, Verzeichnis, Dateien sind {\tt in 'tt' geschrieben}; besonders in {\tt ML>} ist das Kerngebiet schnell. - -\paragraph{Versuchen Sie es!} Ein weiteres Anliegen dieses Textes ist, dem Leser Tipps f\"ur Versuche mit den Anwendungen zu geben. - -\section{Gleich am Computer ausprobieren!}\label{get-started} -\paragraph{TO DO screenshot} Bevor Sie mit Ihren Versuchen beginnen, m\"ochten wir Ihnen noch einige Hinweise geben: -\begin{itemize} - \item System starten - \item Shell aufmachen und die Datei mat-eng-de.sml \"offnen. - \item $>$ : Hinter diesem Zeichen (``Prompt'') stehen jene, die Sie selbst eingeben bzw. mit Copy und Paste aus der Datei kopieren. - \item Die Eingabe wird mit ``;'' und ``Enter'' abgeschlossen. - \item Zeilen, die nicht mit Prompt beginnen, werden vom Computer ausgegeben. - -\end{itemize} - -\part{Experimentelle Ann\"aherung} - -\chapter{Terme und Theorien} -Wie bereits erw\"ahnt, geht es um Computer-Mathematik. In den letzten Jahren hat die ``computer science'' grosse Fortschritte darin gemacht, Mathematik auf dem Computer verst\"andlich darzustellen. Dies gilt f\"ur mathematische Formeln, f\"ur die Beschreibung von Problemen, f\"ur L\"osungsmethoden etc. Wir beginnen mit mathematischen Formeln. - -\section{Von der Formel zum Term} -Um ein Beispiel zu nennen: Die Formel $a+b\cdot 3$ l\"asst sich in lesbarer Form so eingeben: -{\footnotesize\begin{verbatim} - > "a + b * 3"; - val it = "a + b * 3" : string -\end{verbatim}} -\noindent ``a + b * 3'' ist also ein string (eine Zeichenfolge). In dieser Form weiss der Computer nicht, dass z.B. eine Multiplikation {\em vor} einer Addition zu rechnen ist. Isabelle braucht dazu eine andere Darstellung f\"ur Formeln. In diese kann man mit der Funktion {\tt str2term} (string to term) umrechnen: -{\footnotesize\begin{verbatim} - > str2term "a + b * 3"; - val it = - Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $ - Free ("a", "RealDef.real") $ - (Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $ - ...) : Term.term -\end{verbatim}} -\noindent Diese Form heisst {\tt term} und ist nicht f\"ur den Menschen zum lesen gedacht. Isabelle braucht sie aber intern zum Rechnen. Wir wollen sie mit Hilfe von {\tt val} (value) auf der Variable {\tt t} speichern: -{\footnotesize\begin{verbatim} - > val t = str2term "a + b * 3"; - val t = - Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $ - Free ("a", "RealDef.real") $ - (Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $ - ...) : Term.term -\end{verbatim}} -Von dieser Variablen {\tt t} kann man den Wert jederzeit abrufen: -{\footnotesize\begin{verbatim} - > t; - val it = - Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $ - Free ("a", "RealDef.real") $ - (Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $ - ...) : Term.term -\end{verbatim}} -Der auf {\tt t} gespeicherte Term kann einer Funktion {\tt atomty} \"ubergeben werden, die diesen in einer dritten Form zeigt: -{\footnotesize\begin{verbatim} - > atomty term; - - *** - *** Const (op +, [real, real] => real) - *** . Free (a, real) - *** . Const (op *, [real, real] => real) - *** . . Free (b, real) - *** . . Free (3, real) - *** - - val it = () : unit -\end{verbatim}} -Diese Darstellung nennt man ``abstract syntax'' und macht unmittelbar klar, dass man a und b nicht addieren kann, weil ein Mal vorhanden ist. -\newline Es gibt noch eine vierte Art von Term, den cterm. Er wird weiter unten verwendet, weil er sich als string lesbar darstellt. - -\section{``Theory'' und ``Parsing``} -Der Unterschied zwischen \isac{} und bisheriger Mathematiksoftware (GeoGebra, Mathematica, Maple, Derive etc.) ist, dass das mathematische Wissen nicht im Programmcode steht, sondern in sogenannten theories (Theorien). -Dort wird das Mathematikwissen in einer f\"ur nicht Programmierer lesbaren Form geschrieben. Das Wissen von \isac{} ist in folgenden Theorien entahlten: -{\footnotesize\begin{verbatim} - > Isac.thy; - val it = - {ProtoPure, CPure, HOL, Set, Typedef, Fun, Product_Type, Lfp, Gfp, - Sum_Type, Relation, Record, Inductive, Transitive_Closure, - Wellfounded_Recursion, NatDef, Nat, NatArith, Divides, Power, - SetInterval, Finite_Set, Equiv, IntDef, Int, Datatype_Universe, - Datatype, Numeral, Bin, IntArith, Wellfounded_Relations, Recdef, IntDiv, - IntPower, NatBin, NatSimprocs, Relation_Power, PreList, List, Map, - Hilbert_Choice, Main, Lubs, PNat, PRat, PReal, RealDef, RealOrd, - RealInt, RealBin, RealArith0, RealArith, RComplete, RealAbs, RealPow, - Ring_and_Field, Complex_Numbers, Real, ListG, Tools, Script, Typefix, - Float, ComplexI, Descript, Atools, Simplify, Poly, Rational, PolyMinus, - Equation, LinEq, Root, RootEq, RatEq, RootRat, RootRatEq, PolyEq, Vect, - Calculus, Trig, LogExp, Diff, DiffApp, Integrate, EqSystem, Biegelinie, - AlgEin, Test, Isac} : Theory.theory -\end{verbatim}} -{\tt ProtoPure} und {\tt CPure} enthalten diese logischen Grundlagen, die in {\tt HOL} und den nachfolgenden Theorien erweitert werden. \isac{} als letzte Theorie beinhaltet das gesamte Wissen. -Dass das Mal vor dem Plus berechnet wird, ist so festgelegt: -{\footnotesize\begin{verbatim} - class plus = - fixes plus :: "'a \ 'a \ 'a" (infixl "+" 65) - - class minus = - fixes minus :: "'a \ 'a \ 'a" (infixl "-" 65) - - class uminus = - fixes uminus :: "'a \ 'a" ("- _" [81] 80) - - class times = - fixes times :: "'a \ 'a \ 'a" (infixl "*" 70) -\end{verbatim}} -{\tt infix} gibt an, dass der Operator zwischen den Zahlen steht und nicht, wie in ''abstract syntax``, vorne oben. -Die Zahlen rechts davon legen die Priorit\"at fest. 70 f\"ur Mal ist gr\"osser als 65 f\"ur Plus und wird daher zuerst berechnet. - -Wollen Sie wissen, wie die einzelnen Rechengesetze aussehen, k\"onnen Sie im Internet folgenden Link ansehen: http://isabelle.in.tum.de/dist/library/HOL/Groups.html - -\paragraph{} Der Vorgang, bei dem aus einem {\tt string} ein Term entsteht, nennt man Parsing. Dazu wird Wissen aus der Theorie ben\"otigt, denn {\tt str2term} nimmt intern eine parse-Funktion, bei der immer das gesamte \isac{}-Wissen verwendet wird. Bei dieser Funktion wird weiters festgelegt, aus welcher Theorie das Wissen genommen werden soll. -{\footnotesize\begin{verbatim} - > parse Isac.thy "a + b"; - val it = Some "a + b" : Thm.cterm Library.option -\end{verbatim}} -Um sich das Weiterrechnen zu erleichtern, kann das Ergebnis vom Parsing auf eine Variable, wie zum Beispiel {\tt t} gespeichert werden: -{\footnotesize\begin{verbatim} - > val t = parse Isac.thy "a + b"; - val t = Some "a + b" : Thm.cterm Library.option -\end{verbatim}} -{\tt Some} bedeutet, dass das n\"otige Wissen vorhanden ist, um die Rechnung durchzuf\"uhren. {\tt None} zeigt uns, dass das Wissen fehlt oder ein Fehler aufgetreten ist. Daher sieht man im folgenden Beispiel, dass {\tt HOL.thy} nicht ausreichend Wissen enth\"alt: -{\footnotesize\begin{verbatim} - > parse HOL.thy "a + b"; - val it = None : Thm.cterm Library.option -\end{verbatim}} -Anschliessend zeigen wir Ihnen noch ein zweites Beispiel, bei dem sowohl ein Fehler aufgetreten ist, als auch das Wissen fehlt: -{\footnotesize\begin{verbatim} - > parse Isac.thy "a + "; - *** Inner syntax error: unexpected end of input - *** Expected tokens: "contains_root" "is_root_free" "q_" "M_b" "M_b'" - *** "Integral" "differentiate" "E_" "some_of" "||" "|||" "argument_in" - *** "filter_sameFunId" "I__" "letpar" "Rewrite_Inst" "Rewrite_Set" - *** "Rewrite_Set_Inst" "Check_elementwise" "Or_to_List" "While" "Script" - *** "\\" "\\" "\\" "CHR" "xstr" "SOME" "\\" "@" - *** "GREATEST" "[" "[]" "num" "\\" "{)" "{.." "\\" "(|" - *** "\\" "SIGMA" "()" "\\" "PI" "\\" "\\" "{" "INT" - *** "UN" "{}" "LEAST" "\\" "0" "1" "-" "!" "?" "?!" "\\" - *** "\\" "\\" "\\!" "THE" "let" "case" "~" "if" "ALL" - *** "EX" "EX!" "!!" "_" "\\" "\\" "PROP" "[|" "OFCLASS" - *** "\\" "op" "\\" "%" "TYPE" "id" "longid" "var" "..." - *** "\\" "(" - val it = None : Thm.cterm Library.option -\end{verbatim}} - -Das mathematische Wissen w\"achst mit jeder Theorie von ProtoPure bis Isac. In den folgenden Beispielen wird gezeigt, wie das Wissen w\"achst. - -{\footnotesize\begin{verbatim} - > (*-1-*); - > parse HOL.thy "2^^^3"; - *** Inner lexical error at: "^^^3" - val it = None : Thm.cterm Library.option -\end{verbatim}} -''Inner lexical error`` und ''None`` bedeuten, dass ein Fehler aufgetreten ist, denn das Wissen \"uber {\tt *} findet sich erst in der {\tt theorie group}. - -{\footnotesize\begin{verbatim} - > (*-2-*); - > parse HOL.thy "d_d x (a + x)"; - val it = None : Thm.cterm Library.option -\end{verbatim}} -Hier wiederum ist noch kein Wissen \"uber das Differenzieren vorhanden. - -{\footnotesize\begin{verbatim} - > (*-3-*); - > parse Rational.thy "2^^^3"; - val it = Some "2 ^^^ 3" : Thm.cterm Library.option -\end{verbatim}} - -{\footnotesize\begin{verbatim} - > (*-4-*); - > val Some t4 = parse Rational.thy "d_d x (a + x)"; - val t4 = "d_d x (a + x)" : Thm.cterm -\end{verbatim}} - -{\footnotesize\begin{verbatim} - > (*-5-*); - > val Some t5 = parse Diff.thy "d_d x (a + x)"; - val t5 = "d_d x (a + x)" : Thm.cterm -\end{verbatim}} -Die letzen drei Aufgaben k\"onnen schon gel\"ost werden, da {\tt Rational.thy} \"uber das n\"otige Wissen verf\"ugt. - -\section{Details von Termen} -Mit Hilfe der darunterliegenden Darstellung sieht man, dass ein cterm in einen Term umgewandelt werden kann. -{\footnotesize\begin{verbatim} - > term_of; - val it = fn : Thm.cterm -> Term.term -\end{verbatim}} -Durch die Umwandlung eines cterms in einen Term sieht man die einzelnen Teile des Terms. ''Free`` bedeutet, dass man die Variable \"andern kann. -{\footnotesize\begin{verbatim} - > term_of t4; - val it = - Free ("d_d", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $ - ...: Term.term - -\end{verbatim}} -In diesem Fall sagt uns das ''Const``, dass die Variable eine Konstante ist, also ein Fixwert, der immer die selbe Funktion hat. -{\footnotesize\begin{verbatim} - > term_of t5; - val it = - Const ("Diff.d_d", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $ - ... : Term.term -\end{verbatim}} -Sollten verschiedene Teile des ''output`` (= das vom Computer Ausgegebene) nicht sichtbar sein, kann man mit einem bestimmten Befehl alles angezeigt werden. -{\footnotesize\begin{verbatim} - > print_depth; - val it = fn : int -> unit - \end{verbatim}} -Zuerst gibt man den Befehl ein, danach den Term, der gr\"osser werden soll. Dabei kann man selbst einen Wert f\"ur die L\"ange bestimmen. -{\footnotesize\begin{verbatim} - > print_depth 10; - val it = () : unit - > term_of t4; - val it = - Free ("d_d", "[RealDef.real, RealDef.real] => RealDef.real") $ - Free ("x", "RealDef.real") $ - (Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $ - Free ("a", "RealDef.real") $ Free ("x", "RealDef.real")) - : Term.term - - > print_depth 10; - val it = () : unit - > term_of t5; - val it = - Const ("Diff.d_d", "[RealDef.real, RealDef.real] => RealDef.real") $ - Free ("x", "RealDef.real") $ - (Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $ - Free ("a", "RealDef.real") $ Free ("x", "RealDef.real")) - : Term.term -\end{verbatim}} -\paragraph{Versuchen Sie es!} -Eine andere Variante um den Unterschied der beiden Terme zu sehen ist folgende: -{\footnotesize\begin{verbatim} - > (*-4-*) val thy = Rational.thy; - val thy = - {ProtoPure, CPure, HOL, Set, Typedef, Fun, Product_Type, Lfp, Gfp, - Sum_Type, Relation, Record, Inductive, Transitive_Closure, - Wellfounded_Recursion, NatDef, Nat, NatArith, Divides, Power, - SetInterval, Finite_Set, Equiv, IntDef, Int, Datatype_Universe, - Datatype, Numeral, Bin, IntArith, Wellfounded_Relations, Recdef, IntDiv, - IntPower, NatBin, NatSimprocs, Relation_Power, PreList, List, Map, - Hilbert_Choice, Main, Lubs, PNat, PRat, PReal, RealDef, RealOrd, - RealInt, RealBin, RealArith0, RealArith, RComplete, RealAbs, RealPow, - Ring_and_Field, Complex_Numbers, Real, ListG, Tools, Script, Typefix, - Float, ComplexI, Descript, Atools, Simplify, Poly, Rational} - : Theory.theory - > ((atomty) o term_of o the o (parse thy)) "d_d x (a + x)"; - - *** - *** Free (d_d, [real, real] => real) - *** . Free (x, real) - *** . Const (op +, [real, real] => real) - *** . . Free (a, real) - *** . . Free (x, real) - *** - - val it = () : unit - - - > (*-5-*) val thy = Diff.thy; - val thy = - {ProtoPure, CPure, HOL, Set, Typedef, Fun, Product_Type, Lfp, Gfp, - Sum_Type, Relation, Record, Inductive, Transitive_Closure, - Wellfounded_Recursion, NatDef, Nat, NatArith, Divides, Power, - SetInterval, Finite_Set, Equiv, IntDef, Int, Datatype_Universe, - Datatype, Numeral, Bin, IntArith, Wellfounded_Relations, Recdef, IntDiv, - IntPower, NatBin, NatSimprocs, Relation_Power, PreList, List, Map, - Hilbert_Choice, Main, Lubs, PNat, PRat, PReal, RealDef, RealOrd, - RealInt, RealBin, RealArith0, RealArith, RComplete, RealAbs, RealPow, - Ring_and_Field, Complex_Numbers, Real, Calculus, Trig, ListG, Tools, - Script, Typefix, Float, ComplexI, Descript, Atools, Simplify, Poly, - Equation, LinEq, Root, RootEq, Rational, RatEq, RootRat, RootRatEq, - PolyEq, LogExp, Diff} : Theory.theory - - > ((atomty) o term_of o the o (parse thy)) "d_d x (a + x)"; - - *** - *** Const (Diff.d_d, [real, real] => real) - *** . Free (x, real) - *** . Const (op +, [real, real] => real) - *** . . Free (a, real) - *** . . Free (x, real) - *** - - val it = () : unit -\end{verbatim}} - - -\chapter{''Rewriting``} -\section{Was ist Rewriting?} -Bei Rewriting handelt es sich um das Umformen von Termen nach vorgegebenen Regeln. Folgende zwei Funktionen sind notwendig: -{\footnotesize\begin{verbatim} - > rewrite; - val it = fn - : - theory' -> - rew_ord' -> - rls' -> bool -> thm' -> cterm' -> (string * string list) Library.option -\end{verbatim}} -Die Funktion hat zwei Argumente, die mitgeschickt werden m\"ussen, damit die Funktion arbeiten kann. Das letzte Element {\tt (cterm' * cterm' list) Library.option} im unteren Term ist das Ergebnis, das die Funktionen {\tt rewrite} zur\"uckgeben und die zwei vorhergehenden Argumente, {\tt theorem} und {\tt cterm}, sind die f\"ur uns wichtigen. {\tt Theorem} ist die Rechenregel und {\tt cterm} jene Formel auf die die Rechenregel angewendet wird. -{\footnotesize\begin{verbatim} - > rewrite_inst; - val it = fn - : - theory' -> - rew_ord' -> - rls' ->bool -> 'a -> thm' -> cterm' -> (cterm' * cterm' list) Library.option -\end{verbatim}} -Die Funktion {\tt rewrite\_inst} wird ben\"otigt, um Gleichungen, Rechnungen zum Differenzieren etc. zu l\"osen. Dabei wird die gebundene Variable (bdv) instanziiert, d.h. es wird die Variable angegeben, nach der man differenzieren will, bzw. f\"ur die ein Wert bei einer Gleichung herauskommen soll. -Um zu sehen wie der Computer vorgeht nehmen wir folgendes Beispiel, dessen Ergebnis offenbar 0 ist, was der Computer jedoch erst nach einer Reihe von Schritten herausfindet. -Im Beispiel wird differenziert, wobei \isac's Schreibweise jene von Computer Algebra Systemen (CAS) anzugleichen: in CAS wird differenziert mit $\frac{d}{dx}\; x^2 + 3 \cdot x + 4$, in \isac{} mit {\tt d\_d x (x \^{ }\^{ }\^{ } 2 + 3 * x + 4)}. -Zuerst werden die einzelnen Werte als Variablen gespeichert: -{\footnotesize\begin{verbatim} - > val thy' = "Diff.thy"; - val thy' = "Diff.thy" : string - > val ro = "tless_true"; - val ro = "tless_true" : string - > val er = "eval_rls"; - val er = "eval_rls" : string - > val inst = [("bdv","x::real")]; - val inst = [("bdv", "x::real")] : (string * string) list - > val ct = "d_d x (a + a * (2 + b))"; - val ct = "d_d x (a + a * (2 + b))" : string -\end{verbatim}} -Nun wird die Rechnung nach den Regeln ausgerechnet, wobei am Ende mehrere Dinge zugleich gemacht werden. -Folgende Regeln werden ben\"otigt: Summenregel, Produktregel, Multiplikationsregel mit einem konstanten Faktor und zum Schluss die Additionsregel. -{\footnotesize\begin{verbatim} - > val Some (ct,_) = rewrite_inst thy' ro er true inst ("diff_sum","") ct; - val ct = "d_d x a + d_d x (a * (2 + b))" : cterm' - > val Some (ct,_) = rewrite_inst thy' ro er true inst ("diff_prod","") ct; - val ct = "d_d x a + (d_d x a * (2 + b) + a * d_d x (2 + b))" : cterm' - > val Some (ct,_) = rewrite_inst thy' ro er true inst ("diff_const","") ct; - val ct = "d_d x a + (d_d x a * (2 + b) + a * 0) " : cterm' - > val Some (ct,_) = rewrite_inst thy' ro er true inst ("diff_const","") ct; - val ct = "d_d x a + (0 * (2 + b) + a * 0)" : cterm' - > val Some (ct,_) = rewrite_inst thy' ro er true inst ("diff_const","") ct; - val ct = "0 + (0 * (2 + b) + a * 0)" : cterm' - > val Some (ct,_) = rewrite_set thy' true "make_polynomial" ct; - val ct = "0" : string -\end{verbatim}} -Was {\tt rewrite\_set} genau macht, finden Sie im n\"achsten Kapitel. - -Dies w\"are ein etwas ernsthafteres Beispiel zum Differenzieren: -{\footnotesize\begin{verbatim} - > val ct = "d_d x (x ^^^ 2 + 3 * x + 4)"; - > val Some (ct,_) = rewrite_inst thy' ro er true inst ("diff_sum","") ct; -\end{verbatim}} -\paragraph{Versuchen Sie es,} diese Beispiel zu Ende zu f\"uhren! Die Regeln, die \isac{} kennt und zum Umformen verwenden kann, finden Sie im Internet \footnote{{\tiny\tt http://www.ist.tugraz.at/projects/isac/www/kbase/thy/browser\_info/HOL/HOL-Real/Isac/Diff.html}}. - -\section{Welche W\"unsche kann man an Rewriting stellen?} -Es gibt verschiedene Varianten von Rewriting, die alle eine bestimmte Bedeutung haben. -{\tt rewrite\_ set} wandelt Terme in ein ganzes rule set um, die normalerweise nur mit einem Theorem vereinfacht dargestellt werden. -Hierbei werden auch folgende Argumente verwendet:\\ -\tabcolsep=4mm -\def\arraystretch{1.5} -\begin{tabular}{lp{11.0cm}} -{\tt theory} & Die Theory von Isabelle, die alle n\"otigen Informationen f\"ur das Parsing {\tt term} enth\"alt. \\ -{\tt rew\_ord}& die Ordnung f\"ur das geordnete Rewriting. F\"ur {\em no} ben\"otigt das geordnete Rewriting {\tt tless\_true}, eine Ordnung, die f\"ur alle nachgiebigen Argumente true ist \\ -{\tt rls} & Das rule set; zur Auswertung von bestimmten Bedingungen in {\tt thm} falls {\tt thm} eine conditional rule ist \\ -{\tt bool} & ein Bitschalter, der die Berechnungen der m\"oglichen condition in {\tt thm} ausl\"ost: wenn sie {\tt false} ist, dann wird die condition bewertet und auf Grund des Resultats wendet man {\tt thm} an, oder nicht; wenn {\tt true} dann wird die condition nicht ausgewertet, aber man gibt sie in eine Menge von Hypothesen \\ -{\tt thm} & das theorem versucht den {\tt term} zu \"uberschreiben \\ -{\tt term} & {\tt thm} wendet Rewriting m\"oglicherweise auf den Term an \\ -\end{tabular}\\ - -{\footnotesize\begin{verbatim} - > rewrite_set; - val it = fn : theory' -> bool -> rls' -> ... -\end{verbatim}} -{\footnotesize\begin{verbatim} - > rewrite_set_inst; - val it = fn : theory' -> bool -> subs' -> . -\end{verbatim}} -Wenn man sehen m\"ochte wie Rewriting bei den einzelnen theorems funktioniert kann man dies mit {\tt trace\_rewrite} versuchen. -{\footnotesize\begin{verbatim} - > trace_rewrite := true; - val it = () : unit -\end{verbatim}} - - -\section{Rule sets} -Einige der oben genannten Varianten von Rewriting beziehen sich nicht nur auf einen theorem, sondern auf einen ganzen Block von theorems, die man als rule set bezeichnet. -Dieser wird so lange angewendet, bis ein Element davon f\"ur Rewriting verwendet werden kann. Sollte der Begriff ''terminate`` fehlen, wird das Rule set nicht beendet und l\"auft weiter. -Ein Beispiel f\"ur einen rule set ist folgendes: -{\footnotesize\begin{verbatim} -??????????? -\end{verbatim}} - -{\footnotesize\begin{verbatim} - > sym; - val it = "?s = ?t ==> ?t = ?s" : Thm.thm - > rearrange_assoc; - val it = - Rls - {id = "rearrange_assoc", - scr = Script (Free ("empty_script", "RealDef.real")), - calc = [], - erls = - Rls - {id = "e_rls", - scr = EmptyScr, - calc = [], - erls = Erls, - srls = Erls, - rules = [], - rew_ord = ("dummy_ord", fn), - preconds = []}, - srls = - Rls - {id = "e_rls", - scr = EmptyScr, - calc = [], - erls = Erls, - srls = Erls, - rules = [], - rew_ord = ("dummy_ord", fn), - preconds = []}, - rules = - [Thm ("sym_radd_assoc", "?m1 + (?n1 + ?k1) = ?m1 + ?n1 + ?k1" [.]), - Thm - ("sym_rmult_assoc", - "?m1 * (?n1 * ?k1) = ?m1 * ?n1 * ?k1" [.])], - rew_ord = ("e_rew_ord", fn), - preconds = []} : rls -\end{verbatim}} - - -\section{Berechnung von Konstanten} -Sobald Konstanten in dem Bereich des Subterms sind, k\"onnen sie von einer Funktion berechnet werden: -{\footnotesize\begin{verbatim} - > calculate; - val it = fn - : - theory' -> - string * - ( - string -> - Term.term -> Theory.theory -> (string * Term.term) Library.option) -> - cterm' -> (string * thm') Library.option - - > calculate_; - val it = fn - : - Theory.theory -> - string * - ( - string -> - Term.term -> Theory.theory -> (string * Term.term) Library.option) -> - Term.term -> (Term.term * (string * Thm.thm)) Library.option -\end{verbatim}} -Man bekommt das Ergebnis und das theorem bezieht sich darauf. Daher sind die folgenden mathematischen Rechnungen m\"oglich: -{\footnotesize\begin{verbatim} - > calclist; - val it = - [("Vars", ("Tools.Vars", fn)), ("matches", ("Tools.matches", fn)), - ("lhs", ("Tools.lhs", fn)), ("plus", ("op +", fn)), - ("times", ("op *", fn)), ("divide_", ("HOL.divide", fn)), - ("power_", ("Atools.pow", fn)), ("is_const", ("Atools.is'_const", fn)), - ("le", ("op <", fn)), ("leq", ("op <=", fn)), - ("ident", ("Atools.ident", fn)), ("sqrt", ("Root.sqrt", fn)), - ("Test.is_root_free", ("is'_root'_free", fn)), - ("Test.contains_root", ("contains'_root", fn))] - : - ( - string * - ( - string * - ( - string -> - Term.term -> Theory.theory -> (string * Term.term) Library.option))) list -\end{verbatim}} - - - - -\chapter{Termordnung} -Die Anordnungen der Begriffe sind unverzichtbar f\"ur den Gebrauch des Umschreibens von normalen Funktionen und von normalen Formeln, die n\"otig sind um passende Modelle f\"ur Probleme zu finden. - -\section{Beispiel f\"ur Termordnungen} -Es ist nicht unbedeutend, eine Verbindung zu Termen herzustellen, die wirklich eine Ordnung besitzen. Diese Ordnungen sind selbstaufrufende Bahnordnungen: - -{\footnotesize\begin{verbatim} - > sqrt_right; - val it = fn : bool -> Theory.theory -> subst -> Term.term * Term.term -> b ool - > tless_true; - val it = fn : subst -> Term.term * Term.term -> bool -\end{verbatim}} - -Das ''bool`` Argument gibt Ihnen die M\"oglichkeit, die Kontrolle zu den zugeh\"origen Unterordunungen zur\"uck zu verfolgen, damit sich die Unterordnungen, die 'true' sind, als strings anzeigen lassen. - -{\section{Geordnetes Rewriting}} -Beim Rewriting entstehen Probleme, die vom ''law of commutativity`` (= Kommutativgesetz) durch '+' und '*' verursacht werden. Diese Probleme k\"onnen nur durch geordnetes Rewriting gel\"ost werden, da hier ein Term nur umgeschrieben wird, wenn ein kleinerer dadurch entsteht. - - -\chapter{Problem hierachy} -\section{''Matching``} -Matching ist eine Technik von Rewriting, die von \isac{} verwendet wird, um ein Problem und den passenden problem type daf\"ur zu finden. Die folgende Funktion \"uberpr\"uft, ob Matching m\"oglich ist: -{\footnotesize\begin{verbatim} -> matches; -val it = fn : Theory.theory -> Term.term -> Term.term -> bool -\end{verbatim}} -Die folgende Gleichung wird in Operatoren und freie Variablen zerlegt. -{\footnotesize\begin{verbatim} -> val t = (term_of o the o (parse thy)) "3 * x^^^2 = 1"; -val t = -Const ("op =", "[RealDef.real, RealDef.real] => bool") $ -(Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $ -Free ("3", "RealDef.real") $ -(Const -("Atools.pow", -"[RealDef.real, RealDef.real] => RealDef.real") $ -Free ("x", "RealDef.real") $ Free ("2", " RealDef.real"))) $ -Free ("1", "RealDef.real") : Term.term -\end{verbatim}} -Nun wird ein Modell erstellt, das sich nicht auf bestimmte Zahlen bezieht, sondern nur eine generelle Zerlegung durchf\"uhrt. -{\footnotesize\begin{verbatim} -> val p = (term_of o the o (parse thy)) "a * b^^^2 = c"; -val p = -Const ("op =", "[RealDef.real, RealDef.real] => bool") $ -(Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $ -Free ("a", "RealDef.real") $ -(Const -("Atools.pow", -"[RealDef.real, RealDef.real] => RealDef.real") $ -Free ("b", "RealDef.real") $ Free ("2", "RealDef.real"))) $ -Free ("c", "RealDef.real") : Term.term -\end{verbatim}} -Dieses Modell enth\"alt sogenannte \textit{scheme variables}. -{\footnotesize\begin{verbatim} -> atomt p; -"*** -------------" -"*** Const (op =)" -"*** . Const (op *)""*** . . Free (a, )" -"*** . . Const (Atools.pow)" -"*** . . . Free (b, )" -"*** . . . Free (2, )" -"*** . Free (c, )" -"\n" -val it = "\n" : string -\end{verbatim}} -Das Modell wird durch den Befehl \textit{free2var} erstellt. -{\footnotesize\begin{verbatim} -> free2var; -val it = fn : Term.term -> Term.term -> val pat = free2var p; -val pat = -Const ("op =", "[RealDef.real, RealDef.real] => bool") $ -(Const ("op *", "[RealDef.real, RealDef.real] => RealDef.real") $ -Var (("a", 0), "RealDef.real") $ -(Const -("Atools.pow", -"[RealDef.real, RealDef.real] => RealDef.real") $ -Var (("b", 0), "RealDef.real") $ -Free ("2", "RealDef.real"))) $ Var (("c", 0), "RealDef.real") -: Term.term -> Sign.string_of_term (sign_of thy) pat; -val it = "?a * ?b ^^^ 2 = ?c" : string -\end{verbatim}} -Durch \textit{atomt pat} wird der Term aufgespalten und in eine Form gebracht, die f\"ur die weiteren Schritte ben\"otigt wird. -{\footnotesize\begin{verbatim} -> atomt pat; -"*** -------------" -"*** Const (op =)" -"*** . Const (op *)" -"*** . . Var ((a, 0), )" -"*** . . Const (Atools.pow)" -"*** . . . Var ((b, 0), )" -"*** . . . Free (2, )" -"*** . Var ((c, 0), )" -"\n" -val it = "\n" : string -\end{verbatim}} -Jetzt kann das Matching an den beiden vorigen Terme angewendet werden. -{\footnotesize\begin{verbatim} -> matches thy t pat; -val it = true : bool -> val t2 = (term_of o the o (parse thy)) "x^^^2 = 1"; -val t2 = -Const ("op =", "[RealDef.real, RealDef.real] => bool") $ -(Const -("Atools.pow", -"[RealDef.real, RealDef.real] => RealDef.real") $ -Free ("x", "RealDef.real") $ Free ("2", "RealDef.real")) $ -Free ("1", "RealDef.real") : Term.term -> matches thy t2 pat; -val it = false : bool -> val pat2 = (term_of o the o (parse thy)) "?u^^^2 = ?v"; -val pat2 = -Const ("op =", "[RealDef.real, RealDef.real] => bool") $ -(Const -("Atools.pow", -"[RealDef.real, RealDef.real] => RealDef.real") $ -Var (("u", 0), "RealDef.real") $ Free ("2", "RealDef.real")) $ -Var (("v", 0), "RealDef.real") : Term.term -> matches thy t2 pat2; -val it = true : bool -\end{verbatim}} - -\section{Zugriff auf die hierachy} -Man verwendet folgenden Befehl, um sich Zugang zur hierachy von problem type zu verschaffen. -{\footnotesize\begin{verbatim} -> show_ptyps; -val it = fn : unit -> unit -> show_ptyps(); -[ -["e_pblID"], -["simplification", "polynomial"], -["simplification", "rational"], -["vereinfachen", "polynom", "plus_minus"], -["vereinfachen", "polynom", "klammer"], -["vereinfachen", "polynom", "binom_klammer"], -["probe", "polynom"], -["probe", "bruch"], -["equation", "univariate", "linear"], -["equation", "univariate", "root", "sq", "rat"], -["equation", "univariate", "root", "normalize"], -["equation", "univariate", "rational"], -["equation", "univariate", "polynomial", "degree_0"], -["equation", "univariate", "polynomial", "degree_1"], -["equation", "univariate", "polynomial", "degree_2", "sq_only"], -["equation", "univariate", "polynomial", " - degree_2", "bdv_only"], -["equation", "univariate", "polynomial", "degree_2", "pqFormula"], -["equation", "univariate", "polynomial", "degree_2", "abcFormula"], -["equation", "univariate", "polynomial", "degree_3"], -["equation", "univariate", "polynomial", "degree_4"], -["equation", "univariate", "polynomial", "normalize"], -["equation", "univariate", "expanded", "degree_2"], -["equation", "makeFunctionTo"], -["function", "derivative_of", "named"], -["function", "maximum_of", "on_interval"], -["function", "make", "by_explicit"], -["function", "make", "by_new_variable"], -["function", "integrate", "named"], -["tool", "find_values"], -["system", "linear", "2x2", "triangular"], -["system", "linear", "2x2", "normalize"], -["system", "linear", "3x3"], -["system", "linear", "4x4", "triangular"], -["system", "linear", "4x4", "normalize"], -["Biegelinien", " -MomentBestimmte"], -["Biegelinien", "MomentGegebene"], -["Biegelinien", "einfache"], -["Biegelinien", "QuerkraftUndMomentBestimmte"], -["Biegelinien", "vonBelastungZu"], -["Biegelinien", "setzeRandbedingungen"], -["Berechnung", "numerischSymbolische"], -["test", "equation", "univariate", "linear"], -["test", "equation", "univariate", "plain_square"], -["test", "equation", "univariate", "polynomial", "degree_two", "pq_formula"], -["test", "equation", "univariate", "polynomial", "degree_two", "abc_formula"], -["test", "equation", "univariate", "squareroot"], -["test", "equation", "univariate", "normalize"], -["test", "equation", "univariate", "sqroot-test"] -] -val it = () : unit -\end{verbatim}} - -\section{Die passende ''formalization`` f\"ur den problem type} -Eine andere Art des Matching ist es die richtige ''formalization`` zum jeweiligen problem type zu finden. Wenn eine solche vorhanden ist, kann \isac{} selbstst\"andig die Probleme l\"osen. - -\section{''problem-refinement``} -Will man die problem hierachy (= ) aufstellen, so ist darauf zu achten, dass man die verschiedenen Branches so konstruiert, dass das problem-refinement automatisch durchgef\"uhrt werden kann. -{\footnotesize\begin{verbatim} -> refine; -val it = fn : fmz_ -> pblID -> SpecifyTools.match list -> val fmz = ["equality (sqrt(9 + 4 * x)=sqrt x -+ sqrt (5 + x))", -# "soleFor x","errorBound (eps=0)", -# "solutions L"]; -val fmz = -["equality (sqrt(9 + 4 * x)=sqrt x + sqrt (5 + x))", "soleFor x", -"errorBound (eps=0)", ...] : string list -> refine fmz ["univariate","equation"]; -*** pass ["equation","univariate"] -*** comp_dts: ??.empty $ soleFor x -Exception- ERROR raised -\end{verbatim}} -Wenn die ersten zwei Regeln nicht angewendet werden k\"onnen, kommt die dritte zum Einsatz: -{\footnotesize\begin{verbatim} -> val fmz = ["equality (x + 1 = 2)", -# "solveFor x","errorBound (eps=0)", -# "solutions L"]; -val fmz = ["equality (x + 1 = 2)", "solveFor x", "errorBound (eps=0)", ...] -: string list -> refine fmz ["univariate","equation"]; -*** pass ["equation","univariate"] -*** pass ["equation","univariate","linear"] -*** pass ["equation","univariate","root"] -*** pass ["equation","univariate","rational"] -*** pass ["equation","univariate","polynomial" ] -*** pass ["equation","univariate","polynomial","degree_0"] -*** pass ["equation","univariate","polynomial","degree_1"] -*** pass ["equation","univariate","polynomial","degree_2"] -*** pass ["equation","univariate","polynomial","degree_3"] -*** pass ["equation","univariate","polynomial","degree_4"] -*** pass ["equation","univariate","polynomial","normalize"] -val it = -[Matches -(["univariate", "equation"], -{Find = [Correct "solutions L"], With = [...], ...}), -NoMatch (["linear", "univariate", ...], {Find = [...], ...}), -NoMatch (["root", ...], ...), ...] : SpecifyTools.match list -\end{verbatim}} -Der problem type wandelt $x + 1 = 2$ in die normale Form $-1 + x = 0$ um. Diese Suche nach der jeweiligen problem hierachy kann mit Hilfe eines ''proof state`` durchgef\"uhrt werden (siehe n\"achstes Kapitel). - - -\chapter{''Methods``} -Methods werden dazu verwendet, Probleme von type zu l\"osen. Sie sind in einer anderen Programmiersprache beschrieben. Die Sprache sieht einfach aus, betreibt aber im Hintergrund einen enormen Pr\"ufaufwand. So muss sich der Programmierer nicht mit technischen Details befassen, gleichzeitig k\"onnen aber auch keine falschen Anweisungen eingegeben werden. -\section{Der ''Syntax`` des script} -Syntax beschreibt den Zusammenhang der einzelnen Zeichen und Zeichenfolgen mit den Theorien. -Er kann so definiert werden: -\begin{tabbing} -123\=123\=expr ::=\=$|\;\;$\=\kill -\>script ::= {\tt Script} id arg$\,^*$ = body\\ -\>\>arg ::= id $\;|\;\;($ ( id :: type ) $)$\\ -\>\>body ::= expr\\ -\>\>expr ::= \>\>{\tt let} id = expr $($ ; id = expr$)^*$ {\tt in} expr\\ -\>\>\>$|\;$\>{\tt if} prop {\tt then} expr {\tt else} expr\\ -\>\>\>$|\;$\>listexpr\\ -\>\>\>$|\;$\>id\\ -\>\>\>$|\;$\>seqex id\\ -\>\>seqex ::= \>\>{\tt While} prop {\tt Do} seqex\\ -\>\>\>$|\;$\>{\tt Repeat} seqex\\ -\>\>\>$|\;$\>{\tt Try} seqex\\ -\>\>\>$|\;$\>seqex {\tt Or} seqex\\ -\>\>\>$|\;$\>seqex {\tt @@} seqex\\ -\>\>\>$|\;$\>tac $($ id $|$ listexpr $)^*$\\ -\>\>type ::= id\\ -\>\>tac ::= id -\end{tabbing} - -\section{\"Uberpr\"ufung der Auswertung} -Das Kontrollsystem arbeitet mit den folgenden Script-Ausdr\"ucken, die {\it tacticals} genannt werden: -\begin{description} -\item{{\tt while} prop {\tt Do} expr id} -\item{{\tt if} prop {\tt then} expr {\tt else} expr} -\end{description} -W\"ahrend die genannten Befehle das Kontrollsystem durch Auswertung der Formeln ausl\"osen, h\"angen die anderen von der Anwendbarkeit der Formel in den entsprechenden Unterbegriffen ab: -\begin{description} -\item{{\tt Repeat} expr id} -\item{{\tt Try} expr id} -\item{expr {\tt Or} expr id} -\item{expr {\tt @@} expr id} -\item xxx -\end{description} - - - -\chapter{Befehle von \isac{}} -In diesem Kapitel werden alle schon zur Verf\"ugung stehenden Schritte aufgelistet. Diese Liste kann sich auf Grund von weiteren Entwicklungen von \isac{} noch \"andern.\ -\newline\linebreak \textbf{Init\_Proof\_Hid (dialogmode, formalization, specifictaion)} gibt die eingegebenen Befehle an die mathematic engine weiter, wobei die beiden letzten Begriffe die Beispiele automatisch speichern. Es ist nicht vorgesehen, dass der Sch\"uler tactic verwendet.\ -\newline\linebreak \textbf{Init\_Proof} bildet mit einem ''proof tree`` ein leeres Modell.\ -\newline\linebreak \textbf{Model\_Problem problem} bestimmt ein problemtype, das wom\"oglich in der ''hierachy`` gefunden wurde, und verwendet es f\"ur das Umformen.\ -\newline\linebreak \textbf{Add\_Given, Add\_Find, Add\_Relation formula} f\"ugt eine Formel in ein bestimmtes Feld eines Modells ein. Dies ist notwendig, solange noch kein Objekt f\"ur den Benutzer vorhanden ist, in dem man die Formel eingeben kann, und nicht die gew\"unschte tactic und Formel von einer Liste w\"ahlen will.\ -\newline\linebreak \textbf{Specify\_Theorie theory, Specify\_Problem proble, Specify\_Method method} gibt das entsprechende Element des Basiswissens an.\ -\newline\linebreak \textbf{Refine\_Problem problem} sucht nach einem Problem in der hierachy, das auf das vorhandene zutrifft.\ -\newline\linebreak \textbf{Apply\_Method method} beendet das Modell und die Beschreibung. Danach wird die L\"osungmeldung ge\"offnet.\ -\newline\linebreak \textbf{Free\_Solve} beginnt eine L\"osungsmeldung ohne die Hilfe einer method.\ -\newline\linebreak \textbf{Rewrite theorem} bef\"ordert ein theorem in die aktuelle Formel und wandelt es demenetsprechend um. Wenn dies nicht m\"oglich ist, kommt eine Meldung mit ''error``.\ -\newline\linebreak \textbf{Rewrite\_Asm theorem} hat die gleiche Funktion wie Rewrite, speichert jedoch eine endg\"ultige Vorraussetzung des theorems, anstatt diese zu sch\"atzen.\ -\newline\linebreak \textbf{Rewrite\_Set ruleset} hat \"ahnliche Funktionen wie Rewrite, gilt aber f\"ur einen ganzen Satz von theorems, dem rule set.\ -\newline\linebreak \textbf{Rewrite\_Inst (substitution, theorem), Rewrite\_Set\_Inst (substitution, rule set)} ist vergleichbar mit besonderen tactics, ersetzt aber Konstanten im theorem, bevor es zu einer Anwendung kommt.\ -\newline\linebreak \textbf{Calculate operation} berechnet das Ergebnis der Eingabe mit der aktuellen Formel (plus, minus, times, cancel, pow, sqrt).\ -\newline\linebreak \textbf{Substitute substitution} f\"ugt der momentanen Formel {\tt substitution} hinzu und wandelt es um.\ -\newline\linebreak \textbf{Take formula} startet eine neue Reihe von Rechnungen in den Formeln, wo sich schon eine andere Rechnung befindet.\ -\newline\linebreak \textbf{Subproblem (theory, problem)} beginnt ein subproblem innerhalb einer Rechnung.\ -\newline\linebreak \textbf{Function formula} ruft eine Funktion auf, in der der Name in der Formel enthalten ist. ???????\ -\newline\linebreak \textbf{Split\_And, Conclude\_And, Split\_Or, Conclude\_Or, Begin\_Trans, End\_Trans, Begin\_Sequ, End\_Sequ, Split\_Intersect, End\_Intersect} betreffen den Bau einzelner branches des proof trees. Normalerweise werden sie vom dialog guide verdr\"angt.\ -\newline\linebreak \textbf{Check\_elementwise assumption} wird in Bezug auf die aktuelle Formel verwendet, die Elemente in einer Liste enth\"alt.\ -\newline\linebreak \textbf{Or\_to\_List} wandelt eine Verbindung von Gleichungen in eine Liste von Gleichungen um.\ -\newline\linebreak \textbf{Check\_postcond} \"uberpr\"uft die momentane Formel im Bezug auf die Nachbedinung beim Beenden des subproblem.\ -\newline\linebreak \textbf{End\_Proof} beendet eine \"Uberpr\"ufung und gibt erst dann ein Ergebnis aus, wenn Check\_postcond erfolgreich abgeschlossen wurde. - -\section{Die Funktionsweise der mathematic engine} -Ein proof (= Beweis) wird in der mathematic engine me von der tactic {\tt Init\_Proof} gestartet und wird wechselwirkend mit anderen tactics vorangebracht. Auf den input (= das, was eingegeben wurde) einzelner tactics folgt eine Formel, die von der me ausgegeben wird, und die darauf folgende tactic gilt. Der proof ist beendet, sobald die me {\tt End\_Proof} als n\"achste tactic vorschl\"agt. -\newline Im Anschluss werden Sie einen Rechenbeweis sehen, der von der L\"osung einer Gleichung (= equation) handelt, bei der diese automatisch differenziert wird. -{\footnotesize\begin{verbatim} -?????????????????????????????????????????????????????????????????????????????????? - -ML> val fmz = ["equality ((x+#1)*(x+#2)=x^^^#2+#8)","solveFor x", - "errorBound (eps=#0)","solutions L"]; - val fmz = - ["equality ((x+#1)*(x+#2)=x^^^#2+#8)","solveFor x","errorBound (eps=#0)", - "solutions L"] : string list - ML> - ML> val spec as (dom, pbt, met) = ("SqRoot.thy",["univariate","equation"], - ("SqRoot.thy","no_met")); - val dom = "SqRoot.thy" : string - val pbt = ["univariate","equation"] : string list - val met = ("SqRoot.thy","no_met") : string * string -\end{verbatim}} - -\section{Der Beginn einer Rechnung} - -Der proof state wird von einem proof tree und einer position ausgegeben. Beide sind zu Beginn leer. Die tactic {\tt Init\_Proof} ist, wie alle anderen tactics auch, an einen string gekoppelt. Um einen neuen proof beginnen zu k\"onnen, werden folgende Schritte durchgef\"uhrt: -{\footnotesize\begin{verbatim} -???????????????????????????????????????????????????????????????????????????????????????????? -ML> val (mID,m) = ("Init_Proof",Init_Proof (fmz, (dom,pbt,met))); - val mID = "Init_Proof" : string - val m = - Init_Proof - (["equality ((x+#1)*(x+#2)=x^^^#2+#8)","solveFor x","errorBound (eps=#0)", - "solutions L"],("SqRoot.thy",[#,#],(#,#))) : mstep - ML> - ML> val (p,_,f,nxt,_,pt) = me (mID,m) e_pos' c EmptyPtree; - val p = ([],Pbl) : pos' - val f = Form' (PpcKF (0,EdUndef,0,Nundef,(#,#))) : mout - val nxt = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"]) - : string * mstep - val pt = - Nd - (PblObj - {branch=#,cell=#,env=#,loc=#,meth=#,model=#,origin=#,ostate=#,probl=#, - result=#,spec=#},[]) : ptree -\end{verbatim}} -Die mathematics engine gibt etwas mit dem type {\tt mout} aus, was in unserem Fall ein Problem darstellt. Sobald mehr angezeigt wird, m\"usste dieses jedoch gel\"ost sein. -{\footnotesize\begin{verbatim} -????????????????????????????????????????????????????????????????????????????????????????????? - ML> Compiler.Control.Print.printDepth:=8; (*4 default*) - val it = () : unit - ML> - ML> f; - val it = - Form' - (PpcKF - (0,EdUndef,0,Nundef, - (Problem [], - {Find=[Incompl "solutions []"], - Given=[Incompl "equality",Incompl "solveFor"],Relate=[], - Where=[False "matches (?a = ?b) e_"],With=[]}))) : mout -\end{verbatim}} -{\footnotesize\begin{verbatim} -????????????????????????????????????????????????????????????????????????????????????????????? - ML> nxt; - val it = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"]) - : string * mstep - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val nxt = ("Model_Problem",Model_Problem ["normalize","univariate","equation"]) - : string * mstep - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; -\end{verbatim}} - -\section{The phase of modeling} -Dieses Kapitel besch\"aftigt sich mit dem input der Einzelheiten bei einem Problem. Die me kann dabei helfen, wenn man die formalization durch {\tt Init\_Proof} darauf hinweist. Normalerweise weiss die mathematics engine die n\"achste gute tactic. -{\footnotesize\begin{verbatim} -????????????????????????????????????????????????????????????????????????????????????????????? - ML> nxt; - val it = - ("Add_Given",Add_Given "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)") - : string * mstep - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val nxt = ("Add_Given",Add_Given "solveFor x") : string * mstep - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val nxt = ("Add_Find",Add_Find "solutions L") : string * mstep - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val f = Form' (PpcKF (0,EdUndef,0,Nundef,(#,#))) : mout -\end{verbatim}} -{\footnotesize\begin{verbatim} -????????????????????????????????????????????????????????????????????????????????????????????? - ML> Compiler.Control.Print.printDepth:=8; - ML> f; - val it = - Form' - (PpcKF - (0,EdUndef,0,Nundef, - (Problem [], - {Find=[Correct "solutions L"], - Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", - Correct "solveFor x"],Relate=[],Where=[],With=[]}))) : mout -\end{verbatim}} - - -\section{The phase of specification} -Diese phase liefert eindeutige Bestimmungen einer domain, den problem type und die method damit man sie verwenden kann. F\"ur gew\"ohnlich wird die Suche nach dem richtigen problem type unterst\"utzt. Dazu sind zwei tactics verwendbar: {\tt Specify\_Problem} entwickelt ein Feedback, wie ein problem type bei dem jetzigen problem zusammenpasst und {\tt Refine\_Problem} stellt Hilfe durch das System bereit, falls der Benutzer die \"Ubersicht verliert. -{\footnotesize\begin{verbatim} -?????????????????????????????????????????????????????????????????????????????????????????? - ML> nxt; - val it = ("Specify_Domain",Specify_Domain "SqRoot.thy") : string * mstep - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val nxt = - ("Specify_Problem",Specify_Problem ["normalize","univariate","equation"]) - : string * mstep - val pt = - Nd - (PblObj - {branch=#,cell=#,env=#,loc=#,meth=#,model=#,origin=#,ostate=#,probl=#, - result=#,spec=#},[]) : ptree -\end{verbatim}} -Die me erkennt den richtigen Problem type und arbeitet so weiter: -{\footnotesize\begin{verbatim} -????????????????????????????????????????????????????????????????????????????????????????? - ML> val nxt = ("Specify_Problem", - Specify_Problem ["polynomial","univariate","equation"]); - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val f = Form' (PpcKF (0,EdUndef,0,Nundef,(#,#))) : mout - val nxt = - ("Refine_Problem",Refine_Problem ["normalize","univariate","equation"]) - : string * mstep - ML> - ML> val nxt = ("Specify_Problem", - Specify_Problem ["linear","univariate","equation"]); - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val f = - Form' - (PpcKF - (0,EdUndef,0,Nundef, - (Problem ["linear","univariate","equation"], - {Find=[Correct "solutions L"], - Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", - Correct "solveFor x"],Relate=[], - Where=[False - "matches (?a + ?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)"], - With=[]}))) : mout -\end{verbatim}} -Wir nehmen wieder an, dass der dialog guide die n\"achsten tactics, veranlasst von der mathematic engine, versteckt und der Sch\"uler Hilfe ben\"otigt. Dann muss {\tt Refine\_Problem} angewandt werden. Dieser Befehl findet immer den richtigen Weg, wenn man es auf den problem type bezieht [''univariate``, ''equation``]. -{\footnotesize\begin{verbatim} -???????????????????????????????????????????????????????????????????????????????????????????? - ML> val nxt = ("Refine_Problem", - Refine_Problem ["linear","univariate","equation - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val f = Problems (RefinedKF [NoMatch #]) : mout - ML> - ML> Compiler.Control.Print.printDepth:=9;f;Compiler.Control.Print.printDepth:=4; - val f = - Problems - (RefinedKF - [NoMatch - (["linear","univariate","equation"], - {Find=[Correct "solutions L"], - Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", - Correct "solveFor x"],Relate=[], - Where=[False - "matches (?a + ?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)"], - With=[]})]) : mout - ML> - ML> val nxt = ("Refine_Problem",Refine_Problem ["univariate","equation"]); - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val f = - Problems - (RefinedKF [Matches #,NoMatch #,NoMatch #,NoMatch #,NoMatch #,Matches #]) - : mout - ML> - ML> - ML> Compiler.Control.Print.printDepth:=9;f;Compiler.Control.Print.printDepth:=4; - val f = - Problems - (RefinedKF - [Matches - (["univariate","equation"], - {Find=[Correct "solutions L"], - Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", - Correct "solveFor x"],Relate=[], - Where=[Correct - With=[]}), - NoMatch - (["linear","univariate","equation"], - {Find=[Correct "solutions L"], - Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", - Correct "solveFor x"],Relate=[], - Where=[False - "matches (?a + ?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)"], - With=[]}), - NoMatch - ... - ... - Matches - (["normalize","univariate","equation"], - {Find=[Correct "solutions L"], - Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", - Correct "solveFor x"],Relate=[],Where=[],With=[]})]) : mout -\end{verbatim}} -Die tactic {\tt Refine\_Problem} wandelt alle matches wieder in problem types um und sucht in der problem hierachy weiter. - - -\section{The phase of solving} -Diese phase beginnt mit dem Aufruf einer method, die eine normale form innerhalb einer tactic ausf\"uhrt: {\tt Rewrite rnorm\_equation\_add} und {\tt Rewrite\_Set SqRoot\_simplify}: -{\footnotesize\begin{verbatim} - ML> nxt; - val it = ("Apply_Method",Apply_Method ("SqRoot.thy","norm_univar_equation")) - : string * mstep - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val f = - Form' (FormKF (~1,EdUndef,1,Nundef,"(x + #1) * (x + #2) = x ^^^ #2 + #8")) - val nxt = - ("Rewrite", Rewrite - ("rnorm_equation_add","~ ?b =!= #0 ==> (?a = ?b) = (?a + #-1 * ?b = #0)")) - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val f = - Form' (FormKF (~1,EdUndef,1,Nundef, - "(x + #1) * (x + #2) + #-1 * (x ^^^ #2 + #8) = #0")) : mout - val nxt = ("Rewrite_Set",Rewrite_Set "SqRoot_simplify") : string * mstep - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val f = Form' (FormKF (~1,EdUndef,1,Nundef,"#-6 + #3 * x = #0")) : mout - val nxt = ("Subproblem",Subproblem ("SqRoot.thy",[#,#])) : string * mstep -\end{verbatim}} -Die Formel $-6 + 3\cdot x = 0$ ist die Eingabe eine subproblems, das wiederum gebraucht wird, um die Gleichungsart zu erkennen und die entsprechende method auszuf\"uhren: -{\footnotesize\begin{verbatim} - ML> nxt; - val it = ("Subproblem",Subproblem ("SqRoot.thy",["univariate","equation"])) - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val f = - Form' (FormKF - (~1,EdUndef,1,Nundef,"Subproblem (SqRoot.thy, [univariate, equation])")) - : mout - val nxt = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"]) - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val nxt = ("Model_Problem",Model_Problem ["linear","univariate","equation"]) -\end{verbatim}} -{\tt Refine [''univariate``, ''equation``]} sucht die passende Gleichungsart aus der problem hierachy heraus, welche man mit {\tt Model\_Problem [''linear``, ''univariate``, ''equation``]} \"uber das System ansehen kann. -Nun folgt erneut die phase of modeling und die phase of specification. - -\section{The final phase: \"Uberpr\"ufung der ''post-condition``} -Die gezeigten problems, die durch \isac{} gel\"ost wurden, sind so genannte 'example construction problems'. Das massivste Merkmal solcher problems ist die post-condition. Im Umgang mit dieser gibt es noch offene Fragen. -Dadurch wird die post-condition im folgenden Beispiel als problem und subproblem erw\"ahnt. -{\footnotesize\begin{verbatim} - ML> nxt; - val it = ("Check_Postcond",Check_Postcond ["linear","univariate","equation"]) - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val f = Form' (FormKF (~1,EdUndef,1,Nundef,"[x = #2]")) : mout - val nxt = - ("Check_Postcond",Check_Postcond ["normalize","univariate","equation"]) - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val f = Form' (FormKF (~1,EdUndef,0,Nundef,"[x = #2]")) : mout - val nxt = ("End_Proof'",End_Proof') : string * mstep -\end{verbatim}} -Die tactic {\tt End\_Proof'} bedeutet, dass der proof erflogreich beendet wurde.\\ - -\paragraph{Versuchen Sie es!} Die tactics, die vom System vorgeschlagen werden, m\"ussen vom Benutzer nicht angewendet werden. Er kann selbstverst\"andlich auch andere tactics verwenden und das System wird melden, ob dieser Befehl zutreffend ist oder nicht. - - -\part{Handbuch f\"ur Autoren} - -\chapter{Die Struktur des Grundlagenwissens} - -\section{''tactics`` und Daten} -Zuerst betrachten wir die me von aussen. Wir sehen uns tactics und an und verbinden sie mit unserem Grundwissen (KB). Im Bezug auf das KB befassen wir uns mit den kleinsten Teilchen, die von den Autoren des KB sehr genau durchgef\"uhrt werden m\"ussen. -Diese Teile sind in alphabetischer Anordnung in Tab.\ref{kb-items} auf Seite \pageref{kb-items} aufgelistet. - -{\begin{table}[h] -\caption{Kleinste Teilchen des KB} \label{kb-items} -%\tabcolsep=0.3mm -\begin{center} -\def\arraystretch{1.0} -\begin{tabular}{lp{9.0cm}} -Abk\"urzung & Beschreibung \\ -\hline -&\\ -{\it calc\_list} -& gesammelte Liste von allen ausgewerteten Funktionen\\ -{\it eval\_fn} -& ausgewertete Funktionen f\"ur Zahlen und f\"ur Eigenschaften, die in SML kodiert sind\\ -{\it eval\_rls } -& rule set {\it rls} f\"ur einfache Ausdr\"ucke mit {\it eval\_fn}s\\ -{\it fmz} -& Formalisierung, d.h. eine sehr geringe Darstellung von einem Beispiel \\ -{\it met} -& eine method d.h. eine Datenstruktur, die alle Informationen zum L\"osen einer phase enth\"alt ({\it rew\_ord}, {\it scr}, etc.)\\ -{\it metID} -& bezieht sich auf {\it met}\\ -{\it op} -& ein Operator, der der Schl\"ussel zu {\it eval\_fn} in einer {\it calc\_list} ist \\ -{\it pbl} -& Problem d.h. der Knotenpunkt in der problem hierachy\\ -{\it pblID} -& bezieht sich auf {\it pbl}\\ -{\it rew\_ord} -& Anordnung beim Rewriting\\ -{\it rls} -& rule set, d.h. eine Datenstruktur, die theorems {\it thm} und Operatoren {\it op} zur Vereinfachung (mit {\it rew\_ord}) enth\"alt \\ -{\it Rrls} -& rule set f\"ur das 'reverse rewriting' (eine \isac-Technik, die schrittweise Rewriting entwickelt, z.B. f\"ur die zur\"uckgenommenen Teile)\\ -{\it scr} -& script, das die Algorithmen durch Anwenden von tactics beschreibt und ein Teil von {\it met} ist \\ -{\it norm\_rls} -& spezielles Regelwerk zum Berechnen von Normalformen, im Zusammenhang mit {\it thy}\\ -{\it spec} -& Spezifikation, z.B, ein Tripel ({\it thyID, pblID, metID})\\ -{\it subs} -& Ersatz, z.B. eine Liste von Variablen und ihren jeweiligen Werten\\ -{\it Term} -& Term von Isabelle, z.B. eine Formel\\ -{\it thm} -& theorem\\ -{\it thy} -& theory\\ -{\it thyID} -& im Bezug auf {\it thy} \\ -\end{tabular}\end{center}\end{table}} - -Die Verbindung zwischen tactics und Daten werden in Tab.\ref{tac-kb} auf Seite \pageref{tac-kb} dargestellt. - - -\begin{table}[h] -\caption{Welche tactics verwenden die Teile des KB~?} \label{tac-kb} -\tabcolsep=0.3mm -\begin{center} -\begin{tabular}{|ll||cccc|ccc|cccc|} \hline -tactic &Eingabe & & & &norm\_& &rew\_&rls &eval\_&eval\_&calc\_& \\ -& &thy &scr &Rrls&rls &thm &ord &Rrls&fn &rls &list &dsc\\ -\hline\hline -Init\_Proof -&fmz & x & & & x & & & & & & & x \\ -&spec & & & & & & & & & & & \\ -\hline -\multicolumn{13}{|l|}{model phase}\\ -\hline -Add\_* -&Term & x & & & x & & & & & & & x \\ -FormFK &model & x & & & x & & & & & & & x \\ -\hline -\multicolumn{13}{|l|}{specify phase}\\ -\hline -Specify\_Theory -&thyID & x & & & x & & & & x & x & & x \\ -Specify\_Problem -&pblID & x & & & x & & & & x & x & & x \\ -Refine\_Problem -&pblID & x & & & x & & & & x & x & & x \\ -Specify\_Method -&metID & x & & & x & & & & x & x & & x \\ -Apply\_Method -&metID & x & x & & x & & & & x & x & & x \\ -\hline -\multicolumn{13}{|l|}{solve phase}\\ -\hline -Rewrite,\_Inst -&thm & x & x & & & x &met & & x &met & & \\ -Rewrite, Detail -&thm & x & x & & & x &rls & & x &rls & & \\ -Rewrite, Detail -&thm & x & x & & & x &Rrls & & x &Rrls & & \\ -Rewrite\_Set,\_Inst -&rls & x & x & & & & & x & x & x & & \\ -Calculate -&op & x & x & & & & & & & & x & \\ -Substitute -&subs & x & & & x & & & & & & & \\ -& & & & & & & & & & & & \\ -SubProblem -&spec & x & x & & x & & & & x & x & & x \\ -&fmz & & & & & & & & & & & \\ -\hline -\end{tabular}\end{center}\end{table} - - -\section{Die theories von \isac{}} -Die theories von \isac{} basieren auf den theories f\"ur HOL und Real von Isabelle. Diese theories haben eine spezielle Form, die durch die Endung {\tt *.thy} gekennzeichnet sind; normalerweise werden diese theories zusammen mit SML verwendet. Dann haben sie den selben Dateinamen, aber die Endung {\tt *.ML}. -Die theories von \isac{} representieren den Teil vom Basiswissen von \isac{}, die hierachy von den zwei theories ist nach diesen strukturiert. Die {\tt *.ML} Dateien beinhalten {\em alle} Daten von den anderen zwei Hauptlinien des Basiswissens, die problems und methods (ohne ihre jeweilige Struktur, die von den problem Browsern und den method Browsern gemacht wird, zu pr\"asentieren. -Die Tab.\ref{theories} auf Seite \pageref{theories} listet die base theories auf, die geplant sind in der Version \isac{} 1 angewendet zu werden. Wir erwarten, dass die Liste erweitert wird in n\"aherer Zukunft, und wir werden uns auch den theorie Browser genauer ansehen. -Die ersten drei theories auf der Liste geh\"oren {\em nicht} zum Grundwissen von \isac{}; sie besch\"aftigen sich mit der Skriptsprache f\"ur methods und ist hier nur zur Vollst\"andigkeit angef\"uhrt. - -{\begin{table}[h] -\caption{theory von der ersten Version von \isac} \label{theories} -%\tabcolsep=0.3mm -\begin{center} -\def\arraystretch{1.0} -\begin{tabular}{lp{9.0cm}} -theory & Beschreibung \\ -\hline -&\\ -ListI.thy -& ordnet die Bezeichnungen den Funktionen, die in {\tt Isabelle2002/src/HOL/List.thy} sind, zu und (intermediatly~?) definiert einige weitere Listen von Funktionen\\ -ListI.ML -& {\tt eval\_fn} f\"ur die zus\"atzliche Listen von Funktionen\\ -Tools.thy -& Funktion, die f\"ur die Auswertung von Skripten ben\"otigt wird\\ -Tools.ML -& bezieht sich auf {\tt eval\_fn}s\\ -Script.thy -& Vorraussetzung f\"ur script: types, tactics, tacticals\\ -Script.ML -& eine Reihe von tactics und Funktionen f\"ur den internen Gebrauch\\ -& \\ -\hline -& \\ -Typefix.thy -& fortgeschrittener Austritt, um den type Fehlern zu entkommen\\ -Descript.thy -& {\it Beschreibungen} f\"ur die Formeln von {\it Modellen} und {\it Problemen}\\ -Atools -& Neudefinierung von Operatoren; allgemeine Eigenschaften und Funktionen f\"ur Vorraussetzungen; theorems f\"ur {\tt eval\_rls}\\ -Float -& Gleitkommerzahlendarstellung\\ -Equation -& grunds\"atzliche Vorstellung f\"ur Gleichungen und Gleichungssysteme\\ -Poly -& Polynome\\ -PolyEq -& polynomiale Gleichungen und Gleichungssysteme \\ -Rational.thy -& zus\"atzliche theorems f\"ur Rationale Zahlen\\ -Rational.ML -& abbrechen, hinzuf\"ugen und vereinfachen von Rationalen Zahlen durch Verwenden von (einer allgemeineren Form von) Euclids Algorithmus; die entsprechenden umgekehrten Regels\"atze\\ -RatEq -& Gleichung mit rationalen Zahlen\\ -Root -& Radikanten; berechnen der Normalform; das betreffende umgekehrte Regelwerk\\ -RootEq -& Gleichungen mit Wurzeln\\ -RatRootEq -& Gleichungen mit rationalen Zahlen und Wurzeln (z.B. mit Termen, die beide Vorg\"ange enthalten)\\ -Vect -& Vektoren Analysis\\ -Trig -& Trigonometrie\\ -LogExp -& Logarithmus und Exponentialfunktionen\\ -Calculus -& nicht der Norm entsprechende Analysis\\ -Diff -& Differenzierung\\ -DiffApp -& Anwendungen beim Differenzieren (Maximum-Minimum-Probleme)\\ -Test -& (alte) Daten f\"ur Testfolgen\\ -Isac -& enth\"alt alle Theorien von\isac{}\\ -\end{tabular}\end{center}\end{table}} - - -\section{Daten in {\tt *.thy} und {\tt *.ML}} -Wie schon zuvor angesprochen, haben die Arbeiten die theories von *.thy und *.ML zusammen und haben deswegen den selben Dateiname. Wie diese Daten zwischen den zwei Dateien verteilt werden wird in der -Tab.\ref{thy-ML} auf Seite \pageref{thy-ML} gezeigt. Die Ordnung von den Datenteilchen in den theories sollte an der Ordnung von der Liste festhalten. - -{\begin{table}[h] -\caption{Daten in {\tt *.thy}- und {\tt *.ML}-files} \label{thy-ML} -\tabcolsep=2.0mm -\begin{center} -\def\arraystretch{1.0} -\begin{tabular}{llp{7.7cm}} -Datei & Daten & Beschreibung \\ -\hline -& &\\ -{\tt *.thy} -& consts -& Operatoren, Eigenschaften, Funktionen und Skriptnamen ('{\tt Skript} Name \dots{\tt Argumente}') -\\ -& rules -& theorems: \isac{} verwendet theorems von Isabelle, wenn m\"oglich; zus\"atzliche theorems, die jenen von Isabelle entsprechen, bekommen ein {\it I} angeh\"angt -\\& &\\ -{\tt *.ML} -& {\tt theory' :=} -& Die theory, die -abgegrenzt ist von der {\tt *.thy}-Datei, wird durch \isac{} zug\"anglich gemacht -\\ -& {\tt eval\_fn} -& die Auswertungsfunktion f\"ur die Operatoren und Eigenschaften, kodiert im meta-Level (SML); die Bezeichnugn von so einer Funktion ist eine Kombination von Schl\"usselw\"ortern {\tt eval\_} und einer Bezeichnung von der Funktion, die in in {\tt *.thy} erkl\"art ist -\\ -& {\tt *\_simplify} -& der automatisierte Vereinfacher f\"ur die tats\"achliche Theorie, z.B. die Bezeichnung von diesem Regelwerk ist eine Kombination aus den Theorienbezeichnungen und dem Schl\"usselwort {\tt *\_simplify} -\\ -& {\tt norm\_rls :=} -& der automatisierte Vereinfacher {\tt *\_simplify} wird so aufgehoben, dass er \"uber \isac{} zug\"anglich ist -\\ -& {\tt rew\_ord' :=} -& das Gleiche f\"ur die Anordnung des Rewriting, wenn es ausserhalb eines speziellen Regelwerks gebraucht wird -\\ -& {\tt ruleset' :=} -& dasselbe wie f\"ur Regels\"atze (gew\"ohnliche Regels\"atze, umgekehrte Regels\"atze, und {\tt eval\_rls}) -\\ -& {\tt calc\_list :=} -& dasselbe f\"ur {\tt eval\_fn}s, wenn es ausserhalb eines bestimmten Regelwerks gebraucht wird (wenn es ausserhalb eines bestimmten Regelwerks ben\"otigt wird) (z.B. f\"ur eine tactic {\tt Calculate} in einem Skript) -\\ -& {\tt store\_pbl} -& Problems, die in {\tt *.ML}-Dateien definiert sind, werden zug\"anglich f\"ur \isac{} -\\ -& {\tt methods :=} -& methods, die in {\tt *.ML}-Dateien definiert sind werden zug\"anglich f\"ur \isac{} -\\ -\end{tabular}\end{center}\end{table}} - -\section{Formale Beschreibung der Hierarchie von Problemen} - -\section{Skripttaktiken} -Tats\"achlich sind es die tactics, die die Berechnungen vorantreiben: im Hintergrund bauen sie den proof tree und sie \"ubernehmen die wichtigsten Aufgaben w\"ahrend der Auswertung bei der der ''script-interpreter`` zur Steuerung des Benutzers transferiert wird. Hier beschreiben wir nur den Syntax von tactics; die Semantik ist beschrieben etwas weiter unten im Kontext mit tactics, die die Benutzer/Innen dieses Programmes verwenden: Es gibt einen Schriftverkehr zwischen den user-tactics und den script tactics. - - - -\part{Authoring on the knowledge} - - -\section{Add a theorem} -\section{Define and add a problem} -\section{Define and add a predicate} -\section{Define and add a method} -\section{} -\section{} -\section{} -\section{} - - - -\newpage -\bibliography{bib/isac,bib/from-theses} - -\end{document} diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/mat-eng-en.tex --- a/src/Doc/isac/mat-eng-en.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1771 +0,0 @@ -%WN051006 dropped in code, but interesting for case study 'order a list' -%EqSystem.thy -%--------------------------------------------------------------------------- -% -% order'_system :: "bool list => bool list " ("order'_system _") -% -%EqSystem.ML -%--------------------------------------------------------------------------- -%(*("order_system", ("EqSystem.order'_system", -% eval_order_system "#eval_order_system_"))*) -%fun eval_order_system _ "EqSystem.order'_system" -% (p as (Const ("EqSystem.order'_system",_) $ ts)) _ = -% let val ts' = sort (ord_simplify_Integral_ false (assoc_thy"Isac.thy") []) -% (isalist2list ts) -% val ts'' = list2isalist HOLogic.boolT ts' -% in if ts <> ts'' -% then Some (term2str p ^ " = " ^ term2str ts'', -% Trueprop $ (mk_equality (p,ts''))) -% else None -% end -% | eval_order_system _ _ _ _ = None; -% -% -%"Script Norm2SystemScript (es_::bool list) (vs_::real list) = \ -%\ (let es__ = Try (Rewrite_Set simplify_Integral_parenthesized False) es_; \ -%\ es__ = (Try (Calculate order_system_) (order_system es__))\ -%\in (SubProblem (Biegelinie_,[linear,system],[no_met])\ -%\ [bool_list_ es__, real_list_ vs_]))" -% )); -% -%eqsystem.sml -%--------------------------------------------------------------------------- -%"----------- eval_sort -------------------------------------------"; -%"----------- eval_sort -------------------------------------------"; -%"----------- eval_sort -------------------------------------------"; -%val ts = str2term "[c_2 = 0, -1 * (q_0 * L ^^^ 2) / 2 + (L * c + c_2) = 0]"; -%val ts' = sort (ord_simplify_Integral_ false (assoc_thy"Isac.thy") []) -% (isalist2list ts); -%terms2str ts'; -%val ts'' = list2isalist HOLogic.boolT ts'; -%if term2str ts'' = "[-1 * (q_0 * L ^^^ 2) / 2 + (L * c + c_2) = 0, c_2 = 0]" -%then () else raise error "eqsystem.sml eval_sort 1"; -% -%val t = str2term "order_system [c_2 = 0,\ -% \-1 * (q_0 * L ^^^ 2) / 2 + (L * c + c_2) = 0]"; -%val Some (str,_) = eval_order_system "" "EqSystem.order'_system" t ""; -%if str = "order_system [c_2 = 0, -1 * (q_0 * L ^^^ 2) / 2 + (L * c + c_2) = 0] = [-1 * (q_0 * L ^^^ 2) / 2 + (L * c + c_2) = 0, c_2 = 0]" then () -%else raise error "eqsystem.sml eval_sort 2"; -% -% -% -% calculate_ thy ("EqSystem.order'_system", -% eval_order_system "#eval_order_system_") t; -% -%--------------------------------------------------------------------------- -%--------------------------------------------------------------------------- -%--------------------------------------------------------------------------- - - -%In the following this text is not compatible with isac-code: -%* move termorder to knowledge: FIXXXmat0201a -% -% - -\documentclass[11pt,a4paper,headline,headcount,towside,nocenter]{report} -\usepackage{latexsym} % recommended by Ch.Schinagl 10.98 -\bibliographystyle{alpha} - -\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} - -\title{\isac --- Interface for\\ - Developers of Math Knowledge\\[1.0ex] - and\\[1.0ex] - Tools for Experiments in\\ - Symbolic Computation\\[1.0ex]} -\author{The \isac-Team\\ - \tt isac-users@ist.tugraz.at\\[1.0ex]} -\date{\today} - -\begin{document} -\maketitle -\newpage -\tableofcontents -\newpage -\listoftables -\newpage - -\chapter{Introduction} -\section{The scope of this document} -\paragraph{As a manual:} This document describes the interface to \isac's kernel (KE), the interface to the mathematics engine (ME) included in the KE, and to the various tools like rewriting, matching etc. - -\isac's KE is written in SML, the language developed in conjunction with predecessors of the theorem prover Isabelle. Thus, in this document we use the plain ASCII representation of SML code. The reader may note that the \isac-user is presented a completely different view on a graphical user interface. - -The document is selfcontained; basic knowledge about SML (as an introduction \cite{Paulson:91} is recommended), terms and rewriting is assumed. - -%The interfaces will be moderately exended during the first phase of development of the mathematics knowledge. The work on the subprojects defined should {\em not} create interfaces of any interest to a user or another author of knowledge except identifiers (of type string) for theorems, rulesets etc. - -Notation: SML code, directories, file names are {\tt written in 'tt'}; in particular {\tt ML>} is the KE prompt. - -\paragraph{Give it a try !} Another aim of this text is to give the reader hints for experiments with the tools introduced. - -\section{Related documents}\label{related-docs} -Isabelle reference manual \cite{Isa-ref}, also contained in the Isabelle distribution under $\sim${\tt /doc/}. - -{\bf The actual locations of files is being recorded in \\{\tt /software/services/isac/README} -\footnote{The KEs current version is {\tt isac.020120-math/} which is based on the version Isabelle99 at {\tt http://isabelle.in.tum.de}.\\ -The current locations at IST are\\ -{\tt [isabelle]\hspace{3em} /software/sol26/Isabelle99/}\\ -{\tt [isac-src]\hspace{3em} /software/services/isac/src/ke/}\\ -{\tt [isac-bin]\hspace{3em} /software/services/isac/bin/ke/} -} -and rigorously updated.} In this document we refer to the following directories -\begin{tabbing} -xxx\=Isabelle sources1234 \=\kill -\>Isabelle sources \> {\tt [isabelle]/}\\ -\>KE sources \> {\tt [isac-src]/\dots{version}\dots/}\\ -\>KE binary \> {\tt [isac-bin]/\dots{version}\dots/} -\end{tabbing} -where {\tt\dots version\dots} stands for a directory-name containing information on the version. - -\section{Getting started} -Change to the directory {\tt [isac-bin]} where \isac's binary is located and type to the unix-prompt '$>$' (ask your system administrator where the directory {\tt [isac-bin]} is on your system): -\begin{verbatim} - > [isac-bin]/sml @SMLload=isac.020120-math - val it = false : bool - ML> -\end{verbatim} -yielding the message {\tt val it = false : bool} followed by the prompt of the KE. Having been successful so far, just type in the input presented below -- all of it belongs to {\em one} session~! - -\part{Experimental approach} - -\chapter{Basics, terms and parsing} -Isabelle implements terms of the {\it simply typed lambda calculus} \cite{typed-lambda} defined in $\sim${\tt/src/Pure.ML}. -\section{The definition of terms} -There are two kinds of terms in Isabelle, 'raw terms' and 'certified terms'. \isac{} works on raw terms, which are efficient but hard to comprehend. -{\footnotesize\begin{verbatim} - datatype term = - Const of string * typ - | Free of string * typ - | Var of indexname * typ - | Bound of int - | Abs of string * typ * term - | op $ of term * term; - - datatype typ = Type of string * typ list - | TFree of string * sort - | TVar of indexname * sort; -\end{verbatim}}%size % $ -where the definitions of sort and indexname is not relevant in this context. The {\tt typ}e is being inferred during parsing. Parsing creates the other kind of terms, {\tt cterm}. These {\tt cterm}s are encapsulated records, which cannot be composed without the respective Isabelle functions (checking for type correctness), but which then are conveniently displayed as strings (using SML compiler internals -- see below). - -\section{Theories and parsing} -Parsing uses information contained in Isabelles theories $\sim${\tt /src/HOL}. The currently active theory is held in a global variable {\tt thy}; theories can be accessed individually; -{\footnotesize\begin{verbatim} - ML> thy; - val it = - {ProtoPure, CPure, HOL, Ord, Set, subset, equalities, mono, Vimage, Fun, - Prod, Lfp, Relation, Trancl, WF, NatDef, Gfp, Sum, Inductive, Nat, Arith, - Divides, Power, Finite, Equiv, IntDef, Int, Univ, Datatype, Numeral, Bin, - IntArith, WF_Rel, Recdef, IntDiv, NatBin, List, Option, Map, Record, - RelPow, Sexp, String, Calculation, SVC_Oracle, Main, Zorn, Filter, PNat, - PRat, PReal, RealDef, RealOrd, RealInt, RealBin, HyperDef, Descript, ListG, - Tools, Script, Typefix, Atools, RatArith, SqRoot, Differentiate, DiffAppl, - InsSort, Isac} : theory ML> - ML> HOL.thy; - val it = {ProtoPure, CPure, HOL} : theory - ML> - ML> parse; - val it = fn : theory -> string -> cterm option - ML> parse thy "a + b * #3"; - val it = Some "a + b * #3" : cterm option - ML> - ML> val t = (term_of o the) it; - val t = Const (#,#) $ Free (#,#) $ (Const # $ Free # $ Free (#,#)) : term -\end{verbatim}}%size -where {\tt term\_of} and {\tt the} are explained below. The syntax of the list of characters can be read out of Isabelles theories \cite{Isa-obj} {\tt [isabelle]/src/HOL/}\footnote{Or you may use your internetbrowser to look at the files in {\tt [isabelle]/browser\_info}.} -and from theories developed with in \isac{} at {\tt [isac-src]/knowledge/}. Note that the syntax of the terms is different from those displayed at \isac's frontend after conversion to MathML. - - -\section{Displaying terms} -The print depth on the SML top-level can be set in order to produce output in the amount of detail desired: -{\footnotesize\begin{verbatim} - ML> Compiler.Control.Print.printDepth; - val it = ref 4 : int ref - ML> - ML> Compiler.Control.Print.printDepth:= 2; - val it = () : unit - ML> t; - val it = # $ # $ (# $ #) : term - ML> - ML> Compiler.Control.Print.printDepth:= 6; - val it = () : unit - ML> t; - val it = - Const ("op +","[RealDef.real, RealDef.real] => RealDef.real") $ - Free ("a","RealDef.real") $ - (Const ("op *","[RealDef.real, RealDef.real] => RealDef.real") $ - Free ("b","RealDef.real") $ Free ("#3","RealDef.real")) : term -\end{verbatim}}%size % $ -A closer look to the latter output shows that {\tt typ} is output as a string like {\tt cterm}. Other useful settings for the output are: -{\footnotesize\begin{verbatim} - ML> Compiler.Control.Print.printLength; - val it = ref 8 : int ref - ML> Compiler.Control.Print.stringDepth; - val it = ref 250 : int ref -\end{verbatim}}%size -Anyway, the SML output of terms is not very readable; there are functions in the KE to display them: -{\footnotesize\begin{verbatim} - ML> atomt; - val it = fn : term -> unit - ML> atomt t; - *** ------------- - *** Const ( op +) - *** . Free ( a, ) - *** . Const ( op *) - *** . . Free ( b, ) - *** . . Free ( #3, ) - val it = () : unit - ML> - ML> atomty; - val it = fn : theory -> term -> unit - ML> atomty thy t; - *** ------------- - *** Const ( op +, [real, real] => real) - *** . Free ( a, real) - *** . Const ( op *, [real, real] => real) - *** . . Free ( b, real) - *** . . Free ( #3, real) - val it = () : unit -\end{verbatim}}%size -where again the {\tt typ}s are rendered as strings, but more elegantly by use of the information contained in {\tt thy}.. - -\paragraph{Give it a try !} {\bf The mathematics knowledge grows} as it is defined in Isabelle theory by theory. Have a look by your internet browser to the hierarchy of those theories at {\tt [isabelle]/src/HOL/HOL.thy} and its children available on your system. Or you may use your internetbrowser to look at the files in {\tt [isabelle]/browser\_info}. -{\footnotesize\begin{verbatim} - ML> (*-1-*) parse HOL.thy "#2^^^#3"; - *** Inner lexical error at: "^^^#3" - val it = None : cterm option - ML> - ML> (*-2-*) parse HOL.thy "d_d x (a + x)"; - val it = None : cterm option - ML> - ML> - ML> (*-3-*) parse RatArith.thy "#2^^^#3"; - val it = Some "#2 ^^^ #3" : cterm option - ML> - ML> (*-4-*) parse RatArith.thy "d_d x (a + x)"; - val it = Some "d_d x (a + x)" : cterm option - ML> - ML> - ML> (*-5-*) parse Differentiate.thy "d_d x (a + x)"; - val it = Some "d_d x (a + x)" : cterm option - ML> - ML> (*-6-*) parse Differentiate.thy "#2^^^#3"; - val it = Some "#2 ^^^ #3" : cterm option -\end{verbatim}}%size -Don't trust the string representation: if we convert {\tt(*-4-*)} and {\tt(*-6-*)} to terms \dots -{\footnotesize\begin{verbatim} - ML> (*-4-*) val thy = RatArith.thy; - ML> ((atomty thy) o term_of o the o (parse thy)) "d_d x (a + x)"; - *** ------------- - *** Free ( d_d, [real, real] => real) - *** . Free ( x, real) - *** . Const ( op +, [real, real] => real) - *** . . Free ( a, real) - *** . . Free ( x, real) - val it = () : unit - ML> - ML> (*-6-*) val thy = Differentiate.thy; - ML> ((atomty thy) o term_of o the o (parse thy)) "d_d x (a + x)"; - *** ------------- - *** Const ( Differentiate.d_d, [real, real] => real) - *** . Free ( x, real) - *** . Const ( op +, [real, real] => real) - *** . . Free ( a, real) - *** . . Free ( x, real) - val it = () : unit -\end{verbatim}}%size -\dots we see: in {\tt(*-4-*)} we have an arbitrary function {\tt Free ( d\_d, \_)} and in {\tt(*-6-*)} we have the special function constant {\tt Const ( Differentiate.d\_d, \_)} for differentiation, which is defined in {\tt Differentiate.thy} and presumerably is meant. - - -\section{Converting terms} -The conversion from {\tt cterm} to {\tt term} has been shown above: -{\footnotesize\begin{verbatim} - ML> term_of; - val it = fn : cterm -> term - ML> - ML> the; - val it = fn : 'a option -> 'a - ML> - ML> val t = (term_of o the o (parse thy)) "a + b * #3"; - val t = Const (#,#) $ Free (#,#) $ (Const # $ Free # $ Free (#,#)) : term -\end{verbatim}}%size -where {\tt the} unwraps the {\tt term option} --- an auxiliary function from Larry Paulsons basic library at {\tt [isabelle]/src/Pure/library.ML}, which is really worthwile to study for any SML programmer. - -The other conversions are the following, some of which use the {\it signature} {\tt sign} of a theory: -{\footnotesize\begin{verbatim} - ML> sign_of; - val it = fn : theory -> Sign.sg - ML> - ML> cterm_of; - val it = fn : Sign.sg -> term -> cterm - ML> val ct = cterm_of (sign_of thy) t; - val ct = "a + b * #3" : cterm - ML> - ML> Sign.string_of_term; - val it = fn : Sign.sg -> term -> string - ML> Sign.string_of_term (sign_of thy) t; - val it = "a + b * #3" : ctem' - ML> - ML> string_of_cterm; - val it = fn : cterm -> string - ML> string_of_cterm ct; - val it = "a + b * #3" : ctem' -\end{verbatim}}%size - -\section{Theorems} -Theorems are a type, {\tt thm}, even more protected than {\tt cterms}: they are defined as axioms or proven in Isabelle. These definitions and proofs are contained in theories in the directory {\tt[isac-src]/knowledge/}, e.g. the theorem {\tt diff\_sum} in the theory {\tt[isac-src]/knowledge/Differentiate.thy}. Additionally, each theorem has to be recorded for \isac{} in the respective {\tt *.ML}, e.g. {\tt diff\_sum} in {\tt[isac-src]/knowledge/Differentiate.ML} as follows: -{\footnotesize\begin{verbatim} - ML> theorem' := overwritel (!theorem', - [("diff_const",num_str diff_const) - ]); -\end{verbatim}}%size -The additional recording of theorems and other values will disappear in later versions of \isac. - -\chapter{Rewriting} -\section{The arguments for rewriting} -The type identifiers of the arguments and values of the rewrite-functions in \ref{rewrite} differ only in an apostroph: the apostrohped types are re-named strings in order to maintain readability. -{\footnotesize\begin{verbatim} - ML> HOL.thy; - val it = {ProtoPure, CPure, HOL} : theory - ML> "HOL.thy" : theory'; - val it = "HOL.thy" : theory' - ML> - ML> sqrt_right; - val it = fn : rew_ord (* term * term -> bool *) - ML> "sqrt_right" : rew_ord'; - val it = "sqrt_right" : rew_ord' - ML> - ML> eval_rls; - val it = - Rls - {preconds=[],rew_ord=("sqrt_right",fn), - rules=[Thm #,Thm #,Thm #,Thm #,Thm #,Thm #,Thm #,Thm #, - Thm #,Thm #,Thm #,Thm #,Thm #,Calc #,Calc #,...], - scr=Script (Free #)} : rls - ML> "eval_rls" : rls'; - val it = "eval_rls" : rls' - ML> - ML> diff_sum; - val it = "d_d ?bdv (?u + ?v) = d_d ?bdv ?u + d_d ?bdv ?v" : thm - ML> ("diff_sum", "") : thm'; - val it = ("diff_sum","") : thm' -\end{verbatim}}%size -where a {\tt thm'} is a pair, eventually with the string-representation of the respective theorem. - -\section{The functions for rewriting}\label{rewrite} -Rewriting comes along with two equivalent functions, where the first is being actually used within the KE, and the second one is useful for tests: -{\footnotesize\begin{verbatim} - ML> rewrite_; - val it = fn - : theory - -> rew_ord - -> rls -> bool -> thm -> term -> (term * term list) option - ML> - ML> rewrite; - val it = fn - : theory' - -> rew_ord' - -> rls' -> bool -> thm' -> cterm' -> (cterm' * cterm' list) option -\end{verbatim}}%size -The arguments are the following:\\ -\tabcolsep=4mm -\def\arraystretch{1.5} -\begin{tabular}{lp{11.0cm}} - {\tt theory} & the Isabelle theory containing the definitions necessary for parsing the {\tt term} \\ - {\tt rew\_ord}& the rewrite order \cite{nipk:rew-all-that} for ordered rewriting -- see the section \ref{term-order} below. For {\em no} ordered rewriting take {\tt tless\_true}, a dummy order yielding true for all arguments \\ - {\tt rls} & the rule set for evaluating the condition within {\tt thm} in case {\tt thm} is a conditional rule \\ - {\tt bool} & a flag which triggers the evaluation of the eventual condition in {\tt thm}: if {\tt false} then evaluate the condition and according to the result of the evaluation apply {\tt thm} or not (conditional rewriting \cite{nipk:rew-all-that}), if {\tt true} then don't evaluate the condition, but put it into the set of assumptions \\ - {\tt thm} & the theorem used to try to rewrite {\tt term} \\ - {\tt term} & the term eventually rewritten by {\tt thm} \\ -\end{tabular}\\ - -\noindent The respective values of {\tt rewrite\_} and {\tt rewrite} are an {\tt option} of a pair, i.e. {\tt Some(\_,\_)} in case the {\tt term} can be rewritten by {\tt thm} w.r.t. {\tt rew\_ord} and/or {\tt rls}, or {\tt None} if no rewrite is found:\\ -\begin{tabular}{lp{10.4cm}} - {\tt term} & the term rewritten \\ - {\tt term list}& the assumptions eventually generated if the {\tt bool} flag is set to {\tt true} and {\tt thm} is applicable. \\ -\end{tabular}\\ - -\paragraph{Give it a try !} {\bf\dots rewriting is fun~!} many examples can be found in {\tt [isac-src]/tests/\dots}. In {\tt [isac-src]/tests/differentiate.sml} the following can be found: -{\footnotesize\begin{verbatim} - ML> val thy' = "Differentiate.thy"; - val thy' = "Differentiate.thy" : string - ML> val ct = "d_d x (x ^^^ #2 + #3 * x + #4)"; - val ct = "d_d x (x ^^^ #2 + #3 * x + #4)" : cterm' - ML> - ML> val thm = ("diff_sum",""); - val thm = ("diff_sum","") : thm' - ML> val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true - [("bdv","x::real")] thm ct; - val ct = "d_d x (x ^^^ #2 + #3 * x) + d_d x #4" : cterm' - ML> - ML> val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true - [("bdv","x::real")] thm ct; - val ct = "d_d x (x ^^^ #2) + d_d x (#3 * x) + d_d x #4" : cterm' - ML> - ML> val thm = ("diff_prod_const",""); - val thm = ("diff_prod_const","") : thm' - ML> val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true - [("bdv","x::real")] thm ct; - val ct = "d_d x (x ^^^ #2) + #3 * d_d x x + d_d x #4" : cterm' -\end{verbatim}}%size -You can look up the theorems in {\tt [isac-src]/knowledge/Differentiate.thy} and try to apply them until you get the result you would expect if calculating by hand. -\footnote{Hint: At the end you will need {\tt val (ct,\_) = the (rewrite\_set thy' "eval\_rls" false "SqRoot\_simplify" ct);}} - -\paragraph{Give it a try !}\label{cond-rew} {\bf Conditional rewriting} is a more powerful technique then ordinary rewriting, and is closer to the power of programming languages (see the subsequent 'try it out'~!). The following example expands a term to poynomial form: -{\footnotesize\begin{verbatim} - ML> val thy' = "Isac.thy"; - val thy' = "Isac.thy" : string - ML> val ct' = "#3 * a + #2 * (a + #1)"; - val ct' = "#3 * a + #2 * (a + #1)" : cterm' - ML> - ML> val thm' = ("radd_mult_distrib2","?k * (?m + ?n) = ?k * ?m + ?k * ?n"); - val thm' = ("radd_mult_distrib2","?k * (?m + ?n) = ?k * ?m + ?k * ?n") - : thm' - ML> (*1*) val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; - val ct' = "#3 * a + (#2 * a + #2 * #1)" : cterm' - ML> - ML> val thm' = ("radd_assoc_RS_sym","?m1 + (?n1 + ?k1) = ?m1 + ?n1 + ?k1"); - val thm' = ("radd_assoc_RS_sym","?m1 + (?n1 + ?k1) = ?m1 + ?n1 + ?k1") - : thm' - ML> (*2*) val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; - val ct' = "#3 * a + #2 * a + #2 * #1" : cterm' - ML> - ML> val thm' = ("rcollect_right", - "[| ?l is_const; ?m is_const |] ==> ?l * ?n + ?m * ?n = (?l + ?m) * ?n"); - val thm' = - ("rcollect_right", - "[| ?l is_const; ?m is_const |] ==> ?l * ?n + ?m * ?n = (?l + ?m) * ?n") - : thm' - ML> (*3*) val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; - val ct' = "(#3 + #2) * a + #2 * #1" : cterm' - ML> - ML> (*4*) val Some (ct',_) = calculate' thy' "plus" ct'; - val ct' = "#5 * a + #2 * #1" : cterm' - ML> - ML> (*5*) val Some (ct',_) = calculate' thy' "times" ct'; - val ct' = "#5 * a + #2" : cterm' -\end{verbatim}}%size -Note, that the two rules, {\tt radd\_mult\_distrib2} in {\tt(*1*)} and {\tt rcollect\_right} in {\tt(*3*)} would neutralize each other (i.e. a rule set would not terminate), if there would not be the condition {\tt is\_const}. - -\paragraph{Give it a try !} {\bf Functional programming} can, within a certain range, modeled by rewriting. In {\tt [isac-src]/\dots/tests/InsSort.thy} the following rules can be found, which are able to sort a list ('insertion sort'): -{\footnotesize\begin{verbatim} - sort_def "sort ls = foldr ins ls []" - - ins_base "ins [] a = [a]" - ins_rec "ins (x#xs) a = (if x < a then x#(ins xs a) else a#(x#xs))" - - foldr_base "foldr f [] a = a" - foldr_rec "foldr f (x#xs) a = foldr f xs (f a x)" - - if_True "(if True then ?x else ?y) = ?x" - if_False "(if False then ?x else ?y) = ?y" -\end{verbatim}}%size -where {\tt\#} is the list-constructor, {\tt foldr} is the well-known standard function of functional programming, and {\tt if\_True, if\_False} are auxiliary rules. Then the sort may be done by the following rewrites: -{\footnotesize\begin{verbatim} - ML> val thy' = "InsSort.thy"; - val thy' = "InsSort.thy" : theory' - ML> val ct = "sort [#1,#3,#2]" : cterm'; - val ct = "sort [#1,#3,#2]" : cterm' - ML> - ML> val thm = ("sort_def",""); - ML> val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); - val ct = "foldr ins [#1, #3, #2] []" : cterm' - ML> - ML> val thm = ("foldr_rec",""); - ML> val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); - val ct = "foldr ins [#3, #2] (ins [] #1)" : cterm' - ML> - ML> val thm = ("ins_base",""); - ML> val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); - val ct = "foldr ins [#3, #2] [#1]" : cterm' - ML> - ML> val thm = ("foldr_rec",""); - ML> val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); - val ct = "foldr ins [#2] (ins [#1] #3)" : cterm' - ML> - ML> val thm = ("ins_rec",""); - ML> val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); - val ct = "foldr ins [#2] (if #1 < #3 then #1 # ins [] #3 else [#3, #1])" - : cterm' - ML> - ML> val (ct,_) = the (calculate' thy' "le" ct); - val ct = "foldr ins [#2] (if True then #1 # ins [] #3 else [#3, #1])" : cterm' - ML> - ML> val thm = ("if_True","(if True then ?x else ?y) = ?x"); - ML> val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); - val ct = "foldr ins [#2] (#1 # ins [] #3)" : cterm' - ML> - ... - val ct = "sort [#1,#3,#2]" : cterm' -\end{verbatim}}%size - - -\section{Variants of rewriting} -Some of the above examples already used variants of {\tt rewrite} all of which have the same value, and very similar arguments: -{\footnotesize\begin{verbatim} - ML> rewrite_inst_; - val it = fn - : theory - -> rew_ord - -> rls - -> bool - -> (cterm' * cterm') list - -> thm -> term -> (term * term list) option - ML> rewrite_inst; - val it = fn - : theory' - -> rew_ord' - -> rls' - -> bool - -> (cterm' * cterm') list - -> thm' -> cterm' -> (cterm' * cterm' list) option - ML> - ML> rewrite_set_; - val it = fn - : theory -> rls -> bool -> rls -> term -> (term * term list) option - ML> rewrite_set; - val it = fn - : theory' -> rls' -> bool -> rls' -> cterm' -> (cterm' * cterm' list) option - ML> - ML> rewrite_set_inst_; - val it = fn - : theory - -> rls - -> bool - -> (cterm' * cterm') list - -> rls -> term -> (term * term list) option - ML> rewrite_set_inst; - val it = fn - : theory' - -> rls' - -> bool - -> (cterm' * cterm') list - -> rls' -> cterm' -> (cterm' * cterm' list) option -\end{verbatim}}%size - -\noindent The variant {\tt rewrite\_inst} substitutes {\tt (term * term) list} in {\tt thm} before rewriting,\\ -the variant {\tt rewrite\_set} rewrites with a whole rule set {\tt rls} (instead with a {\tt thm} only),\\ -the variant {\tt rewrite\_set\_inst} is a combination of the latter two variants. In order to watch how a term is rewritten theorem by theorem, there is a switch {\tt trace\_rewrite}: -{\footnotesize\begin{verbatim} - ML> toggle; - val it = fn : bool ref -> bool - ML> - ML> toggle trace_rewrite; - val it = true : bool - ML> toggle trace_rewrite; - val it = false : bool -\end{verbatim}}%size - -\section{Rule sets} -Some of the variants of {\tt rewrite} above do not only apply one theorem, but a whole set of theorems, called a 'rule set'. Such a rule set is applied as long one of its elements can be used for a rewrite (which can go forever, i.e. the rule set eventually does not 'terminate'). - -A simple example of a rule set is {\tt rearrange\_assoc} which is defined in {\tt knowledge/RatArith.ML} as: -{\footnotesize\begin{verbatim} - val rearrange_assoc = - Rls{preconds = [], rew_ord = ("tless_true",tless_true), - rules = - [Thm ("radd_assoc_RS_sym",num_str (radd_assoc RS sym)), - Thm ("rmult_assoc_RS_sym",num_str (rmult_assoc RS sym))], - scr = Script ((term_of o the o (parse thy)) - "empty_script") - }:rls; -\end{verbatim}}%size -where -\begin{description} -\item [\tt preconds] are conditions which must be true in order to make the rule set applicable (the empty list evaluates to {\tt true}) -\item [\tt rew\_ord] concerns term orders introduced below in \ref{term-order} -\item [\tt rules] are the theorems to be applied -- in priciple applied in arbitrary order, because all these rule sets should be 'complete' \cite{nipk:rew-all-that} (and actually the theorems are applied in the sequence they appear in this list). The function {\tt num\_str} must be applied to theorems containing numeral constants (and thus is obsolete in this example). {\tt RS} is an infix function applying the theorem {\tt sym} to {\tt radd\_assoc} before storage (the effect see below) -\item [\tt scr] is the script applying the ruleset; it will disappear in later versions of \isac. -\end{description} -These variables evaluate to -{\footnotesize\begin{verbatim} - ML> sym; - val it = "?s = ?t ==> ?t = ?s" : thm - ML> rearrange_assoc; - val it = - Rls - {preconds=[],rew_ord=("tless_true",fn), - rules=[Thm ("radd_assoc_RS_sym","?m1 + (?n1 + ?k1) = ?m1 + ?n1 + ?k1"), - Thm ("rmult_assoc_RS_sym","?m1 * (?n1 * ?k1) = ?m1 * ?n1 * ?k1")], - scr=Script (Free ("empty_script","RealDef.real"))} : rls -\end{verbatim}}%size - -\paragraph{Give it a try !} The above rule set makes an arbitrary number of parentheses disappear which are not necessary due to associativity of {\tt +} and -{\footnotesize\begin{verbatim} - ML> val ct = (string_of_cterm o the o (parse RatArith.thy)) - "a + (b * (c * d) + e)"; - val ct = "a + ((b * (c * d) + e) + f)" : cterm' - ML> rewrite_set "RatArith.thy" "eval_rls" false "rearrange_assoc" ct; - val it = Some ("a + b * c * d + e + f",[]) : (string * string list) option -\end{verbatim}}%size -For acchieving this result the rule set has to be surprisingly busy: -{\footnotesize\begin{verbatim} - ML> toggle trace_rewrite; - val it = true : bool - ML> rewrite_set "RatArith.thy" "eval_rls" false "rearrange_assoc" ct; - ### trying thm 'radd_assoc_RS_sym' - ### rewrite_set_: a + b * (c * d) + e - ### trying thm 'radd_assoc_RS_sym' - ### trying thm 'rmult_assoc_RS_sym' - ### rewrite_set_: a + b * c * d + e - ### trying thm 'rmult_assoc_RS_sym' - ### trying thm 'radd_assoc_RS_sym' - ### trying thm 'rmult_assoc_RS_sym' - val it = Some ("a + b * c * d + e",[]) : (string * string list) option -\end{verbatim}}%size - - -\section{Calculate numeric constants} -As soon as numeric constants are in adjacent subterms (see the example on p.\pageref{cond-rew}), they can be calculated by the function -{\footnotesize\begin{verbatim} - ML> calculate; - val it = fn : theory' -> string -> cterm' -> (cterm' * thm') option - ML> calculate_; - val it = fn : theory -> string -> term -> (term * (string * thm)) option -\end{verbatim}}%size -where the {\tt string} in the arguments defines the algebraic operation to be calculated. The function returns the result of the calculation, and as second element in the pair the theorem applied. The following algebraic operations are available: -{\footnotesize\begin{verbatim} - ML> calc_list; - val it = - ref - [("plus",("op +",fn)), - ("times",("op *",fn)), - ("cancel_",("cancel",fn)), - ("power",("pow",fn)), - ("sqrt",("sqrt",fn)), - ("Var",("Var",fn)), - ("Length",("Length",fn)), - ("Nth",("Nth",fn)), - ("power",("pow",fn)), - ("le",("op <",fn)), - ("leq",("op <=",fn)), - ("is_const",("is'_const",fn)), - ("is_root_free",("is'_root'_free",fn)), - ("contains_root",("contains'_root",fn)), - ("ident",("ident",fn))] - : (string * (string * (string -> term -> theory -> - (string * term) option))) list ref -\end{verbatim}}%size -These operations can be used in the following way. -{\footnotesize\begin{verbatim} - ML> calculate' "Isac.thy" "plus" "#1 + #2"; - val it = Some ("#3",("#add_#1_#2","\"#1 + #2 = #3\"")) : (string * thm') option - ML> - ML> calculate' "Isac.thy" "times" "#2 * #3"; - val it = Some ("#6",("#mult_#2_#3","\"#2 * #3 = #6\"")) - : (string * thm') option - ML> - ML> calculate' "Isac.thy" "power" "#2 ^^^ #3"; - val it = Some ("#8",("#power_#2_#3","\"#2 ^^^ #3 = #8\"")) - : (string * thm') option - ML> - ML> calculate' "Isac.thy" "cancel_" "#9 // #12"; - val it = Some ("#3 // #4",("#cancel_#9_#12","\"#9 // #12 = #3 // #4\"")) - : (string * thm') option - ML> - ML> ... -\end{verbatim}}%size - - - -\chapter{Term orders}\label{term-order} -Orders on terms are indispensable for the purpose of rewriting to normal forms in associative - commutative domains \cite{nipk:rew-all-that}, and for rewriting to normal forms necessary for matching models to problems, see sect.\ref{pbt}. -\section{Examples for term orders} -It is not trivial to construct a relation $<$ on terms such that it is really an order, i.e. a transitive and antisymmetric relation. These orders are 'recursive path orders' \cite{nipk:rew-all-that}. Some orders implemented in the knowledgebase at {\tt [isac-src]/knowledge/\dots}, %FIXXXmat0201a -e.g. -{\footnotesize\begin{verbatim} - ML> sqrt_right; - val it = fn : bool -> theory -> term * term -> bool - ML> tless_true; - val it = fn : 'a -> bool -\end{verbatim}}%size -where the bool argument is a switch for tracing the checks on the respective subterms (and theory is necessary for displyinging the (sub-)terms as strings in the case of 'true'). The order {\tt tless\_true} is a dummy always yielding {\tt true}, and {\tt sqrt\_right} prefers a square root shifted to the right within a term: -{\footnotesize\begin{verbatim} - ML> val t1 = (term_of o the o (parse thy)) "(sqrt a) + b"; - val t1 = Const # $ (# $ #) $ Free (#,#) : term - ML> - ML> val t2 = (term_of o the o (parse thy)) "b + (sqrt a)"; - val t2 = Const # $ Free # $ (Const # $ Free #) : term - ML> - ML> sqrt_right false SqRoot.thy (t1, t2); - val it = false : bool - ML> sqrt_right false SqRoot.thy (t2, t1); - val it = true : bool -\end{verbatim}}%size -The many checks performed recursively through all subterms can be traced throughout the algorithm in {\tt [isac-src]/knowledge/SqRoot.ML} by setting the flag to true: -{\footnotesize\begin{verbatim} - ML> val t1 = (term_of o the o (parse thy)) "a + b*(sqrt c) + d"; - val t1 = Const (#,#) $ (# $ # $ (# $ #)) $ Free ("d","RealDef.real") : term - ML> - ML> val t2 = (term_of o the o (parse thy)) "a + (sqrt b)*c + d"; - val t2 = Const (#,#) $ (# $ # $ (# $ #)) $ Free ("d","RealDef.real") : term - ML> - ML> sqrt_right true SqRoot.thy (t1, t2); - t= f@ts= "op +" @ "[a + b * sqrt c,d]" - u= g@us= "op +" @ "[a + sqrt b * c,d]" - size_of_term(t,u)= (8, 8) - hd_ord(f,g) = EQUAL - terms_ord(ts,us) = LESS - ------- - t= f@ts= "op +" @ "[a,b * sqrt c]" - u= g@us= "op +" @ "[a,sqrt b * c]" - size_of_term(t,u)= (6, 6) - hd_ord(f,g) = EQUAL - terms_ord(ts,us) = LESS - ------- - t= f@ts= "a" @ "[]" - u= g@us= "a" @ "[]" - size_of_term(t,u)= (1, 1) - hd_ord(f,g) = EQUAL - terms_ord(ts,us) = EQUAL - ------- - t= f@ts= "op *" @ "[b,sqrt c]" - u= g@us= "op *" @ "[sqrt b,c]" - size_of_term(t,u)= (4, 4) - hd_ord(f,g) = EQUAL - terms_ord(ts,us) = LESS - ------- - t= f@ts= "b" @ "[]" - u= g@us= "sqrt" @ "[b]" - size_of_term(t,u)= (1, 2) - hd_ord(f,g) = LESS - terms_ord(ts,us) = LESS - ------- - val it = true : bool -\end{verbatim}}%size - - - -\section{Ordered rewriting} -Rewriting faces problems in just the most elementary domains, which are all associative and commutative w.r.t. {\tt +} and {\tt *} --- the law of commutativity applied within a rule set causes this set not to terminate~! One method to cope with this difficulty is ordered rewriting, where a rewrite is only done if the resulting term is smaller w.r.t. a term order (with some additional properties called 'rewrite orders' \cite{nipk:rew-all-that}). - -Such a rule set {\tt ac\_plus\_times}, called an AC-rewrite system, can be found in {\tt[isac-src]/knowledge/RathArith.ML}: -{\footnotesize\begin{verbatim} - val ac_plus_times = - Rls{preconds = [], rew_ord = ("term_order",term_order), - rules = - [Thm ("radd_commute",radd_commute), - Thm ("radd_left_commute",radd_left_commute), - Thm ("radd_assoc",radd_assoc), - Thm ("rmult_commute",rmult_commute), - Thm ("rmult_left_commute",rmult_left_commute), - Thm ("rmult_assoc",rmult_assoc)], - scr = Script ((term_of o the o (parse thy)) - "empty_script") - }:rls; - val ac_plus_times = - Rls - {preconds=[],rew_ord=("term_order",fn), - rules=[Thm ("radd_commute","?m + ?n = ?n + ?m"), - Thm ("radd_left_commute","?x + (?y + ?z) = ?y + (?x + ?z)"), - Thm ("radd_assoc","?m + ?n + ?k = ?m + (?n + ?k)"), - Thm ("rmult_commute","?m * ?n = ?n * ?m"), - Thm ("rmult_left_commute","?x * (?y * ?z) = ?y * (?x * ?z)"), - Thm ("rmult_assoc","?m * ?n * ?k = ?m * (?n * ?k)")], - scr=Script (Free ("empty_script","RealDef.real"))} : rls -\end{verbatim}}%size -Note that the theorems {\tt radd\_left\_commute} and {\tt rmult\_left\_commute} are really necessary in order to make the rule set 'confluent'~! - - -\paragraph{Give it a try !} Ordered rewriting is one technique to produce polynomial normal from from arbitrary integer terms: -{\footnotesize\begin{verbatim} - ML> val ct' = "#3 * a + b + #2 * a"; - val ct' = "#3 * a + b + #2 * a" : cterm' - ML> - ML> (*-1-*) radd_commute; val thm' = ("radd_commute","") : thm'; - val it = "?m + ?n = ?n + ?m" : thm - val thm' = ("radd_commute","") : thm' - ML> val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; - val ct' = "#2 * a + (#3 * a + b)" : cterm' - ML> - ML> (*-2-*) rdistr_right_assoc_p; val thm' = ("rdistr_right_assoc_p","") : thm'; - val it = "?l * ?n + (?m * ?n + ?k) = (?l + ?m) * ?n + ?k" : thm - val thm' = ("rdistr_right_assoc_p","") : thm' - ML> val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; - val ct' = "(#2 + #3) * a + b" : cterm' - ML> - ML> (*-3-*) - ML> val Some (ct',_) = calculate thy' "plus" ct'; - val ct' = "#5 * a + b" : cterm' -\end{verbatim}}%size %FIXXXmat0201b ... calculate ! -This looks nice, but if {\tt radd\_commute} is applied automatically in {\tt (*-1-*)} without checking the resulting term to be 'smaller' w.r.t. a term order, then rewritin goes on forever (i.e. it does not 'terminate') \dots -{\footnotesize\begin{verbatim} - ML> val ct' = "#3 * a + b + #2 * a" : cterm'; - val ct' = "#3 * a + b + #2 * a" : cterm' - ML> val thm' = ("radd_commute","") : thm'; - val thm' = ("radd_commute","") : thm' - ML> - ML> val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; - val ct' = "#2 * a + (#3 * a + b)" : cterm' - ML> val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; - val ct' = "#3 * a + b + #2 * a" : cterm' - ML> val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; - val ct' = "#2 * a + (#3 * a + b)" : cterm' - .......... -\end{verbatim}}%size - -Ordered rewriting with the above AC-rewrite system {\tt ac\_plus\_times} performs a kind of bubble sort which can be traced: -{\footnotesize\begin{verbatim} - ML> toggle trace_rewrite; - val it = true : bool - ML> - ML> rewrite_set "RatArith.thy" "eval_rls" false "ac_plus_times" ct; - ### trying thm 'radd_commute' - ### not: "a + (b * (c * d) + e)" > "b * (c * d) + e + a" - ### rewrite_set_: a + (e + b * (c * d)) - ### trying thm 'radd_commute' - ### not: "a + (e + b * (c * d))" > "e + b * (c * d) + a" - ### not: "e + b * (c * d)" > "b * (c * d) + e" - ### trying thm 'radd_left_commute' - ### not: "a + (e + b * (c * d))" > "e + (a + b * (c * d))" - ### trying thm 'radd_assoc' - ### trying thm 'rmult_commute' - ### not: "b * (c * d)" > "c * d * b" - ### not: "c * d" > "d * c" - ### trying thm 'rmult_left_commute' - ### not: "b * (c * d)" > "c * (b * d)" - ### trying thm 'rmult_assoc' - ### trying thm 'radd_commute' - ### not: "a + (e + b * (c * d))" > "e + b * (c * d) + a" - ### not: "e + b * (c * d)" > "b * (c * d) + e" - ### trying thm 'radd_left_commute' - ### not: "a + (e + b * (c * d))" > "e + (a + b * (c * d))" - ### trying thm 'radd_assoc' - ### trying thm 'rmult_commute' - ### not: "b * (c * d)" > "c * d * b" - ### not: "c * d" > "d * c" - ### trying thm 'rmult_left_commute' - ### not: "b * (c * d)" > "c * (b * d)" - ### trying thm 'rmult_assoc' - val it = Some ("a + (e + b * (c * d))",[]) : (string * string list) option \end{verbatim}}%size -Notice that {\tt +} is left-associative where the parentheses are omitted for {\tt (a + b) + c = a + b + c}, but not for {\tt a + (b + c)}. Ordered rewriting necessarily terminates with parentheses which could be omitted due to associativity. - - -\chapter{The hierarchy of problem types}\label{pbt} -\section{The standard-function for 'matching'} -Matching \cite{nipk:rew-all-that} is a technique used within rewriting, and used by \isac{} also for (a generalized) 'matching' a problem with a problem type. The function which tests for matching has the following signature: -{\footnotesize\begin{verbatim} - ML> matches; - val it = fn : theory -> term -> term -> bool -\end{verbatim}}%size -where the first of the two {\tt term} arguments is the particular term to be tested, and the second one is the pattern: -{\footnotesize\begin{verbatim} - ML> val t = (term_of o the o (parse thy)) "#3 * x^^^#2 = #1"; - val t = Const (#,#) $ (# $ # $ (# $ #)) $ Free ("#1","RealDef.real") : term - ML> - ML> val p = (term_of o the o (parse thy)) "a * b^^^#2 = c"; - val p = Const (#,#) $ (# $ # $ (# $ #)) $ Free ("c","RealDef.real") : term - ML> atomt p; - *** ------------- - *** Const ( op =) - *** . Const ( op *) - *** . . Free ( a, ) - *** . . Const ( RatArith.pow) - *** . . . Free ( b, ) - *** . . . Free ( #2, ) - *** . Free ( c, ) - val it = () : unit - ML> - ML> free2var; - val it = fn : term -> term - ML> - ML> val pat = free2var p; - val pat = Const (#,#) $ (# $ # $ (# $ #)) $ Var ((#,#),"RealDef.real") : term - ML> Sign.string_of_term (sign_of thy) pat; - val it = "?a * ?b ^^^ #2 = ?c" : cterm' - ML> atomt pat; - *** ------------- - *** Const ( op =) - *** . Const ( op *) - *** . . Var ((a, 0), ) - *** . . Const ( RatArith.pow) - *** . . . Var ((b, 0), ) - *** . . . Free ( #2, ) - *** . Var ((c, 0), ) - val it = () : unit -\end{verbatim}}%size % $ -Note that the pattern {\tt pat} contains so-called {\it scheme variables} decorated with a {\tt ?} (analoguous to theorems). The pattern is generated by the function {\tt free2var}. This format of the pattern is necessary in order to obtain results like these: -{\footnotesize\begin{verbatim} - ML> matches thy t pat; - val it = true : bool - ML> - ML> val t2 = (term_of o the o (parse thy)) "x^^^#2 = #1"; - val t2 = Const (#,#) $ (# $ # $ Free #) $ Free ("#1","RealDef.real") : term - ML> matches thy t2 pat; - val it = false : bool - ML> - ML> val pat2 = (term_of o the o (parse thy)) "?u^^^#2 = ?v"; - val pat2 = Const (#,#) $ (# $ # $ Free #) $ Var ((#,#),"RealDef.real") : term - ML> matches thy t2 pat2; - val it = true : bool -\end{verbatim}}%size % $ - -\section{Accessing the hierarchy} -The hierarchy of problem types is encapsulated; it can be accessed by the following functions. {\tt show\_ptyps} retrieves all leaves of the hierarchy (here in an early version for testing): -{\footnotesize\begin{verbatim} - ML> show_ptyps; - val it = fn : unit -> unit - ML> show_ptyps(); - [ - ["e_pblID"], - ["equation", "univariate", "linear"], - ["equation", "univariate", "plain_square"], - ["equation", "univariate", "polynomial", "degree_two", "pq_formula"], - ["equation", "univariate", "polynomial", "degree_two", "abc_formula"], - ["equation", "univariate", "squareroot"], - ["equation", "univariate", "normalize"], - ["equation", "univariate", "sqroot-test"], - ["function", "derivative_of"], - ["function", "maximum_of", "on_interval"], - ["function", "make"], - ["tool", "find_values"], - ["functional", "inssort"] - ] - val it = () : unit -\end{verbatim}}%size -The retrieve function for individual problem types is {\tt get\_pbt} -\footnote{A function providing better readable output is in preparation}. Note that its argument, the 'problem identifier' {\tt pblID}, has the strings listed in reverse order w.r.t. the hierarchy, i.e. from the leave to the root. This order makes the {\tt pblID} closer to a natural description: -{\footnotesize\begin{verbatim} - ML> get_pbt; - val it = fn : pblID -> pbt - ML> get_pbt ["squareroot", "univariate", "equation"]; - val it = - {met=[("SqRoot.thy","square_equation")], - ppc=[("#Given",(Const (#,#),Free (#,#))), - ("#Given",(Const (#,#),Free (#,#))), - ("#Given",(Const (#,#),Free (#,#))), - ("#Find",(Const (#,#),Free (#,#)))], - thy={ProtoPure, CPure, HOL, Ord, Set, subset, equalities, mono, Vimage, Fun, - Prod, Lfp, Relation, Trancl, WF, NatDef, Gfp, Sum, Inductive, Nat, - Arith, Divides, Power, Finite, Equiv, IntDef, Int, Univ, Datatype, - Numeral, Bin, IntArith, WF_Rel, Recdef, IntDiv, NatBin, List, Option, - Map, Record, RelPow, Sexp, String, Calculation, SVC_Oracle, Main, - Zorn, Filter, PNat, PRat, PReal, RealDef, RealOrd, RealInt, RealBin, - HyperDef, Descript, ListG, Tools, Script, Typefix, Atools, RatArith, - SqRoot}, - where_=[Const ("SqRoot.contains'_root","bool => bool") $ - Free ("e_","bool")]} : pbt -\end{verbatim}}%size %$ -where the records fields hold the following data: -\begin{description} -\item [\tt thy]: the theory necessary for parsing the formulas -\item [\tt ppc]: the items of the problem type, divided into those {\tt Given}, the precondition {\tt Where} and the output item(s) {\tt Find}. The items of {\tt Given} and {\tt Find} are all headed by so-called descriptions, which determine the type. These descriptions are defined in {\tt [isac-src]/Isa99/Descript.thy}. -\item [\tt met]: the list of methods solving this problem type.\\ -\end{description} - -The following function adds or replaces a problem type (after having it prepared using {\tt prep\_pbt}) -{\footnotesize\begin{verbatim} - ML> store_pbt; - val it = fn : pbt * pblID -> unit - ML> store_pbt - (prep_pbt SqRoot.thy - (["newtype","univariate","equation"], - [("#Given" ,["equality e_","solveFor v_","errorBound err_"]), - ("#Where" ,["contains_root (e_::bool)"]), - ("#Find" ,["solutions v_i_"]) - ], - [("SqRoot.thy","square_equation")])); - val it = () : unit -\end{verbatim}}%size -When adding a new type with argument {\tt pblID}, an immediate parent must already exist in the hierarchy (this is the one with the tail of {\tt pblID}). - -\section{Internals of the datastructure} -This subsection only serves for the implementation of the hierarchy browser and can be skipped by the authors of math knowledge. - -A problem type is described by the following record type (in the file {\tt [isac-src]/globals.sml}, the respective functions are in {\tt [isac-src]/ME/ptyps.sml}), and held in a global reference variable: -{\footnotesize\begin{verbatim} - type pbt = - {thy : theory, (* the nearest to the root, - which allows to compile that pbt *) - where_: term list, (* where - predicates *) - ppc : ((string * (* fields "#Given","#Find" *) - (term * (* description *) - term)) (* id *) - list), - met : metID list}; (* methods solving the pbt *) - datatype ptyp = - Ptyp of string * (* key within pblID *) - pbt list * (* several pbts with different domIDs*) - ptyp list; - val e_Ptyp = Ptyp ("empty",[],[]); - - type ptyps = ptyp list; - val ptyps = ref ([e_Ptyp]:ptyps); -\end{verbatim}}%size -The predicates in {\tt where\_} (i.e. the preconditions) usually are defined in the respective theory in {\tt[isac-src]/knowledge}. Most of the predicates are not defined by rewriting, but by SML-code contained in the respective {\tt *.ML} file. - -Each item is headed by a so-called description which provides some guidance for interactive input. The descriptions are defined in {\tt[isac-src]/Isa99/Descript.thy}. - - - -\section{Match a formalization with a problem type}\label{pbl} -A formalization is {\it match}ed with a problem type which yields a problem. A formal description of this kind of {\it match}ing can be found in \\{\tt ftp://ft.ist.tugraz.at/projects/isac/publ/calculemus01.ps.gz}. A formalization of an equation is e.g. -{\footnotesize\begin{verbatim} - ML> val fmz = ["equality (#1 + #2 * x = #0)", - "solveFor x", - "solutions L"] : fmz; - val fmz = ["equality (#1 + #2 * x = #0)","solveFor x","solutions L"] : fmz -\end{verbatim}}%size -Given a formalization (and a specification of the problem, i.e. a theory, a problemtype, and a method) \isac{} can solve the respective problem automatically. The formalization must match the problem type for this purpose: -{\footnotesize\begin{verbatim} - ML> match_pbl; - val it = fn : fmz -> pbt -> match' - ML> - ML> match_pbl fmz (get_pbt ["univariate","equation"]); - val it = - Matches' - {Find=[Correct "solutions L"], - Given=[Correct "equality (#1 + #2 * x = #0)",Correct "solveFor x"], - Relate=[],Where=[Correct "matches (?a = ?b) (#1 + #2 * x = #0)"],With=[]} - : match' - ML> - ML> match_pbl fmz (get_pbt ["linear","univariate","equation"]); - val it = - Matches' - {Find=[Correct "solutions L"], - Given=[Correct "equality (#1 + #2 * x = #0)",Correct "solveFor x"], - Relate=[], - Where=[Correct - "matches ( x = #0) (#1 + #2 * x = #0) | - matches ( ?b * x = #0) (#1 + #2 * x = #0) | - matches (?a + x = #0) (#1 + #2 * x = #0) | - matches (?a + ?b * x = #0) (#1 + #2 * x = #0)"], - With=[]} : match' - ML> - ML> match_pbl fmz (get_pbt ["squareroot","univariate","equation"]); - val it = - NoMatch' - {Find=[Correct "solutions L"], - Given=[Correct "equality (#1 + #2 * x = #0)",Correct "solveFor x", - Missing "errorBound err_"],Relate=[], - Where=[False "contains_root #1 + #2 * x = #0 "],With=[]} : match' -\end{verbatim}}%size -The above formalization does not match the problem type \\{\tt["squareroot","univariate","equation"]} which is explained by the tags: -\begin{tabbing} -123\=\kill -\> {\tt Missing:} the item is missing in the formalization as required by the problem type\\ -\> {\tt Superfl:} the item is not required by the problem type\\ -\> {\tt Correct:} the item is correct, or the precondition ({\tt Where}) is true\\ -\> {\tt False:} the precondition ({\tt Where}) is false\\ -\> {\tt Incompl:} the item is incomlete, or not yet input.\\ -\end{tabbing} - - - -\section{Refine a problem specification} -The challenge in constructing the problem hierarchy is, to design the branches in such a way, that problem refinement can be done automatically (as it is done in algebra system e.g. by a internal hierarchy of equations). - -For this purpose the hierarchy must be built using the following rules: Let $F$ be a formalization and $P$ and $P_i,\:i=1\cdots n$ problem types, where the $P_i$ are specialized problem types w.r.t. $P$ (i.e. $P$ is a parent node of $P_i$), then -{\small -\begin{enumerate} -\item for all $F$ matching some $P_i$ must follow, that $F$ matches $P$ -\item an $F$ matching $P$ should not have more than {\em one} $P_i,\:i=1\cdots n-1$ with $F$ matching $P_i$ (if there are more than one $P_i$, the first one will be taken) -\item for all $F$ matching some $P$ must follow, that $F$ matches $P_n$\\ -\end{enumerate}}%small -\noindent Let us give an example for the point (1.) and (2.) first: -{\footnotesize\begin{verbatim} - ML> refine; - val it = fn : fmz -> pblID -> match list - ML> - ML> val fmz = ["equality (sqrt(#9+#4*x)=sqrt x + sqrt(#5+x))", - "solveFor x","errorBound (eps=#0)", - "solutions L"]; - ML> - ML> refine fmz ["univariate","equation"]; - *** pass ["equation","univariate"] - *** pass ["equation","univariate","linear"] - *** pass ["equation","univariate","plain_square"] - *** pass ["equation","univariate","polynomial"] - *** pass ["equation","univariate","squareroot"] - val it = - [Matches - (["univariate","equation"], - {Find=[Correct "solutions L"], - Given=[Correct "equality (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x))", - Correct "solveFor x",Superfl "errorBound (eps = #0)"],Relate=[], - Where=[Correct - "matches (?a = ?b) (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x))"], - With=[]}), - NoMatch - (["linear","univariate","equation"], - {Find=[Correct "solutions L"], - Given=[Correct "equality (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x))", - Correct "solveFor x",Superfl "errorBound (eps = #0)"],Relate=[], - Where=[False "(?a + ?b * x = #0) (sqrt (#9 + #4 * x#"], - With=[]}), - NoMatch - (["plain_square","univariate","equation"], - {Find=[Correct "solutions L"], - Given=[Correct "equality (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x))", - Correct "solveFor x",Superfl "errorBound (eps = #0)"],Relate=[], - Where=[False - "matches (?a + ?b * x ^^^ #2 = #0)"], - With=[]}), - NoMatch - (["polynomial","univariate","equation"], - {Find=[Correct "solutions L"], - Given=[Correct "equality (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x))", - Correct "solveFor x",Superfl "errorBound (eps = #0)"],Relate=[], - Where=[False - "is_polynomial_in sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x) x"], - With=[]}), - Matches - (["squareroot","univariate","equation"], - {Find=[Correct "solutions L"], - Given=[Correct "equality (sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x))", - Correct "solveFor x",Correct "errorBound (eps = #0)"],Relate=[], - Where=[Correct - "contains_root sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x) "], - With=[]})] : match list -\end{verbatim}}%size}%footnotesize\label{refine} -This example shows, that in order to refine an {\tt["univariate","equation"]}, the formalization must match respective respective problem type (rule (1.)) and one of the descendants which should match selectively (rule (2.)). - -If no one of the descendants of {\tt["univariate","equation"]} match, rule (3.) comes into play: The {\em last} problem type on this level ($P_n$) provides for a special 'problem type' {\tt["normalize"]}. This node calls a method transforming the equation to a (or another) normal form, which then may match. Look at this example: -{\footnotesize\begin{verbatim} - ML> val fmz = ["equality (x+#1=#2)", - "solveFor x","errorBound (eps=#0)", - "solutions L"]; - [...] - ML> - ML> refine fmz ["univariate","equation"]; - *** pass ["equation","univariate"] - *** pass ["equation","univariate","linear"] - *** pass ["equation","univariate","plain_square"] - *** pass ["equation","univariate","polynomial"] - *** pass ["equation","univariate","squareroot"] - *** pass ["equation","univariate","normalize"] - val it = - [Matches - (["univariate","equation"], - {Find=[Correct "solutions L"], - Given=[Correct "equality (x + #1 = #2)",Correct "solveFor x", - Superfl "errorBound (eps = #0)"],Relate=[], - Where=[Correct "matches (?a = ?b) (x + #1 = #2)"],With=[]}), - NoMatch - (["linear","univariate","equation"], - [...] - With=[]}), - NoMatch - (["squareroot","univariate","equation"], - {Find=[Correct "solutions L"], - Given=[Correct "equality (x + #1 = #2)",Correct "solveFor x", - Correct "errorBound (eps = #0)"],Relate=[], - Where=[False "contains_root x + #1 = #2 "],With=[]}), - Matches - (["normalize","univariate","equation"], - {Find=[Correct "solutions L"], - Given=[Correct "equality (x + #1 = #2)",Correct "solveFor x", - Superfl "errorBound (eps = #0)"],Relate=[],Where=[],With=[]})] - : match list -\end{verbatim}}%size -The problem type $P_n$, {\tt["normalize","univariate","equation"]}, will transform the equation {\tt x + \#1 = \#2} to the normal form {\tt \#-1 + x = \#0}, which then will match {\tt["linear","univariate","equation"]}. - -This recursive search on the problem hierarchy can be done within a proof state. This leads to the next section. - - -\chapter{Methods} -A problem type can have one ore more methods solving a respective problem. A method is described by means of another new program language. The language itself looks like a simple functional language, but constructs an imperative proof-state behind the scenes (thus liberating the programer from dealing with technical details and also prohibiting incorrect construction of the proof tree). The interpreter of 'scripts' written in this language evaluates the scriptexpressions, and also delivers certain parts of the script itself for discussion with the user. - -\section{The scripts' syntax} -The syntax of scripts follows the definition given in Backus-normal-form: -{\it -\begin{tabbing} -123\=123\=expr ::=\=$|\;\;$\=\kill -\>script ::= {\tt Script} id arg$\,^*$ = body\\ -\>\>arg ::= id $\;|\;\;($ ( id :: type ) $)$\\ -\>\>body ::= expr\\ -\>\>expr ::= \>\>{\tt let} id = expr $($ ; id = expr$)^*$ {\tt in} expr\\ -\>\>\>$|\;$\>{\tt if} prop {\tt then} expr {\tt else} expr\\ -\>\>\>$|\;$\>listexpr\\ -\>\>\>$|\;$\>id\\ -\>\>\>$|\;$\>seqex id\\ -\>\>seqex ::= \>\>{\tt While} prop {\tt Do} seqex\\ -\>\>\>$|\;$\>{\tt Repeat} seqex\\ -\>\>\>$|\;$\>{\tt Try} seqex\\ -\>\>\>$|\;$\>seqex {\tt Or} seqex\\ -\>\>\>$|\;$\>seqex {\tt @@} seqex\\ -\>\>\>$|\;$\>tac $($ id $|$ listexpr $)^*$\\ -\>\>type ::= id\\ -\>\>tac ::= id -\end{tabbing}} -where {\it id} is an identifier with the usual syntax, {\it prop} is a proposition constructed by Isabelles logical operators (see \cite{Isa-obj} {\tt [isabelle]/src/HOL/HOL.thy}), {\it listexpr} (called {\bf list-expression}) is constructed by Isabelles list functions like {\tt hd, tl, nth} described in {\tt [isabelle]/src/HOL/List.thy}, and {\it type} are (virtually) all types declared in Isabelles version 99. - -Expressions containing some of the keywords {\tt let}, {\tt if} etc. are called {\bf script-expressions}. - -Tactics {\it tac} are (curried) functions. For clarity and simplicity reasons, {\it listexpr} must not contain a {\it tac}, and {\it tac}s must not be nested, - - -\section{Control the flow of evaluation} -The flow of control is managed by the following script-expressions called {\it tacticals}. -\begin{description} -\item{{\tt while} prop {\tt Do} expr id} -\item{{\tt if} prop {\tt then} expr {\tt else} expr} -\end{description} -While the the above script-expressions trigger the flow of control by evaluating the current formula, the other expressions depend on the applicability of the tactics within their respective subexpressions (which in turn depends on the proofstate) -\begin{description} -\item{{\tt Repeat} expr id} -\item{{\tt Try} expr id} -\item{expr {\tt Or} expr id} -\item{expr {\tt @@} expr id} -\end{description} - -\begin{description} -\item xxx - -\end{description} - -\chapter{Do a calculational proof} -First we list all the tactics available so far (this list may be extended during further development of \isac). - -\section{Tactics for doing steps in calculations} -\input{tactics} - -\section{The functionality of the math engine} -A proof is being started in the math engine {\tt me} by the tactic -\footnote{In the present version a tactic is of type {\tt mstep}.} - {\tt Init\_Proof}, and interactively promoted by other tactics. On input of each tactic the {\tt me} returns the resulting formula and the next tactic applicable. The proof is finished, when the {\tt me} proposes {\tt End\_Proof} as the next tactic. - -We show a calculation (calculational proof) concerning equation solving, where the type of equation is refined automatically: The equation is given by the respective formalization ... -{\footnotesize\begin{verbatim} - ML> val fmz = ["equality ((x+#1)*(x+#2)=x^^^#2+#8)","solveFor x", - "errorBound (eps=#0)","solutions L"]; - val fmz = - ["equality ((x+#1)*(x+#2)=x^^^#2+#8)","solveFor x","errorBound (eps=#0)", - "solutions L"] : string list - ML> - ML> val spec as (dom, pbt, met) = ("SqRoot.thy",["univariate","equation"], - ("SqRoot.thy","no_met")); - val dom = "SqRoot.thy" : string - val pbt = ["univariate","equation"] : string list - val met = ("SqRoot.thy","no_met") : string * string -\end{verbatim}}%size -... and the specification {\tt spec} of a domain {\tt dom}, a problem type {\tt pbt} and a method {\tt met}. Note that the equation is such, that it is not immediatly clear, what type it is in particular (it could be a polynomial of degree 2; but, for sure, the type is some specialized type of a univariate equation). Thus, no method ({\tt no\_met}) can be specified for solving the problem. - -Nevertheless this specification is sufficient for automatically solving the equation --- the appropriate method will be found by refinement within the hierarchy of problem types. - - -\section{Initialize the calculation} -The start of a new proof requires the following initializations: The proof state is given by a proof tree {\tt ptree} and a position {\tt pos'}; both are empty at the beginning. The tactic {\tt Init\_Proof} is, like all other tactics, paired with an identifier of type {\tt string} for technical reasons. -{\footnotesize\begin{verbatim} - ML> val (mID,m) = ("Init_Proof",Init_Proof (fmz, (dom,pbt,met))); - val mID = "Init_Proof" : string - val m = - Init_Proof - (["equality ((x+#1)*(x+#2)=x^^^#2+#8)","solveFor x","errorBound (eps=#0)", - "solutions L"],("SqRoot.thy",[#,#],(#,#))) : mstep - ML> - ML> val (p,_,f,nxt,_,pt) = me (mID,m) e_pos' c EmptyPtree; - val p = ([],Pbl) : pos' - val f = Form' (PpcKF (0,EdUndef,0,Nundef,(#,#))) : mout - val nxt = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"]) - : string * mstep - val pt = - Nd - (PblObj - {branch=#,cell=#,env=#,loc=#,meth=#,model=#,origin=#,ostate=#,probl=#, - result=#,spec=#},[]) : ptree - \end{verbatim}}%size -The mathematics engine {\tt me} returns the resulting formula {\tt f} of type {\tt mout} (which in this case is a problem), the next tactic {\tt nxt}, and a new proof state ({\tt ptree}, {\tt pos'}). - -We can convince ourselves, that the problem is still empty, by increasing {\tt Compiler.Control.Print.printDepth}: -{\footnotesize\begin{verbatim} - ML> Compiler.Control.Print.printDepth:=8; (*4 default*) - val it = () : unit - ML> - ML> f; - val it = - Form' - (PpcKF - (0,EdUndef,0,Nundef, - (Problem [], - {Find=[Incompl "solutions []"], - Given=[Incompl "equality",Incompl "solveFor"],Relate=[], - Where=[False "matches (?a = ?b) e_"],With=[]}))) : mout -\end{verbatim}}%size -Recall, please, the format of a problem as presented in sect.\ref{pbl} on p.\pageref{pbl}; such an 'empty' problem can be found above encapsulated by several constructors containing additional data (necessary for the dialog guide, not relevant here).\\ - -{\it In the sequel we will omit output of the {\tt me} if it is not important for the respective context}.\\ - -In general, the dialog guide will hide the following two tactics {\tt Refine\_Tacitly} and {\tt Model\_Problem} from the user. -{\footnotesize\begin{verbatim} - ML> nxt; - val it = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"]) - : string * mstep - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val nxt = ("Model_Problem",Model_Problem ["normalize","univariate","equation"]) - : string * mstep - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; -\end{verbatim}}%size - - -\section{The phase of modeling} -comprises the input of the items of the problem; the {\tt me} can help by use of the formalization tacitly transferred by {\tt Init\_Proof}. In particular, the {\tt me} in general 'knows' the next promising tactic; the first one has been returned by the (hidden) tactic {\tt Model\_Problem}. - -{\footnotesize\begin{verbatim} - ML> nxt; - val it = - ("Add_Given",Add_Given "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)") - : string * mstep - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val nxt = ("Add_Given",Add_Given "solveFor x") : string * mstep - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val nxt = ("Add_Find",Add_Find "solutions L") : string * mstep - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val f = Form' (PpcKF (0,EdUndef,0,Nundef,(#,#))) : mout -\end{verbatim}}%size -\noindent Now the problem is 'modeled', all items are input. We convince ourselves by increasing {\tt Compiler.Control.Print.printDepth} once more. -{\footnotesize\begin{verbatim} - ML> Compiler.Control.Print.printDepth:=8; - ML> f; - val it = - Form' - (PpcKF - (0,EdUndef,0,Nundef, - (Problem [], - {Find=[Correct "solutions L"], - Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", - Correct "solveFor x"],Relate=[],Where=[],With=[]}))) : mout -\end{verbatim}}%size -%One of the input items is considered {\tt Superfluous} by the {\tt me} consulting the problem type {\tt ["univariate","equation"]}. The {\tt ErrorBound}, however, could become important in case the equation only could be solved by some iteration method. - -\section{The phase of specification} -This phase provides for explicit determination of the domain, the problem type, and the method to be used. In particular, the search for the appropriate problem type is being supported. There are two tactics for this purpose: {\tt Specify\_Problem} generates feedback on how a candidate of a problem type matches the current problem, and {\tt Refine\_Problem} provides help by the system, if the user gets lost. -{\footnotesize\begin{verbatim} -ML> nxt; - val it = ("Specify_Domain",Specify_Domain "SqRoot.thy") : string * mstep - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val nxt = - ("Specify_Problem",Specify_Problem ["normalize","univariate","equation"]) - : string * mstep - val pt = - Nd - (PblObj - {branch=#,cell=#,env=#,loc=#,meth=#,model=#,origin=#,ostate=#,probl=#, - result=#,spec=#},[]) : ptree -\end{verbatim}}%size -The {\tt me} is smart enough to know the appropriate problem type (transferred tacitly with {\tt Init\_Proof}). In order to challenge the student, the dialog guide may hide this information; then the {\tt me} works as follows. -{\footnotesize\begin{verbatim} - ML> val nxt = ("Specify_Problem", - Specify_Problem ["polynomial","univariate","equation"]); - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val f = Form' (PpcKF (0,EdUndef,0,Nundef,(#,#))) : mout - val nxt = - ("Refine_Problem",Refine_Problem ["normalize","univariate","equation"]) - : string * mstep - ML> - ML> val nxt = ("Specify_Problem", - Specify_Problem ["linear","univariate","equation"]); - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val f = - Form' - (PpcKF - (0,EdUndef,0,Nundef, - (Problem ["linear","univariate","equation"], - {Find=[Correct "solutions L"], - Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", - Correct "solveFor x"],Relate=[], - Where=[False - "matches (?a + ?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)"], - With=[]}))) : mout -\end{verbatim}}%size -Again assuming that the dialog guide hide the next tactic proposed by the {\tt me}, and the student gets lost, {\tt Refine\_Problem} always 'knows' the way out, if applied to the problem type {\tt["univariate","equation"]}. -{\footnotesize\begin{verbatim} - ML> val nxt = ("Refine_Problem", - Refine_Problem ["linear","univariate","equation - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val f = Problems (RefinedKF [NoMatch #]) : mout - ML> - ML> Compiler.Control.Print.printDepth:=9;f;Compiler.Control.Print.printDepth:=4; - val f = - Problems - (RefinedKF - [NoMatch - (["linear","univariate","equation"], - {Find=[Correct "solutions L"], - Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", - Correct "solveFor x"],Relate=[], - Where=[False - "matches (?a + ?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)"], - With=[]})]) : mout - ML> - ML> val nxt = ("Refine_Problem",Refine_Problem ["univariate","equation"]); - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val f = - Problems - (RefinedKF [Matches #,NoMatch #,NoMatch #,NoMatch #,NoMatch #,Matches #]) - : mout - ML> - ML> - ML> Compiler.Control.Print.printDepth:=9;f;Compiler.Control.Print.printDepth:=4; - val f = - Problems - (RefinedKF - [Matches - (["univariate","equation"], - {Find=[Correct "solutions L"], - Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", - Correct "solveFor x"],Relate=[], - Where=[Correct - With=[]}), - NoMatch - (["linear","univariate","equation"], - {Find=[Correct "solutions L"], - Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", - Correct "solveFor x"],Relate=[], - Where=[False - "matches (?a + ?b * x = #0) ((x + #1) * (x + #2) = x ^^^ #2 + #8)"], - With=[]}), - NoMatch - ... - ... - Matches - (["normalize","univariate","equation"], - {Find=[Correct "solutions L"], - Given=[Correct "equality ((x + #1) * (x + #2) = x ^^^ #2 + #8)", - Correct "solveFor x"],Relate=[],Where=[],With=[]})]) : mout -\end{verbatim}}%size -The tactic {\tt Refine\_Problem} returns all matches to problem types along the path traced in the problem hierarchy (anlogously to the authoring tool for refinement in sect.\ref{refine} on p.\pageref{refine}) --- a lot of information to be displayed appropriately in the hiearchy browser~! - -\section{The phase of solving} -This phase starts by invoking a method, which acchieves the normal form within two tactics, {\tt Rewrite rnorm\_equation\_add} and {\tt Rewrite\_Set SqRoot\_simplify}: -{\footnotesize\begin{verbatim} - ML> nxt; - val it = ("Apply_Method",Apply_Method ("SqRoot.thy","norm_univar_equation")) - : string * mstep - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val f = - Form' (FormKF (~1,EdUndef,1,Nundef,"(x + #1) * (x + #2) = x ^^^ #2 + #8")) - val nxt = - ("Rewrite", Rewrite - ("rnorm_equation_add","~ ?b =!= #0 ==> (?a = ?b) = (?a + #-1 * ?b = #0)")) - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val f = - Form' (FormKF (~1,EdUndef,1,Nundef, - "(x + #1) * (x + #2) + #-1 * (x ^^^ #2 + #8) = #0")) : mout - val nxt = ("Rewrite_Set",Rewrite_Set "SqRoot_simplify") : string * mstep - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val f = Form' (FormKF (~1,EdUndef,1,Nundef,"#-6 + #3 * x = #0")) : mout - val nxt = ("Subproblem",Subproblem ("SqRoot.thy",[#,#])) : string * mstep -\end{verbatim}}%size -Now the normal form {\tt \#-6 + \#3 * x = \#0} is the input to a subproblem, which again allows for specification of the type of equation, and the respective method: -{\footnotesize\begin{verbatim} - ML> nxt; - val it = ("Subproblem",Subproblem ("SqRoot.thy",["univariate","equation"])) - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val f = - Form' (FormKF - (~1,EdUndef,1,Nundef,"Subproblem (SqRoot.thy, [univariate, equation])")) - : mout - val nxt = ("Refine_Tacitly",Refine_Tacitly ["univariate","equation"]) - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val nxt = ("Model_Problem",Model_Problem ["linear","univariate","equation"]) -\end{verbatim}}%size -As required, the tactic {\tt Refine ["univariate","equation"]} selects the appropriate type of equation from the problem hierarchy, which can be seen by the tactic {\tt Model\_Problem ["linear","univariate","equation"]} prosed by the system. - -Again the whole phase of modeling and specification follows; we skip it here, and \isac's dialog guide may decide to do so as well. - - -\section{The final phase: check the post-condition} -The type of problems solved by \isac{} are so-called 'example construction problems' as shown above. The most characteristic point of such a problem is the post-condition. The handling of the post-condition in the given context is an open research question. - -Thus the post-condition is just mentioned, in our example for both, the problem and the subproblem: -{\footnotesize\begin{verbatim} - ML> nxt; - val it = ("Check_Postcond",Check_Postcond ["linear","univariate","equation"]) - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val f = Form' (FormKF (~1,EdUndef,1,Nundef,"[x = #2]")) : mout - val nxt = - ("Check_Postcond",Check_Postcond ["normalize","univariate","equation"]) - ML> - ML> val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val f = Form' (FormKF (~1,EdUndef,0,Nundef,"[x = #2]")) : mout - val nxt = ("End_Proof'",End_Proof') : string * mstep -\end{verbatim}}%size -The next tactic proposed by the system, {\tt End\_Proof'} indicates that the proof has finished successfully.\\ - -{\it The tactics proposed by the system need {\em not} be followed by the user; the user is free to choose other tactics, and the system will report, if this is applicable at the respective proof state, or not~! The reader may try out~!} - - - -\part{Systematic description} - - -\chapter{The structure of the knowledge base} - -\section{Tactics and data} -First we view the ME from outside, i.e. we regard tactics and relate them to the knowledge base (KB). W.r.t. the KB we address the atomic items which have to be implemented in detail by the authors of the KB -\footnote{Some of these items are fetched by the tactics from intermediate storage within the ME, and not directly from the KB.} -. The items are listed in alphabetical order in Tab.\ref{kb-items} on p.\pageref{kb-items}. -{\begin{table}[h] -\caption{Atomic items of the KB} \label{kb-items} -%\tabcolsep=0.3mm -\begin{center} -\def\arraystretch{1.0} -\begin{tabular}{lp{9.0cm}} -abbrevation & description \\ -\hline -&\\ -{\it calc\_list} -& associationlist of the evaluation-functions {\it eval\_fn}\\ -{\it eval\_fn} -& evaluation-function for numerals and for predicates coded in SML\\ -{\it eval\_rls } -& ruleset {\it rls} for simplifying expressions with {\it eval\_fn}s\\ -{\it fmz} -& formalization, i.e. a minimal formula representation of an example \\ -{\it met} -& a method, i.e. a datastructure holding all informations for the solving phase ({\it rew\_ord}, {\it scr}, etc.)\\ -{\it metID} -& reference to a {\it met}\\ -{\it op} -& operator as key to an {\it eval\_fn} in a {\it calc\_list}\\ -{\it pbl} -& problem, i.e. a node in the problem-hierarchy\\ -{\it pblID} -& reference to a {\it pbl}\\ -{\it rew\_ord} -& rewrite-order\\ -{\it rls} -& ruleset, i.e. a datastructure holding theorems {\it thm} and operators {\it op} for simplification (with a {\it rew\_ord})\\ -{\it Rrls} -& ruleset for 'reverse rewriting' (an \isac-technique generating stepwise rewriting, e.g. for cancelling fractions)\\ -{\it scr} -& script describing algorithms by tactics, part of a {\it met} \\ -{\it norm\_rls} -& special ruleset calculating a normalform, associated with a {\it thy}\\ -{\it spec} -& specification, i.e. a tripel ({\it thyID, pblID, metID})\\ -{\it subs} -& substitution, i.e. a list of variable-value-pairs\\ -{\it term} -& Isabelle term, i.e. a formula\\ -{\it thm} -& theorem\\ -{\it thy} -& theory\\ -{\it thyID} -& reference to a {\it thy} \\ -\end{tabular}\end{center}\end{table} -} -The relations between tactics and data items are shown in Tab.\ref{tac-kb}on p.\pageref{tac-kb}. -{\def\arraystretch{1.2} -\begin{table}[h] -\caption{Which tactic uses which KB's item~?} \label{tac-kb} -\tabcolsep=0.3mm -\begin{center} -\begin{tabular}{|ll||cccc|ccc|cccc|} \hline -tactic &input & & & &norm\_& &rew\_&rls &eval\_&eval\_&calc\_& \\ - & &thy &scr &Rrls&rls &thm &ord &Rrls&fn &rls &list &dsc\\ -\hline\hline -Init\_Proof - &fmz & x & & & x & & & & & & & x \\ - &spec & & & & & & & & & & & \\ -\hline -\multicolumn{13}{|l|}{model phase}\\ -\hline -Add\_* &term & x & & & x & & & & & & & x \\ -FormFK &model & x & & & x & & & & & & & x \\ -\hline -\multicolumn{13}{|l|}{specify phase}\\ -\hline -Specify\_Theory - &thyID & x & & & x & & & & x & x & & x \\ -Specify\_Problem - &pblID & x & & & x & & & & x & x & & x \\ -Refine\_Problem - &pblID & x & & & x & & & & x & x & & x \\ -Specify\_Method - &metID & x & & & x & & & & x & x & & x \\ -Apply\_Method - &metID & x & x & & x & & & & x & x & & x \\ -\hline -\multicolumn{13}{|l|}{solve phase}\\ -\hline -Rewrite,\_Inst - &thm & x & x & & & x &met & & x &met & & \\ -Rewrite, Detail - &thm & x & x & & & x &rls & & x &rls & & \\ -Rewrite, Detail - &thm & x & x & & & x &Rrls & & x &Rrls & & \\ -Rewrite\_Set,\_Inst - &rls & x & x & & & & & x & x & x & & \\ -Calculate - &op & x & x & & & & & & & & x & \\ -Substitute - &subs & x & & & x & & & & & & & \\ - & & & & & & & & & & & & \\ -SubProblem - &spec & x & x & & x & & & & x & x & & x \\ - &fmz & & & & & & & & & & & \\ -\hline -\end{tabular}\end{center}\end{table} -} - -\section{\isac's theories} -\isac's theories build upon Isabelles theories for high-order-logic (HOL) up to the respective development of real numbers ({\tt HOL/Real}). Theories have a special format defined in \cite{Isa-ref} and the suffix {\tt *.thy}; usually theories are paired with SML-files having the same filename and the suffix {\tt *.ML}. - -\isac's theories represent the deductive part of \isac's knowledge base, the hierarchy of theories is structured accordingly. The {\tt *.ML}-files, however, contain {\em all} data of the other two axes of the knowledge base, the problems and the methods (without presenting their respective structure, which is done by the problem browser and the method browser, see \ref{pbt}). - -Tab.\ref{theories} on p.\pageref{theories} lists the basic theories planned to be implemented in version \isac.1. We expext the list to be expanded in the near future, actually, have a look to the theory browser~! - -The first three theories in the list do {\em not} belong to \isac's knowledge base; they are concerned with \isac's script-language for methods and listed here for completeness. -{\begin{table}[h] -\caption{Theories in \isac-version I} \label{theories} -%\tabcolsep=0.3mm -\begin{center} -\def\arraystretch{1.0} -\begin{tabular}{lp{9.0cm}} -theory & description \\ -\hline -&\\ -ListI.thy -& assigns identifiers to the functions defined in {\tt Isabelle2002/src/HOL/List.thy} and (intermediatly~?) defines some more list functions\\ -ListI.ML -& {\tt eval\_fn} for the additional list functions\\ -Tools.thy -& functions required for the evaluation of scripts\\ -Tools.ML -& the respective {\tt eval\_fn}s\\ -Script.thy -& prerequisites for scripts: types, tactics, tacticals,\\ -Script.ML -& sets of tactics and functions for internal use\\ -& \\ -\hline -& \\ -Typefix.thy -& an intermediate hack for escaping type errors\\ -Descript.thy -& {\it description}s for the formulas in {\it model}s and {\it problem}s\\ -Atools -& (re-)definition of operators; general predicates and functions for preconditions; theorems for the {\tt eval\_rls}\\ -Float -& floating point numerals\\ -Equation -& basic notions for equations and equational systems\\ -Poly -& polynomials\\ -PolyEq -& polynomial equations and equational systems \\ -Rational.thy -& additional theorems for rationals\\ -Rational.ML -& cancel, add and simplify rationals using (a generalization of) Euclids algorithm; respective reverse rulesets\\ -RatEq -& equations on rationals\\ -Root -& radicals; calculate normalform; respective reverse rulesets\\ -RootEq -& equations on roots\\ -RatRootEq -& equations on rationals and roots (i.e. on terms containing both operations)\\ -Vect -& vector analysis\\ -Trig -& trigonometriy\\ -LogExp -& logarithms and exponential functions\\ -Calculus -& nonstandard analysis\\ -Diff -& differentiation\\ -DiffApp -& applications of differentiaten (maxima-minima-problems)\\ -Test -& (old) data for the test suite\\ -Isac -& collects all \isac-theoris.\\ -\end{tabular}\end{center}\end{table} -} - - -\section{Data in {\tt *.thy}- and {\tt *.ML}-files} -As already mentioned, theories come in pairs of {\tt *.thy}- and {\tt *.ML}-files with the same respective filename. How data are distributed between the two files is shown in Tab.\ref{thy-ML} on p.\pageref{thy-ML}. -{\begin{table}[h] -\caption{Data in {\tt *.thy}- and {\tt *.ML}-files} \label{thy-ML} -\tabcolsep=2.0mm -\begin{center} -\def\arraystretch{1.0} -\begin{tabular}{llp{7.7cm}} -file & data & description \\ -\hline -& &\\ -{\tt *.thy} -& consts -& operators, predicates, functions, script-names ('{\tt Script} name \dots{\tt arguments}') -\\ -& rules -& theorems: \isac{} uses Isabelles theorems if possible; additional theorems analoguous to such existing in Isabelle get the Isabelle-identifier attached an {\it I} -\\& &\\ -{\tt *.ML} -& {\tt theory' :=} -& the theory defined by the actual {\tt *.thy}-file is made accessible to \isac -\\ -& {\tt eval\_fn} -& evaluation function for operators and predicates, coded on the meta-level (SML); the identifier of such a function is a combination of the keyword {\tt eval\_} with the identifier of the function as defined in {\tt *.thy} -\\ -& {\tt *\_simplify} -& the canonical simplifier for the actual theory, i.e. the identifier for this ruleset is a combination of the theories identifier and the keyword {\tt *\_simplify} -\\ -& {\tt norm\_rls :=} -& the canonical simplifier {\tt *\_simplify} is stored such that it is accessible for \isac -\\ -& {\tt rew\_ord' :=} -& the same for rewrite orders, if needed outside of one particular ruleset -\\ -& {\tt ruleset' :=} -& the same for rulesets (ordinary rulesets, reverse rulesets and {\tt eval\_rls}) -\\ -& {\tt calc\_list :=} -& the same for {\tt eval\_fn}s, if needed outside of one particular ruleset (e.g. for a tactic {\tt Calculate} in a script) -\\ -& {\tt store\_pbl} -& problems defined within this {\tt *.ML}-file are made accessible for \isac -\\ -& {\tt methods :=} -& methods defined within this {\tt *.ML}-file are made accessible for \isac -\\ -\end{tabular}\end{center}\end{table} -} -The order of the data-items within the theories should adhere to the order given in this list. - -\section{Formal description of the problem-hierarchy} -%for Richard Lang - -\section{Script tactics} -The tactics actually promote the calculation: they construct the prooftree behind the scenes, and they are the points during evaluation where the script-interpreter transfers control to the user. Here we only describe the sytax of the tactics; the semantics is described on p.\pageref{user-tactics} below in context with the tactics the student uses ('user-tactics'): there is a 1-to-1 correspondence between user-tactics and script-tactics. - - - - - -\part{Authoring on the knowledge} - - -\section{Add a theorem} -\section{Define and add a problem} -\section{Define and add a predicate} -\section{Define and add a method} -\section{} -\section{} -\section{} -\section{} - - - -\newpage -\bibliography{bib/isac,bib/from-theses} - -\end{document} \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/mat-eng.sml --- a/src/Doc/isac/mat-eng.sml Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,519 +0,0 @@ -(* cut and paste for math.tex -*) - -(*2.2. *) -"a + b * 3"; -str2term "a + b * 3"; -val term = str2term "a + b * 3"; -atomt term; -atomty term; - -(*2.3. Theories and parsing*) - - > Isac.thy; -val it = - {ProtoPure, CPure, HOL, Set, Typedef, Fun, Product_Type, Lfp, Gfp, - Sum_Type, Relation, Record, Inductive, Transitive_Closure, - Wellfounded_Recursion, NatDef, Nat, NatArith, Divides, Power, - SetInterval, Finite_Set, Equiv, IntDef, Int, Datatype_Universe, - Datatype, Numeral, Bin, IntArith, Wellfounded_Relations, Recdef, IntDiv, - IntPower, NatBin, NatSimprocs, Relation_Power, PreList, List, Map, - Hilbert_Choice, Main, Lubs, PNat, PRat, PReal, RealDef, RealOrd, - RealInt, RealBin, RealArith0, RealArith, RComplete, RealAbs, RealPow, - Ring_and_Field, Complex_Numbers, Real, ListG, Tools, Script, Typefix, - Float, ComplexI, Descript, Atools, Simplify, Poly, Rational, PolyMinus, - Equation, LinEq, Root, RootEq, RatEq, RootRat, RootRatEq, PolyEq, Vect, - Calculus, Trig, LogExp, Diff, DiffApp, Integrate, EqSystem, Biegelinie, - AlgEin, Test, Isac} : Theory.theory - -Group.thy -suche nach '*' Link: http://www.cl.cam.ac.uk/research/hvg/Isabelle/dist/library/HOL/Groups.html -locale semigroup = - fixes f :: "'a => 'a => 'a" (infixl "*" 70) - assumes assoc [ac_simps]: "a * b * c = a * (b * c)" - -> parse; -val it = fn : Theory.theory -> string -> Thm.cterm Library.option - - - -> (*-1-*); -> parse HOL.thy "2^^^3"; -*** Inner lexical error at: "^^^3" -val it = None : Thm.cterm Library.option -> (*-2-*); -> parse HOL.thy "d_d x (a + x)"; -val it = None : Thm.cterm Library.option -> (*-3-*); -> parse Rational.thy "2^^^3"; -val it = Some "2 ^^^ 3" : Thm.cterm Library.option -> (*-4-*); -val Some t4 = parse Rational.thy "d_d x (a + x)"; -val t4 = "d_d x (a + x)" : Thm.cterm -> (*-5-*); -val Some t5 = parse Diff.thy "d_d x (a + x)"; -val t5 = "d_d x (a + x)" : Thm.cterm - - -> term_of; -val it = fn : Thm.cterm -> Term.term -> term_of t4; -val it = - Free ("d_d", "[RealDef.real, RealDef.real] => RealDef.real") $ - Free ("x", "RealDef.real") $ - (Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $ - Free ("a", "RealDef.real") $ Free ("x", "RealDef.real")) -: Term.term -> term_of t5; -val it = - Const ("Diff.d_d", "[RealDef.real, RealDef.real] => RealDef.real") $ - Free ("x", "RealDef.real") $ - (Const ("op +", "[RealDef.real, RealDef.real] => RealDef.real") $ - Free ("a", "RealDef.real") $ Free ("x", "RealDef.real")) -: Term.term - -> print_depth; -val it = fn : int -> unit - - - - - -> (*-4-*) val thy = Rational.thy; -val thy = - {ProtoPure, CPure, HOL, Set, Typedef, Fun, Product_Type, Lfp, Gfp, - Sum_Type, Relation, Record, Inductive, Transitive_Closure, - Wellfounded_Recursion, NatDef, Nat, NatArith, Divides, Power, - SetInterval, Finite_Set, Equiv, IntDef, Int, Datatype_Universe, - Datatype, Numeral, Bin, IntArith, Wellfounded_Relations, Recdef, IntDiv, - IntPower, NatBin, NatSimprocs, Relation_Power, PreList, List, Map, - Hilbert_Choice, Main, Lubs, PNat, PRat, PReal, RealDef, RealOrd, - RealInt, RealBin, RealArith0, RealArith, RComplete, RealAbs, RealPow, - Ring_and_Field, Complex_Numbers, Real, ListG, Tools, Script, Typefix, - Float, ComplexI, Descript, Atools, Simplify, Poly, Rational} -: Theory.theory -> ((atomty) o term_of o the o (parse thy)) "d_d x (a + x)"; - -*** -*** Free (d_d, [real, real] => real) -*** . Free (x, real) -*** . Const (op +, [real, real] => real) -*** . . Free (a, real) -*** . . Free (x, real) -*** - -val it = () : unit -> (*-5-*) val thy = Diff.thy; -val thy = - {ProtoPure, CPure, HOL, Set, Typedef, Fun, Product_Type, Lfp, Gfp, - Sum_Type, Relation, Record, Inductive, Transitive_Closure, - Wellfounded_Recursion, NatDef, Nat, NatArith, Divides, Power, - SetInterval, Finite_Set, Equiv, IntDef, Int, Datatype_Universe, - Datatype, Numeral, Bin, IntArith, Wellfounded_Relations, Recdef, IntDiv, - IntPower, NatBin, NatSimprocs, Relation_Power, PreList, List, Map, - Hilbert_Choice, Main, Lubs, PNat, PRat, PReal, RealDef, RealOrd, - RealInt, RealBin, RealArith0, RealArith, RComplete, RealAbs, RealPow, - Ring_and_Field, Complex_Numbers, Real, Calculus, Trig, ListG, Tools, - Script, Typefix, Float, ComplexI, Descript, Atools, Simplify, Poly, - Equation, LinEq, Root, RootEq, Rational, RatEq, RootRat, RootRatEq, - PolyEq, LogExp, Diff} : Theory.theory - -> ((atomty) o term_of o the o (parse thy)) "d_d x (a + x)"; - -*** -*** Const (Diff.d_d, [real, real] => real) -*** . Free (x, real) -*** . Const (op +, [real, real] => real) -*** . . Free (a, real) -*** . . Free (x, real) -*** - -val it = () : unit - - - -> print_depth 1; -val it = () : unit -> term_of t4; -val it = - Free ("d_d", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $ ... -: Term.term - - -> print_depth 1; -val it = () : unit -> term_of t5; -val it = - Const ("Diff.d_d", "[RealDef.real, RealDef.real] => RealDef.real") $ ... $ - ... : Term.term - - - --------------------------------------------ALT... -explode it; - \footnote{ - print_depth 9; - explode "a + b * 3"; - } - -(*unschoen*) - --------------------------------------------ALT... - HOL.thy; - parse; - parse thy "a + b * 3"; - val t = (term_of o the) it; - term_of; - -(*2.3. Displaying terms*) - print_depth; - ////Compiler.Control.Print.printDepth; -? Compiler.Control.Print.printDepth:= 2; - t; - ?Compiler.Control.Print.printDepth:= 6; - t; - ?Compiler.Control.Print.printLength; - ?Compiler.Control.Print.stringDepth; - atomt; - atomt t; - atomty; - atomty thy t; -(*Give it a try: the mathematics knowledge grows*) - parse HOL.thy "2^^^3"; - parse HOL.thy "d_d x (a + x)"; - ?parse RatArith.thy "#2^^^#3"; - ?parse RatArith.thy "d_d x (a + x)"; - parse Differentiate.thy "d_d x (a + x)"; - ?parse Differentiate.thy "#2^^^#3"; -(*don't trust the string representation*) - ?val thy = RatArith.thy; - ((atomty thy) o term_of o the o (parse thy)) "d_d x (a + x)"; - ?val thy = Differentiate.thy; - ((atomty thy) o term_of o the o (parse thy)) "d_d x (a + x)"; - -(*2.4. Converting terms*) - term_of; - the; - val t = (term_of o the o (parse thy)) "a + b * 3"; - - sign_of; - cterm_of; - val ct = cterm_of (sign_of thy) t; - - Sign.string_of_term; - Sign.string_of_term (sign_of thy) t; - - string_of_cterm; - string_of_cterm ct; - -(*2.5. Theorems *) - ?theorem' := overwritel (!theorem', - [("diff_const",num_str diff_const) - ]); - -(** 3. Rewriting **) -(*3.1. The arguments for rewriting*) - HOL.thy; - "HOL.thy" : theory'; - sqrt_right; - "sqrt_right" : rew_ord'; - eval_rls; - "eval_rls" : rls'; - diff_sum; - ("diff_sum", "") : thm'; - -(*3.2. The functions for rewriting*) - rewrite_; - rewrite; - -> val thy' = "Diff.thy"; -val thy' = "Diff.thy" : string -> val ct = "d_d x (a * 3 + b)"; -val ct = "d_d x (a * 3 + b)" : string -> val thm = ("diff_sum",""); -val thm = ("diff_sum", "") : string * string -> val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true - [("bdv","x::real")] thm ct; -val ct = "d_d x (a * 3) + d_d x b" : cterm' -> val thm = ("diff_prod_const",""); -val thm = ("diff_prod_const", "") : string * string -> val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true - [("bdv","x::real")] thm ct; -val ct = "a * d_d x 3 + d_d x b" : cterm' - - - -> val thy' = "Diff.thy"; -val thy' = "Diff.thy" : string -> val ct = "d_d x (a + a * (2 + b))"; -val ct = "d_d x (a + a * (2 + b))" : string -> val thm = ("diff_sum",""); -val thm = ("diff_sum", "") : string * string -> val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true - [("bdv","x::real")] thm ct; -val ct = "d_d x a + d_d x (a * (2 + b))" : cterm' - -> val thm = ("diff_prod_const",""); -val thm = ("diff_prod_const", "") : string * string -> val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true - [("bdv","x::real")] thm ct; -val ct = "d_d x a + a * d_d x (2 + b)" : cterm' - - - -(*Give it a try: rewriting*) - val thy' = "Diff.thy"; - val ct = "d_d x (x ^^^ 2 + 3 * x + 4)"; - val thm = ("diff_sum",""); - val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true [("bdv","x::real")] thm ct; - val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true [("bdv","x::real")] thm ct; - val thm = ("diff_prod_const",""); - val Some (ct,_) = rewrite_inst thy' "tless_true" "eval_rls" true [("bdv","x::real")] thm ct; -(*Give it a try: conditional rewriting*) - val thy' = "Isac.thy"; - val ct' = "3 * a + 2 * (a + 1)"; - val thm' = ("radd_mult_distrib2","?k * (?m + ?n) = ?k * ?m + ?k * ?n"); - (*1*) val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; - val thm' = ("radd_assoc_RS_sym","?m1 + (?n1 + ?k1) = ?m1 + ?n1 + ?k1"); - ?(*2*) val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; - ?val thm' = ("rcollect_right", - "[| ?l is_const; ?m is_const |] ==> ?l * ?n + ?m * ?n = (?l + ?m) * ?n"); - ?(*3*) val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; - ?(*4*) val Some (ct',_) = calculate thy' "plus" ct'; - ?(*5*) val Some (ct',_) = calculate thy' "times" ct'; - -(*Give it a try: functional programming*) - val thy' = "InsSort.thy"; - val ct = "sort [#1,#3,#2]" : cterm'; - - val thm = ("sort_def",""); - ?val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); - - val thm = ("foldr_rec",""); - ?val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); - - val thm = ("ins_base",""); - ?val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); - - val thm = ("foldr_rec",""); - ?val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); - - val thm = ("ins_rec",""); - ?val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); - - ?val (ct,_) = the (calculate thy' "le" ct); - - val thm = ("if_True","(if True then ?x else ?y) = ?x"); - ?val (ct,_) = the (rewrite thy' "tless_true" "eval_rls" false thm ct); - -(*3.3. Variants of rewriting*) - rewrite_inst_; - rewrite_inst; - - rewrite_set_; - rewrite_set; - - rewrite_set_inst_; - rewrite_set_inst; - - toggle; - toggle trace_rewrite; - -(*3.4. Rule sets*) - sym; - rearrange_assoc; - -(*Give it a try: remove parentheses*) - ?val ct = (string_of_cterm o the o (parse RatArith.thy)) - "a + (b * (c * d) + e)"; - ?rewrite_set "RatArith.thy" "eval_rls" false "rearrange_assoc" ct; - - toggle trace_rewrite; - ?rewrite_set "RatArith.thy" "eval_rls" false "rearrange_assoc" ct; - -(*3.5. Calculate numeric constants*) - calculate; - calculate_; - - ?calc_list; - ?calculate "Isac.thy" "plus" "#1 + #2"; - ?calculate "Isac.thy" "times" "#2 * #3"; - ?calculate "Isac.thy" "power" "#2 ^^^ #3"; - ?calculate "Isac.thy" "cancel_" "#9 // #12"; - - -(** 4. Term orders **) -(*4.1. Exmpales for term orders*) - sqrt_right; - tless_true; - - val t1 = (term_of o the o (parse thy)) "(sqrt a) + b"; - val t2 = (term_of o the o (parse thy)) "b + (sqrt a)"; - ?sqrt_right false SqRoot.thy (t1, t2); - ?sqrt_right false SqRoot.thy (t2, t1); - - val t1 = (term_of o the o (parse thy)) "a + b*(sqrt c) + d"; - val t2 = (term_of o the o (parse thy)) "a + (sqrt b)*c + d"; - ?sqrt_right true SqRoot.thy (t1, t2); - -(*4.2. Ordered rewriting*) - ac_plus_times; - -(*Give it a try: polynomial (normal) form*) - val ct' = "#3 * a + b + #2 * a"; - val thm' = ("radd_commute","") : thm'; - ?val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; - val thm' = ("rdistr_right_assoc_p","") : thm'; - ?val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; - ?val Some (ct',_) = calculate thy' "plus" ct'; - - val ct' = "3 * a + b + 2 * a" : cterm'; - val thm' = ("radd_commute","") : thm'; - ?val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; - ?val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; - ?val Some (ct',_) = rewrite thy' "tless_true" "eval_rls" true thm' ct'; - - toggle trace_rewrite; - ?rewrite_set "RatArith.thy" "eval_rls" false "ac_plus_times" ct; - - -(** 5. The hierarchy of problem types **) -(*5.1. The standard-function for 'matching'*) - matches; - - val t = (term_of o the o (parse thy)) "3 * x^^^2 = 1"; - val p = (term_of o the o (parse thy)) "a * b^^^2 = c"; - atomt p; - free2var; - val pat = free2var p; - matches thy t pat; - - val t2 = (term_of o the o (parse thy)) "x^^^2 = 1"; - matches thy t2 pat; - - val pat2 = (term_of o the o (parse thy)) "?u^^^2 = ?v"; - matches thy t2 pat2; - -(*5.2. Accessing the hierarchy*) - show_ptyps; - show_ptyps(); - get_pbt; - ?get_pbt ["squareroot", "univariate", "equation"]; - - store_pbt; - ?store_pbt - (prep_pbt SqRoot.thy - (["newtype","univariate","equation"], - [("#Given" ,["equality e_","solveFor v_","errorBound err_"]), - ("#Where" ,["contains_root (e_::bool)"]), - ("#Find" ,["solutions v_i_"]) - ], - [("SqRoot.thy","square_equation")])); - show_ptyps(); - -(*5.3. Internals of the datastructure*) -(*5.4. Match a problem with a problem type*) - ?val fmz = ["equality (#1 + #2 * x = #0)", - "solveFor x", - "solutions L"] : fmz; - match_pbl; - ?match_pbl fmz (get_pbt ["univariate","equation"]); - ?match_pbl fmz (get_pbt ["linear","univariate","equation"]); - ?match_pbl fmz (get_pbt ["squareroot","univariate","equation"]); - -(*5.5. Refine a problem specification *) - refine; - ?val fmz = ["equality (sqrt(#9+#4*x)=sqrt x + sqrt(#5+x))", - "solveFor x","errorBound (eps=#0)", - "solutions L"]; - ?refine fmz ["univariate","equation"]; - - ?val fmz = ["equality (x+#1=#2)", - "solveFor x","errorBound (eps=#0)", - "solutions L"]; - ?refine fmz ["univariate","equation"]; - - -(* 6. Do a calculational proof *) - ?val fmz = ["equality ((x+#1) * (x+#2) = x^^^#2+#8)","solveFor x", - "errorBound (eps=#0)","solutions L"]; - val spec as (dom, pbt, met) = ("SqRoot.thy",["univariate","equation"], - ("SqRoot.thy","no_met")); - -(*6.1. Initialize the calculation*) - val p = e_pos'; val c = []; - ?val (mID,m) = ("Init_Proof",Init_Proof (fmz, (dom,pbt,met))); - ?val (p,_,f,nxt,_,pt) = me (mID,m) p c EmptyPtree; - - ?Compiler.Control.Print.printDepth:=8; - ?f; - ?Compiler.Control.Print.printDepth:=4; - - ?nxt; - ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - -(*6.2. The phase of modeling*) - ?nxt; - ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - - ?Compiler.Control.Print.printDepth:=8; - ?f; - ?Compiler.Control.Print.printDepth:=4; - -(*6.3. The phase of specification*) - ?nxt; - ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - - - val nxt = ("Specify_Problem", - Specify_Problem ["polynomial","univariate","equation"]); - ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - - val nxt = ("Specify_Problem", - Specify_Problem ["linear","univariate","equation"]); - ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - ?Compiler.Control.Print.printDepth:=8;f;Compiler.Control.Print.printDepth:=4; - - val nxt = ("Refine_Problem", - Refine_Problem ["linear","univariate","equation"]); - ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - ?Compiler.Control.Print.printDepth:=9;f;Compiler.Control.Print.printDepth:=4; - - val nxt = ("Refine_Problem",Refine_Problem ["univariate","equation"]); - ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - ?Compiler.Control.Print.printDepth:=9;f;Compiler.Control.Print.printDepth:=4; - - ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - -(*6.4. The phase of solving*) - nxt; - ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - - val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - -(*6.5. The final phase: check the postcondition*) - ?val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - val (p,_,f,nxt,_,pt) = me nxt p [1] pt; - - - - - - diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/mlehnfeld/bib.bib --- a/src/Doc/isac/mlehnfeld/bib.bib Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -@Book{Nipkow-Paulson-Wenzel:2002, - author = {Tobias Nipkow and Lawrence C. Paulson and Markus Wenzel}, - title = {{Isabelle/HOL} --- A Proof Assistant for Higher-Order Logic}, - publisher = {Springer}, - series = {LNCS}, - volume = 2283, - year = 2002} - -@Article{plmms10, - author = {Florian Haftmann and Cezary Kaliszyk and Walther Neuper}, - title = {{CTP}-based programming languages~? Considerations about an experimental design}, - journal = {ACM Communications in Computer Algebra}, - year = {2010}, - volume = {44}, - number = {1/2}, - pages = {27-41}, - doi = {10.1145/1838599.1838621} -} - -@Manual{isar-impl, - title = {The {Isabelle/Isar} Implementation}, - author = {Makarius Wenzel}, - month = {30 January}, - year = {2011}, - note = {With contributions by Florian Haftmann and Larry Paulson} -} diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/mlehnfeld/overview.odg Binary file src/Doc/isac/mlehnfeld/overview.odg has changed diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/mlehnfeld/presentation.tex --- a/src/Doc/isac/mlehnfeld/presentation.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,469 +0,0 @@ -% $Header: /cvsroot/latex-beamer/latex-beamer/solutions/conference-talks/conference-ornate-20min.en.tex,v 1.7 2007/01/28 20:48:23 tantau Exp $ - -\documentclass{beamer} - -% This file is a solution template for: - -% - Talk at a conference/colloquium. -% - Talk length is about 20min. -% - Style is ornate. - - - -% Copyright 2004 by Till Tantau . -% -% In principle, this file can be redistributed and/or modified under -% the terms of the GNU Public License, version 2. -% -% However, this file is supposed to be a template to be modified -% for your own needs. For this reason, if you use this file as a -% template and not specifically distribute it as part of a another -% package/program, I grant the extra permission to freely copy and -% modify this file as you see fit and even to delete this copyright -% notice. - - -\mode -{ - \usetheme{Hannover} - % or ... - - \setbeamercovered{transparent} - % or whatever (possibly just delete it) -} - -%\usepackage{setspace} %for "\begin{onehalfspace}" -\usepackage[english]{babel} -% or whatever - -\usepackage[utf8]{inputenc} -% or whatever - -\usepackage{times} -\usepackage[T1]{fontenc} -% Or whatever. Note that the encoding and the font should match. If T1 -% does not look nice, try deleting the line with the fontenc. - -\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} -\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} - -\title[\isac: Computation \& Deduction] % (optional, use only with long paper titles) -{Integrating Computation and Deduction\\ - in the \isac-System} - -\subtitle{Projektpraktikum: Introducing Isabelle's Contexts} - -\author[Lehnfeld] % (optional, use only with lots of authors) -{Mathias~Lehnfeld} -% - Give the names in the same order as the appear in the paper. -% - Use the \inst{?} command only if the authors have different -% affiliation. - -\institute % (optional, but mostly needed) -{ - Vienna University of Technology\\ - Institute of Computer Languages -} -% - Use the \inst command only if there are several affiliations. -% - Keep it simple, no one is interested in your street address. - -% \date[CFP 2003] % (optional, should be abbreviation of conference name) -% {Conference on Fabulous Presentations, 2003} -% - Either use conference name or its abbreviation. -% - Not really informative to the audience, more for people (including -% yourself) who are reading the slides online - -% \subject{Theoretical Computer Science} -% This is only inserted into the PDF information catalog. Can be left -% out. - - - -% If you have a file called "university-logo-filename.xxx", where xxx -% is a graphic format that can be processed by latex or pdflatex, -% resp., then you can add a logo as follows: - -% \pgfdeclareimage[height=0.5cm]{university-logo}{university-logo-filename} -% \logo{\pgfuseimage{university-logo}} - - - -% Delete this, if you do not want the table of contents to pop up at -% the beginning of each subsection: -\AtBeginSubsection[] -{ - \begin{frame}{Outline} - \tableofcontents[currentsection,currentsubsection] - \end{frame} -} - - -% If you wish to uncover everything in a step-wise fashion, uncomment -% the following command: - -%\beamerdefaultoverlayspecification{<+->} - - -\begin{document} - -\begin{frame} - \titlepage -\end{frame} - -\begin{frame}{Outline} - \tableofcontents - % You might wish to add the option [pausesections] -\end{frame} - - -% Structuring a talk is a difficult task and the following structure -% may not be suitable. Here are some rules that apply for this -% solution: - -% - Exactly two or three sections (other than the summary). -% - At *most* three subsections per section. -% - Talk about 30s to 2min per frame. So there should be between about -% 15 and 30 frames, all told. - -% - A conference audience is likely to know very little of what you -% are going to talk about. So *simplify*! -% - In a 20min talk, getting the main ideas across is hard -% enough. Leave out details, even if it means being less precise than -% you think necessary. -% - If you omit details that are vital to the proof/implementation, -% just say so once. Everybody will be happy with that. - -\section[Introduction]{Introduction: Isabelle and \isac} -%\subsection[Isabelle \& \isac]{Isabelle and \isac} -\begin{frame} - \frametitle{Isabelle and \isac} -The task of this ``Projektpraktikum'' (6 ECTS) was to -\begin{itemize} -\item study the concept of ``context'' in the theorem prover \textbf{Isabelle} from TU Munich -\item study basic concepts of the math assistant \sisac{} from TU Graz -\pause -\item redesign \sisac{} with respect to contexts - \begin{itemize} - \item use contexts for type inference of user input - \item handle preconditions of specifications - \item clarify the transfer of context data from sub-programs to the calling program - \end{itemize} -\pause -\item introduce contexts to \sisac{} according to the new design -\item use the coding standards of Isabelle2011 for new code. -\end{itemize} -\end{frame} - -%\subsection[Computation \& Deduction]{Computation and Deduction in a Lucas-Interpreter} -\begin{frame} - \frametitle{Computation and Deduction in a Lucas-Interpreter} - \includegraphics[width=100mm]{overview.pdf} -\end{frame} - -\section[Contributions]{Contributions of the project to \isac} -\subsection[Contexts]{Isabelle's Contexts, advantages and use} -\begin{frame} - \frametitle{Advantages of Isabelle's Contexts} -Isabelle's context replaced theories because \dots: -\begin{itemize} -\item theories are static containers of \textit{all} logical data -\item contexts are \textit{dynamic} containers of logical data: - \begin{itemize} - \item functions for storing and retrieving various logical data - \item functions for type inference - \item provide data for Isabelle's automated provers - \end{itemize} -%\item e.g. theories have no direct functions for type inference -%\item replace function \texttt{parseNEW} -%\item assumptions \& environment $\rightarrow$ context -\item allow to conform with scopes for subprograms. -\end{itemize} -\end{frame} - -\begin{frame} - \frametitle{Isabelle's context mechanism} - \texttt{\small{ - \begin{tabbing} -xx\=xx\=in\=\kill -%xx\=xx\=xx\=xx\=\kill -%datatype Isac\_Ctxt =\\ -%\>\>Env of term * term\\ -%\>| Asm of term;\\ -%\\ -structure ContextData = \alert{Proof\_Data}\\ -\>~(\alert{type T} = term list\\ -\>\>\alert{fun init \_} = []);\\ -\\ -%local\\ -%\>fun insert\_ctxt data = ContextData\alert{.map} (fn xs => distinct (data@xs));\\ -%in\\ -%\>fun insert\_assumptions asms = map (fn t => Asm t) asms |> insert\_ctxt;\\ -%\>fun insert\_environments envs = map (fn t => Env t) envs |> insert\_ctxt;\\ -%end\\ -fun insert\_assumptions asms = \\ -\>\>\>ContextData\alert{.map} (fn xs => distinct (asms@xs));\\ -\\ -%local\\ -%\>fun unpack\_asms (Asm t::ts) = t::(unpack\_asms ts)\\ -%\>\>| unpack\_asms (Env \_::ts) = unpack\_asms ts\\ -%\>\>| unpack\_asms [] = [];\\ -%\>fun unpack\_envs (Env t::ts) = t::(unpack\_envs ts)\\ -%\>\>| unpack\_envs (Asm \_::ts) = unpack\_envs ts\\ -%\>\>| unpack\_envs [] = [];\\ -%in\\ -%\>fun get\_assumptions ctxt = ContextData.get ctxt |> unpack\_asms;\\ -%\>fun get\_environments ctxt = ContextData.get ctxt |> unpack\_envs;\\ -%end -fun get\_assumptions ctxt = ContextData\alert{.get} ctxt;\\ -\\ -\\ -val declare\_constraints : \\ -\>\>\>term -> Proof.context -> Proof.context - \end{tabbing} - }} -\end{frame} - -\begin{frame} - \frametitle{Usage of Contexts} - \texttt{\footnotesize{ - \begin{tabbing} -xx\=xx\=xx\=xx\=xx\=\kill -fun transfer\_asms\_from\_to from\_ctxt to\_ctxt =\\ -\> let\\ -\>\> val to\_vars = get\_assumptions to\_ctxt |> map vars |> flat\\ -\>\> fun transfer [] to\_ctxt = to\_ctxt\\ -\>\>\> | transfer (from\_asm::fas) to\_ctxt =\\ -\>\>\>\>\> if inter op = (vars from\_asm) to\_vars = []\\ -\>\>\>\>\> then transfer fas to\_ctxt\\ -\>\>\>\>\> else transfer fas (insert\_assumptions [from\_asm] to\_ctxt)\\ -\> in transfer (get\_assumptions from\_ctxt) to\_ctxt end\\ -\\ -fun parse thy str =\\ -\>(let val t = (\alert{typ\_a2real} o numbers\_to\_string)\\ -\>\>\>\>(\alert{Syntax.read\_term\_global thy} str)\\ -\>\>in SOME (cterm\_of thy t) end)\\ -\>\>\>handle \_ => NONE;\\ -\\ -fun parseNEW ctxt str = \\ -\>\>\>SOME (\alert{Syntax.read\_term ctxt} str |> numbers\_to\_string)\\ -\>\>\>handle \_ => NONE; - \end{tabbing} - }} - - -\end{frame} - -\subsection[Redesign]{Redesign of \isac{} using contexts} -\begin{frame} - \frametitle{Redesign of \isac{} using contexts} -\begin{center} DEMO \end{center} -\end{frame} - -\begin{frame} - \frametitle{Deduction simplifies computation} -\small{ -%\begin{onehalfspace} -\begin{tabbing} -xxx\=xxx\=\kill - \`$\mathit{(some)}\;\mathit{assumptions}$\\ -$\mathit{solve}\;(\frac{x}{x ^ 2 - 6 * x + 9} - \frac{1}{x ^ 2 - 3 * x} = \frac{1}{x}, x)$\\ -% \`$x ^ 2 - 6 * x + 9\not=0\land x ^ 2 - 3 * x\not=0$\\ -%\>$\frac{x}{x ^ 2 - 6 * x + 9} - \frac{1}{x ^ 2 - 3 * x} = \frac{1}{x}$ \\ \\ -%\>$\frac{x}{x ^ 2 + -1 * (6 * x) + 9} + \frac{-1 * 1}{x ^ 2 + -1 * (3 * x)} = \frac{1}{x}$ \\ \\ -\>$\frac{3 + -1 * x + x ^ 2}{9 * x + -6 * x ^ 2 + x ^ 3} = \frac{1}{x}$ \\ - \`$x\not=3\land x\not=0$\\ -\>$(3 + -1 * x + x ^ 2) * x = 1 * (9 * x + -6 * x ^ 2 + x ^ 3)$ \\ -\>$\mathit{solve}\;((3 + -1 * x + x ^ 2) * x = 1 * (9 * x + -6 * x ^ 2 + x ^ 3), x)$ \\ -%\>\>$(3 + -1 * x + x ^ 2) * x = 1 * (9 * x + -6 * x ^ 2 + x ^ 3)$ \\ -%\>\>$(3 + -1 * x + x ^ 2) * x - 1 * (9 * x + -6 * x ^ 2 + x ^ 3) = 0$ \\ -\>\>$(3 + -1 * x + x ^ 2) * x - (9 * x + -6 * x ^ 2 + x ^ 3) = 0$ \\ -\>\>$-6 * x + 5 * x ^ 2 = 0$ \\ -\>\>$\mathit{solve}\;(-6 * x + 5 * x ^ 2 = 0, x)$ \\ -\>\>$[x = 0, x = \frac{6}{5}]$ \\ - \`$x = 0\land x = \frac{6}{5}$\\ -\>$[\alert{x = 0}, x = \frac{6}{5}]$ \\ - \`\alert{$\mathit{Check\_Elementwise}\;\mathit{Assumptions}:x\not=0\land x = 0$}\\ -\>$[x = \frac{6}{5}]$ \\ -$[x = \frac{6}{5}]$ -\end{tabbing} -} -%\end{onehalfspace} -\end{frame} - -\begin{frame} - \frametitle{More ``deduction'', \\less ``computation''} -\footnotesize{\tt -\begin{tabbing} -xx\=xx\=xx\=xx\=xx\=xx\=\kill -Script Solve\_root\_equation (e\_e::bool) (v\_v::real) = \\ -\> (let e\_e = ((Try (Rewrite\_Set norm\_equation False)) \@\@ \\ -\>\>\> (Try (Rewrite\_Set Test\_simplify False))) e\_e; \\ -\>\> (L\_L::bool list) = \\ -\>\>\> (SubProblem (Test', \\ -\>\>\>\> [linear,univariate,equation,test]\\ -\>\>\>\> [Test,solve\_linear]) \\ -\>\>\>\> [BOOL e\_e, REAL v\_v]) \\ -\> in \alert{Check\_elementwise L\_L \{(v\_v::real). Assumptions\}})\\ -\end{tabbing} -} -\small{ -``Deductive'' part of Lucas-Interpretation relives the ``computational'' part: \alert{one statement becomes obsolete~!} -} -\end{frame} - - -\begin{frame} - \frametitle{Redesign of \isac{} using contexts} -Advantages of the redesign: -\begin{itemize} -\item type inference by \textit{local} contexts\\ -\pause - \alert{now user-input without type constraints~!} -\pause -\item consistent handling of logical data - \begin{itemize} - \item preconditions and partiality conditions in contexts - \item transfer of context data into subprograms clarified - \item transfer of context data from subprograms clarified - \end{itemize} -\pause - \alert{now some statements become obsolete.}\\ -\end{itemize} -\pause -Now Lucas-interpretation shifts efforts from ``computation'' further to ``deduction''. -\end{frame} - - - -\subsection[Code Improvement]{Improvement of functional code} -\begin{frame} - \frametitle{Improvement of functional code} - \begin{itemize} - \item \textbf{code conventions}: Isabelle2011 published coding standards first time - \item \textbf{combinators}: Isabelle2011 introduced a library containing the following combinators: -\\\vspace{0.2cm} -\tiny{\tt% - val |$>$ : 'a * ('a -$>$ 'b) -$>$ 'b\\ - val |-$>$ : ('c * 'a) * ('c -$>$ 'a -$>$ 'b) -$>$ 'b\\ - val |$>>$ : ('a * 'c) * ('a -$>$ 'b) -$>$ 'b * 'c\\ - val ||$>$ : ('c * 'a) * ('a -$>$ 'b) -$>$ 'c * 'b\\ - val ||$>>$ : ('c * 'a) * ('a -$>$ 'd * 'b) -$>$ ('c * 'd) * 'b\\ - val \#$>$ : ('a -$>$ 'b) * ('b -$>$ 'c) -$>$ 'a -$>$ 'c\\ - val \#-$>$ : ('a -$>$ 'c * 'b) * ('c -$>$ 'b -$>$ 'd) -$>$ 'a -$>$ 'd\\ - val \#$>>$ : ('a -$>$ 'c * 'b) * ('c -$>$ 'd) -$>$ 'a -$>$ 'd * 'b\\ - val \#\#$>$ : ('a -$>$ 'c * 'b) * ('b -$>$ 'd) -$>$ 'a -$>$ 'c * 'd\\ - val \#\#$>>$ : ('a -$>$ 'c * 'b) * ('b -$>$ 'e * 'd) -$>$ 'a -$>$ ('c * 'e) * 'd\\ -} - \end{itemize} -\end{frame} - -\begin{frame} - \frametitle{Example with combinators} - \texttt{\footnotesize{ - \begin{tabbing} -xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=\kill -fun prep\_ori [] \_ \_ = ([], e\_ctxt)\\ -\>| prep\_ori fmz thy pbt =\\ -\>\>\>let\\ -\>\>\>\>val ctxt = ProofContext.init\_global thy \\ -\>\>\>\>\> |> fold declare\_constraints fmz\\ -\>\>\>\>val ori = \\ -\>\>\>\>\> map (add\_field thy pbt o split\_dts o the o parseNEW ctxt) fmz\\ -\>\>\>\>\>\> |> add\_variants\\ -\>\>\>\>val maxv = map fst ori |> max\\ -\>\>\>\>val maxv = if maxv = 0 then 1 else maxv\\ -\>\>\>\>val oris = coll\_variants ori\\ -\>\>\>\>\> |> map (replace\_0 maxv |> apfst)\\ -\>\>\>\>\> |> add\_id\\ -\>\>\>\>\> |> map flattup\\ -\>\>\>in (oris, ctxt) end; - \end{tabbing} - }} -\dots which probably can be further polished. -\end{frame} - -%\subsection[Future Development]{Preparation of Future Development} -%\begin{frame} -% \frametitle{Preparation of Future Development} -% -%% "Script Solve_root_equation (e_e::bool) (v_v::real) = " ^ -%% " (let e_e = ((Try (Rewrite_Set norm_equation False)) @@ " ^ -%% " (Try (Rewrite_Set Test_simplify False))) e_e; " ^ -%% " (L_L::bool list) = " ^ -%% " (SubProblem (Test', " ^ -%% " [linear,univariate,equation,test]," ^ -%% " [Test,solve_linear]) " ^ -%% " [BOOL e_e, REAL v_v]) " ^ -%% " in Check_elementwise L_L {(v_v::real). Assumptions}) " -%\end{frame} -% -%\begin{frame} -% \frametitle{Preparation of Future Development} -% \begin{itemize} -% \item logical data for Isabelle provers in contexts -% \item \isac{} programming language more compact\\ -% $\rightarrow$ context built automatically -% \end{itemize} -%\end{frame} - - -\section[Problems]{Problems encountered in the project} -\begin{frame} - \frametitle{Problems encountered in the project} - \begin{itemize} - \item new Isabelle release in February 2011: update \sisac{} first -\pause - \item lines of code (LOC) in Isabelle and \sisac{}\\ \vspace{0.2cm} -\textit{ - \begin{tabular}{lrl} - src/ & 1700 & $\,$k LOC\\ - src/Pure/ & 70 & k LOC\\ - src/Provers/ & 8 & k LOC\\ - src/Tools/ & 800 & k LOC\\ - src/Tools/isac/ & 37 & k LOC\\ - src/Tools/isac/Knowledge & 16 & k LOC - \end{tabular} -} -\pause - \item changes scattered throughout the code ($\rightarrow$ grep) -\pause - \item documentation of Isabelle very ``technical'' (no API) -\pause - \item documentation of \sisac{} not up to date - \end{itemize} -\end{frame} - -%\begin{frame} -% \frametitle{Lines of Code} -% \begin{tabular}{lr} -% src/ & 1700 k \\ -% src/Pure/ & 70 k \\ -% src/Provers/ & 8 k \\ -% src/Tools/ & 800 k \\ -% src/Tools/isac/ & 37 k \\ -% src/Tools/isac/Knowledge & 16 k \\ -% \end{tabular} -%\end{frame} - -\section{Summary} -\begin{frame} - \frametitle{Summary} -The project succeeded in all goals: -\begin{itemize} -\item implemented Isabelle's contexts in \sisac{} such that -\item user input requires no type constraints anymore -\item consistent logical data is prepared for Isabelle's provers -\end{itemize} -\pause -The course of the project was close to the plan: -\begin{itemize} -\item faster in writing new code -\item slower in integrating the code into \sisac -\end{itemize} -\pause -The project provided essential prerequisites for further development of the Lucas-interpreter. -\end{frame} - -\end{document} - - diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/mlehnfeld/projektbericht.tex --- a/src/Doc/isac/mlehnfeld/projektbericht.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,575 +0,0 @@ -\documentclass[a4paper,12pt]{article} -% -\usepackage[ngerman]{babel} -\usepackage[utf8]{inputenc} -\usepackage{ngerman} -\usepackage{graphicx} -\bibliographystyle{alpha} - -\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} -\def\sisac{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} - -\begin{document} - -\title{\Large {\bf Verbindung von 'Computation' und 'Deduction' im \isac{}-System}\\~\\ - Projektpraktikum am Institut für Computersprachen,\\Technische Universit\"at Wien\\ -\vspace{0.7cm} -\large{Betreuer: Univ.-Prof. Dr. Jens Knoop}} -\author{Mathias Lehnfeld\\ - {\tt mathias.lehnfeld@gmx.at}} -%pdflatex creates an empty page 1 and the titlepage on page 2 ?!?... -%\thanks{Betreuer: Univ.-Prof. Dr. Jens Knoop, Technische Universit\"at Wien\\ -% Dr. Walther Neuper, Technische Universit\"at Graz} -\date{30. Mai 2011} -\maketitle -\clearpage -\tableofcontents -\clearpage - - -\section{Zur Aufgabenstellung} -Das \sisac{}-Projekt entwickelt einen {\it math assistant} aufbauend auf den -{\it theorem prover} Isabelle. Der Kern des \sisac{}-Systems ist ein -{\it Lucas-Interpreter}, der automatisch Benutzerführung für schrittweises -Problemlösen erzeugt: Der nächste Schritt wird von einem Programm -berechnet ({\it computation}); {\it deduction} wird gefordert, wenn der Benutzer -eine Formel eingibt (die Ableitbarkeit der Formel aus dem {\it context} ist -zu beweisen).\\ -\\ -Die Aufgabenstellung im Rahmen des Projektpraktikums besteht darin, das -in Isabelle verfügbare Konzept {\it context} in den Lucas-Interpreter -einzubauen. Dies schließt grundlegende Design-Überlegungen ein, verlangt -tiefes Eindringen in den umfangreichen Code von zwei Softwareprodukten, -{\it Isabelle} und \sisac{} und bedeutet daher Zusammenarbeit mit den jeweiligen -Entwicklerteams.\\ -\\ -Ein erfolgreicher Einbau der Isabelle-{\it context}s in den -Lucas-Interpreter wird \sisac{}s Fähigkeit, Benutzereingaben zu -interpretieren, wesentlich erweitern: {\it context}s stellen Isabelles -automatischen Beweisern die notwendigen Daten bereit. - - -\section{Planung des Projektes} -\subsection{Ist-Zustand vor dem Projekt} -Das Isabelle Konzept der {\it context}s findet derzeit in \sisac{} noch keine Verwendung. Dadurch entstehen gewisse Einschränkungen bezüglich der Interpretation durch den Lucas-Interpreter, weil Rechenschritte nicht unter Berücksichtigung aller Faktoren ihres Kontexts betrachtet werden können. Derzeit werden Zusicherungen und Umgebungsdaten in einer \sisac{}-spezifischen Datenstruktur verwaltet, die Zugriffe auf Isabelles Prover nicht direkt unterstützen. - -\subsection{Geplanter Soll-Zustand nach dem Projekt} -\sisac{}s Lucas-Interpreter ist nun schlanker und nimmt Isabelles {\it context}s bei der Interpretation von Benutzereingaben in Anspruch. Spezifikationen werden mit Isabelles eigenen Datenstrukturen verwaltet. Zusicherungen und Typen von Variablen werden im Lucas-Interpreter in {\it context}s behandelt. - -\subsection{Zeitplanung f\"ur das Projekt} -Die Planung f\"ur das Projekt sah folgende Meilensteine vor (Details siehe \ref{ms-desc}): -\begin{enumerate} -\item \textbf{Voraussetzungen zum Arbeitsbeginn schaffen} (10.02. -- 18.02.) - %Beschreibung siehe \ref{ms1_desc} -\item \textbf{\isac{} auf die letzte Isabelle-Release updaten} (21.02. -- 25.02.) - %Beschreibung siehe \ref{ms2_desc} -\item \textbf{Parsen aus \textit{contexts}} (28.02. -- 04.03.) - %Beschreibung siehe \ref{ms3_desc} -\item \textbf{Spezifikationsphase mit \textit{context}s} (07.03. -- 11.03.) - %Beschreibung siehe \ref{ms4_desc} -\item \textbf{L\"osungsphase mit \textit{context}s} (14.03. -- 18.03.) - %Beschreibung siehe \ref{ms5_desc} -\end{enumerate} - -\section{Konzepte und L\"osungen} -\subsection{Architektur von \isac} -Die Grafik auf Seite \pageref{architektur} gibt einen \"Uberblick \"uber die Architektur von \sisac: - -\begin{figure} [htb] -\begin{center} - \includegraphics[width=120mm]{overview.pdf} -\end{center} -\caption{Lucas-interpreter und Isabelle} -\label{architektur} -\end{figure} -Die Mathematik-Engine von \sisac{} ist nach dem Konzept eines ``Lucas-Interpreters'' (LI) gebaut. Ein LI interpretiert drei Arten von Daten: -\begin{enumerate} -\item\label{spec}\textbf{Spezifikationen}: diese beschreiben ein Problem der angewandten Mathematik durch die Ein- und Ausgabedaten, die ``precondition'' (Pr\"adikate auf den Eingabedaten) und eine ``postcondition'' (eine Relation zwischen Ein- und Ausgabedaten). Spezifikationen stellen den \textit{applikations-orientierten} Aspekt der Mathematik dar. -\item \textbf{Programme}: beschreiben den Algorithmus zur L\"osung des spezifizierten Problems. \sisac's Programmsprache ist funktional und hat keine Ein- oder Ausgabe-Statements \cite{plmms10}. Sie kann aber auf Funktionalit\"aten des Computer Theorem Provers (CTP) Isabelle \cite{Nipkow-Paulson-Wenzel:2002} zugreifen. Programme stellen den \textit{algorithmischen} Aspekt der Mathematik dar. -\item \textbf{Theorien}: beinhalten die Definitionen, Axiome und Theoreme, die einer bestimmten Rechnung der angewandten Mathematik zugrundeliegen. \sisac{} verwendet die ``theories'' von Isabelle in vollem Umfang. Theorien stellen den \textit{deduktiven} Aspekt der Mathematik dar. -\end{enumerate} - -Die Funktionalit\"at eines LI kann in kurzer Form durch die folgenden drei Anspr\"uche erkl\"art werden\footnote{siehe http://www.ist.tugraz.at/isac/index.php/Description}: - -\begin{enumerate} -\item \textbf{Benutzereingaben pr\"ufen}: Benutzereingaben sollen so gro\3z\"ugig wie m\"oglich verarbeitet werden. Bei einem gegebenen Problem aus der angewandten Mathematik als formale Spezifikation, wird mit den jeweiligen ``preconditions'' ein ``context'' erzeugt. Nun kann ein Isabelle ``prover'' die Ableitbarkeit einer Benutzereingabe aus dem ``context'' \"uberpr\"ufen. Der ``context'' wird Schritt f\"ur Schritt durch Benutzereingaben erweitert, bis ein Ergebnis vorliegt, das beweisbar die ``postcondition'' aus der Spezifikation erf\"ullt. -\item \textbf{Den Benutzer anleiten}: Wei\3 der Lernende nicht mehr weiter, so kann das System den n\"achsten Schritt vorschlagen und den Benutzer so Schritt f\"ur Schritt zum Ergebnis f\"uhren. Ein \sisac{}-Programm wird so interpretiert, wie es bei einem Debugger passiert; die Breakpoints (i.e. Schritte) sind als bestimmte Statements im Programm definiert, die notwendigerweise zum Verlauf der Rechnung bzw. deren Aufbau geh\"oren. An den Breakpoints kann der Benutzer frei entscheiden, ob er den n\"achsten Schritt generieren lassen m\"ochte oder ob er versucht, selbst weiter zu rechnen. Die Herausforderung f\"ur den \textit{Lucas-Interpreter} ist, mit beliebigen Benutzereingaben umgehen zu k\"onnen. -\item \textbf{Schritte erkl\"aren}: Bei Interesse hat der Lernende Zugang zu dem Wissen, das f\"ur einen mechanisierten \textit{math assistant} zur L\"osung mathematischer Probleme von N\"oten ist: Definitionen, Axiome und Theoreme (erfasst in ``theories''\footnote{siehe http://www.ist.tugraz.at/projects/isac/www/kbase/thy/index\_thy.html}), Spezifikationen von Problemklassen\footnote{siehe z.B. http://www.ist.tugraz.at/projects/isac/www/kbase/pbl/index\_pbl.html} und Programme, um die Probleme zu l\"osen\footnote{siehe http://www.ist.tugraz.at/projects/isac/www/kbase/met/index\_met.html}. Theoretisch ist dieses Wissen ausreichend, automatisch Erkl\"arungen f\"ur die einzelnen Schritte zu generieren. Das Hintergrundwissen liegt zwar in mathematischer Formulierung vor, es ist jedoch fraglich, wie dies in eine Form gebracht werden kann, die den Lernenden nicht \"uberfordert. -\end{enumerate} - -\subsection{Isabelles Konzept von ``contexts''} -Die Beschreibung dieses bew\"ahrten Konzeptes findet sich in einem internen Papier zur Implementierung von Isabelles Beweissprache Isar \cite{isar-impl}. Isabelle stellt einen sehr generellen Funktor zur Verf\"ugung: - -{\tt -\begin{tabbing} -xx\=xx\=in\=\kill -structure ContextData = {Proof\_Data}\\ -\>~({type T} = term list\\ -\>\>{fun init \_} = []);\\ -\\ -fun insert\_assumptions asms = \\ -\>\>\>ContextData{.map} (fn xs => distinct (asms@xs));\\ -\\ -fun get\_assumptions ctxt = ContextData{.get} ctxt;\\ -\\ -\\ -val declare\_constraints : \\ -\>\>\>term -> Proof.context -> Proof.context -\end{tabbing} -} -Das Einzige, was die Definition eines''contexts'' braucht, ist die Spezifikation eines Typs \textit{type T} und einer Funktion \textit{fun init \_} f\"ur den Funktor \textit{Proof\_Data}. Dieser stellt dann die Zugriffsfunktionen \textit{ContextData.map} und \textit{ContextData.get} zur Verf\"ugung. - -Die Funktion \textit{declare\_constraints} liefert eine wichtige Funktionalit\"at: Ein \textit{term} angewandt auf einen \textit{Proof.context} ergibt einen neuen \textit{Proof.context}, der f\"ur das Parsen von Strings verwendet werden kann: -{\tt -\begin{tabbing} -xx\=xx\=xx\=xx\=xx\=\kill -fun parseNEW ctxt str = \\ -\>\>\>SOME ({Syntax.read\_term ctxt} str |> numbers\_to\_string)\\ -\>\>\>handle \_ => NONE; - \end{tabbing} -} -\textit{Syntax.read\_term ctxt} entnimmt dem ``context'' die Typinformation, die vorher durch \textit{declare\_constraints} zugef\"uhrt wurde. Da die \textit{fun parse} vor Beginn dieses Projektes keine ``contexts'' zur Verf\"ugung hatte, setzte sie mittels \textit{typ\_a2real} einfach alle unbestimmten Typen auf \textit{real}: -{\tt -\begin{tabbing} -xx\=xx\=xx\=xx\=xx\=\kill -fun parse thy str =\\ -\>(let val t = ({typ\_a2real} o numbers\_to\_string)\\ -\>\>\>\>({Syntax.read\_term\_global thy} str)\\ -\>\>in SOME (cterm\_of thy t) end)\\ -\>\>\>handle \_ => NONE;\\ - \end{tabbing} -} - -\subsection{Die Initialisierung von ``contexts''}\label{init-ctxt} -``Contexts'' werden an zwei Stellen von Lucas-Interpretation initialisiert: am Beginn der Spezifikationsphase und zu Beginn der L\"osungsphase. - -\begin{enumerate} -\item\label{init-ctxt-spec}{Die Spezifikations-Phase} dient der Erstellung einer formalen Spezifikation (siehe \ref{spec})\footnote{Da bekannterma\3en formales Spezifizieren schwierig ist, kann es durch entsprechende Dialog-Einstellung dem LI \"uberlassen werden.}. Der ``context'' wird mittels \textit{declare\_constraints} mit den Typdeklarationen aller vorkommenden Variablen initialisiert. - -Im Falle eines Rootproblems kommen die Variablen von einer ``formalization'', einer Kurzbeschreibung der Eingabedaten durch einen Autor. Im Falle eines Subproblems kommen die Variablen von den ``actual arguments'' des Subprogrammes. - -\item\label{init-ctxt-solve}{Die L\"osungsphase} erzeugt die Rechenschritte aus dem spezifizierten Programm. Zu Beginn der Interpretation des Programmes wird der ``context'' initialisiert mit - \begin{enumerate} - \item den Typdeklarationen aller in der Spezifikation vorkommenden Variablen mittels \textit{declare\_constraints} - \item den ``preconditions'' des (interaktiv oder automatisch) spezifizierten Programmes, genauer: mit den ``preconditions'' des zugeh\"origen Guards, der meist gleich der Spezifikation ist - \end{enumerate} -\end{enumerate} - - -\subsection{Aufbau von ``contexts'' in der Interpretation}\label{partiality} -W\"ahrend der Interpretation eines Programmes baut der Lucas-Interpreter einen ``context'' auf, indem er alle relevanten ``preconditions'', andere Pr\"adikate -- insbesondere ``partiality conditions'' -- einsammelt. Eine ``partiality condition'' ist zum Beispiel $x\not=0$, die eine Division durch $0$ verhindert. - -Am Ende eines Programmes soll der ``context'' hinreichend logische Information enthalten, sodass Isabelles automatische Beweiser die ``postcondition'' automatisch beweisen k\"onnen (das ist eine k\"unftige Entwicklungsaufgabe!). - -\subsection{Transfer von ``contexts'' aus Subprogrammen}\label{transfer} -``contexts'' folgen den \"ublichen Scope-Regeln von Programmsprachen mit Blockstruktur, wie schon die Initialisierung von ``contexts'' gezeigt hat. Die Behandlung von ``contexts'' bei der R\"uckkehr aus Subprogrammen erfolgt durch folgende Funktionen: -{\tt -\begin{tabbing} -xx\=xx\=xx\=xx\=xx\=\kill -fun transfer\_asms\_from\_to from\_ctxt to\_ctxt =\\ -\> let\\ -\>\> val to\_vars = get\_assumptions to\_ctxt |> map vars |> flat\\ -\>\> fun transfer [] to\_ctxt = to\_ctxt\\ -\>\>\> | transfer (from\_asm::fas) to\_ctxt =\\ -\>\>\>\>\> if inter op = (vars from\_asm) to\_vars = []\\ -\>\>\>\>\> then transfer fas to\_ctxt\\ -\>\>\>\>\> else transfer fas (insert\_assumptions [from\_asm] to\_ctxt)\\ -\> in transfer (get\_assumptions from\_ctxt) to\_ctxt end\\ - \end{tabbing} -} -Folgende Daten werden aus dem Sub-``context'' in den ``context'' des aufrufenden Programmes zur\"uckgegeben: -\begin{enumerate} -\item die R\"uckgabewerte des Subprogrammes, sofern sie vom Typ \textit{bool} sind -\item alle \textit{assumptions}, die eine Variable enthalten, die auch einer der R\"uckgabewerte enth\"alt -\item alle \textit{assumptions}, die eine Variable enthalten, die in einem Term des aufrufenden Programmes enthalten sind\footnote{in diesem Punkt sind die Scope-Regeln schw\"acher als sonst bei Subprogrammen}. Der Unterschied begr\"undet sich darin, dass Rechnungen vorzugsweise mit Variablennamen vorgehen, die block\"ubergreifend g\"ultig sind. -\item\label{conflict} \textbf{nicht zur\"uckgegeben} werden R\"uckgabewerte des Subprogrammes dann, wenn sie im Widerspruch zum ``context'' des aufrunfenden Programmes stehen \footnote{Dieser Punkt wurde erst zu Ende der vorliegenden Arbeit gekl\"art und ist zur Zeit ihrer Fertigstellung nicht implementiert~!}. Hier ist ein Beispiel: -\end{enumerate} - -\begin{tabbing} -xxx\=xxx\=\kill - \`$\mathit{(some)}\;\mathit{assumptions}$\\ -$\mathit{solve}\;(\frac{x}{x ^ 2 - 6 * x + 9} - \frac{1}{x ^ 2 - 3 * x} = \frac{1}{x}, x)$\\ - \`$x ^ 2 - 6 * x + 9\not=0\land x ^ 2 - 3 * x\not=0$\\ -\>$\frac{x}{x ^ 2 - 6 * x + 9} - \frac{1}{x ^ 2 - 3 * x} = \frac{1}{x}$ \\ \\ -\>$\frac{x}{x ^ 2 + -1 * (6 * x) + 9} + \frac{-1 * 1}{x ^ 2 + -1 * (3 * x)} = \frac{1}{x}$ \\ \\ -\>$\frac{3 + -1 * x + x ^ 2}{9 * x + -6 * x ^ 2 + x ^ 3} = \frac{1}{x}$ \\ - \`$x\not=3\land x\not=0$\\ -\>$(3 + -1 * x + x ^ 2) * x = 1 * (9 * x + -6 * x ^ 2 + x ^ 3)$ \\ -\>$\mathit{solve}\;((3 + -1 * x + x ^ 2) * x = 1 * (9 * x + -6 * x ^ 2 + x ^ 3), x)$ \\ -\>\>$(3 + -1 * x + x ^ 2) * x = 1 * (9 * x + -6 * x ^ 2 + x ^ 3)$ \\ -\>\>$(3 + -1 * x + x ^ 2) * x - 1 * (9 * x + -6 * x ^ 2 + x ^ 3) = 0$ \\ -\>\>$(3 + -1 * x + x ^ 2) * x - (9 * x + -6 * x ^ 2 + x ^ 3) = 0$ \\ -\>\>$-6 * x + 5 * x ^ 2 = 0$ \\ -\>\>$\mathit{solve}\;(-6 * x + 5 * x ^ 2 = 0, x)$ \\ -\>\>$[x = 0, x = \frac{6}{5}]$ \\ - \`$x = 0\land x = \frac{6}{5}$\\ -\>$[{x = 0}, x = \frac{6}{5}]$ \\ - \`{$\mathit{Check\_Elementwise}\;\mathit{Assumptions}:x\not=0\land x = 0$}\\ -\>$[x = \frac{6}{5}]$ \\ -$[x = \frac{6}{5}]$ -\end{tabbing} -Aufgrund von Punkt \ref{conflict}. oben wird es m\"oglich, aus dem Programm, das obige Rechnung erzeugt, das Statement \textit{Check\_Elementwise Assumptions} zu streichen: -{\tt -\begin{tabbing} -xx\=xx\=xx\=xx\=xx\=xx\=\kill -Script Solve\_root\_equation (e\_e::bool) (v\_v::real) = \\ -\> (let e\_e = ((Try (Rewrite\_Set norm\_equation False)) \@\@ \\ -\>\>\> (Try (Rewrite\_Set Test\_simplify False))) e\_e; \\ -\>\> (L\_L::bool list) = \\ -\>\>\> (SubProblem (Test', \\ -\>\>\>\> [linear,univariate,equation,test]\\ -\>\>\>\> [Test,solve\_linear]) \\ -\>\>\>\> [BOOL e\_e, REAL v\_v]) \\ -\> in {Check\_Elementwise L\_L \{(v\_v::real). Assumptions\}})\\ -\end{tabbing} -} -Hiermit geht die Entwicklung des Konzeptes von Lucas-Interpretation einen Schritt in die begonnene Richtung weiter, die Verschiebung des Programmieraufwandes von ``computation'' (im herk\"ommlichen Programmieren) auf ``deduction'' (im Spezifizieren von Programmeigenschaften) zu unterst\"utzen. - -\subsection{\"Uberblick: ``contexts'' bei Lucas-Interpretation} - -Im Folgenden betrachten wir ein Bespiel für die Lösung einer Aufgabe durch \sisac. Die gegebenen Codeausschnitte sind nur Teile des gesamten Programmes. Der vollständige Code befindet sich in Anhang \ref{demo-code}. - -\paragraph{Formulierung der Aufgabenstellung und Spezifikation}~\\ - -Erklärung siehe \ref{init-ctxt-spec}. -\begin{verbatim} -val fmz = ["equality (x+1=(2::real))", "solveFor x", "solutions L"]; -val (dI',pI',mI') = - ("Test", ["sqroot-test","univariate","equation","test"], - ["Test","squ-equ-test-subpbl1"]); -val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))]; -\end{verbatim} -\textit{fmz} enthält also die zwei Eingabegrößen und die gesuchte Ausgabegröße, also die Liste aller Lösungen für \textit{x} in der Gleichung $x + 1 = 2$. Die zweite Zeile definiert den Namen der ``theory'' mit dem deduktiven Hintergrundwissen, die Spezifikation in Form einer Liste und das zu verwendende Programm.\\ -\textit{CalcTreeTEST} erzeugt schlie\3lich die grundlegenden Datenstrukturen für die folgenden Berechnungen. Beispielsweise wird ein ``context'' erzeugt, der nun im Baum \textit{pt} an der Position \textit{p} steht. -\begin{verbatim} -val ctxt = get_ctxt pt p; -val SOME known_x = parseNEW ctxt "x + y + z"; -val SOME unknown = parseNEW ctxt "a + b + c"; -\end{verbatim} -Dies erzeugt folgenden Output: -\begin{verbatim} -val ctxt = : Proof.context -val known_x = - Const ("Groups.plus_class.plus", - "RealDef.real => RealDef.real => RealDef.real") $ - (Const ("Groups.plus_class.plus", - "RealDef.real => RealDef.real => RealDef.real") $ - Free ("x", "RealDef.real") $ Free ("y", "RealDef.real")) $ - Free ("z", "RealDef.real"): - term -val unknown = - Const ("Groups.plus_class.plus", "'a => 'a => 'a") $ - (Const ("Groups.plus_class.plus", "'a => 'a => 'a") - $ Free ("a", "'a") $ Free ("b", "'a")) $ - Free ("c", "'a"): - term -\end{verbatim} -Der Output dieser Zeilen zeigt die neue Funktionalität anhand der Erkennung des Typs \textit{real} für die Variablen \textit{x}, \textit{y} und \textit{z} mittels Typinferenz, im Gegensatz zu den Unbekannten \textit{a}, \textit{b} und \textit{c} (unbekannter Typ \textit{'a}. - -\paragraph{Beginn der Interpretation}~\\ - -Nach einigen Schritten der Mathematik-Engine ist die Spezifikationsphase beendet und die Interpretation des Programmes kann beginnen. Die ``precondition'' ist in den Assumptions enthalten: -\begin{verbatim} -get_assumptions_ pt p |> terms2strs -\end{verbatim} -Output: -\begin{verbatim} -val it = ["precond_rootmet x"]: string list -\end{verbatim} - -\paragraph{Bearbeitung eines Subproblems}~\\ - -Einige Ausführungsschritte später startet der Interpreter mit der Gleichung $-1 + x = 0$ ein Subproblem, beginnt dort wiederum mit Spezifikationsphase und setzt mit der Lösungsphase fort.\\ -In einem Zwischenschritt bestehen die lokalen Assumptions aus der Annahme, dass die Gleichung mit der Gleichheitsregel zu matchen ist: -\begin{verbatim} -["matches (?a = ?b) (-1 + x = 0)"]: string list -\end{verbatim} -Nach künstlichem Einfügen zweier Assumptions und Beendigung des Subproblems steht eine Lösung für \textit{x} in den Assumptions:\\ -\texttt{[\dq{}matches (?a = ?b) (-1 + x = 0)\dq{}, \dq{}x < sub\_asm\_out\dq{}, \dq{}{\bf x = 1}\dq{}, \dq{}precond\_rootmet x\dq{}]: string list}\\ -\\ -Bei der Rückkehr aus dem Subproblem könnte eine erzeugte Lösung aufgrund einer Bedingungsverletzung wieder wegfallen, hier ist das nicht der Fall. Die Überprüfung dieser Bedingungen (siehe \ref{partiality}) geschieht beim Transfer des lokalen ``contexts'' in den übergeordneten (hier der des Rootproblems, siehe \ref{transfer}). - -\paragraph{Abschluss der Berechnung}~\\ - -Nach den letzten Aufrufen der Mathematik-Engine stehen alle Schritte fest: -\begin{verbatim}[ -(([], Frm), solve (x + 1 = 2, x)), -(([1], Frm), x + 1 = 2), -(([1], Res), x + 1 + -1 * 2 = 0), -(([2], Res), -1 + x = 0), -(([3], Pbl), solve (-1 + x = 0, x)), -(([3,1], Frm), -1 + x = 0), -(([3,1], Res), x = 0 + -1 * -1), -(([3,2], Res), x = 1), -(([3], Res), [x = 1]), -(([4], Res), [x = 1]), -(([], Res), [x = 1])] -\end{verbatim} - -\section{Beschreibung der Meilensteine}\label{ms-desc} -\subsection{Voraussetzungen zum Arbeitsbeginn schaffen}\label{ms1_desc} -Die Komplexit\"at \sisac{}s, welches auf Konzepten von Isabelle aufbaut und die tief ins System eingreifenden Ver\"anderungen in den bevorstehenden Meilensteinen machen eine intensive Auseinandersetzung mit Isabelle, insbesondere mit dem Konzept der ``contexts'', und dem \sisac-Code notwendig. Darunter fallen neben dem Lesen von Dokumentationen auch die gezielte Suche von Anwendungsf\"allen im bestehenden Code, sowie das Studieren von Coding Standards und ein Vertrautmachen mit den im \sisac-Team \"ublichen Workflows. - -\subsection{\isac{} auf die letzte Isabelle-Release updaten}\label{ms2_desc} -Die Arbeit mit den Isabelle {\it context}s wird Anfragen in isabelle-dev@ -erfordern. isabelle-dev@ beantwortet Fragen i.A. nur f\"ur die aktuelle -Release. Überraschenderweise wurde zwei Wochen vor Beginn des Projektpraktikums eine neue Release -veröffentlicht. Daher muss auf diese vor Arbeitsbeginn upgedatet werden. - -\subsection{Parsen aus {\it context}s}\label{ms3_desc} -Bisher nahm \sisac{} für jede Variable den Typ {\it real} an. Variablen, Terme und Pr\"adikate sollen nun beim ersten Auftreten im {\it context} eingetragen werden. User-Input wird mithilfe des {\it context}s mittels Typinferenz typgerecht geparst. Die Verwendungen der bestehenden \textit{parse}-Funktion m\"ussen im ganzen System ersetzt und angepasst werden. - -\subsection{Spezifikationsphase mit {\it context}s}\label{ms4_desc} -\sisac{} sah für die Spezifikation eine Datenstruktur vor, die interaktives Spezifizieren effizient unterstützt. Diese Datenstruktur soll nun durch {\it context}s ersetzt werden. Dadurch ist die bisherige Fixierung auf {\it real} aufgehoben und beliebige Typen werden fehlerfrei behandelt. Dieser Schritt macht weitere Eingriffe in grundlegende Funktionen und Datenstrukturen des Systems notwendig. - -\subsection{L\"osungsphase mit {\it context}s}\label{ms5_desc} -Der Lucas-Interpreter speicherte Assumptions (precondition, partiality conditions, etc.) in einer eigenen Datenstruktur im Rechenbaum. Nun sollen Assumptions im {\it context} verwaltet werden. Dazu sind Schreib- und Lesefunktionen zu implementieren und alle Verwendungen von Assumptions entsprechend anzupassen. - -\section{Bericht zum Projektverlauf} - -\subsection{Voraussetzungen zum Arbeitsbeginn schaffen} -Die Größe der Projekte {\it Isabelle} und \sisac{} sowie deren Abgrenzung haben den Weg zu meinem schließlichen Verständnis der Aufgabenstellung etwas langwierig gestaltet. Dazu kamen nicht geplante, organisatorische Vorbereitungen, wie die Erstellung einer Projektbeschreibung und des -planes. Die lange Vorbereitung hat sich aber positiv auf den weiteren Verlauf des Projektes ausgewirkt. - -\subsection{\isac{} auf die letzte Isabelle-Release updaten} -Da die Veröffentlichung der {\it Isabelle}-Version 2009-2 noch nicht lange zurück lag, kam {\it Isabelle2011} mit vielen grundlegenden Änderungen im System kurz vor Projektbeginn sehr überraschend. Die Mailingliste der Entwickler beantwortet nur Fragen zur aktuellen Release, weshalb ein entsprechendes Update von \sisac{} vor Arbeitsbeginn notwendig war.\\ -Dieser Arbeitsschritt beanspruchte wesentlich mehr Zeit als ursprünglich geplant. Als \sisac{} schließlich erfolgreich kompilierte funktionierte eine große Zahl der Tests nicht mehr. Dies machte die selbstständige Arbeit für mich vorerst unmöglich. Ich konnte jedoch in persönlicher Zusammenarbeit mit Walther Neuper meine Fähigkeiten einbringen. Die Notwendigkeit dieser persönlichen Zusammenarbeit verzögerte den Projektverlauf. - -\subsection{Parsen aus {\it context}s} -In diesem Schritt konnte ich besonders Syntax und Funktionsweise von StandardML, die praktischen, {\it Isabelle}-eigenen Operatoren und die Arbeitsweise mit der Entwicklungsumgebung kennen lernen. Dieser Meilenstein konnte in recht kurzer Zeit abgeschlossen werden. - -\subsection{Spezifikationsphase mit {\it context}s} -Hier konnte ich sehr viel selbstständig arbeiten. Zu Beginn verlief alles völlig problemlos, die Suche nach einem bestimmten Fehler beanspruchte dann aber mit Abstand die meiste Zeit, hatte jedoch zur Folge, dass ich mich sehr intensiv mit dem System auseinandersetzen musste und damit einige Kernfunktionen kennen und verstehen lernte und teilweise sogar etwas optimieren konnte. -Insgesamt verlief diese Phase trotz der langwierigen Fehlersuche nicht viel langsamer als geplant. - -\subsection{L\"osungsphase mit {\it context}s} -Die Integration von {\it context}s in die Lösungsphase zur Ersetzung der ursprünglichen behandlung von Assertions konnte in enger Zusammenarbeit mit Herrn Neuper fertiggestellt werden, persönliche Termine auf beiden Seiten verlängerten aber den zeitlichen Verlauf. Der Code des Lucas-Interpreters ist jetzt sauberer und die Logik vereinfacht. - - -\section{Abschließende Bemerkungen} -Rückblickend betrachte ich das Projektpraktikum als sehr positive Erfahrung, da ich das Gefühl habe, etwas nicht Unwesentliches zur Erweiterung von \sisac{} beigetragen zu haben. Die persönliche Zusammenarbeit mit Akademikern und auch die Verrichtung einer Arbeit, die nach Abschluss gebraucht und verwendet wird, ist eine Erfahrung, die in meinem Studium nicht selbstverständlich ist und um die ich mich sehr bemüht habe. - -Der %nicht zuletzt -durch das überraschend notwendig gewordene Update -von Isabelle2009-2 auf Isabelle2011 -bedingte zähe Verlauf bis ich endlich wirklich an der eigentlichen Aufgabenstellung arbeiten konnte, %war etwas ernüchternd, -verlange einies Umdisponieren, -da ich gehofft hatte, das Praktikum bis spätestens Ende März abschließen zu können. Die zeitliche Verzögerung des Projektes wurde jedoch durch gro\3es Entgegenkommen des Institutes in der Terminsetzung am Ende des Projektes ausgeglichen; daf\"ur bin ich Herrn Professor Knoop sehr zu Dank verpflichtet. Lehrreich war f\"ur mich auch die Einbindung der Abschlusspr\"asentation in die Vortragsreihe des Institutes f\"ur Computersprachen und dem Feedback von dort; auch daf\"ur herzlichen Dank. - -Die Zusammenarbeit mit \sisac-Entwicklung an der Technischen Universit\"at Graz \"uber Herrn Neuper hat %jedenfalls -sehr gut funktioniert und aus meiner Sicht haben wir uns sehr gut verstanden. Das hat ein produktives %entspanntes -Arbeitsklima ermöglicht. - -%Abgesehen von der zeitlichen Verzögerung des Projektes freue ich mich über den erfolgreichen Abschluss der geplanten Aufgaben und deren interessanten Charakter. - -\clearpage - -\bibliography{bib} - -\clearpage - -\appendix -%\section*{Anhang} -\section{Demobeispiel}\label{demo-code} -\begin{verbatim} - -theory All_Ctxt imports Isac begin - -text {* all changes of context are demonstrated in a mini example. - see test/../mstools.sml --- all ctxt changes in minimsubpbl x+1=2 --- *} - -section {* start of the mini example *} - -ML {* - val fmz = ["equality (x+1=(2::real))", "solveFor x", "solutions L"]; - val (dI',pI',mI') = - ("Test", ["sqroot-test","univariate","equation","test"], - ["Test","squ-equ-test-subpbl1"]); - val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))]; -*} - -section {* start of specify phase *} - -text {* variables known from formalisation provide type-inference - for further input *} - -ML {* - val ctxt = get_ctxt pt p; - val SOME known_x = parseNEW ctxt "x + y + z"; - val SOME unknown = parseNEW ctxt "a + b + c"; -*} - -ML {* - val (p,_,f,nxt,_,pt) = me nxt p [] pt; - val (p,_,f,nxt,_,pt) = me nxt p [] pt; - val (p,_,f,nxt,_,pt) = me nxt p [] pt; - val (p,_,f,nxt,_,pt) = me nxt p [] pt; - val (p,_,f,nxt,_,pt) = me nxt p [] pt; - val (p,_,f,nxt,_,pt) = me nxt p [] pt; - val (p,_,f,nxt,_,pt) = me nxt p [] pt; - val (p,_,f,nxt,_,pt) = me nxt p [] pt; -*} - -section {* start interpretation of method *} - -text {* preconditions are known at start of - interpretation of (root-)method *} - -ML {* - get_assumptions_ pt p |> terms2strs; -*} - -ML {* -val (p,_,f,nxt,_,pt) = me nxt p [] pt; -val (p,_,f,nxt,_,pt) = me nxt p [] pt; -val (p,_,f,nxt,_,pt) = me nxt p [] pt; -*} - -section {* start a subproblem: specification *} - -text {* variables known from arguments of (sub-)method - provide type-inference for further input *} - -ML {* - val ctxt = get_ctxt pt p; - val SOME known_x = parseNEW ctxt "x+y+z"; - val SOME unknown = parseNEW ctxt "a+b+c"; -*} - -ML {* - val (p,_,f,nxt,_,pt) = me nxt p [] pt; - val (p,_,f,nxt,_,pt) = me nxt p [] pt; - val (p,_,f,nxt,_,pt) = me nxt p [] pt; - val (p,_,f,nxt,_,pt) = me nxt p [] pt; - val (p,_,f,nxt,_,pt) = me nxt p [] pt; - val (p,_,f,nxt,_,pt) = me nxt p [] pt; - val (p,_,f,nxt,_,pt) = me nxt p [] pt; - val (p,_,f,nxt,_,pt) = me nxt p [] pt; -*} - -section {* interpretation of subproblem's method *} - -text {* preconds are known at start of interpretation of (sub-)method *} - -ML {* - get_assumptions_ pt p |> terms2strs -*} - -ML {* - val (p,_,f,nxt,_,pt) = me nxt p [] pt; -*} - -ML {* - "artifically inject assumptions"; - val (SOME (iform, cform), SOME (ires, cres)) = get_obj g_loc pt (fst p); - val ctxt = insert_assumptions [str2term "x < sub_asm_out", - str2term "a < sub_asm_local"] cres; - val pt = update_loc' pt (fst p) (SOME (iform, cform), SOME (ires, ctxt)); -*} - -ML {* -val (p,_,f,nxt,_,pt) = me nxt p [] pt; -val (p,_,f,nxt,_,pt) = me nxt p [] pt; -*} - -section {* finish subproblem, return to calling method*} - -text {* transfer non-local assumptions and result from sub-method - to root-method. - non-local assumptions are those contaning a variable known - in root-method. -*} - -ML {* - terms2strs (get_assumptions_ pt p); -*} - -ML {* - val (p,_,f,nxt,_,pt) = me nxt p [] pt; - val (p,_,f,nxt,_,pt) = me nxt p [] pt; -*} - -section {* finish Lucas interpretation *} - -text {* assumptions collected during lucas-interpretation - for proof of postcondition *} - -ML {* - terms2strs (get_assumptions_ pt p); -*} - -ML {* - show_pt pt; -*} - -end -\end{verbatim} - -\section{Stundenliste} - -\subsection*{Voraussetzungen zum Arbeitsbeginn schaffen} -\begin{tabular}[t]{lll} - {\bf Datum} & {\bf Stunden} & {\bf Beschreibung} \\ - 10.02.2011 & 2:00 & Besprechung der Problemstellung \\ - 11.02.2011 & 1:30 & {\it context}s studieren, Isabelle/Mercurial Installation \\ - 18.02.2011 & 0:15 & meld/tortoisehg installieren \\ - 20.02.2011 & 1:00 & Projektbeschreibung, jedit Probleme \\ - 25.02.2011 & 1:00 & Ausarbeitung Meilensteine \\ - 26.02.2011 & 1:00 & Ausarbeitung Ist-/Soll-Zustand, {\it context}s studieren\\ - 28.02.2011 & 1:15 & Einführungsbeispiel {\it context}s \\ - 28.02.2011 & 1:15 & Projektplan erstellen, formatieren \\ - 01.03.2011 & 1:00 & Projektplan überarbeiten, Stundenlisten \\ -\end{tabular} - -\subsection*{\isac{} auf die letzte Isabelle-Release updaten} -\begin{tabular}[t]{lll} - {\bf Datum} & {\bf Stunden} & {\bf Beschreibung} \\ - 18.02.2011 & 2:45 & Anpassungen an Isabelle2011 \\ - 20.02.2011 & 2:45 & Update auf Isabelle2011, Fehlersuche \\ - 21.02.2011 & 6:30 & ... \\ - 25.02.2011 & 5:30 & ... \\ - 26.02.2011 & 4:30 & ... \\ - 03.03.2011 & 5:00 & ... \\ - 04.03.2011 & 6:00 & Tests reparieren \\ -\end{tabular} - -\subsection*{Parsen aus \textit{contexts}} -\begin{tabular}[t]{lll} - {\bf Datum} & {\bf Stunden} & {\bf Beschreibung} \\ - 02.03.2011 & 1:30 & vorbereitendes Übungsbeispiel \\ - 03.03.2011 & 1:00 & ... \\ - 04.03.2011 & 5:00 & Funktion {\tt parseNEW} schreiben \\ - 05.03.2011 & 3:00 & Funktion {\tt vars} anpassen, {\tt declare\_constraints} neu \\ - 07.03.2011 & 8:45 & {\tt parseNEW}, Spezifikationen studieren \\ - 08.03.2011 & 6:00 & {\it context} in zentrale Datenstrukturen einbauen \\ - 09.03.2011 & 2:00 & Fehlersuche {\it context}-Integration \\ -\end{tabular} - -\subsection*{Spezifikationsphase mit \textit{context}s} -\begin{tabular}[t]{lll} - {\bf Datum} & {\bf Stunden} & {\bf Beschreibung} \\ - 10.03.2011 & 2:30 & {\it context} in {\tt prep\_ori} und {\tt appl\_add} einbauen\\ - 11.03.2011 & 5:45 & {\tt appl\_add} überarbeiten \\ - 12.03.2011 & 5:15 & Fehlersuche \\ - 14.03.2011 & 2:00 & ... \\ - 16.03.2011 & 2:30 & ... \\ - 17.03.2011 & 1:45 & ... \\ - 18.03.2011 & 4:45 & ..., Optimierung \\ - 19.03.2011 & 5:30 & ... \\ - 21.03.2011 & 3:00 & Abschluss Spezifikationsphase \\ -\end{tabular} - -\subsection*{L\"osungsphase mit \textit{context}s} -\begin{tabular}[t]{lll} - {\bf Datum} & {\bf Stunden} & {\bf Beschreibung} \\ - 22.03.2011 & 4:30 & {\it context} in Funktion {\tt solve} einbauen\\ - 23.03.2011 & 4:45 & Tests reparieren \\ - 24.03.2011 & 3:30 & ... \\ - 25.03.2011 & 2:00 & ... \\ - 03.04.2011 & 4:00 & ... \\ - 05.04.2011 & 8:00 & Optimierung \\ - 06.04.2011 & 7:15 & L\"osung Exponentenoperator \\ - 07.04.2011 & 7:00 & ... \\ - 12.04.2011 & 3:30 & Projektbericht \\ -\end{tabular} - -\end{document} diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/msteger/README --- a/src/Doc/isac/msteger/README Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -bakk-arbeit/ contains stylefiles required for Bernhard Aichernig's format. -These probably go to a shared directory. \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/msteger/bakk-arbeit/CLEANUP --- a/src/Doc/isac/msteger/bakk-arbeit/CLEANUP Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -rm *.dvi -rm *.bbl -rm *.blg -rm *.aux -rm *.log -rm *.nav -rm *.out -rm *.snm -rm *.toc -rm *~ diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/msteger/bakk-arbeit/content.tex --- a/src/Doc/isac/msteger/bakk-arbeit/content.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,607 +0,0 @@ -\chapter{Definition der Aufgabenstellung} -\section{Detaillierte Beschreibung der Aufgabenstellung} -Zu Beginn des Projekts wurden einige Vorgaben und Ziele des Projektes erarbeitet und im Laufe des Projekts angepasst wo notwendig. Es wurde bewusst auf eine zu einschr\"ankende Aufgabenstellung verzichtet, da Entwicklungen und Erarbeitungen von verschiedenen Umsetzungsstrategien erw\"unscht war. - -Hauptaugenmerk war dabei auf die Erstellung eines jEdit-Plugins gelegt worden, das als Vorarbeit zu Back's Structured Derivations dienen soll. Mit anderen Worten, es sollte so viel Plugin-Code, wie im begrenzten Projektzeitraum m\"oglich, implementiert werden. - -Weiters sollte eine Projektstruktur aufgebaut werden, die die Initialisierungsarbeiten von weiterf\"uhrende bzw. nachfolgende Projekten erleichtert und somit verk\"urzt. Dabei sollte darauf geachtet werden, dass die vom Isabelleteam bereits verwendete Projekthierarchie soweit wie m\"oglich \"ubernommen bzw. erweitert wird. -Die nachfolgende Auflistung soll die wichtigsten Tasks nochmals zusammenfassen: -\begin{enumerate} -\item Relevante Isabelle Komponenten identifizieren und studieren -\item Installation der Standard-Komponenten -\item Entwicklungsumgebung vom Isabelle-Team kopieren -\item Relevante Komponenten implementieren -\begin{itemize} -\item jEdit Plugin f\"ur SD -\item zugeh\"origen Parser -\item nicht vorgesehen: SD-Interpreter in Isar (SML) -\end{itemize} -\end{enumerate} -In Abs.\ref{zusammenfassung} wird r\"uckblickend zusammengefasst, welche dieser Punkte in welchem Ausma\ss{} in dieser Bachelor-Arbeit erledigt wurden. - -\chapter{Beleuchtung der Projekt-relevanten Technologien} -Dieses Kapitel soll die vielen unterschiedlichen Technologien, die im Rahmen dieser Arbeit verwendet oder zumindest ber\"uhrt wurden, beleuchten und dem Leser helfen, nachfolgende Zusammenh\"ange zu verstehen. Nat\"urlich kann in keines der folgenden Themen sehr tief eingestiegen werden. Viel mehr sollen die nachfolgenden Ausf\"uhrungen einen groben \"Uberblick \"uber die einzelnen Technologien geben. -\section{Back's Structured Derivations} -Wie in der Aufgabenstellung bereits beschrieben, war die Erstellung eines Structured Derivation Plugins das Hauptziel dieser Arbeit. Aus diesem Grund wird in diesem Absatz kurz auf die von Prof. Ralph-Johan Back einf\"uhrten Structured Derivations eingegangen und dessen Eigenschaften bzw. Zusammenh\"ange beschrieben. - -Das nachfolgende Beispiel zeigt ein einfaches Beispiel, wie eine Formel mittels SD dargestellt bzw. umgeformt werden kann: - -%{\footnotesize -\begin{tabbing} -123,\=1234\=1234\=1234\=1234\=1234\=1234\=123\=\kill -\>$\bullet$\>Simplify $(1 - x) * (x ^ 2 + 1) + x ^ 3 - x ^ 2$\\ -\> \>$(1 - x) * (x ^ 2 + 1) + x ^ 3 - x ^ 2$\\ -\>$\equiv$\>$\{ {\it RewriteSet}\;{\it purify}\}$\\ -\> \>$(1 + -1 * x) * (x ^ 2 + 1) + x ^ 3 + -1 * x ^ 2$\\ -\>$\equiv$\>$\{{\it RewriteSet}\;{\it simplify\_pure}\}$\\ -\> \>$\bullet$\>$(1 + -1 * x) * (x ^ 2 + 1) + x ^ 3 + -1 * x ^ 2$\\ -\> \>$\equiv$\>$\{{\it RewriteSet}\;{\it expand\_poly\_}\}$ \\ -\> \> \>$1 * x ^ 2 + 1 * 1 + (-1 * x * x ^ 2 + -1 * x * 1) + x ^ 3 +-1 * x ^ 2$\\ -\> \>$\equiv$\>\vdots\\ -\> \> \>$1 + -1 * x + 0 * x ^ 2 + 0 * x ^ 3$\\ -\> \>$\equiv$\>$\{{\it RewriteSet}\;{\it reduce\_012\_}\}$ \\ -\> \> \>$1 + -1 * x$\\ -\>\dots\>$1 + -1 * x$\\ -\>$\equiv$\>$\{{\it RewriteSet}\;{\it beautify}\}$\\ -\> \>$1-x$ -\end{tabbing} -%} - -Dieses Beispiel kann wie folgt interpretiert werden: -\begin{enumerate} -\item Die erste Zeile ist als Angabe bzw. Ausgangspunkt der Berechnung zu verstehen. -\item Nun folgt der eigentliche Ablauf einer Umformung mittels SD: Mit der Formel in der zweiten Zeile beginnt die Berechnung. -\item Die n\"achste Zeile gibt nun an, wie die Formel aus der direkt dar\"uberliegenden Zeile umgeformt bzw. aufbereitet wird. Es ist also eine Beschreibung bzw. die passende Rechenregel, um von der Ausgangsformel auf die nachfolgende Formel schlie{\ss}en zu k\"onnen. -\item Aus dieser Rechenvorschrift ergibt sich die Formel in der n\"achsten Zeile. -\item Dieser Ablauf wiederholt sich und zieht sich \"uber die weiteren Berechnungen. -\end{enumerate} - -Back liefert mit SD eine sehr gute Darstellungs- und Verbarbeitungs-Richtlinie, die einerseits dem Leser/Anwender hilft, da durch die Regel- bzw. Beschreibungs-Zeile klar gestellt wird, wie der letzte Berechnungsschritt durchgef\"uhrt wurde. Andererseits bringt SD auch f\"ur den Programmierer einen klaren Vorteil, da \"uber die vorgestellten Sonderzeichen das Parsen von \textit{SD-Code} vereinfacht bzw. direkt (ohne extra Schl\"usselw\"orter einf\"uhren zu m\"ussen) m\"oglich ist. - -\section{Der Texteditor jEdit}\label{jEdit} -% http://www.jedit.org/ -% http://de.wikipedia.org/wiki/JEdit -% http://www.chip.de/downloads/jEdit_19235021.html -% -jEdit ist ein in Java geschriebener und als Open-Source-Projekt erh\"altlicher Texteditor, der vor allem durch sein sehr gut entwickeltes und ebenso einfaches Plugin-Management-System sehr effektiv eingesetzt werden kann. Solche Plugins k\"{o}nnen direkt in jEdit installiert oder durch manuelles Hinzuf\"{u}gen eines Plugin-Paketes genutzt werden. Dadurch ist dieser Editor sehr flexibel in der Anwendung und kann den eigenen Bed\"{u}rfnissen perfekt angepasst werden. -Diese Umst\"ande sind wohl auch der Grund, warum sich die Entwickler von Isabelle f\"ur diesen Editor entschieden haben. Hierbei ist zu erw\"{a}hnen, dass hier eine etwas modifizierte bzw. an Isabelle angepasste Version verwendet wird. Es empfiehlt sich daher, immer die aktuelle Version des Isabelle-jEdit-Editors (zB. aus dem Bundle erh\"{a}ltlich auf der Isabelle-Homepage) zu verwenden, da hier diverse Voreinstellungen vorgenommen wurden. In weiterer Folge wird mit jEdit immer diese modifizierte Version des Editors in Verbindung gebracht, da die Verwendung der Grundversion aus oben genannten Gr\"{u}nden nicht zu empfehlen bzw. sinnvoll ist. -Weiters sollte noch erw\"ahnt werden, dass es rund um jEdit einen sehr guten Support via Mailinglist gibt und man wirklich rasch Hilfestellung bekommen kann. - -\subsection{Das Plugin-System} -% http://jedit.org/users-guide/writing-plugins-part.html -Wie im vorigen Abschnitt bereits erw\"ahnt, ist es sehr einfach und bequem m\"oglich, geeignete Plugins zu installieren bzw. zu verwenden. Es stehen bereits sehr viele verschiedenste Plugins auf der jEdit-Homepage zur Verf\"{u}gung. Diese werden ebenfalls als Open-Source-Projekte angeboten und es bietet sich daher an, bereits verf\"ugbare und funktionierende Plugins als Teil eines neuen Plugins zu verwenden und gegebenenfalls kleine Modifikationen oder Erweiterungen an den Plugins durchzuf\"{u}hren. Im Beispiel von Isabelle wurden unter anderem die Plugins \textit{Sidekick} und \textit{Konsole} verwendet. Dabei ist es m\"oglich, dass Java-Plugins mit Scala-Plugins kombiniert werden, da diese auch problemlos miteinander kommunizieren k\"{o}nnen. -jEdit bietet einen Plugin-Manager an, mit dem sich sehr einfach bereits installierte Plugins verwalten und updaten lassen und es ist auch m\"{o}glich, neue Plugins direkt zu installieren. -Weiters bietet sich die M\"oglichkeit, selbst implementierte Plugins direkt zu den bereits vorhandenen jEdit-Plugins hizuzuf\"{u}gen. Dazu muss das erzeugte "Plugin".jar Paket ledigich in den jars-Ordner verschoben werden. Beim Start von jEdit wird das neue Plugin automatisch erkannt und hinzugef\"{u}gt. Man muss aber darauf achten, dass \"{A}nderungen nur nach einem Neustart von jEdit \"{u}bernommen werden. - - -\subsection{Pluginstruktur} -Ein solches jEdit-Plugin muss nat\"{u}rlich ein gewisses Design umsetzen, um von jEdit korrekt ausgef\"{u}hrt werden zu k\"{o}nnen. Grunds\"{a}tzlich besteht ein solches Plugin aus den eigentlichen Sourcefiles und einigen XML- und Property-Datein. -Ein m\"{o}glicher Aufbau kann dem Beispiel-Plugin "QuickNotepad"\footnote{http://jedit.org/users-guide/writing-plugins-part.html}, das auf der jEdit-Homepage zu finden ist, entnommen bzw. als Ausgangspunkt f\"{u}r die Entwicklung eines eigenen Plugins herangezogen werden. Weitere Informationen k\"{o}nnen auch dem Paper "Userinterfaces for Computer Theorem Provers" entnommen werden. - -\section{Isabelle} -Isabelle ist einer der f\"{u}hrenden CTPs und an dessen Weiterentwicklung wird st\"{a}ndig gearbeitet. Der letzte gro{\ss}e Schritt betraf den Umstieg von reinem ML auf die "Mischsprache" Scala(mit funktionalen sowie imperativen Sprachanteilen). Weiters wurde der in die Jahre gekommene Proof General und der damit in Verbindung stehende Editor Emacs durch den vielseitigen Editor jEdit ersetzt. Dadurch ergeben sich auch f\"{u}r das laufende \sisac-Projekt an der TU Graz neue M\"{o}glichkeiten. Wichtig im Zusammenhang mit dieser Beschreibung ist zu erw\"{a}hnen, dass hier in weiterer Folge nur noch f\"{u}r jEdit bzw. Scala relevante Teile von Isabelle behandelt und beschrieben werden. Weiters ist wichtig zu wissen, dass f\"{u}r die bereits bestehende Struktur rund um Isablle-jEdit zwei Isabelle-Pakete zum Einsatz kommen. Auf diese Pakete soll in den n\"{a}chsten Passagen eingegangen werden. - -\subsection{Isabelle-Pure} -In diesem Plugin ist der eigentliche CTP-Teil von Isabelle verpackt. Das bedeutet im weiteren Sinn, dass es hier keine grafische Verarbeitung der Daten gibt, sondern der Zugriff von aussen erforderich ist, um den CTP mit Daten zu versorgen und diese nach deren Verabreitung in Isabelle-Pure auszuwerten. Also ist nur hier eine Schnittstelle zum eigentlichen Proofer m\"{o}glich und deshalb ist dieses Plugin f\"{u}r das \sisac-Projekt von zentraler Bedeutung. Standardm\"{a}{\ss}ig ist bereits ein Pure.jar-Paket f\"{u}r jEdit vorhanden. Um SD umsetzten zu k\"{o}nnen, muss hier eine Schnittstelle zu Isabelle-Pure implementiert werden. Nach diesem Schritt kann das Plugin Pure.jar neu gebaut werden. -Eine Auflistung der f\"ur das Isabelle-Pure-Packet ben\"otigten Scala-Source-Filles kann Anhang B.2 entnommen werden. - -\subsection{Isabelle-jEdit} -Dieser Teil von Isabelle repr\"{a}sentiert das Frontend in jEdit. Hier wird also die grafische Aufbereitung der von Isabelle-Pure berechneten Daten \"{u}bernommen. Dieses Plugin zeigt sehr sch\"{o}n, wie bereits bestehende Plugins weiter genutzt und erweitert werden k\"{o}nnen. -An diesem Plugin wird von Seiten der Isabelle-Entwickler sehr stark weitergearbeitet. Darum sollten hier wohl nicht zu viele, am besten nat\"{u}rlich keine \"{A}nderungen, vorgenommen werden. Der Umstand, dass sich einzelne Plugins ganz einfach in einem anderen mitverwenden lassen, macht es m\"{o}glich, dass das \sisac-Plugin sehr einfach, im Idealfall von Seiten der Isabelle-Entwickler, in das Isabelle-jEdit-Plugin integriert werden kann. - -\subsection{Paketstruktur von Isabelle} -Durch die Komplexit\"{a}t des Isabelle-Entwicklungs-Aufbaus soll hier eine Auflistung aller relevanten jar-Pakete erfolgen. Alle Pakete befinden sich innerhalb der Ordnerstruktur von ISABELLE\_HOME. Darum wird ab hier immer von diesem Verzeichnis ausgegangen. -Die nachfolgende Auflistung zeigt alle Pakete, die f\"{u}r SD bzw. {\sisac} von Bedeutung sind und und wo diese zu finden sind. - - -\begin{itemize} -\item \textit{contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars:} \textbf{Isabelle-jEdit.jar, Pure.jar, SideKick.jar, ...} Der Ordner contrib ist in der Repository-Version nicht vorhanden! Dieser kann dem Isabelle-Bundle entnommen werden. Hier befinden sich alle ben\"{o}tigten Zusatztools f\"{u}r Isabelle und darunter eben auch jEdit. In dem oben angef\"{u}hrten Ordner liegen alle Plugins bzw. dorthin werden alle Plugins kopiert, die zusammen mit jEdit gestartet werden sollen. -\item \textit{lib/classes:} \textbf{isabelle-scala.jar, pure.jar;} Standardm\"{a}{\ss}ig ist dieser Ordner nicht vorhanden. Erst durch Erzeugen der angef\"{u}hrten jar's werden dieser Ordner und die Pakete erstellt. -\item \textit{src/Tools/jEdit/dist/jars:} \textbf{Isabelle-jEdit.jar, Pure.jar, SideKick.jar, jedit.jar, ...} -\item \textit{src/Tools/jEditC/dist/jars:} \textbf{Isabelle-jEdit.jar, Pure.jar, SideKick.jar, jedit.jar, ...} Diese beiden obigen Verzeichnisse sind, wie man an der sehr \"{a}hnlichen Pfadstruktur erkennen kann, \"{a}quivalent, wobei der zweite Pfad zum \sisac-Entwicklungsverzeichnis geh\"{o}rt. Hier sind die f\"{u}r das Isabelle-jEdit- bzw. \sisac-Plugin ben\"{o}tigten Plugins und Pakete plus das erzeugte Plugin zu finden. -\item \textit{src/Tools/jEditC/contrib/jEdit/build/jars:} \textbf{Isabelle-jEdit.jar, Pure.jar, SideKick.jar, jedit.jar, ...} Diesen Aufbau ben\"{o}tigt man nur, wenn man das jEdit-Isac-Projekt direkt in NetBeans debuggen m\"{o}chte. Man erkennt, dass in diesem Verzeichnis der vollst\"{a}ndige Quellcode von jEdit plus allen Plugins, die zusammen mit jEdit gestartet werden sollen, hier zu finden sind. Wie aber bereits erw\"{a}hnt, ist vom direkten Debuggen generell abzuraten bzw. sollte dies nur f\"ur schwer nachvollziebare Abl\"aufe ohne Isabelle-Beteiligung angewendet werden. -\end{itemize} - -Siehe dazu auch Anhang B. Dort sind alle relevanten jar-Pakete noch einmal aufgelistet und entsprechend gruppiert. - -\section{Die Programmiersprache Scala} -Urspr\"{u}nglich wurde Isabelle rein in ML entwickelt. Erst vor ein paar Jahren wurde mit der \"{U}bersetzung von einigen Teilen in Scala begonnen. Grund genug, sich hier kurz diese neue und sehr vielseitige Sprache etwas genauer anzusehen. - -\subsection{Grundlage der Sprache} -Scala \cite{odersky:scala06} ist eine objektorientierte Sprache, die sehr \"{a}hnlich zu Java aufgebaut wurde. Dadurch wird die Einarbeitung in diese Programmiersprache f\"{u}r Java-Programmierer sehr vereinfacht. Neben den Vorteilen einer objektorientierten Sprache deckt Scala aber auch die Bed\"{u}rfnisse der funktionalen Programmierung \cite{pl:milner97} ab. Dies, und vorallem auch das von Erlang \cite{armstrong:erlang96} \"ubernommene und sehr gut umgesetzte Actorprinzip \cite{Haller:2009:SAU:1496391.1496422,scala:jmlc06}, sind wohl die Hauptgr\"unde, warum sich das Isabelle-Entwicklungsteam f\"{u}r diese Sprache entschieden hat. Wie bereits erw\"{a}hnt, ist Scala sehr \"{a}hnlich aufgebaut wie Java und hat nebenbei noch den gro{\ss}en Vorteil, dass Scala-Executables in der JVM (Java virtual Machine) ausf\"{u}hrbar sind. Dadurch ist die Plattformunabh\"{a}ngigkeit garantiert und es besteht ein direkter Zusammenhang zwischen Scala und Java der auch bei der jEdit-Plugin-Entwicklung ausgenutzt bzw. verwendet wird. - -Dieser direkte Zusammenhang zwischen Java und Scala soll anhand der Grafik-Bibliotheken Swing gezeigt bzw. die Vorteile, die daraus resultieren, beleuchtet werden. - -Beide Sprachen stellen diese Grafik-Bibliotheken zur Verf\"{u}gung (und darin auch eigene Shapes und Funktionalit\"{a}t). Es ist jedoch m\"{o}glich, Java-Bibliotheken, wie eben Java-Swing in Scala zu verwenden. Ein JButton(Java) kann zum Beispiel mittels \textit{import javax.swing.JButton} in Scala eingebunden und damit sofort verwendet werden. Auch Scala stellt in seiner Swing-Bibliothek einen Button zur Verf\"{u}gung: \textit{scala.swing.Button}. Es wird nahezu dieselbe Funktionalit\"{a}t angeboten und teilweise die Erzeugung bzw. Verwendung vereinfacht. Man kann sich nun fragen, warum sich die Scala-Entwickler einerseits die M\"{u}he gemacht haben, die Verwendung Java-Swing, wie in Java selbst, m\"{o}glich zu machen und andererseits mit Scala-Swing eine nahezu idente Alternative geschaffen haben. - -Die Antwort darauf zeigt, wie die Objektorientiertheit von Scala in vielen Bereichen ausgenutzt wurde, um die Sprache mit Funktionalit\"{a}t auszur\"{u}sten, denn es wurde kein neues Konzept f\"{u}r diese Grafikklassen entworfen, sondern Wrapper-Objekte/ Methoden/Klassen erstellt, die das Arbeiten mit diesen Grafikkomponenten erleichtern soll. -Ein Letztes Problem bleibt noch: Es ist zwar sehr einfach ein Java-Swing-Objekt an einen Scala-Swing-Container (zb. Frame) anzubinden, da eine Konvertierung einer Java-Komponente in ein Scala-\"{a}quivalent problemlos m\"{o}glich ist. Jedoch ist oft auch die Konvertierung einer Scala- in eine Java-Komponente n\"{o}tig. Dies kann ganz einfach mittels \textit(peer)-Befehl der Komponente erreicht werden. - -Das angef\"{u}hrte Beispiel soll zeigen, wie vielseitig Scala sein kann und welch enormes Potenzial in dieser noch sehr jungen Sprache steckt. Nat\"{u}rlich gibt es dazu eine sehr gut aufgebaute Entwickler-Homepage\footnote{http://www.scala-lang.org/}, die Tutorials, Plugin f\"{u}r diverse IDEs und weitere n\"{u}tzliche Hilfestellungen f\"{u}r Scala-Neulinge bereitstellt. - -\subsection{Scala, Java und jEdit} -Wie im letzten Abschnitt bereits beschrieben, kommen bei jEdit Java- sowie auch Scala-Komponenten zum Einsatz bzw. werden sogar zu logischen Einheiten kombiniert. So ist zum Beispiel jEdit selbst rein in Java geschrieben und das Plugin Isabelle-jEdit rein in Scala. Trotzdem gibt es \"{u}berhaupt kein Problem, diese beiden jar-File miteinander bzw. ineinander in der JVM zu nutzen. Es geht sogar so weit, dass es m\"{o}glich ist, dass das Plugin Isabelle-jEdit bereits vorhandene und rein in Java geschriebene Plugins erweitert und nutzt. Dieses Zusammenspiel zwischen Objekten aus zwei verschiedenen Sprachen ist doch recht au\ss ergew\"{o}hnlich und kann bzw. sollte nat\"{u}rlich auch f\"{u}r SD bzw. {\sisac} ausgenutzt werden! - -\subsection{Der Isabelle-Scala-Layer} -Es sollten nun die Grundlegenden Eigenschaften von Scala bekannt sein. Die Einf\"uhrung des Scala-Layers ab Isabelle-Version 2009 war ein grosser Schritt f\"ur das Isabelle Projekt. Das Scala-Actor-Konzept erm\"oglicht die asynchrone Verarbeitung von einzelnen Beweisteilen und ist einer der massgeblichen Gr\"unde f\"ur die Einf\"uhrung des Scala-Layer. - -In diesem Absatz sollen nun die Eigenschaften des Scala-Layers und die damit verbundenen Chancen f\"ur das Isac- bzw. SD-Projektes -erarbeitet werden. - -\begin{figure} -\begin{center} -\includegraphics[width=100mm]{../fig-reuse-ml-scala-SD.png} -\end{center} -\label{fig-reuse-ml-scala} -\caption{Der Scala-Layer zwischen Java und SML} -\end{figure} - -Wie %Fig.\ref{fig-reuse-ml-scala} WARUM GEHT DAS NICHT ??? -Fig.3.1 -zeigt, verbindet der Scala-Layer die Java Virtual Maschine (JVM) und den in Standart-ML (SML) geschriebenen Isabelle-Kern. Dabei wird ein internes Protokoll verwendet, dass den Datenaustausch zwischen jEdit und Isabelle/Isar erm\"oglicht. Dieses Protokoll ist im Moment noch (bewusst) ohne API ausgef\"uhrt. Aus diesem Grund musste eine Schnittstelle definiert werden, um den Datenaustausch des SD-Plugins (JVM) mit dem SD-Interpreter m\"oglich zu machen. Siehe dazu den Absatz "Verbindung zum Isabelle-Pure Plugin herstellen". Man kann aus diesem Umstand ableiten, dass die Isabelle-Entwickler mit diesem eingezogenen Scala-Layer und dem damit verbundenen internen Protokoll, auf eine konsistente Verwaltung der Theorie-Bibliotheken abzielen. Mit anderen Worten wird dem Anwendungsprogrammierer der direkte Zugriff auf die Isabelle/Isar-Komponente verwehrt. Der Anwender sollte hier also nicht angreifen sonder die Isabelle-Theorien entsprechend erweitern. - -\chapter{Konfiguration und Implementation der Komponenten} -Dieses Kapitel soll nun anhand der bereits gewonnen Erkenntnise illustrieren, wie die Entwicklungsumgebung vom Isabelle-Team kopiert wurde und wie wichtigsten Schritte zum SD-Plugin f\"{u}r jEdit wahrscheinlich aussehen werden. Wobei einige Schritte parallel und dadurch nat\"{u}rlich sehr gut im Team umgesetzt werden k\"{o}nnen. Eine genaue Aufstellung aller beteiligten Files k\"onnen dem Anhang \ref{files-SD-plugin} entnommen werden. - -\section{Konfiguration des Netbeans- (NB-) Projektes} -Um in k\"unftigen Entwicklungsvorhaben effizient kooperieren zu k\"onnen, wurde das NB-Projekt genau nach den Vorgaben des Isabelle-Teams konfiguriert. Voraussetzung f\"ur die Konfiguration sind die Files aus dem Repository laut Anhang \ref{files-SD-plugin}. Die Konfiguration des NB-Projektes ``testSD-jedit'' erfolgt in folgenden Schritten: - -\begin{enumerate} -\item Softwarekomponenten aus dem Isabelle\_bundle checken; diese sind alle im Verzeichnis {\tt contrib}: - \begin{enumerate} - \item {\tt contrib/scala-\dots} Scala-Compiler und Runtime-System - \item {\tt contrib/scala-\dots} jEdit - \item {\tt src/Tools/jEditC} der Code f\"ur das Test-Plugin - \end{enumerate} -\item Konfigurations-Files von Netbeans im ``Files''-View checken; Achtung: die Files beeinflussen sich gegenseitig, direkte Eingriffe sind problematisch: -\begin{enumerate} -\item {\tt build.xml} wurde direkt aus dem Template in {\tt src/Tools/jEdit/} erzeugt; von hier nimmt NB die Daten um Daten in (Teilen von den) anderen Konfigurations-Files zu \"andern; NB nimmt hier keine automatischen Ver\"anderungen vor. -\item {\tt nbproject/build-impl.xml} z.T. automatisch erzeugt aus {\tt build.xml} und z.T. untenstehenden Files -\item {\tt nbproject/genfiles.properties} -\item {\tt nbproject/project.properties}, z.B. Projekt-Name -\item {\tt nbproject/project.xml} -\end{enumerate} -\item Sacla-plugin installieren laut {\tt http://wiki.netbeans.org/Scala69}, -\begin{enumerate} -\item insbesonders siehe ``Install with NetBeans 6.9'' -\item nach {\tt /usr/local/netbeans.../plugins/scala/} kopieren -\end{enumerate} -\item Scala-plugin in NB installieren -\begin{enumerate} -\item Men\"u $>$ Tools $>$ Plugins $>$ Downloaded $>$ Add Plugins -\item alle Files von {\tt /usr/local/netbeans\dots/plugins/scala/} ausw\"ahlen -\item Fenster in ``Add Plugins'' zeigt alle ausgew\"alten Files -\item $<$Install$>$ ruft den Wizzard auf, $<$Next$>$ erzeugt i.A. ein ``Warning'' das zu \"ubergehen ist -\item Funktionstest: Men\"ue $>$ Files $>$ New Project: zeigt Scala als ``Categories'' -\end{enumerate} -\item Neues Projekt ``testSD-jedit'' konfigurieren -\begin{enumerate} -\item Men\"u $>$ Open Project (weil schon aus dem Repository die notwendigen Files vorhanden sind) -\item /src/Tools/jeditC: Reference Problems, weil jEdit die Plugins von \ref{plugins} braucht -\item Funktionskontrolle: ``Projects''-View zeigt das neue Projekt.\\ - Die Konfigurations-Files sind v\"ollig getrennt von denen anderer Projekte~! -\item\label{reference-pbl} Referenz-Probleme beheben; das zeigt auch eventuell fehlende Files: -\begin{enumerate} -\item ``Projects''-View $>$ rightMouse $>$ Resolve Reference Problems: Fenster zeigt dieListe der fehlenden Dateien; $<$Next$>$ -\item Files holen aus ``Tools'' $>$ Libraries: \"uber Filebrowser aus dem Isabelle\_bundle holen {\tt contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars} -\item\label{plugins} ``New Library'' -\begin{enumerate} -\item Cobra-renderer: cobra.jar -\item Console: Console.jar -\item ErrorList: ErrorList.jar -\item Hyperlinks: Hyperlinks.jar -\item Isabelle-Pure: Pure.jar -\item Rhino-JavaScript: js.jar -\item Scala-compiler: scala-compiler.jar -\item SideKick: SideKick.jar -\end{enumerate} -\item Funktions-Kontrollen -\begin{enumerate} -\item das kleine gelbe Warndreieck im ``Projects''-View ist verschwunden -\item im ``Projects''-View sind nun 2 Ordner: {\tt src} und {\tt Libraries} -\end{enumerate} -\end{enumerate} -\item jEdit-Paket zum ``testSD-jedit''-Projekt hinzuf\"ugen -\begin{enumerate} -\item ``Project''-View $>$ rightMouse $>$ Add Jar/Folder: Filebrowser -\item /contrib/jedit.../jedit.jar -\item Funktions-Kontrolle: ist in ``Projects''/Libraries/jedit.jar -\end{enumerate} -\item Das neue Projekt ``testSD-jedit'' zum Hauptprojekt machen: ``Project''-View $>$ rightMouse $>$ Set as Main Project; Funktions-Kontrolle: der Projektname ist boldface. -\end{enumerate} -\item den neuen Isabelle/Scala-Layer ({\tt Pure.jar}) erzeugen mit {\tt bin/testSD}; siehe Pkt.\ref{build-isa-scala} unten. -\end{enumerate} - -\noindent Ab nun wird die Konfiguration \"uber ``trial and error'' zu Ende gef\"uhrt; die unten angef\"uhrten Fehler entstanden durch Umbenennung des Projektes von ``isac-jedit'' auf ``testSD-jedit'' w\"ahrend der oben beschriebenen Installation. -\begin{enumerate} -\item Build des Plugins schl\"agt fehl: Men\"u $>$ Build Main - \begin{enumerate} - \item Fehler: {\it Target ``Isac-impl.jar'' does not exist in the project ``testSD-jedit''. It is used from target ``debug''} - \begin{enumerate} - \item\label{restart-NB} Versuch - \begin{itemize} - \item {\tt build-impl.xml} l\"oschen - \item NetBeans neu starten, stellt build-impl.xml automatisch aus build.xml wieder her - \item \dots hat in diesem Fall nicht geholfen - \end{itemize} - \item Versuch zur Vermutung: Projekt wurde umbenannt von ``Isac'' in ``testSD-jedit'', entsprechende Eintr\"age in den Konfigurations-Dateien wurden automatisch richtig ersetzt, aber nicht in {\tt build.xml} - \begin{itemize} - \item in {\tt build.xml} query-replace ``isac-jedit'' in ``testSD-jedit'' - \end{itemize} - \end{enumerate} - \item Fehler: {\it Problem: failed to create task or type scalac} - \begin{enumerate} - \item Versuch: Pfad zum Scala bekanntgeben - \begin{itemize} - \item {\tt /usr/local/netbeans-6.9.1/etc/netbeans.conf}: netbeans\_default\_options= \dots richtigen Scala-Pfad setzen - \item build-impl.xml l\"oschen - \item NetBeans neu starten (siehe \ref{restart-NB}). - \end{itemize} - \end{enumerate} - \item Wenn Fehler: {\it /usr/local/isabisac/src/Tools/jEditC/\${project.jEdit}/modes does not exist} - \begin{enumerate} - \item grep -r "project.jEdit" * - \item {\tt nbproject/project.properties}: project.jEdit=contrib/jEdit - \end{enumerate} - \end{enumerate}%??indent -\item Fehlersuche in den Project Files, nicht in {\tt build.xml}:\\ -{\it src/Tools/jEditC/src/testSD.scala:225: error: value Isac is not a member of package isabelle} - \begin{enumerate} - \item den Link zu {\tt testSD.scala:22} folgen - \item\label{build-intermed} als Zwischenschritt eine noch nicht erzeugte Class ``Isac'' auskommentieren; siehe Pkt.\ref{build-intermed-end} unten\\ -val str1: String = isabelle.Isac.parse(``Testdaten aus dem Parser!'')\\ - val str1: String = ``TEST'' //isabelle.Isac.parse(``Testdaten aus dem Parser!'') - \item nochmals Men\"u $>$ Build (Hammer) \dots successful (wegen auskommentierter Zeile) - \item in der Konsole beobachten, welche Files kopiert werden und vergleichen mit {\tt build.xml}, z.B. - $<$target name=''-pre-jar''$>$ - $<$target name=''-post-jar''$>$ - \item {\tt bin/testSD} ausf\"uhren \dots - \item =dots stellt den entscheidender Schritt dar: ein neues {\tt Pure.jar} wurde erzeugt; dieses ist nun erweitert mit einer class {\tt Isac}; diese Klasse wurde erzeugt durch Code in \\{\tt scr/Pure/Isac/isac.scala} - \item\label{build-intermed-end} den Zwischenschritt Pkt.\ref{build-intermed} oben r\"uckg\"angig machen:\\ - ``val str1: String = isabelle.Isac.parse(``Testdaten aus dem Parser!'')".\\ - Dieser Befehl braucht das {\em neue} {\tt Pure.jar} am richtigen Platz \dots - \item \dots das Shellscript {\tt bin/testSD\_jedit} erzeugt dieses {\tt Pure.jar} - \end{enumerate} -\item\label{build-isa-scala} Fehler beim Exekutieren von {\tt bin/testSD} - \begin{enumerate} - \item einfach auf die ``error messages'' schauen, eg. {\it src/Pure/: no such file or directory} \dots - \item \dots hei\ss t, dass das Skript nicht vom richtigen Pfad {\tt \~{\,}\~{\,}} gestartet wurde --- dieses Skript sollte also verbessert werden. - \item Funktionstest: \\ - \#\#\#\\ - \#\#\# Building Isabelle/Scala layer\\ - \#\#\# - \end{enumerate} -\item Fehlermeldung beim Starten des Plugins aus NB, die \"ubergehen sind: -\begin{verbatim} -/home/neuper/.jedit/jars/Console.jar: -Two copies installed. Please remove one of the two copies. -/home/neuper/.jedit/jars/Hyperlinks.jar: -Two copies installed. Please remove one of the two copies. -/home/neuper/.jedit/jars/SideKick.jar: -Two copies installed. Please remove one of the two copies. -/home/neuper/.jedit/jars/ErrorList.jar: -Two copies installed. Please remove one of the two copies. -\end{verbatim} -Fehler zu beseitigen mit {\tt rm -r \~/jedit/jars} -\item \textit{Referenzproblem} auf {\tt Pure.jar}: siehe Pkt.\ref{reference-pbl} auf S.\pageref{reference-pbl}. - -%$<$ $>$ -%Men\"u $>$ $>$ $>$ $>$ $>$ $>$ -%``Project''-View $>$ rightMouse $>$ $>$ $>$ $>$ $>$ -%\item -% \begin{enumerate} -% \item -% \begin{enumerate} -% \item -% \begin{itemize} -% \item -% \begin{itemize} -% \item -% \item -% \item -% \end{itemize} -% \item -% \item -% \end{itemize} -% \item -% \item -% \end{enumerate} -%\item -%\item -%\end{enumerate} -%\item -%\begin{enumerate} -%\item -%\begin{enumerate} -%\item -%\begin{itemize} -%\item -%\begin{itemize} -%\item -%\item -%\item -%\end{itemize} -%\item -%\item -%\end{itemize} -%\item -%\item -%\end{enumerate} -%\item -%\item -%\end{enumerate} -\end{enumerate} - - -\section{Implementation der jEdit Komponenten} - -\subsection{Erstellen des Plugin-Ger\"{u}sts} -Hier gilt es, erstmal den Umfang der gew\"{u}nschten Anforderungen an das Plugin so genau wie m\"{o}glich zu identifizieren. Hat man eine sehr genaue Vorstellung, wie das GUI des Plugins aussehen wird und welche Zusatz-Features angeboten werden sollen, so kann man gezielt unter den bereits bestehenden Plugins f\"{u}r jEdit nach n\"{u}tzlichen Plugins suchen, die in das SD-Plugin (m\"{o}glicherweise durch kleine Modifikationen) integriert werden k\"{o}nnen. Dies spart einerseits sehr viel Zeit und ist nebenbei genau die Art von Programmierung, die durch die offnene Plugin-Struktur von jEdit gef\"{o}rdert wird. - -Hat man nun die Planung abgeschlossen und m\"{o}glicherweise n\"{u}tzliche Plugins gefunden, kann mit der Programmierung des GUIs begonnen werden. Man sollte hier beachten, dass man von Beginn an festlegt, ob mit Scala- oder Java-Swing Komponenten gearbeitet werden soll. Es ist zwar m\"{o}glich, beide Formen zu mischen, doch aus Klarheitsgr\"{u}nden sollte man sich f\"{u}r eine Art entscheiden. Wobei hier die Empfehlung im Moment eher noch Richtung Java-Swing geht, da man hier eigentlich f\"{u}r jede Art von Problem bzw. Aufgabe bereits HowTo's im Web finden kann. Da bei Scala-Swing nur Wrapper auf die Java-Swing-Libraries gesetzt wurden, entsteht dadurch auch keinerlei Performance-Verlust. - -Es existiert bereits ein beispielhaftes Plugin am \sisac-Repository. Da der grunds\"{a}tzliche Aufbau eines jEdit-Plugins soweit umgesetzt wurde und bereits lauff\"{a}hig ist, sollte man dieses wohl als Ausgangspunkt verwenden. Die direkte Verwendung eines Isabelle-Klons ist wohl zu Beginn nicht zu empfehlen bzw. sollte meiner Meinung nach die Integration von Isac in Isabelle bzw. die Verwachsung der beiden Plugins das Fernziel sein und dadurch w\"{u}rde der Klon-Vorgang wohl eher Probleme schaffen als sie zu l\"{o}sen. - -\subsection{Erzeugung des Plugins} -Hat man die Planung des Plugin-Ger\"{u}sts abgeschlossen und die eigentliche Implementationsphase begonnen, kann dieses Plugin getestet bzw. erzeugt und via jEdit ausgef\"{u}hrt werden. Dazu muss zuerst das jar-File erzeugt und danach in den jEdit-Pluginsordner verschoben werden. Die Erzeugung kann nat\"{u}rlich direkt mittels NetBeans durchgef\"{u}hrt werden. Doch es ist auch m\"{o}glich dies via Kommandline durchzuf\"{u}hren. Folgende Schritte illustrieren wie die Erzeugung und der Kopiervorgang des Plugins durchgef\"{u}hrt werden k\"{o}nnen(Ausschnitt aus dem Skript isac\_jedit, Anhang C): -\begin{enumerate} -\item Das Plugin kann mittels Kommandline folgenderma{\ss}en erstellt werden: \\ \textit{cd ISABELLE\_HOME/src/Tools/isac/jEdit} $\rightarrow$ \textit{ant jar} -\item Nun kann das das neue Plugin ganz einfach kopiert werden \textit{cp contrib/jEdit/build/ // jars/Isac.jar ../../../../contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/} -\item jEdit ausf\"{u}hren und testen -\end{enumerate} - -\subsection{Verbindung zum Isabelle-Pure Plugin herstellen} -Der n\"{a}chste Schritt sieht nun die Versorgung des GUIs mit Daten vor. Da das jEdit-Plugin selbst nicht rechnen/interpretieren kann, m\"{u}ssen Daten an den Isabelle-Kern, also das Isabelle-Pure-Plugin, {\tt Pure.jar}, weitergegeben werden. Dort k\"{o}nnen die Daten verwertet und aufbereitet zur\"{u}ck an das Frontend gereicht werden. - -\begin{figure} -\begin{center} -\includegraphics[width=100mm]{../fig-jedit-plugins-SD.png} -\end{center} -\label{fig-jedit-plugins-SD} -\caption{jEdit Plugins und die Verbindung zu Isabelle} -\end{figure} - -%Fig.\ref{fig-jedit-plugins-SD} WARUM GEHT DAS NICHT ??? -Fig.4.1 zeigt die involvierten Komponenten und ihren Zusammenhang. - -Der Zusammenhang zwischen dem Kern von Isabelle, Isabelle-Pure und dem Plugin wird folgenderma\ss en hergestellt: Zun\"{a}chst wird {\tt Pure.jar} leicht modifiziert, danach neu erstellt und zuletzt zu den restlichen jEdit-Plugins hinzugef\"{u}gt. Dies wurde auf der aktuellen Version am Repository bereits erledigt. Folgende Schritte wurden dazu gesetzt und sind wieder n\"{o}tig, da sicher weitere Modifikationen an der Datei Pure.jar n\"{o}tig sein werden. - - -\begin{enumerate} -\item Um den \sisac-Teil im Isabelle-Pure genau abzugrenzen, wurde ein Ordner \textit{Isac} angelegt und ein Testfile \textit{isac.scala} erstellt. -\item Nun muss diese File nat\"{u}rlich dem Make-Skript \textit{ISABELLE\_HOME/src/Pure/build-jars} hizugef\"{u}gt werden, um beim Erzeugen des jar-Files mitverpackt zu werden. -\item Nun kann Pure.jar mittels Kommandline erstellt werden: \textit{cd /src/Pure} $\rightarrow$ \textit{../../bin/isabelle env ./build-jars} -\item Nun kann das das neue Plugin ganz einfach kopiert werden \textit{cp ../../lib/classes/Pure.jar ../../contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/} -\item jEdit ausf\"{u}hren und testen -\end{enumerate} -Alle die oben angef\"{u}hrten Punkte, sowie das Erzeugen und Kopieren des Plugins selbst, werden vom Script isac\_jedit erledigt. -Das Skript kann dem Anhang C entnommen werden. - -\section{``Run Configurations''} -Zwischen Isabelle2009-2 und Isabelle2011 hat sich viel ge\"andert. Jetzt mit Isabelle2011 sieht es folgenderma\ss en aus: - -Am Anfang der Plugin-Entwicklung wird man versuchen, ohne eine Verbindung zu Isabelle auszukommen; in sp\"ateren Phase wird man genau diese Verbindung brauchen. Starten eines Plugins in NB mit gleichzeitigem Hochfahren von Isabelle ist schwierig. - -Folgende M\"oglichkeiten gibt es beim Debuggen: - -\begin{enumerate} -\item Man macht alles in Netbeans. Mit dem -Disabelle.home=... sollte man - die Applikation direkt aus der IDE starten und profilen/debuggen - k\"onnen. Das war der urspr\"ungliche Plan des ganzen Setups, d.h. der - Grund warum er so kompliziert ist. - -\item Man startet aus der Shell \"uber "isabelle jedit -d" und verbindet - dann den Netbeans debugger (oder jeden anderen JVM debugger) \"uber - den hier ausgegebenen Port. - -\item Man startet "isabelle jedit", geht dann in das "Console" Plugin und - w\"ahlt dort das "Scala" Sub-Plugin aus. Nach ca. 5s Bedenkzeit steht - der interaktive Scala toplevel innerhalb von Isabelle/jEdit zur - Verf\"ugung. Nun kann man direkt Dinge auswerten etc. und schauen was - passiert. - - Auf dem Cambridge Workshop 2010, {\tt T06\_System.thy} sind Beispiele zu finden. - Siehe subsection Isabelle/Scala. Man aktuviert dazu Isabelle/jEdit - mit obigem thy File und kopiert die Scala snippets aus dem Text - zeilenweise in das Console/Scala Fenster. - -\item Man streut einfach {\tt System.err.println} in seinen Code ein. -\end{enumerate} -Die M\"oglichkeiten (3) oder (4) sind zu bevorzugen. - -Ferner gibt es einige externe JVM Diagnose-Tools. Zu nennen sind {\tt jvisualvm} oder {\tt jconsole} um threads, heaps, profiles etc. anzuschauen, da sich das alles gerne verheddert. - -Richtig koordiniertes Hochfahren aller Komponenten braucht ein Shellscript wie {\tt isabelle jedit}. - -\section{Umsetzung des SD-Parsers} -Aus diversen Gr\"{u}nden wurde dieser Punkt im Zuge dieser Projektarbeit nicht mehr umgesetzt sonder nach hinten verschoben. Jedoch gibt es bereits eine Version des Parsers in ML und diese kann in einigen Arbeitsstunden in Zusammenarbeit mit Herrn Neuper in Scala \"{u}bersetzt und eingesetzt werden. - -Es ist bereits ein Parser in ML im Isabelle-Verzeichnis vorhanden, \textit{src/Pure/isar/ parse.ML}. Hier werden sogannte "parse combinators" verwendet. Dasselbe wird in n\"{a}chster Zeit von Seiten des Isabelle-Team auch f\"{u}r den Scala-Parse implementiert. Dadurch lassen sich hieraus auch wichtige Erkenntnisse gewinnen und dies spricht ebenfalls f\"{u}r die Verschiebung dieses Milestones nach hinten. - - -\chapter{Ausblick: Von SD- zum \isac-Plugin} -Die obigen Schritte sind n\"{o}tig, um das vorl\"{a}ufige Plugin SD umzusetzen. Nat\"{u}rlich beginnt danach die spannende Arbeit erst so richtig. Ist erst mal ein funktionierender SD-Parser vorhanden, kann dieser immer weiter verbessert und verfeinert werden, bis man auch damit beginnen kann, ihn f\"{u}r das \sisac-Projekt zu nutzen. - -Daneben kann an der Weiterentwicklung des GUIs gearbeitet werden und die ersten Schritte zur Ann\"{a}herung an das Isabelle-Plugin k\"{o}nnen hier erfolgen. - -\chapter{Zusammenfassung und R\"{u}ckblick} -Zusammenfassend wird nun ein \"Uberblick gegeben, welche Milestones erledigt wurden und welche nicht; Details dazu finden sich in Anhang A. %TODO -Abschlie{\ss}end gebe ich einen R\"uckblick auf meine pers\"onlichen Erfahrungen aus dieser Bakkalaureats-Arbeit. - -\section{Zusammenfassung}\label{zusammenfassung} -Folgende Milestones wurden erfolgreich abgeschlossen: -\begin{enumerate} -\item Relevante Isabelle Komponenten dokumentiert - -\item Installation der Standard-Komponenten: -\begin{itemize} -\item Mercurial Versioncontrol -\item NetBeans IDE -\item Standard Isabelle Bundle -\end{itemize} - -\item Entwicklungsumgebung vom Isabelle-Team kopieren -\begin{itemize} -\item Isabelle-Sources vom Repository M\"unchen (Java, Scala, ML) -\item jEdit als NetBeans Projekt definiert -\end{itemize} - -\item Relevante Komponenten implementieren -\begin{itemize} -\item jEdit Plugin f\"ur SD -\item Verbindung des Plugins zu Isabelle -\item zugeh\"origen Parser: nur ein Test in SML -\end{itemize} -\end{enumerate} - -\noindent Aus Zeitgr\"unden war {\em nicht} m\"oglich, ein komplettes SD-Plugin zu implementieren; dazu w\"are auch ein Interpreter f\"ur SD auf der ML-Seite n\"otig gewesen. - -\paragraph{Voraussetzungen f\"ur k\"unftige Entwicklung} geschaffen: -\begin{enumerate} -\item f\"ur die Implementation von ``structured derivations'' in Isabelle \dots -\item \dots als Vorarbeit f\"ur jEdit als k\"unftiges \isac-Frontend -\item f\"ur Mitarbeit an k\"unftiger Integration von Isabelle in Entwicklungswerkzeuge (Testcase-Generation etc). -\end{enumerate} - -\section{R\"uckblick} -Isabelle ist ein sehr gro\ss es Softwarepacket mit mehreren Millionen LOC. Daher gestaltete sich die Einarbeitungsphase sehr schwierig und kostet sehr viel Zeit. Erschwerend kam hinzu, dass ich von Beginn an mit mehreren, f\"{u}r mich noch ganz neue, Technologien arbeiten musste. Diese Herausforderungen schon zu Beginn machten die Arbeit an \sisac{ }von Beginn an spannend. Hier ist mir vorallem die gemeinsam mit meinem Betreuer Herrn Walther Neuper durchgef\"{u}hrte Installationsarbeit von Isabelle in Erinnerung geblieben. Nie zuvor hatte ich f\"{u}r eine Installation von Software so lange gebraucht - eine ganz neue, wichtige Erfahrung. - -Einer der bedeutensten Milesteine war r\"{u}ckblickend wohl, die Verzeichnisstruktur von Isabelle grunds\"atzlich verstanden zu haben. Bei einem Softwarepacket von dieser Gr\"{o}{\ss}e war es wichtig zu wissen, wo man Files suchen/modifizieren/einf\"{u}gen muss, um den gew\"{u}nschten Effekt erreichen zu k\"onnen. - -Der n\"achste wichtige Schritt war das bereits teilweise bestehende NetBeansprojekt lauff\"ahig zu machen und mir damit zum ersten mal selbst das jEdit-Isabelle-Plugin erzeugen zu k\"onnen. Dies war ein sehr bedeutsamer Schritt, da ich hier zum einen NetBeans und dessen Konfiguration besser kennenlernen konnte und zum anderen sehr viel \"{u}ber die Pluginstruktur eines jEdit-Plugins lernen konnte. Zu Beginn machte mir hier der Mix aus Scala-, Java-, XML- und diversen Config-Files Probleme. - -Bis jetzt hatte ich eigentlich noch nicht wirklich mit der Programmierung des Plugins begonnen doch es waren schon zig Arbeitsstunden rein f\"{u}r Einarbeitungs- und Vorbereitungsaufgaben verstrichen - wieder eine neue Erfahrung f\"{u}r mich. Nach einigen Test- bzw. Beispielprogrammen um die Sprache Scala etwas kennenzulernen, begann die wohl spannenste Phase im Projektverlauf. Das in Java geschriebene Beispielplugin "Quick-Notepad" wurde in Scala \"{u}bersetzt und etwas abge\"andert. - -Der letzte wirklich bedeutende Schritt war Herstellung der Verbindung zwischen Isabelle-Pure und \sisac. Dieser Punkt ist sehr wichtig, da ohne diese Schnittstelle die Planung des SD-Parser nicht m\"oglich gewesen w\"are. Der letzte Schritt, also die Implementation des SD-Parsers wurde aufgeschoben, da es derzeit seitens des Isabelle-Teams ebenfalls Bestrebungen gibt, einen neuen Scala-Parser zu designen und wir von diesen Erkenntnissen mit Sicherheit in der Zunkft profitieren k\"onnen. - -%Abschlie{\ss}end m\"ochte ich mich bei meinem Betreuer Herrn Walther Neuper sehr herzlich f\"{u}r die gute Betreuung und die spannenden Entwicklungsstuden bedanken. Es war eine sehr lehrreiche und interessante Projektarbeit! - -%\chapter{Milestones und Arbeitsprotokolle} -%\section{Inhaltliche Voraussetzungen erarbeitet: beendet am 27.09.2010} -%\begin{itemize} -%\item Kenntnis der Grundlagen und Anwendung von CTP: beendet am 03.08.2010 -%\item Charakteristika der Programmsprache Scala: beendet am 27.09.2010 -%\item Scala Actors: beendet am 12.08.2010 -%\end{itemize} -%\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} -%\hline -%Datum & T\"atigkeit & Einheiten \\ \hline -%12.07.2010 & Meeting: erste Besprechung und Erkl\"{a}rungen zu Isabelle, Isac und CTPs & 2 \\ \hline -%15.07.2010 & Recherche \"{u}ber Isabelle und CTPs & 3 \\ \hline -%20.07.2010 & Meeting: Besprechen der grunds\"{a}tzlichen Vorgangsweise und Ziele & 1 \\ \hline -%23.07.2010 & Isabelle: Ziele, Techniken (ML) und Zusammenh\"{a}nge mit Isac abkl\"{a}ren & 1 \\ \hline -%30.07.2010 & Ende der Einarbeitungstage: weitere Vorgensweise \"{u}ber Backs 'structured derivations'; Begriffserkl\"{a}rung & 3 \\ \hline -%01.08.2010 & Recherche: Buch f\"{u}r Scala & 2 \\ \hline -%03.08.2010 & Isabelle bestehende Technologie studieren & 4 \\ \hline -%05.08.2010 & Einarbeiten in Scala: Unterschiede zu Java indentifizieren & 1 \\ \hline -%06.08.2010 & Einarbeiten in Scala: Unterschiede zu Java indentifizieren, erste Beispielfiles & 4 \\ \hline -%08.08.2010 & Einarbeiten in Scala: funktionale Seite von Scala & 2 \\ \hline -%09.08.2010 & Einarbeiten in Scala: Testfiles mit Scala-Swing & 5 \\ \hline -%12.08.2010 & Studieren von Papers zu Scala Actors & 3 \\ \hline -%24.09.2010 & Scala: Arbeiten mit Klassen und Schnittstellen & 3 \\ \hline -%25.09.2010 & Scala: Experimente mit Java in Scala-Source & 6 \\ \hline -%27.09.2010 & Scala: Testfiles zu "Funktional vs Imperativ" & 4 \\ \hline \hline -% & Anzahl der Einheiten & 44 \\ -%\hline -%\end{tabular} -% -% -%\section{Technische Voraussetzungen hergestellt: beendet am 02.08.2010} -%\begin{itemize} -%\item Isabelle installiert, Filestruktur bekannt: beendet am 02.08.2010 -%\item Scala in NetBeans eingebunden: beendet am 22.07.2010 -%\item Mercurial installiert und einrichten des Repositories: beendet am 19.07.2010 -%\end{itemize} -%\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} -%\hline -%Datum & T\"atigkeit & Einheiten \\ \hline -%19.07.2010 & Beginn der Installationsarbeiten: Repo klonen und testen & 6 \\ \hline -%20.07.2010 & Installationsarbeiten, Einarbeiten in Filestruktur & 7 \\ \hline -%21.07.2010 & Einarbeiten in Filestruktur & 6 \\ \hline -%22.07.2010 & Vorbereitungen: NetBeans, JDK und Scala installieren. Scala in NetBeans integrieren & 8 \\ \hline -%23.07.2010 & Isabelle-jEdit-Plugin mittels NetBeans ausf\"{u}hren: testen & 5 \\ \hline -%27.07.2010 & Isabelle-jEdit-Plugin: \"{a}nderungen an der Projektstruktur & 7 \\ \hline -%28.07.2010 & Experimente mit Isabelle-jEdit-Plugin & 6 \\ \hline -%29.07.2010 & Identifikations der Parse-Einstiegsstelle & 5 \\ \hline -%30.07.2010 & Experimente mit Isabelle-jEdit-Plugin, Besprechung \"{u}ber Erfahrungen mit Filestruktur & 4 \\ \hline -%02.08.2010 & Installationen und einrichten des Repos auf meinen Laptop & 6 \\ \hline \hline -% & Anzahl der Einheiten & 60 \\ -%\hline -%\end{tabular} -% -%\section{NetBeans-Projekt aufgesetzt: beendet am 02.08.2010} -%\begin{itemize} -%\item Grundlegende Projektstruktur f\"ur ISAC hergestellt: beendet am 02.08.2010 -%\item jEdit-Plugin: XML-Files f\"{u}r ISAC vorbereitet: beendet am 22.07.2010 -%\item jEdit-Plugin: Source files geschrieben: beendet am 19.07.2010 -%\end{itemize} -%\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} -%\hline -%Datum & T\"atigkeit & Einheiten \\ \hline -%10.08.2010 & Projektstruktur anlegen, build.xml anpassen & 7 \\ \hline -%11.08.2010 & jEdit-Plugin-Struktur studieren: Howto durcharbeiten & 5 \\ \hline -%21.08.2010 & bestehende jEdit-Plugins (Java) durcharbeiten & 3 \\ \hline -%22.08.2010 & Kopieren des Isabelle-jEdit-Plugins, Umarbeiten f\"{u}r ISAC & 3 \\ \hline -%24.08.2010 & Umarbeiten des Isabelle-Plugins f\"{u}r ISAC & 6 \\ \hline -%26.08.2010 & Problem mit Isabelle-Umgebungsvariable: Suche nach L\"{o}sungen & 3 \\ \hline -%28.08.2010 & Recherchen zum Umgebungsvariable-Problem, Arbeiten mit den Isabelle-Shell-Skripts & 2 \\ \hline -%29.08.2010 & Experimente mit den Path-Varialbe der jvm & 3 \\ \hline -%30.08.2010 & Isabelle-jEdit-Plugin endlich vollst\"{a}ndig lauff\"{a}hig gebracht & 4 \\ \hline -%01.09.2010 & Arbeiten an der jEdit-ISAC-Projektstruktur & 3 \\ \hline -%04.09.2010 & Umarbeiten des Isabelle-Plugins f\"{u}r ISAC & 5 \\ \hline -%20.09.2010 & Einrichten des Laptops f\"{u}r Isabelle-Isac & 4 \\ \hline -%22.09.2010 & Meeting: Fortschrittsbericht, kurze Einf\"{u}hrung f\"{u}r Mitstreiter & 3 \\ \hline -% -%29.09.2010 & Neue Vorgehensweise: QuickNotepad-Plugin(QN) wird in Scala \"{u}bersetzt und f\"{u}r ISAC entsprechend angepasst: Arbeit an den XML-Files & 4 \\ \hline -%30.09.2010 & QN: Start mit \"{u}bersetzten der Sourcefiles & 5 \\ \hline -%02.10.2010 & QN: \"{U}bersetzten der Sourcefiles & 6 \\ \hline -%04.10.2010 & QN: \"{U}bersetzten der Sourcefiles: Problem bei Interface & 3 \\ \hline -%05.10.2010 & QN: QN vollst\"andig in Scala \"{u}bersetzt, testen & 2 \\ \hline \hline -% & Anzahl der Einheiten & 71 \\ -%\hline -%\end{tabular} -% -%\section{Experimentelle Parser implementiert: beendet am 04.03.2011} -%\begin{itemize} -%\item Experimente mit dem SideKick-Parser abgeschlossen: beendet am 03.02.2011 -%\item Verbindung zu Isabelle-Pure hergestellt: beendet am 04.03.2011 -%\item Implementierung des Scala-Parsers: aufgeschoben -%\end{itemize} -%\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} -%\hline -%Datum & T\"atigkeit & Einheiten \\ \hline -%28.01.2011 & Testen des SideKick-Parsers im Isabelle-Plugin & 2 \\ \hline -%29.01.2011 & Leichte Modifikationen des SideKick-Parsers im Isabelle-Plugin & 1 \\ \hline -%08.02.2011 & Besprechung zum Abschluss der praktischen Arbeiten & 1 \\ \hline -%16.02.2011 & Erstellen des Isabelle-Pur jar-Files & 1 \\ \hline -%19.02.2011 & Behebung des Problems mit den Umgebungsvariablen & 1 \\ \hline -%03.03.2011 & Erzeugung des Pure.jar Package m\"{o}glich & 2 \\ \hline -%04.04.2011 & Verbindung zwischen Plugin und Isabelle-Pure hergestellt und getestet & 3 \\ \hline -%08.04.2011 & Besprechung: Implementierung des experimentellen Parsers wird nicht mehr durchgef\"{u}hrt & 1 \\ \hline \hline -% & Anzahl der Einheiten & 12 \\ -%\hline -%\end{tabular} -% -%\section{Verfassen der Dokumentation und abschliesende Arbeiten: beendet am TO.DO.2011} -%\begin{itemize} -%\item Bacc.-Protokoll fertiggestellt: beendet am 01.03.2011 -%\item Dokumentation: erste Version fertiggestellt: beendet am 28.04.2011 -%\item Dokumentation abgeschlossen: beendet am TO.DO.2011 -%\end{itemize} -%\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} -%\hline -%Datum & T\"atigkeit & Einheiten \\ \hline -%01.03.2011 & Besprechung zum Ablauf der Dokumentationsarbeiten: Protokoll und Dokumentation & 1 \\ \hline -%01.03.2011 & Erstellen des Protokolls & 2 \\ \hline -%08.03.2011 & Besprechung zur Doku und zur Schnittstelle zu Isabelle-Pure & 1 \\ \hline -%17.03.2011 & Dokumentation schreiben & 2 \\ \hline -%19.03.2011 & Dokumentation schreiben & 3 \\ \hline -%24.04.2011 & Dokumentation schreiben & 2 \\ \hline -%25.04.2011 & Dokumentation schreiben & 4 \\ \hline -%27.04.2011 & Dokumentation schreiben & 2 \\ \hline -%28.04.2011 & Dokumentation: Fertigstellen der ersten Version & 3 \\ \hline \hline -% & Anzahl der Einheiten & 20 \\ -%\hline -%\end{tabular} -% -%\section{Pr\"asentation der Arbeit im IST-Seminar }% am ..(*)...} diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/msteger/bakk-arbeit/master_thesis.bib --- a/src/Doc/isac/msteger/bakk-arbeit/master_thesis.bib Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,187 +0,0 @@ -% Add your bibtex entries - -@Book{aichernig:uni-iist-02, - editor = {Aichernig, Bernhard K. and Maibaum, Tom}, - title = {Formal Methods at the Crossroads. From Panacea to Foundational Support. -{10th Anniversary Colloquium of UNU/IIST, the International Institute for Software Technology of The United Nations University}}, - publisher = {Springer-Verlag}, - year = {2003}, - volume = {2757}, - series = {Lecture Notes in Computer Science}, - address = {Lisbon, Portugal}, - month = {March 18-20, 2002} -} - -@InCollection{aichernig:mut-test, - author = {Aichernig, Bernhard}, - title = {A systematic introduction to mutation testing in unifying theories of programming}, - booktitle = {Testing Techniques in Software Engineering}, - pages = {243--287}, - publisher = {Springer Berlin / Heidelberg}, - year = {2010}, - editor = {Borba, Paulo and Cavalcanti, Ana and Sampaio, Augusto and Woodcook, Jim}, - volume = {6153}, - series = {Lecture Notes in Computer Science} -} - -@inproceedings{Aspinall:2007:FIP:1420412.1420429, - author = {Aspinall, David and L\"{u}th, Christoph and Winterstein, Daniel}, - title = {A Framework for Interactive Proof}, - booktitle = {Proceedings of the 14th symposium on Towards Mechanized Mathematical Assistants: 6th International Conference}, - series = {Calculemus '07 / MKM '07}, - year = {2007}, - isbn = {978-3-540-73083-5}, - location = {Hagenberg, Austria}, - pages = {161--175}, - numpages = {15}, - url = {http://dx.doi.org/10.1007/978-3-540-73086-6_15}, - doi = {http://dx.doi.org/10.1007/978-3-540-73086-6_15}, - acmid = {1420429}, - publisher = {Springer-Verlag}, - address = {Berlin, Heidelberg}, -} - -@Book{armstrong:erlang96, - author = {Armstrong, Joe and others}, - title = {Concurrent Programming in Erlang}, - publisher = {Prentice Hall}, - year = {1996} -} - -@TechReport{odersky:scala06, - author = {Odersky, Martin and others}, - title = {An Overview of the Scala Programming Language}, - institution = {\'Ecole Polytechnique F\'ed\'erale de Lausanne (EPFL)}, - year = {2006}, - type = {Technical Report LAMP-REPORT-2006-001}, - address = {1015 Lausanne, Switzerland}, - note = {Second Edition}, - annote = {http://www.scala-lang.org/sites/default/files/linuxsoft_archives/docu/files/ScalaOverview.pdf} -} - -@article{Haller:2009:SAU:1496391.1496422, - author = {Haller, Philipp and Odersky, Martin}, - title = {Scala Actors: Unifying thread-based and event-based programming}, - journal = {Theor. Comput. Sci.}, - volume = {410}, - issue = {2-3}, - month = {February}, - year = {2009}, - issn = {0304-3975}, - pages = {202--220}, - numpages = {19}, - url = {http://portal.acm.org/citation.cfm?id=1496391.1496422}, - doi = {10.1016/j.tcs.2008.09.019}, - acmid = {1496422}, - publisher = {Elsevier Science Publishers Ltd.}, - address = {Essex, UK}, - keywords = {Actors, Concurrent programming, Events, Threads}, -} - -@InProceedings{scala:jmlc06, - author = {Philipp Haller and Martin Odersky}, - title = {Event-Based Programming without Inversion of Control}, - booktitle = {Proc. Joint Modular Languages Conference}, - year = 2006, - series = {Springer LNCS} -} - - -@InProceedings{makarius:isa-scala-jedit, - author = {Makarius Wenzel}, - title = {Asyncronous Proof Processing with {Isabelle/Scala} and {Isabelle/jEdit}}, - booktitle = {User Interfaces for Theorem Provers (UITP 2010)}, - year = {2010}, - editor = {C. Sacerdoti Coen and D. Aspinall}, - address = {Edinburgh, Scotland}, - month = {July}, - organization = {FLOC 2010 Satellite Workshop}, - note = {http://www4.in.tum.de/~wenzelm/papers/async-isabelle-scala.pdf} -} - -@Book{db:dom-eng, - author = {Bj{\o}rner, Dines}, - title = {Domain Engineering. Technology Management, Research and Engineering}, - publisher = {JAIST Press}, - year = {2009}, - month = {Feb}, - series = {COE Research Monograph Series}, - volume = {4}, - address = {Nomi, Japan} -} - -@inproceedings{Haftmann-Nipkow:2010:code, - author = {Florian Haftmann and Tobias Nipkow}, - title = {Code Generation via Higher-Order Rewrite Systems}, - booktitle = {Functional and Logic Programming, 10th International -Symposium: {FLOPS} 2010}, - year = {2010}, - publisher = {Springer}, - series = {Lecture Notes in Computer Science}, - volume = {6009} -} - -@Manual{coq1999, - title = {The Coq Proof Assistant}, - author = {Barras, B. and others}, - organization = {INRIA-Rocquencourt - CNRS-ENS Lyon}, - month = {July}, - year = {1999}, - pnote={},status={cited},source={mkm01.caprotti},location={} -} - -@Book{meta-ML, - author = {Gordon,M. and Milner,R. and Wadsworth,C. P.}, - title = {Edinburgh LCF: A Mechanised Logic of Computation}, - publisher = { Springer-Verlag}, - year = {1979}, - volume = {78}, - series = {Lecture Notes in Computer Science} -} - -@book{Paulson:Isa94, - title={Isabelle: a generic theorem prover}, - author={Paulson, Lawrence C. }, publisher={Springer-Verlag},year={1994}, - volume={828},series={Lecture Notes in Computer Science},address={},edition={},month={}, - note={With contributions by Topias Nipkow}, - status={},source={},location={-} - } - -@Book{pl:milner97, - author = {Robin Milner and Mads Tofte and Robert Harper and David MacQueen}, - title = {The Definition of Standard ML (Revised)}, - publisher = {The MIT Press}, - year = 1997, - address = {Cambridge, London}, - annote = {97bok375} -} - -@Article{back-grundy-wright-98, - author = {Back, Ralph and Grundy, Jim and von Wright, Joakim}, - title = {Structured Calculational Proof}, - journal = {Formal Aspects of Computing}, - year = {1998}, - number = {9}, - pages = {469-483} -} - -@Manual{isar-impl, - title = {The {Isabelle/Isar} Implementation}, - author = {Makarius Wenzel}, - month = {April 19}, - year = {2009}, - note = {With contributions by Florian Haftmann and Larry Paulson} -} - -@InProceedings{wenzel:isar, - author = {Wenzel, Markus}, - title = {Isar - a Generic Interpretative Approach to Readable Formal Proof Documents}, - booktitle = {Theorem Proving in Higher Order Logics}, - year = {1999}, - editor = {G. Dowek, A. Hirschowitz, C. Paulin, L. Thery}, - series = {LNCS 1690}, - organization = {12th International Conference TPHOLs'99}, - publisher = {Springer} -} - - diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/msteger/bakk-arbeit/thesis-acknowl.tex --- a/src/Doc/isac/msteger/bakk-arbeit/thesis-acknowl.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -%\begin{changemargin}{1.5cm}{1.5cm} - -%\chapter*{Acknowledgements} -%\addcontentsline{toc}{chapter}{Acknowledgements} - - - -\begin{center} -{\Large\bfseries Acknowledgements} -\end{center} -%\vspace*{3mm} - -\begin{changemargin}{1.5cm}{1.5cm} -I would like to thank Professor Berhard Aichernig for having prepared the grounds for this thesis by his work on test case generation and in particular in his interest in the computer theorem prover Isabelle. - -His general surveys on computer theorem proving, on programming languages in general, on functional programming in particular and on respective advantages in upcoming multi-core computing were inspiring and they motivate the directions for my future studies. - -Many thanks also to Walther Neuper, who was always available for the many intricacies of Isabelle/Isar and the technicalities involved when doing a bachelor project and writing a thesis. - -\begin{flushright} -Marco Steger \\ {\small Graz, June 30, 2011} -\end{flushright} -\end{changemargin} - -\selectlanguage{austrian} - -\vspace*{5mm} - -\begin{center} -{\Large\bfseries Danksagung} -\end{center} -%\vspace*{0mm} - -\begin{changemargin}{1.5cm}{1.5cm} -Ich mchte mich herzlich bei allen bedanken, die diese Bakkalaureats-Arbeit unterst\"utzt haben. - -Herr Professor Bernhard Aichernig hat die Voraussetzungen f\"ur die Themenstellung der Arbeit durch seine F\&E in Test-Case-Generation geschaffen; Isabelle geh\"ort auch zu seinem Tool-Set. - -Besonder inspirierend waren seine \"Uberblicks-Informationen zu Computer Theorem Proving, zu Programm-Sprachen im Allgemeinen und zu funktionalen Sprachen im Besonderen, die ihre Vorteile bei den kommenden Multi-Core-Prozessoren zum Tragen bringen werden; diese Informationen werden auch meine Entscheidung f\"ur Wahlf\"acher in den kommenden Semestern motivieren. - -Walther Neuper war immer hilfreich in allen technischen Fragen zu Isabelle/Isar und in organisatorischen Fragen zu Bachelor-Projekt und -Thesis. - -\begin{flushright} -Marco Steger \\ {\small Graz, am 30 Juni 2011} -\end{flushright} -\end{changemargin} - -\selectlanguage{english} - - - - - - - diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/msteger/bakk-arbeit/thesis-appendix.tex --- a/src/Doc/isac/msteger/bakk-arbeit/thesis-appendix.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,339 +0,0 @@ -\chapter{Milestones und Arbeitsprotokolle}\label{milestones} %\ref doesnt work outside this file ?!? -\section{Inhaltliche Voraussetzungen erarbeitet: beendet am 27.09.2010} -\begin{itemize} -\item Kenntnis der Grundlagen und Anwendung von CTP: beendet am 03.08.2010 -\item Charakteristika der Programmsprache Scala: beendet am 27.09.2010 -\item Scala Actors: beendet am 12.08.2010 -\end{itemize} -\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} -\hline -Datum & T\"atigkeit & Einheiten \\ \hline -12.07.2010 & Meeting: erste Besprechung und Erkl\"{a}rungen zu Isabelle, Isac und CTPs & 2 \\ \hline -15.07.2010 & Recherche \"{u}ber Isabelle und CTPs & 3 \\ \hline -20.07.2010 & Meeting: Besprechen der grunds\"{a}tzlichen Vorgangsweise und Ziele & 1 \\ \hline -23.07.2010 & Isabelle: Ziele, Techniken (ML) und Zusammenh\"{a}nge mit Isac abkl\"{a}ren & 1 \\ \hline -30.07.2010 & Ende der Einarbeitungstage: weitere Vorgensweise \"{u}ber Backs 'structured derivations'; Begriffserkl\"{a}rung & 3 \\ \hline -01.08.2010 & Recherche: Buch f\"{u}r Scala & 2 \\ \hline -03.08.2010 & Isabelle bestehende Technologie studieren & 4 \\ \hline -05.08.2010 & Einarbeiten in Scala: Unterschiede zu Java indentifizieren & 1 \\ \hline -06.08.2010 & Einarbeiten in Scala: Unterschiede zu Java indentifizieren, erste Beispielfiles & 4 \\ \hline -08.08.2010 & Einarbeiten in Scala: funktionale Seite von Scala & 2 \\ \hline -09.08.2010 & Einarbeiten in Scala: Testfiles mit Scala-Swing & 5 \\ \hline -12.08.2010 & Studieren von Papers zu Scala Actors & 3 \\ \hline -24.09.2010 & Scala: Arbeiten mit Klassen und Schnittstellen & 3 \\ \hline -25.09.2010 & Scala: Experimente mit Java in Scala-Source & 6 \\ \hline -27.09.2010 & Scala: Testfiles zu "Funktional vs Imperativ" & 4 \\ \hline \hline - & Anzahl der Einheiten & 44 \\ -\hline -\end{tabular} - - -\section{Technische Voraussetzungen hergestellt: beendet am 02.08.2010} -\begin{itemize} -\item Isabelle installiert, Filestruktur bekannt: beendet am 02.08.2010 -\item Scala in NetBeans eingebunden: beendet am 22.07.2010 -\item Mercurial installiert und einrichten des Repositories: beendet am 19.07.2010 -\end{itemize} -\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} -\hline -Datum & T\"atigkeit & Einheiten \\ \hline -19.07.2010 & Beginn der Installationsarbeiten: Repo klonen und testen & 6 \\ \hline -20.07.2010 & Installationsarbeiten, Einarbeiten in Filestruktur & 7 \\ \hline -21.07.2010 & Einarbeiten in Filestruktur & 6 \\ \hline -22.07.2010 & Vorbereitungen: NetBeans, JDK und Scala installieren. Scala in NetBeans integrieren & 8 \\ \hline -23.07.2010 & Isabelle-jEdit-Plugin mittels NetBeans ausf\"{u}hren: testen & 5 \\ \hline -27.07.2010 & Isabelle-jEdit-Plugin: \"{a}nderungen an der Projektstruktur & 7 \\ \hline -28.07.2010 & Experimente mit Isabelle-jEdit-Plugin & 6 \\ \hline -29.07.2010 & Identifikations der Parse-Einstiegsstelle & 5 \\ \hline -30.07.2010 & Experimente mit Isabelle-jEdit-Plugin, Besprechung \"{u}ber Erfahrungen mit Filestruktur & 4 \\ \hline -02.08.2010 & Installationen und einrichten des Repos auf meinen Laptop & 6 \\ \hline \hline - & Anzahl der Einheiten & 60 \\ -\hline -\end{tabular} - -\section{NetBeans-Projekt aufgesetzt: beendet am 02.08.2010} -\begin{itemize} -\item Grundlegende Projektstruktur f\"ur ISAC hergestellt: beendet am 02.08.2010 -\item jEdit-Plugin: XML-Files f\"{u}r ISAC vorbereitet: beendet am 22.07.2010 -\item jEdit-Plugin: Source files geschrieben: beendet am 19.07.2010 -\end{itemize} -\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} -\hline -Datum & T\"atigkeit & Einheiten \\ \hline -10.08.2010 & Projektstruktur anlegen, build.xml anpassen & 7 \\ \hline -11.08.2010 & jEdit-Plugin-Struktur studieren: Howto durcharbeiten & 5 \\ \hline -21.08.2010 & bestehende jEdit-Plugins (Java) durcharbeiten & 3 \\ \hline -22.08.2010 & Kopieren des Isabelle-jEdit-Plugins, Umarbeiten f\"{u}r ISAC & 3 \\ \hline -24.08.2010 & Umarbeiten des Isabelle-Plugins f\"{u}r ISAC & 6 \\ \hline -26.08.2010 & Problem mit Isabelle-Umgebungsvariable: Suche nach L\"{o}sungen & 3 \\ \hline -28.08.2010 & Recherchen zum Umgebungsvariable-Problem, Arbeiten mit den Isabelle-Shell-Skripts & 2 \\ \hline -29.08.2010 & Experimente mit den Path-Varialbe der jvm & 3 \\ \hline -30.08.2010 & Isabelle-jEdit-Plugin endlich vollst\"{a}ndig lauff\"{a}hig gebracht & 4 \\ \hline -01.09.2010 & Arbeiten an der jEdit-ISAC-Projektstruktur & 3 \\ \hline -04.09.2010 & Umarbeiten des Isabelle-Plugins f\"{u}r ISAC & 5 \\ \hline -20.09.2010 & Einrichten des Laptops f\"{u}r Isabelle-Isac & 4 \\ \hline -22.09.2010 & Meeting: Fortschrittsbericht, kurze Einf\"{u}hrung f\"{u}r Mitstreiter & 3 \\ \hline - -29.09.2010 & Neue Vorgehensweise: QuickNotepad-Plugin(QN) wird in Scala \"{u}bersetzt und f\"{u}r ISAC entsprechend angepasst: Arbeit an den XML-Files & 4 \\ \hline -30.09.2010 & QN: Start mit \"{u}bersetzten der Sourcefiles & 5 \\ \hline -02.10.2010 & QN: \"{U}bersetzten der Sourcefiles & 6 \\ \hline -04.10.2010 & QN: \"{U}bersetzten der Sourcefiles: Problem bei Interface & 3 \\ \hline -05.10.2010 & QN: QN vollst\"andig in Scala \"{u}bersetzt, testen & 2 \\ \hline \hline - & Anzahl der Einheiten & 71 \\ -\hline -\end{tabular} - -\section{Experimentelle Parser implementiert: beendet am 04.03.2011} -\begin{itemize} -\item Experimente mit dem SideKick-Parser abgeschlossen: beendet am 03.02.2011 -\item Verbindung zu Isabelle-Pure hergestellt: beendet am 04.03.2011 -\item Implementierung des Scala-Parsers: aufgeschoben -\end{itemize} -\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} -\hline -Datum & T\"atigkeit & Einheiten \\ \hline -28.01.2011 & Testen des SideKick-Parsers im Isabelle-Plugin & 2 \\ \hline -29.01.2011 & Leichte Modifikationen des SideKick-Parsers im Isabelle-Plugin & 1 \\ \hline -08.02.2011 & Besprechung zum Abschluss der praktischen Arbeiten & 1 \\ \hline -16.02.2011 & Erstellen des Isabelle-Pur jar-Files & 1 \\ \hline -19.02.2011 & Behebung des Problems mit den Umgebungsvariablen & 1 \\ \hline -03.03.2011 & Erzeugung des Pure.jar Package m\"{o}glich & 2 \\ \hline -04.04.2011 & Verbindung zwischen Plugin und Isabelle-Pure hergestellt und getestet & 3 \\ \hline -08.04.2011 & Besprechung: Implementierung des experimentellen Parsers wird nicht mehr durchgef\"{u}hrt & 1 \\ \hline \hline - & Anzahl der Einheiten & 12 \\ -\hline -\end{tabular} - -\section{Verfassen der Dokumentation und abschliesende Arbeiten: beendet am 30.Juni 2011} -\begin{itemize} -\item Bacc.-Protokoll fertiggestellt: beendet am 01.03.2011 -\item Dokumentation: erste Version fertiggestellt: beendet am 28.04.2011 -\item Dokumentation abgeschlossen: beendet am 30.Juni 2011 -\end{itemize} -\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} -\hline -Datum & T\"atigkeit & Einheiten \\ \hline -01.03.2011 & Besprechung zum Ablauf der Dokumentationsarbeiten: Protokoll und Dokumentation & 1 \\ \hline -01.03.2011 & Erstellen des Protokolls & 2 \\ \hline -08.03.2011 & Besprechung zur Doku und zur Schnittstelle zu Isabelle-Pure & 1 \\ \hline -17.03.2011 & Dokumentation schreiben & 2 \\ \hline -19.03.2011 & Dokumentation schreiben & 3 \\ \hline -24.04.2011 & Dokumentation schreiben & 2 \\ \hline -25.04.2011 & Dokumentation schreiben & 4 \\ \hline -27.04.2011 & Dokumentation schreiben & 2 \\ \hline -28.04.2011 & Dokumentation: Fertigstellen der ersten Version & 3 \\ \hline \hline - & Anzahl der Einheiten & 20 \\ -\hline -\end{tabular} - -\section{Pr\"asentation der Arbeit im IST-Seminar: beendet am 21.06.2011} -\begin{itemize} -\item Pr\"asentation fertiggestellt: beendet am 19.06.2011 -\item Pr\"asentation: abgehalten am 21.06.2011 -\end{itemize} -\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} -\hline -Datum & T\"atigkeit & Einheiten \\ \hline -06.06.2011 & Planung der Pr\"asentation & 2 \\ \hline -16.06.2011 & Verfassen der Pr\"asentation & 2 \\ \hline -18.06.2011 & Verfassen der Pr\"asentation & 3 \\ \hline -19.06.2011 & Pr\"asentation: Feinschliff & 2 \\ \hline -20.06.2011 & Vorbereiten der Pr\"asentation& 3 \\ \hline -21.06.2011 & Abhaltung und nachfolgende Diskussion & 1 \\ \hline \hline - & Anzahl der Einheiten & 13 \\ - \hline -\end{tabular} - -\chapter{Filestruktur Isabelle} -\section{jar-Packete} -\textbf{----- for "isabelle jedit \&"; contained in Isabelle\_bundle} \\ -./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jedit.jar \\ -./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/LatestVersion.jar \\ -./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/SideKick.jar \\ -./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/Console.jar \\ -./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/Pure.jar \\ -./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/Isac.jar \\ -./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/scala-compiler.jar \\ -./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/Isabelle-jEdit.jar \\ -./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/cobra.jar \\ -./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/js.jar \\ -./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/Hyperlinks.jar \\ -./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/scala-swing.jar \\ -./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/scala-library.jar \\ -./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/QuickNotepad.jar \\ -./contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/ErrorList.jar \\ -\textbf{----- scala system; contained in Isabelle\_bundle} \\ -./contrib/scala-2.8.1.final/misc/sbaz/scala-bazaars.jar \\ -./contrib/scala-2.8.1.final/misc/sbaz/sbaz-tests.jar \\ -./contrib/scala-2.8.1.final/misc/scala-devel/plugins/continuations.jar \\ -./contrib/scala-2.8.1.final/lib/scala-compiler.jar \\ -./contrib/scala-2.8.1.final/lib/scalap.jar \\ -./contrib/scala-2.8.1.final/lib/scala-swing.jar \\ -./contrib/scala-2.8.1.final/lib/scala-library.jar \\ -./contrib/scala-2.8.1.final/lib/jline.jar \\ -./contrib/scala-2.8.1.final/lib/scala-dbc.jar \\ -./contrib/scala-2.8.1.final/src/scala-library-src.jar \\ -./contrib/scala-2.8.1.final/src/scala-swing-src.jar \\ -./contrib/scala-2.8.1.final/src/scala-compiler-src.jar \\ -./contrib/scala-2.8.1.final/src/scala-dbc-src.jar \\ -./contrib/scala-2.8.1.final/src/sbaz-src.jar \\ -\textbf{----- Isars entry to SML from Scala-layer; } \\ -\textit{created according to 4.3.\#3 }\\ -./lib/classes/isabelle-scala.jar \\ -./lib/classes/Pure.jar \\\\ -\textit{\textbf{===== all below for NetBeans}} \\\\ -\textbf{----- standard Isabelle, started by $$ in NetBeans} \\ - \textit{description in 2.2.2} \\ -./src/Tools/jEdit/dist/jars/jedit.jar \\ -./src/Tools/jEdit/dist/jars/SideKick.jar \\ -./src/Tools/jEdit/dist/jars/Console.jar \\ -./src/Tools/jEdit/dist/jars/Pure.jar \\ -./src/Tools/jEdit/dist/jars/scala-compiler.jar \\ -./src/Tools/jEdit/dist/jars/Isabelle-jEdit.jar \\ -./src/Tools/jEdit/dist/jars/cobra.jar \\ -./src/Tools/jEdit/dist/jars/js.jar \\ -./src/Tools/jEdit/dist/jars/Hyperlinks.jar \\ -./src/Tools/jEdit/dist/jars/scala-swing.jar \\ -./src/Tools/jEdit/dist/jars/scala-library.jar \\ -./src/Tools/jEdit/dist/jars/ErrorList.jar \\ -\textbf{----- source of jEdit, required for $$ in NetBeans; \\} - adapted from NetBeans' webpages, \\ - \textit{description in 2.2.3.\#5} \\ -./src/Tools/jEditC/contrib/jEdit/build/jars/SideKick.jar \\ -./src/Tools/jEditC/contrib/jEdit/build/jars/Console.jar \\ -./src/Tools/jEditC/contrib/jEdit/build/jars/Pure.jar \\ -./src/Tools/jEditC/contrib/jEdit/build/jars/Isac.jar \\ -./src/Tools/jEditC/contrib/jEdit/build/jars/QuickNPScala.jar \\ -./src/Tools/jEditC/contrib/jEdit/build/jars/scala-compiler.jar \\ -./src/Tools/jEditC/contrib/jEdit/build/jars/Isabelle-jEdit.jar \\ -./src/Tools/jEditC/contrib/jEdit/build/jars/cobra.jar \\ -./src/Tools/jEditC/contrib/jEdit/build/jars/js.jar \\ -./src/Tools/jEditC/contrib/jEdit/build/jars/Hyperlinks.jar \\ -./src/Tools/jEditC/contrib/jEdit/build/jars/scala-swing.jar \\ -./src/Tools/jEditC/contrib/jEdit/build/jars/scala-library.jar \\ -./src/Tools/jEditC/contrib/jEdit/build/jars/ErrorList.jar \\ -./src/Tools/jEditC/contrib/jEdit/build/jEdit.jar \\ -\textbf{----- demo plugin, started by $$ in NetBeans \\} - \textit{description in 2.2.3.\#4} \\ -./src/Tools/jEditC/dist/jars/SideKick.jar \\ -./src/Tools/jEditC/dist/jars/Console.jar \\ -./src/Tools/jEditC/dist/jars/Pure.jar \\ -./src/Tools/jEditC/dist/jars/Isac.jar \\ -./src/Tools/jEditC/dist/jars/scala-compiler.jar \\ -./src/Tools/jEditC/dist/jars/cobra.jar \\ -./src/Tools/jEditC/dist/jars/js.jar \\ -./src/Tools/jEditC/dist/jars/Hyperlinks.jar \\ -./src/Tools/jEditC/dist/jars/scala-swing.jar \\ -./src/Tools/jEditC/dist/jars/scala-library.jar \\ -./src/Tools/jEditC/dist/jars/ErrorList.jar \\ - -\section{Scala-Files: Isabelle-Pure} -\textbf{General:}\\ -./src/Pure/General/xml.scala\\ -./src/Pure/General/linear\_set.scala\\ -./src/Pure/General/symbol.scala\\ -./src/Pure/General/exn.scala\\ -./src/Pure/General/position.scala\\ -./src/Pure/General/scan.scala\\ -./src/Pure/General/xml\_data.scala\\ -./src/Pure/General/yxml.scala\\ -./src/Pure/General/markup.scala\\ -./src/Pure/General/sha1.scala\\ -./src/Pure/General/timing.scala\\ -./src/Pure/General/pretty.scala\\ -\textbf{Concurent:}\\ -./src/Pure/Concurrent/volatile.scala\\ -./src/Pure/Concurrent/future.scala\\ -./src/Pure/Concurrent/simple\_thread.scala\\ -\textbf{Thy:}\\ -./src/Pure/Thy/html.scala\\ -./src/Pure/Thy/completion.scala\\ -./src/Pure/Thy/thy\_header.scala\\ -./src/Pure/Thy/thy\_syntax.scala\\ -./src/Pure/Isac/isac.scala\\ -./src/Pure/library.scala\\ -\textbf{Isar:}\\ -./src/Pure/Isar/keyword.scala\\ -./src/Pure/Isar/outer\_syntax.scala\\ -./src/Pure/Isar/token.scala\\ -./src/Pure/Isar/parse.scala\\ -\textbf{Isac:}\\ -\textit{./src/Pure/Isac/isac.scala}\\ -\textbf{System:}\\ -./src/Pure/System/gui\_setup.scala\\ -./src/Pure/System/isabelle\_system.scala\\ -./src/Pure/System/swing\_thread.scala\\ -./src/Pure/System/download.scala\\ -./src/Pure/System/session\_manager.scala\\ -./src/Pure/System/standard\_system.scala\\ -./src/Pure/System/isabelle\_syntax.scala\\ -./src/Pure/System/session.scala\\ -./src/Pure/System/platform.scala\\ -./src/Pure/System/cygwin.scala\\ -./src/Pure/System/event\_bus.scala\\ -./src/Pure/System/isabelle\_process.scala\\ -\textbf{PIDE}\\ -./src/Pure/PIDE/document.scala\\ -./src/Pure/PIDE/markup\_tree.scala\\ -./src/Pure/PIDE/text.scala\\ -./src/Pure/PIDE/command.scala\\ -./src/Pure/PIDE/isar\_document.scala \\ - - -\chapter{Das Skript \textit{isac\_jedit}} - -\textit{ -\#$!$/usr/bin/env bash -cd src/Pure/ \\ -echo "Building Pure.jar" \\ -../../bin/isabelle env ./build-jars \\ -echo "copying Pure.jar to contrib/jedit" \\ -cp ../../lib/classes/Pure.jar ../../contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/ \\ -echo "Building Isac.jar" \\ -cd /home/gadei/isac/isa/src/Tools/jEditC \\ -ant jar \\ -cd /home/gadei/isac/isa/src/Pure/ \\ -echo "copying Isac.jar to contrib/jedit" \\ -cp ../Tools/jEditC/contrib/jEdit/build/jars/Isac.jar ../../contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/ \\ -echo "Done!" \\ -} - -\chapter{Filestruktur f\"ur die Entwicklung des SD-Plugins}\label{files-SD-plugin} - -\textbf{src/Tools/jEditC/}build.xml\\ -\textbf{src/Tools/jEditC/}makedist\\ -\textbf{src/Tools/jEditC/}manifest.mf\\ -\textbf{src/Tools/jEditC/}README\_BUILD\\ -\textbf{src/Tools/jEditC/build/*}\\ -\textbf{src/Tools/jEditC/contrib/*}\\ -\textbf{src/Tools/jEditC/dist/*}\\ -\textbf{src/Tools/jEditC/plugin/}build.xml\\ -\textbf{src/Tools/jEditC/plugin/}changes40.txt\\ -\textbf{src/Tools/jEditC/plugin/}changes42.txt\\ -\textbf{src/Tools/jEditC/plugin/}description.html\\ -\textbf{src/Tools/jEditC/plugin/}testSDActions.java\\ -\textbf{src/Tools/jEditC/plugin/}testSD.iml\\ -\textbf{src/Tools/jEditC/plugin/}testSD.java\\ -\textbf{src/Tools/jEditC/plugin/}testSDOptionPane.java\\ -\textbf{src/Tools/jEditC/plugin/}testSDPlugin.java\\ -\textbf{src/Tools/jEditC/plugin/}testSDTextArea.java\\ -\textbf{src/Tools/jEditC/plugin/}testSDToolPanel.java\\ -\textbf{src/Tools/jEditC/plugin/}plugin\\ -\textbf{src/Tools/jEditC/plugin/}README.txt\\ -\textbf{src/Tools/jEditC/nbproject/*}\\ -\textbf{src/Tools/jEditC/src/}actions.xml\\ -\textbf{src/Tools/jEditC/src/}changes40.txt\\ -\textbf{src/Tools/jEditC/src/}changes42.txt\\ -\textbf{src/Tools/jEditC/src/}description.html\\ -\textbf{src/Tools/jEditC/src/}dockables.xml\\ -\textbf{src/Tools/jEditC/src/}testSDActions.scala\\ -\textbf{src/Tools/jEditC/src/}testSD.iml\\ -\textbf{src/Tools/jEditC/src/}testSDOptionPane.scala\\ -\textbf{src/Tools/jEditC/src/}testSDPlugin.scala\\ -\textbf{src/Tools/jEditC/src/}testSD.props\\ -\textbf{src/Tools/jEditC/src/}testSD.scala\\ -\textbf{src/Tools/jEditC/src/}testSDTextArea.scala\\ -\textbf{src/Tools/jEditC/src/}testSDToolPanel.scala\\ -\textbf{src/Tools/jEditC/src/}manifest.mf\\ -\textbf{src/Tools/jEditC/src/}README.txt\\ -\textbf{src/Tools/jEditC/src/}users-guide.xml \\ \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/msteger/bakk-arbeit/thesis-biblio.tex --- a/src/Doc/isac/msteger/bakk-arbeit/thesis-biblio.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -{ - -%\bibliographystyle{plain} -\bibliographystyle{alpha} - - -% the names of the bib files used - -\phantomsection -\addcontentsline{toc}{chapter}{Bibliography} -\bibliography{master_thesis.bib} - -} - - diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/msteger/bakk-arbeit/thesis-conclusion.tex --- a/src/Doc/isac/msteger/bakk-arbeit/thesis-conclusion.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -\chapter{Concluding Remarks} -... \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/msteger/bakk-arbeit/thesis-contents.tex --- a/src/Doc/isac/msteger/bakk-arbeit/thesis-contents.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -{ -\setlength{\parskip}{3pt plus 3pt minus 3pt} % compact table of contents - -\tableofcontents - -\listoffigures -%\addcontentsline{toc}{chapter}{List of Figures} - -{ -% format sections to chapters for this scope -\titleformat{\section}{\bf\huge}{\thesection\quad}{0em}{} -\titlespacing*{\section}{0em}{-2em}{1.5em} -\def\chapter*#1{\section*{#1}} - -%\vspace*{20mm} -%\listoftables -%%\addcontentsline{toc}{chapter}{List of Tables} -% -%\vspace*{20mm} -%\lstlistoflistings -%%\addcontentsline{toc}{chapter}{List of Listings} - -} -} - diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/msteger/bakk-arbeit/thesis-intro.tex --- a/src/Doc/isac/msteger/bakk-arbeit/thesis-intro.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -\chapter{Einf\"{u}hrung} -Europa ist bei Computer Theorem Provern (CTP) weltweit f\"uhrend, die zwei prominenten Prover sind Coq \cite{coq1999} und Isabelle \cite{Paulson:Isa94}. -Im Zuge der Weiterentwicklung der Informatik als Ingenieurs-Disziplin werden auch Anwendungsgebiete zunehmend mathematisiert \cite{db:dom-eng}, was wiederum CTP vermehrt auf den Plan ruft. -CTP sind bis dato in H\"anden eines relativ kleinen Kreises von Experten, von denen der Gro{\ss}teil wiederum im akademischen Bereich arbeitet und nur ein kleiner Teil in der Industrie. Diese Experten bevorzugen Keyboard-Shortcuts (vor Men\"us), reine Texte (ohne mathematische Sonderzeichen) und benutzen auch mit gro{\ss}em Aufwand hergestellte CTP-Entwicklungs-Umgebungen nicht, zum Beispiel die CoqIDE. - -Nachdem CTP nun unaufhaltsam in Entwicklungs-Umgebungen von Software- Ingenieuren vorzudringen beginnen (siehe zum Beispiel \cite{aichernig:uni-iist-02,aichernig:mut-test}),% \cite{wolff10-boogie}, -stellt sich die Herausforderung neu, Frontends f\"ur die t\"agliche Entwicklungsarbeit mit integrierten CTP zu entwerfen. Einer der Vorschl\"age, wie Theorem Prover mit Front-ends zu verbinden w\"are, findet sich in \cite{Aspinall:2007:FIP:1420412.1420429}. Isabelle geht einen anderen Weg, indem es sich aktuellen technischen Herausforderungen stellt \cite{makarius:isa-scala-jedit}: Multicore-Maschinen versprechen erh\"ohten Durchsatz, falls Teile von Beweisen parallel abgearbeitet werden k\"onnen. Isabelles Entwurf sieht vor, die Programmsprache Scala (insbesonders seine Actor-Library) als Bindeglied zwischen der Mathematik-Sprache SML und der g\"angisten Plattform f\"ur GUIs vor, der Java-Virtual-Maschine. - -Die Bachelorarbeit l\"auft im Rahmen des ISAC-Projektes. ISACs experimenteller Mathematik-Assistant baut auf dem SML-Teil von Isabelle auf und es ist geplant, auch sein Frontend in entsprechend geplanten Schritten an die aktuelle Entwicklung von Isabelle anzuschlie{\ss}en. Der erste Schritt geht einen Umweg, um die Technologie kennen zu lernen: Nicht ISACs Rechnungen (mit aufw\"andigen Interaktionen), sondern Backs 'structured derivations' (SD) \cite{back-grundy-wright-98} sollen auf jEdit und Isabelle aufgesetzt werden. Die Bachelorarbeit liefert die Machbarkeits-Studie f\"ur diesen Schritt. diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/msteger/bakk-arbeit/thesis-macros.tex --- a/src/Doc/isac/msteger/bakk-arbeit/thesis-macros.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -% macros and definitions - -\newcommand\fname{\begingroup \smaller\urlstyle{tt}\Url} - -\newcommand\vname{\begingroup \smaller\urlstyle{tt}\Url} - - -% for class names, define our own url style - -\makeatletter % protect @ names - -% \url@letstyle: New URL sty to premit break at any letters. -% Based on \url@ttstyle - -\def\Url@letdo{% style assignments for tt fonts or T1 encoding -\def\UrlBreaks{\do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j\do\k\do\l% - \do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t\do\u\do\v\do\w\do\x% - \do\y\do\z% - \do\A\do\B\do\C\do\D\do\E\do\F\do\G\do\H\do\I\do\J\do\K\do\L% - \do\M\do\N\do\O\do\P\do\Q\do\R\do\S\do\T\do\U\do\V\do\W\do\X% - \do\Y\do\Z% -}% -\def\UrlBigBreaks{\do\.\do\@\do\\\do\/\do\!\do\_\do\|\do\%\do\;\do\>\do\]% - \do\)\do\,\do\?\do\'\do\+\do\=\do\#\do\:\do@url@hyp}% -\def\UrlNoBreaks{\do\(\do\[\do\{\do\<}% (unnecessary) -\def\UrlSpecials{\do\ {\ }}% -\def\UrlOrds{\do\*\do\-\do\~}% any ordinary characters that aren't usually -\Urlmuskip = 0mu plus 1mu% -} - -\def\url@letstyle{% -\@ifundefined{selectfont}{\def\UrlFont{\sf}}{\def\UrlFont{\sffamily}}\Url@letdo -} - -\makeatother % unprotect @ names - - -\newcommand\cname{\begingroup \smaller\urlstyle{let}\Url} - - -\newcommand{\imgcredit}[1] -{% -\small -[#1] -} - - -\newcommand{\chapquote}[2] -{% -\begin{quote} -\emph{% -``#1''% -}% -\begin{flushright} -{\scriptsize \sffamily [#2]}% -\end{flushright} -\end{quote} -} - - -% \urlfootnote{url}{day}{month}{year} -\newcommand{\murlfootnote}[4]{\footnote{\url{{#1}} (last visit {#4}-{#3}-{#2})}} -\newcommand{\murlfootnotebreak}[4]{\footnote{\url{{#1}}\\ \hspace*{6mm}(last visit {#4}-{#3}-{#2})}} - -% change margin command -\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]} -\let\endchangemargin=\endlist \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/msteger/bakk-arbeit/thesis-preamble.tex --- a/src/Doc/isac/msteger/bakk-arbeit/thesis-preamble.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,183 +0,0 @@ -\usepackage[ % set page and margin sizes - a4paper, - twoside=false, - top=10mm, - bottom=10mm, - left=20mm, - right=20mm, - bindingoffset=10mm, - head=10mm, - foot=10mm, - headsep=10mm, - footskip=10mm, - includeheadfoot, -]{geometry} - -\usepackage{times} % use PostScript fonts -%\usepackage{ngerman} % causes ! Illegal parameter number in definition of \grmn@originalTeX. \penalty l.53 \selectlanguage{austrian} -\usepackage{relsize} % relative font sizes \smaller \larger - -\usepackage[iso-8859-1]{inputenx} % so can use Umlaut chars �, � - -\usepackage{textcomp} % symbols such as \texttimes and \texteuro - -\usepackage[bf]{titlesec} -% format chapter captions (vorher \Huge) -\titleformat{\chapter}{\bf\huge}{\thechapter\quad}{0em}{} -\titlespacing*{\chapter}{0em}{-2em}{1.5em} - -% use caption and subfig (caption2 and subfigure are now obsolete) -\usepackage[ - position=bottom, - margin=1cm, - font=small, - labelfont={bf,sf}, - format=hang, - indention=0mm, -]{caption,subfig} - -\captionsetup[subfigure]{ - margin=0pt, - parskip=0pt, - hangindent=0pt, - indention=0pt, - singlelinecheck=true, -} - - - -% fancyhdr to make nice headers and footers -% and deal with long chapter names - -\usepackage{fancyhdr} % headers and footers -\pagestyle{fancy} % must call to set defaults before redefining - -\renewcommand{\headrulewidth}{0mm} -\renewcommand{\footrulewidth}{0mm} -\fancyhf{} - -\fancyhead[R]{\thepage} - -\fancyhead[L]{ - \parbox[t]{0.8\textwidth}{\nouppercase{\leftmark}} -} - - -% \usepackage{tabularx} % for better tables -\usepackage{multirow} -\usepackage{listings} % for listings of source code -\usepackage{amsmath} - - -\usepackage[austrian,english]{babel} % load babel *before* natbib or jurabib - - -\usepackage[square]{natbib} % natbib but with my own knat.bst - % made with the custom-bib package - -\usepackage{url} -\def\UrlFont{\small\ttfamily} - -\usepackage{latexsym} - -\usepackage{color} -\definecolor{lightgrey}{gray}{0.8} -% \definecolor{darkgreen}{rgb}{0,0.2,0} -% \definecolor{darkblue}{rgb}{0,0,0.2} -% \definecolor{darkred}{rgb}{0.2,0,0} - - - -\usepackage{ifpdf} - -%begin{latexonly} -\ifpdf - % pdflatex - \usepackage[pdftex]{graphicx} - \DeclareGraphicsExtensions{.pdf,.jpg,.png} - \pdfcompresslevel=9 - \pdfpageheight=297mm - \pdfpagewidth=210mm - \usepackage{rotating} % sidewaystable - \usepackage[ % hyperref should be last package loaded - pdftex, - pdftitle={Automating Test Case Generation from Transition Systems via Symbolic Execution and SAT Solving}, - pdfsubject={Master's Thesis}, - pdfauthor={Elisabeth Joebstl}, - pdfkeywords={Model-Based Testing, Conformance Testing, Automated Test Case Generation, Input Output Symbolic Transition Systems, Symbolic Execution, SMT Solving}, - bookmarks, - bookmarksnumbered, - linktocpage, - pagebackref, - colorlinks, - linkcolor=black, - anchorcolor=black, - citecolor=black, - urlcolor=black, - pdfview={FitH}, - pdfstartview={Fit}, - pdfpagemode=UseOutlines, % open bookmarks in Acrobat - plainpages=false, % avoids duplicate page number problem - pdfpagelabels, % avoids duplicate page number problem - ]{hyperref} - - \renewcommand*{\backref}[1]{} - \renewcommand*{\backrefalt}[4]{ - \ifcase #1 - (Not cited.) - \or - (Cited on page~#2.) - \else - (Cited on pages~#2.) - \fi - } - - \renewcommand*{\backrefsep}{, } - \renewcommand*{\backreftwosep}{ and~} - \renewcommand*{\backreflastsep}{ and~} - -\else - % latex - \usepackage{rotating} % sidewaystable - \usepackage{graphicx} - \DeclareGraphicsExtensions{.eps} -\fi -%end{latexonly} - - -% \includeonly{intro,biblio} % selective inclusion - - - -\newcommand{\halfh}{9.5cm} % height of figures for 2 per page -\newcommand{\thirdh}{6cm} % height of figures for 3 per page - - -\setlength{\parskip}{3pt plus 1pt minus 0pt} % vert. space before a paragraph - - -\setcounter{tocdepth}{2} % lowest section level entered in ToC % TODO FIXXME: wieder auf 1 zurcksetzen? -\setcounter{secnumdepth}{2} % lowest section level still numbered - - -\input{thesis-macros} - - -% Reduce vertical distance between items -% itemize -\let\origitemize\itemize -\def\itemize{\origitemize\itemsep0pt} -%enumerate -\let\origenumerate\enumerate -\def\enumerate{\origenumerate\itemsep0pt} - - -% FIXXME: bessere Positionierung der Graphiken -%\setcounter{totalnumber}{8} -%\setcounter{topnumber}{5} -%\setcounter{bottomnumber}{5} - -%\renewcommand{\topfraction}{0.999} -%\renewcommand{\bottomfraction}{0.999} -%\renewcommand{\textfraction}{0.0005} - diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/msteger/bakk-arbeit/thesis-title.tex --- a/src/Doc/isac/msteger/bakk-arbeit/thesis-title.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,205 +0,0 @@ -% --- English Title Page ------------------------------------------------ -\begin{titlepage} -\begin{center} -\vspace*{8mm} -{\LARGE Bachelor's Thesis}\\ - -\vspace{16mm} - -{\huge \bf Userinterfaces for Computer Theorem Provers\\ - Feasibility Study in the \isac-Projekt\\} - -\vspace{16mm} - -{\LARGE Marco Steger\textsuperscript{1}}\\ - -\vspace{16mm} - -{\Large -Institute for Software Technology (IST)\\ -Graz University of Technology\\ -A-8010 Graz, Austria\\} - -\vspace{16mm} - -%TODO TU - figure; Line 26, 76 -%\begin{figure}[!ht] -%\centerline{\includegraphics[width=4cm,keepaspectratio=true]{fig/tug}} -%\end{figure} - -\vspace{16mm} - -{\large -\begin{tabular}{ll} -Advisor: & Ass.Prof. Dipl.-Ing. Dr.techn.\ Bernhard Aichernig\\[0.5ex] -%TODO Aichernig???? -Co-Advisor: & Dr.techn.\ Walther Neuper -\end{tabular}} - -\vfill -{\large Graz, 30.06.2011} -\vspace{15mm} -\end{center} - -\noindent -\underline{\hspace*{3cm}}\\ -{\footnotesize -\textsuperscript{1} E-mail: m.steger@student.tugraz.at\\ -\copyright ~ Copyright 2011 by the author} - - - -% --- German Title Page ------------------------------------------------- -\selectlanguage{austrian} - -\newpage -\begin{center} -\vspace*{8mm} -{\LARGE Bachelorarbeit}\\ - -\vspace{16mm} - -{\huge \bf Userinterfaces f\"ur Computer Theorem Prover\\ - Machbarkeits-Studie im \isac-Projekt\\} - -\vspace{16mm} - -{\LARGE Marco Steger\textsuperscript{1}}\\ - -\vspace{16mm} - -{\Large -Institut f\"ur Softwaretechnologie (IST)\\ -Technische Universit\"at Graz\\ -A-8010 Graz\\} - -\vspace{16mm} - -%\begin{figure}[!ht] -%\centerline{\includegraphics[width=4cm,keepaspectratio=true]{fig/tug}} -%\end{figure} - -\vspace{16mm} - -%TODO Aichernig???? -{\large -\begin{tabular}{ll} -Gutachter: & Ass.Prof. Dipl.-Ing. Dr.techn.\ Bernhard Aichernig\\[0.5ex] -Mitbetreuer: & Dr.techn.\ Walther Neuper -\end{tabular}} - -\vspace{16mm} -{\large Graz, 30.05.2011} - -\vfill -Diese Arbeit ist in deutscher Sprache verfasst. -\end{center} - -\noindent -\underline{\hspace*{3cm}}\\ -{\footnotesize -\textsuperscript{1} E-Mail: m.steger@student.tugraz.at\\ -\copyright ~ Copyright 2011, Marco Steger} -\end{titlepage} - -\selectlanguage{english} - - -% --- English Abstract -------------------------------------------------- -\pagestyle{plain} -\pagenumbering{roman} -\newpage - -\vspace*{25mm} - -\begin{changemargin}{15mm}{15mm} -\begin{center} -{\Large\bfseries Abstract} -\end{center} -\vspace*{7mm} - -The computer theorem prover Isabelle switches from a user interface for expert users to a user interface which is more powerful and which serves integration of Isabelle into other tools for software engineers. - -This bachelor thesis in ``Telematik'' introduces the specific components underlying Isabelle's new user interface, the scala-layer for asyncronous editing of proof documents, the Java-based editor jEdit together with the respective plugin mechanisms; and the thesis documents the current organization of these components in Isabelle and sets up the whole system, Isabelle, Scala and jEdit in the IDE NetBeans copying the configuration of the Isabelle developer team. This setup is explored in the implementation of a test-plugin, and the experiences are documented in detail. - -Thus the prerequisites are given for cooperation in the further development of Isabelle's future front-end and respective integration into development tools like test case generators for software engineers. - -\vspace{5mm} -\noindent -{\large\bfseries Keywords:} -computer theorem prover, Isabelle, user-interface, jEdit, plugin, Scala, actors, asynconous communication, proof document, structured derivations - - - -% --- German Abstract --------------------------------------------------- -\selectlanguage{austrian} -\newpage - -\vspace*{10mm} - -\begin{center} -{\Large\bfseries Kurzfassung} -\end{center} -\vspace*{2mm} - -Der Theoremprover Isabelle befindet sich im \"Ubergang von einer Oberfl\"ache f\"ur akademische Benutzer zu einem generellen Frontend, das in verschiedenste softwaretechnische Tools eingebunden werden kann. - -Die vorliegende Bachelorarbeit in Telematik f\"uhrt in die speziellen, dem Frontend zugrundleliegenden Konzepte und Komponenten (Scala-Layer f\"ur asynchrone Bearbeitung von Beweisdokumenten, jEdit mit Plugins, Parser) ein, dokumentiert die momentane Organisation dieser Komponenten im Isabelle System und setzt das gesamte System in einer integrierten Entwicklungsungebung auf. Dieses Setup wird in der Implementation eines Test-Plugins erprobt. Die Erfahrungen mit diesem Test werden ausf\"uhrlich dokumentiert. - -Hiermit sind die organisatorischen und softwaretechnische Voraussetzungen daf\"ur geschaffen, dass ein Team an der Technischen Universi\"at Graz an der Entwicklung des kommenden Frontends f\"ur den Theoremprover Isabelle und seiner Integration in Entwicklungswerkzeuge teilhaben kann. - -\vspace{5mm} -\noindent -{\large\bfseries Schlagworte:} -Computer Theorem Proving, Isabelle, User-Interface, jEdit, Plugin, Scala, Actors, Asyncrone Kommunikation, Beweis-Dokument, Structured Derivations - -\selectlanguage{english} -\end{changemargin} - - -% --- Pledge ------------------------------------------------------------ -\newpage -\vspace*{20mm} - -\begin{center} -{\Large\bfseries Statutory Declaration} -\end{center} -\vspace{5mm} -\noindent -I declare that I have authored this thesis independently, that I have not used other than the declared -sources/resources, and that I have explicitly marked all material which has been quoted either -literally or by content from the used sources. - -\vspace{2cm} - -\noindent -\begin{tabular}{ccc} -\hspace*{6cm} & \hspace*{2cm} & \hspace*{6.7cm}\\ -\dotfill & & \dotfill\\ -place, date & & (signature)\\ -\end{tabular} - -\vspace{35mm} - - -\selectlanguage{austrian} - -\begin{center} -{\Large\bfseries Eidesstattliche Erkl\"arung} -\end{center} -\vspace{5mm} -\noindent -Ich erkl\"are an Eides statt, dass ich die vorliegende Arbeit selbstst\"andig verfasst, andere als die -angegebenen Quellen/Hilfsmittel nicht benutzt, und die den benutzten Quellen w\"ortlich und inhaltlich -entnommenen Stellen als solche kenntlich gemacht habe. - -\vspace{2cm} - -\noindent -\begin{tabular}{ccc} -\hspace*{6cm} & \hspace*{2cm} & \hspace*{6.7cm}\\ -\dotfill & & \dotfill\\ -Ort, Datum & & (Unterschrift)\\ -\end{tabular} - -\selectlanguage{english} diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/msteger/bakk-arbeit/thesis.tex --- a/src/Doc/isac/msteger/bakk-arbeit/thesis.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -\documentclass[11pt]{report} -%\usepackage{ngerman} -\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} -\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} - -\include{thesis-preamble} - -\begin{document} - -\lstset{ % set parameters for listings - language=, - basicstyle=\small, - tabsize=2, - xleftmargin=2mm, - xrightmargin=2mm, - float=htb, - frame=shadowbox, - framexleftmargin=2mm, - rulesepcolor=\color{lightgrey}, - numbers=left, - numberstyle=\scriptsize, - extendedchars, - breaklines, - showtabs=false, - showspaces=false, - showstringspaces=false, - keywordstyle=\bfseries, - identifierstyle=\ttfamily, - stringstyle=, - captionpos=b, - abovecaptionskip=\abovecaptionskip, - belowcaptionskip=\belowcaptionskip, - aboveskip=\floatsep, -} - - -%\frontmatter -\normalsize -\pagestyle{empty} % for title pages - -\pagenumbering{alph} -\include{thesis-title} % Title Pages, Abstracts, Pledge -\include{thesis-acknowl} % Acknowledgements -\include{thesis-contents} % Table of Contents, List of Figures, List of Tables - - -%\mainmatter -\pagestyle{fancy} % for main pages -\pagenumbering{arabic} % for main pages - -\include{thesis-intro} % Introduction -\include{content} -% \include{your main files} - -%\include{thesis-conclusion} % Conclusion and Future Work - - -\appendix -% \noappendicestocpagenum -% \addappheadtotoc - -\include{thesis-appendix} % Appendix A - - -%\backmatter -\include{thesis-biblio} % Bibliography -%%%\bibliographystyle{plain} -%%%\bibliography{master_thesis} -% \include{glossary} % Glossary -% \include{index} % Index - -\end{document} \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/msteger/bakk-plan.tex --- a/src/Doc/isac/msteger/bakk-plan.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +0,0 @@ -\documentclass{article} -\usepackage{a4} -\usepackage{times} -\usepackage{latexsym} - -\bibliographystyle{alpha} -\usepackage{graphicx} - -\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} -\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} -\def\Problem{ {\tt Problem }} - - -\title{Userinterfaces f\"ur Computer Theorem Prover\\ - Machbarkeits-Studie im Isac-Projekt -} - -\author{Marco Steger\\ -Bachelorarbeit Telematik\\ -am Institut f\"ur Softwaretechnologie\\ -TU Graz} - -\begin{document} -\maketitle -%\newpage -\section{Zur Aufgabenstellung der Bachelorarbeit}\label{intro} -Computer Theorem Prover (CTP) sind bis dato in H\"anden eines relativ kleinen Kreises von Experten, von denen der Gro{\ss}teil wiederum im akademischen Bereich arbeitet und nur ein kleiner Teil in der Industrie. Diese Experten bevorzugen Keyboard-Shortcuts (vor Men\"us), reine Texte (ohne mathematische Sonderzeichen) und benutzen auch mit gro{\ss}em Aufwand hergestellte CTP-Entwicklungs-Umgebungen nicht, zum Beispiel die CoqIDE. - -Nachdem CTP nun unaufhaltsam in Entwicklungs-Umgebungen von Software-Ingenieuren vorzudringen beginnen, stellt sich die Herausforderung neu, Frontends f\"ur die t\"agliche Entwicklungsarbeit mit integrierten CTP zu entwerfen. -Isabelle stellt sich dieser Herausforderung motiviert durch eine aktuelle technische Entwicklung: Multicore-Maschinen versprechen erh\"ohten Durchsatz, falls Teile von Beweisen parallel abgearbeitet werden k\"onnen. Isabelles Entwurf sieht vor, die Programmsprache Scala (insbesonders seine Actor-Library) als Bindeglied zwischen der Mathematik-Sprache SML und der g\"angisten Plattform f\"ur GUIs vor, der Java-Virtual-Maschine. - -Die Bachelorarbeit l\"auft im Rahmen des ISAC-Projektes. ISACs experimenteller Mathematik-Assistant baut auf dem SML-Teil von Isabelle auf und es ist geplant, auch sein Frontend in entsprechend geplanten Schritten an die aktuelle Entwicklung von Isabelle anzuschlie{\ss}en. Der erste Schritt geht einen Umweg, um die Technologie kennen zu lernen: Nicht ISACs Rechnungen (mit aufw\"andigen Interaktionen), sondern Backs 'structured derivations' sollen auf jEdit und Isabelle aufgesetzt werden. Die Bachelorarbeit liefert die Machbarkeits-Studie f\"ur diesen Schritt. - -%\newpage - -\section{Ist-Zustand zu Projektbeginn} -ISAC wird als Eclipse-Projekt entwickelt, das das JavaSwing-Frontend und auch die SML-Mathematik-Engine (samt einer alten Isabelle-Version) umfasst. Isabelles kommende jEdit/Scala-Technologie ist schwer in Eclipse zu integrieren. Zwei Frontends, das alte JavaSwing und das neue jEdit, st\"oren sich gegenseitig in einer einzigen Entwicklungs-Umgebung. - -Sowohl zu jEdit als auch zu Scala und NetBeans bestehen keine Erfahrungen im ISAC-Projekt. - -\section{Planung: Soll-Zustand am Projektende} -ISAC ist in die Isabelle-Entwicklung integriert, die ISAC-Entwicklung l\"auft in einem updatebaren Repository von Isabelle. F\"ur das in Entwicklung befindliche jEdit-Frontend von Isabelle ist ein NetBeans-Projekt aufgesetzt. -Wesentliche Vorarbeiten haben die Herausforderungen gekl\"art, die sich aus der Zielsetzung ergeben: Backs 'structured derivations' \"uber das neue jEdit-GUI eingeben und von Isabelle checken lassen. - -%\newpage - -\section{Milestones und Arbeitsprotokolle} -\subsection{Inhaltliche Voraussetzungen erarbeitet: am 27.09.2010} -\begin{itemize} -\item Kenntnis der Grundlagen und Anwendung von CTP: am 03.08.2010 -\item Charakteristika der Programmsprache Scala: 27.09.2010 -\item Scala Actors: am 12.08.2010 -\end{itemize} -\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} -\hline -Datum & T\"atigkeit & Einheiten \\ \hline -12.07.2010 & Meeting: erste Besprechung und Erklärungen zu Isabelle, Isac und CTPs & 2 \\ \hline -15.07.2010 & Recherche über Isabelle und CTPs & 3 \\ \hline -20.07.2010 & Meeting: Besprechen der grundsätzlichen Vorgangsweise und Ziele & 1 \\ \hline -23.07.2010 & Isabelle: Ziele, Techniken (ML) und Zusammenhänge mit Isac abklären & 1 \\ \hline -30.07.2010 & Ende der Einarbeitungstage: weitere Vorgensweise über Backs 'structured derivations'; Begriffserklärung & 3 \\ \hline -01.08.2010 & Recherche: Buch für Scala & 2 \\ \hline -03.08.2010 & Isabelle bestehende Technologie studieren & 4 \\ \hline -05.08.2010 & Einarbeiten in Scala: Unterschiede zu Java indentifizieren & 1 \\ \hline -06.08.2010 & Einarbeiten in Scala: Unterschiede zu Java indentifizieren, erste Beispielfiles & 4 \\ \hline -08.08.2010 & Einarbeiten in Scala: funktionale Seite von Scala & 2 \\ \hline -09.08.2010 & Einarbeiten in Scala: Testfiles mit Scala-Swing & 5 \\ \hline -12.08.2010 & Studieren von Papers zu Scala Actors & 3 \\ \hline -24.09.2010 & Scala: Arbeiten mit Klassen und Schnittstellen & 3 \\ \hline -25.09.2010 & Scala: Experimente mit Java in Scala-Source & 6 \\ \hline -27.09.2010 & Scala: Testfiles zu "Funktional vs Imperativ" & 4 \\ \hline - & Anzahl der Einheiten & 44 \\ -\hline -\end{tabular} - - -\subsection{Technische Voraussetzungen hergestellt: am 02.08.2010} -\begin{itemize} -\item Isabelle installiert, Filestruktur bekannt: am 02.08.2010 -\item Scala in NetBeans eingebunden: am 22.07.2010 -\item Mercurial installiert und einrichten des Repositories: 19.07.2010 -\end{itemize} -\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} -\hline -Datum & T\"atigkeit & Einheiten \\ \hline -19.07.2010 & Beginn der Installationsarbeiten: Repo klonen und testen & 6 \\ \hline -20.07.2010 & Installationsarbeiten, Einarbeiten in Filestruktur & 7 \\ \hline -21.07.2010 & Einarbeiten in Filestruktur & 6 \\ \hline -22.07.2010 & Vorbereitungen: NetBeans, JDK und Scala installieren. Scala in NetBeans integrieren & 8 \\ \hline -23.07.2010 & Isabelle-jEdit-Plugin mittels NetBeans ausführen: testen & 5 \\ \hline -27.07.2010 & Isabelle-jEdit-Plugin: Änderungen an der Projektstruktur & 7 \\ \hline -28.07.2010 & Experimente mit Isabelle-jEdit-Plugin & 6 \\ \hline -29.07.2010 & Identifikations der Parse-Einstiegsstelle & 5 \\ \hline -30.07.2010 & Experimente mit Isabelle-jEdit-Plugin, Besprechung über Erfahrungen mit Filestruktur & 4 \\ \hline -02.08.2010 & Installationen und einrichten des Repos auf meinen Laptop & 6 \\ \hline \hline - & Anzahl der Einheiten & 60 \\ -\hline -\end{tabular} - -\subsection{NetBeans-Projekt aufgesetzt }% am ..(*)...} -\begin{itemize} -\item Grundlegende Projektstruktur f\"ur ISAC hergestellt: am 02.08.2010 -\item jEdit-Plugin: XML-Files für ISAC vorbereitet: am 22.07.2010 -\item jEdit-Plugin: Source files geschrieben: 19.07.2010 -\end{itemize} -\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} -\hline -Datum & T\"atigkeit & Einheiten \\ \hline -10.08.2010 & Projektstruktur anlegen, build.xml anpassen & 7 \\ \hline -11.08.2010 & jEdit-Plugin-Struktur studieren: Howto durcharbeiten & 5 \\ \hline -21.08.2010 & bestehende jEdit-Plugins (Java) durcharbeiten & 3 \\ \hline -22.08.2010 & Kopieren des Isabelle-jEdit-Plugins, Umarbeiten für ISAC & 3 \\ \hline -24.08.2010 & Umarbeiten des Isabelle-Plugins für ISAC & 6 \\ \hline -26.08.2010 & Problem mit Isabelle-Umgebungsvariable: Suche nach Lösungen & 3 \\ \hline -28.08.2010 & Recherchen zum Umgebungsvariable-Problem, Arbeiten mit den Isabelle-Shell-Skripts & 2 \\ \hline -29.08.2010 & Experimente mit den Path-Varialbe der jvm & 3 \\ \hline -30.08.2010 & Isabelle-jEdit-Plugin endlich vollständig lauffähig gebracht & 4 \\ \hline -01.09.2010 & Arbeiten an der jEdit-ISAC-Projektstruktur & 3 \\ \hline -04.09.2010 & Umarbeiten des Isabelle-Plugins für ISAC & 5 \\ \hline -20.09.2010 & Einrichten des Laptops für Isabelle-Isac & 4 \\ \hline -22.09.2010 & Meeting: Fortschrittsbericht, kurze Einführung für Mitstreiter & 3 \\ \hline - -29.09.2010 & Neue Vorgehensweise: QuickNotepad-Plugin(QN) wird in Scala übersetzt und für ISAC entsprechend angepasst: Arbeit an den XML-Files & 4 \\ \hline -30.09.2010 & QN: Start mit übersetzten der Sourcefiles & 5 \\ \hline -02.10.2010 & QN: Übersetzten der Sourcefiles & 6 \\ \hline -04.10.2010 & QN: Übersetzten der Sourcefiles: Problem bei Interface & 3 \\ \hline -05.10.2010 & QN: QN vollständig in Scala übersetzt, testen & 2 \\ \hline \hline - & Anzahl der Einheiten & 71 \\ -\hline -\end{tabular} - -\subsection{Experimentelle Parser implementiert}% am ..(*)...} -\subsection{Pr\"asentation der Arbeit im IST-Seminar }% am ..(*)...} -%\newpage - -\section{Zusammenfassung und R\"uckblick} - - -%\bibliography{CTP-userinterfaces} -%\bibliography{bib/math-eng,bib/bk,bib/RISC_2,bib/isac,bib/pl,bib/math,bib/pl} -\end{document} \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/msteger/bakk-presentation.tex --- a/src/Doc/isac/msteger/bakk-presentation.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,445 +0,0 @@ -% /usr/share/doc/latex-beamer/solutions/conference-talks/conference-ornate-20min.en.tex - -\documentclass{beamer} -\mode -{ - \usetheme{Hannover} - \setbeamercovered{transparent} -} -\usepackage[english]{babel} -\usepackage[latin1]{inputenc} -\usepackage{times} -\usepackage{ngerman} -\usepackage[T1]{fontenc} -%\usepackage{graphicx} - -\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} -\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} - -\title[Isabelle Frontend] -{Userinterfaces \\f\"ur Computer Theorem Prover,\\ - Machbarkeits-Studie im \isac-Projekt -} -\subtitle{Bachelorarbeit Telematik} - -\author{Marco Steger} -\institute{Institut f\"ur Software Technologie\\ - Technische Universit\"at Graz} - -\date{21.06.2011} -%\subject{Formal specification of math assistants} -% This is only inserted into the PDF information catalog - -% Delete this, if you do not want the table of contents to pop up at -% the beginning of each subsection: -\AtBeginSubsection[] -{ - \begin{frame} - \frametitle{Outline} - \tableofcontents[currentsection,currentsubsection] - \end{frame} -} - - -% If you wish to uncover everything in a step-wise fashion, uncomment -% the following command: -%\beamerdefaultoverlayspecification{<+->} - - -\begin{document} -\begin{frame} - \titlepage -\end{frame} - -\begin{frame} - \frametitle{Outline} - \tableofcontents - % You might wish to add the option [pausesections] -\end{frame} - -\section[Stutus quo]{Ausgangssituation: das k\"unftige Isabelle Front-end} -\subsection[Isabelle]{Der Theoremprover Isabelle} -\begin{frame} - \frametitle{Der Theoremprover Isabelle} -\begin{itemize} -\item Anwendungen von Isabelle - \begin{itemize} - \item Mechanisieren von Mathematik Theorien - \begin{itemize} - \item nat\"urliche, reelle, komplexe Zahlen, Listen, Lattices, \dots - \item Gr\"obner Basen, Integral/Differential, Taylorreihen, \dots - \item High Order Logics, Logic of Computable Functions, \dots - \end{itemize} -\pause - \item Math.Grundlagen f\"ur Softwaretechnologie - \begin{itemize} - \item Hoare Logic, Temporal Logic of Actions, Hoare for Java - \item Theory for Unix file-system security, for state spaces, \dots - \item Archive of Formal Proofs {\tiny\tt http://afp.sourceforge.net} - \end{itemize} - \end{itemize} -\pause -\item Integration von Isabelle in Entwicklungstools - \begin{itemize} - \item Boogie --- Verification Condition Generator - \item $\mathbf{\pi}d.e$ Projekt: Unterst\"utzung Domain-spezifischen CTPs - \item Test Case Generators (TUG) ? - \end{itemize} -\pause -\item Isar, die Beweissprache von Isabelle - \begin{itemize} - %\item Demo $\sqrt{2}\not\in{\cal R}\;\;\;$ - \item Demo 'Allgemeine Dreiecke' -\pause -\alert{Beweisteile asynchron interpretiert} - \end{itemize} -\end{itemize} -\end{frame} - -\subsection[Scala-Layer]{Die Konzeption des Scala-Layers} -\begin{frame}\frametitle{Die Konzeption des Scala-Layers} -\begin{figure} -\begin{center} -\includegraphics[width=100mm]{fig-reuse-ml-scala-SD} -\end{center} -%\nocaptionrule\caption{Reuse of Isabelle/Isar's Scala API.} -\label{fig-reuse-ml-scala} -\end{figure} -\end{frame} - -\begin{frame}\frametitle{Kommunikationsprotokoll \\Scala --- SML} -\begin{itemize} -\item Das Protokoll ist \textbf{asynchron}: \\ -verschiedene Teile eines Beweises werden in verschiedenen Threads interpretiert -\pause -\item Die Threads werden von Scala-\textbf{``Actors''} verwaltet (``Actors'' von der Programmsprache Erlang \"ubernommen) -\pause -\item \alert{Das Protokoll hat \textbf{kein API} nach aussen:}\\ -\pause -Der Scala-Layer zielt auf konsistente Verwaltung gro\3er, verteilter Theorie-Bibliotheken\\ -\pause -Anwendungsprogrammierer sollen nicht hier eingreifen, sondern Isabelle Theorien erweitern\\ -\pause -\alert{\textit{!~Grunds\"atzliches Problem f\"ur das Projekt ``SD''~!}} -\end{itemize} -\end{frame} - -\subsection[Integration]{Isabelles Filestruktur im \"Ubergangsstadium} - - -\begin{frame}\frametitle{Isabelle Files: *.scala} -{\tiny -\textbf{\$ find -name ``*.scala''}\\ -./src/Pure/General/xml.scala\\ -./src/Pure/General/linear\_set.scala\\ - -./src/Pure/General/symbol.scala\\ -./src/Pure/General/exn.scala\\ -./src/Pure/General/position.scala\\ -./src/Pure/General/scan.scala\\ -./src/Pure/General/xml\_data.scala\\ -./src/Pure/General/yxml.scala\\ -./src/Pure/General/markup.scala\\ -:\\ -./src/Pure/General/sha1.scala\\ -./src/Pure/General/timing.scala\\ -./src/Pure/General/pretty.scala\\ -.\\ -./src/Pure/Concurrent/volatile.scala\\ -./src/Pure/Concurrent/future.scala\\ -./src/Pure/Concurrent/simple\_thread.scala\\ -.\\ -./src/Pure/Thy/html.scala\\ -./src/Pure/Thy/completion.scala\\ -./src/Pure/Thy/thy\_header.scala\\ -./src/Pure/Thy/thy\_syntax.scala\\ -./src/Pure/Isac/isac.scala\\ -./src/Pure/library.scala\\ -.\\ -./src/Pure/Isar/keyword.scala\\ -./src/Pure/Isar/outer\_syntax.scala\\ -./src/Pure/Isar/token.scala\\ -./src/Pure/Isar/parse.scala\\ -.\\ -./src/Pure/System/gui\_setup.scala\\ -./src/Pure/System/isabelle\_system.scala\\ -./src/Pure/General/timing.scala\\ -./src/Pure/General/pretty.scala\\ -.\\ -./src/Pure/Concurrent/volatile.scala\\ -./src/Pure/Concurrent/future.scala\\ -./src/Pure/Concurrent/simple\_thread.scala\\ -.\\ -./src/Pure/Thy/html.scala\\ -./src/Pure/Thy/completion.scala\\ -./src/Pure/Thy/thy\_header.scala\\ -./src/Pure/Thy/thy\_syntax.scala\\ -./src/Pure/Isac/isac.scala\\ -./src/Pure/library.scala\\ -.\\ -./src/Pure/Isar/keyword.scala\\ -./src/Pure/Isar/outer\_syntax.scala\\ -./src/Pure/Isar/token.scala\\ -./src/Pure/Isar/parse.scala\\ -.\\ -./src/Pure/System/gui\_setup.scala\\ -./src/Pure/System/isabelle\_system.scala\\ -./src/Pure/System/swing\_thread.scala\\ -./src/Pure/System/download.scala\\ -./src/Pure/System/session\_manager.scala\\ -./src/Pure/System/standard\_system.scala\\ -./src/Pure/System/isabelle\_syntax.scala\\ -./src/Pure/System/session.scala\\ -./src/Pure/System/platform.scala\\ -./src/Pure/System/cygwin.scala\\ -./src/Pure/System/event\_bus.scala\\ -./src/Pure/System/isabelle\_process.scala\\ -.\\ -./src/Pure/PIDE/document.scala\\ -./src/Pure/PIDE/markup\_tree.scala\\ -./src/Pure/PIDE/text.scala\\ -./src/Pure/PIDE/command.scala\\ -./src/Pure/PIDE/isar\_document.scala -} -\end{frame} - - - -\subsection[jEdit]{Das Frontend: jEdit und ``plugins''} -\begin{frame}\frametitle{Das Frontend: \\jEdit und ``plugins''} -\begin{itemize} -\item \textbf{jEdit} \textit{``is a mature programmer's text editor with hundreds (counting the time developing \textbf{plugins}) of person-years of development behind it.''} -\pause -\item Also: Die Funktionalit\"at von jEdit wird \"uber ``plugins'' bestimmt -\pause -\item Isabelle verwendet eine Reihe davon - \begin{itemize} - \item der Parser ``Sidekick'' - \item Console f\"ur jEdit-Komponenten - \item + Scala - \item + Ml - \item etc - \end{itemize} -\pause -\item jEdit ist ``open source'' mit gro\3er Community -\pause -\item Anfragen an Mailinglisten von jEdit (ohne Scala-plugin!) und Isabelle -\end{itemize} -\end{frame} - -\section[Projektarbeit]{Projekt: Vorarbeiten f\"ur ``structured derivations'' (SD)} -\subsection[Aufgabenstellung]{Definition der Aufgabenstellung} -\begin{frame}\frametitle{Definition der Aufgabenstellung} -Aufgabenstellung: \\Feasibility-Study zur Implementierung von ``structured~derivations'' (SD) in Isabelle.\\ - -\textit{``Die Implementierung soweit vorantreiben wie im gegebenen Studenausma\3 m\"oglich~!''}\\ - -Milestones: -\begin{enumerate} -\item Relevante Isabelle Komponenten identifizieren und studieren -\item Installation der Standard-Komponenten -\item Entwicklungsumgebung vom Isabelle-Team kopieren -\item Relevante Komponenten implementieren - \begin{itemize} - \item jEdit Plugin f\"ur SD - \item zugeh\"origen Parser - \item nicht vorgesehen: SD-Interpreter in Isar (SML) - \end{itemize} -\end{enumerate} -\end{frame} - -%\subsection[Beispiel SD]{Beispiel ``structured derivation'' (SD)} -\begin{frame}\frametitle{Beispiel ``structured~derivation''~(SD)} -{\footnotesize -\begin{tabbing} -123,\=1234\=1234\=1234\=1234\=1234\=1234\=123\=\kill -\>$\bullet$\>Simplify $(1 - x) * (x ^ 2 + 1) + x ^ 3 - x ^ 2$\\ -\> \>$(1 - x) * (x ^ 2 + 1) + x ^ 3 - x ^ 2$\\ -\>$\equiv$\>$\{ {\it RewriteSet}\;{\it purify}\}$\\ -\> \>$(1 + -1 * x) * (x ^ 2 + 1) + x ^ 3 + -1 * x ^ 2$\\ -\>$\equiv$\>$\{{\it RewriteSet}\;{\it simplify\_pure}\}$\\ -\> \>$\bullet$\>$(1 + -1 * x) * (x ^ 2 + 1) + x ^ 3 + -1 * x ^ 2$\\ -\> \>$\equiv$\>$\{{\it RewriteSet}\;{\it expand\_poly\_}\}$ \\ -\> \> \>$1 * x ^ 2 + 1 * 1 + (-1 * x * x ^ 2 + -1 * x * 1) + x ^ 3 +-1 * x ^ 2$\\ -\> \>$\equiv$\>\vdots\\ -\> \> \>$1 + -1 * x + 0 * x ^ 2 + 0 * x ^ 3$\\ -\> \>$\equiv$\>$\{{\it RewriteSet}\;{\it reduce\_012\_}\}$ \\ -\> \> \>$1 + -1 * x$\\ -\>\dots\>$1 + -1 * x$\\ -\>$\equiv$\>$\{{\it RewriteSet}\;{\it beautify}\}$\\ -\> \>$1-x$ -\end{tabbing} -} -\end{frame} - -\subsection[NetBeans]{Konfiguration des Projektes in der NetBeans IDE} -\begin{frame}\frametitle{Konfiguration in NetBeans} -Mehrere Run-Konfigurationen sind praktisch: -\begin{itemize} -\item Start von jEdit + Plug-ins aus NetBeans - \begin{itemize} - \item Exekution der fertig kompilierten jEdit.jar - \item Exkution der eingebundenen jEdit Sources: \\zum Debuggen ! - \end{itemize} -\item Start von jEdit aus der Konsole -\end{itemize} -\vspace{0.2cm} \pause -Dementsprechend komplex sind die Konfigurations-Files: -\begin{center} -\begin{tabular}{l r l} -build.xml & 102 & LOCs\\ -project.xml & 25 & LOCs\\ -project.properties & 85 & LOCs\\ -build-impl.xml & 708 & LOCs\\ - & & (teilw. automatisch generiert)\end{tabular} -\end{center} -\end{frame} - -\subsection[Implementation]{Komponenten zur Implementation von SD} - -\begin{frame}\frametitle{Die Konzeption des Scala-Layers} -\begin{figure} -\includegraphics[width=100mm]{fig-jedit-plugins-SD} -\label{Frontend des jEdit} -\end{figure} -\end{frame} - -\begin{frame}\frametitle{jEdit-Plugin} -\begin{itemize} -\item Aufbau: Ein Plugin besteht aus: -\pause - \begin{itemize} - \item Source-Files: \textbf{Scala} - \pause - \item Property file - \pause - \item XML-Files: \textit{``glue code''} zwischen \textbf{Java} (Editor) und \textbf{Scala} (Plugin) - \end{itemize} -%\pause -%\item Bestehendes Java-Plugin in Scala transferieren -%\pause -%\item Neue Ordnerstruktur in bestehende Isabelle-Ordner-Hierachie integrieren -\end{itemize} -\end{frame} - -\begin{frame}\frametitle{Sources des jEdit Plugins} -{\tiny -src/Tools/jEditC\textbf{\$ ls -l *}\\ -build.xml\\ -%makedist\\ -%manifest.mf\\ -%README\_BUILD\\ -\textbf{build/*}\\ -\textbf{contrib/*}\\ -\textbf{dist/*}\\ -\textbf{plugin/}build.xml\\ -\textbf{plugin/}changes40.txt\\ -\textbf{plugin/}changes42.txt\\ -\textbf{plugin/}description.html\\ -\textbf{plugin/}IsacActions.java\\ -\textbf{plugin/}Isac.iml\\ -\textbf{plugin/}Isac.java\\ -\textbf{plugin/}IsacOptionPane.java\\ -\textbf{plugin/}IsacPlugin.java\\ -\textbf{plugin/}IsacTextArea.java\\ -\textbf{plugin/}IsacToolPanel.java\\ -\textbf{plugin/}plugin\\ -\textbf{plugin/}README.txt\\ -\textbf{nbproject/*}\\ -\textbf{src/}actions.xml\\ -\textbf{src/}changes40.txt\\ -\textbf{src/}changes42.txt\\ -\textbf{src/}description.html\\ -\textbf{src/}dockables.xml\\ -\textbf{src/}IsacActions.scala\\ -\textbf{src/}Isac.iml\\ -\textbf{src/}IsacOptionPane.scala\\ -\textbf{src/}IsacPlugin.scala\\ -\textbf{src/}Isac.props\\ -\textbf{src/}Isac.scala\\ -\textbf{src/}IsacTextArea.scala\\ -\textbf{src/}IsacToolPanel.scala\\ -\textbf{src/}manifest.mf\\ -\textbf{src/}README.txt\\ -\textbf{src/}users-guide.xml -} -\end{frame} - -\begin{frame}\frametitle{Anforderungen an das Versuchs-Plugin} -Folgende Funktionalit\"at wurde zu Testzwecken umgesetzt: -\pause -\begin{itemize} - \item Grunds\"atzlicher Aufbau eines GUIs - \pause - \item Kopieren von Text zwischen den einzelnen Buffers - \pause - \begin{itemize} - \item \alert{Somit auch Zugriff auf andere Plugins!} - \end{itemize} - \pause - \item Ansatz f\"ur die Einbindung des SD-Parsers - \pause - \begin{itemize} - \item Zugriff auf Isabelle-Pure: \alert{parsen von SD parallel zu Isabelle/Isar} - \end{itemize} - \pause - \item \textit{DEMO} -\end{itemize} -\end{frame} - - -%\subsection[Parser]{Ein funktionaler Parser f\"ur SD (in SML)} - -\section[Summary]{Zusammenfassung} -\begin{frame}\frametitle{Zusammenfassung} -Folgende Milestones wurden erfolgreich abgeschlossen: -\begin{enumerate} -\item Relevante Isabelle Komponenten dokumentiert -\pause -\item Installation der Standard-Komponenten: - \begin{itemize} - \item Mercurial Versioncontrol - \item NetBeans IDE - \item Standard Isabelle Bundle - \end{itemize} - \pause -\item Entwicklungsumgebung vom Isabelle-Team kopieren - \begin{itemize} - \item Isabelle-Sources vom Repository M\"unchen (Java, Scala, ML) - \item jEdit als NetBeans Projekt definiert - \end{itemize} - \pause -\item Relevante Komponenten implementieren - \begin{itemize} - \item jEdit Plugin f\"ur SD - \item Verbindung des Plugins zu Isabelle - \item zugeh\"origen Parser: nur ein Test in SML - \end{itemize} -\end{enumerate} -\end{frame} - -\begin{frame}\frametitle{Zusammenfassung} -\pause -\alert{$\mathbf{- - -}$}\\ -Aus Zeitgr\"unden nicht m\"oglich: ein komplettes SD-Plugin;\\ -dazu w\"are auch ein Interpreter auf der ML-Seite n\"otig.\\ -\vspace{0.3cm} -\alert{$\mathbf{+ + +}$}\\ -\pause -Voraussetzungen f\"ur k\"unftige Entwicklung geschaffen: -\begin{enumerate} -\item f\"ur die Implementation von ``structured derivations'' in Isabelle \dots -\item \dots als Vorarbeit f\"ur jEdit als k\"unftiges \isac-Frontend -\item f\"ur Mitarbeit an k\"unftiger Integration von Isabelle in Entwicklungswerkzeuge (Testcase-Generation etc). -\end{enumerate} -\end{frame} - -\begin{frame}\frametitle{} -\begin{center} -\LARGE{Danke f\"ur die Aufmerksamkeit !} -\end{center} -\end{frame} - -\end{document} - - diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/msteger/bibliografie.bib --- a/src/Doc/isac/msteger/bibliografie.bib Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -@article{wolff10-boogie, - author = {Sascha B{\"o}hme and - Michal Moskal and - Wolfram Schulte and - Burkhart Wolff}, - title = {HOL-Boogie - An Interactive Prover-Backend for the Verifying - C Compiler}, - journal = {J. Autom. Reasoning}, - volume = {44}, - number = {1-2}, - year = {2010}, - pages = {111-144}, - ee = {http://dx.doi.org/10.1007/s10817-009-9142-9}, - bibsource = {DBLP, http://dblp.uni-trier.de} -} \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/msteger/dirs-all-jars.txt --- a/src/Doc/isac/msteger/dirs-all-jars.txt Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ ------ for "isabelle jedit &"; contained in Isabelle_bundle -./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jedit.jar -./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/LatestVersion.jar -./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/SideKick.jar -./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/Console.jar -./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/Pure.jar -./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/Isac.jar -./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/scala-compiler.jar -./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/Isabelle-jEdit.jar -./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/cobra.jar -./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/js.jar -./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/Hyperlinks.jar -./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/scala-swing.jar -./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/scala-library.jar -./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/QuickNotepad.jar -./contrib/jedit-4.3.2_Isabelle-6d736d983d5c/jars/ErrorList.jar ------ scala system; contained in Isabelle_bundle -./contrib/scala-2.8.1.final/misc/sbaz/scala-bazaars.jar -./contrib/scala-2.8.1.final/misc/sbaz/sbaz-tests.jar -./contrib/scala-2.8.1.final/misc/scala-devel/plugins/continuations.jar -./contrib/scala-2.8.1.final/lib/scala-compiler.jar -./contrib/scala-2.8.1.final/lib/scalap.jar -./contrib/scala-2.8.1.final/lib/scala-swing.jar -./contrib/scala-2.8.1.final/lib/scala-library.jar -./contrib/scala-2.8.1.final/lib/jline.jar -./contrib/scala-2.8.1.final/lib/scala-dbc.jar -./contrib/scala-2.8.1.final/src/scala-library-src.jar -./contrib/scala-2.8.1.final/src/scala-swing-src.jar -./contrib/scala-2.8.1.final/src/scala-compiler-src.jar -./contrib/scala-2.8.1.final/src/scala-dbc-src.jar -./contrib/scala-2.8.1.final/src/sbaz-src.jar ------ Isars entry to SML from Scala-layer; created according to 3.3.#3{enumerate} -./lib/classes/isabelle-scala.jar -./lib/classes/Pure.jar -===== all below for NetBeans ------ standard Isabelle, started by in NetBeans - description in 2.2.2 -./src/Tools/jEdit/dist/jars/jedit.jar -./src/Tools/jEdit/dist/jars/SideKick.jar -./src/Tools/jEdit/dist/jars/Console.jar -./src/Tools/jEdit/dist/jars/Pure.jar -./src/Tools/jEdit/dist/jars/scala-compiler.jar -./src/Tools/jEdit/dist/jars/Isabelle-jEdit.jar -./src/Tools/jEdit/dist/jars/cobra.jar -./src/Tools/jEdit/dist/jars/js.jar -./src/Tools/jEdit/dist/jars/Hyperlinks.jar -./src/Tools/jEdit/dist/jars/scala-swing.jar -./src/Tools/jEdit/dist/jars/scala-library.jar -./src/Tools/jEdit/dist/jars/ErrorList.jar ------ source of jEdit, required for in NetBeans; - adapted from NetBeans' webpages, - description in 2.2.3.#5 -./src/Tools/jEditC/contrib/jEdit/build/jars/SideKick.jar -./src/Tools/jEditC/contrib/jEdit/build/jars/Console.jar -./src/Tools/jEditC/contrib/jEdit/build/jars/Pure.jar -./src/Tools/jEditC/contrib/jEdit/build/jars/Isac.jar -./src/Tools/jEditC/contrib/jEdit/build/jars/QuickNPScala.jar -./src/Tools/jEditC/contrib/jEdit/build/jars/scala-compiler.jar -./src/Tools/jEditC/contrib/jEdit/build/jars/Isabelle-jEdit.jar -./src/Tools/jEditC/contrib/jEdit/build/jars/cobra.jar -./src/Tools/jEditC/contrib/jEdit/build/jars/js.jar -./src/Tools/jEditC/contrib/jEdit/build/jars/Hyperlinks.jar -./src/Tools/jEditC/contrib/jEdit/build/jars/scala-swing.jar -./src/Tools/jEditC/contrib/jEdit/build/jars/scala-library.jar -./src/Tools/jEditC/contrib/jEdit/build/jars/ErrorList.jar -./src/Tools/jEditC/contrib/jEdit/build/jEdit.jar ------ demo plugin, started by in NetBeans - description in 2.2.3.#4 -./src/Tools/jEditC/dist/jars/SideKick.jar -./src/Tools/jEditC/dist/jars/Console.jar -./src/Tools/jEditC/dist/jars/Pure.jar -./src/Tools/jEditC/dist/jars/Isac.jar -./src/Tools/jEditC/dist/jars/scala-compiler.jar -./src/Tools/jEditC/dist/jars/cobra.jar -./src/Tools/jEditC/dist/jars/js.jar -./src/Tools/jEditC/dist/jars/Hyperlinks.jar -./src/Tools/jEditC/dist/jars/scala-swing.jar -./src/Tools/jEditC/dist/jars/scala-library.jar -./src/Tools/jEditC/dist/jars/ErrorList.jar diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/msteger/fig-jedit-plugins-SD.odg Binary file src/Doc/isac/msteger/fig-jedit-plugins-SD.odg has changed diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/msteger/fig-jedit-plugins-SD.png Binary file src/Doc/isac/msteger/fig-jedit-plugins-SD.png has changed diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/msteger/fig-reuse-ml-scala-SD.odg Binary file src/Doc/isac/msteger/fig-reuse-ml-scala-SD.odg has changed diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/msteger/fig-reuse-ml-scala-SD.png Binary file src/Doc/isac/msteger/fig-reuse-ml-scala-SD.png has changed diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/msteger/official_docu/Doku.tex --- a/src/Doc/isac/msteger/official_docu/Doku.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,540 +0,0 @@ -\chapter{Definition der Aufgabenstellung} -\section{Detaillierte Beschreibung der Aufgabenstellung} -Zu Beginn des Projekts wurden einige Vorgaben und Ziele des Projektes erarbeitet und im Laufe des Projekts etwas angepasst. Es wurde bewusst auf eine zu einschr\"ankende Aufgabenstellung verzichtet, da Entwicklungen und Erarbeitungen von verschiedenen Umsetzungsstrategien erw\"unscht war. - -Hauptaugenmerk war dabei auf die Erstellung eines jEdit-Plugins, dass die Verarbeitung von Back's Structured Derivations m\"oglich machen soll, gelegt worden. Mit anderen Worten, es sollte so viel Plugin-Code, wie im begrenzten Projektzeitraum m\"oglich, implementiert werden. - -Weiters sollte eine Projektstruktur aufgebaut werden, die die Initialisierungsarbeiten von weiterf\"uhrende bzw. nachfolgende Projekten erleichtert und somit verk\"urzt. Dabei sollte darauf geachtet werden, dass die vom Isabelleteam bereits verwendete Projekthierarchie soweit wie m\"oglich \"ubernommen bzw. erweitert wird. -Die nachfolgende Auflistung soll die wichtigsten Tasks nochmals zusammenfassen: -\begin{enumerate} -\item Relevante Isabelle Komponenten identifizieren und studieren -\item Installation der Standard-Komponenten -\item Entwicklungsumgebung vom Isabelle-Team kopieren -\item Relevante Komponenten implementieren - \begin{itemize} - \item jEdit Plugin f\"ur SD - \item zugeh\"origen Parser - \item nicht vorgesehen: SD-Interpreter in Isar (SML) - \end{itemize} -\end{enumerate} - -\chapter{Beleuchtung der Projekt-relevanten Technologien} -Dieses Kapitel soll die vielen unterschiedlichen Technologien, die im Rahmen dieser Arbeit verwendet oder zumindest ber\"uhrt wurden, beleuchten und dem Leser helfen, nachfolgende Zusammenh\"ange zu verstehen. Nat\"urlich kann in keines der folgenden Themen sehr tief eingestiegen werden. Viel mehr sollen die nachfolgenden Ausf\"uhrungen einen groben \"Uberblick \"uber die einzelnen Technologien geben. -\section{Back's Structured Derivations} -Wie in der Aufgabenstellung bereits beschrieben, war die Erstellung eines Structured Derivation Plugins das Hauptziel dieser Arbeit. Aus diesem Grund wird in diesem Absatz kurz auf die von Prof. Ralph-Johan Back einf\"uhrten Structured Derivations eingegangen und dessen Eigenschaften bzw. Zusammenh\"ange beschrieben. - -Das nachfolgende Beispiel zeigt ein einfaches Beispiel, wie eine Formel mittels SD dargestellt bzw. umgeformt werden kann: - -%{\footnotesize -\begin{tabbing} -123,\=1234\=1234\=1234\=1234\=1234\=1234\=123\=\kill -\>$\bullet$\>Simplify $(1 - x) * (x ^ 2 + 1) + x ^ 3 - x ^ 2$\\ -\> \>$(1 - x) * (x ^ 2 + 1) + x ^ 3 - x ^ 2$\\ -\>$\equiv$\>$\{ {\it RewriteSet}\;{\it purify}\}$\\ -\> \>$(1 + -1 * x) * (x ^ 2 + 1) + x ^ 3 + -1 * x ^ 2$\\ -\>$\equiv$\>$\{{\it RewriteSet}\;{\it simplify\_pure}\}$\\ -\> \>$\bullet$\>$(1 + -1 * x) * (x ^ 2 + 1) + x ^ 3 + -1 * x ^ 2$\\ -\> \>$\equiv$\>$\{{\it RewriteSet}\;{\it expand\_poly\_}\}$ \\ -\> \> \>$1 * x ^ 2 + 1 * 1 + (-1 * x * x ^ 2 + -1 * x * 1) + x ^ 3 +-1 * x ^ 2$\\ -\> \>$\equiv$\>\vdots\\ -\> \> \>$1 + -1 * x + 0 * x ^ 2 + 0 * x ^ 3$\\ -\> \>$\equiv$\>$\{{\it RewriteSet}\;{\it reduce\_012\_}\}$ \\ -\> \> \>$1 + -1 * x$\\ -\>\dots\>$1 + -1 * x$\\ -\>$\equiv$\>$\{{\it RewriteSet}\;{\it beautify}\}$\\ -\> \>$1-x$ -\end{tabbing} -%} - -Dieses Beispiel kann wie folgt interpretiert werden: -\begin{enumerate} -\item Die erste Zeile ist als Angabe bzw. Ausgangspunkt der Berechnung zu verstehen. -\item Nun folgt der eigentliche Ablauf einer Umformung mittels SD: Mit der Formel in der zweiten Zeile beginnt die Berechnung. -\item Die n\"achste Zeile gibt nun an, wie die Formel aus der direkt dar\"uberliegenden Zeile umgeformt bzw. aufbereitet wird. Es ist also eine Beschreibung bzw. die passende Rechenregel, um von der Ausgangsformel auf die nachfolgende Formel schlie{\ss}en zu k\"onnen. -\item Aus dieser Rechenvorschrift ergibt sich die Formel in der n\"achsten Zeile. -\item Dieser Ablauf wiederholt sich und zieht sich \"uber die weiteren Berechnungen. -\end{enumerate} - -Back liefert mit SD eine sehr gute Darstellungs- und Verbarbeitungs-Richtlinie, die einerseits dem Leser/Anwender hilft, da durch die Regel- bzw. Beschreibungs-Zeile klar gestellt wird, wie der letzte Berechnungsschritt durchgef\"uhrt wurde. Andererseits bringt SD auch f\"ur den Programmierer einen klaren Vorteil, da \"uber die vorgestellten Sonderzeichen das Parsen von \textit{SD-Code} vereinfacht bzw. direkt (ohne extra Schl\"usselw\"orter einf\"uhren zu m\"ussen) m\"oglich ist. - -\section{Der Texteditor jEdit}\label{jEdit} -% http://www.jedit.org/ -% http://de.wikipedia.org/wiki/JEdit -% http://www.chip.de/downloads/jEdit_19235021.html -% -jEdit ist ein in Java geschriebener und als Open-Source-Projekt erh\"altlicher Texteditor, der vor allem durch sein sehr gut entwickeltes und ebenso einfaches Plugin-Management-System sehr effektiv eingesetzt werden kann. Solche Plugins k\"{o}nnen direkt in jEdit installiert oder durch manuelles Hinzuf\"{u}gen eines Plugin-Paketes genutzt werden. Dadurch ist dieser Editor sehr flexibel in der Anwendung und kann den eigenen Bed\"{u}rfnissen perfekt angepasst werden. -Diese Umst\"ande sind wohl auch der Grund, warum sich die Entwickler von Isabelle f\"ur diesen Editor entschieden haben. Hierbei ist zu erw\"{a}hnen, dass hier eine etwas modifizierte bzw. an Isabelle angepasste Version verwendet wird. Es empfiehlt sich daher, immer die aktuelle Version des Isabelle-jEdit-Editors (zB. aus dem Bundle erh\"{a}ltlich auf der Isabelle-Homepage) zu verwenden, da hier diverse Voreinstellungen vorgenommen wurden. In weiterer Folge wird mit jEdit immer diese modifizierte Version des Editors in Verbindung gebracht, da die Verwendung der Grundversion aus oben genannten Gr\"{u}nden nicht zu empfehlen bzw. sinnvoll ist. -Weiters sollte noch erw\"ahnt werden, dass es rund um jEdit einen sehr guten Support via Mailinglist gibt und man wirklich rasch Hilfestellung bekommen kann. - -\subsection{Das Plugin-System} -% http://jedit.org/users-guide/writing-plugins-part.html -Wie im vorigen Abschnitt bereits erw\"ahnt, ist es sehr einfach und bequem m\"oglich, geeignete Plugins zu installieren bzw. zu verwenden. Es stehen bereits sehr viele verschiedenste Plugins auf der jEdit-Homepage zur Verf\"{u}gung. Diese werden ebenfalls als Open-Source-Projekte angeboten und es bietet sich daher an, bereits verf\"ugbare und funktionierende Plugins als Teil eines neuen Plugins zu verwenden und gegebenenfalls kleine Modifikationen oder Erweiterungen an den Plugins durchzuf\"{u}hren. Im Beispiel von Isabelle wurden unter anderem die Plugins \textit{Sidekick} und \textit{Konsole} verwendet. Dabei ist es m\"oglich, dass Java-Plugins mit Scala-Plugins kombiniert werden, da diese auch problemlos miteinander kommunizieren k\"{o}nnen. -jEdit bietet einen Plugin-Manager an, mit dem sich sehr einfach bereits installierte Plugins verwalten und updaten lassen und es ist auch m\"{o}glich, neue Plugins direkt zu installieren. -Weiters bietet sich die M\"oglichkeit, selbst implementierte Plugins direkt zu den bereits vorhandenen jEdit-Plugins hizuzuf\"{u}gen. Dazu muss das erzeugte "Plugin".jar Paket ledigich in den jars-Ordner verschoben werden. Beim Start von jEdit wird das neue Plugin automatisch erkannt und hinzugef\"{u}gt. Man muss aber darauf achten, dass \"{A}nderungen nur nach einem Neustart von jEdit \"{u}bernommen werden. - - -\subsection{Pluginstruktur} -Ein solches jEdit-Plugin muss nat\"{u}rlich ein gewisses Design umsetzen, um von jEdit korrekt ausgef\"{u}hrt werden zu k\"{o}nnen. Grunds\"{a}tzlich besteht ein solches Plugin aus den eigentlichen Sourcefiles und einigen XML- und Property-Datein. -Ein m\"{o}glicher Aufbau kann dem Beispiel-Plugin "QuickNotepad"\footnote{http://jedit.org/users-guide/writing-plugins-part.html}, das auf der jEdit-Homepage zu finden ist, entnommen bzw. als Ausgangspunkt f\"{u}r die Entwicklung eines eigenen Plugins herangezogen werden. Weitere Informationen k\"{o}nnen auch dem Paper "Userinterfaces for Computer Theorem Provers" entnommen werden. - -\section{Isabelle} -Isabelle ist einer der f\"{u}hrenden CTPs und an dessen Weiterentwicklung wird st\"{a}ndig gearbeitet. Der letzte gro{\ss}e Schritt betraf den Umstieg von reinem ML auf die "Mischsprache" Scala(mit funktionalen sowie imperativen Sprachanteilen). Weiters wurde der in die Jahre gekommene Proof General und der damit in Verbindung stehende Editor Emacs durch den vielseitigen Editor jEdit ersetzt. Dadurch ergeben sich auch f\"{u}r das laufende \sisac-Projekt an der TU Graz neue M\"{o}glichkeiten. Wichtig im Zusammenhang mit dieser Beschreibung ist zu erw\"{a}hnen, dass hier in weiterer Folge nur noch f\"{u}r jEdit bzw. Scala relevante Teile von Isabelle behandelt und beschrieben werden. Weiters ist wichtig zu wissen, dass f\"{u}r die bereits bestehende Struktur rund um Isablle-jEdit zwei Isabelle-Pakete zum Einsatz kommen. Auf diese Pakete soll in den n\"{a}chsten Passagen eingegangen werden. - -\subsection{Isabelle-Pure} -In diesem Plugin ist der eigentliche CTP-Teil von Isabelle verpackt. Das bedeutet im weiteren Sinn, dass es hier keine grafische Verarbeitung der Daten gibt, sondern der Zugriff von aussen erforderich ist, um den CTP mit Daten zu versorgen und diese nach deren Verabreitung in Isabelle-Pure auszuwerten. Also ist nur hier eine Schnittstelle zum eigentlichen Proofer m\"{o}glich und deshalb ist dieses Plugin f\"{u}r das \sisac-Projekt von zentraler Bedeutung. Standardm\"{a}{\ss}ig ist bereits ein Pure.jar-Paket f\"{u}r jEdit vorhanden. Um SD umsetzten zu k\"{o}nnen, muss hier eine Schnittstelle zu Isabelle-Pure implementiert werden. Nach diesem Schritt kann das Plugin Pure.jar neu gebaut werden. -Eine Auflistung der f\"ur das Isabelle-Pure-Packet ben\"otigten Scala-Source-Filles kann Anhang B.2 entnommen werden. - -\subsection{Isabelle-jEdit} -Dieser Teil von Isabelle repr\"{a}sentiert das Frontend in jEdit. Hier wird also die grafische Aufbereitung der von Isabelle-Pure berechneten Daten \"{u}bernommen. Dieses Plugin zeigt sehr sch\"{o}n, wie bereits bestehende Plugins weiter genutzt und erweitert werden k\"{o}nnen. -An diesem Plugin wird von Seiten der Isabelle-Entwickler sehr stark weitergearbeitet. Darum sollten hier wohl nicht zu viele, am besten nat\"{u}rlich keine \"{A}nderungen, vorgenommen werden. Der Umstand, dass sich einzelne Plugins ganz einfach in einem anderen mitverwenden lassen, macht es m\"{o}glich, dass das \sisac-Plugin sehr einfach, im Idealfall von Seiten der Isabelle-Entwickler, in das Isabelle-jEdit-Plugin integriert werden kann. - -\subsection{Paketstruktur von Isabelle} -Durch die Komplexit\"{a}t des Isabelle-Entwicklungs-Aufbaus soll hier eine Auflistung aller relevanten jar-Pakete erfolgen. Alle Pakete befinden sich innerhalb der Ordnerstruktur von ISABELLE\_HOME. Darum wird ab hier immer von diesem Verzeichnis ausgegangen. -Die nachfolgende Auflistung zeigt alle Pakete, die f\"{u}r SD bzw. {\sisac} von Bedeutung sind und und wo diese zu finden sind. - - -\begin{itemize} -\item \textit{contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars:} \textbf{Isabelle-jEdit.jar, Pure.jar, SideKick.jar, ...} Der Ordner contrib ist in der Repository-Version nicht vorhanden! Dieser kann dem Isabelle-Bundle entnommen werden. Hier befinden sich alle ben\"{o}tigten Zusatztools f\"{u}r Isabelle und darunter eben auch jEdit. In dem oben angef\"{u}hrten Ordner liegen alle Plugins bzw. dorthin werden alle Plugins kopiert, die zusammen mit jEdit gestartet werden sollen. -\item \textit{lib/classes:} \textbf{isabelle-scala.jar, pure.jar;} Standardm\"{a}{\ss}ig ist dieser Ordner nicht vorhanden. Erst durch Erzeugen der angef\"{u}hrten jar's werden dieser Ordner und die Pakete erstellt. -\item \textit{src/Tools/jEdit/dist/jars:} \textbf{Isabelle-jEdit.jar, Pure.jar, SideKick.jar, jedit.jar, ...} -\item \textit{src/Tools/jEditC/dist/jars:} \textbf{Isabelle-jEdit.jar, Pure.jar, SideKick.jar, jedit.jar, ...} Diese beiden obigen Verzeichnisse sind, wie man an der sehr \"{a}hnlichen Pfadstruktur erkennen kann, \"{a}quivalent, wobei der zweite Pfad zum \sisac-Entwicklungsverzeichnis geh\"{o}rt. Hier sind die f\"{u}r das Isabelle-jEdit- bzw. \sisac-Plugin ben\"{o}tigten Plugins und Pakete plus das erzeugte Plugin zu finden. -\item \textit{src/Tools/jEditC/contrib/jEdit/build/jars:} \textbf{Isabelle-jEdit.jar, Pure.jar, SideKick.jar, jedit.jar, ...} Diesen Aufbau ben\"{o}tigt man nur, wenn man das jEdit-Isac-Projekt direkt in NetBeans debuggen m\"{o}chte. Man erkennt, dass in diesem Verzeichnis der vollst\"{a}ndige Quellcode von jEdit plus allen Plugins, die zusammen mit jEdit gestartet werden sollen, hier zu finden sind. Wie aber bereits erw\"{a}hnt, ist vom direkten Debuggen generell abzuraten bzw. sollte dies nur f\"ur schwer nachvollziebare Abl\"aufe ohne Isabelle-Beteiligung angewendet werden. -\end{itemize} - -Siehe dazu auch Anhang B. Dort sind alle relevanten jar-Pakete noch einmal aufgearbeitet und entsprechend gruppiert. - -\section{Die Programmiersprache Scala} -Urspr\"{u}nglich wurde Isabelle rein in ML entwickelt. Erst vor ein paar Jahren wurde mit der \"{U}bersetzung von einigen Teilen in Scala begonnen. Grund genug, sich hier kurz diese neue und sehr vielseitige Sprache etwas genauer anzusehen. - -\subsection{Grundlage der Sprache} -Scala ist eine objektorientierte Sprache, die sehr \"{a}hnlich zu Java aufgebaut wurde. Dadurch wird die Einarbeitung in diese Programmiersprache f\"{u}r Java-Programmierer sehr vereinfacht. Neben den Vorteilen einer objektorientierten Sprache deckt Scala aber auch die Bed\"{u}rfnisse der funktionalen Programmierung ab. Dies, und vorallem auch das von Erlang \"ubernommene und sehr gut umgesetzte Actorprinzip, sind wohl die Hauptgr\"unde, warum sich das Isabelle-Entwicklungsteam f\"{u}r diese Sprache entschieden hat. Wie bereits erw\"{a}hnt, ist Scala sehr \"{a}hnlich aufgebaut wie Java und hat nebenbei noch den gro{\ss}en Vorteil, dass Scala-Executables in der JVM (Java virtual Machine) ausf\"{u}hrbar sind. Dadurch ist die Plattformunabh\"{a}ngigkeit garantiert und es besteht ein direkter Zusammenhang zwischen Scala und Java der auch bei der jEdit-Plugin-Entwicklung ausgenutzt bzw. verwendet wird. - -Dieser direkte Zusammenhang zwischen Java und Scala soll anhand der Grafik-Bibliotheken Swing gezeigt bzw. die Vorteile, die daraus resultieren, beleuchtet werden. - -Beide Sprachen stellen diese Grafik-Bibliotheken zur Verf\"{u}gung (und darin auch eigene Shapes und Funktionalit\"{a}t). Es ist jedoch m\"{o}glich, Java-Bibliotheken, wie eben Java-Swing in Scala zu verwenden. Ein JButton(Java) kann zum Beispiel mittels \textit{import javax.swing.JButton} in Scala eingebunden und damit sofort verwendet werden. Auch Scala stellt in seiner Swing-Bibliothek einen Button zur Verf\"{u}gung: \textit{scala.swing.Button}. Es wird nahezu dieselbe Funktionalit\"{a}t angeboten und teilweise die Erzeugung bzw. Verwendung vereinfacht. Man kann sich nun fragen, warum sich die Scala-Entwickler einerseits die M\"{u}he gemacht haben, die Verwendung Java-Swing, wie in Java selbst, m\"{o}glich zu machen und andererseits mit Scala-Swing eine nahezu idente Alternative geschaffen haben. - -Die Antwort darauf zeigt, wie die Objektorientiertheit von Scala in vielen Bereichen ausgenutzt wurde, um die Sprache mit Funktionalit\"{a}t auszur\"{u}sten, denn es wurde kein neues Konzept f\"{u}r diese Grafikklassen entworfen, sondern Wrapper-Objekte/ Methoden/Klassen erstellt, die das Arbeiten mit diesen Grafikkomponenten erleichtern soll. -Ein Letztes Problem bleibt noch: Es ist zwar sehr einfach ein Java-Swing-Objekt an einen Scala-Swing-Container (zb. Frame) anzubinden, da eine Konvertierung einer Java-Komponente in ein Scala-\"{a}quivalent problemlos m\"{o}glich ist. Jedoch ist oft auch die Konvertierung einer Scala- in eine Java-Komponente n\"{o}tig. Dies kann ganz einfach mittels \textit(peer)-Befehl der Komponente erreicht werden. - -Das angef\"{u}hrte Beispiel soll zeigen, wie vielseitig Scala sein kann und welch enormes Potenzial in dieser noch sehr jungen Sprache steckt. Nat\"{u}rlich gibt es dazu eine sehr gut aufgebaute Entwickler-Homepage\footnote{http://www.scala-lang.org/}, die Tutorials, Plugin f\"{u}r diverse IDEs und weitere n\"{u}tzliche Hilfestellungen f\"{u}r Scala-Neulinge bereitstellt. - -\subsection{Scala, Java und jEdit} -Wie im letzten Abschnitt bereits beschrieben, kommen bei jEdit Java- sowie auch Scala-Komponenten zum Einsatz bzw. werden sogar zu logischen Einheiten kombiniert. So ist zum Beispiel jEdit selbst rein in Java geschrieben und das Plugin Isabelle-jEdit rein in Scala. Trotzdem gibt es \"{u}berhaupt kein Problem, diese beiden jar-File miteinander bzw. ineinander in der JVM zu nutzen. Es geht sogar so weit, dass es m\"{o}glich ist, dass das Plugin Isabelle-jEdit bereits vorhandene und rein in Java geschriebene Plugins erweitert und nutzt. Dieses Zusammenspiel zwischen Objekten aus zwei verschiedenen Sprachen ist doch recht au\ss ergew\"{o}hnlich und kann bzw. sollte nat\"{u}rlich auch f\"{u}r SD bzw. {\sisac} ausgenutzt werden! - -\subsection{Der Isabelle-Scala-Layer} -Es sollten nun die Grundlegenden Eigenschaften von Scala bekannt sein. Die Einf\"uhrung des Scala-Layers ab Isabelle-Version 2009 war ein grosser Schritt f\"ur das Isabelle Projekt. Das Scala-Actor-Konzept erm\"oglicht die asynchrone Verarbeitung von einzelnen Beweisteilen und ist einer der massgeblichen Gr\"unde f\"ur die Einf\"uhrung des Scala-Layer. - -Dieser Absatz sollen nun die Eigenschaften des Scala-Layers und die damit verbundenen Chancen f\"ur das Isac- bzw. SD-Projektes -erarbeitet werden. - -\begin{figure} -\begin{center} -\includegraphics[width=100mm]{../fig-reuse-ml-scala-SD} -\end{center} -\label{fig-reuse-ml-scala} -\end{figure} - -Der Scala-Layer verbindet die Java Virtual Maschine (JVM) und den in Standart-ML (SML) geschriebenen Isabelle-Kern. Dabei wird ein internes Protokoll verwendet, dass den Datenaustausch zwischen jEdit und Isabelle/Isar erm\"oglicht. Dieses Protokoll ist im Moment noch (bewusst) ohne API ausgef\"uhrt. Aus diesem Grund musste eine Schnittstelle definiert werden, um den Datenaustausch des SD-Plugins (JVM) mit dem SD-Interpreter m\"oglich zu machen. Siehe dazu den Absatz "Verbindung zum Isabelle-Pure Plugin herstellen". Man kann aus diesem Umstand ableiten, dass die Isabelle-Entwickler mit diesem eingezogenen Scala-Layer und dem damit verbundenen internen Protokoll, auf eine konsistente Verwaltung der Theorie-Bibliotheken abzielen. Mit anderen Worten wird dem Anwendungsprogrammierer der direkte Zugriff auf die Isabelle/Isar-Komponente verwehrt. Der Anwender sollte hier also nicht angreifen sonder die Isabelle-Theorien entsprechend erweitern. - -\chapter{Konfiguration und Implementation der Komponenten} -Dieses Kapitel soll nun anhand der bereits gewonnen Erkenntnise illustrieren, wie die Entwicklungsumgebung vom Isabelle-Team kopiert wurde und wie wichtigsten Schritte zum SD-Plugin f\"{u}r jEdit wahrscheinlich aussehen werden. Wobei einige Schritte parallel und dadurch nat\"{u}rlich sehr gut im Team umgesetzt werden k\"{o}nnen. Eine genaue Aufstellung aller beteiligten Files k\"onnen dem Anhang D entnommen werden. - -\section{Konfiguration des Netbeans Projektes} -Um in k\"unftigen Entwicklungsvorhaben effizient kooperieren zu k\"onnen, wurde das Netbeans-Projekt genau nach den Vorgaben des Isabelle-Teams konfiguriert. - -\begin{enumerate} -\item Konfigurations-Files von Netbeans in ``Files''-View; beeinflussen sich gegenseitig - \begin{enumerate} - \item build.xml (aus template erzeugt, keine automatischen Ver\"anderunen) - \item nbproject/build-impl.xml (z.T. automatische Ver\"anderunen) - \item nbproject/project.xml (z.T. automatische Ver\"anderunen) - \item TODO - \end{enumerate} -\item Sacla-plugin installieren laut http://wiki.netbeans.org/Scala69, - \begin{enumerate} - \item von ``Install with NetBeasn 6.9'' - \item nach /usr/local/netbeans.../plugins/scala - \end{enumerate} -\item Scala-plugin installiert in NetBeans - \begin{enumerate} - \item Men\"u $>$ Tools $>$ Plugins $>$ Downloaded $>$ Add Plugins - \item alle Files von /usr/local/netbeans.../plugins/scala/ - \item Fenster zeigt alle ausgew\"alten Files - \item $<$Install$>$ calls Wizzard $<$Next$>$ probably accept Warning - \item Funktionstest: Men\"ue $>$ Files $>$ New Project: zeigt Scala als ``Categories'' - \end{enumerate} -\item Neues Projekt ``isac-jedit'' konfigurieren - \begin{enumerate} - \item Men\"u $>$ Open Project (weil schon aus dem Repository die notwendigen Files vorhanden sind) - \item /src/Tools/jeditC: Reference Problems, weil jEdit folgende Plugins braucht - \item Funktionskontrolle: ``Projects''-View zeigt das neue Projekt - \item Die Konfigurations-Files sind v\"ollig getrennt von anderen Projekten - \item Referenz-Probleme beheben; das zeigt auch eventuell fehlende Files - \begin{enumerate} - \item ``Projects''-View $>$ rightMouse $>$ Resolve Reference Problems: Fenster zeigt dieListe der fehlenden Dateien; $<$Next$>$ - \item Files holen aus ``Tools'' $>$ Libraries: \"uber Filebrowser aus dem Isabelle\_bundle holen contrib/jEdit---/jars - \item ``New Library'' - \begin{enumerate} - \item Cobra-renderer: cobra.jar - \item Console: Console.jar - \item ErrorList: ErrorList.jar - \item Hyperlinks: Hyperlinks.jar - \item Isabelle-Pure: Pure.jar - \item Rhino-JavaScript: js.jar - \item Scala-compiler: scala-compiler.jar - \item SideKick: SideKick.jar - \end{enumerate} - \item Funktions-Kontrollen - \begin{enumerate} - \item das kleine gelbe Warndreieck im ``Projects''-View ist verschwunden - \item im ``Projects''-View 2 Ordner: ``src'' und ``Libraries'' - \end{enumerate} - \end{enumerate} - \item jEdit-Paket zum ``isac-jedit''-Projekt hinzuf\"ugen - \begin{enumerate} - \item ``Project''-View $>$ rightMouse $>$ Add Jar/Folder: Filebrowser - \item /contrib/jedit.../jedit.jar - \item Funktions-Kontrolle: ist in ``Projects''/Libraries/jedit.jar - \end{enumerate} - \item Das neue Projekt ``isac-jedit'' zum Hauptprojekt machen: ``Project''-View $>$ rightMouse $>$ Set as Main Project; Funktions-Kontrolle: der Projektname ist boldface. - \end{enumerate} -\item Ab nun wird die Konfiguration \"uber ``trial and error'' zu Ende gef\"uhrt - \begin{enumerate} - \item Men\"u $>$ Build Main - \begin{enumerate} - \item Wenn: Target ``Isac-impl.jar'' does not exist in the project ``isac-jedit''. It is used from target ``debug'' - \begin{enumerate} - \item Versuch - \begin{itemize} - \item build-impl.xml l\"oschen - \item NetBeans neu starten, stellt build-impl.xml automatisch aus build.xml wieder her - \item \dots hat in diesem Fall nicht geholfen - \end{itemize} - \item Versuch zur Vermutung: Projekt wurde umbenannt von ``Isac'' in ``isac-jedit'', und das machte build.xml inkonsistent - \begin{itemize} - \item in build.xml query-replace ``Isac'' in ``isac-jedit'' - \item TODO? - \item - \end{itemize} - \end{enumerate} - \item Wenn: Problem: failed to create tsk or type scalac - \begin{enumerate} - \item Versuch: Pfad zum Scala bekanntgeben - \begin{itemize} - \item /usr/local/netbeans-6.9.1/etc/netbeans.conf: netbeans\_default\_options= richtigen Scala-Pfad setzen - \item build-impl.xml l\"oschen - \item NetBeans neu starten. - \end{itemize} - \end{enumerate} - \item Wenn Fehler: ``/usr/local/isabisac/src/Tools/jEditC/\${project.jEdit}/modes does not exist'' - \begin{enumerate} - \item grep -r "project.jEdit" * - \item nbproject/project.properties:project.jEdit=contrib/jEdit - \item TODO? - \end{enumerate} - \end{enumerate} - \end{enumerate} -\item error in project files, not in build.xml etc (1) - \begin{enumerate} - \item follow link to testSD.scala:22 - \item val str1: String = isabelle.Isac.parse(``Testdaten aus dem Parser!'')\\ - val str1: String = ``TEST'' //isabelle.Isac.parse(``Testdaten aus dem Parser!'')\\ - \item build once again ... successful\\ - \item watch in console what is being copied and compare build.xml, - $<$target name=''-pre-jar''$>$ - $<$target name=''-post-jar''$>$ - \item essential: a new Pure.jar has been generated, which has been extended with a new class ``Isac''; this class has been defined in scr/Pure/Isac/isac.scala - \item restore ``val str1: String = isabelle.Isac.parse(``Testdaten aus dem Parser!'')" requires new Pure.jar at the right place \dots - \item \dots the shellscript bin/testSD\_jedit creates this new Pure.jar - \end{enumerate} -\item error in bin/testSD - \begin{enumerate} - \item look at error messages, eg. src/Pure/: no such file or directory \dots - \item \dots means that the script has not been started from $\approx\approx$ --- this behaviour shall be improved a.s.a.p. - \item function test: \\ - \#\#\#\\ - \#\#\# Building Isabelle/Scala layer\\ - \#\#\#\\ - \item - \item - \end{enumerate} -$<$ $>$ -Men\"u $>$ $>$ $>$ $>$ $>$ $>$ -``Project''-View $>$ rightMouse $>$ $>$ $>$ $>$ $>$ -\item - \begin{enumerate} - \item - \begin{enumerate} - \item - \begin{itemize} - \item - \begin{itemize} - \item - \item - \item - \end{itemize} - \item - \item - \end{itemize} - \item - \item - \end{enumerate} - \item - \item - \end{enumerate} -\item - \begin{enumerate} - \item - \begin{enumerate} - \item - \begin{itemize} - \item - \begin{itemize} - \item - \item - \item - \end{itemize} - \item - \item - \end{itemize} - \item - \item - \end{enumerate} - \item - \item - \end{enumerate} -\end{enumerate} - - -\section{Implementation der jEdit Komponenten} - -\subsection{Erstellen des Plugin-Ger\"{u}sts} -Hier gilt es, erstmal den Umfang der gew\"{u}nschten Anforderungen an das Plugin so genau wie m\"{o}glich zu identifizieren. Hat man eine sehr genaue Vorstellung, wie das GUI des Plugins aussehen wird und welche Zusatz-Features angeboten werden sollen, so kann man gezielt unter den bereits bestehenden Plugins f\"{u}r jEdit nach n\"{u}tzlichen Plugins suchen, die in das SD-Plugin (m\"{o}glicherweise durch kleine Modifikationen) integriert werden k\"{o}nnen. Dies spart einerseits sehr viel Zeit und ist nebenbei genau die Art von Programmierung, die durch die offnene Plugin-Struktur von jEdit gef\"{o}rdert wird. - -Hat man nun die Planung abgeschlossen und m\"{o}glicherweise n\"{u}tzliche Plugins gefunden, kann mit der Programmierung des GUIs begonnen werden. Man sollte hier beachten, dass man von Beginn an festlegt, ob mit Scala- oder Java-Swing Komponenten gearbeitet werden soll. Es ist zwar m\"{o}glich, beide Formen zu mischen, doch aus Klarheitsgr\"{u}nden sollte man sich f\"{u}r eine Art entscheiden. Wobei hier die Empfehlung im Moment eher noch Richtung Java-Swing geht, da man hier eigentlich f\"{u}r jede Art von Problem bzw. Aufgabe bereits HowTo's im Web finden kann. Da bei Scala-Swing nur Wrapper auf die Java-Swing-Libraries gesetzt wurden, entsteht dadurch auch keinerlei Performance-Verlust. - -Es existiert bereits ein beispielhaftes Plugin am \sisac-Repository. Da der grunds\"{a}tzliche Aufbau eines jEdit-Plugins soweit umgesetzt wurde und bereits lauff\"{a}hig ist, sollte man dieses wohl als Ausgangspunkt verwenden. Die direkte Verwendung eines Isabelle-Klons ist wohl zu Beginn nicht zu empfehlen bzw. sollte meiner Meinung nach die Integration von Isac in Isabelle bzw. die Verwachsung der beiden Plugins das Fernziel sein und dadurch w\"{u}rde der Klon-Vorgang wohl eher Probleme schaffen als sie zu l\"{o}sen. - -\subsection{Erzeugung des Plugins} -Hat man die Planung des Plugin-Ger\"{u}sts abgeschlossen und die eigentliche Implementationsphase begonnen, kann dieses Plugin getestet bzw. erzeugt und via jEdit ausgef\"{u}hrt werden. Dazu muss zuerst das jar-File erzeugt und danach in den jEdit-Pluginsordner verschoben werden. Die Erzeugung kann nat\"{u}rlich direkt mittels NetBeans durchgef\"{u}hrt werden. Doch es ist auch m\"{o}glich dies via Kommandline durchzuf\"{u}hren. Folgende Schritte illustrieren wie die Erzeugung und der Kopiervorgang des Plugins durchgef\"{u}hrt werden k\"{o}nnen(Ausschnitt aus dem Skript isac\_jedit, Anhang C): -\begin{enumerate} -\item Das Plugin kann mittels Kommandline folgenderma{\ss}en erstellt werden: \\ \textit{cd ISABELLE\_HOME/src/Tools/isac/jEdit} $\rightarrow$ \textit{ant jar} -\item Nun kann das das neue Plugin ganz einfach kopiert werden \textit{cp contrib/jEdit/build/ // jars/Isac.jar ../../../../contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/} -\item jEdit ausf\"{u}hren und testen -\end{enumerate} - -\subsection{Verbindung zum Isabelle-Pure Plugin herstellen} -Der n\"{a}chste Schritt sieht nun die Versorgung des GUIs mit Daten vor. Da das jEdit-Plugin selbst nicht rechnen/interpretieren kann, m\"{u}ssen Daten an den Isabelle-Kern, also das Isabelle-Pure-Plugin weitergegeben werden. Dort k\"{o}nnen die Daten verwertet und aufbereitet zur\"{u}ck an das Frontend gereicht werden. - -\begin{figure} -\begin{center} -\includegraphics[width=100mm]{../fig-jedit-plugins-SD} -\end{center} -\label{fig-jedit-plugins-SD} -\end{figure} - -Um diesen Schritt setzen zu k\"{o}nnen, muss eine Schnittstelle zwischen dem Kern von Isabelle, Isabelle-Pure und dem Plugin hergestellt werden. Dazu muss zun\"{a}chst Pure.jar leicht modifiziert, danach neu erstellt und zuletzt zu den restlichen jEdit-Plugins hinzugef\"{u}gt werden. Dies wurde auf der aktuellen Version am Repository bereits erledigt. Folgende Schritte wurden dazu gesetzt und sind wieder n\"{o}tig, da sicher weitere Modifikationen an der Datei Pure.jar n\"{o}tig sein werden. - - -\begin{enumerate} -\item Um den \sisac-Teil im Isabelle-Pure genau abzugrenzen, wurde ein Ordner \textit{Isac} angelegt und ein Testfile \textit{isac.scala} erstellt. -\item Nun muss diese File nat\"{u}rlich dem Make-Skript \textit{ISABELLE\_HOME/src/Pure/build-jars} hizugef\"{u}gt werden, um beim Erzeugen des jar-Files mitverpackt zu werden. -\item Nun kann Pure.jar mittels Kommandline erstellt werden: \textit{cd /src/Pure} $\rightarrow$ \textit{../../bin/isabelle env ./build-jars} -\item Nun kann das das neue Plugin ganz einfach kopiert werden \textit{cp ../../lib/classes/Pure.jar ../../contrib/jedit-4.3.2\_Isabelle-6d736d983d5c/jars/} -\item jEdit ausf\"{u}hren und testen -\end{enumerate} -Alle die oben angef\"{u}hrten Punkte, sowie das Erzeugen und Kopieren des Plugins selbst, werden vom Script isac\_jedit erledigt. -Das Skript kann dem Anhang C entnommen werden. - -\section{Umsetzung des SD-Parsers} -Aus diversen Gr\"{u}nden wurde dieser Punkt im Zuge dieser Projektarbeit nicht mehr umgesetzt sonder nach hinten verschoben. Jedoch gibt es bereits eine Version des Parsers in ML und diese kann in einigen Arbeitsstunden in Zusammenarbeit mit Herrn Neuper in Scala \"{u}bersetzt und eingesetzt werden. - -Es ist bereits ein Parser in ML im Isabelle-Verzeichnis vorhanden, \textit{src/Pure/isar/ parse.ML}. Hier werden sogannte "parse combinators" verwendet. Dasselbe wird in n\"{a}chster Zeit von Seiten des Isabelle-Team auch f\"{u}r den Scala-Parse implementiert. Dadurch lassen sich hieraus auch wichtige Erkenntnisse gewinnen und dies spricht ebenfalls f\"{u}r die Verschiebung dieses Milestones nach hinten. - - -\chapter{Ausblick: Von SD- zum \isac-Plugin} -Die obigen Schritte sind n\"{o}tig, um das vorl\"{a}ufige Plugin SD umzusetzen. Nat\"{u}rlich beginnt danach die spannende Arbeit erst so richtig. Ist erst mal ein funktionierender SD-Parser vorhanden, kann dieser immer weiter verbessert und verfeinert werden, bis man auch damit beginnen kann, ihn f\"{u}r das \sisac-Projekt zu nutzen. - -Daneben kann an der Weiterentwicklung des GUIs gearbeitet werden und die ersten Schritte zur Ann\"{a}herung an das Isabelle-Plugin k\"{o}nnen hier erfolgen. - -\chapter{Zusammenfassung und R\"{u}ckblick} -Zusammenfassend wird nun ein \"Uberblick gegeben, welche Milestones erledigt wurden und welche nicht; Details dazu finden sich in Anhang A. %TODO -Abschlie{\ss}end gebe ich einen R\"uckblick auf meine pers\"onlichen Erfahrungen aus dieser Bakkalaureats-Arbeit. - -\section{Zusammenfassung} -Folgende Milestones wurden erfolgreich abgeschlossen: -\begin{enumerate} -\item Relevante Isabelle Komponenten dokumentiert - -\item Installation der Standard-Komponenten: - \begin{itemize} - \item Mercurial Versioncontrol - \item NetBeans IDE - \item Standard Isabelle Bundle - \end{itemize} - -\item Entwicklungsumgebung vom Isabelle-Team kopieren - \begin{itemize} - \item Isabelle-Sources vom Repository M\"unchen (Java, Scala, ML) - \item jEdit als NetBeans Projekt definiert - \end{itemize} - -\item Relevante Komponenten implementieren - \begin{itemize} - \item jEdit Plugin f\"ur SD - \item Verbindung des Plugins zu Isabelle - \item zugeh\"origen Parser: nur ein Test in SML - \end{itemize} -\end{enumerate} - -\noindent Aus Zeitgr\"unden war {\em nicht} m\"oglich, ein komplettes SD-Plugin zu implementieren; dazu w\"are auch ein Interpreter f\"ur SD auf der ML-Seite n\"otig gewesen. - -\paragraph{Voraussetzungen f\"ur k\"unftige Entwicklung} geschaffen: -\begin{enumerate} -\item f\"ur die Implementation von ``structured derivations'' in Isabelle \dots -\item \dots als Vorarbeit f\"ur jEdit als k\"unftiges \isac-Frontend -\item f\"ur Mitarbeit an k\"unftiger Integration von Isabelle in Entwicklungswerkzeuge (Testcase-Generation etc). -\end{enumerate} - -\section{R\"uckblick} -Isabelle ist ein sehr gro\ss es Softwarepacket mit mehreren Millionen LOC. Daher gestaltete sich die Einarbeitungsphase sehr schwierig und kostet sehr viel Zeit. Erschwerend kam hinzu, dass ich von Beginn an mit mehreren, f\"{u}r mich noch ganz neue, Technologien arbeiten musste. Diese Herausforderungen schon zu Beginn machten die Arbeit an \sisac{ }von Beginn an spannend. Hier ist mir vorallem die gemeinsam mit meinem Betreuer Herrn Walther Neuper durchgef\"{u}hrte Installationsarbeit von Isabelle in Erinnerung geblieben. Nie zuvor hatte ich f\"{u}r eine Installation von Software so lange gebraucht - eine ganz neue, wichtige Erfahrung. - -Einer der bedeutensten Milesteine war r\"{u}ckblickend wohl, die Verzeichnisstruktur von Isabelle grunds\"atzlich verstanden zu haben. Bei einem Softwarepacket von dieser Gr\"{o}{\ss}e war es wichtig zu wissen, wo man Files suchen/modifizieren/einf\"{u}gen muss, um den gew\"{u}nschten Effekt erreichen zu k\"onnen. - -Der n\"achste wichtige Schritt war das bereits teilweise bestehende NetBeansprojekt lauff\"ahig zu machen und mir damit zum ersten mal selbst das jEdit-Isabelle-Plugin erzeugen zu k\"onnen. Dies war ein sehr bedeutsamer Schritt, da ich hier zum einen NetBeans und dessen Konfiguration besser kennenlernen konnte und zum anderen sehr viel \"{u}ber die Pluginstruktur eines jEdit-Plugins lernen konnte. Zu Beginn machte mir hier der Mix aus Scala-, Java-, XML- und diversen Config-Files Probleme. - -Bis jetzt hatte ich eigentlich noch nicht wirklich mit der Programmierung des Plugins begonnen doch es waren schon zig Arbeitsstunden rein f\"{u}r Einarbeitungs- und Vorbereitungsaufgaben verstrichen - wieder eine neue Erfahrung f\"{u}r mich. Nach einigen Test- bzw. Beispielprogrammen um die Sprache Scala etwas kennenzulernen, begann die wohl spannenste Phase im Projektverlauf. Das in Java geschriebene Beispielplugin "Quick-Notepad" wurde in Scala \"{u}bersetzt und etwas abge\"andert. - -Der letzte wirklich bedeutende Schritt war Herstellung der Verbindung zwischen Isabelle-Pure und \sisac. Dieser Punkt ist sehr wichtig, da ohne diese Schnittstelle die Planung des SD-Parser nicht m\"oglich gewesen w\"are. Der letzte Schritt, also die Implementation des SD-Parsers wurde aufgeschoben, da es derzeit seitens des Isabelle-Teams ebenfalls Bestrebungen gibt, einen neuen Scala-Parser zu designen und wir von diesen Erkenntnissen mit Sicherheit in der Zunkft profitieren k\"onnen. - -%Abschlie{\ss}end m\"ochte ich mich bei meinem Betreuer Herrn Walther Neuper sehr herzlich f\"{u}r die gute Betreuung und die spannenden Entwicklungsstuden bedanken. Es war eine sehr lehrreiche und interessante Projektarbeit! - -%\chapter{Milestones und Arbeitsprotokolle} -%\section{Inhaltliche Voraussetzungen erarbeitet: beendet am 27.09.2010} -%\begin{itemize} -%\item Kenntnis der Grundlagen und Anwendung von CTP: beendet am 03.08.2010 -%\item Charakteristika der Programmsprache Scala: beendet am 27.09.2010 -%\item Scala Actors: beendet am 12.08.2010 -%\end{itemize} -%\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} -%\hline -%Datum & T\"atigkeit & Einheiten \\ \hline -%12.07.2010 & Meeting: erste Besprechung und Erkl\"{a}rungen zu Isabelle, Isac und CTPs & 2 \\ \hline -%15.07.2010 & Recherche \"{u}ber Isabelle und CTPs & 3 \\ \hline -%20.07.2010 & Meeting: Besprechen der grunds\"{a}tzlichen Vorgangsweise und Ziele & 1 \\ \hline -%23.07.2010 & Isabelle: Ziele, Techniken (ML) und Zusammenh\"{a}nge mit Isac abkl\"{a}ren & 1 \\ \hline -%30.07.2010 & Ende der Einarbeitungstage: weitere Vorgensweise \"{u}ber Backs 'structured derivations'; Begriffserkl\"{a}rung & 3 \\ \hline -%01.08.2010 & Recherche: Buch f\"{u}r Scala & 2 \\ \hline -%03.08.2010 & Isabelle bestehende Technologie studieren & 4 \\ \hline -%05.08.2010 & Einarbeiten in Scala: Unterschiede zu Java indentifizieren & 1 \\ \hline -%06.08.2010 & Einarbeiten in Scala: Unterschiede zu Java indentifizieren, erste Beispielfiles & 4 \\ \hline -%08.08.2010 & Einarbeiten in Scala: funktionale Seite von Scala & 2 \\ \hline -%09.08.2010 & Einarbeiten in Scala: Testfiles mit Scala-Swing & 5 \\ \hline -%12.08.2010 & Studieren von Papers zu Scala Actors & 3 \\ \hline -%24.09.2010 & Scala: Arbeiten mit Klassen und Schnittstellen & 3 \\ \hline -%25.09.2010 & Scala: Experimente mit Java in Scala-Source & 6 \\ \hline -%27.09.2010 & Scala: Testfiles zu "Funktional vs Imperativ" & 4 \\ \hline \hline -% & Anzahl der Einheiten & 44 \\ -%\hline -%\end{tabular} -% -% -%\section{Technische Voraussetzungen hergestellt: beendet am 02.08.2010} -%\begin{itemize} -%\item Isabelle installiert, Filestruktur bekannt: beendet am 02.08.2010 -%\item Scala in NetBeans eingebunden: beendet am 22.07.2010 -%\item Mercurial installiert und einrichten des Repositories: beendet am 19.07.2010 -%\end{itemize} -%\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} -%\hline -%Datum & T\"atigkeit & Einheiten \\ \hline -%19.07.2010 & Beginn der Installationsarbeiten: Repo klonen und testen & 6 \\ \hline -%20.07.2010 & Installationsarbeiten, Einarbeiten in Filestruktur & 7 \\ \hline -%21.07.2010 & Einarbeiten in Filestruktur & 6 \\ \hline -%22.07.2010 & Vorbereitungen: NetBeans, JDK und Scala installieren. Scala in NetBeans integrieren & 8 \\ \hline -%23.07.2010 & Isabelle-jEdit-Plugin mittels NetBeans ausf\"{u}hren: testen & 5 \\ \hline -%27.07.2010 & Isabelle-jEdit-Plugin: \"{a}nderungen an der Projektstruktur & 7 \\ \hline -%28.07.2010 & Experimente mit Isabelle-jEdit-Plugin & 6 \\ \hline -%29.07.2010 & Identifikations der Parse-Einstiegsstelle & 5 \\ \hline -%30.07.2010 & Experimente mit Isabelle-jEdit-Plugin, Besprechung \"{u}ber Erfahrungen mit Filestruktur & 4 \\ \hline -%02.08.2010 & Installationen und einrichten des Repos auf meinen Laptop & 6 \\ \hline \hline -% & Anzahl der Einheiten & 60 \\ -%\hline -%\end{tabular} -% -%\section{NetBeans-Projekt aufgesetzt: beendet am 02.08.2010} -%\begin{itemize} -%\item Grundlegende Projektstruktur f\"ur ISAC hergestellt: beendet am 02.08.2010 -%\item jEdit-Plugin: XML-Files f\"{u}r ISAC vorbereitet: beendet am 22.07.2010 -%\item jEdit-Plugin: Source files geschrieben: beendet am 19.07.2010 -%\end{itemize} -%\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} -%\hline -%Datum & T\"atigkeit & Einheiten \\ \hline -%10.08.2010 & Projektstruktur anlegen, build.xml anpassen & 7 \\ \hline -%11.08.2010 & jEdit-Plugin-Struktur studieren: Howto durcharbeiten & 5 \\ \hline -%21.08.2010 & bestehende jEdit-Plugins (Java) durcharbeiten & 3 \\ \hline -%22.08.2010 & Kopieren des Isabelle-jEdit-Plugins, Umarbeiten f\"{u}r ISAC & 3 \\ \hline -%24.08.2010 & Umarbeiten des Isabelle-Plugins f\"{u}r ISAC & 6 \\ \hline -%26.08.2010 & Problem mit Isabelle-Umgebungsvariable: Suche nach L\"{o}sungen & 3 \\ \hline -%28.08.2010 & Recherchen zum Umgebungsvariable-Problem, Arbeiten mit den Isabelle-Shell-Skripts & 2 \\ \hline -%29.08.2010 & Experimente mit den Path-Varialbe der jvm & 3 \\ \hline -%30.08.2010 & Isabelle-jEdit-Plugin endlich vollst\"{a}ndig lauff\"{a}hig gebracht & 4 \\ \hline -%01.09.2010 & Arbeiten an der jEdit-ISAC-Projektstruktur & 3 \\ \hline -%04.09.2010 & Umarbeiten des Isabelle-Plugins f\"{u}r ISAC & 5 \\ \hline -%20.09.2010 & Einrichten des Laptops f\"{u}r Isabelle-Isac & 4 \\ \hline -%22.09.2010 & Meeting: Fortschrittsbericht, kurze Einf\"{u}hrung f\"{u}r Mitstreiter & 3 \\ \hline -% -%29.09.2010 & Neue Vorgehensweise: QuickNotepad-Plugin(QN) wird in Scala \"{u}bersetzt und f\"{u}r ISAC entsprechend angepasst: Arbeit an den XML-Files & 4 \\ \hline -%30.09.2010 & QN: Start mit \"{u}bersetzten der Sourcefiles & 5 \\ \hline -%02.10.2010 & QN: \"{U}bersetzten der Sourcefiles & 6 \\ \hline -%04.10.2010 & QN: \"{U}bersetzten der Sourcefiles: Problem bei Interface & 3 \\ \hline -%05.10.2010 & QN: QN vollst\"andig in Scala \"{u}bersetzt, testen & 2 \\ \hline \hline -% & Anzahl der Einheiten & 71 \\ -%\hline -%\end{tabular} -% -%\section{Experimentelle Parser implementiert: beendet am 04.03.2011} -%\begin{itemize} -%\item Experimente mit dem SideKick-Parser abgeschlossen: beendet am 03.02.2011 -%\item Verbindung zu Isabelle-Pure hergestellt: beendet am 04.03.2011 -%\item Implementierung des Scala-Parsers: aufgeschoben -%\end{itemize} -%\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} -%\hline -%Datum & T\"atigkeit & Einheiten \\ \hline -%28.01.2011 & Testen des SideKick-Parsers im Isabelle-Plugin & 2 \\ \hline -%29.01.2011 & Leichte Modifikationen des SideKick-Parsers im Isabelle-Plugin & 1 \\ \hline -%08.02.2011 & Besprechung zum Abschluss der praktischen Arbeiten & 1 \\ \hline -%16.02.2011 & Erstellen des Isabelle-Pur jar-Files & 1 \\ \hline -%19.02.2011 & Behebung des Problems mit den Umgebungsvariablen & 1 \\ \hline -%03.03.2011 & Erzeugung des Pure.jar Package m\"{o}glich & 2 \\ \hline -%04.04.2011 & Verbindung zwischen Plugin und Isabelle-Pure hergestellt und getestet & 3 \\ \hline -%08.04.2011 & Besprechung: Implementierung des experimentellen Parsers wird nicht mehr durchgef\"{u}hrt & 1 \\ \hline \hline -% & Anzahl der Einheiten & 12 \\ -%\hline -%\end{tabular} -% -%\section{Verfassen der Dokumentation und abschliesende Arbeiten: beendet am TO.DO.2011} -%\begin{itemize} -%\item Bacc.-Protokoll fertiggestellt: beendet am 01.03.2011 -%\item Dokumentation: erste Version fertiggestellt: beendet am 28.04.2011 -%\item Dokumentation abgeschlossen: beendet am TO.DO.2011 -%\end{itemize} -%\begin{tabular}{|p{2cm}|p{8cm}|p{2cm}|} -%\hline -%Datum & T\"atigkeit & Einheiten \\ \hline -%01.03.2011 & Besprechung zum Ablauf der Dokumentationsarbeiten: Protokoll und Dokumentation & 1 \\ \hline -%01.03.2011 & Erstellen des Protokolls & 2 \\ \hline -%08.03.2011 & Besprechung zur Doku und zur Schnittstelle zu Isabelle-Pure & 1 \\ \hline -%17.03.2011 & Dokumentation schreiben & 2 \\ \hline -%19.03.2011 & Dokumentation schreiben & 3 \\ \hline -%24.04.2011 & Dokumentation schreiben & 2 \\ \hline -%25.04.2011 & Dokumentation schreiben & 4 \\ \hline -%27.04.2011 & Dokumentation schreiben & 2 \\ \hline -%28.04.2011 & Dokumentation: Fertigstellen der ersten Version & 3 \\ \hline \hline -% & Anzahl der Einheiten & 20 \\ -%\hline -%\end{tabular} -% -%\section{Pr\"asentation der Arbeit im IST-Seminar }% am ..(*)...} diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/tactics.tex --- a/src/Doc/isac/tactics.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -\chapter{\isac s tactics} - -\begin{description} -\item{\bf Init\_Proof\_Hid (dialogmode, formalization, specification)} transfers the arguments to the math engine, the latter two in order to solve the example automatically. The tactic is not intended to be used by the student; it generates a proof tree with an empty model. -\item{\bf Init\_Proof} generates a proof tree with an empty model. -\item{\bf Model\_Problem problem} determines a problemtype (eventually found in the hierarchy) to be used for modeling. -\item{\bf Add\_Given, Add\_Find, Add\_Relation formula} inputs a formula to the respective field in a model (necessary as long as there is no facility for the user to input formula directly, and not only select the respective tactic plus formula from a list). -\item{\bf Specify\_Theory theory, Specify\_Problem problem, Specify\_Method method} specifies the respective element of the knowledgebase. -\item{\bf Refine\_Problem problem} searches for a matching problem in the hierarchy below 'problem'. -\item{\bf Apply\_Method method} finishes the model and specification phase and starts the solve phase. -\item{\bf Free\_Solve} initiates the solve phase without guidance by a method. -\item{\bf Rewrite theorem} applies 'theorem' to the current formula and transforms it accordingly (if possible -- otherwise error). -\item{\bf Rewrite\_Asm theorem} is the same tactic as 'Rewrite', but stores an eventual assumption of the theorem (instead of evaluating the assumption, i.e. the condition) -\item{\bf Rewrite\_Set ruleset} similar to 'Rewrite', but applies a whole set of theorems ('ruleset'). -\item{\bf Rewrite\_Inst (substitution, theorem), Rewrite\_Set\_Inst (substitution, ruleset)} similar to the respective tactics, but substitute a constant (e.g. a bound variable) in 'theorem' before application. -\item{\bf Calculate operation} calculates the result of numerals w.r.t. 'operation' (plus, minus, times, cancel, pow, sqrt) within the current formula. -\item{\bf Substitute substitution} applies 'substitution' to the current formula and transforms it accordingly. -\item{\bf Take formula} starts a new sequence of calculations on 'formula' within an already ongoing calculation. -\item{\bf Subproblem (theory, problem)} initiates a subproblem within a calculation. -\item{\bf Function formula} calls a function, where 'formula' contains the function name, e.g. 'Function (solve $1+2x+3x^2=0\;\;\;x$)'. In this case the modelling and specification phases are suppressed by default, i.e. the solving phase of this subproblem starts immediately. -\item{\bf Split\_And, Conclude\_And, Split\_Or, Conclude\_Or, Begin\_Trans, End\_Trans, Begin\_Sequ, End\_Sequ, Split\_Intersect, End\_Intersect} concern the construction of particular branches of the prooftree; usually suppressed by the dialog guide. -\item{\bf Check\_elementwise assumptions} w.r.t. the current formula which comprises elements in a list. -\item{\bf Or\_to\_List} transforms a conjunction of equations to a list of equations (a questionable tactic in equation solving). -\item{\bf Check\_postcond:} check the current formula w.r.t. the postcondition on finishing the resepctive (sub)problem. -\item{\bf End\_Proof} finishes a proof and delivers a result only if 'Check\_postcond' has been successful before. -\end{description} \ No newline at end of file diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/template_master_thesis.zip Binary file src/Doc/isac/template_master_thesis.zip has changed diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/template_thesis_prelim.tex --- a/src/Doc/isac/template_thesis_prelim.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -\documentclass{report} -\usepackage{a4} -\usepackage{times} -\usepackage{latexsym} -%\bibliographystyle{alpha} -\bibliographystyle{abbrv} -\usepackage{graphicx} - -\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} -\def\sisac{{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$}} - -\title{Tentative Title:\\ - TODO} -\author{n.n.\\ -{\tt TODO@xxx.at}} - -\begin{document} -\maketitle -\abstract{ -TODO -} - -\chapter{Background} - -\chapter{Goal} - -\chapter{State of the Art} - -\chapter{Thesis Structure} - -\chapter{Timeline} -Milestones - -\section{TODO} - -\section{TODO} - -\section{TODO} - - -%\bibliography{bib/TODO} -\end{document} diff -r 7f3760f39bdc -r f8845fc8f38d src/Doc/isac/tleh/ferialprakt.tex --- a/src/Doc/isac/tleh/ferialprakt.tex Mon Sep 16 12:27:20 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -\documentclass[a4paper,12pt]{article} -%usepackage{ngerman} - - -\def\isac{${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} -\def\sisac{\footnotesize${\cal I}\mkern-2mu{\cal S}\mkern-5mu{\cal AC}$} - -\title{Ferialpraxis\\ am Institut f\"ur Softwaretechnologie\\ - der Technischen Universit\"at Graz\\ - Arbeitsprotokoll} -\author{Thomas Leh\\ - t.leh@gmx.at} -\date{\today} - -\begin{document} -\maketitle - -\section{Pers\"ohnliche Zielsetzung} -Im letzen Sommer vor der Maturaklasse wollte ich mich schon \"uber -Studienm\"oglichkeiten informieren. -Meine Interessen liegen im Bereich der Computerwissenschaften und ich war -deshalb froh, die Praktikumsstelle bekommen zu haben. -Dabei wollte ich Folgendes erzielen: -\begin{itemize}\itemsep1pt -\item Genereller Einblick in die Software-Entwicklung -\item Einblick ins Programmieren -\item Informationen \"uber die Studienrichtung Informatik auf der TU -\item Arbeitserfahrung im Bereich der Informatik -\end{itemize} -\newpage -\section{Arbeitsprotokoll} -\begin{center} -\begin{tabular}{l|l|r} -Datum & T\"atigkeit & Std. \\ \hline -12.7.11 - & Demonstration des ``educational math assistant \sisac'' &7.5 \\ - & Demonstration des Theorem Provers Isabelle & \\ - & Einf\"uhrung Linux, objektorientierte/funktionale Programmierung& \\ - & Installation: Isabelle, \sisac-core, Mercurial & \\ \hline -13.7.11 & Einf\"uhrung Latex und ML Basic & 7.5 \\ - & Konfiguration von Mercurial & \\ - & ML Basics \"Ubungen & \\\hline -14.7.11 & Einf\"uhrung ML Functions und ML Combinators &7.5 \\ - & \"Ubungen ML Functions und ML Combinators s & \\ \hline -15.7.11& Einf\"uhrung ML Datastructure &7.5 \\ - & Ml Datastructure \"Ubungen & \\ - & Informationen \"uber Rewriting und MathEngine & \\ \hline -18.7.11 & Einf\"uhrung in die Fehlersuche (ISAC-Tests) & 7.5 \\ - & Fehlersuche im Directory ``Frontend'' & \\ \hline -19.7.11 & Fehlersuche im Directory ``Knowledge'' & 7.5 \\ - & Uncommanding funktionierender Tests & \\ \hline -20.7.11 & Einf\"uhrung Fehlerbeseitigung (ISAC-Tests) & 7.5 \\ - & Fehlerbeseitigung im File polyminus.sml & \\ \hline -21.7.11 & Informationen \"uber Studienrichtungen der Informatik & 7.5 \\ - & Fehlerbeseitigung im File integrate.sml & \\ \hline -22.7.11 & Fehlersuche in der File ``diffapp'' & 7.5 \\ -& Beseitigung des Fehlers & \\ \hline -25.7.11 & Fehlersuche in der File ``diff.sml'' & 7.5\\ -& Fehlerbeseitigung in der File ``diff.sml``& \\\hline -26.7.11 & updaten des ``scr'' Directories & 7.5 \\ -& Fehlersuche im ``scr'' Directory & \\ \hline -27.7.11 & updaten des ``scr'' Directories & 7.5 \\ -& Fehlerbehebung in den Files eqsystem.thy, atools.thy & \\ \hline -28.7.11 & Abschluss: Check des builds, check aller Tests & 7.5 \\ - & Fertigstellung des Protokolls & \\ \hline -29.7.11 & Austausch mit Ferialpraktikanten von anderen Fakult\"aten & 7.5 \\ -\end{tabular} -\end{center} -\newpage -\section{R\"uckblick auf das Praktikum} - - - -\paragraph{Im Bereich der Software-Entwicklung} wurden meine Erwartungen -erf\"ullt. Ich wei\ss \ jetzt wie bei einem gr\"o\ss eren Software-Projekt -gearbeitet wird und habe mich mit den Umgang mit der Versionsverwaltungssoftware -Mercurial vertraut gemacht. Des weiteren wurde mir die wichtige Rolle von Tests in -Software-Projekten bewusst gemacht. - -\paragraph{Von der Programmierung} habe ich mir einen gro\ss en \"Überblick - verschaffen k\"onnen. Dabei habe ich vorallem einiges zum Thema ``Funktionales -Programmieren (SML)'' erfahren und wurde mit dem Editor-Programm ``Jedit'' -vertraut gemacht. - -\paragraph{Informationen \"uber die Studienrichtungen der Informatik} konnte ich -auch gewinnen. Ich habe Zug\"ange bei tugonline in Erfahrung gebracht und habe -mich \"uber die Studienrichtungen Informatik, Telematik und Softwareentwicklung- -Wirtschaft informiert. - -\paragraph{Arbeitserfahrung} konnte ich auch einige erlangen. Es herrschte eine -sehr komplexe, und vor allem ungewohnte Arbeitsumgebung (Linux,Mercurial,Isabelle) -an die es sich zu gew\"ohnen galt. Es wurde mit mehreren dutzend Files mit einigen -tausend Programmzeilen gearbeitet. - - -\end{document}