int main(int argc, char **argv) { cout << std::setprecision(5) << "ANT v" << ANT_VERSION << endl; CmdLineParser cmdline(argc, argv); if (!cmdline.parse()) { print_usage(argv[0]); return -1; } print_header(); /* La classe Global inizializza la working memory. La stessa contiene metodi * per distruggere la working memory e per recuperarne un'istanza. */ Global global; Parser parser(&global); if (!(parser.start(cmdline["input"].c_str()))) return -1; cout << "Facts in memory: " << global.wm()->fact_number() << endl; cout << "Rules in memory: " << global.ruleset->rules_number() << endl; try { global.wm()->prepare(&cmdline); unsigned int expanded_nodes = global.wm()->run(global.ruleset); global.wm()->die(&cmdline, expanded_nodes); } catch(WorkingMemoryError wme) { cerr << "Working memory error: " << wme.err << endl; } catch(PredicateError perr) { cerr << "Predicate error: " << perr.err << endl; } return 0; };