129 research outputs found
Automated Generation of Non-Linear Loop Invariants Utilizing Hypergeometric Sequences
Analyzing and reasoning about safety properties of software systems becomes
an especially challenging task for programs with complex flow and, in
particular, with loops or recursion. For such programs one needs additional
information, for example in the form of loop invariants, expressing properties
to hold at intermediate program points. In this paper we study program loops
with non-trivial arithmetic, implementing addition and multiplication among
numeric program variables. We present a new approach for automatically
generating all polynomial invariants of a class of such programs. Our approach
turns programs into linear ordinary recurrence equations and computes closed
form solutions of these equations. These closed forms express the most precise
inductive property, and hence invariant. We apply Gr\"obner basis computation
to obtain a basis of the polynomial invariant ideal, yielding thus a finite
representation of all polynomial invariants. Our work significantly extends the
class of so-called P-solvable loops by handling multiplication with the loop
counter variable. We implemented our method in the Mathematica package Aligator
and showcase the practical use of our approach.Comment: A revised version of this paper is published in the proceedings of
ISSAC 201
Invariant Generation for Multi-Path Loops with Polynomial Assignments
Program analysis requires the generation of program properties expressing
conditions to hold at intermediate program locations. When it comes to programs
with loops, these properties are typically expressed as loop invariants. In
this paper we study a class of multi-path program loops with numeric variables,
in particular nested loops with conditionals, where assignments to program
variables are polynomial expressions over program variables. We call this class
of loops extended P-solvable and introduce an algorithm for generating all
polynomial invariants of such loops. By an iterative procedure employing
Gr\"obner basis computation, our approach computes the polynomial ideal of the
polynomial invariants of each program path and combines these ideals
sequentially until a fixed point is reached. This fixed point represents the
polynomial ideal of all polynomial invariants of the given extended P-solvable
loop. We prove termination of our method and show that the maximal number of
iterations for reaching the fixed point depends linearly on the number of
program variables and the number of inner loops. In particular, for a loop with
m program variables and r conditional branches we prove an upper bound of m*r
iterations. We implemented our approach in the Aligator software package.
Furthermore, we evaluated it on 18 programs with polynomial arithmetic and
compared it to existing methods in invariant generation. The results show the
efficiency of our approach
Stochastische Ăśberraschungen beim Spiel BINGO
BINGO ist ein sehr einfaches Spiel. Man hat dabei eigentlich keine Strategien
zu verfolgen, sondern muss nur schnell sein, das ist alles, was man
selbst steuern kann. Trotzdem besitzt BINGO interessante stochastische
Aspekte, welche im Folgenden behandelt werden sollen, z. B. wie viele
Ziehungen muss man im Durchschnitt abwarten, bis man „BINGO!“ rufen
kann? Oder: Wie wahrscheinlich ist es, dass man erst nach der letzten gezogenen
Kugel „BINGO!“ rufen kann? Welche Anzahl der nötigen Ziehungen,
bis man „BINGO!“ rufen kann, ist die wahrscheinlichste
Dividing a pizza into equal parts – an easy job?
Theoretically seen dividing a pizza equally is not an easy task. For instance, with a normal knife (straight cuts) one has to hit the center so that the cut is a diameter. But there are alternatives (also for dividing equally between more than two persons) which have strong connections to elementary geometry and to integral calculus. This paper deals with these alternatives elucidating the so called “pizza theorem”
- …