Skip to content

Commit

Permalink
Make get-proof command SMT-LIB compliant. (#4)
Browse files Browse the repository at this point in the history
Make `get-proof` command SMT-LIB compliant.
  • Loading branch information
HanielB authored Nov 8, 2022
2 parents 6751c64 + 4347ea5 commit cacfb32
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/parser/api/cpp/command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1490,7 +1490,12 @@ void GetProofCommand::invoke(cvc5::Solver* solver, SymbolManager* sm)

void GetProofCommand::printResult(cvc5::Solver* solver, std::ostream& out) const
{
out << d_result;
std::string result = d_result;
if (solver->getOption("proof-format-mode") == "lean")
{
result = "(proof \"" + result + "\")\n";
}
out << result;
}

std::string GetProofCommand::getCommandName() const { return "get-proof"; }
Expand Down
2 changes: 1 addition & 1 deletion src/proof/lean/lean_node_converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ Node LeanNodeConverter::convert(Node n)
{
TypeNode tn = cur.getType();
AlwaysAssert(tn.isInteger()) << "Only support integer rationals\n";
res = mkInt(cur);
res = cur;
break;
}
case kind::CONST_BITVECTOR:
Expand Down
1 change: 0 additions & 1 deletion src/proof/lean/lean_node_converter.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ class LeanNodeConverter
// Node mkList(const std::vector<Node>& nodes);

Node mkInt(unsigned i);
Node mkInt(Node i);

std::vector<Node> getOperatorIndices(Kind k, Node n);

Expand Down

0 comments on commit cacfb32

Please sign in to comment.