OCamlPro / alt-ergo

OCamlPro public development repository for Alt-Ergo
https://alt-ergo.ocamlpro.com/
Other
132 stars 33 forks source link

AE seems stuck on a trivial test case #500

Open pictavien opened 2 years ago

pictavien commented 2 years ago

Hi,

I'm using alt-ergo (2.4.0). AE fails to prove, at least in a reasonable amount of time, the following simple case generated by Why3 (the goal is an axiom). After inlining the function f, it works fine.

(* this is the prelude for Alt-Ergo, version >= 2.4.0 *)
(* this is a prelude for Alt-Ergo integer arithmetic *)
type string

logic match_bool : bool, 'a, 'a -> 'a

axiom match_bool_True :
  (forall z:'a. forall z1:'a. (match_bool(true, z, z1) = z))

axiom match_bool_False :
  (forall z:'a. forall z1:'a. (match_bool(false, z, z1) = z1))

axiom CompatOrderMult :
  (forall x:int. forall y:int. forall z:int. ((x <= y) -> ((0 <= z) ->
  ((x * z) <= (y * z)))))

function f(x: int) : int = (((x * x) * x) - x)

axiom f_diff :
  (forall x:int. (exists y:int. ((f((x + 1)) - f(x)) = (3 * y))))

goal f_diff2 :
  (forall x:int. (exists y:int. ((f((x + 1)) - f(x)) = (3 * y))))
Gbury commented 2 years ago

Sorry for the delay, I'll try and take a look at this as soon as possible.

bclement-ocp commented 1 year ago

Looks like this is AC(X) exploding by trying to saturate way too many equations involving f(x), f(x + 1) and variants. Either inlining f or abstracting it (making it uninterpreted) makes AltRg answer immediately because it no longer spends time with irrelevant congruences involving f.

After discussing with @Gbury there are at least 4 underlying issues that contribute to the problem: