[][src]Struct z3::FuncDecl

pub struct FuncDecl<'ctx> { /* fields omitted */ }

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.

Methods

impl<'ctx> FuncDecl<'ctx>[src]

pub fn new<S: Into<Symbol>>(
    ctx: &'ctx Context,
    name: S,
    domain: &[&Sort<'ctx>],
    range: &Sort<'ctx>
) -> Self
[src]

pub unsafe fn from_raw(ctx: &'ctx Context, z3_func_decl: Z3_func_decl) -> Self[src]

pub fn arity(&self) -> usize[src]

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);

pub fn apply(&self, args: &[&Dynamic<'ctx>]) -> Dynamic<'ctx>[src]

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.

Trait Implementations

impl<'ctx> Drop for FuncDecl<'ctx>[src]

impl<'ctx> Display for FuncDecl<'ctx>[src]

Auto Trait Implementations

impl<'ctx> !Send for FuncDecl<'ctx>

impl<'ctx> Unpin for FuncDecl<'ctx>

impl<'ctx> !Sync for FuncDecl<'ctx>

impl<'ctx> UnwindSafe for FuncDecl<'ctx>

impl<'ctx> RefUnwindSafe for FuncDecl<'ctx>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]