6#include "FunctionDefinition.h"
10#include "dlinear/util/exception.h"
15 : parameters_{
std::move(parameters)}, return_type_{return_type}, body_{
std::move(body)} {
21 DLINEAR_RUNTIME_ERROR_FMT(
"This function definition expects #{} arguments ({}). Provided #{} arguments.",
26 for (std::size_t i = 0; i <
parameters_.size(); ++i) {
28 const Term& arg_i{arguments[i]};
29 arg_i.Check(param_i.get_type());
Represents a symbolic variable.
Term operator()(const std::vector< Term > &arguments) const
Call the function with the given arguments.
FunctionDefinition(std::vector< Variable > parameters, Sort return_type, Term body)
Construct a new function definition.
Sort return_type_
Return type of the function.
Term body_
Body of the function.
std::vector< Variable > parameters_
Parameters of the function.
Generic term that can be either an expression or a formula.
void Check(Sort s) const
Check if this term can be matched with s.
Term Substitute(const Variable &v, const Term &t)
Create a new Term with substitutes the variable v in this term with t.
Namespace for the VNNLIB parser of the dlinear library.