pub struct ProofFragment {
pub id: String,
pub conclusion: Predicate,
pub rule_applied: Option<RuleRef>,
pub premise_refs: Vec<ProofFragmentRef>,
pub substitution: Vec<(String, Term)>,
pub metadata: ProofMetadata,
}Expand description
A proof fragment that can be stored as IPLD
Fields§
§id: StringUnique identifier for this fragment
conclusion: PredicateThe conclusion proved by this fragment
rule_applied: Option<RuleRef>The rule applied (if any)
premise_refs: Vec<ProofFragmentRef>References to premise proof fragments
substitution: Vec<(String, Term)>Substitution used in this proof step (serialized as term pairs)
metadata: ProofMetadataMetadata about this fragment
Implementations§
Source§impl ProofFragment
impl ProofFragment
Sourcepub fn fact(conclusion: Predicate) -> Self
pub fn fact(conclusion: Predicate) -> Self
Create a new proof fragment for a fact (no premises)
Sourcepub fn with_rule(
conclusion: Predicate,
rule: &Rule,
premises: Vec<ProofFragmentRef>,
substitution: Vec<(String, Term)>,
) -> Self
pub fn with_rule( conclusion: Predicate, rule: &Rule, premises: Vec<ProofFragmentRef>, substitution: Vec<(String, Term)>, ) -> Self
Create a proof fragment with a rule application
Sourcepub fn premise_count(&self) -> usize
pub fn premise_count(&self) -> usize
Get the number of premises
Trait Implementations§
Source§impl Clone for ProofFragment
impl Clone for ProofFragment
Source§fn clone(&self) -> ProofFragment
fn clone(&self) -> ProofFragment
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProofFragment
impl Debug for ProofFragment
Source§impl<'de> Deserialize<'de> for ProofFragment
impl<'de> Deserialize<'de> for ProofFragment
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ProofFragment
impl RefUnwindSafe for ProofFragment
impl Send for ProofFragment
impl Sync for ProofFragment
impl Unpin for ProofFragment
impl UnwindSafe for ProofFragment
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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