00001
00027
00028
00029
00030
00031
00032
00033 #ifndef __Miniscope__
00034 #define __Miniscope__
00035
00036
00037 #include "Position.hpp"
00038 #include "Formula.hpp"
00039
00040
00041 class Miniscope
00042 {
00043 public:
00044
00045 Miniscope (Formula::Connective Q,
00046 const VarList& vars,
00047 const Formula&,
00048 const Position& pos);
00049 ~Miniscope ();
00050
00051 bool noMiniscoping () const;
00052 void pushOnes (InferenceList&);
00053 bool pushMany (InferenceList&);
00054 void result (Formula& res);
00055
00056 private:
00057 Formula::Connective _quant;
00058 const Formula& _formula;
00059 const int _nfs;
00060 int _realNfs;
00061 int _nvs;
00062 bool** _occ;
00063 bool* _mem;
00064 bool** _index;
00065 Var* _vars;
00066 int* _N;
00067 Var _maxV;
00068 Formula* _formulas;
00069 Position _position;
00070
00071 void count (const Formula&, int formNumber);
00072 void count (const Term&, int formNumber);
00073 void pushOne (Var v, int k, InferenceList&);
00074 void occurInSameFormulas (int v, IntList& vs) const;
00075 bool occurInSameFormulas (int v, int w) const;
00076 void decodeVars (const IntList& in, VarList& out) const;
00077 void decodeFormulas (const IntList& in, IntList& out) const;
00078 void decodeFormulas (const IntList& in, IntList& out,
00079 int inIndex, int outIndex) const;
00080 void deleteVars (const IntList& vs);
00081 void partition (const FormulaList& F, Var v, FormulaList& G, FormulaList& H);
00082 };
00083
00084
00085 #endif // __Miniscope__