77 lines
2.4 KiB
Rust
77 lines
2.4 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::FormulaStatementKind
|
|
{
|
|
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
|
{
|
|
match &self
|
|
{
|
|
crate::project::FormulaStatementKind::Axiom => write!(format, "axiom"),
|
|
crate::project::FormulaStatementKind::Completion(
|
|
crate::project::CompletionTarget::Predicate(predicate_declaration))
|
|
=> write!(format, "completion({}/{})", predicate_declaration.name, predicate_declaration.arity),
|
|
crate::project::FormulaStatementKind::Completion(crate::project::CompletionTarget::Constraint)
|
|
=> write!(format, "completion(constraint)"),
|
|
crate::project::FormulaStatementKind::Assumption => write!(format, "assumption"),
|
|
crate::project::FormulaStatementKind::Assertion => write!(format, "assertion"),
|
|
crate::project::FormulaStatementKind::Lemma(None) => write!(format, "lemma"),
|
|
crate::project::FormulaStatementKind::Lemma(Some(crate::project::ProofDirection::Forward)) => write!(format, "lemma(forward)"),
|
|
crate::project::FormulaStatementKind::Lemma(Some(crate::project::ProofDirection::Backward)) => write!(format, "lemma(backward)"),
|
|
}
|
|
}
|
|
}
|
|
|
|
impl std::fmt::Display for crate::project::FormulaStatementKind
|
|
{
|
|
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::FormulaStatement(ref formula_statement) =>
|
|
write!(format, "{}", formula_statement.original_text)?,
|
|
crate::project::Block::InputStatement(ref input_statement) =>
|
|
write!(format, "{}", input_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)
|
|
}
|
|
}
|