Rename “assert” statement to “spec”

This commit is contained in:
2020-05-22 18:34:59 +02:00
parent 116f74f63e
commit 739cae1f7c
9 changed files with 26 additions and 23 deletions

View File

@@ -364,16 +364,16 @@ pub(crate) fn parse_specification(mut input: &str, problem: &crate::Problem)
continue;
},
"assert" =>
"spec" =>
{
let (formula, remaining_input) = formula_statement_body(input, problem)?;
input = remaining_input;
let statement = crate::problem::Statement::new(
crate::problem::StatementKind::Assertion, formula);
crate::problem::StatementKind::Spec, formula);
problem.add_statement(crate::problem::SectionKind::Assertions, statement);
problem.add_statement(crate::problem::SectionKind::Specs, statement);
continue;
},

View File

@@ -190,7 +190,8 @@ impl Problem
{
self.print_step_title("Started",
termcolor::ColorSpec::new().set_bold(true).set_fg(Some(termcolor::Color::Green)))?;
self.shell.borrow_mut().println(&"verification of assertions from translated program",
self.shell.borrow_mut().println(
&"verification of specification from translated program",
&termcolor::ColorSpec::new())?;
let mut statements = self.statements.borrow_mut();
@@ -229,7 +230,7 @@ impl Problem
};
self.print_step_title("Finished", &step_title_color)?;
println!("verification of assertions from translated program");
println!("verification of specification from translated program");
}
if proof_direction == ProofDirection::Both
@@ -242,7 +243,8 @@ impl Problem
{
self.print_step_title("Started",
termcolor::ColorSpec::new().set_bold(true).set_fg(Some(termcolor::Color::Green)))?;
self.shell.borrow_mut().println(&"verification of translated program from assertions",
self.shell.borrow_mut().println(
&"verification of translated program from specification",
&termcolor::ColorSpec::new())?;
let mut statements = self.statements.borrow_mut();
@@ -256,7 +258,7 @@ impl Problem
{
StatementKind::Axiom
| StatementKind::Assumption
| StatementKind::Assertion =>
| StatementKind::Spec =>
statement.proof_status = ProofStatus::AssumedProven,
StatementKind::Lemma(ProofDirection::Forward) =>
statement.proof_status = ProofStatus::Ignored,
@@ -280,7 +282,7 @@ impl Problem
};
self.print_step_title("Finished", &step_title_color)?;
println!("verification of translated program from assertions");
println!("verification of translated program from specification");
}
Ok(())
@@ -537,6 +539,7 @@ impl<'p> std::fmt::Display for ProblemTPTPDisplay<'p>
continue;
}
// TODO: refactor
let title = match section_kind
{
SectionKind::CompletedDefinitions => "completed definitions",
@@ -544,7 +547,7 @@ impl<'p> std::fmt::Display for ProblemTPTPDisplay<'p>
SectionKind::Axioms => "axioms",
SectionKind::Assumptions => "assumptions",
SectionKind::Lemmas => "lemmas",
SectionKind::Assertions => "assertions",
SectionKind::Specs => "specs",
};
write_title(formatter, title, section_separator)?;

View File

@@ -7,7 +7,7 @@ pub enum SectionKind
Lemmas,
CompletedDefinitions,
IntegrityConstraints,
Assertions,
Specs,
}
impl std::fmt::Debug for SectionKind
@@ -21,7 +21,7 @@ impl std::fmt::Debug for SectionKind
Self::Axioms => write!(formatter, "axiom"),
Self::Assumptions => write!(formatter, "assumption"),
Self::Lemmas => write!(formatter, "lemma"),
Self::Assertions => write!(formatter, "assertion"),
Self::Specs => write!(formatter, "spec"),
}
}
}

View File

@@ -8,7 +8,7 @@ pub(crate) enum StatementKind
CompletedDefinition(std::rc::Rc<crate::PredicateDeclaration>),
IntegrityConstraint,
Lemma(ProofDirection),
Assertion,
Spec,
}
impl std::fmt::Debug for StatementKind
@@ -23,7 +23,7 @@ impl std::fmt::Debug for StatementKind
write!(formatter, "completed definition of {}", predicate_declaration.declaration),
Self::IntegrityConstraint => write!(formatter, "integrity constraint"),
Self::Lemma(_) => write!(formatter, "lemma"),
Self::Assertion => write!(formatter, "assertion"),
Self::Spec => write!(formatter, "spec"),
}
}
}