Struct Rewriter

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

State of the SMT2 rewriter.

Implementations§

Source§

impl Rewriter

Source

pub fn new(config: RewriterConfig, discarded_options: HashSet<String>) -> Self

Trait Implementations§

Source§

impl Debug for Rewriter

Source§

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

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

impl Rewriter for Rewriter

Source§

type V = SyntaxBuilder

Source§

fn visitor(&mut self) -> &mut SyntaxBuilder

Delegate visitor
Source§

fn process_symbol(&mut self, symbol: Symbol) -> Symbol

Source§

fn visit_forall(&mut self, vars: Vec<(Symbol, Sort)>, term: Term) -> Term

Source§

fn visit_assert(&mut self, term: Term) -> Command

Source§

fn visit_set_option( &mut self, keyword: Keyword, value: AttributeValue, ) -> Command

Source§

fn visit_get_unsat_core(&mut self) -> Command

Source§

fn process_constant( &mut self, value: <Self::V as Smt2Visitor>::Constant, ) -> <Self::V as Smt2Visitor>::Constant

Source§

fn process_keyword( &mut self, value: <Self::V as Smt2Visitor>::Keyword, ) -> <Self::V as Smt2Visitor>::Keyword

Source§

fn process_s_expr( &mut self, value: <Self::V as Smt2Visitor>::SExpr, ) -> <Self::V as Smt2Visitor>::SExpr

Source§

fn process_sort( &mut self, value: <Self::V as Smt2Visitor>::Sort, ) -> <Self::V as Smt2Visitor>::Sort

Source§

fn process_qual_identifier( &mut self, value: <Self::V as Smt2Visitor>::QualIdentifier, ) -> <Self::V as Smt2Visitor>::QualIdentifier

Source§

fn process_term( &mut self, value: <Self::V as Smt2Visitor>::Term, ) -> <Self::V as Smt2Visitor>::Term

Source§

fn process_command( &mut self, value: <Self::V as Smt2Visitor>::Command, ) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_numeral_constant( &mut self, value: BigUint, ) -> <Self::V as Smt2Visitor>::Constant

Source§

fn visit_decimal_constant( &mut self, value: Ratio<BigInt>, ) -> <Self::V as Smt2Visitor>::Constant

Source§

fn visit_hexadecimal_constant( &mut self, value: Vec<u8>, ) -> <Self::V as Smt2Visitor>::Constant

Source§

fn visit_binary_constant( &mut self, value: Vec<bool>, ) -> <Self::V as Smt2Visitor>::Constant

Source§

fn visit_string_constant( &mut self, value: String, ) -> <Self::V as Smt2Visitor>::Constant

Source§

fn visit_bound_symbol( &mut self, value: String, ) -> Result<<Self::V as Smt2Visitor>::Symbol, String>

Source§

fn visit_fresh_symbol( &mut self, value: String, ) -> <Self::V as Smt2Visitor>::Symbol

Source§

fn visit_any_symbol( &mut self, value: String, ) -> <Self::V as Smt2Visitor>::Symbol

Source§

fn bind_symbol(&mut self, symbol: &<Self::V as Smt2Visitor>::Symbol)

Source§

fn unbind_symbol(&mut self, symbol: &<Self::V as Smt2Visitor>::Symbol)

Source§

fn visit_keyword(&mut self, value: String) -> <Self::V as Smt2Visitor>::Keyword

Source§

fn visit_constant_s_expr( &mut self, value: <Self::V as Smt2Visitor>::Constant, ) -> <Self::V as Smt2Visitor>::SExpr

Source§

fn visit_symbol_s_expr( &mut self, value: <Self::V as Smt2Visitor>::Symbol, ) -> <Self::V as Smt2Visitor>::SExpr

Source§

fn visit_keyword_s_expr( &mut self, value: <Self::V as Smt2Visitor>::Keyword, ) -> <Self::V as Smt2Visitor>::SExpr

Source§

fn visit_application_s_expr( &mut self, values: Vec<<Self::V as Smt2Visitor>::SExpr>, ) -> <Self::V as Smt2Visitor>::SExpr

