Skip to main content

ProofWriter

Struct ProofWriter 

Source
pub struct ProofWriter<W, Int> { /* private fields */ }
Expand description

Write a DRCP proof to some sink.

See the module documentation of crate::writer for examples on how to use the ProofWriter.

Implementations§

Source§

impl<W: Write, Int> ProofWriter<W, Int>

Source

pub fn new(writer: W) -> Self

Create a new proof writer which writes the proof to an underlying sink implementing Write.

Source§

impl<W: Write, Int: IntValue> ProofWriter<W, Int>

Source

pub fn log_deduction<Identifier: Into<Box<str>>>( &mut self, deduction: Deduction<Identifier, Int>, ) -> Result<()>

Write a deduction step.

The propagation_hints can be optionally given to indicate which previously derived facts should be applied to derive the conflict.

This function wraps an IO operation, which is why it can fail with an IO error.

Source

pub fn log_inference<Identifier: Into<Box<str>>, Label: Display>( &mut self, inference: Inference<Identifier, Int, Label>, ) -> Result<()>

Log an inference step.

Besides premises and a consequent, an inference step can optionally include hints regarding the constraint that generated the inference, and the label of the filtering algorithm which identified the inference.

If there is no consequent, then the format prescribes that the consequent is false, so that the premises form a nogood.

This function wraps an IO operation, which is why it can fail with an IO error.

Source

pub fn log_conclusion<Identifier: Into<Box<str>>>( &mut self, conclusion: Conclusion<Identifier, Int>, ) -> Result<()>

Conclude the proof with a conclusion.

Trait Implementations§

Source§

impl<W: Debug, Int: Debug> Debug for ProofWriter<W, Int>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<W, Int> Freeze for ProofWriter<W, Int>
where W: Freeze,

§

impl<W, Int> RefUnwindSafe for ProofWriter<W, Int>

§

impl<W, Int> Send for ProofWriter<W, Int>
where W: Send, Int: Send,

§

impl<W, Int> Sync for ProofWriter<W, Int>
where W: Sync, Int: Sync,

§

impl<W, Int> Unpin for ProofWriter<W, Int>
where W: Unpin,

§

impl<W, Int> UnsafeUnpin for ProofWriter<W, Int>
where W: UnsafeUnpin,

§

impl<W, Int> UnwindSafe for ProofWriter<W, Int>
where W: UnwindSafe, Int: RefUnwindSafe,

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, 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.