Normal form of formula returned by Z3's qe tactic
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
add a comment |
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
add a comment |
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
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
z3 smt z3py quantifiers
edited Nov 11 '18 at 7:34
Akay
asked Nov 11 '18 at 7:09
AkayAkay
1375
1375
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
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
add a comment |
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
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
add a comment |
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
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
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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