Skip to main content

Fixedpoint

Struct Fixedpoint 

Source
pub struct Fixedpoint { /* private fields */ }
Expand description

Context for Horn clause / Datalog solving.

§See also

Implementations§

Source§

impl Fixedpoint

Source

pub fn new() -> Fixedpoint

Create a new fixedpoint context.

Source

pub fn add_rule(&self, rule: &impl Ast, name: Option<&str>)

Add a Horn clause rule to the fixedpoint context.

§Example
let fp = Fixedpoint::new();
let p = Bool::new_const("p");
let q = Bool::new_const("q");

// Add rule: p => q
fp.add_rule(&p.implies(&q), None);
Source

pub fn add_fact(&self, pred: &FuncDecl, args: &[u32])

Add a fact (ground assertion) to the fixedpoint context.

Source

pub fn assert(&self, axiom: &impl Ast)

Assert a formula in the fixedpoint context.

Source

pub fn query(&self, query: &impl Ast) -> SatResult

Query the fixedpoint context for satisfiability.

Returns the result of the query (satisfiable, unsatisfiable, or unknown).

Source

pub fn query_relations(&self, relations: &[&FuncDecl]) -> SatResult

Query the fixedpoint context with multiple relations.

Source

pub fn get_answer(&self) -> Option<Bool>

Get the answer substitution after a successful query. This provides the concrete values that make the query satisfiable.

Source

pub fn get_reason_unknown(&self) -> String

Get the reason (core) for unsatisfiability after an unsuccessful query.

Source

pub fn update_rule(&self, rule: &impl Ast, name: &str)

Update a named rule.

Source

pub fn get_num_levels(&self, pred: &FuncDecl) -> u32

Get the number of levels explored during the last query.

Source

pub fn get_cover_delta(&self, level: i32, predicate: &FuncDecl) -> Option<Bool>

Get the cover (approximation) at a given level.

Source

pub fn add_cover(&self, level: i32, predicate: &FuncDecl, property: &impl Ast)

Add a cover for a predicate at a given level.

Source

pub fn get_statistics(&self) -> Statistics

Get statistics about the last query.

Source

pub fn register_relation(&self, pred: &FuncDecl)

Register a relation as fixedpoint-defined (least-fixedpoint semantics).

Source

pub fn set_params(&self, params: &Params)

Set parameters for the fixedpoint context.

Source

pub fn get_help(&self) -> String

Get the help string for fixedpoint parameters.

Source

pub fn from_string(&self, s: &str) -> Result<(), String>

Parse a fixedpoint problem from a string in SMT-LIB format.

Source

pub fn from_file(&self, filename: &str) -> Result<(), String>

Parse a file containing a fixedpoint problem.

Trait Implementations§

Source§

impl Debug for Fixedpoint

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for Fixedpoint

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for Fixedpoint

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Drop for Fixedpoint

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, A> IntoAst<A> for T
where T: Into<A>, A: Ast,

Source§

fn into_ast(self, _a: &A) -> A

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.