You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have 0 <= V and V <= 0 in your set of qualifiers, then you can infer refinements of the shape 0 <=V and V <= 0. We should use an SMT solver to simplify this into V == 0 even if V == 0 isn't in the set of qualifiers.
This will just make the inferred refinement types easier to read.
The text was updated successfully, but these errors were encountered:
Weirdly, z3's simplify nor some straightforward tactics don't seem to do the needful here: I would have thought it'd be smart enough to figure it out, but I guess I'm misunderstanding its limits or just driving it wrong:
>>> V = Int("V")
>>> simplify(And(0 <= V, V <= 0))
And(V >= 0, V <= 0)
>>>
>>> t = Tactic('solve-eqs')
>>> t(And(0 <= V, V <= 0))
[[V >= 0, V <= 0]]
>>>
Rubbing everyone's favourite CS 386L tactic on the result yields a funny result, too...
>>> t = Tactic('lia')
>>> t(And(0 <= V, V <= 0))
[[]]
>>>
Broadly, though, it's interesting to think about what sequence of tactics might be useful for our domain here. (word to the wise: z3.describe_tactics() will print out all the available ones in the REPL.)
If you have
0 <= V
andV <= 0
in your set of qualifiers, then you can infer refinements of the shape0 <=V and V <= 0
. We should use an SMT solver to simplify this intoV == 0
even ifV == 0
isn't in the set of qualifiers.This will just make the inferred refinement types easier to read.
The text was updated successfully, but these errors were encountered: