2019-11-07 07:53:50 +01:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-07 08:12:26 +01:00
|
|
|
impl std::fmt::Debug for crate::project::FormulaStatementKind
|
2019-11-02 02:13:45 +01:00
|
|
|
{
|
|
|
|
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
|
|
|
{
|
|
|
|
match &self
|
|
|
|
{
|
2019-11-07 08:12:26 +01:00
|
|
|
crate::project::FormulaStatementKind::Axiom => write!(format, "axiom"),
|
|
|
|
crate::project::FormulaStatementKind::Completion(
|
2019-11-07 04:20:06 +01:00
|
|
|
crate::project::CompletionTarget::Predicate(predicate_declaration))
|
|
|
|
=> write!(format, "completion({}/{})", predicate_declaration.name, predicate_declaration.arity),
|
2019-11-07 08:12:26 +01:00
|
|
|
crate::project::FormulaStatementKind::Completion(crate::project::CompletionTarget::Constraint)
|
2019-11-07 04:20:06 +01:00
|
|
|
=> write!(format, "completion(constraint)"),
|
2019-11-07 08:12:26 +01:00
|
|
|
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)"),
|
2019-11-02 02:13:45 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-07 08:12:26 +01:00
|
|
|
impl std::fmt::Display for crate::project::FormulaStatementKind
|
2019-11-02 02:13:45 +01:00
|
|
|
{
|
|
|
|
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
|
|
|
{
|
|
|
|
write!(format, "{:?}", &self)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-06 11:36:51 +01:00
|
|
|
impl std::fmt::Debug for crate::Project
|
2019-11-02 02:13:45 +01:00
|
|
|
{
|
|
|
|
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
|
|
|
{
|
2019-11-05 19:44:28 +01:00
|
|
|
for block in &self.blocks
|
2019-11-02 02:13:45 +01:00
|
|
|
{
|
2019-11-05 19:44:28 +01:00
|
|
|
match block
|
2019-11-02 02:13:45 +01:00
|
|
|
{
|
2019-11-05 19:44:28 +01:00
|
|
|
crate::project::Block::Whitespace(ref text) => write!(format, "{}", text)?,
|
2019-11-07 08:12:26 +01:00
|
|
|
crate::project::Block::FormulaStatement(ref formula_statement) =>
|
|
|
|
write!(format, "{}", formula_statement.original_text)?,
|
2019-11-02 02:13:45 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-06 11:36:51 +01:00
|
|
|
impl std::fmt::Display for crate::Project
|
2019-11-02 02:13:45 +01:00
|
|
|
{
|
|
|
|
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
|
|
|
{
|
|
|
|
write!(format, "{:?}", &self)
|
|
|
|
}
|
|
|
|
}
|