doc-src/isac/CTP-userinterfaces.tex
branchdecompose-isar
changeset 38105 89510a21f9c4
parent 38104 67b6ead8d8b4
child 38106 90c4c3bb47d9
equal deleted inserted replaced
38104:67b6ead8d8b4 38105:89510a21f9c4
    48 %specifically designed a 'meta language' (ML)
    48 %specifically designed a 'meta language' (ML)
    49 %http://en.wikipedia.org/wiki/ML\_(programming\_language)
    49 %http://en.wikipedia.org/wiki/ML\_(programming\_language)
    50 %\cite{pl:milner97}
    50 %\cite{pl:milner97}
    51 %for developing CTP
    51 %for developing CTP
    52 \subsubsection{Standard ML}
    52 \subsubsection{Standard ML}
    53 Standard ML is a general-purpose, modular, functional programming language. 
    53 Standard ML is a general-purpose, modular, functional programming language. \cite{pl:milner97}
    54 Programs written in Standard ML consist of expressions to be evaluated, as opposed to statements or commands. 
    54 Programs written in Standard ML consist of expressions to be evaluated, as opposed to statements or commands. 
    55 Function programming languages constitude a ???? very differnt of object orientated languages, see Sect.\ref{ctp-techn}. ML originated from the LCF-project(Logic for Computable Functions), 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 $\lamda$-calclism.
    55 Functional programming languages constitude a ???? very differnt 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.
    56 %http://en.wikipedia.org/wiki/Standard_M 
    56 %http://en.wikipedia.org/wiki/Standard_M 
    57 \subsubsection{Coq}
    57 \subsubsection{Coq}
    58 Coq is an interactive theorem prover, developed in France.
    58 Coq is an interactive theorem prover, developed in France.
    59 It is programmed in Objective Caml, an ML based programming language.
    59 It is programmed in Objective Caml, an ML based programming language.
    60 It has the ability to express  mathematical  assertions and check proof of mathematical assertions. 
    60 It has the ability to express  mathematical  assertions and check proof of mathematical assertions. 
    61 Furthermore Coq includes automatic theorem proving tactics and decision procedures.
    61 Furthermore Coq includes automatic theorem proving tactics and decision procedures.
    62 Properties, programs and proofs are written a functional programming language called the Calculus of Inductive Constructions (CIC) \cite{todo}, .
    62 Properties, programs and proofs are written a functional programming language called the Calculus of Inductive Constructions (CIC).
    63 Proof development in Coq is done through a language of tactics that allows a user-guided proof process.
    63 Proof development in Coq is done through a language of tactics that allows a user-guided proof process.\cite{coq1999}
    64   
    64   
    65 Another feature of Coq is “that it can automatically extract executable programs from specifications, as either Objective Caml 
    65 Another feature of Coq is “that it can automatically extract executable programs from specifications, as either Objective Caml 
    66 or Haskell source code.“
    66 or Haskell source code.“
    67 
    67 
    68 There are many easy-to-read introductions to Coq \footnote{http://coq.inria.fr/a-short-introduction-to-coq} on the internet.
    68 There are many easy-to-read introductions to Coq \footnote{http://coq.inria.fr/a-short-introduction-to-coq} on the internet.
    69 
       
    70 \subsubsection{Isabelle}
    69 \subsubsection{Isabelle}
    71 Isabelle is an interactive theorem proving framework for high-level natural deduction proofs \cite{Paulson:Isa94}, written in Standard ML. 
    70 Isabelle is an interactive theorem proving framework for high-level natural deduction proofs \cite{Paulson:Isa94}, written in Standard ML. 
    72 Isabelle is developed at University of Cambridge (Larry Paulson), Technische Universit\"at M\"unchen
    71 Isabelle is developed at University of Cambridge (Larry Paulson), Technische Universit\"at M\"unchen
    73 and Université Paris-Sud.
    72 and Université Paris-Sud. Isabelle is called a framework, because it implements serveral object logics.
    74 The most widespread instance of Isabelle nowadays is Isabelle/HOL, providing a higher-order logic theorem proving environment.
    73 The most widespread logic of Isabelle is Isabelle/HOL, short for higher-order logic.
    75 Isabelle/HOL includes several  specification tools, e.g. for datatypes, inductive definitions and functions with complex pattern matching.
    74 Isabelle/HOL includes several  specification tools, e.g. for datatypes, inductive definitions and functions with complex pattern matching.
    76 Proofs are written in the structured proof language Isar. Isabelle implements several tools to increase the user's productivity in theorem proving. 
    75 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(Slegehammer), increase the user's productivity in theorem proving. 
    77 Isabelle's classical reasoner is used to check formulas. The simplifier can reason with and about equations. 
       
    78 Linear arithmetic facts are proved automatically.
       
    79 Isabelle provides notational support: new notations can be introduced, using normal mathematical symbols.
    76 Isabelle provides notational support: new notations can be introduced, using normal mathematical symbols.
    80 Definitions and proofs may include LaTeX source, from which Isabelle can automatically generate typeset documents.
    77 Definitions and proofs may include LaTeX source, from which Isabelle can automatically generate typeset documents.
    81 Isabelle/HOL allows to turn executable specifications directly into code in SML, OCaml, and Haskell.
    78 Isabelle/HOL allows to turn executable specifications directly into code in SML, OCaml, and Haskell.\cite{Haftmann-Nipkow:2010:code}
    82 (http://www.cl.cam.ac.uk/research/hvg/Isabelle/overview.html)
    79 (http://www.cl.cam.ac.uk/research/hvg/Isabelle/overview.html)
    83 \subsection{Userinterfaces for CTP: Coq and Isabelle}\label{gui-coq-isa}
    80 \subsection{Userinterfaces for CTP: Coq and Isabelle}\label{gui-coq-isa}
    84 %     CoqIDE, ..
    81 %     CoqIDE, ..
    85 %         http://coq.inria.fr/what-is-coq?q=node/57\\
    82 %         http://coq.inria.fr/what-is-coq?q=node/57\\
    86 %         earlier than Isabelle/jEdit
    83 %         earlier than Isabelle/jEdit
   134 \subsubsection{Isabelle/Jedit}
   131 \subsubsection{Isabelle/Jedit}
   135 jEdit is a text editor for programmers, written in Java.
   132 jEdit is a text editor for programmers, written in Java.
   136 Compared to fully-featured IDEs, such as Eclipse or Netbeans, jEdit is much 
   133 Compared to fully-featured IDEs, such as Eclipse or Netbeans, jEdit is much 
   137 smaller and better focused on its primary task of text editing.
   134 smaller and better focused on its primary task of text editing.
   138 The general look of the Isabelle/jEdit plugin is similar to existing Java IDEs.
   135 The general look of the Isabelle/jEdit plugin is similar to existing Java IDEs.
   139 The main Isabelle/jEdit plugin consists of ≈ 10 small Scala files  that augment some key jEdit components in order to provide a metaphor of asynchronous 
   136 The main Isabelle/jEdit plugin consists of ten small Scala files  that augment some key jEdit components in order to provide a metaphor of asynchronous 
   140 proof document editing. 
   137 proof document editing. 
   141 Isabelle/jEdit integrates the jEdit 4.3.2 framework  and some further  jEdit plugins. 
   138 Isabelle/jEdit integrates the jEdit 4.3.2 framework  and some further  jEdit plugins. 
   142 It also implements custom-made IsabelleText Unicode font that actually contains the usual Isabelle symbols that users expect from long 
   139 It also implements custom-made IsabelleText Unicode font that actually contains the usual Isabelle symbols that users expect from long 
   143 years of Proof General X-Symbol support. 
   140 years of Proof General X-Symbol support. 
   144 The editor provides useful feedback, via semantic information from the processed document in the background. 
   141 The editor provides useful feedback, via semantic information from the processed document in the background. 
   274 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 operations are receive and react. An actor can suspend with a full thread stack (receive) or it can suspend with just a continuation closure (react) [2.P]. 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.
   271 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 operations are receive and react. An actor can suspend with a full thread stack (receive) or it can suspend with just a continuation closure (react) [2.P]. 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.
   275 
   272 
   276 receive:         def receive[R](f: PartialFunction[Any, R]): R
   273 receive:         def receive[R](f: PartialFunction[Any, R]): R
   277 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. 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 behavior is therefore a sequential program which corresponds to thread-based programming [2.P]. \\
   274 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. 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 behavior is therefore a sequential program which corresponds to thread-based programming [2.P]. \\
   278 react:          
   275 react:          
   279 $$\mathit{def}\;\mathit{react}(f: \mathit{PartialFunction}[Any, Unit]): \mathit{Nothing$$
   276 $$\mathit{def}\;\mathit{react}(f: \mathit{PartialFunction}[Any, Unit]): \mathit{Nothing}$$
   280 The action which is specified in the partial function is the last code that the current actor executes, if the message is matching. 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 [2.P]. \\
   277 The action which is specified in the partial function is the last code that the current actor executes, if the message is matching. 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 [2.P]. \\
   281 For this implementation multiple acotrs 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. \\
   278 For this implementation multiple acotrs 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. \\
   282 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.\\
   279 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.\\
   283 Event-Based Programming without Inversion of Control - Philipp Haller, Martin Odersky  [IoC]\\
   280 Event-Based Programming without Inversion of Control - Philipp Haller, Martin Odersky  [IoC]\\
   284 Scala actors: Unifying thread-based and event-based programming - Philipp Haller, Martin Odersky [2.P]\\
   281 Scala actors: Unifying thread-based and event-based programming - Philipp Haller, Martin Odersky [2.P]\\
   311 This plan involves the following details.
   308 This plan involves the following details.
   312 
   309 
   313 \subsection{Add a plug-in to jEdit}\label{plugin}
   310 \subsection{Add a plug-in to jEdit}\label{plugin}
   314     % file structure, copied from example project ...
   311     % file structure, copied from example project ...
   315 %Die von jEdit verfolgte Strategie im Bezug auf Plugin-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. Plugins lassen sich sehr einfach anfügen und durch die riesige Vielfalt von bereits bestehenden Plugins ist auch die Adaption von Plugins möglich bzw. zu empfehlen, denn warum sollte nicht bereits funktionierender Code verwendet werden?\\
   312 %Die von jEdit verfolgte Strategie im Bezug auf Plugin-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. Plugins lassen sich sehr einfach anfügen und durch die riesige Vielfalt von bereits bestehenden Plugins ist auch die Adaption von Plugins möglich bzw. zu empfehlen, denn warum sollte nicht bereits funktionierender Code verwendet werden?\\
   316 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 Plugin. There are a lot of useful and powerful Plugins available in the net and it is also possible to use a existing Plugin 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.
   313 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 Plugin. There are a lot of useful and powerful Plugins available in the net and it is also possible to use a existing Plugin as part of a new one. Because of this facts, jEdit is very suitable for a project like Isabelle and also for the Isac-project at TU-Graz. \\\\
   317 
   314 Each jEdit-Plugin 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 Plugin and provides information like the name, author, ... of the Plugin. 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 Plugin routines located in the source files. As you see, this files are used as interface between the Plugin and the jEdit engine itself.\\
   318 Each jEdit-Plugin\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 Plugin and provides information like the name, author, ... of the Plugin. 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 Plugin routines located in the source files. As you see, this files are used as interface between the Plugin and the jEdit engine itself.
       
   319 
       
   320 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.    
   315 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.    
   321 
   316 To get more information about the jEdit infrastructure see: http://jedit.org/users-guide/plugin-intro
   322 
   317 \\\\
   323 %isabell plugin beschreiben!!!!!!!!
   318 %isabell plugin beschreiben!!!!!!!!
   324 The Isabelle-team also follow use this Plugin-structure. In the next paragraph the involved files will be described. The jEdit-Isabelle-Plugin consists of:
   319 The Isabelle-team also follow use this Plugin-structure. In the next paragraph the involved files will be described. The jEdit-Isabelle-Plugin consists of:
   325 \begin{itemize}
   320 \begin{itemize}
       
   321 \item 14 Scala-source-files
       
   322 \item three XML-files
   326 \item one property file
   323 \item one property file
   327 \item three XML-files
       
   328 \item 14 Scala-source-files
       
   329 \end{itemize}
   324 \end{itemize}
   330 %Das vom Isabelle-Team erstellte jEdit-Plugin folgt natürlich auch dem oben erklärten Muster. Es wird nun genauer auf dieses Plugin eingegangen. The plugin consits of 14 scala-source-files, three xml-files and one property-file. 
   325 %Das vom Isabelle-Team erstellte jEdit-Plugin folgt natürlich auch dem oben erklärten Muster. Es wird nun genauer auf dieses Plugin eingegangen. The plugin consits of 14 scala-source-files, three xml-files and one property-file. 
   331 \begin{description}
   326 The property-file \textit{Isabelle.props} contains general informations about the Isabelle-Plugin and the needed dependencies between Isabelle and the other used Plugins like sidekick. \\
   332 \item[Isabelle.props] The property-file \textit{Isabelle.props} contains general informations about the Isabelle-Plugin and the needed dependencies between Isabelle and the other used Plugins like sidekick.
   327 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 Plugin.\\
   333 \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 Plugin.
   328 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.\\
   334 \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.
   329 The last XML-file is \textit{services.xml} and is used to create instances of needed jEdit-Plugins.\\
   335 \item[services.xml] The last XML-file is \textit{services.xml} and is used to create instances of needed jEdit-Plugins.
   330 This four files are located in the folder \textit{plugin}.\\\\
   336 \end{description}
   331 The more interesting files, the scala-files of the Plugin, 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: \\
   337 This four files are located in the folder \textit{plugin}.\\
   332 The file \textit{plugin.scala} is the main-file of the Isabelle-Plugin 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-Plugin should have this methods because they are very important for the handling of the Plugin! \\
   338 
   333 jEdit and also the Isabelle Plugin 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 individualize 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}.\\
   339 The more interesting files, the scala-files of the Plugin, 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: 
   334 The next interesting file is \textit{scala-console.scala} with the main-class Scala-Console. This class is used to expand the Console-Plugin in a way, that it is possible to interpret Scala-code with a Shell inside of jEdit.\\ 
   340 \begin{description}
   335 The file \textit{isabelle-sidekick.scala} is related to the file \textit{scala-console.scala} because it is also used to adapt the Plugin Sidekick for Isabelle.\\
   341 \item[plugin.scala] The file \textit{plugin.scala} is the main-file of the Isabelle-Plugin 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-Plugin should have this methods because they are very important for the handling of the Plugin!
   336 The files \textit{document-model.scala} and \textit{document-view.scala1} are used to connect the jEdit-buffer/the text-area to Isabelle. Both classes offer, upon others, methods to activate and deactivate this features.\\
   342 \item[dockable.scala] jEdit and also the Isabelle Plugin 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 individualize 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}.
   337 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-Plugin should be set up and the remaining files are not as important for the Isabelle-Plugin-structure:
   343 \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-Plugin in a way, that it is possible to interpret Scala-code with a Shell inside of jEdit.
   338 \begin{itemize}
   344 \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 Plugin Sidekick for Isabelle.
   339 \item $html_panel.scala$
   345 \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.
   340 \item $isabelle_encoding.scala$
   346 \end{description}
   341 \item $isabelle_hyperlinks.scala$
   347 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-Plugin should be set up and the remaining files are not as important for the Isabelle-Plugin-structure.
   342 \item $isabelle_options.scala$
   348 %\begin{itemize}
   343 \item $isabelle_token_maker.scala$
   349 %\item $html_panel.scala$
   344 \item $isabelle_hyperlinks.scala$
   350 %\item $isabelle_encoding.scala$
   345 \end{itemize}
   351 %\item $isabelle_hyperlinks.scala$
       
   352 %\item $isabelle_options.scala$
       
   353 %\item $isabelle_token_maker.scala$
       
   354 %\item $isabelle_hyperlinks.scala$
       
   355 %\end{itemize}
       
   356 
   346 
   357 
   347 
   358 %  Like each other jEdit-Plugin also this 
   348 %  Like each other jEdit-Plugin also this 
   359 
   349 
   360 %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.\\
   350 %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.\\
   361 
   351 
   362 \subsection{Details of NetBeans projects}\label{netbeans}
   352 \subsection{Details of NetBeans projects}\label{netbeans}
   363 %     Scala + Java: html project files
   353 %     Scala + Java: html project files
   364 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.\footnote{See http://wiki.netbeans.org/NetbeansedJEdit for further information.} 
   354 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.\\\\
   365 
       
   366 If you want to set up a new jEdit-Plugin-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")}\\
   355 If you want to set up a new jEdit-Plugin-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")}\\
   367 As shown above, the jEdit-source is needed to compile and build your Plugin. There are two ways to organize your project:
   356 As shown above, the jEdit-source is needed to compile and build your Plugin. There are two ways to organize your project:
   368 %\begin{itemize}
   357 \begin{itemize}
   369 %\item with jEdit source code - two projects in one
   358 \item with jEdit source code - two projects in one
   370 %\item with jedit.jar library
   359 \item with jedit.jar library
   371 %\end{itemize}
   360 \end{itemize}
   372 \subsubsection{Plugin with jEdit-source}
   361 \subsubsection{Plugin with jEdit-source}
   373 It is a good way to download the jEdit source as Netbeans project because then it is possible to add another subproject 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.
   362 It is a good way to download the jEdit source as Netbeans project because then it is possible to add another subproject 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.
   374 \begin{enumerate}
   363 \begin{enumerate}
   375 \item {Create a new NetBeans-project for your Plugin like \textit{example-plugin}. This will probably be a Scala-Project.}
   364 \item {Create a new NetBeans-project for your Plugin like \textit{example-plugin}. This will probably be a Scala-Project.}
   376 \item Download (and try out) the \textit{jEdit-NetBeans-project}
   365 \item Download (and try out) the \textit{jEdit-NetBeans-project}
   396 \item $	\langle copy $file="plugin/Isabelle.props" todir="\${build.classes.dir}" $/\rangle$
   385 \item $	\langle copy $file="plugin/Isabelle.props" todir="\${build.classes.dir}" $/\rangle$
   397 \item $	\langle /target\rangle$
   386 \item $	\langle /target\rangle$
   398 \end{itemize}
   387 \end{itemize}
   399 %* kurze aufzählung der xml-netbeans-files + erklärung\\
   388 %* kurze aufzählung der xml-netbeans-files + erklärung\\
   400 \subsubsection{NetBeans project files}
   389 \subsubsection{NetBeans project files}
   401 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 informations 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!).
   390 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 informations 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!).\\
   402 
   391 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.\\
   403 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.
       
   404 
       
   405 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.
   392 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.
   406 
   393 
   407 \subsection{Use interfaces between Java and Scala}\label{java-scala}
   394 \subsection{Use interfaces between Java and Scala}\label{java-scala}
   408 %     how are data exchanged between Scala and Java ...
   395 %     how are data exchanged between Scala and Java ...
   409 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.
   396 jEdit is completely written in Java and the required plugin(s) for Isac 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.\\
   410 
   397 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.\\
   411 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.
   398 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} to work with a Java-button. But you can also use the Scala-equivalent \textit{scala.swing.Button}. 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.\\
   412 
       
   413 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.
       
   414 
       
   415 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.
       
   416 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:
   399 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:
   417 \begin{enumerate}
   400 \begin{enumerate}
   418 \item \textit{import javax.swing.JButton}
   401 \item \textit{import javax.swing.JButton}
   419 \item \textit{import scala.swing.Button}
   402 \item \textit{import scala.swing.Button}
   420 \item \textit{var b: scala.swing.Button}
   403 \item \textit{var b: scala.swing.Button}
   421 \item \textit{var jb: javax.swing.JButton}
   404 \item \textit{var jb: javax.swing.JButton}
   422 \item \textit{jb = b.peer}
   405 \item \textit{jb = b.peer}
   423 \end{enumerate}
   406 \end{enumerate}
   424 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 Plugin written in Scala and one coded in Java. With this connection between Scala and Java, it would be easy to connect this two Plugins! 
   407 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 Plugin written in Scala and one coded in Java. With this connection between Scala and Java, it would be easy to connect this two Plugins! 
   425 %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. ...
   408 %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. ...
       
   409 http://www.scala-lang.org/api/current/scala/swing/Button.html\\
       
   410 http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/JButton.html
       
   411 
   426 \section{Conclusion and future work}
   412 \section{Conclusion and future work}
   427 
   413 
   428 
   414 
   429 \bibliography{CTP-userinterfaces}
   415 \bibliography{CTP-userinterfaces}
   430 %\bibliography{bib/math-eng,bib/bk,bib/RISC_2,bib/isac,bib/pl,bib/math,bib/pl}
   416 %\bibliography{bib/math-eng,bib/bk,bib/RISC_2,bib/isac,bib/pl,bib/math,bib/pl}