dlinear  0.0.1
Delta-complete SMT solver for linear programming
Loading...
Searching...
No Matches
dlinear::PrefixPrinter Class Reference

Print expressions and formulas in prefix-form. More...

#include <PrefixPrinter.h>

Inheritance diagram for dlinear::PrefixPrinter:
dlinear::GenericFormulaVisitor< std::ostream & > dlinear::GenericExpressionVisitor< std::ostream & >

Public Member Functions

 PrefixPrinter (std::ostream &os, const Config &config=Config{})
 Constructs a new PrefixPrinter object with os.
 
 ~PrefixPrinter () override
 Restore the original precision of the ostream.
 
std::ostream & Print (const Expression &e) const
 Print the prefix form of the expression e to the ostream.
 
std::ostream & Print (const Formula &f) const
 Print the prefix form of the formula f to the ostream.
 
- Public Member Functions inherited from dlinear::GenericFormulaVisitor< std::ostream & >
const IterationStatsstats () const
 Get read-only access to the statistics of the FormulaVisitor.
 
const Configconfig () const
 Get read-only access to the configuration of the FormulaVisitor.
 
- Public Member Functions inherited from dlinear::GenericExpressionVisitor< std::ostream & >
const IterationStatsstats () const
 Get read-only access to the statistics of the GenericExpressionVisitor.
 
const Configconfig () const
 Get read-only access to the configuration of the GenericExpressionVisitor.
 

Private Attributes

std::ostream & os_
 Stream to print to.
 
const std::streamsize old_precision_
 Original precision of the stream.
 

Additional Inherited Members

- Protected Member Functions inherited from dlinear::GenericFormulaVisitor< std::ostream & >
 GenericFormulaVisitor (const Config &config, const std::string &class_name="GenericFormulaVisitor")
 Construct a new FormulaVisitor object with the given config.
 
- Protected Attributes inherited from dlinear::GenericFormulaVisitor< std::ostream & >
const Configconfig_
 Configuration.
 
IterationStats stats_
 Statistics.
 
- Protected Attributes inherited from dlinear::GenericExpressionVisitor< std::ostream & >
const Configconfig_
 Configuration.
 
IterationStats stats_
 Statistics.
 

Detailed Description

Print expressions and formulas in prefix-form.

It is mainly used for debugging purposes.

Definition at line 24 of file PrefixPrinter.h.

Constructor & Destructor Documentation

◆ PrefixPrinter()

dlinear::PrefixPrinter::PrefixPrinter ( std::ostream & os,
const Config & config = Config{} )
explicit

Constructs a new PrefixPrinter object with os.

It temporarily sets the precision of os to the maximum precision.

Parameters
osstream to print to.

Definition at line 19 of file PrefixPrinter.cpp.

Member Function Documentation

◆ Print() [1/2]

std::ostream & dlinear::PrefixPrinter::Print ( const Expression & e) const

Print the prefix form of the expression e to the ostream.

Parameters
eexpression to print
Returns
updated ostream

Definition at line 27 of file PrefixPrinter.cpp.

◆ Print() [2/2]

std::ostream & dlinear::PrefixPrinter::Print ( const Formula & f) const

Print the prefix form of the formula f to the ostream.

Parameters
fformula to print
Returns
updated ostream

Definition at line 30 of file PrefixPrinter.cpp.


The documentation for this class was generated from the following files: