Skip to content

Commit

Permalink
Do not copy preconditions of base spec to constrained spec
Browse files Browse the repository at this point in the history
  • Loading branch information
vl0w committed Apr 28, 2022
1 parent ce90b13 commit e9419cd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion prusti-interface/src/specs/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,16 @@ impl SpecGraph<ProcedureSpecification> {
) -> &mut ProcedureSpecification {
self.specs_with_constraints
.entry(constraint)
.or_insert_with(|| self.base_spec.clone())
.or_insert_with(|| {
let mut base = self.base_spec.clone();

// Preconditions of the base spec do not appear in the constrained spec
// Any preconditions that exist on the base spec are thus pruned
// (see comment on impl block)
base.pres = SpecificationItem::Empty;

base
})
}

/// Gets the constraint of a spec function `spec`.
Expand Down

0 comments on commit e9419cd

Please sign in to comment.