52 research outputs found
Ten virtues of structured graphs
This paper extends the invited talk by the first author about the virtues
of structured graphs. The motivation behind the talk and this paper relies on our
experience on the development of ADR, a formal approach for the design of styleconformant,
reconfigurable software systems. ADR is based on hierarchical graphs
with interfaces and it has been conceived in the attempt of reconciling software architectures
and process calculi by means of graphical methods. We have tried to
write an ADR agnostic paper where we raise some drawbacks of flat, unstructured
graphs for the design and analysis of software systems and we argue that hierarchical,
structured graphs can alleviate such drawbacks
Constructing Mobile Agents using Transformations
Although mobile agents are widely accepted as a useful and elegant way to develop software for distributed systems, they are not widely-used. One of the main reasons for this is the lack of provable and manageable protection of an agent platform. We present a working prototype of a mobile agent programming and execution environment based on term graph transformation and the strongly typed functional programming language Haskell. The well-understood type system of Haskell can be used to guarantee that a mobile agent cannot do arbitrary I/O on an agent platform. Therefore the mobile agent migrates as Haskell source code and is type-checked on each platform. The services a platform offers to a mobile agent are encapsulated in so-called possibly-provided functions (PPFs). A PPF is a function that returns a value of type Maybe a for arbitrary a. A PPF need not be available on all platforms. If it is not available, it will be temporarily replaced with a function returning the value Nothing of type Maybe a by a preprocessor on the agent platform. In order to be able to replace a PPF, the Haskell code is encapsulated in a list of code fragments. A strongly typed mobile agent which consists of one complex function with a complex parameter which has to be encapsulated in a list of code fragments is a very awkward piece of software. The complex parameter is the data part of the mobile agent and is called its suitcase. Conventional programming using a normal text editor is not feasible. Therefore we use the Higher Object Programming System HOPS, a graphically interactive program development and transformation system based on term graphs, for developing a mobile agent. When using HOPS we have the ability to define an easy-to-use domain-specific language for mobile agents and to derive the necessary shape of the mobile agent code using term graph transformation. Not only the encapsulation into the code fragment data type can be automated, but also the complex suitcase can be generated automatically from small manageable pieces. With this thesis we demonstrate that the combination of a strongly typed functional language and a development process which is aided by term graph transformation together with our concept of PPFs is a very well suited approach towards a fully-fledged mobile agent system.Obwohl mobile Agenten weitestgehend akzeptiert wurden als nĂźtzliche und elegante Art Software fĂźr verteilte Systeme zu entwicklen, werden sie kaum eingesetzt. Einer der HauptgrĂźnde dafĂźr ist das Fehlen eines beweisbaren und beherrschbaren Schutzmechanismus fĂźr eine Agentenplattform. Wir präsentieren mit dieser Arbeit einen funktionstĂźchtigen Prototyp einer Programmier- und AusfĂźhrungsumgebung fĂźr mobile Agenten basierend auf Termgraph Transformation und der rein funktionalen Programmiersprache Haskell. Das Typsystem von Haskell kann garantieren, dass ein mobiler Agent keine beliebigen E/A Aktionen auf einer Agentenplattform ausfĂźhren kann. Um es zu nutzen migriert der mobile Agent asl Haskell Quellcode und der Typ wird auf jeder Agentenplattform ĂźberprĂźft. Die Dienste die eine Agentenplattform den mobilen Agenten zur VerfĂźgung stellt, sind in sogennannte possibly-provided functions (PPFs) gekapselt. Eine PPF ist eine Funktion die einen Wert vom Typ Maybe a fĂźr ein beliebiges a zurĂźckliefert. Eine PPF muĂ nicht auf jeder Plattform vorhanden sein. Wenn die PPF nicht vorhanden ist, wird sie temporär von einem Präprozessor durch eine Funktion die den Wert Nothing liefert ersetzt. Um eine solche Ersetzung mĂśglich zu machen, wurde der Haskell code in eine Liste sogenannter Code Fragmente eingebettet. Ein streng typisierter mobiler Agent der aus einer komplexen Funktion mit einem komplexen Parameter besteht, die in eine Liste von Code Fragmenten eingebettet werden muĂ, ist ein schwierig zu handhabendes StĂźck Software. Der komplexe Parameter ist der Datenteil des mobilen Agenten und wird Suitcase genannt. HerkĂśmmliche Programmierung mit einem gewĂśhnlichen Texteditor ist nicht praktikabel. Aus diesem Grunde nutzen wir das Higher Object Programming System HOPS, ein graphisches, interaktives Programmentwicklungs- und -transformationssystem basierend auf Termgraphen, fĂźr die Entwicklung eines mobilen Agenten. Durch die Verwendung von HOPS ist es mĂśglich eine einfach zu nutzende Domain-Specific Language fĂźr mobile Agenten zu definieren und mittels Termgraph Transformation die benĂśtigte Form daraus herzuleiten. Neben der Einbettung des mobile Agenten in die Liste der Code Fragmente kann der komplexe Suitcase aus kleinen, Ăźberschaubaren Teilen generiert werden. Mit dieser Arbeit haben wir gezeigt, dass die Kombination einer streng typisierten, funktionalen Programmiersprache und einem Softwareentwicklungsprozess der durch Termgraph Transformation unterstĂźtzt wird, zusammen mit unserem Konzept der PPFs, ein sehr gut geeigneter Ansatz in Richtung eines vollwertigen System fĂźr mobile Agenten ist
Generic Strategies for Chemical Space Exploration
Computational approaches to exploring "chemical universes", i.e., very large
sets, potentially infinite sets of compounds that can be constructed by a
prescribed collection of reaction mechanisms, in practice suffer from a
combinatorial explosion. It quickly becomes impossible to test, for all pairs
of compounds in a rapidly growing network, whether they can react with each
other. More sophisticated and efficient strategies are therefore required to
construct very large chemical reaction networks.
Undirected labeled graphs and graph rewriting are natural models of chemical
compounds and chemical reactions. Borrowing the idea of partial evaluation from
functional programming, we introduce partial applications of rewrite rules.
Binding substrate to rules increases the number of rules but drastically prunes
the substrate sets to which it might match, resulting in dramatically reduced
resource requirements. At the same time, exploration strategies can be guided,
e.g. based on restrictions on the product molecules to avoid the explicit
enumeration of very unlikely compounds. To this end we introduce here a generic
framework for the specification of exploration strategies in graph-rewriting
systems. Using key examples of complex chemical networks from sugar chemistry
and the realm of metabolic networks we demonstrate the feasibility of a
high-level strategy framework.
The ideas presented here can not only be used for a strategy-based chemical
space exploration that has close correspondence of experimental results, but
are much more general. In particular, the framework can be used to emulate
higher-level transformation models such as illustrated in a small puzzle game
Termination of Graph Transformation Systems Using Weighted Subgraph Counting
We introduce a termination method for the algebraic graph transformation
framework PBPO+, in which we weigh objects by summing a class of weighted
morphisms targeting them. The method is well-defined in rm-adhesive
quasitoposes (which include toposes and therefore many graph categories of
interest), and is applicable to non-linear rules. The method is also defined
for other frameworks, including SqPO and left-linear DPO, because we have
previously shown that they are naturally encodable into PBPO+ in the quasitopos
setting. We have implemented our method, and the implementation includes a REPL
that can be used for guiding relative termination proofs.Comment: 36 pages. Preprint submitted to LMCS. Extends the conference version
published at the 16th International Conference on Graph Transformation (ICGT
2023
Achieving High-Performance the Functional Way: A Functional Pearl on Expressing High-Performance Optimizations as Rewrite Strategies
Optimizing programs to run efficiently on modern parallel hardware is hard but crucial for many applications. The predominantly used imperative languages - like C or OpenCL - force the programmer to intertwine the code describing functionality and optimizations. This results in a portability nightmare that is particularly problematic given the accelerating trend towards specialized hardware devices to further increase efficiency.
Many emerging DSLs used in performance demanding domains such as deep learning or high-performance image processing attempt to simplify or even fully automate the optimization process. Using a high-level - often functional - language, programmers focus on describing functionality in a declarative way. In some systems such as Halide or TVM, a separate schedule specifies how the program should be optimized. Unfortunately, these schedules are not written in well-defined programming languages. Instead, they are implemented as a set of ad-hoc predefined APIs that the compiler writers have exposed.
In this functional pearl, we show how to employ functional programming techniques to solve this challenge with elegance. We present two functional languages that work together - each addressing a separate concern. RISE is a functional language for expressing computations using well known functional data-parallel patterns. ELEVATE is a functional language for describing optimization strategies. A high-level RISE program is transformed into a low-level form using optimization strategies written in ELEVATE . From the rewritten low-level program high-performance parallel code is automatically generated. In contrast to existing high-performance domain-specific systems with scheduling APIs, in our approach programmers are not restricted to a set of built-in operations and optimizations but freely define their own computational patterns in RISE and optimization strategies in ELEVATE in a composable and reusable way. We show how our holistic functional approach achieves competitive performance with the state-of-the-art imperative systems Halide and TVM
Design and implementation of a low-level language for interaction nets
Interaction nets are a graphical model of computation based on a restricted form of graph rewriting. A specific net can represent a program with a user-defined set of nodes and computation is modelled by a user-defined set of rewrite rules. This very simple model has had great success in modelling sharing in computation (specifically in the lambda calculus), and there is potential for generating a new theoretical foundation of parallel computation since all computation steps are local and thus can be implemented in parallel.
This thesis is about the implementation of interaction nets. Specifically, for the first contributions we define a low-level language as an object language for the compilation of interaction nets. We study the efficiency and properties of different data structures, and focus on the management of the rewriting process which is usually hidden in the graph rewriting system. We provide experimental data comparing the different choices of data
structures and select one for further development. For the compilation of nets and rules into this language, we show an optimisation such that allocated memory for agents is reused, and thus we obtain optimal efficiency for the rewriting process.
The second part of this thesis describes extensions of interaction nets so that they can be used as a programming language. Interaction nets in their pure form are quite restrictive in expressive power. By extending the notions of agents and rules we can express computation more naturally, yet still preserve the good properties (such as strong confluence) of the rewriting system. We then implement a selection of algorithms using and extending the compilation techniques developed in the first part of the thesis. We also demonstrate experimental results on multi-core CPUs, using the Posix-thread library, thus realising some of the potential for parallel implementation mentioned above
- âŚ