From 9f3fff18f29d250745a758d13e4c4d39f59bee9c Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Mon, 9 Jul 2012 18:42:28 +1000 Subject: Few quick logging changes, just for fun. --- impl/ImprovementOperator.hpp | 9 ++++++--- impl/Log.hpp | 2 +- impl/TODO.org | 10 +++++----- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/impl/ImprovementOperator.hpp b/impl/ImprovementOperator.hpp index d99ccbc..e70b5af 100644 --- a/impl/ImprovementOperator.hpp +++ b/impl/ImprovementOperator.hpp @@ -224,18 +224,21 @@ struct SmartImprovementOperator : public ImprovementOperator { stableSet = invalidSet.inverse(); } + log::strategy << std::endl; log::strategy << "stable: " << stableSet << std::endl; log::strategy << "infl: " << _influence << std::endl; DynamicMaxStrategy strat(_system, stratOut, _influence, rho, stableSet, changedSet); log::strategy << "invalid: " << invalidSet << std::endl; + log::strategy << "==================" << std::endl; for (auto it = invalidSet.begin(), end = invalidSet.end(); it != end; ++it) { + auto expr = _system.maxExpression(*it); unsigned int subExpression = strat.get(_system.maxExpression(*it)); - log::strategy << _system.maxExpression(*it) - << " -> " - << subExpression << std::endl; + log::strategy << expr + << " --[" << subExpression << "]-> " + << *expr.arguments()[subExpression] << std::endl; } log::strategy << std::endl; IdSet> seen; diff --git a/impl/Log.hpp b/impl/Log.hpp index 0f12fec..621c94c 100644 --- a/impl/Log.hpp +++ b/impl/Log.hpp @@ -15,7 +15,7 @@ namespace log { struct LoggerBuffer : public std::streambuf { LoggerBuffer(std::streambuf* buffer, const std::string& name) : _buffer(buffer), - _prefix(name + " :- "), + _prefix(name + ": "), _prefix_next(true) { } int_type overflow(int_type c=EOF) { diff --git a/impl/TODO.org b/impl/TODO.org index fe7acee..4d14b64 100644 --- a/impl/TODO.org +++ b/impl/TODO.org @@ -17,11 +17,11 @@ - [X] debug - [X] trace - [X] info -- [ ] Provide output [0/5] - - [ ] strategies - print the system and assignment, then the next strategy - print each strategy like this: - max(0, x, sub(y,2)) -> sub(y,2) +- [-] Provide output [0/5] + - [-] strategies [1/2] + - [ ] print the system and assignment, then the next strategy + - [X] print each strategy like this: + max(0, x, sub(y,2)) --[2]-> sub(y,2) - [ ] fixpoint print the system we're working with, then print the resultant assignment - [ ] debug -- cgit v1.2.3