Quantifier Elimination für LIA in Z3 über C / C ++ API

Ich möchte Z3 zum Eliminieren von Quantifizierern in linearen ganzzahligen arithmetischen Formeln über C / C ++ API verwenden. Betrachten Sie ein einfaches Beispiel: Exists (x) (x <= y & y <= 2 * x). Eine quantifiziererfreie Formel mit denselben Modellen lautet y> = 0.

Ich habe versucht, es so zu machen:

   context ctx;
   ctx.set("ELIM_QUANTIFIERS", "true");
   expr x = ctx.int_const("x"); 
   expr y = ctx.int_const("y"); 
   expr sub_expr = (x <= y)  && (y <= 2*x);

   Z3_ast qf = Z3_mk_exists_const(ctx, 0, 1, (Z3_app[]) {x}, 
                                  0, {}, // patterns don't seem to make sense here.
                                  sub_expr); //No C++ API for quantifiers :(
   qf = Z3_simplify(ctx, qf);
   cout << Z3_ast_to_string(ctx, qf);

was ich bekomme ist

(existiert ((x Int) (und (<= x y) (<= y (* 2 x))))

wohingegen ich gerne etwas besorgen möchte

(<= 0 Jahre)

Gibt es eine Möglichkeit, es mit Z3 zu bekommen? Vielen Dank im Voraus.

Antworten auf die Frage(2)

Ihre Antwort auf die Frage