use super::Sentence;
use crate::inference::Truth;
use nar_dev_utils::join;
use narsese::lexical::Sentence as LexicalSentence;
pub trait Judgement: Sentence + Truth {
fn revisable_to(&self, other: &Self) -> bool {
let content_eq = self.content() == other.content();
let other_revisable = other.revisable();
content_eq && other_revisable
}
fn revisable(&self) -> bool;
fn is_belief_equivalent(&self, other: &impl Judgement) -> bool {
self.truth_eq(other) && self.evidential_eq(other)
}
fn judgement_to_key(&self) -> String {
join! {
=> self.content().to_string()
=> self.punctuation().to_string() + " "
=> self.truth_to_display_brief()
}
}
fn judgement_to_display(&self) -> String {
join! {
=> self.content().to_string()
=> self.punctuation().to_string() + " "
=> self.truth_to_display()
=> self.stamp_to_display()
}
}
fn judgement_to_lexical(&self) -> LexicalSentence {
LexicalSentence {
term: self.content().into(),
punctuation: self.punctuation().to_char().into(),
stamp: self.stamp_to_lexical(),
truth: self.truth_to_lexical(),
}
}
}