clingo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
Classes | Public Member Functions | Static Public Member Functions | List of all members
Clasp::Cli::ClaspCliConfig Class Reference

#include <clasp_options.h>

Inheritance diagram for Clasp::Cli::ClaspCliConfig:
Inheritance graph
Collaboration diagram for Clasp::Cli::ClaspCliConfig:
Collaboration graph

Classes

struct  ParseContext
 
class  ProgOption
 

Public Member Functions

 ClaspCliConfig ()
 
 ~ClaspCliConfig ()
 
Raw interface
void init (uint32 solverId, ConfigKey config=config_asp_default)
 Initializes the i'th solver with the given configuration. More...
 
void initTester (uint32 solverId, ConfigKey config=config_default)
 Initializes the i'th tester solver with the given configuration. More...
 
bool set (OptionKey o, const char *value)
 Sets the given option in the master configuration. More...
 
bool set (uint32 solverId, OptionKey o, const char *value)
 Sets the given option in the i'th solver. More...
 
bool setTester (uint32 solverId, OptionKey o, const char *value)
 Sets the given option in the i'th tester solver. More...
 
bool finalize ()
 Validates and finalizes this configuration. More...
 
App interface
void addOptions (ProgramOptions::OptionContext &root)
 Adds all available options to root. More...
 
void addDisabled (ProgramOptions::ParsedOptions &parsed)
 Adds options that are disabled by the options contained in parsed to parsed. More...
 
bool finalize (const ProgramOptions::ParsedOptions &parsed, ProblemType type, bool applyDefaults)
 Applies the options in parsed and calls finalize(). More...
 
template<class IT >
bool setConfig (IT first, IT last, ProblemType t)
 Populates this configuration with the options given in [first, last) and finalizes it. More...
 
- Public Member Functions inherited from Clasp::ClaspConfig
 ClaspConfig ()
 
 ~ClaspConfig ()
 
void prepare (SharedContext &)
 Prepares this configuration for the usage in the given context. More...
 
void reset ()
 
UserConfigtesterConfig () const
 
UserConfigaddTesterConfig ()
 
void setSolvers (uint32 n)
 
- Public Member Functions inherited from Clasp::BasicSatConfig
 BasicSatConfig ()
 
void prepare (SharedContext &)
 Prepares this configuration for the usage in the given context. More...
 
const CtxOptscontext () const
 Returns the options for the shared context. More...
 
uint32 numSolver () const
 Returns the number of solver options in this config. More...
 
uint32 numSearch () const
 Returns the number of search options in this config. More...
 
const SolverOptssolver (uint32 i) const
 Returns the solver options for the i'th solver to be attached to the SharedContext. More...
 
const SearchOptssearch (uint32 i) const
 Returns the search options for the i'th solver of the SharedContext. More...
 
DecisionHeuristicheuristic (uint32 i) const
 Returns the heuristic to be used in the i'th solver. More...
 
SolverOptsaddSolver (uint32 i)
 Returns the (modifiable) solver options for the i'th solver. More...
 
SearchOptsaddSearch (uint32 i)
 Returns the (modifiable) search options for the i'th solver. More...
 
virtual void resize (uint32 numSolver, uint32 numSearch)
 
- Public Member Functions inherited from Clasp::UserConfiguration
virtual bool addPost (Solver &s) const
 Adds post propagators to the given solver. More...
 
- Public Member Functions inherited from Clasp::Configuration
virtual ~Configuration ()
 
- Public Member Functions inherited from Clasp::ContextParams
 ContextParams ()
 

Static Public Member Functions

static ConfigKey allocConfig ()
 Registers a new empty configuration and returns its key. More...
 
static void appendConfig (ConfigKey k, const char *name, const char *cmd)
 Appends cmd to the given configuration. More...
 
static ConfigKey loadConfig (const char *fileName)
 Loads the configuration file with the given name and returns a configuration key for accessing it. More...
 
static ConfigIter getConfig (ConfigKey key)
 Returns the configuration with the given key as a double-null-terminated string list. More...
 
static bool releaseConfig (ConfigKey key)
 Discards the configuration with the given key. More...
 
static const char * getDefaults (ProblemType f)
 Returns defaults for the given problem type. More...
 

Additional Inherited Members

- Public Types inherited from Clasp::ClaspConfig
typedef BasicSatConfig UserConfig
 
typedef Solver ** SolverIt
 
typedef
Asp::LogicProgram::AspOptions 
AspOptions
 
