dlvhex
2.5.0
|
00001 /* dlvhex -- Answer-Set Programming with external interfaces. 00002 * Copyright (C) 2005-2007 Roman Schindlauer 00003 * Copyright (C) 2006-2015 Thomas Krennwallner 00004 * Copyright (C) 2009-2016 Peter Schüller 00005 * Copyright (C) 2011-2016 Christoph Redl 00006 * Copyright (C) 2015-2016 Tobias Kaminski 00007 * Copyright (C) 2015-2016 Antonius Weinzierl 00008 * Copyright (C) 2007, 2008 Thomas Krennwallner 00009 * 00010 * This file is part of dlvhex. 00011 * 00012 * dlvhex is free software; you can redistribute it and/or modify it 00013 * under the terms of the GNU Lesser General Public License as 00014 * published by the Free Software Foundation; either version 2.1 of 00015 * the License, or (at your option) any later version. 00016 * 00017 * dlvhex is distributed in the hope that it will be useful, but 00018 * WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00020 * Lesser General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU Lesser General Public 00023 * License along with dlvhex; if not, write to the Free Software 00024 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 00025 * 02110-1301 USA. 00026 */ 00027 00037 #if !defined(_DLVHEX_STATE_H) 00038 #define _DLVHEX_STATE_H 00039 00040 #include "dlvhex2/PlatformDefinitions.h" 00041 #include "dlvhex2/fwd.h" 00042 00043 #include <boost/shared_ptr.hpp> 00044 00045 DLVHEX_NAMESPACE_BEGIN 00046 00047 class State; 00048 typedef boost::shared_ptr<State> StatePtr; 00049 00055 class DLVHEX_EXPORT State 00056 { 00057 protected: 00062 void changeState(ProgramCtx* ctx, StatePtr newState); 00063 00064 public: 00067 State(StatePtr failureState=StatePtr()); 00069 virtual ~State(); 00070 00073 virtual void showPlugins(ProgramCtx* ctx); 00076 virtual void convert(ProgramCtx* ctx); 00079 virtual void parse(ProgramCtx* ctx); 00082 virtual void moduleSyntaxCheck(ProgramCtx* ctx); 00085 virtual void mlpSolver(ProgramCtx* ctx); 00088 virtual void rewriteEDBIDB(ProgramCtx* ctx); 00091 virtual void safetyCheck(ProgramCtx* ctx); 00094 virtual void createDependencyGraph(ProgramCtx* ctx); 00097 virtual void checkLiberalSafety(ProgramCtx* ctx); 00100 virtual void optimizeEDBDependencyGraph(ProgramCtx* ctx); 00103 virtual void createComponentGraph(ProgramCtx* ctx); 00106 virtual void strongSafetyCheck(ProgramCtx* ctx); 00107 virtual void createEvalGraph(ProgramCtx* ctx); 00110 virtual void setupProgramCtx(ProgramCtx* ctx); 00113 virtual void evaluate(ProgramCtx* ctx); 00116 virtual void postProcess(ProgramCtx* ctx); 00117 00118 protected: 00119 StatePtr failureState; 00120 }; 00121 00123 class DLVHEX_EXPORT ShowPluginsState : public State 00124 { 00125 public: 00127 ShowPluginsState(); 00128 virtual void showPlugins(ProgramCtx*); 00129 }; 00130 00132 class DLVHEX_EXPORT ConvertState : public State 00133 { 00134 public: 00136 ConvertState(); 00137 virtual void convert(ProgramCtx*); 00138 }; 00139 00141 class DLVHEX_EXPORT ParseState : public State 00142 { 00143 public: 00145 ParseState(); 00146 virtual void parse(ProgramCtx*); 00147 }; 00148 00150 class DLVHEX_EXPORT ModuleSyntaxCheckState : public State 00151 { 00152 public: 00154 ModuleSyntaxCheckState(); 00155 virtual void moduleSyntaxCheck(ProgramCtx*); 00156 }; 00157 00159 class DLVHEX_EXPORT MLPSolverState : public State 00160 { 00161 public: 00163 MLPSolverState(); 00164 virtual void mlpSolver(ProgramCtx*); 00165 }; 00166 00168 class DLVHEX_EXPORT RewriteEDBIDBState : public State 00169 { 00170 public: 00172 RewriteEDBIDBState(); 00173 virtual void rewriteEDBIDB(ProgramCtx*); 00174 }; 00175 00177 class DLVHEX_EXPORT SafetyCheckState : public State 00178 { 00179 public: 00181 SafetyCheckState(); 00182 virtual void safetyCheck(ProgramCtx*); 00183 }; 00184 00186 class DLVHEX_EXPORT CreateDependencyGraphState : public State 00187 { 00188 public: 00190 CreateDependencyGraphState(); 00191 virtual void createDependencyGraph(ProgramCtx*); 00192 }; 00193 00195 class DLVHEX_EXPORT CheckLiberalSafetyState : public State 00196 { 00197 public: 00199 CheckLiberalSafetyState(); 00200 virtual void checkLiberalSafety(ProgramCtx*); 00201 }; 00202 00204 class DLVHEX_EXPORT OptimizeEDBDependencyGraphState : public State 00205 { 00206 public: 00207 OptimizeEDBDependencyGraphState(); 00208 virtual void optimizeEDBDependencyGraph(ProgramCtx*); 00209 }; 00210 00212 class DLVHEX_EXPORT CreateComponentGraphState : public State 00213 { 00214 public: 00216 CreateComponentGraphState(); 00217 virtual void createComponentGraph(ProgramCtx*); 00218 }; 00219 00221 class DLVHEX_EXPORT StrongSafetyCheckState : public State 00222 { 00223 public: 00225 StrongSafetyCheckState(); 00226 virtual void strongSafetyCheck(ProgramCtx*); 00227 }; 00228 00230 class DLVHEX_EXPORT CreateEvalGraphState : public State 00231 { 00232 public: 00234 CreateEvalGraphState(); 00235 virtual void createEvalGraph(ProgramCtx*); 00236 }; 00237 00239 class DLVHEX_EXPORT SetupProgramCtxState : public State 00240 { 00241 public: 00243 SetupProgramCtxState(); 00244 virtual void setupProgramCtx(ProgramCtx*); 00245 }; 00246 00248 class DLVHEX_EXPORT EvaluateState : public State 00249 { 00250 public: 00252 EvaluateState(); 00253 virtual void evaluate(ProgramCtx*); 00254 }; 00255 00257 class DLVHEX_EXPORT PostProcessState : public State 00258 { 00259 public: 00261 PostProcessState(); 00262 virtual void postProcess(ProgramCtx*); 00263 }; 00264 00265 DLVHEX_NAMESPACE_END 00266 #endif // _DLVHEX_STATE_H 00267 00268 00269 // vim:expandtab:ts=4:sw=4: 00270 // mode: C++ 00271 // End: