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.logic;
12:
13: /**
14: * This class is used to hold information about modified formulas.
15: * @see SequentChangeInfo
16: */
17: public class FormulaChangeInfo {
18: /** position within the original formula */
19: private final PosInOccurrence positionOfModification;
20: /** modified formula */
21: private final ConstrainedFormula newFormula;
22:
23: public FormulaChangeInfo(PosInOccurrence positionOfModification,
24: ConstrainedFormula newFormula) {
25: this .newFormula = newFormula;
26: this .positionOfModification = positionOfModification;
27: }
28:
29: public ConstrainedFormula getNewFormula() {
30: return newFormula;
31: }
32:
33: public ConstrainedFormula getOriginalFormula() {
34: return getPositionOfModification().constrainedFormula();
35: }
36:
37: /**
38: * @return position within the original formula
39: */
40: public PosInOccurrence getPositionOfModification() {
41: return positionOfModification;
42: }
43:
44: public String toString() {
45: return "Replaced " + positionOfModification + " with "
46: + newFormula;
47: }
48: }
|