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.termfeature;
12:
13: import de.uka.ilkd.key.logic.Term;
14: import de.uka.ilkd.key.strategy.termProjection.TermBuffer;
15:
16: /**
17: * Term feature for testing equality of two terms. The feature returns zero iff
18: * it is invoked on a term that is equal to the current value of
19: * <code>pattern</code>.
20: *
21: * NB: it is not possible to use general <code>ProjectionToTerm</code> here,
22: * because the information necessary to evaluate a <code>ProjectionToTerm</code>
23: * is not available in a term feature
24: */
25: public class EqTermFeature extends BinaryTermFeature {
26:
27: private final TermBuffer pattern;
28:
29: public static TermFeature create(TermBuffer pattern) {
30: return new EqTermFeature(pattern);
31: }
32:
33: private EqTermFeature(TermBuffer pattern) {
34: this .pattern = pattern;
35: }
36:
37: protected boolean filter(Term term) {
38: return term.equals(pattern.getContent());
39: }
40: }
|