#include "Formula.h" #include "Assignment.h" #include "WalkSatRestart.h" #include "rand.h" #include #include int main( int argc, char* argv[] ) { Formula f; WalkSatRestart ws; Assignment* a; // Check that the number of arguments is correct if( argc < 4 ) return 0; // Seed the random number generator my_srand(); // Get the input parameters ws.SetMaxFlips( atoi(argv[1]) ); ws.SetProbability( (float)atof(argv[2]) ); ws.SetMaxRestarts( atoi(argv[3]) ); // Load the formula f.Load(); // Solve the formula a = ws.Solve( &f ); // Print the solution printf( "Solution:\n" ); a->Print(); return 0; }