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.Name;
14: import de.uka.ilkd.key.logic.PosInOccurrence;
15: import de.uka.ilkd.key.proof.Goal;
16: import de.uka.ilkd.key.rule.TacletApp;
17: import de.uka.ilkd.key.strategy.termProjection.ProjectionToTerm;
18: import de.uka.ilkd.key.strategy.termProjection.SVInstantiationProjection;
19:
20: /**
21: * Feature that returns zero iff a certain schema variable is instantiated (or
22: * does not occur in the taclet at hand)
23: */
24: public class InstantiatedSVFeature extends BinaryTacletAppFeature {
25:
26: private final ProjectionToTerm instProj;
27:
28: public static Feature create(Name svName) {
29: return new InstantiatedSVFeature(svName);
30: }
31:
32: private InstantiatedSVFeature(Name svName) {
33: instProj = SVInstantiationProjection.create(svName, false);
34: }
35:
36: protected boolean filter(TacletApp app, PosInOccurrence pos,
37: Goal goal) {
38: return instProj.toTerm(app, pos, goal) != null;
39: }
40:
41: }
|