doc-isac/mlehnfeld/master/thesis/conclusion.tex
author Walther Neuper <neuper@ist.tugraz.at>
Wed, 23 Jul 2014 14:32:19 +0200
changeset 55476 8e3f73e1e3a3
parent 55466 55c2d2ee3f92
permissions -rw-r--r--
final docu of mlehnfeld

copy from https://hg.risc.uni-linz.ac.at/wneuper/mlehnfeld
changeset 97ab9b31c84d: Added tag fixed final for changeset 2faac24320f2
author Mathias Lehnfeld <s1210629013@students.fh-hagenberg.at>
Sun, 20 Jul 2014 16:32:03 +0200 (2 days ago)
changeset 38 97ab9b31c84d
s1210629013@55466
     1
\chapter{Conclusion}
s1210629013@55404
     2
\label{cha:conclusion}
s1210629013@55466
     3
In this thesis we showed how an educational mathematics system called \isac{} was integrated with the theory data evaluation scheme managed by \isabelle, an interactive theorem proving system. This modification allowed for the straight forward introduction of a parallel execution mechanism called {\em futures}, which are data structures holding possibly unfinished computations and whose evaluation is efficiently managed by \isabelle{}'s run-time system. Before we went into the details of this process, a comprehensive theoretical basis was established. This included a discussion of the requirement for modern software to utilize the processing power available on shared memory multi-core architectures which have become a standard during the last decade. Also, various approaches towards the implementation and benefits of parallelism and concurrency in functional programming were explored, along with important aspects to consider in order to parallelize software efficiently. The architectures and technologies related to \isabelle{} and \isac{} were explained and we saw how both projects combined \textit{JVM}-based front-ends with logical engines developed in \textit{Standard ML} and followed different approaches for the communication between these layers. The systems' designs show how one can benefit from the advantages and strengths of different programming paradigms and platforms within a single architecture. The results of the case study are promising and show that depending on the problem at hand, the achievable speedup can be close to a factor of the number of available processing cores, potentially enhanced even more by the use of simultaneous multithreading (hyper-threading).
s1210629013@55466
     4
%NOTES: functional programming, higher-order -> compiler responsible for efficiency; a lot of research has gone into it.
s1210629013@55404
     5
s1210629013@55404
     6
s1210629013@55466
     7
\section{Future Work}
s1210629013@55466
     8
While \isac{}'s internal user session management has now been parallelized, multiple user GUIs communicate with the same standard input stream on the \textit{Standard ML} side and this communication is unsynchronized. The mathematic engine writes to one single standard output stream. The write operation in use is provided and synchronized by \isabelle. However, since all GUIs read from the same stream, they need to filter out all messages not meant for them and thus waste resources, especially with growing numbers of simultaneous user sessions. The next important step is therefore a more flexible, efficient and robust communication model which would then allow the parallel session management to be stressed and also fine-tuned to perform well in practice.
s1210629013@55466
     9
Other improvements to \isac{} include utilizing of \isabelle{}'s function package and code generator to simplify and speedup \isac{}'s programming language, adaptation of \isabelle{}'s capabilities with respect to floating point numbers and complex numbers, possibly adopt term nets for better performance of \isac{}'s rewrite engine.  The latter plans for improvement of the mathematics-engine can be pursued independently from work on the front-end due to a stable interface in between. While \isac{}'s own front-end will be extended and improved, future development of the \textit{Isabelle/jEdit} IDE may enable \isac{} to adopt it as its front-end in the long run.
s1210629013@55404
    10
neuper@55476
    11
The whole case study involved deeply invasive refactoring processes. The presence of automatic tools for this kind of tasks in \textit{Standard ML} would have been desirable. While there has been related work on \textit{Haskell} \cite{brown2012paraforming,thompson2005refactoring,dig2011refactoring,li2006comparative} and \textit{Erlang} \cite{brown2013cost,li2006comparative}, there are, to my knowledge, no such projects specifically for \textit{Standard ML} available. These could also help remove unused code and support convenient restructuring of modules.
s1210629013@55466
    12
% TODO: isa_pide_educational.pdf
s1210629013@55404
    13
s1210629013@55466
    14
