1+ /* **********************************************************************[pfmain.cpp]
2+ Copyright(c) 2020, Muhammad Osama - Anton Wijs,
3+ Technische Universiteit Eindhoven (TU/e).
4+
5+ This program is free software: you can redistribute it and/or modify
6+ it under the terms of the GNU General Public License as published by
7+ the Free Software Foundation, either version 3 of the License, or
8+ (at your option) any later version.
9+
10+ This program is distributed in the hope that it will be useful,
11+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+ GNU General Public License for more details.
14+
15+ You should have received a copy of the GNU General Public License
16+ along with this program. If not, see <https://www.gnu.org/licenses/>.
17+ **********************************************************************************/
18+
19+ #include " pfsolve.h"
20+
21+ using namespace pFROST ;
22+
23+ bool quiet_en = false ;
24+ int verbose = -1 ;
25+
26+ int main (int argc, char **argv)
27+ {
28+ BOOL_OPT opt_quiet_en (" quiet" , " enable quiet mode, same as verbose=0" , false );
29+ INT_OPT opt_verbose (" verbose" , " set the verbosity" , 1 , INT32R (0 , 4 ));
30+ INT_OPT opt_timeout (" timeout" , " set the timeout in seconds" , 0 , INT32R (0 , INT32_MAX ));
31+ if (argc == 1 ) PFLOGE (" no input file specified" );
32+ try {
33+ parseArguments (argc, argv);
34+ quiet_en = opt_quiet_en, verbose = opt_verbose;
35+ if (quiet_en) verbose = 0 ;
36+ else if (!verbose) quiet_en = true ;
37+ if (!quiet_en && verbose) {
38+ PFNAME (" ParaFROST (Parallel Formal Reasoning On Satisfiability)" );
39+ PFAUTHORS (" Muhammad Osama and Anton Wijs" );
40+ PFRIGHTS (" Technische Universiteit Eindhoven (TU/e)" );
41+ PFLRULER (' -' , RULELEN );
42+ PFLOGN0 (" Embedded options: " );
43+ for (int i = 0 , j = 0 ; i < options.size (); i++) {
44+ if (options[i]->isParsed ()) {
45+ options[i]->printArgument ();
46+ if (++j % 4 == 0 ) { putc (' \n ' , stdout); PFLOGN0 (" \t\t " ); }
47+ }
48+ }
49+ putc (' \n ' , stdout); PFLRULER (' -' , RULELEN );
50+ }
51+ signal_handler (handler_terminate);
52+ string formula = argv[1 ];
53+ ParaFROST* pFrost = new ParaFROST (formula);
54+ pfrost = pFrost;
55+ if (opt_timeout > 0 ) set_timeout (opt_timeout);
56+ signal_handler (handler_mercy_interrupt, handler_mercy_timeout);
57+ pFrost->solve ();
58+ if (!quiet_en) PFLOG0 (" " );
59+ PFLOGN2 (1 , " Cleaning up.." );
60+ pfrost = NULL ;
61+ delete pFrost;
62+ PFLDONE (1 , 5 );
63+ if (!quiet_en) PFLRULER (' -' , RULELEN );
64+ return 0 ;
65+ }
66+ catch (MEMOUTEXCEPTION &) {
67+ PFLOGEN (" Memoryout" );
68+ PFLOGS (" UNKNOWN" );
69+ return 0 ;
70+ }
71+ }
0 commit comments