expr_manager_template.h
Go to the documentation of this file.
/********************* */
#include "cvc4_public.h"
#ifndef __CVC4__EXPR_MANAGER_H
#define __CVC4__EXPR_MANAGER_H
#include <vector>
#include "expr/kind.h"
#include "expr/type.h"
#include "expr/expr.h"
#include "util/subrange_bound.h"
#include "util/statistics.h"
#include "util/sexpr.h"
${includes}
// This is a hack, but an important one: if there's an error, the
// compiler directs the user to the template file instead of the
// generated one. We don't want the user to modify the generated one,
// since it'll get overwritten on a later build.
#line 38 "${template}"
namespace CVC4 {
class Expr;
class SmtEngine;
class NodeManager;
class Options;
class IntStat;
struct ExprManagerMapCollection;
class StatisticsRegistry;
namespace expr {
namespace pickle {
class Pickler;
}/* CVC4::expr::pickle namespace */
}/* CVC4::expr namespace */
namespace context {
class Context;
}/* CVC4::context namespace */
namespace stats {
StatisticsRegistry* getStatisticsRegistry(ExprManager*);
}/* CVC4::stats namespace */
class CVC4_PUBLIC ExprManager {
private:
context::Context* d_ctxt;
NodeManager* d_nodeManager;
IntStat* d_exprStatisticsVars[LAST_TYPE];
IntStat* d_exprStatistics[kind::LAST_KIND];
NodeManager* getNodeManager() const;
context::Context* getContext() const;
void checkResolvedDatatype(DatatypeType dtt) const;
friend class SmtEngine;
friend class ExprManagerScope;
friend class NodeManager;
friend ::CVC4::StatisticsRegistry* ::CVC4::stats::getStatisticsRegistry(ExprManager*);
StatisticsRegistry* getStatisticsRegistry() throw();
// undefined, private copy constructor and assignment op (disallow copy)
ExprManager(const ExprManager&) CVC4_UNDEFINED;
ExprManager& operator=(const ExprManager&) CVC4_UNDEFINED;
public:
ExprManager();
explicit ExprManager(const Options& options);
~ExprManager() throw();
const Options& getOptions() const;
BooleanType booleanType() const;
StringType stringType() const;
RealType realType() const;
IntegerType integerType() const;
Expr mkExpr(Kind kind, Expr child1);
Expr mkExpr(Kind kind, Expr child1, Expr child2);
Expr mkExpr(Kind kind, Expr child1, Expr child2, Expr child3);
Expr mkExpr(Kind kind, Expr child1, Expr child2, Expr child3, Expr child4);
Expr mkExpr(Kind kind, Expr child1, Expr child2, Expr child3, Expr child4,
Expr child5);
Expr mkExpr(Kind kind, const std::vector<Expr>& children);
Expr mkExpr(Kind kind, Expr child1, const std::vector<Expr>& otherChildren);
Expr mkExpr(Expr opExpr);
Expr mkExpr(Expr opExpr, Expr child1);
Expr mkExpr(Expr opExpr, Expr child1, Expr child2);
Expr mkExpr(Expr opExpr, Expr child1, Expr child2, Expr child3);
Expr mkExpr(Expr opExpr, Expr child1, Expr child2, Expr child3, Expr child4);
Expr mkExpr(Expr opExpr, Expr child1, Expr child2, Expr child3, Expr child4,
Expr child5);
Expr mkExpr(Expr opExpr, const std::vector<Expr>& children);
template <class T>
Expr mkConst(const T&);
Expr mkAssociative(Kind kind, const std::vector<Expr>& children);
static bool hasOperator(Kind k);
Expr operatorOf(Kind k);
FunctionType mkFunctionType(Type domain, Type range);
FunctionType mkFunctionType(const std::vector<Type>& argTypes, Type range);
FunctionType mkFunctionType(const std::vector<Type>& sorts);
FunctionType mkPredicateType(const std::vector<Type>& sorts);
TupleType mkTupleType(const std::vector<Type>& types);
RecordType mkRecordType(const Record& rec);
SExprType mkSExprType(const std::vector<Type>& types);
BitVectorType mkBitVectorType(unsigned size) const;
ArrayType mkArrayType(Type indexType, Type constituentType) const;
SetType mkSetType(Type elementType) const;
DatatypeType mkDatatypeType(const Datatype& datatype);
std::vector<DatatypeType>
mkMutualDatatypeTypes(const std::vector<Datatype>& datatypes);
std::vector<DatatypeType>
mkMutualDatatypeTypes(const std::vector<Datatype>& datatypes,
const std::set<Type>& unresolvedTypes);
ConstructorType mkConstructorType(const DatatypeConstructor& constructor, Type range) const;
SelectorType mkSelectorType(Type domain, Type range) const;
TesterType mkTesterType(Type domain) const;
enum {
SORT_FLAG_NONE = 0,
SORT_FLAG_PLACEHOLDER = 1
};/* enum */
SortType mkSort(const std::string& name, uint32_t flags = SORT_FLAG_NONE) const;
SortConstructorType mkSortConstructor(const std::string& name,
size_t arity) const;
// not in release 1.0
//Type mkPredicateSubtype(Expr lambda)
// throw(TypeCheckingException);
// not in release 1.0
//Type mkPredicateSubtype(Expr lambda, Expr witness)
// throw(TypeCheckingException);
Type mkSubrangeType(const SubrangeBounds& bounds)
throw(TypeCheckingException);
Type getType(Expr e, bool check = false)
throw(TypeCheckingException);
enum {
VAR_FLAG_NONE = 0,
VAR_FLAG_GLOBAL = 1,
VAR_FLAG_DEFINED = 2
};/* enum */
Expr mkVar(const std::string& name, Type type, uint32_t flags = VAR_FLAG_NONE);
Expr mkVar(Type type, uint32_t flags = VAR_FLAG_NONE);
Expr mkBoundVar(const std::string& name, Type type);
Expr mkBoundVar(Type type);
Statistics getStatistics() const throw();
SExpr getStatistic(const std::string& name) const throw();
//static Expr exportExpr(const Expr& e, ExprManager* em);
static Type exportType(const Type& t, ExprManager* em, ExprManagerMapCollection& vmap);
static unsigned minArity(Kind kind);
static unsigned maxArity(Kind kind);
};/* class ExprManager */
${mkConst_instantiations}
}/* CVC4 namespace */
#endif /* __CVC4__EXPR_MANAGER_H */
Context
void * Context
Definition c_interface_defs.h:42
Expr
void * Expr
Definition c_interface_defs.h:46
Type
void * Type
Definition c_interface_defs.h:48
ExprManager
void * ExprManager
Definition c_interface_defs.h:43
cvc4_public.h
Macros that should be defined everywhere during the building of the libraries and driver binary,...
CVC4_PUBLIC
#define CVC4_PUBLIC
Definition cvc4_public.h:30
CVC4_UNDEFINED
#define CVC4_UNDEFINED
Definition cvc4_public.h:52
expr.h
kind.h
CVC3::Statistics
CVC4::Statistics Statistics
Definition cvc3_compat.h:462
CVC4::kind::$
@ $
marks the upper-bound of this enumeration
Definition kind_template.h:33
CVC4::stats::getStatisticsRegistry
StatisticsRegistry * getStatisticsRegistry(ExprManager *)
CVC4
Definition expr.h:106
CVC4::LAST_TYPE
@ LAST_TYPE
Definition kind.h:556
std
STL namespace.
sexpr.h
Simple representation of S-expressions.
statistics.h
[[ Add one-line brief description here ]]
subrange_bound.h
Representation of subrange bounds.
type.h
Interface for expression types.