Source§

fn visit_simple_sort( &mut self, identifier: Identifier<<Self::V as Smt2Visitor>::Symbol>, ) -> <Self::V as Smt2Visitor>::Sort

Source§

fn visit_parameterized_sort( &mut self, identifier: Identifier<<Self::V as Smt2Visitor>::Symbol>, parameters: Vec<<Self::V as Smt2Visitor>::Sort>, ) -> <Self::V as Smt2Visitor>::Sort

Source§

fn visit_simple_identifier( &mut self, identifier: Identifier<<Self::V as Smt2Visitor>::Symbol>, ) -> <Self::V as Smt2Visitor>::QualIdentifier

Source§

fn visit_sorted_identifier( &mut self, identifier: Identifier<<Self::V as Smt2Visitor>::Symbol>, sort: <Self::V as Smt2Visitor>::Sort, ) -> <Self::V as Smt2Visitor>::QualIdentifier

Source§

fn visit_constant( &mut self, constant: <Self::V as Smt2Visitor>::Constant, ) -> <Self::V as Smt2Visitor>::Term

Source§

fn visit_qual_identifier( &mut self, qual_identifier: <Self::V as Smt2Visitor>::QualIdentifier, ) -> <Self::V as Smt2Visitor>::Term

Source§

fn visit_application( &mut self, qual_identifier: <Self::V as Smt2Visitor>::QualIdentifier, arguments: Vec<<Self::V as Smt2Visitor>::Term>, ) -> <Self::V as Smt2Visitor>::Term

Source§

fn visit_let( &mut self, var_bindings: Vec<(<Self::V as Smt2Visitor>::Symbol, <Self::V as Smt2Visitor>::Term)>, term: <Self::V as Smt2Visitor>::Term, ) -> <Self::V as Smt2Visitor>::Term

Source§

fn visit_exists( &mut self, vars: Vec<(<Self::V as Smt2Visitor>::Symbol, <Self::V as Smt2Visitor>::Sort)>, term: <Self::V as Smt2Visitor>::Term, ) -> <Self::V as Smt2Visitor>::Term

Source§

fn visit_match( &mut self, term: <Self::V as Smt2Visitor>::Term, cases: Vec<(Vec<<Self::V as Smt2Visitor>::Symbol>, <Self::V as Smt2Visitor>::Term)>, ) -> <Self::V as Smt2Visitor>::Term

Source§

fn visit_attributes( &mut self, term: <Self::V as Smt2Visitor>::Term, attributes: Vec<(<Self::V as Smt2Visitor>::Keyword, AttributeValue<<Self::V as Smt2Visitor>::Constant, <Self::V as Smt2Visitor>::Symbol, <Self::V as Smt2Visitor>::SExpr>)>, ) -> <Self::V as Smt2Visitor>::Term

Source§

