00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _cvcl__search__search_theorem_producer_h_
00031 #define _cvcl__search__search_theorem_producer_h_
00032
00033 #include "theorem_producer.h"
00034 #include "search_rules.h"
00035
00036 namespace CVCL {
00037
00038 class CommonProofRules;
00039
00040 class SearchEngineTheoremProducer
00041 : public SearchEngineRules,
00042 public TheoremProducer {
00043 private:
00044 CommonProofRules* d_commonRules;
00045
00046 void verifyConflict(const Theorem& thm, TheoremMap& m);
00047
00048 void checkSoundNoSkolems(const Expr& e, ExprMap<bool>& visited,
00049 const ExprMap<bool>& skolems);
00050 void checkSoundNoSkolems(const Theorem& t, ExprMap<bool>& visited,
00051 const ExprMap<bool>& skolems);
00052 public:
00053 SearchEngineTheoremProducer(TheoremManager* tm);
00054
00055 virtual ~SearchEngineTheoremProducer() { }
00056
00057
00058
00059 virtual Theorem proofByContradiction(const Expr& a,
00060 const Theorem& pfFalse);
00061
00062
00063
00064 virtual Theorem negIntro(const Expr& not_a, const Theorem& pfFalse);
00065
00066
00067 virtual Theorem caseSplit(const Expr& a,
00068 const Theorem& a_proves_c,
00069 const Theorem& not_a_proves_c);
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080 virtual Theorem eliminateSkolemAxioms(const Theorem& tFalse,
00081 const std::vector<Theorem>& delta);
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094 virtual Theorem conflictClause(const Theorem& thm,
00095 const std::vector<Theorem>& lits,
00096 const std::vector<Theorem>& gamma);
00097
00098
00099 virtual Theorem cutRule(const std::vector<Theorem>& thmsA,
00100 const Theorem& as_prove_b);
00101
00102
00103
00104
00105 virtual Theorem unitProp(const std::vector<Theorem>& thms,
00106 const Theorem& clause, unsigned i);
00107
00108
00109
00110 virtual Theorem conflictRule(const std::vector<Theorem>& thms,
00111 const Theorem& clause);
00112
00113
00114 virtual Theorem propAndrAF(const Theorem& andr_th,
00115 bool left,
00116 const Theorem& b_th);
00117
00118 virtual Theorem propAndrAT(const Theorem& andr_th,
00119 const Theorem& l_th,
00120 const Theorem& r_th);
00121
00122
00123 virtual void propAndrLRT(const Theorem& andr_th,
00124 const Theorem& a_th,
00125 Theorem* l_th,
00126 Theorem* r_th);
00127
00128 virtual Theorem propAndrLF(const Theorem& andr_th,
00129 const Theorem& a_th,
00130 const Theorem& r_th);
00131
00132 virtual Theorem propAndrRF(const Theorem& andr_th,
00133 const Theorem& a_th,
00134 const Theorem& l_th);
00135
00136
00137 virtual Theorem confAndrAT(const Theorem& andr_th,
00138 const Theorem& a_th,
00139 bool left,
00140 const Theorem& b_th);
00141
00142 virtual Theorem confAndrAF(const Theorem& andr_th,
00143 const Theorem& a_th,
00144 const Theorem& l_th,
00145 const Theorem& r_th);
00146
00147
00148 virtual Theorem propIffr(const Theorem& iffr_th,
00149 int p,
00150 const Theorem& a_th,
00151 const Theorem& b_th);
00152
00153
00154 virtual Theorem confIffr(const Theorem& iffr_th,
00155 const Theorem& i_th,
00156 const Theorem& l_th,
00157 const Theorem& r_th);
00158
00159
00160 virtual Theorem propIterIte(const Theorem& iter_th,
00161 bool left,
00162 const Theorem& if_th,
00163 const Theorem& then_th);
00164
00165 virtual void propIterIfThen(const Theorem& iter_th,
00166 bool left,
00167 const Theorem& ite_th,
00168 const Theorem& then_th,
00169 Theorem* if_th,
00170 Theorem* else_th);
00171
00172 virtual Theorem propIterThen(const Theorem& iter_th,
00173 const Theorem& ite_th,
00174 const Theorem& if_th);
00175
00176
00177 virtual Theorem confIterThenElse(const Theorem& iter_th,
00178 const Theorem& ite_th,
00179 const Theorem& then_th,
00180 const Theorem& else_th);
00181
00182 virtual Theorem confIterIfThen(const Theorem& iter_th,
00183 bool left,
00184 const Theorem& ite_th,
00185 const Theorem& if_th,
00186 const Theorem& then_th);
00187
00188
00189 Theorem andCNFRule(const Theorem& thm);
00190 Theorem orCNFRule(const Theorem& thm);
00191 Theorem impCNFRule(const Theorem& thm);
00192 Theorem iffCNFRule(const Theorem& thm);
00193 Theorem iteCNFRule(const Theorem& thm);
00194 Theorem iteToClauses(const Theorem& ite);
00195 Theorem iffToClauses(const Theorem& iff);
00196
00197
00198
00199
00200 private:
00201 Theorem opCNFRule(const Theorem& thm, int kind,
00202 const std::string& ruleName);
00203
00204 Expr convertToCNF(const Expr& v, const Expr & phi);
00205
00206
00207
00208 Expr findInLocalCache(const Expr& i,
00209 ExprMap<Expr>& localCache,
00210 std::vector<Expr>& boundVars);
00211
00212 };
00213 }
00214 #endif