Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "example.h"
00021 #include <clasp/enumerator.h>
00022 #include <clasp/Solver.h>
00023 void printModel(const Clasp::SymbolTable& symTab, const Clasp::Model& model) {
00024 std::cout << "Model " << model.num << ": \n";
00025
00026 for (Clasp::SymbolTable::const_iterator it = symTab.begin(); it != symTab.end(); ++it) {
00027 if (model.isTrue(it->second.lit) && !it->second.name.empty()) {
00028 std::cout << it->second.name.c_str() << " ";
00029 }
00030 }
00031 std::cout << std::endl;
00032 }
00033
00034 #define RUN(x) try { std::cout << "*** Running " << static_cast<const char*>(#x) << " ***" << std::endl; x(); } catch (const std::exception& e) { std::cout << " *** ERROR: " << e.what() << std::endl; }
00035
00036 int main() {
00037 RUN(example1);
00038 RUN(example2);
00039 #if WITH_THREADS
00040 RUN(example3);
00041 #endif
00042 }