Project

General

Profile

Revision 10

Added by Willibald K. over 8 years ago

restrict list casts to something useful - i.e. inner type sizes must not change; this is in preparation for faster dynamic list support in momut; deep casts now need to be done manually by the user via fold operations or can be added again to the ooas compiler as a more expensive, special cast operator; also more cleaning of Qualitative Action System stuff

View differences:

OoaPrologSymbolicExpression.java
126 126
		case minus:  // T_MINUS:
127 127
			return "-";
128 128
		case less:
129
			return resultingType.kind() == TypeKind.QrType || !isNumericBinary(expression) ? "<" : "#<";
129
			return !isNumericBinary(expression) ? "<" : "#<";
130 130
		case lessequal:
131
			return resultingType.kind() == TypeKind.QrType || !isNumericBinary(expression) ? "=<" : "#=<";
131
			return !isNumericBinary(expression) ? "=<" : "#=<";
132 132
		case greater:
133
			return resultingType.kind() == TypeKind.QrType || !isNumericBinary(expression) ? ">" : "#>";
133
			return !isNumericBinary(expression) ? ">" : "#>";
134 134
		case greaterequal:
135
			return resultingType.kind() == TypeKind.QrType || !isNumericBinary(expression) ? ">=" : "#>=";
135
			return !isNumericBinary(expression) ? ">=" : "#>=";
136 136
		case equal:
137
			return resultingType.kind() == TypeKind.QrType ? "==" : "#=";
137
			return "#=";
138 138
		case notequal:
139
			return resultingType.kind() == TypeKind.QrType || !isNumericBinary(expression) ? "\\=" : "#\\=";
139
			return !isNumericBinary(expression) ? "\\=" : "#\\=";
140 140
		case and:    // T_AND:
141 141
			throw new NotImplementedException(); // implemented in binaryoperator
142 142
		case or:     // T_OR:
......
360 360
		default:
361 361
			m_emitter.Append(leftcode.toString());
362 362
			m_emitter.Append(rightcode.toString());
363
			if (binaryOperator.left().type().kind() == TypeKind.QrType)
364
				m_emitter.Append("qEval");
365 363

  
366 364
			//do not use #= for assignments in the symbolic backend
367 365
			m_emitter.AppendLine(String.format(" %s = (%s %s %s), ",

Also available in: Unified diff