kframework / k-legacy

The K tools (deprecated, see README)
http://kframework.org
Other
146 stars 61 forks source link

Index arithmetic error in TermCons from KOREToTreeNodes #1519

Open cos opened 9 years ago

cos commented 9 years ago
error was: java.lang.IndexOutOfBoundsException
    at org.pcollections.ConsPStack.listIterator(ConsPStack.java:85)
    at java.util.AbstractSequentialList.get(AbstractSequentialList.java:88)
    at org.kframework.parser.TermCons.get(treeNodes.scala:36)
    at org.kframework.unparser.KOREToTreeNodes$$anonfun$1.apply(KOREToTreeNodes.scala:46)

Replicate by running: ktest tests/config.xml --skip pdf in /k-distribution/tutorial-on-kore/1_k/2_imp/lesson_2 on branch feature/ktest-tutorial2.

dwightguth commented 9 years ago

So, we can definitely have a better error message in this case, but this looks like a mismatch between the arity of the production being pretty printed and the arity of the TermCons that is claiming to be an instance of that production. Given the fact that last I checked you were deliberately doing this in misc.k with Maps, I'm not going to spend time investigating this issue unless you can demonstrate that this is an actual bug and not simply a misuse of the standard library.

On Sat, May 23, 2015 at 5:58 PM, Cosmin Radoi notifications@github.com wrote:

Assigned #1519 https://github.com/kframework/k/issues/1519 to @dwightguth https://github.com/dwightguth.

— Reply to this email directly or view it on GitHub https://github.com/kframework/k/issues/1519#event-312439423.