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.proof.Goal;
15: import de.uka.ilkd.key.rule.RuleApp;
16: import de.uka.ilkd.key.strategy.LongRuleAppCost;
17: import de.uka.ilkd.key.strategy.RuleAppCost;
18:
19: /**
20: * A feature that computes the depth of the find-position of a taclet (top-level
21: * positions have depth zero)
22: *
23: * TODO: eliminate this class and use term features instead
24: */
25: public class FindDepthFeature implements Feature {
26:
27: public static final Feature INSTANCE = new FindDepthFeature();
28:
29: private FindDepthFeature() {
30: }
31:
32: public RuleAppCost compute(RuleApp app, PosInOccurrence pos,
33: Goal goal) {
34: assert pos != null : "Feature is only applicable to rules with find";
35:
36: return LongRuleAppCost.create(pos.depth());
37: }
38:
39: }
|