01: // This file is part of KeY - Integrated Deductive Software Design
02: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
03: // Universitaet Koblenz-Landau, Germany
04: // Chalmers University of Technology, Sweden
05: //
06: // The KeY system is protected by the GNU General Public License.
07: // See LICENSE.TXT for details.
08: //
09: //
10:
11: package de.uka.ilkd.key.strategy.feature;
12:
13: import de.uka.ilkd.key.logic.PosInOccurrence;
14: import de.uka.ilkd.key.logic.op.IteratorOfSchemaVariable;
15: import de.uka.ilkd.key.logic.op.SetOfSchemaVariable;
16: import de.uka.ilkd.key.proof.Goal;
17: import de.uka.ilkd.key.rule.TacletApp;
18:
19: /**
20: * Feature that returns zero iff the given rule app is a taclet app that needs
21: * explicit instantiation of schema variables (which has not been done yet)
22: */
23: public class TacletRequiringInstantiationFeature extends
24: BinaryTacletAppFeature {
25:
26: public final static Feature INSTANCE = new TacletRequiringInstantiationFeature();
27:
28: private TacletRequiringInstantiationFeature() {
29: super (false);
30: }
31:
32: protected boolean filter(TacletApp app, PosInOccurrence pos,
33: Goal goal) {
34: final SetOfSchemaVariable neededVars = app
35: .neededUninstantiatedVars();
36: final SetOfSchemaVariable ifFindVars = app.taclet()
37: .getIfFindVariables();
38: final IteratorOfSchemaVariable it = neededVars.iterator();
39: while (it.hasNext()) {
40: if (!ifFindVars.contains(it.next()))
41: return true;
42: }
43: return false;
44: }
45: }
|