Expr CnfProof::getAtom(prop::SatVariable var) {
prop::SatLiteral lit (var);
- Expr atom = d_cnfStream->getNode(lit).toExpr();
+ Node node = d_cnfStream->getNode(lit);
+ Expr atom = node.toExpr();
return atom;
}
ProofManager::var_iterator end = ProofManager::currentPM()->end_vars();
for (;it != end; ++it) {
- Expr atom = getAtom(*it);
os << "(decl_atom ";
- LFSCTheoryProof::printFormula(atom, os);
+
+ if (ProofManager::currentPM()->getLogic().compare("QF_UF") == 0) {
+ Expr atom = getAtom(*it);
+ LFSCTheoryProof::printFormula(atom, os);
+ } else {
+ // print fake atoms for all other logics
+ os << "true ";
+ }
+
os << " (\\ " << ProofManager::getVarName(*it) << " (\\ " << ProofManager::getAtomName(*it) << "\n";
paren << ")))";
}
#include "proof/cnf_proof.h"
#include "proof/theory_proof.h"
#include "util/cvc4_assert.h"
+#include "smt/smt_engine.h"
+#include "smt/smt_engine_scope.h"
namespace CVC4 {
}
}
-Proof* ProofManager::getProof() {
+Proof* ProofManager::getProof(SmtEngine* smt) {
if (currentPM()->d_fullProof != NULL)
return currentPM()->d_fullProof;
Assert (currentPM()->d_format == LFSC);
- currentPM()->d_fullProof = new LFSCProof((LFSCSatProof*)getSatProof(),
+ currentPM()->d_fullProof = new LFSCProof(smt,
+ (LFSCSatProof*)getSatProof(),
(LFSCCnfProof*)getCnfProof(),
(LFSCTheoryProof*)getTheoryProof());
return currentPM()->d_fullProof;
d_inputFormulas.insert(formula);
}
+void ProofManager::setLogic(const std::string& logic_string) {
+ d_logic = logic_string;
+}
+
-LFSCProof::LFSCProof(LFSCSatProof* sat, LFSCCnfProof* cnf, LFSCTheoryProof* theory)
+LFSCProof::LFSCProof(SmtEngine* smtEngine, LFSCSatProof* sat, LFSCCnfProof* cnf, LFSCTheoryProof* theory)
: d_satProof(sat)
, d_cnfProof(cnf)
, d_theoryProof(theory)
+ , d_smtEngine(smtEngine)
{
d_satProof->constructProof();
}
void LFSCProof::toStream(std::ostream& out) {
+ smt::SmtScope scope(d_smtEngine);
std::ostringstream paren;
out << "(check \n";
- d_theoryProof->printAssertions(out, paren);
+ if (ProofManager::currentPM()->getLogic().compare("QF_UF") == 0) {
+ d_theoryProof->printAssertions(out, paren);
+ }
out << "(: (holds cln) \n";
d_cnfProof->printAtomMapping(out, paren);
d_cnfProof->printClauses(out, paren);
namespace prop {
class CnfStream;
}
+
+class SmtEngine;
+
typedef int ClauseId;
class Proof;
static bool isInitialized;
ProofManager(ProofFormat format = LFSC);
~ProofManager();
+protected:
+ std::string d_logic;
public:
static ProofManager* currentPM();
// initialization
static void initCnfProof(CVC4::prop::CnfStream* cnfStream);
static void initTheoryProof();
- static Proof* getProof();
+ static Proof* getProof(SmtEngine* smt);
static SatProof* getSatProof();
static CnfProof* getCnfProof();
static TheoryProof* getTheoryProof();
static std::string getVarName(prop::SatVariable var);
static std::string getAtomName(prop::SatVariable var);
static std::string getLitName(prop::SatLiteral lit);
+
+ void setLogic(const std::string& logic_string);
+ const std::string getLogic() const { return d_logic; }
};/* class ProofManager */
class LFSCProof : public Proof {
LFSCSatProof* d_satProof;
LFSCCnfProof* d_cnfProof;
- LFSCTheoryProof* d_theoryProof;
+ LFSCTheoryProof* d_theoryProof;
+ SmtEngine* d_smtEngine;
public:
- LFSCProof(LFSCSatProof* sat, LFSCCnfProof* cnf, LFSCTheoryProof* theory);
+ LFSCProof(SmtEngine* smtEngine, LFSCSatProof* sat, LFSCCnfProof* cnf, LFSCTheoryProof* theory);
virtual void toStream(std::ostream& out);
virtual ~LFSCProof() {}
};
res->addStep(lit, res_id, !sign(lit));
}
registerResolution(d_emptyClauseId, res);
- // FIXME: massive hack
- Proof* proof = ProofManager::getProof();
- proof->toStream(std::cout);
+ // // FIXME: massive hack
+ // Proof* proof = ProofManager::getProof();
+ // proof->toStream(std::cout);
}
/// CRef manager
// declaring the terms
for (ExprSet::const_iterator it = d_termDeclarations.begin(); it != d_termDeclarations.end(); ++it) {
Expr term = *it;
-
+
os << "(% " << term << " (term ";
paren <<")";
if(options::cumulativeMillisecondLimit() != 0) {
setTimeLimit(options::cumulativeMillisecondLimit(), true);
}
+ PROOF( ProofManager::currentPM()->setLogic(d_logic.getLogicString()); );
}
void SmtEngine::finalOptionsAreSet() {
throw ModalException(msg);
}
- return ProofManager::getProof();
+ return ProofManager::getProof(this);
#else /* CVC4_PROOF */
throw ModalException("This build of CVC4 doesn't have proof support.");
#endif /* CVC4_PROOF */
simple.01.cvc \
simple.02.cvc \
simple.03.cvc \
- simple.04.cvc
+ simple.04.cvc \
+ proof00.smt2
EXTRA_DIST = $(TESTS) \
mkpidgeon
--- /dev/null
+; PROOF
+(set-logic QF_UF)
+(set-info :source |
+CADE ATP System competition. See http://www.cs.miami.edu/~tptp/CASC
+ for more information.
+
+This benchmark was obtained by trying to find a finite model of a first-order
+formula (Albert Oliveras).
+|)
+(set-info :smt-lib-version 2.0)
+(set-info :category "crafted")
+(set-info :status unsat)
+(declare-sort U 0)
+(declare-fun c3 () U)
+(declare-fun f1 (U U) U)
+(declare-fun f4 (U) U)
+(declare-fun c2 () U)
+(declare-fun c_0 () U)
+(declare-fun c_1 () U)
+(assert (let ((?v_1 (f1 c3 c_0))) (let ((?v_0 (f1 ?v_1 c_0)) (?v_2 (f1 c_0 c_0)) (?v_4 (f1 c_0 c_1)) (?v_3 (f1 ?v_1 c_1)) (?v_6 (f1 c3 c_1))) (let ((?v_5 (f1 ?v_6 c_0)) (?v_7 (f1 c_1 c_0)) (?v_9 (f1 c_1 c_1)) (?v_8 (f1 ?v_6 c_1)) (?v_10 (f4 c_0))) (let ((?v_11 (f1 c_0 ?v_10)) (?v_12 (f4 c_1))) (let ((?v_13 (f1 c_1 ?v_12)) (?v_15 (f1 c2 c_0))) (let ((?v_14 (f1 ?v_15 c_0)) (?v_16 (f1 ?v_15 c_1)) (?v_18 (f1 c2 c_1))) (let ((?v_17 (f1 ?v_18 c_0)) (?v_19 (f1 ?v_18 c_1))) (and (distinct c_0 c_1) (= (f1 ?v_0 c_0) (f1 c_0 ?v_2)) (= (f1 ?v_0 c_1) (f1 c_0 ?v_4)) (= (f1 ?v_3 c_0) (f1 c_1 ?v_2)) (= (f1 ?v_3 c_1) (f1 c_1 ?v_4)) (= (f1 ?v_5 c_0) (f1 c_0 ?v_7)) (= (f1 ?v_5 c_1) (f1 c_0 ?v_9)) (= (f1 ?v_8 c_0) (f1 c_1 ?v_7)) (= (f1 ?v_8 c_1) (f1 c_1 ?v_9)) (not (= ?v_11 (f1 ?v_10 ?v_11))) (not (= ?v_13 (f1 ?v_12 ?v_13))) (= (f1 ?v_14 c_0) (f1 (f1 ?v_2 c_0) c_0)) (= (f1 ?v_14 c_1) (f1 (f1 ?v_4 c_0) c_1)) (= (f1 ?v_16 c_0) (f1 (f1 ?v_2 c_1) c_0)) (= (f1 ?v_16 c_1) (f1 (f1 ?v_4 c_1) c_1)) (= (f1 ?v_17 c_0) (f1 (f1 ?v_7 c_0) c_0)) (= (f1 ?v_17 c_1) (f1 (f1 ?v_9 c_0) c_1)) (= (f1 ?v_19 c_0) (f1 (f1 ?v_7 c_1) c_0)) (= (f1 ?v_19 c_1) (f1 (f1 ?v_9 c_1) c_1)) (or (= ?v_2 c_0) (= ?v_2 c_1)) (or (= ?v_4 c_0) (= ?v_4 c_1)) (or (= ?v_7 c_0) (= ?v_7 c_1)) (or (= ?v_9 c_0) (= ?v_9 c_1)) (or (= ?v_10 c_0) (= ?v_10 c_1)) (or (= ?v_12 c_0) (= ?v_12 c_1)) (or (= c3 c_0) (= c3 c_1)) (or (= c2 c_0) (= c2 c_1)))))))))))
+(check-sat)
proof_command='(get-proof)'
lang=smt2
if test -e "$benchmark.expect"; then
- expected_proof=`grep '^% PROOF' "$benchmark.expect" &>/dev/null && echo yes`
+ expected_proof=`grep '^[%;] PROOF' "$benchmark.expect" &>/dev/null && echo yes`
expected_output=`grep '^% EXPECT: ' "$benchmark.expect" | sed 's,^% EXPECT: ,,'`
expected_error=`grep '^% EXPECT-ERROR: ' "$benchmark.expect" | sed 's,^% EXPECT-ERROR: ,,'`
expected_exit_status=`grep -m 1 '^% EXIT: ' "$benchmark.expect" | perl -pe 's,^% EXIT: ,,;s,\r,,'`
expected_exit_status=10
command_line=
elif grep '^ *( *set-info *:status *unsat' "$benchmark" &>/dev/null; then
- expected_proof=
+ expected_proof=`grep '^; PROOF' "$benchmark" &>/dev/null && echo yes`
expected_output=unsat
expected_exit_status=20
command_line=
if [ "$proof" = yes -a "$expected_proof" = yes ]; then
gettemp pfbenchmark cvc4_pfbenchmark.$$.XXXXXXXXXX
- cp "$benchmark" "$pfbenchmark";
- echo "$proof_command" >>"$pfbenchmark";
+ # remove exit command to add proof command for smt2 benchmarks
+ if expr "$benchmark" : '.*\.smt2$' &>/dev/null; then
+ head -n -0 "$benchmark" > "$pfbenchmark";
+ echo "$proof_command" >>"$pfbenchmark";
+ echo "(exit)" >> "$pfbenchmark";
+ else
+ cp $benchmark $pfbenchmark
+ echo "$proof_command" >>"$pfbenchmark";
+ fi
echo running $wrapper $cvc4full $CVC4_REGRESSION_ARGS $command_line --proof --segv-nospin `basename "$pfbenchmark"` [from working dir `dirname "$pfbenchmark"`]
time ( :; \
( cd `dirname "$pfbenchmark"`;
) > "$outfile" 2> "$errfile" )
gettemp pfoutfile cvc4_proof.$$.XXXXXXXXXX
+
diff --unchanged-group-format='' \
--old-group-format='' \
--new-group-format='%>' \