Note that there are some explanatory texts on larger screens.

plurals
  1. POStrange variable values in Z3 solution
    primarykey
    data
    text
    <p>I have the following model in Z3 (paste code at <a href="http://research.microsoft.com/en-us/um/redmond/projects/z3/" rel="nofollow noreferrer">http://research.microsoft.com/en-us/um/redmond/projects/z3/</a> to try it). The web interface gives me a solution back, see below. However, when I solve the same model via .NET and get the variable values by using Evaluate(), I get a different output, which I don't understand. As you can see, I don't get values, but expressions. My question is: How do I get the values in .NET? For the record, I double checked that the model I build up in .NET is identical to the one pasted here. I also saw this post: <a href="https://stackoverflow.com/questions/10197970/strange-z3-model-value">Post</a> and tried to apply the fix (setting auto_config to false), but that only results in the solver not being able to compute a solution.</p> <p><strong>Model:</strong></p> <pre><code> Q311, Q411, Q431, QQ311, QQ411, QQ431, H11, H41 = Reals('Q311 Q411 Q431 QQ311 QQ411 QQ431 H11 H41') solve( Q411 + Q311 &lt;= 155, Q431 - Q311 &lt;= -28.015, -Q431 - Q411 &lt;= -126.985, -Q411 - Q311 &lt;= -155, -Q431 + Q311 &lt;= 28.015, Q431 + Q411 &lt;= 126.985, 43.015 - H11 - 0.0031 * QQ311 * Q311 &lt;= 0, H41 - H11 - 0.0031 * QQ411 * Q411 &lt;= 0, H41 - 43.015 - 0.0031 * QQ431 * Q431 &lt;= 0, -43.015 + H11 + 0.0031 * QQ311 * Q311 &lt;= 0, -H41 + H11 + 0.0031 * QQ411 * Q411 &lt;= 0, -H41 + 43.015 + 0.0031 * QQ431 * Q431 &lt;= 0, QQ311 - Q311 &lt;= 0, QQ411 - Q411 &lt;= 0, QQ431 - Q431 &lt;= 0, -QQ311 + Q311 &lt;= 0, -QQ411 + Q411 &lt;= 0, -QQ431 + Q431 &lt;= 0, Q311 &gt;= 0, Q411 &gt;= 0, Q431 &gt;= 0, QQ311 &gt;= 0, QQ411 &gt;= 0, QQ431 &gt;= 0, H11 &gt;= 0, H41 &gt;= 0, show=True) </code></pre> <p><strong>Web interface solution:</strong></p> <pre><code>[Q411 = 83.5779688745?, Q311 = 71.4220311254?, Q431 = 43.4070311254?, H11 = 27.2015697567?, QQ311 = 71.4220311254?, H41 = 48.8559280884?, QQ411 = 83.5779688745?, QQ431 = 43.4070311254?] </code></pre> <p><strong>.NET solution:</strong></p> <pre><code>Q311: (root-obj (+ (* 40000 (^ x 2)) (* 10158800 x) (- 929606391)) 2) Q411: (root-obj (+ (* 40000 (^ x 2)) (* (- 22558800) x) 1606007609) 1) Q431: (root-obj (+ (* 20 (^ x 2)) (* 6200 x) (- 306807)) 2) QQ431: (root-obj (+ (* 20 (^ x 2)) (* 6200 x) (- 306807)) 2) H11: (root-obj (+ (* 160000000000000000 (^ x 2)) (* 41281815903200000000 x) (- 1 241318258533436869359)) 2) QQ311: (root-obj (+ (* 40000 (^ x 2)) (* 10158800 x) (- 929606391)) 2) H41: (root-obj (+ (* 40000000000 (^ x 2)) (* (- 19162006800000) x) 8407015578762 89) 1) QQ411: (root-obj (+ (* 40000 (^ x 2)) (* (- 22558800) x) 1606007609) 1) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload