4 #ifndef ILANG_ILA_AST_FUNC_H__
5 #define ILANG_ILA_AST_FUNC_H__
31 const std::vector<SortPtr>& args);
40 size_t arg_num()
const {
return args_.size(); }
42 const SortPtr arg(
const int& i)
const {
return args_.at(i); }
56 const std::vector<SortPtr>& args);
59 bool CheckSort(
const std::vector<std::shared_ptr<Expr>>& args)
const;
65 std::ostream&
Print(std::ostream&
out)
const;
77 std::vector<SortPtr> args_;
95 #endif // ILANG_ILA_AST_FUNC_H__
z3::func_decl GetZ3FuncDecl(z3::context &ctx) const
Return the z3 func_decl.
std::ostream & Print(std::ostream &out) const
Output to stream.
std::shared_ptr< Func > FuncPtr
Pointer type for normal use of Func.
Definition: func.h:26
const SortPtr arg(const int &i) const
Return the sort of the i-th argument.
Definition: func.h:42
static FuncPtr New(const std::string &name, const SortPtr out=Sort::MakeBoolSort())
Create an uninterpreted function (Func) with no input (nondet).
Sort::SortPtr SortPtr
Pointer type for storing/passing Sort.
Definition: sort.h:82
~Func()
Default destructor.
size_t arg_num() const
Return the number of arguments.
Definition: func.h:40
static SortPtr MakeBoolSort()
Create a Boolean Sort.
size_t operator()(const FuncPtr &func) const
Function object for hashing.
Definition: func.h:90
The function object for hashing Func. The hash value is the id of the symbol, which is supposed to be...
Definition: func.h:87
Func::FuncPtr FuncPtr
Pointer type for normal use of Func.
Definition: func.h:83
bool CheckSort(const std::vector< std::shared_ptr< Expr >> &args) const
Check if the input arguments match the specified sort.
The class for the Abstract Syntax Tree. An Ast object can be an expression or function definition (in...
Definition: ast.h:20
Func(const std::string &name, const SortPtr out, const std::vector< SortPtr > &args)
Constructor for multiple-argument function.
friend std::ostream & operator<<(std::ostream &out, const FuncPtr &f)
Overload output stream.
Definition: func.h:68
const SortPtr out() const
Return the output sort.
Definition: func.h:38
The class for uninterpreted function.
Definition: func.h:23
const Symbol & name() const
Get the symbol (name).