Author: niels
Date: Tue May 27 10:11:02 2014
New Revision: 9468
URL: http://svn.gna.org/viewcvs/service-tech?rev=9468&view=rev
Log:
* LoLA now displays how many rules have been applied during rewriting.
Modified:
trunk/lola2/src/Frontend/Parser/formula_rewrite.k
trunk/lola2/src/Planning/Task.cc
Modified: trunk/lola2/src/Frontend/Parser/formula_rewrite.k
URL:
http://svn.gna.org/viewcvs/service-tech/trunk/lola2/src/Frontend/Parser/formula_rewrite.k?rev=9468&r1=9467&r2=9468&view=diff
==============================================================================
--- trunk/lola2/src/Frontend/Parser/formula_rewrite.k (original)
+++ trunk/lola2/src/Frontend/Parser/formula_rewrite.k Tue May 27 10:11:02 2014
@@ -1,4 +1,10 @@
+%{ KC_REWRITE_HEADER
+/// variable counting the rule applications in the rewrite rule sets
+extern size_t rule_applications;
+%}
+
%{ KC_REWRITE /* code redirection */
+#include <Frontend/Parser/ast-system-rk.h>
#include <CoverGraph/CoverGraph.h>
#include <Net/Marking.h>
#include <Net/Net.h>
@@ -8,6 +14,12 @@
the rewriting process.
*/
//#define KC_TRACE_REWRITE_RESULT(VIEW,FILE,LINE,NODE) {
RT::rep->status("rewrite %s:%d", FILE, LINE); }
+
+/*!
+Count the rule applications
+*/
+size_t rule_applications = 0;
+#define KC_TRACE_REWRITE_MATCH(VIEW,FILE,LINE,NODE) { ++rule_applications; }
integer plus( integer a, integer b ) {
// +-----+-----+-----+-----+
Modified: trunk/lola2/src/Planning/Task.cc
URL:
http://svn.gna.org/viewcvs/service-tech/trunk/lola2/src/Planning/Task.cc?rev=9468&r1=9467&r2=9468&view=diff
==============================================================================
--- trunk/lola2/src/Planning/Task.cc (original)
+++ trunk/lola2/src/Planning/Task.cc Tue May 27 10:11:02 2014
@@ -446,6 +446,8 @@
RT::data["analysis"]["formula"]["processed"] = unparsed;
RT::data["analysis"]["formula"]["processed_size"] =
static_cast<int>(unparsed.size());
+ RT::rep->status("%d rewrites", rule_applications);
+
// prepare counting of place in the formula
extern bool *place_in_formula;
extern unsigned int places_mentioned;
--
You received this e-mail, because you subscribed the mailing list
"service-tech-commits" which will forward you any e-mail addressed to
[email protected]. If you want to unsubscribe or make any changes to
your subscription, please go to
https://mail.gna.org/listinfo/service-tech-commits.