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: * Feature that computes the age of the goal (i.e. total number of rules
21: * applications that have been performed at the goal) to which a rule is
22: * supposed to be applied
23: */
24: public class AgeFeature implements Feature {
25:
26: public static final Feature INSTANCE = new AgeFeature();
27:
28: private AgeFeature() {
29: }
30:
31: public RuleAppCost compute(RuleApp app, PosInOccurrence pos,
32: Goal goal) {
33: return LongRuleAppCost.create(goal.getTime());
34: // return LongRuleAppCost.create ( goal.getTime() / goal.sequent ().size () );
35: // return LongRuleAppCost.create ( (long)Math.sqrt ( goal.getTime () ) );
36: }
37:
38: }
|