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.termProjection;
12:
13: import java.math.BigInteger;
14:
15: import de.uka.ilkd.key.java.Services;
16: import de.uka.ilkd.key.logic.LexPathOrdering;
17: import de.uka.ilkd.key.logic.Term;
18: import de.uka.ilkd.key.rule.metaconstruct.arith.Monomial;
19:
20: public class MonomialColumnOp extends
21: AbstractDividePolynomialsProjection {
22:
23: private MonomialColumnOp(ProjectionToTerm leftCoefficient,
24: ProjectionToTerm polynomial) {
25: super (leftCoefficient, polynomial);
26: }
27:
28: public static ProjectionToTerm create(
29: ProjectionToTerm leftCoefficient,
30: ProjectionToTerm polynomial) {
31: return new MonomialColumnOp(leftCoefficient, polynomial);
32: }
33:
34: protected Term divide(Monomial numerator, BigInteger denominator,
35: Services services) {
36: final BigInteger newRightCoeff = LexPathOrdering.divide(
37: numerator.getCoefficient(), denominator);
38: return numerator.setCoefficient(newRightCoeff).toTerm(services);
39: }
40: }
|