X-Git-Url: https://svn.cri.ensmp.fr/git/linpy.git/blobdiff_plain/197818714e75c2353ed8b7c9fec653f1212f13ae..b77f3f44c4b15fbe2965b206bf74021377a8876a:/examples/nsad2010.py?ds=inline diff --git a/examples/nsad2010.py b/examples/nsad2010.py index 91a85b4..4b73eef 100755 --- a/examples/nsad2010.py +++ b/examples/nsad2010.py @@ -1,21 +1,12 @@ #!/usr/bin/env python3 + +# This is an implementation of the algorithm described in # -# Copyright 2014 MINES ParisTech -# -# This file is part of LinPy. -# -# LinPy is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# LinPy is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# [ACI10] C. Ancourt, F. Coelho and F. Irigoin, A modular static analysis +# approach to affine loop invariants detection (2010), pp. 3 - 16, NSAD 2010. # -# You should have received a copy of the GNU General Public License -# along with LinPy. If not, see . +# to compute the transitive closure of an affine transformer. A refined version +# of this algorithm is implemented in PIPS. from linpy import * @@ -56,8 +47,8 @@ class Transformer: if __name__ == '__main__': - i, iprime, j, jprime = symbols("i i' j j'") - transformer = Transformer(Eq(iprime, i + 2) & Eq(jprime, j + 1), - [i, j], [iprime, jprime]) + i0, i, j0, j = symbols('i0 i j0 j') + transformer = Transformer(Eq(i, i0 + 2) & Eq(j, j0 + 1), + [i0, j0], [i, j]) print('T =', transformer.polyhedron) print('T* =', transformer.star().polyhedron)