[][src]Struct z3::Sort

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

Sorts represent the various 'types' of Asts.

Implementations

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

pub fn uninterpreted(ctx: &'ctx Context, name: Symbol) -> Sort<'ctx>[src]

pub fn bool(ctx: &Context) -> Sort[src]

pub fn int(ctx: &Context) -> Sort[src]

pub fn real(ctx: &Context) -> Sort[src]

pub fn string(ctx: &'ctx Context) -> Sort<'ctx>[src]

pub fn bitvector(ctx: &Context, sz: u32) -> Sort[src]

pub fn array(
    ctx: &'ctx Context,
    domain: &Sort<'ctx>,
    range: &Sort<'ctx>
) -> Sort<'ctx>
[src]

pub fn set(ctx: &'ctx Context, elt: &Sort<'ctx>) -> Sort<'ctx>[src]

pub fn enumeration(
    ctx: &'ctx Context,
    name: Symbol,
    enum_names: &[Symbol]
) -> (Sort<'ctx>, Vec<FuncDecl<'ctx>>, Vec<FuncDecl<'ctx>>)
[src]

Create an enumeration sort.

Creates a Z3 enumeration sort with the given name. The enum variants will have the names in enum_names. Three things are returned:

  • the created Sort,
  • constants to create the variants,
  • and testers to check if a value is equal to a variant.

Examples

let (colors, color_consts, color_testers) = Sort::enumeration(
    &ctx,
    "Color".into(),
    &[
        "Red".into(),
        "Green".into(),
        "Blue".into(),
    ],
);

let red_const = color_consts[0].apply(&[]);
let red_tester = &color_testers[0];
let eq = red_tester.apply(&[&red_const]);

assert_eq!(solver.check(), SatResult::Sat);
let model = solver.get_model();

assert!(model.eval(&eq).unwrap().as_bool().unwrap().as_bool().unwrap());

pub fn kind(&self) -> SortKind[src]

Trait Implementations

impl<'ctx> Debug for Sort<'ctx>[src]

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

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

impl<'ctx> Eq for Sort<'ctx>[src]

impl<'ctx> PartialEq<Sort<'ctx>> for Sort<'ctx>[src]

Auto Trait Implementations

impl<'ctx> RefUnwindSafe for Sort<'ctx>

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

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

impl<'ctx> Unpin for Sort<'ctx>

impl<'ctx> UnwindSafe for Sort<'ctx>

Blanket Implementations

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

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

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

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.