Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add source tracking in VCGenerator #3010

Merged
merged 4 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .unreleased/bug-fixes/source-tracking-in-vcgen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix source tracking in `VCGenerator` to avoid spurious diagnostic messages, see #3010
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ class VCGenerator(tracker: TransformationTracker) extends LazyLogging {
val notBody = tla.not(tla.fromTlaEx(copy.deepCopyEx(body))).typed(BoolT1)
val negative =
TlaOperDecl(NormalizedNames.VC_NOT_TRACE_INV_PREFIX + "0", params, notBody)(traceInv.typeTag)
// track the changes
tracker.hold(body, positive.body)
tracker.hold(body, negative.body)
TlaModule(module.name, module.declarations :+ positive :+ negative)

case Some(decl: TlaOperDecl) =>
Expand Down Expand Up @@ -166,7 +169,10 @@ class VCGenerator(tracker: TransformationTracker) extends LazyLogging {
expr

case (nameEx, set) :: tail =>
decorateWithUniversals(tail, tla.forall(nameEx, set, expr).typed(BoolT1))
val withForall = tla.forall(nameEx, set, expr).typed(BoolT1)
// remember the source of the change
tracker.hold(expr, withForall)
decorateWithUniversals(tail, withForall)
}
}
}
Loading