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: package de.uka.ilkd.key.rule.updatesimplifier;
10:
11: import de.uka.ilkd.key.logic.Term;
12: import de.uka.ilkd.key.rule.AbstractUpdateRule;
13: import de.uka.ilkd.key.rule.UpdateSimplifier;
14:
15: /**
16: * Abstract update simplification rule for access operators.
17: * @author bubel
18: */
19: public abstract class ApplyOnAccessTerm extends AbstractUpdateRule {
20:
21: /**
22: * @param updateSimplifier
23: */
24: public ApplyOnAccessTerm(UpdateSimplifier updateSimplifier) {
25: super (updateSimplifier);
26: }
27:
28: protected static Term compareObjects(Term o1, Term o2) {
29: // compare the objects only if the sorts are compatible; this is
30: // probably inconsistent with the new typed first-order basis of
31: // KeY, TODO /PR
32: final UpdateSimplifierTermFactory utf = UpdateSimplifierTermFactory.DEFAULT;
33: if (o1.sort().extendsTrans(o2.sort())
34: || o2.sort().extendsTrans(o1.sort()))
35: return utf.getBasicTermFactory().createEqualityTerm(o1, o2);
36: else
37: return utf.getUnsatisfiableGuard();
38: }
39:
40: }
|