Add Skolem functions to QP framing axioms#524
Add Skolem functions to QP framing axioms#524marcoeilers merged 2 commits intoviperproject:masterfrom
Conversation
|
Hi, thank you for your contribution and sorry it took so very long to get a response. |
|
Hi Marco, No worries, I admit it took me a while to understand (and even longer to implement) as well! Alex Summers is really to credit for this idea. Below is a "real" example of Viper code that led to this axiom modification. There is a Viper source ( It's rather unreadable, but I believe the Viper should verify (under Carbon only, not Silicon, since it relies on heap-dependent triggers). And the Skolemized Boogie code should verify faster than the original. Please let me know if otherwise, this was all automatically generated code (even the Viper, by a plug-in that I'm working on). The basic idea is: we increment the values of an array So every increment statement of some index in the set Here's a "schematic" version of the code (you can interpret arrayTestChainIrrel3.vpr.txt |
|
Thanks! |
This modifies the axiom used to frame heap-dependent functions and predicates with
Setarguments based on quantified permissions.The following explanation also exists in #522. We noticed that in the existing generated axiom, the LHS quantified formula that will become a negated existential on the left of a disjunction. For example:
This generates new Skolemized indices for
a: Refandi: Intfor each triggering of the outer quantified variablesHeap2Heap: HeapType, Heap1Heap: HeapType, vas: (Set Ref), vis: (Set int).However, there may be some prior equalities between the given heap-dependent term across other heaps. For example, if
then it is undesirable to generate distinct Skolemized indices for both triggerings of the QP axiom:
and
My modification defines a more general Skolem function for each quantified variable, taking applications of the heap-dependent function or predicate, in order to share witness indices. It substitutes these Skolem functions for the quantified variables in the LHS of the implication. For example:
We tested this on examples with heap-modifying statements both relevant and irrelevant to a given heap-dependent function application. We found that the verification times scale roughly with the number of relevant heap-modifying statements, whereas the original axiom scales with the total (relevant and irrelevant) number of heap-modifying statements.