public final class SmtTextBuilder extends java.lang.Object implements ExprTreeVisitor
TreeVisitor.Status
Modifier and Type | Method and Description |
---|---|
int[] |
getOperandOrder()
Returns an array of operand indexes that specify in which order the operands of
the currently visited operator should be visited.
|
TreeVisitor.Status |
getStatus()
Returns the current status of the visitor.
|
void |
onBegin()
Notifies that processing of a hierarchical structure has been started.
|
void |
onBindingBegin(NodeBinding node)
Starts visiting a binding node.
|
void |
onBindingEnd(NodeBinding node)
Finishes visiting a binding node.
|
void |
onBindingListEnd(NodeBinding node)
Notifies that visiting a bound variables list finished.
|
void |
onBoundVariableBegin(NodeBinding node,
NodeVariable variable,
Node value)
Notifies that visiting a bound variable has started.
|
void |
onBoundVariableEnd(NodeBinding node,
NodeVariable variable,
Node value)
Notifies that visiting a bound variable has finished.
|
void |
onEnd()
Notifies that processing of a hierarchical structure has been finished.
|
void |
onOperandBegin(NodeOperation expr,
Node node,
int index)
Notifies that visiting an expression operand has started.
|
void |
onOperandEnd(NodeOperation expr,
Node node,
int index)
Notifies that visiting an expression operand has finished.
|
void |
onOperationBegin(NodeOperation expr)
Starts visiting an operation node.
|
void |
onOperationEnd(NodeOperation expr)
Finishes visiting an operation node.
|
void |
onValue(NodeValue value)
Notifies that a value node has been visited.
|
void |
onVariable(NodeVariable variable)
Notifies that a variable node has been visited.
|
static void |
saveToFile(java.lang.String fileName,
java.util.List<java.lang.String> header,
java.util.Collection<? extends Node> formulas,
java.util.Map<java.lang.Enum<?>,SolverOperation> operations) |
void |
saveToFile(java.lang.String fileName,
java.lang.StringBuilder textBuilder)
Saves the generated SMT-LIB representation to a text file.
|
public static void saveToFile(java.lang.String fileName, java.util.List<java.lang.String> header, java.util.Collection<? extends Node> formulas, java.util.Map<java.lang.Enum<?>,SolverOperation> operations) throws java.io.IOException
java.io.IOException
public void saveToFile(java.lang.String fileName, java.lang.StringBuilder textBuilder) throws java.io.IOException
fileName
- The name of the target file.java.io.IOException
- if failed to create the output file.public TreeVisitor.Status getStatus()
TreeVisitor
getStatus
in interface TreeVisitor
public void onBegin()
TreeVisitor
onBegin
in interface TreeVisitor
public void onEnd()
TreeVisitor
onEnd
in interface TreeVisitor
public void onOperationBegin(NodeOperation expr)
ExprTreeVisitor
onOperationBegin
in interface ExprTreeVisitor
expr
- Operation node.public void onOperationEnd(NodeOperation expr)
ExprTreeVisitor
onOperationEnd
in interface ExprTreeVisitor
expr
- Operation node.public int[] getOperandOrder()
ExprTreeVisitor
null
is returned.getOperandOrder
in interface ExprTreeVisitor
null
for the standard order.public void onOperandBegin(NodeOperation expr, Node node, int index)
ExprTreeVisitor
onOperandBegin
in interface ExprTreeVisitor
expr
- Operation node.node
- Operand node.index
- Operand index.public void onOperandEnd(NodeOperation expr, Node node, int index)
ExprTreeVisitor
onOperandEnd
in interface ExprTreeVisitor
expr
- Operation node.node
- Operand node.index
- Operand index.public void onValue(NodeValue value)
ExprTreeVisitor
onValue
in interface ExprTreeVisitor
value
- Value node.public void onVariable(NodeVariable variable)
ExprTreeVisitor
onVariable
in interface ExprTreeVisitor
variable
- Variable node.public void onBindingBegin(NodeBinding node)
ExprTreeVisitor
onBindingBegin
in interface ExprTreeVisitor
node
- Binding node.public void onBindingListEnd(NodeBinding node)
ExprTreeVisitor
onBindingListEnd
in interface ExprTreeVisitor
node
- Bounding node.public void onBindingEnd(NodeBinding node)
ExprTreeVisitor
onBindingEnd
in interface ExprTreeVisitor
node
- Binding node.public void onBoundVariableBegin(NodeBinding node, NodeVariable variable, Node value)
ExprTreeVisitor
onBoundVariableBegin
in interface ExprTreeVisitor
node
- Binding node.variable
- Bound variable reference.value
- Bound value expression.public void onBoundVariableEnd(NodeBinding node, NodeVariable variable, Node value)
ExprTreeVisitor
onBoundVariableEnd
in interface ExprTreeVisitor
node
- Binding node.variable
- Bound variable reference.value
- Bound value expression.