Skip to content

Commit 594f407

Browse files
committed
smaller fixes in proof script treatment
1 parent 1209847 commit 594f407

4 files changed

Lines changed: 10 additions & 5 deletions

File tree

key.core/src/main/java/de/uka/ilkd/key/macros/ApplyScriptsMacro.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ public ProofMacroFinishedInfo applyTo(UserInterfaceControl uic, Proof proof,
170170
pse.getStateMap().putUserData("jml.obtainVarMap", obtainMap);
171171
pse.getStateMap().getValueInjector().addConverter(JTerm.class, ObtainAwareTerm.class,
172172
oat -> oat.resolve(obtainMap, goal.proof().getServices()));
173+
pse.getStateMap().getValueInjector().addConverter(boolean.class, ObtainAwareTerm.class,
174+
oat -> Boolean.parseBoolean(oat.term.toString()));
173175
LOGGER.debug("---- Script");
174176
LOGGER.debug(renderedProof.stream().map(ScriptCommandAst::asCommandLine)
175177
.collect(Collectors.joining("\n")));
@@ -335,11 +337,13 @@ private static ScriptCommandAst renderObtainCommand(ProofCmdContext ctx, Map<Par
335337
value = services.getTermBuilder().apply(update, (JTerm) value);
336338
}
337339
}
338-
ObtainAwareTerm wrapped = new ObtainAwareTerm((JTerm) value);
340+
if (value instanceof JTerm term) {
341+
value = new ObtainAwareTerm(term);
342+
}
339343
if (argContext.argLabel != null) {
340-
named.put(argContext.argLabel.getText(), wrapped);
344+
named.put(argContext.argLabel.getText(), value);
341345
} else {
342-
positional.add(wrapped);
346+
positional.add(value);
343347
}
344348
}
345349
return new ScriptCommandAst(ctx.cmd.getText(), named, positional,

key.core/src/main/java/de/uka/ilkd/key/proof/mgt/SpecificationRepository.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ private static Taclet getLimitedToUnlimitedTaclet(IObserverFunction limited,
173173
ImmutableSLList.nil(), unlimitedTerm));
174174
tacletBuilder.setName(
175175
MiscTools.toValidTacletName("unlimit " + getUniqueNameForObserver(unlimited)));
176+
//tacletBuilder.addRuleSet(new RuleSet(new Name("unlimitObserver")));
176177
return tacletBuilder.getTaclet();
177178
}
178179

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ private TacletApp makeRuleApp(Parameters p, EngineState state) throws ScriptExce
107107

108108
public static class Parameters {
109109
@Option(value = "on")
110-
public @Nullable Term on;
110+
public @Nullable JTerm on;
111111
@Option(value = "occ")
112112
public @Nullable Integer occ;
113113
@Option(value = "formula")

key.core/src/test/java/de/uka/ilkd/key/scripts/JmlScriptTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class JmlScriptTest {
3434
private static final Logger LOGGER = LoggerFactory.getLogger(JmlScriptTest.class);
3535

3636
// Set this to a specific case to only run that case for debugging
37-
private static final String ONLY_CASE = null;
37+
private static final String ONLY_CASE = "ObtainFromGoal.java";
3838

3939
static {
4040
URL url = JmlScriptTest.class.getResource("jml/project.key");

0 commit comments

Comments
 (0)