Normal form of formula returned by Z3's qe tactic










0















I'm using Z3's quantifier elimination tactic via Z3py and have tried the following examples.



from z3 import *
x,y,xp,yp = Ints('x y xp yp')
t = Tactic('qe')

t(Exists((xp, yp), And(xp==x+1, yp==y+2, xp<=8, xp >=1, yp<=12, yp>=2)))
#returns: [[y <= 10, y >= 0, x <= 7, x >= 0]]

t(Exists((xp, yp), Implies(x<10 , And(xp==x+1, yp==y+2, xp<=8, xp >=1, yp<=12, yp>=2))))
#returns: [[Or(10 <= x, And(y <= 10, y >= 0, And(x <= 7, x >= 0)))]]


I think that the resultant formulas are in quantifier-free DNF(which is what I need), but I could not find anything in the API documentation that guarantees it. Does anyone know if qe always returns formulas in DNF?



Where can I(if at all) find such details regarding tactics without having to dig through the original source code?



EDIT: All formulas are restricted to linear integer arithmetic.










share|improve this question




























    0















    I'm using Z3's quantifier elimination tactic via Z3py and have tried the following examples.



    from z3 import *
    x,y,xp,yp = Ints('x y xp yp')
    t = Tactic('qe')

    t(Exists((xp, yp), And(xp==x+1, yp==y+2, xp<=8, xp >=1, yp<=12, yp>=2)))
    #returns: [[y <= 10, y >= 0, x <= 7, x >= 0]]

    t(Exists((xp, yp), Implies(x<10 , And(xp==x+1, yp==y+2, xp<=8, xp >=1, yp<=12, yp>=2))))
    #returns: [[Or(10 <= x, And(y <= 10, y >= 0, And(x <= 7, x >= 0)))]]


    I think that the resultant formulas are in quantifier-free DNF(which is what I need), but I could not find anything in the API documentation that guarantees it. Does anyone know if qe always returns formulas in DNF?



    Where can I(if at all) find such details regarding tactics without having to dig through the original source code?



    EDIT: All formulas are restricted to linear integer arithmetic.










    share|improve this question


























      0












      0








      0








      I'm using Z3's quantifier elimination tactic via Z3py and have tried the following examples.



      from z3 import *
      x,y,xp,yp = Ints('x y xp yp')
      t = Tactic('qe')

      t(Exists((xp, yp), And(xp==x+1, yp==y+2, xp<=8, xp >=1, yp<=12, yp>=2)))
      #returns: [[y <= 10, y >= 0, x <= 7, x >= 0]]

      t(Exists((xp, yp), Implies(x<10 , And(xp==x+1, yp==y+2, xp<=8, xp >=1, yp<=12, yp>=2))))
      #returns: [[Or(10 <= x, And(y <= 10, y >= 0, And(x <= 7, x >= 0)))]]


      I think that the resultant formulas are in quantifier-free DNF(which is what I need), but I could not find anything in the API documentation that guarantees it. Does anyone know if qe always returns formulas in DNF?



      Where can I(if at all) find such details regarding tactics without having to dig through the original source code?



      EDIT: All formulas are restricted to linear integer arithmetic.










      share|improve this question
















      I'm using Z3's quantifier elimination tactic via Z3py and have tried the following examples.



      from z3 import *
      x,y,xp,yp = Ints('x y xp yp')
      t = Tactic('qe')

      t(Exists((xp, yp), And(xp==x+1, yp==y+2, xp<=8, xp >=1, yp<=12, yp>=2)))
      #returns: [[y <= 10, y >= 0, x <= 7, x >= 0]]

      t(Exists((xp, yp), Implies(x<10 , And(xp==x+1, yp==y+2, xp<=8, xp >=1, yp<=12, yp>=2))))
      #returns: [[Or(10 <= x, And(y <= 10, y >= 0, And(x <= 7, x >= 0)))]]


      I think that the resultant formulas are in quantifier-free DNF(which is what I need), but I could not find anything in the API documentation that guarantees it. Does anyone know if qe always returns formulas in DNF?



      Where can I(if at all) find such details regarding tactics without having to dig through the original source code?



      EDIT: All formulas are restricted to linear integer arithmetic.







      z3 smt z3py quantifiers






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 11 '18 at 7:34







      Akay

















      asked Nov 11 '18 at 7:09









      AkayAkay

      1375




      1375






















          1 Answer
          1






          active

          oldest

          votes


















          1














          By design, tactics make "best effort." That is, while qe is designed to eliminate quantifiers, it may end up failing to do so, returning the goal stack unchanged.



          Note that quantifier elimination is not just one tactic, but it is a whole collection of them, depending on what other theories are involved in your benchmark. See the directory: https://github.com/Z3Prover/z3/tree/master/src/qe






          share|improve this answer























          • For my current use case, I have purely linear integer arithmetic formulas. I tried reading the source you linked to, but I'm not at all familiar with Z3's internals. Is there any documentation on this?

            – Akay
            Nov 11 '18 at 8:38












          • I doubt there's any direct documentation other than the source code itself. If you're looking for general information on quantifier elimination, then I'm sure you can find many scholarly articles on that.

            – Levent Erkok
            Nov 11 '18 at 16:15










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53246590%2fnormal-form-of-formula-returned-by-z3s-qe-tactic%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          By design, tactics make "best effort." That is, while qe is designed to eliminate quantifiers, it may end up failing to do so, returning the goal stack unchanged.



          Note that quantifier elimination is not just one tactic, but it is a whole collection of them, depending on what other theories are involved in your benchmark. See the directory: https://github.com/Z3Prover/z3/tree/master/src/qe






          share|improve this answer























          • For my current use case, I have purely linear integer arithmetic formulas. I tried reading the source you linked to, but I'm not at all familiar with Z3's internals. Is there any documentation on this?

            – Akay
            Nov 11 '18 at 8:38












          • I doubt there's any direct documentation other than the source code itself. If you're looking for general information on quantifier elimination, then I'm sure you can find many scholarly articles on that.

            – Levent Erkok
            Nov 11 '18 at 16:15















          1














          By design, tactics make "best effort." That is, while qe is designed to eliminate quantifiers, it may end up failing to do so, returning the goal stack unchanged.



          Note that quantifier elimination is not just one tactic, but it is a whole collection of them, depending on what other theories are involved in your benchmark. See the directory: https://github.com/Z3Prover/z3/tree/master/src/qe






          share|improve this answer























          • For my current use case, I have purely linear integer arithmetic formulas. I tried reading the source you linked to, but I'm not at all familiar with Z3's internals. Is there any documentation on this?

            – Akay
            Nov 11 '18 at 8:38












          • I doubt there's any direct documentation other than the source code itself. If you're looking for general information on quantifier elimination, then I'm sure you can find many scholarly articles on that.

            – Levent Erkok
            Nov 11 '18 at 16:15













          1












          1








          1







          By design, tactics make "best effort." That is, while qe is designed to eliminate quantifiers, it may end up failing to do so, returning the goal stack unchanged.



          Note that quantifier elimination is not just one tactic, but it is a whole collection of them, depending on what other theories are involved in your benchmark. See the directory: https://github.com/Z3Prover/z3/tree/master/src/qe






          share|improve this answer













          By design, tactics make "best effort." That is, while qe is designed to eliminate quantifiers, it may end up failing to do so, returning the goal stack unchanged.



          Note that quantifier elimination is not just one tactic, but it is a whole collection of them, depending on what other theories are involved in your benchmark. See the directory: https://github.com/Z3Prover/z3/tree/master/src/qe







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 11 '18 at 7:31









          Levent ErkokLevent Erkok

          7,34111027




          7,34111027












          • For my current use case, I have purely linear integer arithmetic formulas. I tried reading the source you linked to, but I'm not at all familiar with Z3's internals. Is there any documentation on this?

            – Akay
            Nov 11 '18 at 8:38












          • I doubt there's any direct documentation other than the source code itself. If you're looking for general information on quantifier elimination, then I'm sure you can find many scholarly articles on that.

            – Levent Erkok
            Nov 11 '18 at 16:15

















          • For my current use case, I have purely linear integer arithmetic formulas. I tried reading the source you linked to, but I'm not at all familiar with Z3's internals. Is there any documentation on this?

            – Akay
            Nov 11 '18 at 8:38












          • I doubt there's any direct documentation other than the source code itself. If you're looking for general information on quantifier elimination, then I'm sure you can find many scholarly articles on that.

            – Levent Erkok
            Nov 11 '18 at 16:15
















          For my current use case, I have purely linear integer arithmetic formulas. I tried reading the source you linked to, but I'm not at all familiar with Z3's internals. Is there any documentation on this?

          – Akay
          Nov 11 '18 at 8:38






          For my current use case, I have purely linear integer arithmetic formulas. I tried reading the source you linked to, but I'm not at all familiar with Z3's internals. Is there any documentation on this?

          – Akay
          Nov 11 '18 at 8:38














          I doubt there's any direct documentation other than the source code itself. If you're looking for general information on quantifier elimination, then I'm sure you can find many scholarly articles on that.

          – Levent Erkok
          Nov 11 '18 at 16:15





          I doubt there's any direct documentation other than the source code itself. If you're looking for general information on quantifier elimination, then I'm sure you can find many scholarly articles on that.

          – Levent Erkok
          Nov 11 '18 at 16:15

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53246590%2fnormal-form-of-formula-returned-by-z3s-qe-tactic%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

          Edmonton

          Crossroads (UK TV series)