Skip to content

Commit b44bff9

Browse files
mattulbrichwadoon
authored andcommitted
updating a few of the script commands
1 parent cba39b4 commit b44bff9

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,11 @@ private TacletApp instantiateTacletApp(final Parameters p, final EngineState sta
144144
ImmutableList<TacletApp> assumesCandidates = theApp
145145
.findIfFormulaInstantiations(state.getFirstOpenAutomaticGoal().sequent(), services);
146146

147-
assumesCandidates = ImmutableList.fromList(filterList(p, assumesCandidates));
147+
assumesCandidates = ImmutableList.fromList(filterList(services, p, assumesCandidates));
148148

149-
if (assumesCandidates.size() != 1) {
149+
if (assumesCandidates.size() == 0) {
150+
throw new ScriptException("No \\assumes instantiation");
151+
} else if (assumesCandidates.size() != 1) {
150152
throw new ScriptException("Not a unique \\assumes instantiation");
151153
}
152154

@@ -244,7 +246,7 @@ private IBuiltInRuleApp builtInRuleApp(Parameters p, EngineState state, BuiltInR
244246
private TacletApp findTacletApp(Parameters p, EngineState state) throws ScriptException {
245247

246248
ImmutableList<TacletApp> allApps = findAllTacletApps(p, state);
247-
List<TacletApp> matchingApps = filterList(p, allApps);
249+
List<TacletApp> matchingApps = filterList(state.getProof().getServices(), p, allApps);
248250

249251
if (matchingApps.isEmpty()) {
250252
throw new ScriptException("No matching applications.");
@@ -363,7 +365,7 @@ private static String formatTermString(String str) {
363365
/*
364366
* Filter those apps from a list that are according to the parameters.
365367
*/
366-
private List<TacletApp> filterList(Parameters p, ImmutableList<TacletApp> list) {
368+
private List<TacletApp> filterList(Services services, Parameters p, ImmutableList<TacletApp> list) {
367369
List<TacletApp> matchingApps = new ArrayList<>();
368370
for (TacletApp tacletApp : list) {
369371
if (tacletApp instanceof PosTacletApp pta) {

0 commit comments

Comments
 (0)