Struct z3::FuncDecl [−][src]
pub struct FuncDecl<'ctx> { /* fields omitted */ }
Expand description
Function declaration. Every constant and function have an associated declaration.
The declaration assigns a name, a sort (i.e., type), and for function the sort (i.e., type) of each of its arguments. Note that, in Z3, a constant is a function with 0 arguments.
See also:
Implementations
pub fn new<S: Into<Symbol>>(
ctx: &'ctx Context,
name: S,
domain: &[&Sort<'ctx>],
range: &Sort<'ctx>
) -> Self
Return the number of arguments of a function declaration.
If the function declaration is a constant, then the arity is 0
.
let f = FuncDecl::new(
&ctx,
"f",
&[&Sort::int(&ctx), &Sort::real(&ctx)],
&Sort::int(&ctx));
assert_eq!(f.arity(), 2);
Create a constant (if args
has length 0) or function application (otherwise).
Note that args
should have the types corresponding to the domain
of the FuncDecl
.