10.07.2015 Views

A New Look at the Automatic Synthesis of Linear Ranking Functions$

A New Look at the Automatic Synthesis of Linear Ranking Functions$

A New Look at the Automatic Synthesis of Linear Ranking Functions$

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

function. This is <strong>the</strong> case, for instance, <strong>of</strong> [13], where gener<strong>at</strong>ion consists in <strong>the</strong>instanti<strong>at</strong>ion <strong>of</strong> templ<strong>at</strong>e functions and testing employs an algorithm based on avariant <strong>of</strong> Farkas’ Lemma. Non-linear constraints gener<strong>at</strong>ed by <strong>the</strong> method describedin [24] are handled by first resorting to semidefinite programming solversand <strong>the</strong>n valid<strong>at</strong>ing <strong>the</strong> obtained results by using some o<strong>the</strong>r tools, since <strong>the</strong>sesolvers are typically based on interior point algorithms and hence may incur intounsafe rounding errors. Note th<strong>at</strong>, in principle, <strong>the</strong> very same observ<strong>at</strong>ion wouldapply to <strong>the</strong> case <strong>of</strong> linear constraints, if <strong>the</strong> corresponding linear programmingproblem is solved using an interior point method or even a flo<strong>at</strong>ing-point basedimplement<strong>at</strong>ion <strong>of</strong> <strong>the</strong> simplex algorithm; however, <strong>the</strong>re exist implement<strong>at</strong>ions<strong>of</strong> <strong>the</strong> simplex algorithm based on exact arithmetic, so th<strong>at</strong> linear programmingproblems can be numerically solved incurring no rounding errors <strong>at</strong> all and witha comput<strong>at</strong>ional overhead th<strong>at</strong> is <strong>of</strong>ten acceptable. 34. The Approach <strong>of</strong> Sohn and Van Gelder, GeneralizedAs far as we know, <strong>the</strong> first approach to <strong>the</strong> autom<strong>at</strong>ic syn<strong>the</strong>sis <strong>of</strong> rankingfunctions is due to Kirack Sohn and Allen Van Gelder [7, 10]. Even thoughSohn and Van Gelder’s work concerned termin<strong>at</strong>ion <strong>of</strong> logic programs, we willshow th<strong>at</strong> <strong>the</strong> key ideas <strong>of</strong> <strong>the</strong>ir approach can be applied, with only r<strong>at</strong>hersimple modific<strong>at</strong>ions, to <strong>the</strong> syn<strong>the</strong>sis <strong>of</strong> ranking functions for any programmingparadigm, thus going beyond wh<strong>at</strong> subsequent authors acknowledged.4.1. <strong>Ranking</strong> Functions for Binary, Directly Recursive CLP(N) ProgramsWe refer <strong>the</strong> interested reader to [3] for a more complete reconstruction <strong>of</strong><strong>the</strong> approach by Sohn and Van Gelder. For <strong>the</strong> o<strong>the</strong>r readers, suffices it to sayth<strong>at</strong> termin<strong>at</strong>ion analysis <strong>of</strong> logic programs can be mapped onto termin<strong>at</strong>ionanalysis <strong>of</strong> CLP(N) programs, <strong>the</strong> termin<strong>at</strong>ion <strong>of</strong> which implies <strong>the</strong> termin<strong>at</strong>ion<strong>of</strong> <strong>the</strong> original program. 4 In turn, <strong>the</strong> termin<strong>at</strong>ion analysis <strong>of</strong> general CLP(N)programs can be approxim<strong>at</strong>ed by termin<strong>at</strong>ion analysis <strong>of</strong> directly recursive, binaryCLP(N) clauses. In order to show how ranking functions can be computedfrom <strong>the</strong>se, we deal first with a single clausep(¯x) :− c[¯x, ¯x ′ ], p(¯x ′ ), (5)where p is a predic<strong>at</strong>e symbol, ¯x and ¯x ′ are disjoint n-tuples <strong>of</strong> variables, andc[¯x, ¯x ′ ] is a linear constraint involving variables in ¯x ∪ ¯x ′ . 5 The meaning <strong>of</strong> sucha clause is th<strong>at</strong>, if p is called on some tuple <strong>of</strong> integers ¯x, <strong>the</strong>n <strong>the</strong>re are twocases:3 In contrast, an exact solver for non-linear constraints would probably require a trulysymbolic comput<strong>at</strong>ion, incurring a much more significant comput<strong>at</strong>ional overhead.4 See, e.g., [26] for an introduction to CLP —constraint logic programming— languages,and [16] for <strong>the</strong> mapping <strong>of</strong> logic programs to CLP(N) programs.5 As usual, we abuse not<strong>at</strong>ion by confusing a tuple with <strong>the</strong> set <strong>of</strong> its elements.10

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!