Skip to content

Commit fb7d09e

Browse files
committed
Do not copy preconditions of base spec to constrained spec
1 parent 1670345 commit fb7d09e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

prusti-interface/src/specs/typed.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,16 @@ impl SpecGraph<ProcedureSpecification> {
247247
) -> &mut ProcedureSpecification {
248248
self.specs_with_constraints
249249
.entry(constraint)
250-
.or_insert_with(|| self.base_spec.clone())
250+
.or_insert_with(|| {
251+
let mut base = self.base_spec.clone();
252+
253+
// Preconditions of the base spec do not appear in the constrained spec
254+
// Any preconditions that exist on the base spec are thus pruned
255+
// (see comment on impl block)
256+
base.pres = SpecificationItem::Empty;
257+
258+
base
259+
})
251260
}
252261

253262
/// Gets the constraint of a spec function `spec`.

0 commit comments

Comments
 (0)