Well no, if there's a bug and state ids are not unique this won't do any
good, because you're already keying off a nonunique id, so this won't fix
the bug. That's why I said elsewhere in this code review that you need to
actually explicitly enforce the unique constraints you expect your code to
have. It was one of the reasons you needed to have authoritative bimaps.
On Mar 28, 2014 6:20 PM, "Radu Mereuta" <notifications@github.com> wrote:

> In src/javasources/KTool/src/org/kframework/parser/concrete2/Grammar.java:
>
> > +        }
> > +
> > +        public State(StateId stateId, NonTerminal nt) {
> > +            this.stateId = stateId; this.nt = nt;
> > +        }
> > +
> > +        public int compareTo(State that) { return this.stateId.compareTo(that.stateId); }
> > +
> > +        @Override
> > +        public boolean equals(Object o) {
> > +            if (this == o) return true;
> > +            if (o == null || getClass() != o.getClass()) return false;
> > +
> > +            State state = (State) o;
> > +
> > +            if (!nt.equals(state.nt)) return false;
>
> This is generated code.
> Anyway, it's worth keeping in case there is a bug and the stateId is not
> generated unique.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/kframework/k/pull/318/files#r11089642>
> .
>