/* LogicStatement -- Automatically generated by TreeBuilder (2024-10-27T16:47Z) */ package de.uni_freiburg.informatik.ultimate.model.acsl.ast; import java.util.List; import java.util.Arrays; import de.uni_freiburg.informatik.ultimate.model.acsl.ACSLNode; /** * LogicDefinition * TODO: Not sure if this works like that. */ public abstract class LogicStatement extends ACSLNode { private static final java.util.function.Predicate VALIDATOR = ACSLNode.VALIDATORS.get(LogicStatement.class); /** * The poly id of this logic statement. */ PolyIdentifier polyId; /** * The parameters of this logic statement. */ Parameter[] parameters; /** * The constructor taking initial values. * @param polyId the poly id of this logic statement. */ public LogicStatement(PolyIdentifier polyId) { super(); this.polyId = polyId; assert VALIDATOR == null || VALIDATOR.test(this) : "Invalid LogicStatement: " + this; } /** * The constructor taking initial values. * @param polyId the poly id of this logic statement. * @param parameters the parameters of this logic statement. */ public LogicStatement(PolyIdentifier polyId, Parameter[] parameters) { super(); this.polyId = polyId; this.parameters = parameters; assert VALIDATOR == null || VALIDATOR.test(this) : "Invalid LogicStatement: " + this; } /** * Returns a textual description of this object. */ public String toString() { StringBuffer sb = new StringBuffer(); sb.append("LogicStatement").append('['); sb.append(polyId); sb.append(','); if (parameters == null) { sb.append("null"); } else { sb.append('['); for(int i1 = 0; i1 < parameters.length; i1++) { if (i1 > 0) sb.append(','); sb.append(parameters[i1]); } sb.append(']'); } return sb.append(']').toString(); } /** * Gets the poly id of this logic statement. * @return the poly id of this logic statement. */ public PolyIdentifier getPolyId() { return polyId; } /** * Gets the parameters of this logic statement. * @return the parameters of this logic statement. */ public Parameter[] getParameters() { return parameters; } public List getOutgoingNodes() { List children = super.getOutgoingNodes(); children.add(polyId); if(parameters!=null){ children.addAll(Arrays.asList(parameters)); } return children; } public abstract void accept(ACSLVisitor visitor); public abstract LogicStatement accept(ACSLTransformer visitor); }