diff --git a/devmods/rulegen-tests.cpp b/devmods/rulegen-tests.cpp index c615a1a9..1ac7f554 100644 --- a/devmods/rulegen-tests.cpp +++ b/devmods/rulegen-tests.cpp @@ -429,7 +429,9 @@ void test_rules() { println(hlog, "sequence: ", seq); } -void list_sequence() { +fhstream *seq_stream; + +void list_all_sequences(string tesname) { int N = isize(treestates); if(!N) { @@ -437,23 +439,29 @@ void list_sequence() { return; } - vector howmany(N); - howmany[0] = 1; + for(int i=0; i howmany(N); - vector seq; - - for(int iter=0; iter<30; iter++) { - bignum total; - for(auto& h: howmany) total += h; - seq.push_back(total.get_str(100)); - vector next(N); - for(int id=0; id= 0) - next[s] += howmany[id]; - howmany = std::move(next); + howmany[i] = 1; + + vector seq; + + for(int iter=0; iter<60; iter++) { + bignum total; + for(auto& h: howmany) total += h; + seq.push_back(total.get_str(100)); + vector next(N); + for(int id=0; id= 0) + next[s] += howmany[id]; + howmany = std::move(next); + } + + println(*seq_stream, (hyperbolic ? "H " : "E "), "FILE ", tesname, ", id "); + println(*seq_stream, seq); } - - println(hlog, "sequence: ", seq); + + fflush(seq_stream->f); } void print_rules(); @@ -772,7 +780,9 @@ void test_current(string tesname) { /* for(auto& a: analyzers) println(hlog, "analyzer ", a.first, " size is ", isize(a.second.spread)); */ fflush(stdout); - list_sequence(); + + if(seq_stream) + list_all_sequences(tesname); fflush(stdout); } @@ -1134,6 +1144,11 @@ int testargs() { shift(); origin_id = argi(); } + else if(argis("-seqf")) { + shift(); + seq_stream = new fhstream(args(), "w"); + } + else if(argis("-tesgen")) { shift(); string s = args(); set_general(s);