56,331 research outputs found
Solving Functional Constraints by Variable Substitution
Functional constraints and bi-functional constraints are an important
constraint class in Constraint Programming (CP) systems, in particular for
Constraint Logic Programming (CLP) systems. CP systems with finite domain
constraints usually employ CSP-based solvers which use local consistency, for
example, arc consistency. We introduce a new approach which is based instead on
variable substitution. We obtain efficient algorithms for reducing systems
involving functional and bi-functional constraints together with other
non-functional constraints. It also solves globally any CSP where there exists
a variable such that any other variable is reachable from it through a sequence
of functional constraints. Our experiments on random problems show that
variable elimination can significantly improve the efficiency of solving
problems with functional constraints
Deforestation for higher-order functional programs
Functional programming languages are an ideal medium for program optimisations based
on source-to-source transformation techniques. Referential transparency affords opportunities
for a wide range of correctness-preserving transformations leading to potent optimisation
strategies.
This thesis builds on deforestation, a program transformation technique due to Wadler
that removes intermediate data structures from first-order functional programs.
Our contribution is to reformulate deforestation for higher-order functional programming
languages, and to show that the resulting algorithm terminates given certain syntactic and
typing constraints on the input. These constraints are entirely reasonable, indeed it is
possible to translate any typed program into the required syntactic form. We show how
this translation can be performed automatically and optimally.
The higher-order deforestation algorithm is transparent. That is, it is possible to determine
by examination of the source program where the optimisation will be applicable.
We also investigate the relationship of deforestation to cut-elimination, the normalisation
property for the logic of sequent calculus. By combining a cut-elimination algorithm and
first-order deforestation, we derive an improved higher-order deforestation algorithm.
The higher-order deforestation algorithm has been implemented in the Glasgow Haskell
Compiler. We describe how deforestation fits into the framework of Haskell, and design
a model for the implementation that allows automatic list removal, with additional deforestation
being performed on the basis of programmer supplied annotations. Results from
applying the deforestation implementation to several example Haskell programs are given
Counterexample-Guided Polynomial Loop Invariant Generation by Lagrange Interpolation
We apply multivariate Lagrange interpolation to synthesize polynomial
quantitative loop invariants for probabilistic programs. We reduce the
computation of an quantitative loop invariant to solving constraints over
program variables and unknown coefficients. Lagrange interpolation allows us to
find constraints with less unknown coefficients. Counterexample-guided
refinement furthermore generates linear constraints that pinpoint the desired
quantitative invariants. We evaluate our technique by several case studies with
polynomial quantitative loop invariants in the experiments
- …