Commit 64345eb1 authored by Matthew Dawson's avatar Matthew Dawson
Browse files

In CVC3ExpressionGenerator, rename OpTypeForVariableType to OpTypeForOpAndType.

Rename the given function, to match the VariableType change, along with making
the name more descriptive.
parent 7c467ed6
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ final public class CVC3ExpressionGenerator implements ExpressionGenerator {
    }

    public static String ConvertToOutputOp(BinaryOperation op, Type type) {
        switch (OpTypeForVariableType(op, type)) {
        switch (OpTypeForOpAndType(op, type)) {
            case Function:
                String func = GetSignedFixedPointFunctionFor(op);
                if (!((FixedPointType) type).isSigned()) {
@@ -119,7 +119,7 @@ final public class CVC3ExpressionGenerator implements ExpressionGenerator {
        }
    }

    private static OperationType OpTypeForVariableType(BinaryOperation op, Type type) {
    private static OperationType OpTypeForOpAndType(BinaryOperation op, Type type) {
        if (type instanceof FixedPointType && op != BinaryOperation.Equals && op != BinaryOperation.NotEquals) {
            if (op == BinaryOperation.Exponentiation) {
                throw new IllegalArgumentException("Cannot generate exponential functions in fixed point!");
@@ -132,7 +132,7 @@ final public class CVC3ExpressionGenerator implements ExpressionGenerator {

    @Override
    public String GenerateBinaryOperation(BinaryOperation op, String lhsExp, String rhsExp, Type usedType) {
        switch (CVC3ExpressionGenerator.OpTypeForVariableType(op, usedType)) {
        switch (CVC3ExpressionGenerator.OpTypeForOpAndType(op, usedType)) {
            case CenterOp:
                return "(" + lhsExp + " " + CVC3ExpressionGenerator.ConvertToOutputOp(op, usedType) + " " + rhsExp + ")";
            case Function:
@@ -154,7 +154,7 @@ final public class CVC3ExpressionGenerator implements ExpressionGenerator {

    @Override
    public String GenerateUnaryOperation(UnaryOperation op, String expression, Type usedType) {
        switch (CVC3ExpressionGenerator.OpTypeForVariableType(op, usedType)) {
        switch (CVC3ExpressionGenerator.OpTypeForOpAndType(op, usedType)) {
            case PrefixOp:
                return "(" + CVC3ExpressionGenerator.ConvertToOutputOp(op, usedType) + " " + expression + ")";
            case Function:
@@ -164,7 +164,7 @@ final public class CVC3ExpressionGenerator implements ExpressionGenerator {
        }
    }

    private static OperationType OpTypeForVariableType(UnaryOperation op, Type usedType) {
    private static OperationType OpTypeForOpAndType(UnaryOperation op, Type usedType) {
        if (usedType instanceof FixedPointType) {
            return OperationType.Function;
        }