fn visit_check_sat(&mut self) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_check_sat_assuming( &mut self, literals: Vec<(<Self::V as Smt2Visitor>::Symbol, bool)>, ) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_declare_const( &mut self, symbol: <Self::V as Smt2Visitor>::Symbol, sort: <Self::V as Smt2Visitor>::Sort, ) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_declare_datatype( &mut self, symbol: <Self::V as Smt2Visitor>::Symbol, datatype: DatatypeDec<<Self::V as Smt2Visitor>::Symbol, <Self::V as Smt2Visitor>::Sort>, ) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_declare_datatypes( &mut self, datatypes: Vec<(<Self::V as Smt2Visitor>::Symbol, BigUint, DatatypeDec<<Self::V as Smt2Visitor>::Symbol, <Self::V as Smt2Visitor>::Sort>)>, ) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_declare_fun( &mut self, symbol: <Self::V as Smt2Visitor>::Symbol, parameters: Vec<<Self::V as Smt2Visitor>::Sort>, sort: <Self::V as Smt2Visitor>::Sort, ) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_declare_sort( &mut self, symbol: <Self::V as Smt2Visitor>::Symbol, arity: BigUint, ) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_define_fun( &mut self, sig: FunctionDec<<Self::V as Smt2Visitor>::Symbol, <Self::V as Smt2Visitor>::Sort>, term: <Self::V as Smt2Visitor>::Term, ) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_define_fun_rec( &mut self, sig: FunctionDec<<Self::V as Smt2Visitor>::Symbol, <Self::V as Smt2Visitor>::Sort>, term: <Self::V as Smt2Visitor>::Term, ) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_define_funs_rec( &mut self, funs: Vec<(FunctionDec<<Self::V as Smt2Visitor>::Symbol, <Self::V as Smt2Visitor>::Sort>, <Self::V as Smt2Visitor>::Term)>, ) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_define_sort( &mut self, symbol: <Self::V as Smt2Visitor>::Symbol, parameters: Vec<<Self::V as Smt2Visitor>::Symbol>, sort: <Self::V as Smt2Visitor>::Sort, ) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_echo(&mut self, message: String) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_exit(&mut self) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_get_assertions(&mut self) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_get_assignment(&mut self) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_get_info( &mut self, flag: <Self::V as Smt2Visitor>::Keyword, ) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_get_model(&mut self) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_get_option( &mut self, keyword: <Self::V as Smt2Visitor>::Keyword, ) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_get_proof(&mut self) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_get_unsat_assumptions(&mut self) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_get_value( &mut self, terms: Vec<<Self::V as Smt2Visitor>::Term>, ) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_pop(&mut self, level: BigUint) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_push(&mut self, level: BigUint) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_reset(&mut self) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_reset_assertions(&mut self) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_set_info( &mut self, keyword: <Self::V as Smt2Visitor>::Keyword, value: AttributeValue<<Self::V as Smt2Visitor>::Constant, <Self::V as Smt2Visitor>::Symbol, <Self::V as Smt2Visitor>::SExpr>, ) -> <Self::V as Smt2Visitor>::Command

Source§

fn visit_set_logic( &mut self, symbol: <Self::V as Smt2Visitor>::Symbol, ) -> <Self::V as Smt2Visitor>::Command

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<R, V> ConstantVisitor for R
where R: Rewriter<V = V>, V: Smt2Visitor,

Source§

type T = <V as Smt2Visitor>::Constant

Source§

fn visit_numeral_constant( &mut self, value: BigUint, ) -> <R as ConstantVisitor>::T

Source§

fn visit_decimal_constant( &mut self, value: Ratio<BigInt>, ) -> <R as ConstantVisitor>::T

Source§

fn visit_hexadecimal_constant( &mut self, value: Vec<u8>, ) -> <R as ConstantVisitor>::T

Source§

fn visit_binary_constant( &mut self, value: Vec<bool>, ) -> <R as ConstantVisitor>::T

Source§

fn visit_string_constant(&mut self, value: String) -> <R as ConstantVisitor>::T

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<R, V> KeywordVisitor for R
where R: Rewriter<V = V>, V: Smt2Visitor,

Source§

type T = <V as Smt2Visitor>::Keyword

Source§

fn visit_keyword(&mut self, value: String) -> <R as KeywordVisitor>::T

Source§

impl<R, V> Smt2Visitor for R
where R: Rewriter<V = V>, V: Smt2Visitor,

Source§

impl<R, V> SymbolVisitor for R
where R: Rewriter<V = V>, V: Smt2Visitor,

Source§

type T = <V as Smt2Visitor>::Symbol

Source§

fn visit_fresh_symbol(&mut self, value: String) -> <R as SymbolVisitor>::T

Source§

fn visit_bound_symbol( &mut self, value: String, ) -> Result<<R as SymbolVisitor>::T, String>

Source§

fn visit_any_symbol(&mut self, value: String) -> <R as SymbolVisitor>::T

Source§

fn bind_symbol(&mut self, symbol: &<R as SymbolVisitor>::T)

Source§

fn unbind_symbol(&mut self, symbol: &<R as SymbolVisitor>::T)

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.