What's the difference between “arith” and “presburger” in Isabelle?

旧城冷巷雨未停 提交于 2019-12-22 06:06:22

问题


Every goal that I have encountered in Isabelle so far that could be solved using arith could also be solved by presburger and vice versa, for example

lemma "odd (n::nat) ⟹ Suc (2 * (n div 2)) = n"
by presburger (* or arith *)

What's the difference between the two solvers? Examples of goals that one can solve but the other can't would be nice.


Edit: I managed to come up with a lemma proved by arith that presburger can't handle. It seems like this has something to do with real numbers:

lemma "max i (i + 1) > (i::nat)" by arith       -- ✔
lemma "max i (i + 1) > (i::nat)" by presburger  -- ✔

lemma "max i (i + 1) > (i::real)" by arith      -- ✔
lemma "max i (i + 1) > (i::real)" by presburger -- ✘

回答1:


I just asked Tobias Nipkow and this is what he told me:

  • presburger is a decision procedure for Presburger arithmetic, i.e. linear arithmetic on natural numbers and integers, plus some pre-processing, which is why your statement with real could be proven as well (as it boils down to a problem on integers). It can handle quantifiers. The algorithm underlying it is known as Cooper's algorithm.
  • linarith performs Fourier-Motzkin elimination to decide problems of linear arithmetic on real numbers. It can also prove these properties on natural numbers and integers, but only if they also hold on all reals. It cannot handle quantifiers.
  • arith can be summarised as a combination of presburger and linarith.

For the sake of completeness, I would like to add that there are more specialised proof methods for interesting classes of statements:

  • algebra applies, to my knowledge, certain rules for algebraic manipulations (such as commutativity, associativity, inverse elements, etc.) to solve goals that can be proven by rearranging terms in algebraic structures like groups and rings
  • approximate computes enclosures for concrete terms using interval arithmetic
  • sos can prove multivariate polynomial inequalities like (x :: real) ≥ 2 ⟹ y ≥ 2 ⟹ x + y ≤ x * y using sum-of-squares certificates
  • sturm, which was written by me, can count the number of real roots in a given interval and prove certain univariate real polynomial inequalities.
  • regexp can prove statements on relations like (r ∪ s⁺)* = (r ∪ s)* using regular expressions.


来源:https://stackoverflow.com/questions/28644151/whats-the-difference-between-arith-and-presburger-in-isabelle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!