00001
00002
00003
00004
00005
00006
00007
00008 #ifndef EXISTENTIALELIMINATOR_H_
00009 #define EXISTENTIALELIMINATOR_H_
00010
00011 #include <map>
00012 #include <set>
00013 using namespace std;
00014
00015 class CNode;
00016 class Term;
00017 class FunctionTerm;
00018
00019 class ExistentialEliminator {
00020 private:
00021 CNode* c;
00022 Term* elim_t;
00023 CNode* result;
00024 bool overapprox;
00025
00026 bool simplify;
00027
00028
00029
00030
00031
00032
00033
00034 map<int, map<Term*, Term*> > function_terms_to_vars;
00035
00036
00037
00038
00039
00040 set<Term*> new_elim_terms;
00041
00042
00043
00044
00045
00046 map<int, set<Term*> > function_ids_to_terms;
00047
00048
00049 public:
00050 ExistentialEliminator(CNode* c, Term* t, bool overapproximation);
00051 CNode* get_result();
00052 ~ExistentialEliminator();
00053
00054 private:
00055 CNode* eliminate_existential(CNode* c);
00056
00057
00058
00059
00060
00061
00062 CNode* collect_function_terms_containing_elim_t(CNode* c);
00063
00064
00065
00066
00067 void build_map_from_fun_id_to_terms(CNode* c);
00068
00069
00070 CNode* get_functional_consistency_axioms();
00071
00072
00073
00074
00075 CNode* args_equal(FunctionTerm* ft1, FunctionTerm* ft2);
00076
00077 bool contained_in_function_term(CNode* c, Term* t);
00078
00079 CNode* replace_elim_t_in_function(CNode* c, Term* elim_t);
00080
00081 CNode* find_disjunctive_equalities(CNode* c, Term* elim_t,
00082 bool parent_conjunct);
00083
00084 };
00085
00086 #endif