diff --git a/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/translation/JMLSpecFactory.java b/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/translation/JMLSpecFactory.java index 5653bfbb809..b7c88be66eb 100644 --- a/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/translation/JMLSpecFactory.java +++ b/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/translation/JMLSpecFactory.java @@ -926,10 +926,13 @@ public ImmutableSet createFunctionalOperationContracts(String name, IP result = result.add(contract); } else { // create two contracts for each diamond and box modality + Map boxPres = new LinkedHashMap<>(pres); for (LocationVariable heap : services.getTypeConverter().getHeapLDT().getAllHeaps()) { if (clauses.requires.get(heap) != null) { + var div = tb.convertToFormula(clauses.diverges); pres.put(heap, - tb.andSC(pres.get(heap), tb.not(tb.convertToFormula(clauses.diverges)))); + tb.andSC(pres.get(heap), tb.not(div))); + boxPres.put(heap, tb.andSC(boxPres.get(heap), div)); break; } } @@ -938,7 +941,7 @@ public ImmutableSet createFunctionalOperationContracts(String name, IP clauses.assignables, clauses.assignablesFree, clauses.accessibles, clauses.hasMod, clauses.hasFreeMod, progVars); contract1 = cf.addGlobalDefs(contract1, abbrvLhs); - FunctionalOperationContract contract2 = cf.func(name, pm, false, clauses.requires, + FunctionalOperationContract contract2 = cf.func(name, pm, false, boxPres, clauses.requiresFree, clauses.measuredBy, posts, clauses.ensuresFree, axioms, clauses.assignables, clauses.assignablesFree, clauses.accessibles, clauses.hasMod, clauses.hasFreeMod, progVars);