* directory for licensing information.
* ****************************************************************************
*
- * A simple demonstration of the capabilities of CVC4
+ * A simple demonstration of the capabilities of cvc5
*
* A simple demonstration of how to use uninterpreted functions, combining this
* with arithmetic, and extracting a model at the end of a satisfiable query.
{
Solver slv;
slv.setOption("produce-models", "true"); // Produce Models
- slv.setOption("output-language", "cvc4"); // Set the output-language to CVC's
+ slv.setOption("output-language", "cvc"); // Set the output-language to CVC's
slv.setOption("dag-thresh", "0"); // Disable dagifying the output
slv.setOption("output-language", "smt2"); // use smt-lib v2 as output language
slv.setLogic(string("QF_UFLIRA"));
<< assertions << endl << endl;
cout << "Prove x /= y is entailed. " << endl
- << "CVC4: " << slv.checkEntailed(slv.mkTerm(DISTINCT, x, y)) << "."
+ << "cvc5: " << slv.checkEntailed(slv.mkTerm(DISTINCT, x, y)) << "."
<< endl
<< endl;
cout << "Call checkSat to show that the assertions are satisfiable. "
<< endl
- << "CVC4: "
+ << "cvc5: "
<< slv.checkSat() << "."<< endl << endl;
cout << "Call slv.getValue(...) on terms of interest."
if __name__ == "__main__":
slv = pycvc4.Solver()
slv.setOption("produce-models", "true") # Produce Models
- slv.setOption("output-language", "cvc4") # Set the output-language to CVC's
+ slv.setOption("output-language", "cvc") # Set the output-language to CVC's
slv.setOption("dag-thresh", "0") # Disable dagifying the output
slv.setOption("output-language", "smt2") # use smt-lib v2 as output language
slv.setLogic("QF_UFLIRA")
slv.assertFormula(assertions)
print("Given the following assertions:", assertions, "\n")
- print("Prove x /= y is entailed.\nCVC4: ",
+ print("Prove x /= y is entailed.\ncvc5: ",
slv.checkEntailed(slv.mkTerm(kinds.Distinct, x, y)), "\n")
print("Call checkSat to show that the assertions are satisfiable")
- print("CVC4:", slv.checkSat(), "\n")
+ print("cvc5:", slv.checkSat(), "\n")
print("Call slv.getValue(...) on terms of interest")
print("slv.getValue({}): {}".format(f_x, slv.getValue(f_x)))
}/* switch(language) */
}/* toOutputLanguage() */
-OutputLanguage toOutputLanguage(std::string language) {
- if (language == "cvc4" || language == "pl" || language == "presentation"
+OutputLanguage toOutputLanguage(std::string language)
+{
+ if (language == "cvc" || language == "pl" || language == "presentation"
|| language == "native" || language == "LANG_CVC")
{
return output::LANG_CVC;
}
- else if (language == "cvc3" || language == "LANG_CVC3")
- {
- return output::LANG_CVC3;
- }
else if (language == "smtlib" || language == "smt" || language == "smtlib2"
|| language == "smt2" || language == "smtlib2.6"
|| language == "smt2.6" || language == "LANG_SMTLIB_V2_6"
|| language == "LANG_SMTLIB_V2")
{
return output::LANG_SMTLIB_V2_6;
- } else if(language == "tptp" || language == "LANG_TPTP") {
+ }
+ else if (language == "tptp" || language == "LANG_TPTP")
+ {
return output::LANG_TPTP;
}
else if (language == "sygus" || language == "LANG_SYGUS"
return output::LANG_AUTO;
}
- throw OptionException(std::string("unknown output language `" + language + "'"));
-}/* toOutputLanguage() */
+ throw OptionException(
+ std::string("unknown output language `" + language + "'"));
+}
InputLanguage toInputLanguage(std::string language) {
- if (language == "cvc4" || language == "pl" || language == "presentation"
+ if (language == "cvc" || language == "pl" || language == "presentation"
|| language == "native" || language == "LANG_CVC")
{
return input::LANG_CVC;
/** The AST output language */
LANG_AST = 10,
- /** The CVC3-compatibility output language */
- LANG_CVC3,
/** LANG_MAX is > any valid OutputLanguage id */
LANG_MAX
case LANG_AST:
out << "LANG_AST";
break;
- case LANG_CVC3:
- out << "LANG_CVC3";
- break;
default:
out << "undefined_output_language";
}
"\
Languages currently supported as arguments to the -L / --lang option:\n\
auto attempt to automatically determine language\n\
- cvc4 | presentation | pl cvc5 presentation language\n\
+ cvc | presentation | pl CVC presentation language\n\
smt | smtlib | smt2 |\n\
smt2.6 | smtlib2.6 SMT-LIB format 2.6 with support for the strings standard\n\
tptp TPTP format (cnf, fof and tff)\n\
\n\
Languages currently supported as arguments to the --output-lang option:\n\
auto match output language to input language\n\
- cvc4 | presentation | pl cvc5 presentation language\n\
- cvc3 CVC3 presentation language\n\
+ cvc | presentation | pl CVC presentation language\n\
smt | smtlib | smt2 |\n\
smt2.6 | smtlib2.6 SMT-LIB format 2.6 with support for the strings standard\n\
tptp TPTP format\n\
case LANG_AST:
return unique_ptr<Printer>(new printer::ast::AstPrinter());
- case LANG_CVC3:
- return unique_ptr<Printer>(
- new printer::cvc::CvcPrinter(/* cvc3-mode = */ true));
-
default: Unhandled() << lang;
}
}
* directory for licensing information.
* ****************************************************************************
*
- * "Ouroborous" test: does CVC4 read its own output?
+ * "Ouroborous" test: does cvc5 read its own output?
*
* The "Ouroborous" test, named after the serpent that swallows its
- * own tail, ensures that CVC4 can parse some input, output it again
+ * own tail, ensures that cvc5 can parse some input, output it again
* (in any of its languages) and then parse it again. The result of
* the first parse must be equal to the result of the second parse;
* both strings and expressions are compared for equality.
}
catch (...)
{
- std::cerr << "non-cvc4 exception thrown" << std::endl;
+ std::cerr << "non-cvc5 exception thrown" << std::endl;
}
return 1;
}
std::string input_language,
std::string output_language)
{
- assert(input_language == "smt2" || input_language == "cvc4");
- assert(output_language == "smt2" || output_language == "cvc4");
+ assert(input_language == "smt2" || input_language == "cvc");
+ assert(output_language == "smt2" || output_language == "cvc");
std::string declarations;
std::string input_language,
std::string output_language)
{
- assert(input_language == "smt2" || input_language == "cvc4");
- assert(output_language == "smt2" || output_language == "cvc4");
+ assert(input_language == "smt2" || input_language == "cvc");
+ assert(output_language == "smt2" || output_language == "cvc");
std::cout << "==============================================" << std::endl
<< "translating from "
<< " in language " << input::LANG_SMTLIB_V2 << std::endl;
std::string smt2str = translate(instr, instr_language, "smt2");
std::cout << "in SMT2 : " << smt2str << std::endl;
- std::string cvcstr = translate(smt2str, "smt2", "cvc4");
+ std::string cvcstr = translate(smt2str, "smt2", "cvc");
std::cout << "in CVC : " << cvcstr << std::endl;
- std::string outstr = translate(cvcstr, "cvc4", "smt2");
+ std::string outstr = translate(cvcstr, "cvc", "smt2");
std::cout << "back to SMT2 : " << outstr << std::endl << std::endl;
assert(outstr == smt2str); // differences in output
int32_t runTest()
{
runTestString("(= (f (f y)) x)", "smt2");
- runTestString("~BVPLUS(3, 0bin00, 0bin11)[2:1] = 0bin10", "cvc4");
- runTestString("~BVPLUS(3, BVMULT(2, 0bin01, 0bin11), 0bin11)[2:0]", "cvc4");
- runTestString("a[x][y] = a[y][x]", "cvc4");
+ runTestString("~BVPLUS(3, 0bin00, 0bin11)[2:1] = 0bin10", "cvc");
+ runTestString("~BVPLUS(3, BVMULT(2, 0bin01, 0bin11), 0bin11)[2:0]", "cvc");
+ runTestString("a[x][y] = a[y][x]", "cvc");
return 0;
}