summaryrefslogtreecommitdiff
path: root/impl/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'impl/main.cpp')
-rw-r--r--impl/main.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/impl/main.cpp b/impl/main.cpp
index 726fa3e..2b7a9a1 100644
--- a/impl/main.cpp
+++ b/impl/main.cpp
@@ -98,7 +98,7 @@ void treeToSystem(pANTLR3_BASE_TREE node, EquationSystem<T>& system) {
typedef Complete<int> ZBar;
int main (int argc, char* argv[]) {
if (argc <= 3) {
- cout << "Usage: " << argv[0] << " filename fixpoint strategy [log]" << endl
+ cerr << "Usage: " << argv[0] << " filename fixpoint strategy [log]" << endl
<< " fixpoint: naive | smart" << endl
<< " strategy: naive | repeat | smart" << endl
<< " log: section[,section[,section[...]]]" << endl;
@@ -135,12 +135,12 @@ int main (int argc, char* argv[]) {
FixpointAlgorithm<ZBar>* algorithm = NULL;
if (!strcmp(argv[2], "naive")) {
algorithm = new NaiveFixpointAlgorithm<ZBar>(system);
- cout << "Naive fixpoint" << endl;
+ log::info << "Naive fixpoint" << endl;
} else if (!strcmp(argv[2], "smart")) {
algorithm = new SmartFixpointAlgorithm<ZBar>(system);
- cout << "Smart fixpoint" << endl;
+ log::info << "Smart fixpoint" << endl;
} else {
- cout << "Unknown fixpoint algorithm." << endl;
+ cerr << "Unknown fixpoint algorithm." << endl;
}
// PARSE ARGUMENTS - strat improvement
@@ -148,15 +148,15 @@ int main (int argc, char* argv[]) {
ImprovementOperator<ZBar>* improvement = NULL;
if (!strcmp(argv[3], "repeat")) {
improvement = new RepeatedImprovementOperator<ZBar>(*naiveImprovement);
- cout << "Repeated strategy improvement" << endl;
+ log::info << "Repeated strategy improvement" << endl;
} else if (!strcmp(argv[3], "naive")) {
improvement = naiveImprovement;
- cout << "Naive strategy improvement" << endl;
+ log::info << "Naive strategy improvement" << endl;
} else if (!strcmp(argv[3], "smart")) {
improvement = new SmartImprovementOperator<ZBar>(system);
- cout << "Smart strategy improvement" << endl;
+ log::info << "Smart strategy improvement" << endl;
} else {
- cout << "Unknown strategy improvement algorithm." << endl;
+ cerr << "Unknown strategy improvement algorithm." << endl;
}
if (!improvement || !algorithm) {
exit(1);
@@ -182,7 +182,6 @@ int main (int argc, char* argv[]) {
log::debug << "Changed: " << (changed ? "true" : "false") << std::endl;
} while(changed);
- cout << endl;
for (unsigned int i = 0, size = system.variableCount(); i < size; ++i) {
Variable<ZBar>& var = system.variable(i);
cout << var.name() << " = " << result[var] << endl;