%>>> Sind die Streams zwischen Mathematikengine und Frontend
s1210629013@55466
    15
%>>> synchronisiert? Das müsste ich dann nämlich auch noch machen. Oder
s1210629013@55466
    16
%>>> passieren sonst noch Dinge innerhalb von appendFormula, die
s1210629013@55466
    17
%>>> möglicherweise synchronisiert werden müssen?
s1210629013@55466
    18
%>>
s1210629013@55466
    19
%>> Diese Frage geht nun über die Programmiersprache (in [2] oben) weiter
s1210629013@55466
    20
%>> hinunter zum Betriebssystem: stdin/stdout Streams [3] sind da
s1210629013@55466
    21
%>> unglaublich robust: Isac funktioniert schon jetzt so, dass das Java ganz
s1210629013@55466
    22
%>> beliebig auf stdin schreibt, ohne sich irgendwie um stdout zu kümmern.
s1210629013@55466
    23
%>> Beobachtet man die Konsole, die stdin und stdout gemeinsam darstellt, so
s1210629013@55466
    24
%>> sieht das sehr verwirrend aus.
s1210629013@55466
    25
%>>
s1210629013@55466
    26
%> Isabelle hat in implementation.pdf die direkten, unsynchronisierten
s1210629013@55466
    27
%> Zugriffe auf die Standard Streams ausdrücklich verboten. Dabei geht es
s1210629013@55466
    28
%> nicht um eine Abhängigkeit zwischen stdin und stdout. Mehrere, parallele
s1210629013@55466
    29
%> Schreiboperationen auf stdout können beispielsweise zu fehlerhaften
s1210629013@55466
    30
%> Ausgaben führen.
s1210629013@55466
    31
%>> printf("hello\n");
s1210629013@55466
    32
%> und
s1210629013@55466
    33
%>> printf("world\n");
s1210629013@55466
    34
%> ergeben zB.
s1210629013@55466
    35
%>> hewolrlo
s1210629013@55466
    36
%>> ld
s1210629013@55466
    37
%> Ich weiß nicht, ob dieses Beispiel realistisch ist. Die Problematik
s1210629013@55466
    38
%> konnte ich aber nicht anders ausdrücken.
s1210629013@55466
    39
%>
s1210629013@55466
    40
%Damit hast Du die Problematik perfekt ausgedrückt, und das Beispiel ist
s1210629013@55466
    41
%sehr realistisch: die verschiedenen Threads mit den jeweiligen Aufrufen
s1210629013@55466
    42
%der math-engine kommen nach einer beliebigen Zeitspanne zurück (0.005 sec
s1210629013@55466
    43
%– 5.00 sec in verfügbaren Beispielen) --- und dann steht nur 1 stdout für
s1210629013@55466
    44
%alle Threads zur Verfügung.
s1210629013@55466
    45
%Mit dem einzigen stdout bleibt ein wesentlicher Teil des derzeitigen
s1210629013@55466
    46
%Flaschenhalses in Isac’s Interaktions-Kette nach Abschluss Deiner Arbeit
s1210629013@55466
    47
%bestehen. Damit jeder Thread seinen eigenen stdin/out bekommt, sind
s1210629013@55466
    48
%symmetrische Änderungen auf der Java-Seite notwendig --- eine schöne
s1210629013@55466
    49
%Arbeit größeren Ausmaßes für FH-Experten nach Dir !
s1210629013@55466
    50
%Damit Deine Arbeit Isac weiterhin lauffähig erhält, ist diese Aufgabe zu
s1210629013@55466
    51
%lösen:
s1210629013@55466
    52
%************ einen Thread nur dann auf den stdout nur schreiben lassen,
s1210629013@55466
    53
%                       wenn kein anderer Thread gerade schreibt    
s1210629013@55466
    54
%*********************
s1210629013@55466
    55
%Da kann ich mir im Prinzip eine Reihe von Möglichkeiten vorstellen und wir
s1210629013@55466
    56
%sollten sorgfältig beraten, welche der Möglichkeiten für Dich am
s1210629013@55466
    57
%einfachsten ist und auch möglichst kompatibel mit dem nächsten
s1210629013@55466
    58
%Entwicklungsschritt.