Automatically generating invariants, key to computer-aided analysis of probabilistic and deterministic programs and compiler optimisation, is a challenging open problem. Whilst the problem is in general undecidable, the goal is settled for restricted classes of loops. For the class of solvable loops, introduced by Kapur and Rodr\'iguez-Carbonell in 2004, one can automatically compute invariants from closed-form solutions of recurrence equations that model the loop behaviour. In this paper we establish a technique for invariant synthesis for loops that are not solvable, termed unsolvable loops. Our approach automatically partitions the program variables and identifies the so-called defective variables that characterise unsolvability. We further present a novel technique that automatically synthesises polynomials, in the defective variables, that admit closed-form solutions and thus lead to polynomial loop invariants. Our implementation and experiments demonstrate both the feasibility and applicability of our approach to both deterministic and probabilistic programs.
翻译:自动生成变量是计算机辅助分析概率和确定性程序以及编译器优化的关键,这是一个具有挑战性的开放问题。 虽然问题一般是不可分的, 但目标已定在限制的循环类别中。 Kapur 和 Rodr\'iguez-Carbonell 在2004年引入的可溶性循环类别中, 人们可以自动从模拟循环行为的复现方程式的封闭式解决方案中计算异性。 在本文中, 我们为不可溶解、 被称为不可溶性循环的循环建立了一种异性合成技术。 我们的方法自动分隔程序变量, 并确定了所谓的缺陷变量, 其特征是不可解的。 我们还展示了一种新型技术, 在有缺陷的变量中自动合成多元性, 接受闭式解决方案, 从而导致多式逆性循环。 我们的实施和实验证明了我们对确定性和预测性程序的方法的可行性和适用性。