Skip to content

Various updates in preparation for Z3 version update#585

Draft
marcoeilers wants to merge 3 commits into
masterfrom
meilers_z3_416
Draft

Various updates in preparation for Z3 version update#585
marcoeilers wants to merge 3 commits into
masterfrom
meilers_z3_416

Conversation

@marcoeilers

Copy link
Copy Markdown
Contributor

We might want to update our used Z3 version from 4.8.7 to 4.16.0 soon. This version leads to some issues with the current version of Carbon, which I'm trying to address in this PR:

  • Doing several asserts related to quantified permissions that we emit without triggers inside their own if (*) { ... assume false } block, to prevent them from being triggered in subsequent assertions.
  • Dropping some Z3 flags
  • Rewriting the axiom that states that for predicate P(x, y), P(x1, y1) == P(x2, y2) ==> x1 == x2 && y1 == y2 to one that uses getter functions for each parameter and therefore should not be multiplicative in the same way
  • Some small changes to sequence axioms
  • Introducing a timeout in the standard test suite

@alexanderjsummers alexanderjsummers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of my comments are out-of-interest; the minor fix to the one axiom seems worth doing now

|// AS: added "reverse triggering" versions of the axioms
|axiom (forall<T> s0: Seq T, s1: Seq T, m: int :: { Seq#Index(s1, m), Seq#Append(s0,s1)} // m == n-|s0|, n == m + |s0|
| s0 != Seq#Empty() && s1 != Seq#Empty() && 0 <= m && m < Seq#Length(s1) ==> Seq#Sub(Seq#Add(m,Seq#Length(s0)),Seq#Length(s0)) == m && Seq#Index(Seq#Append(s0,s1), Seq#Add(m,Seq#Length(s0))) == Seq#Index(s1, m));
| s0 != Seq#Empty() && s1 != Seq#Empty() && 0 <= m && m < Seq#Length(s1) && s1 != Seq#Append(s0,s1) ==> Seq#Sub(Seq#Add(m,Seq#Length(s0)),Seq#Length(s0)) == m && Seq#Index(Seq#Append(s0,s1), Seq#Add(m,Seq#Length(s0))) == Seq#Index(s1, m));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move this to before the inequalities (two conjuncts earlier); I think (heuristically) it can be useful to put the first-to-be-ruled-out cases first.

Also, although I don't think it's relevant for what this axiom does directly, adding s0 != Seq#Append(s0,s1) && before it should be fine and I think it might be easier to get this consistent if we follow this pattern everywhere: rule out the cases where the operator doesn't actually create new sequences, and only add the index terms under these conditions. I didn't think about it that way when making the previous changes, but I think this fits well how to make this more methodical.

"/proverOpt:O:NNF.SK_HACK=true",
"/proverOpt:O:smt.MBQI=false",
"/proverOpt:O:smt.QI.EAGER_THRESHOLD=100",
"/proverOpt:O:smt.BV.REFLECT=true",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this option no longer exist? It seems like one that could have quite significant effects on performance but only for problems using bitvectors + quantifiers

"/proverOpt:O:smt.ARITH.RANDOM_INITIAL_VALUE=true",
"/proverOpt:O:smt.CASE_SPLIT=3",
"/proverOpt:O:smt.DELAY_UNITS=true",
"/proverOpt:O:NNF.SK_HACK=true",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this option has gone? Not sure what it did, to be honest

"/proverOpt:O:smt.PHASE_SELECTION=0",
"/proverOpt:O:smt.RESTART_STRATEGY=0",
"/proverOpt:O:smt.RESTART_FACTOR=|1.5|",
"/proverOpt:O:smt.ARITH.RANDOM_INITIAL_VALUE=true",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking at the docs, I'm surprised we had this one - seems good to get rid of anyway

"/errorTrace:0",
"/errorLimit:10000000",
"/proverOpt:O:smt.AUTO_CONFIG=false",
"/proverOpt:O:smt.PHASE_SELECTION=0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the rationale for removing these three? It might be a good thing to do, but presumably has some chance of non-trivial performance impact (maybe in either direction?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants