SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
Options.cpp
Go to the documentation of this file.
1 /**************************************************************************************[Options.cc]
2 Copyright (c) 2008-2010, Niklas Sorensson
3 
4 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
5 associated documentation files (the "Software"), to deal in the Software without restriction,
6 including without limitation the rights to use, copy, modify, merge, publish, distribute,
7 sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
8 furnished to do so, subject to the following conditions:
9 
10 The above copyright notice and this permission notice shall be included in all copies or
11 substantial portions of the Software.
12 
13 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
14 NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
16 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
17 OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18 **************************************************************************************************/
19 
20 #include "Sort.h"
21 #include "Options.h"
22 
23 using namespace Minisat;
24 
25 void Minisat::setUsageHelp( const char* str )
26 {
27  Option::getUsageString() = str;
28 }
29 
30 void Minisat::setHelpPrefixStr( const char* str )
31 {
33 }
34 
35 void Minisat::printUsageAndExit( int, char** argv, bool verbose )
36 {
37  const char* usage = Option::getUsageString();
38  if( usage != NULL )
39  fprintf( stderr, usage, argv[0] );
40 
42 
43  const char* prev_cat = NULL;
44  const char* prev_type = NULL;
45 
46  for( int i = 0; i < Option::getOptionList().size(); i++ )
47  {
48  const char* cat = Option::getOptionList()[i]->category;
49  const char* type = Option::getOptionList()[i]->type_name;
50 
51  if( cat != prev_cat )
52  fprintf( stderr, "\n%s OPTIONS:\n\n", cat );
53  else if( type != prev_type )
54  fprintf( stderr, "\n" );
55 
56  Option::getOptionList()[i]->help( verbose );
57 
58  prev_cat = Option::getOptionList()[i]->category;
59  prev_type = Option::getOptionList()[i]->type_name;
60  }
61 
62  fprintf( stderr, "\nHELP OPTIONS:\n\n" );
63  fprintf( stderr, " --%shelp Print help message.\n", Option::getHelpPrefixString() );
64  fprintf( stderr, " --%shelp-verb Print verbose help message.\n", Option::getHelpPrefixString() );
65  fprintf( stderr, "\n" );
66  exit( 0 );
67 }
static const char *& getHelpPrefixString()
Definition: Options.h:63
static vec< Option * > & getOptionList()
Definition: Options.h:51
static const char *& getUsageString()
Definition: Options.h:57
Definition: Alg.h:27
void sort(T *array, int size, LessThan lt)
Definition: Sort.h:67
void setUsageHelp(const char *str)
Definition: Options.cpp:25
void printUsageAndExit(int argc, char **argv, bool verbose=false)
Definition: Options.cpp:35
void setHelpPrefixStr(const char *str)
Definition: Options.cpp:30
QuantifierType type(const std::pair< QuantifierType, std::vector< carl::Variable >> &p)
Definition: QEQuery.h:39