reg3 rules now support 65535 states

This commit is contained in:
Zeno Rogue 2021-05-22 01:25:41 +02:00
parent e78a170e7e
commit af9d35dc1c
2 changed files with 9 additions and 2 deletions

View File

@ -112,8 +112,10 @@ void expansion_analyzer::preliminary_grouping() {
children.resize(N);
int k = 0;
for(int i=0; i<N; i++) for(int j=0; j<S7; j++) {
if(chi[k] >= 0)
children[i].push_back(chi[k]);
int ck = chi[k];
if(ck < -1) ck += (1<<16);
if(ck >= 0)
children[i].push_back(ck);
k++;
}
#endif

View File

@ -988,6 +988,7 @@ EX namespace reg3 {
int fv = last.first;
for(int d=0; d<S7; d++) {
int nstate = children[state*S7+d];
if(nstate < -1) nstate += (1<<16);
if(nstate >= 0) {
address next = {mov(fv, d), nstate};
if(!nles.count(next)) bfs.push_back(next);
@ -1011,6 +1012,7 @@ EX namespace reg3 {
int fv = last.first;
for(int d=0; d<S7; d++) {
int nstate = children[state*S7+d];
if(nstate < -1) nstate += (1<<16);
if(nstate >= 0) {
address next = {mov(fv, d), nstate};
if(!nles.count(next)) continue;
@ -1049,6 +1051,7 @@ EX namespace reg3 {
int opos = 0;
for(int c: children) {
if(c < -1) c += (1<<16);
if(c >= 0)
otherpos.push_back(-1);
else {
@ -1143,6 +1146,7 @@ EX namespace reg3 {
heptagon *create_step(heptagon *parent, int d) override {
int id = parent->fiftyval;
if(id < 0) id += (1<<16);
auto cp = counterpart(parent);
int d2 = cp->c.spin(d);
@ -1154,6 +1158,7 @@ EX namespace reg3 {
int id1 = children[S7*id+d];
int pos = otherpos[S7*id+d];
if(id1 < -1) id1 += (1<<16);
if(id1 == -1 && false) {
int kk = pos;