Browse Source
			
			
			make storm compile when carl is not available
			
				
		make storm compile when carl is not available
	
		
	
			
				added settings for smt-lib solver
Former-commit-id: 7d1872267a
			
			
				main
			
			
		
				 7 changed files with 163 additions and 13 deletions
			
			
		- 
					5src/modelchecker/reachability/SparseDtmcEliminationModelChecker.cpp
- 
					7src/modelchecker/reachability/SparseDtmcEliminationModelChecker.h
- 
					5src/settings/SettingsManager.cpp
- 
					8src/settings/SettingsManager.h
- 
					48src/settings/modules/Smt2SmtSolverSettings.cpp
- 
					65src/settings/modules/Smt2SmtSolverSettings.h
- 
					28src/solver/Smt2SmtSolver.cpp
| @ -0,0 +1,48 @@ | |||||
|  | #include "src/settings/modules/Smt2SmtSolverSettings.h"
 | ||||
|  | 
 | ||||
|  | #include "src/settings/SettingsManager.h"
 | ||||
|  | 
 | ||||
|  | namespace storm { | ||||
|  |     namespace settings { | ||||
|  |         namespace modules { | ||||
|  |              | ||||
|  |             const std::string Smt2SmtSolverSettings::moduleName = "smt2smtsolver"; | ||||
|  |             const std::string Smt2SmtSolverSettings::solverCommandOption = "solvercommand"; | ||||
|  |             const std::string Smt2SmtSolverSettings::exportSmtLibScriptOption = "exportSmtLibScript"; | ||||
|  |              | ||||
|  |             Smt2SmtSolverSettings::Smt2SmtSolverSettings(storm::settings::SettingsManager& settingsManager) : ModuleSettings(settingsManager, moduleName) { | ||||
|  |                 this->addOption(storm::settings::OptionBuilder(moduleName, solverCommandOption, true, "If set, this command is used to call the solver and to let the solver know that it should read SMT-LIBv2 commands from standard input. If not set, only a SMT-LIB script file might be exported.").addArgument(storm::settings::ArgumentBuilder::createStringArgument("command", "path to the solver + command line arguments.").setDefaultValueString("").build()).build()); | ||||
|  |                  | ||||
|  |                 this->addOption(storm::settings::OptionBuilder(moduleName, exportSmtLibScriptOption, true, "If set, the SMT-LIBv2 script will be exportet to this file.").addArgument(storm::settings::ArgumentBuilder::createStringArgument("path", "path and filename to the location where the script file should be exportet to").setDefaultValueString("").build()).build()); | ||||
|  |             } | ||||
|  |              | ||||
|  |             bool Smt2SmtSolverSettings::isSolverCommandSet() const{ | ||||
|  |                 return this->getOption(solverCommandOption).getHasOptionBeenSet(); | ||||
|  |             } | ||||
|  | 
 | ||||
|  |             std::string Smt2SmtSolverSettings::getSolverCommand() const{ | ||||
|  |                 return this->getOption(solverCommandOption).getArgumentByName("command").getValueAsString(); | ||||
|  |             } | ||||
|  | 
 | ||||
|  | 
 | ||||
|  |             bool Smt2SmtSolverSettings::isExportSmtLibScriptSet() const{ | ||||
|  |                 return this->getOption(exportSmtLibScriptOption).getHasOptionBeenSet(); | ||||
|  |             } | ||||
|  | 
 | ||||
|  | 
 | ||||
|  |             std::string Smt2SmtSolverSettings::getExportSmtLibScriptPath() const{ | ||||
|  |                 return this->getOption(solverCommandOption).getArgumentByName("path").getValueAsString(); | ||||
|  |             } | ||||
|  | 
 | ||||
|  | 
 | ||||
|  |             bool Smt2SmtSolverSettings::check() const { | ||||
|  |                 if (isSolverCommandSet() || isExportSmtLibScriptSet()) { | ||||
|  |                 //TODO check if paths are valid
 | ||||
|  |     | ||||
|  |                 } | ||||
|  |                 return true; | ||||
|  |             } | ||||
|  |              | ||||
|  |         } // namespace modules
 | ||||
|  |     } // namespace settings
 | ||||
|  | } // namespace storm
 | ||||
| @ -0,0 +1,65 @@ | |||||
|  | #ifndef STORM_SETTINGS_MODULES_SMT2SMTSOLVERSETTINGS_H_ | ||||
|  | #define STORM_SETTINGS_MODULES_SMT2SMTSOLVERSETTINGS_H_ | ||||
|  | 
 | ||||
|  | #include "src/settings/modules/ModuleSettings.h" | ||||
|  | 
 | ||||
|  | namespace storm { | ||||
|  |     namespace settings { | ||||
|  |         namespace modules { | ||||
|  |              | ||||
|  |             /*! | ||||
|  |              * This class represents the settings for interaction with SMT-LIBv2 solvers. | ||||
|  |              */ | ||||
|  |             class Smt2SmtSolverSettings : public ModuleSettings { | ||||
|  |             public: | ||||
|  |                 /*! | ||||
|  |                  * Creates a new set of Smt2SmtSolver settings that is managed by the given manager. | ||||
|  |                  * | ||||
|  |                  * @param settingsManager The responsible manager. | ||||
|  |                  */ | ||||
|  |                 Smt2SmtSolverSettings(storm::settings::SettingsManager& settingsManager); | ||||
|  |                  | ||||
|  |                 /*! | ||||
|  |                  * Retrieves whether the solver command has been set. | ||||
|  |                  * | ||||
|  |                  * @return True iff the solver command has been set. | ||||
|  |                  */ | ||||
|  |                 bool isSolverCommandSet() const; | ||||
|  | 
 | ||||
|  |                 /*! | ||||
|  |                 * Retrieves the solver command i.e. the path and the command line arguments for the solver. | ||||
|  |                 * | ||||
|  |                 * @return The solver command to be used | ||||
|  |                 */ | ||||
|  |                 std::string getSolverCommand() const; | ||||
|  |                  | ||||
|  |                 /*! | ||||
|  |                 * Retrieves whether the SMT-LIBv2 script should be exportet to a file. | ||||
|  |                 * | ||||
|  |                 * @return True iff the SMT-LIBv2 script should be exportet to a file. | ||||
|  |                 */ | ||||
|  |                 bool isExportSmtLibScriptSet() const; | ||||
|  | 
 | ||||
|  |                 /*! | ||||
|  |                 * Retrieves the path where the SMT-LIBv2 script file should be exportet to. | ||||
|  |                 * | ||||
|  |                 * @return the path where the SMT-LIBv2 script file should be exportet to. | ||||
|  |                 */ | ||||
|  |                 std::string getExportSmtLibScriptPath() const; | ||||
|  | 
 | ||||
|  |                 bool check() const override; | ||||
|  |                  | ||||
|  |                 // The name of the module. | ||||
|  |                 static const std::string moduleName; | ||||
|  |                  | ||||
|  |             private: | ||||
|  |                 // Define the string names of the options as constants. | ||||
|  |                 static const std::string solverCommandOption; | ||||
|  |                 static const std::string exportSmtLibScriptOption; | ||||
|  |             }; | ||||
|  |              | ||||
|  |         } // namespace modules | ||||
|  |     } // namespace settings | ||||
|  | } // namespace storm | ||||
|  | 
 | ||||
|  | #endif /* STORM_SETTINGS_MODULES_SMT2SMTSOLVERSETTINGS_H_ */ | ||||
						Write
						Preview
					
					
					Loading…
					
					Cancel
						Save
					
		Reference in new issue