75 lines
2.2 KiB
Rust
75 lines
2.2 KiB
Rust
impl std::fmt::Debug for crate::project::ProofDirection
|
|
{
|
|
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
|
{
|
|
match &self
|
|
{
|
|
crate::project::ProofDirection::Forward => write!(format, "forward"),
|
|
crate::project::ProofDirection::Backward => write!(format, "backward"),
|
|
}
|
|
}
|
|
}
|
|
|
|
impl std::fmt::Display for crate::project::ProofDirection
|
|
{
|
|
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
|
{
|
|
write!(format, "{:?}", &self)
|
|
}
|
|
}
|
|
|
|
impl std::fmt::Debug for crate::project::StatementKind
|
|
{
|
|
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
|
{
|
|
match &self
|
|
{
|
|
crate::project::StatementKind::Axiom => write!(format, "axiom"),
|
|
crate::project::StatementKind::Completion(
|
|
crate::project::CompletionTarget::Predicate(predicate_declaration))
|
|
=> write!(format, "completion({}/{})", predicate_declaration.name, predicate_declaration.arity),
|
|
crate::project::StatementKind::Completion(crate::project::CompletionTarget::Constraint)
|
|
=> write!(format, "completion(constraint)"),
|
|
crate::project::StatementKind::Assumption => write!(format, "assumption"),
|
|
crate::project::StatementKind::Assertion => write!(format, "assertion"),
|
|
crate::project::StatementKind::Lemma(None) => write!(format, "lemma"),
|
|
crate::project::StatementKind::Lemma(Some(crate::project::ProofDirection::Forward)) => write!(format, "lemma(forward)"),
|
|
crate::project::StatementKind::Lemma(Some(crate::project::ProofDirection::Backward)) => write!(format, "lemma(backward)"),
|
|
}
|
|
}
|
|
}
|
|
|
|
impl std::fmt::Display for crate::project::StatementKind
|
|
{
|
|
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
|
{
|
|
write!(format, "{:?}", &self)
|
|
}
|
|
}
|
|
|
|
impl std::fmt::Debug for crate::Project
|
|
{
|
|
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
|
{
|
|
for block in &self.blocks
|
|
{
|
|
match block
|
|
{
|
|
crate::project::Block::Whitespace(ref text) => write!(format, "{}", text)?,
|
|
crate::project::Block::Statement(ref statement) =>
|
|
write!(format, "{}", statement.original_text)?,
|
|
}
|
|
}
|
|
|
|
Ok(())
|
|
}
|
|
}
|
|
|
|
impl std::fmt::Display for crate::Project
|
|
{
|
|
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
|
{
|
|
write!(format, "{:?}", &self)
|
|
}
|
|
}
|