[−][src]Struct z3::Sort
Sorts represent the various 'types' of Ast
s.
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]
ctx: &'ctx Context,
domain: &Sort<'ctx>,
range: &Sort<'ctx>
) -> Sort<'ctx>
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]
ctx: &'ctx Context,
name: Symbol,
enum_names: &[Symbol]
) -> (Sort<'ctx>, Vec<FuncDecl<'ctx>>, Vec<FuncDecl<'ctx>>)
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,