@Override public boolean check(ValidationContext ctx, Constraint c) { if (c.isSetMath()) { return c.getMath().isBoolean(); } return true; } };
@Override public boolean check(ValidationContext ctx, ASTNode node) { // We don't validate inside FunctionDefinition if (node.getParentSBMLObject() instanceof FunctionDefinition) { return true; } // In logical operators... if (node.isLogical()) { // all children must be booleans for (ASTNode n : node.getChildren()) { if (!n.isBoolean()) { return false; } } } return true; } };
UnitDefinition def = child.compile(unitsCompiler).getUnits(); if (!def.isInvalid() && (! (def.isVariantOfDimensionless() || (ctx.isLevelAndVersionGreaterEqualThan(3, 2) && child.isBoolean())))) { return false;
else if (compiled.isBoolean()) { compiled.setValue(compiled.getInteger() == 1 ? 0 : 1);
/** * @param value */ private void notRecursive(ASTNode value) { for (int i = 0; i < value.getChildCount(); i++) { value.getChild(i).compile(this); ASTNode child = getNode(); if (child.isVector()) { notRecursive(value.getChild(i)); } else if (useId){ ASTNode notValue = new ASTNode(ASTNode.Type.LOGICAL_NOT, child.getParentSBMLObject()); notValue.addChild(child.clone()); value.replaceChild(i, notValue); } else if (child.isBoolean()) { value.getChild(i).setValue(child.getInteger() == 1 ? 0 : 1); } else { throw new SBMLException(); } } }
return body.isBoolean() || body.isNumber() || body.isFunction() ||
if (node.isBoolean()) { return DT_BOOLEAN;