Skip to content

Commit b4ad14d

Browse files
committed
Merge branch 'master' into meilers_debugger_update
2 parents 0a24eac + 140125d commit b4ad14d

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

src/main/scala/rules/QuantifiedChunkSupport.scala

+13-7
Original file line numberDiff line numberDiff line change
@@ -1981,11 +1981,11 @@ object quantifiedChunkSupporter extends QuantifiedChunkSupport {
19811981
case qfc: QuantifiedFieldChunk if qfc.invs.isDefined =>
19821982
Left(qfc.invs.get.invertibles, qfc.quantifiedVars, qfc.condition)
19831983
case qfc: QuantifiedFieldChunk if qfc.singletonArguments.isDefined =>
1984-
Right(qfc.singletonArguments.get)
1984+
Right(qfc.singletonArguments.get, qfc.condition)
19851985
case qpc: QuantifiedPredicateChunk if qpc.invs.isDefined =>
19861986
Left(qpc.invs.get.invertibles, qpc.quantifiedVars, qpc.condition)
19871987
case qpc: QuantifiedPredicateChunk if qpc.singletonArguments.isDefined =>
1988-
Right(qpc.singletonArguments.get)
1988+
Right(qpc.singletonArguments.get, qpc.condition)
19891989
case _ => return None
19901990
}
19911991
val relevantChunks: Iterable[QuantifiedBasicChunk] = chunks.flatMap {
@@ -1995,19 +1995,25 @@ object quantifiedChunkSupporter extends QuantifiedChunkSupport {
19951995

19961996
val (receiverTerms, quantVars, cond) = lr match {
19971997
case Left(tuple) => tuple
1998-
case Right(singletonArguments) =>
1998+
case Right((singletonArguments, cond)) =>
19991999
return relevantChunks.find { ch =>
20002000
val chunkInfo = ch match {
20012001
case qfc: QuantifiedFieldChunk if qfc.singletonArguments.isDefined =>
2002-
Some(qfc.singletonArguments.get)
2002+
Some(qfc.singletonArguments.get, qfc.condition)
20032003
case qpc: QuantifiedPredicateChunk if qpc.singletonArguments.isDefined =>
2004-
Some(qpc.singletonArguments.get)
2004+
Some(qpc.singletonArguments.get, qpc.condition)
20052005
case _ => None
20062006
}
20072007
chunkInfo match {
2008-
case Some(cSingletonArguments) =>
2008+
case Some((cSingletonArguments, cCond)) =>
2009+
20092010
val equalityTerm = And(singletonArguments.zip(cSingletonArguments).map { case (a, b) => a === b })
2010-
val result = v.decider.check(equalityTerm, Verifier.config.checkTimeout())
2011+
// The conditions of two chunks with the same receivers can differ if they originate from separate branches
2012+
// that were joined. In such cases, additional conjuncts might have been added to the conditions.
2013+
// Hence, we need to compare the conditions for equality in addition to verifying that the receivers match.
2014+
val equalityCond = And(cond.replace(chunk.quantifiedVars, singletonArguments),
2015+
cCond.replace(ch.quantifiedVars, cSingletonArguments))
2016+
val result = v.decider.check(And(equalityCond, equalityTerm), Verifier.config.checkTimeout())
20112017
if (result) {
20122018
// Learn the equality
20132019
val debugExp = Option.when(withExp)(DebugExp.createInstance("Chunks alias", true))

0 commit comments

Comments
 (0)