2 research outputs found
Flowchart Programs, Regular Expressions, and Decidability of Polynomial Growth-Rate
We present a new method for inferring complexity properties for a class of
programs in the form of flowcharts annotated with loop information.
Specifically, our method can (soundly and completely) decide if computed values
are polynomially bounded as a function of the input; and similarly for the
running time. Such complexity properties are undecidable for a Turing-complete
programming language, and a common work-around in program analysis is to settle
for sound but incomplete solutions. In contrast, we consider a class of
programs that is Turing-incomplete, but strong enough to include several
challenges for this kind of analysis. For a related language that has
well-structured syntax, similar to Meyer and Ritchie's LOOP programs, the
problem has been previously proved to be decidable. The analysis relied on the
compositionality of programs, hence the challenge in obtaining similar results
for flowchart programs with arbitrary control-flow graphs. Our answer to the
challenge is twofold: first, we propose a class of loop-annotated flowcharts,
which is more general than the class of flowcharts that directly represent
structured programs; secondly, we present a technique to reuse the ideas from
the work on tructured programs and apply them to such flowcharts. The technique
is inspired by the classic translation of non-deterministic automata to regular
expressions, but we obviate the exponential cost of constructing such an
expression, obtaining a polynomial-time analysis. These ideas may well be
applicable to other analysis problems.Comment: In Proceedings VPT 2016, arXiv:1607.0183
The Power of Non-Determinism in Higher-Order Implicit Complexity
We investigate the power of non-determinism in purely functional programming
languages with higher-order types. Specifically, we consider cons-free programs
of varying data orders, equipped with explicit non-deterministic choice.
Cons-freeness roughly means that data constructors cannot occur in function
bodies and all manipulation of storage space thus has to happen indirectly
using the call stack.
While cons-free programs have previously been used by several authors to
characterise complexity classes, the work on non-deterministic programs has
almost exclusively considered programs of data order 0. Previous work has shown
that adding explicit non-determinism to cons-free programs taking data of order
0 does not increase expressivity; we prove that this - dramatically - is not
the case for higher data orders: adding non-determinism to programs with data
order at least 1 allows for a characterisation of the entire class of
elementary-time decidable sets.
Finally we show how, even with non-deterministic choice, the original
hierarchy of characterisations is restored by imposing different restrictions.Comment: pre-edition version of a paper accepted for publication at ESOP'1