src/app.cpp
// Pretty print competition format witness with 'v' lines.
//
Pretty print competition format witness with 'v' lines.
Pretty print competition format witness with ' v ' lines .
void App::witness () {
  int c = 0, m = solver->max ();
  File * output = solver->output ();
  for (int i = 1; i <= m; i++) {
    if (!c) output->put ('v'), c = 1;
    char str[20];
    sprintf (str, " %d", solver->val (i) < 0 ? -i : i);
    int l = strlen (str);
    if (c + l > 78) output->put ("\nv"), c = 1;
    output->put (str);
    c += l;
  }
  if (c) output->put ('\n');
  output->put ("v 0\n");
  fflush (stdout);
}
void App :: witness ( ) { int c = 0 , m = solver -> max ( ) ; File * output = solver -> output ( ) ; for ( int i = 1 ; i <= m ; i ++ ) { if ( ! c ) output -> put ( ' ' ) , c = 1 ; char str [ 20 ] ; sprintf ( str , " " , solver -> val ( i ) < 0 ? - i : i ) ; int l = strlen ( str ) ; if ( c + l > 78 ) output -> put ( " \n " ) , c = 1 ; output -> put ( str ) ; c += l ; } if ( c ) output -> put ( ' \n ' ) ; output -> put ( " \n " ) ; fflush ( stdout ) ; }
Pretty print competition format witness with 'v' lines.
Pretty print competition format witness with ' v ' lines .