hc-verifier.cc
/// read solution from stdin, and return solution exit code (0,10,20)
read solution from stdin, and return solution exit code (0,10,20)
read solution from stdin and return solution exit code ( 0 10 20 )
int readValueVector( vector<int>& valueVector )
{
  istream* fileptr= &cin;
  istream& file = *fileptr;
  int solution = 0;
  string line;
  while( getline( file, line ) ) {
    if( line[0] == 's' ) { 
      if( line.find( "UNSATISFIABLE" ) != string::npos ) {
			  solution = 20;
			  break;
      } else if( line.find( "UNKNOWN" ) != string::npos ) { 
			  solution = 0;
			  break;
      } else {
			  solution = 10;
      }
    }
    if( line[0] == 'v' ) {
	int ind = 2;
	while( ind < line.size() && line[ind] == ' ' ) ++ind;
	while(line.size() > ind)
	{
		int number = 0;
		bool negative = false;
		while ( ind < line.size() && line[ind] == '-')
		{
			negative = true;
			ind++;
		}
		while( ind < line.size() && line[ind] >= '0' && line[ind] <= '9' )
		{
			number *=10;
			number += line[ind++] - '0';
		}
		if( number == 0 ) break;
		number = (negative) ? 0 - number : number;
		valueVector.push_back( number );
		while(line[ind] == ' ') ind++;
	}
    }
  }
  return solution;
}
int readValueVector ( vector < int > & valueVector ) { istream * fileptr = & cin ; istream & file = * fileptr ; int solution = 0 ; string line ; while ( getline ( file , line ) ) { if ( line [ 0 ] == ' ' ) { if ( line . find ( " " ) != string :: npos ) { solution = 20 ; break ; } else if ( line . find ( " " ) != string :: npos ) { solution = 0 ; break ; } else { solution = 10 ; } } if ( line [ 0 ] == ' ' ) { int ind = 2 ; while ( ind < line . size ( ) && line [ ind ] == ' ' ) ++ ind ; while ( line . size ( ) > ind ) { int number = 0 ; bool negative = false ; while ( ind < line . size ( ) && line [ ind ] == ' ' ) { negative = true ; ind ++ ; } while ( ind < line . size ( ) && line [ ind ] >= ' ' && line [ ind ] <= ' ' ) { number *= 10 ; number += line [ ind ++ ] - ' ' ; } if ( number == 0 ) break ; number = ( negative ) ? 0 - number : number ; valueVector . push_back ( number ) ; while ( line [ ind ] == ' ' ) ind ++ ; } } } return solution ; }
read solution from stdin, and return solution exit code (0,10,20)
read solution from stdin and return solution exit code ( 0 10 20 )
// check satisfiability // check model