38 research outputs found
Interning Ground Terms in XSB
This paper presents an implementation of interning of ground terms in the XSB
Tabled Prolog system. This is related to the idea of hash-consing. I describe
the concept of interning atoms and discuss the issues around interning ground
structured terms, motivating why tabling Prolog systems may change the
cost-benefit tradeoffs from those of traditional Prolog systems. I describe the
details of the implementation of interning ground terms in the XSB Tabled
Prolog System and show some of its performance properties. This implementation
achieves the effects of that of Zhou and Have but is tuned for XSB's
representations and is arguably simpler.Comment: Proceedings of the 13th International Colloquium on Implementation of
Constraint LOgic Programming Systems (CICLOPS 2013), Istanbul, Turkey, August
25, 201
Edit and verify
Automated theorem provers are used in extended static checking, where they
are the performance bottleneck. Extended static checkers are run typically
after incremental changes to the code. We propose to exploit this usage pattern
to improve performance. We present two approaches of how to do so and a full
solution
Sawja: Static Analysis Workshop for Java
Static analysis is a powerful technique for automatic verification of
programs but raises major engineering challenges when developing a full-fledged
analyzer for a realistic language such as Java. This paper describes the Sawja
library: a static analysis framework fully compliant with Java 6 which provides
OCaml modules for efficiently manipulating Java bytecode programs. We present
the main features of the library, including (i) efficient functional
data-structures for representing program with implicit sharing and lazy
parsing, (ii) an intermediate stack-less representation, and (iii) fast
computation and manipulation of complete programs
A compiler extension for parallelizing arrays automatically on the cell heterogeneous processor
This paper describes the approaches taken to extend an array
programming language compiler using a Virtual SIMD Machine (VSM)
model for parallelizing array operations on Cell Broadband Engine heterogeneous
machine. This development is part of ongoing work at the
University of Glasgow for developing array compilers that are beneficial
for applications in many areas such as graphics, multimedia, image processing
and scientific computation. Our extended compiler, which is built
upon the VSM interface, eases the parallelization processes by allowing
automatic parallelisation without the need for any annotations or process
directives. The preliminary results demonstrate significant improvement
especially on data-intensive applications
The Strahler number of a parity game
The Strahler number of a rooted tree is the largest height of a perfect binary tree that is its minor. The Strahler number of a parity game is proposed to be defined as the smallest Strahler number of the tree of any of its attractor decompositions. It is proved that parity games can be solved in quasi-linear space and in time that is polynomial in the number of vertices~n and linear in (d/2k)k, where d is the number of priorities and k is the Strahler number. This complexity is quasi-polynomial because the Strahler number is at most logarithmic in the number of vertices. The proof is based on a new construction of small Strahler-universal trees.
It is shown that the Strahler number of a parity game is a robust parameter: it coincides with its alternative version based on trees of progress measures and with the register number defined by Lehtinen~(2018). It follows that parity games can be solved in quasi-linear space and in time that is polynomial in the number of vertices and linear in (d/2k)k, where k is the register number. This significantly improves the running times and space achieved for parity games of bounded register number by Lehtinen (2018) and by Parys (2020).
The running time of the algorithm based on small Strahler-universal trees yields a novel trade-off k⋅lg(d/k)=O(logn) between the two natural parameters that measure the structural complexity of a parity game, which allows solving parity games in polynomial time. This includes as special cases the asymptotic settings of those parameters covered by the results of Calude, Jain Khoussainov, Li, and Stephan (2017), of Jurdziński and Lazić (2017), and of Lehtinen (2018), and it significantly extends the range of such settings, for example to d=2O(lgn√) and k=O(lgn−√)
XML Compression via DAGs
Unranked trees can be represented using their minimal dag (directed acyclic
graph). For XML this achieves high compression ratios due to their repetitive
mark up. Unranked trees are often represented through first child/next sibling
(fcns) encoded binary trees. We study the difference in size (= number of
edges) of minimal dag versus minimal dag of the fcns encoded binary tree. One
main finding is that the size of the dag of the binary tree can never be
smaller than the square root of the size of the minimal dag, and that there are
examples that match this bound. We introduce a new combined structure, the
hybrid dag, which is guaranteed to be smaller than (or equal in size to) both
dags. Interestingly, we find through experiments that last child/previous
sibling encodings are much better for XML compression via dags, than fcns
encodings. We determine the average sizes of unranked and binary dags over a
given set of labels (under uniform distribution) in terms of their exact
generating functions, and in terms of their asymptotical behavior.Comment: A short version of this paper appeared in the Proceedings of ICDT
201
Implementing Explicit and Finding Implicit Sharing in Embedded DSLs
Aliasing, or sharing, is prominent in many domains, denoting that two
differently-named objects are in fact identical: a change in one object (memory
cell, circuit terminal, disk block) is instantly reflected in the other.
Languages for modelling such domains should let the programmer explicitly
define the sharing among objects or expressions. A DSL compiler may find other
identical expressions and share them, implicitly. Such common subexpression
elimination is crucial to the efficient implementation of DSLs. Sharing is
tricky in embedded DSL, since host aliasing may correspond to copying of the
underlying objects rather than their sharing.
This tutorial summarizes discussions of implementing sharing in Haskell DSLs
for automotive embedded systems and hardware description languages. The
technique has since been used in a Haskell SAT solver and the DSL for music
synthesis. We demonstrate the embedding in pure Haskell of a simple DSL with a
language form for explicit sharing. The DSL also has implicit sharing,
implemented via hash-consing. Explicit sharing greatly speeds up hash-consing.
The seemingly imperative nature of hash-consing is hidden beneath a simple
combinator language. The overall implementation remains pure functional and
easy to reason about.Comment: In Proceedings DSL 2011, arXiv:1109.032
Efficient tabling of structured data with enhanced hash-consing
Current tabling systems suffer from an increase in space complexity, time
complexity or both when dealing with sequences due to the use of data
structures for tabled subgoals and answers and the need to copy terms into and
from the table area. This symptom can be seen in not only B-Prolog, which uses
hash tables, but also systems that use tries such as XSB and YAP. In this
paper, we apply hash-consing to tabling structured data in B-Prolog. While
hash-consing can reduce the space consumption when sharing is effective, it
does not change the time complexity. We enhance hash-consing with two
techniques, called input sharing and hash code memoization, for reducing the
time complexity by avoiding computing hash codes for certain terms. The
improved system is able to eliminate the extra linear factor in the old system
for processing sequences, thus significantly enhancing the scalability of
applications such as language parsing and bio-sequence analysis applications.
We confirm this improvement with experimental results.Comment: 16 pages; TPLP, 201
Scaling and Multiscaling Exponents in Networks and Flows
The main focus of this paper is on mathematical theory and methods which have a direct bearing on problems involving multiscale phenomena. Modern technology is refining
measurement and data collection to spatio-temporal scales on which observed geophysical phenomena are displayed as intrinsically highly variable and intermittant heirarchical
structures,e.g. rainfall, turbulence, etc. The heirarchical structure is reflected in the occurence of a natural separation of scales which collectively manifest at some basic unit
scale. Thus proper data analysis and inference require a mathematical framework which
couples the variability over multiple decades of scale in which basic theoretical benchmarks can be identified and calculated. This continues the main theme of the research
in this area of applied probability over the past twenty years
Pluggable type-checking for custom type qualifiers in Java
We have created a framework for adding custom type qualifiers to the Javalanguage in a backward-compatible way. The type system designer definesthe qualifiers and creates a compiler plug-in that enforces theirsemantics. Programmers can write the type qualifiers in their programs andbe informed of errors or assured that the program is free of those errors.The system builds on existing Java tools and APIs.In order to evaluate our framework, we have written four type-checkersusing the framework: for a non-null type system that can detect andprevent null pointer errors; for an interned type system that can detectand prevent equality-checking errors; for a reference immutability typesystem, Javari, that can detect and prevent mutation errors; and for areference and object immutability type system, IGJ, that can detect andprevent even more mutation errors. We have conducted case studies usingeach checker to find real errors in existing software. These case studiesdemonstrate that the checkers and the framework are practical and useful