CTP-gui:bib decompose-isar
authorAndreas Schulhofer <andreas.schulhofer@student.tugraz.at>
Tue, 11 Jan 2011 13:34:30 +0100
branchdecompose-isar
changeset 38102e8ec0f7c6bdb
parent 38101 09b428a6b09d
child 38108 a0905773dfd7
CTP-gui:bib
doc-src/isac/CTP-userinterfaces.bib
doc-src/isac/CTP-userinterfaces.tex
     1.1 --- a/doc-src/isac/CTP-userinterfaces.bib	Tue Jan 11 12:34:53 2011 +0100
     1.2 +++ b/doc-src/isac/CTP-userinterfaces.bib	Tue Jan 11 13:34:30 2011 +0100
     1.3 @@ -1,8 +1,16 @@
     1.4 -@TechReport{,
     1.5 +@Book{,
     1.6 +  author = 	 {Armstrong, Joe, et.al.},
     1.7 +  title = 	 {Concurrent Programming in Erlang},
     1.8 +  publisher = {Prentice Hall},
     1.9 +  year = 	 {1996}
    1.10 +}
    1.11 +
    1.12 +
    1.13 +@TechReport{odersky:scala06,
    1.14    author = 	 {Odersky, Martin, et.al.},
    1.15    title = 	 {An Overview of the Scala Programming Language},
    1.16    institution =  {\'Ecole Polytechnique F\'ed\'erale de Lausanne (EPFL)},
    1.17 -  year = 	 {},
    1.18 +  year = 	 {2006},
    1.19    type = 	 {Technical Report LAMP-REPORT-2006-001},
    1.20    address = 	 {1015 Lausanne, Switzerland},
    1.21    note = 	 {Second Edition},
     2.1 --- a/doc-src/isac/CTP-userinterfaces.tex	Tue Jan 11 12:34:53 2011 +0100
     2.2 +++ b/doc-src/isac/CTP-userinterfaces.tex	Tue Jan 11 13:34:30 2011 +0100
     2.3 @@ -180,16 +180,7 @@
     2.4  
     2.5  %Andreas
     2.6  \section{Isabelle's plans for new user-interfaces}\label{gui-plans}
     2.7 -%       http://www4.in.tum.de/~wenzelm/papers/async-isabelle-scala.pdf,\\
     2.8 -%       http://www4.in.tum.de/~wenzelm/papers/parallel-isabelle.pdf
     2.9 -%
    2.10 -%theorem proving will be integrated into software development
    2.11 -%
    2.12 -%hundreds of proof obligations are generated during a software verification process 
    2.13 -%
    2.14 -%so the final goald of Isabelle's planning is integration with other software development tools in an integrated development environment (IDE).
    2.15 -%
    2.16 -%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.
    2.17 +
    2.18  The following observations lead to novel requirements for CTPS' userinterface:
    2.19  
    2.20  \begin{itemize}
    2.21 @@ -205,9 +196,6 @@
    2.22  \subsection{Connect ML-world to the users' world via JVM}\label{ml-users}
    2.23  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 user interfaces, 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.
    2.24  
    2.25 -
    2.26 -
    2.27 -
    2.28  \paragraph{Example: a functional mathematics engine} as the experimental one in the \sisac-project is given by the following signature:
    2.29  {\it
    2.30  \begin{tabbing}
    2.31 @@ -220,10 +208,6 @@
    2.32  \>\>val do\_next : program $\rightarrow$ calcstate $\rightarrow$ (calcstate * step)\\
    2.33  \>\>val apply\_tactic : program $\rightarrow$ calcstate $\rightarrow$ position $\rightarrow$ tactic $\rightarrow$ (calcstate * step list)\\
    2.34  \>\>val apply\_formula : program $\rightarrow$ calcstate $\rightarrow$ position $\rightarrow$ formula $\rightarrow$ (calcstate * step list)\\
    2.35 -%\\
    2.36 -%\>\>val get\_next : program $\rightarrow$ calcstate $\rightarrow$ step\\
    2.37 -%\>\>val get\_applicable\_tactics : program $\rightarrow$ calcstate $\rightarrow$ tactic list\\
    2.38 -%\>\>val get\_intermediate : program $\rightarrow$ calcstate $\rightarrow$ position * position $\rightarrow$ step list\\
    2.39  \>end
    2.40  \end{tabbing}}
    2.41  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.
    2.42 @@ -246,16 +230,16 @@
    2.43       public List<Step> apply_tactic(Tactic tactic) {...}
    2.44       public List<Step> apply_formular(Formular formular) {...}
    2.45     }
    2.46 -\end{verbatim}
    2.47 +\end{verbatim} 
    2.48  
    2.49  \subsection{Scala as a mediator between ML and JVM}\label{scala-medi}
    2.50 -Scala\cite{TODO} 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.
    2.51 +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}.
    2.52  
    2.53 -Scala is pure object-oriented, this means every value is an object. 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 behaviors of objects are described by classes and traits\cite{[wiki]}. 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.
    2.54 +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 behaviors 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.
    2.55  
    2.56 -In Scala every function is a value, hence Scala is also a functional language. 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\cite{[wiki-11-1s]}. Furthermore Scala supports higher-order functions, currying and allows functions to be nested.
    2.57 +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.
    2.58  
    2.59 -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{TODO}:
    2.60 +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)}:
    2.61  
    2.62  \begin{itemize}
    2.63  \item generic classes
    2.64 @@ -270,57 +254,44 @@
    2.65  
    2.66  Static types need no explicit declaration but can be given to give the code some clarity.
    2.67  
    2.68 -Scala supports threads, but the Scala library contains an actor model\cite{TODO} inspired from Erlang\cite{TODO}. Concurrency and Scala actors follow in the next section.
    2.69 -
    2.70 -%quellen
    2.71 -%%http://de.wikipedia.org/wiki/Scala_%28Programmiersprache%29
    2.72 -%%http://en.wikipedia.org/wiki/Scala_%28programming_language%29
    2.73 -%%http://creativekarma.com/ee.php/weblog/comments/why_scala_instead_of_java/
    2.74 -%%http://www.scalasolutions.com/scala
    2.75 -
    2.76 +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.
    2.77  
    2.78  \subsection{Support for parallel processing}\label{actors}
    2.79  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.
    2.80  
    2.81 -%Most of the message passing systems, which are used in practice, are based on the actor model.
    2.82 -
    2.83  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 behavior, an actor is able to reply to a message. The actor-based process is combined with pattern matching for messages.
    2.84  
    2.85 -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{[IoC]}. These systems use a very popular lightweight implementation and a large number of concurrent processes, which can be active simultaneously.
    2.86 +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.
    2.87  
    2.88  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.
    2.89 -The most disadvantageous consequences are:
    2.90 +The most disadvantageous consequences are \cite{scala:jmlc06}:
    2.91  \begin{enumerate}
    2.92  \item quick exhaustion of virtual address space
    2.93  \item locking mechanisms often lack suitable contention managers
    2.94  \end{enumerate}
    2.95 -\cite{[IoC]}\\
    2.96 -For that reasons Erlang uses lightweight concurrent processes by its own run time system and not by the underlying operating system \cite{[IoC]} and the computations on these platforms are often modeled in an event-driven style, which is complicated and error-prone.
    2.97 +
    2.98 +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 modeled in an event-driven style, which is complicated and error-prone.
    2.99  \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.
   2.100  
   2.101 -\subparagraph{Thread-based implementation:} The behavior of a concurrent process is defined by implementing a thread-specific method. The execution state is maintained by an associated thread stack \cite{[2.P]}.
   2.102 +\subparagraph{Thread-based implementation:} The behavior 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}.
   2.103  Supports blocking operations and can be executed on multicore processors in parallel.
   2.104  
   2.105 -\subparagraph{Event-based implementation:} The behavior 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{[2.P]}. Targets to a large number of actor which can be active simultaneously, because they are more lightweight.
   2.106 +\subparagraph{Event-based implementation:} The behavior 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.
   2.107  
   2.108  \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.
   2.109  
   2.110 -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{[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.
   2.111 +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.
   2.112  
   2.113 -\subparagraph{receive:}
   2.114 +\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:
   2.115  $$\mathit{def}\;\mathit{receive}\mathit{[R]}(f: \mathit{PartialFunction}[Any, R]): \mathit{R}$$
   2.116 -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 \cite{[2.P]}.
   2.117 -\subparagraph{react:}
   2.118 +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 \cite{Haller:2009:SAU:1496391.1496422}.
   2.119 +\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:
   2.120  $$\mathit{def}\;\mathit{react}(f: \mathit{PartialFunction}[Any, Unit]): \mathit{Nothing}$$
   2.121 -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 \cite{[2.P]}. 
   2.122 +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}. 
   2.123  
   2.124  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.
   2.125  
   2.126 -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.
   2.127 -
   2.128 -%Event-Based Programming without Inversion of Control - Philipp Haller, Martin Odersky  [IoC]
   2.129 -%Scala actors: Unifying thread-based and event-based programming - Philipp Haller, Martin Odersky [2.P]
   2.130 -
   2.131 +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}.
   2.132  
   2.133  % Marco
   2.134  \section{Planned contributions at TU Graz}