- Public Types inherited from Clasp::Configuration
typedef SolverParams SolverOpts
 
typedef SolveParams SearchOpts
 
typedef ContextParams CtxOpts
 
- Public Types inherited from Clasp::ContextParams
enum  ShortMode { short_implicit = 0, short_explicit = 1 }
 How to handle short learnt clauses. More...
 
enum  ShareMode {
  share_no = 0, share_problem = 1, share_learnt = 2, share_all = 3,
  share_auto = 4
}
 How to handle physical sharing of (explicit) constraints. More...
 
- Public Attributes inherited from Clasp::ClaspConfig
SolveOptions solve
 
EnumOptions enumerate
 
AspOptions asp
 
- Public Attributes inherited from Clasp::ContextParams
SatPreParams satPre
 
uint8 shareMode: 3
 
uint8 stats: 2
 
uint8 shortMode: 1
 
uint8 seed: 1
 
uint8 reserved: 1
 
uint8 cliConfig
 
uint8 cliId
 
uint8 cliMode
 

Constructor & Destructor Documentation

Clasp::Cli::ClaspCliConfig::ClaspCliConfig ( )
Clasp::Cli::ClaspCliConfig::~ClaspCliConfig ( )

Member Function Documentation

void Clasp::Cli::ClaspCliConfig::addDisabled ( ProgramOptions::ParsedOptions parsed)

Adds options that are disabled by the options contained in parsed to parsed.

void Clasp::Cli::ClaspCliConfig::addOptions ( ProgramOptions::OptionContext root)

Adds all available options to root.

Once options are added, an option source (e.g. the command-line) can be used to populate this object.

Here is the call graph for this function:

ConfigKey Clasp::Cli::ClaspCliConfig::allocConfig ( )
static

Registers a new empty configuration and returns its key.

void Clasp::Cli::ClaspCliConfig::appendConfig ( ConfigKey  k,
const char *  name,
const char *  cmd 
)
static

Appends cmd to the given configuration.

Precondition
k was previously acquired by a call to allocConfig().
Parameters
kThe config to append to.
nameThe name of the new config.
cmdA space separated option-list in long-format (i.e. '–opt=value').
bool Clasp::Cli::ClaspCliConfig::finalize ( )

Validates and finalizes this configuration.

Here is the call graph for this function:

bool Clasp::Cli::ClaspCliConfig::finalize ( const ProgramOptions::ParsedOptions parsed,
ProblemType  type,
bool  applyDefaults 
)

Applies the options in parsed and calls finalize().

Here is the call graph for this function:

ConfigIter Clasp::Cli::ClaspCliConfig::getConfig ( ConfigKey  key)
static

Returns the configuration with the given key as a double-null-terminated string list.

const char * Clasp::Cli::ClaspCliConfig::getDefaults ( ProblemType  f)
static

Returns defaults for the given problem type.

void Clasp::Cli::ClaspCliConfig::init ( uint32  solverId,
ConfigKey  config = config_asp_default 
)

Initializes the i'th solver with the given configuration.

Here is the call graph for this function:

void Clasp::Cli::ClaspCliConfig::initTester ( uint32  solverId,
ConfigKey  config = config_default 
)

Initializes the i'th tester solver with the given configuration.

Here is the call graph for this function:

ConfigKey Clasp::Cli::ClaspCliConfig::loadConfig ( const char *  fileName)
static

Loads the configuration file with the given name and returns a configuration key for accessing it.

Here is the call graph for this function:

bool Clasp::Cli::ClaspCliConfig::releaseConfig ( ConfigKey  key)
static

Discards the configuration with the given key.

bool Clasp::Cli::ClaspCliConfig::set ( OptionKey  o,
const char *  value 
)

Sets the given option in the master configuration.

Here is the call graph for this function:

bool Clasp::Cli::ClaspCliConfig::set ( uint32  solverId,
OptionKey  o,
const char *  value 
)

Sets the given option in the i'th solver.

template<class IT >
bool Clasp::Cli::ClaspCliConfig::setConfig ( IT  first,
IT  last,
ProblemType  t 
)
inline

Populates this configuration with the options given in [first, last) and finalizes it.

Parameters
[first,last)a range of options in argv format.
bool Clasp::Cli::ClaspCliConfig::setTester ( uint32  solverId,
OptionKey  o,
const char *  value 
)

Sets the given option in the i'th tester solver.

Here is the call graph for this function:


The documentation for this class was generated from the following files: