Skip to content

Commit 2382655

Browse files
committed
making sure that cuts work with boolean terms instead of formulas.
1 parent 15bd146 commit 2382655

2 files changed

Lines changed: 26 additions & 2 deletions

File tree

key.core/src/main/java/de/uka/ilkd/key/scripts/CutCommand.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ static void execute(EngineState state, Parameters args) throws ScriptException {
5151
TacletApp app = NoPosTacletApp.createNoPosTacletApp(cut);
5252
SchemaVariable sv = app.uninstantiatedVars().iterator().next();
5353

54-
app = app.addCheckedInstantiation(sv, args.formula,
55-
state.getProof().getServices(), true);
54+
var formula = state.getProof().getServices().getTermBuilder().convertToFormula(args.formula);
55+
56+
app = app.addCheckedInstantiation(sv, formula, state.getProof().getServices(), true);
5657
state.getFirstOpenAutomaticGoal().apply(app);
5758
}
5859

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//! settings:
2+
//! CLASS_AXIOM_OPTIONS_KEY: CLASS_AXIOM_OFF
3+
4+
// Was a bug:
5+
// Instantiation Test::pred(heap,self,int::select(heap,self,Test::$f)) of cutFormula (formula) does not satisfy the variable conditions
6+
7+
class Test {
8+
9+
//@ model boolean pred(int x) { return x > 20; }
10+
11+
int f;
12+
13+
//@ requires pred(f);
14+
//@ ensures f > 2;
15+
void test() {
16+
int x;
17+
/*@ assert f > 2 \by {
18+
assert pred(f) \by { auto classAxioms:true; }
19+
auto; // should not be necessary ... eventually removed
20+
} */
21+
}
22+
23+
}

0 commit comments

Comments
 (0)