@Override protected DSHandle value(AbstractDataNode v1, AbstractDataNode v2) { DSHandle r = NodeFactory.newRoot(Field.GENERIC_BOOLEAN, getBool(this, v1) || getBool(this, v2)); logBinaryProvenance("or", v1, v2, r); return r; }
@Override protected DSHandle value(AbstractDataNode v1, AbstractDataNode v2) { Type t = type(v1, v2); DSHandle r; try { if (t == Types.INT) { r = NodeFactory.newRoot(Field.GENERIC_INT, getInt(this, v1) % getInt(this, v2)); } else { r = NodeFactory.newRoot(Field.GENERIC_FLOAT, getFloat(this, v1) % getFloat(this, v2)); } logBinaryProvenance("remainder", v1, v2, r); return r; } catch (DependentException e) { return NodeFactory.newRoot(Field.Factory.getImmutableField("?", t), e); } }
@Override protected DSHandle value(AbstractDataNode v1, AbstractDataNode v2) { DSHandle r = NodeFactory.newRoot(Field.GENERIC_FLOAT, getFloat(this, v1) / getFloat(this, v2)); logBinaryProvenance("fquotient", v1, v2, r); return r; }
@Override protected DSHandle value(AbstractDataNode v1, AbstractDataNode v2) { Type t = type(v1, v2); DSHandle r; try { if (t == Types.STRING) { r = NodeFactory.newRoot( Field.GENERIC_STRING, StringCache.intern( (String.valueOf(v1.getValue()) + String.valueOf(v2.getValue())))); } else if (t == Types.INT) { r = NodeFactory.newRoot(Field.GENERIC_INT, getInt(this, v1) + getInt(this, v2)); } else { r = NodeFactory.newRoot(Field.GENERIC_FLOAT, getFloat(this, v1) + getFloat(this, v2)); } logBinaryProvenance("sum", v1, v2, r); return r; } catch (DependentException e) { return NodeFactory.newRoot(Field.Factory.getImmutableField("?", t), e); } }
@Override protected DSHandle value(AbstractDataNode v) { DSHandle r = NodeFactory.newRoot(Field.GENERIC_INT, getInt(this, v) + 1); return r; }
@Override protected DSHandle value(AbstractDataNode v) { DSHandle r = NodeFactory.newRoot(Field.GENERIC_BOOLEAN, !getBool(this, v)); logUnaryProvenance("not", v, r); return r; }
@Override protected DSHandle value(AbstractDataNode v1, AbstractDataNode v2) { DSHandle r = NodeFactory.newRoot(Field.GENERIC_BOOLEAN, !v1.getValue().equals(v2.getValue())); logBinaryProvenance("ne", v1, v2, r); return r; }