|
|
|
@@ -41,39 +41,37 @@ struct PrintContext
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const BinaryOperation::Operator operator_, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const BinaryOperation &binaryOperation, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Boolean &boolean, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Comparison &comparison, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, Comparison::Operator operator_, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Constant &constant, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Function &function, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const In &in, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Integer &integer, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Interval &interval, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Predicate &predicate, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const SpecialInteger &specialInteger, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const String &string, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const UnaryOperation &unaryOperation, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Variable &variable, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const VariableDeclaration &variableDeclaration, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const BinaryOperation::Operator operator_, PrintContext &printContext);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const BinaryOperation &binaryOperation, PrintContext &printContext);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Boolean &boolean, PrintContext &printContext);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Comparison &comparison, PrintContext &printContext);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Constant &constant, PrintContext &printContext);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Function &function, PrintContext &printContext);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const In &in, PrintContext &printContext);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Integer &integer, PrintContext &printContext);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Interval &interval, PrintContext &printContext);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Predicate &predicate, PrintContext &printContext);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const SpecialInteger &specialInteger, PrintContext &printContext);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const String &string, PrintContext &printContext);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Variable &variable, PrintContext &printContext);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const VariableDeclaration &variableDeclaration, PrintContext &printContext);
|
|
|
|
|
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const And &and_, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Biconditional &biconditional, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Exists &exists, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const ForAll &forAll, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Implies &implies, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Not ¬_, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Or &or_, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const And &and_, PrintContext &printContext);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Biconditional &biconditional, PrintContext &printContext);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Exists &exists, PrintContext &printContext);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const ForAll &forAll, PrintContext &printContext);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Implies &implies, PrintContext &printContext);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Not ¬_, PrintContext &printContext);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Or &or_, PrintContext &printContext);
|
|
|
|
|
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Formula &formula, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Term &term, PrintContext &printContext, bool omitParentheses = false);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Formula &formula, PrintContext &printContext);
|
|
|
|
|
output::ColorStream &print(output::ColorStream &stream, const Term &term, PrintContext &printContext);
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
// Primitives
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, BinaryOperation::Operator operator_, PrintContext &, bool)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, BinaryOperation::Operator operator_, PrintContext &)
|
|
|
|
|
{
|
|
|
|
|
switch (operator_)
|
|
|
|
|
{
|
|
|
|
@@ -96,26 +94,22 @@ inline output::ColorStream &print(output::ColorStream &stream, BinaryOperation::
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const BinaryOperation &binaryOperation, PrintContext &printContext, bool omitParentheses)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const BinaryOperation &binaryOperation, PrintContext &printContext)
|
|
|
|
|
{
|
|
|
|
|
if (!omitParentheses || printContext.context.parenthesisStyle == ParenthesisStyle::Full)
|
|
|
|
|
stream << "(";
|
|
|
|
|
|
|
|
|
|
stream << "(";
|
|
|
|
|
print(stream, binaryOperation.left, printContext);
|
|
|
|
|
stream << " ";
|
|
|
|
|
print(stream, binaryOperation.operator_, printContext);
|
|
|
|
|
stream << " ";
|
|
|
|
|
print(stream, binaryOperation.right, printContext);
|
|
|
|
|
|
|
|
|
|
if (!omitParentheses || printContext.context.parenthesisStyle == ParenthesisStyle::Full)
|
|
|
|
|
stream << ")";
|
|
|
|
|
stream << ")";
|
|
|
|
|
|
|
|
|
|
return stream;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Boolean &boolean, PrintContext &, bool)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Boolean &boolean, PrintContext &)
|
|
|
|
|
{
|
|
|
|
|
if (boolean.value)
|
|
|
|
|
return (stream << output::Boolean("#true"));
|
|
|
|
@@ -125,7 +119,7 @@ inline output::ColorStream &print(output::ColorStream &stream, const Boolean &bo
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, Comparison::Operator operator_, PrintContext &, bool)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, Comparison::Operator operator_, PrintContext &)
|
|
|
|
|
{
|
|
|
|
|
switch (operator_)
|
|
|
|
|
{
|
|
|
|
@@ -148,7 +142,7 @@ inline output::ColorStream &print(output::ColorStream &stream, Comparison::Opera
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Comparison &comparison, PrintContext &printContext, bool)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Comparison &comparison, PrintContext &printContext)
|
|
|
|
|
{
|
|
|
|
|
if (printContext.context.parenthesisStyle == ParenthesisStyle::Full)
|
|
|
|
|
stream << "(";
|
|
|
|
@@ -167,14 +161,14 @@ inline output::ColorStream &print(output::ColorStream &stream, const Comparison
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Constant &constant, PrintContext &, bool)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Constant &constant, PrintContext &)
|
|
|
|
|
{
|
|
|
|
|
return (stream << constant.name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Function &function, PrintContext &printContext, bool)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Function &function, PrintContext &printContext)
|
|
|
|
|
{
|
|
|
|
|
stream << function.name;
|
|
|
|
|
|
|
|
|
@@ -201,7 +195,7 @@ inline output::ColorStream &print(output::ColorStream &stream, const Function &f
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const In &in, PrintContext &printContext, bool)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const In &in, PrintContext &printContext)
|
|
|
|
|
{
|
|
|
|
|
if (printContext.context.parenthesisStyle == ParenthesisStyle::Full)
|
|
|
|
|
stream << "(";
|
|
|
|
@@ -218,14 +212,14 @@ inline output::ColorStream &print(output::ColorStream &stream, const In &in, Pri
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Integer &integer, PrintContext &, bool)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Integer &integer, PrintContext &)
|
|
|
|
|
{
|
|
|
|
|
return (stream << output::Number<int>(integer.value));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Interval &interval, PrintContext &printContext, bool)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Interval &interval, PrintContext &printContext)
|
|
|
|
|
{
|
|
|
|
|
if (printContext.context.parenthesisStyle == ParenthesisStyle::Full)
|
|
|
|
|
stream << "(";
|
|
|
|
@@ -242,7 +236,7 @@ inline output::ColorStream &print(output::ColorStream &stream, const Interval &i
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Predicate &predicate, PrintContext &printContext, bool)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Predicate &predicate, PrintContext &printContext)
|
|
|
|
|
{
|
|
|
|
|
stream << predicate.name;
|
|
|
|
|
|
|
|
|
@@ -266,7 +260,7 @@ inline output::ColorStream &print(output::ColorStream &stream, const Predicate &
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const SpecialInteger &specialInteger, PrintContext &, bool)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const SpecialInteger &specialInteger, PrintContext &)
|
|
|
|
|
{
|
|
|
|
|
switch (specialInteger.type)
|
|
|
|
|
{
|
|
|
|
@@ -281,37 +275,14 @@ inline output::ColorStream &print(output::ColorStream &stream, const SpecialInte
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const String &string, PrintContext &, bool)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const String &string, PrintContext &)
|
|
|
|
|
{
|
|
|
|
|
return (stream << output::String(string.text.c_str()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const UnaryOperation &unaryOperation, PrintContext &printContext, bool)
|
|
|
|
|
{
|
|
|
|
|
switch (unaryOperation.operator_)
|
|
|
|
|
{
|
|
|
|
|
case UnaryOperation::Operator::Absolute:
|
|
|
|
|
stream << "|";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
print(stream, unaryOperation.argument, printContext, true);
|
|
|
|
|
|
|
|
|
|
switch (unaryOperation.operator_)
|
|
|
|
|
{
|
|
|
|
|
case UnaryOperation::Operator::Absolute:
|
|
|
|
|
stream << "|";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return stream;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Variable &variable, PrintContext &printContext, bool)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Variable &variable, PrintContext &printContext)
|
|
|
|
|
{
|
|
|
|
|
assert(variable.declaration != nullptr);
|
|
|
|
|
|
|
|
|
@@ -320,7 +291,7 @@ inline output::ColorStream &print(output::ColorStream &stream, const Variable &v
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const VariableDeclaration &variableDeclaration, PrintContext &printContext, bool)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const VariableDeclaration &variableDeclaration, PrintContext &printContext)
|
|
|
|
|
{
|
|
|
|
|
const auto printVariableDeclaration =
|
|
|
|
|
[&stream, &variableDeclaration](const auto *prefix, auto &variableIDs) -> output::ColorStream &
|
|
|
|
@@ -356,10 +327,9 @@ inline output::ColorStream &print(output::ColorStream &stream, const VariableDec
|
|
|
|
|
// Expressions
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const And &and_, PrintContext &printContext, bool omitParentheses)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const And &and_, PrintContext &printContext)
|
|
|
|
|
{
|
|
|
|
|
if (!omitParentheses || printContext.context.parenthesisStyle == ParenthesisStyle::Full)
|
|
|
|
|
stream << "(";
|
|
|
|
|
stream << "(";
|
|
|
|
|
|
|
|
|
|
for (auto i = and_.arguments.cbegin(); i != and_.arguments.cend(); i++)
|
|
|
|
|
{
|
|
|
|
@@ -369,32 +339,27 @@ inline output::ColorStream &print(output::ColorStream &stream, const And &and_,
|
|
|
|
|
print(stream, *i, printContext);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!omitParentheses || printContext.context.parenthesisStyle == ParenthesisStyle::Full)
|
|
|
|
|
stream << ")";
|
|
|
|
|
stream << ")";
|
|
|
|
|
|
|
|
|
|
return stream;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Biconditional &biconditional, PrintContext &printContext, bool omitParentheses)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Biconditional &biconditional, PrintContext &printContext)
|
|
|
|
|
{
|
|
|
|
|
if (!omitParentheses || printContext.context.parenthesisStyle == ParenthesisStyle::Full)
|
|
|
|
|
stream << "(";
|
|
|
|
|
|
|
|
|
|
stream << "(";
|
|
|
|
|
print(stream, biconditional.left, printContext);
|
|
|
|
|
stream << " <-> ";
|
|
|
|
|
print(stream, biconditional.right, printContext);
|
|
|
|
|
|
|
|
|
|
if (!omitParentheses || printContext.context.parenthesisStyle == ParenthesisStyle::Full)
|
|
|
|
|
stream << ")";
|
|
|
|
|
stream << ")";
|
|
|
|
|
|
|
|
|
|
return stream;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Exists &exists, PrintContext &printContext, bool)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Exists &exists, PrintContext &printContext)
|
|
|
|
|
{
|
|
|
|
|
if (printContext.context.parenthesisStyle == ParenthesisStyle::Full)
|
|
|
|
|
stream << "(";
|
|
|
|
@@ -420,7 +385,7 @@ inline output::ColorStream &print(output::ColorStream &stream, const Exists &exi
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const ForAll &forAll, PrintContext &printContext, bool)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const ForAll &forAll, PrintContext &printContext)
|
|
|
|
|
{
|
|
|
|
|
if (printContext.context.parenthesisStyle == ParenthesisStyle::Full)
|
|
|
|
|
stream << "(";
|
|
|
|
@@ -446,24 +411,20 @@ inline output::ColorStream &print(output::ColorStream &stream, const ForAll &for
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Implies &implies, PrintContext &printContext, bool omitParentheses)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Implies &implies, PrintContext &printContext)
|
|
|
|
|
{
|
|
|
|
|
if (!omitParentheses || printContext.context.parenthesisStyle == ParenthesisStyle::Full)
|
|
|
|
|
stream << "(";
|
|
|
|
|
|
|
|
|
|
stream << "(";
|
|
|
|
|
print(stream, implies.antecedent, printContext);
|
|
|
|
|
stream << " -> ";
|
|
|
|
|
print(stream, implies.consequent, printContext);
|
|
|
|
|
|
|
|
|
|
if (!omitParentheses || printContext.context.parenthesisStyle == ParenthesisStyle::Full)
|
|
|
|
|
stream << ")";
|
|
|
|
|
stream << ")";
|
|
|
|
|
|
|
|
|
|
return stream;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Not ¬_, PrintContext &printContext, bool)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Not ¬_, PrintContext &printContext)
|
|
|
|
|
{
|
|
|
|
|
if (printContext.context.parenthesisStyle == ParenthesisStyle::Full)
|
|
|
|
|
stream << "(";
|
|
|
|
@@ -479,10 +440,9 @@ inline output::ColorStream &print(output::ColorStream &stream, const Not ¬_,
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Or &or_, PrintContext &printContext, bool omitParentheses)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Or &or_, PrintContext &printContext)
|
|
|
|
|
{
|
|
|
|
|
if (!omitParentheses || printContext.context.parenthesisStyle == ParenthesisStyle::Full)
|
|
|
|
|
stream << "(";
|
|
|
|
|
stream << "(";
|
|
|
|
|
|
|
|
|
|
for (auto i = or_.arguments.cbegin(); i != or_.arguments.cend(); i++)
|
|
|
|
|
{
|
|
|
|
@@ -492,8 +452,7 @@ inline output::ColorStream &print(output::ColorStream &stream, const Or &or_, Pr
|
|
|
|
|
print(stream, *i, printContext);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!omitParentheses || printContext.context.parenthesisStyle == ParenthesisStyle::Full)
|
|
|
|
|
stream << ")";
|
|
|
|
|
stream << ")";
|
|
|
|
|
|
|
|
|
|
return stream;
|
|
|
|
|
}
|
|
|
|
@@ -506,24 +465,24 @@ template<class Variant>
|
|
|
|
|
struct VariantPrintVisitor
|
|
|
|
|
{
|
|
|
|
|
template<class T>
|
|
|
|
|
output::ColorStream &visit(const T &x, output::ColorStream &stream, PrintContext &printContext, bool omitParentheses)
|
|
|
|
|
output::ColorStream &visit(const T &x, output::ColorStream &stream, PrintContext &printContext)
|
|
|
|
|
{
|
|
|
|
|
return print(stream, x, printContext, omitParentheses);
|
|
|
|
|
return print(stream, x, printContext);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Formula &formula, PrintContext &printContext, bool omitParentheses)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Formula &formula, PrintContext &printContext)
|
|
|
|
|
{
|
|
|
|
|
return formula.accept(VariantPrintVisitor<Formula>(), stream, printContext, omitParentheses);
|
|
|
|
|
return formula.accept(VariantPrintVisitor<Formula>(), stream, printContext);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Term &term, PrintContext &printContext, bool omitParentheses)
|
|
|
|
|
inline output::ColorStream &print(output::ColorStream &stream, const Term &term, PrintContext &printContext)
|
|
|
|
|
{
|
|
|
|
|
return term.accept(VariantPrintVisitor<Term>(), stream, printContext, omitParentheses);
|
|
|
|
|
return term.accept(VariantPrintVisitor<Term>(), stream, printContext);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|