Skip to Content.
Sympa Menu

k-user - [K-user] krun --parens smart option

k-user AT lists.cs.illinois.edu

Subject: K-user mailing list

List archive

[K-user] krun --parens smart option


Chronological Thread 
  • From: Seokje Seo <seo43 AT illinois.edu>
  • To: "k-user AT cs.uiuc.edu" <k-user AT cs.uiuc.edu>
  • Subject: [K-user] krun --parens smart option
  • Date: Mon, 2 Dec 2013 13:30:05 -0600
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
  • List-id: <k-user.cs.uiuc.edu>

Hello

I am working on re-writing c source code with k-framework and it worked fine. However, when I was trying to use krun with --parens smart option. it gives me OutOfMemoryError when re-rewritten code gets large. Could you help me with this error? Thank you in advance!

best regards,
Seokje Seo


error messages I got

ubuntu:~/HACMS/c-refactor/c-refactor-separated/loop-unroll$ ~/k-framework/bin/krun test.c
<k>
    .K
</k>
<refactor>
    (int dwmonitor ( (((float *) X), ((double *) D)) ) ({ ((double s11925 ;) (
      (double x11824 ;) ((double s61723 ;) ((double w11622 ;) ((double q41521 
      ;) ((double q31420 ;) ((int i312 ;) ((double s119 ;) ((double x118 ;) ((
      double s617 ;) ((double w116 ;) ((double q415 ;) ((double q314 ;) ((
      double s7811 ;) ((double s5710 ;) ((double s469 ;) ((int i54 ;) ((double
       s78 ;) ((double s57 ;) ((double s46 ;) ((double q3 ;) ((double q4 ;) ((
      double s1 ;) ((double s4 ;) ((double s5 ;) ((double s6 ;) ((double s7 ;)
       ((double s8 ;) ((double w1 ;) ((double x1 ;) ((int w2 ;) ((int i5 ;) ((
      int i3 ;) (((s8 = (X [ 0 ])) ;) ((for ( (i5 = 0) ; (i5 < (3 - ((3 - 0) %
       2))) ; (i5 = (i5 + (2 * 1))) ) ({ (((s4 = (s7 * (D [ i5 ]))) ;) (((s5 =
       ((i5 == 0) ? 0.0 : (s5 + s4))) ;) (((s7 = ((i5 == 0) ? 1.0 : (s7 * s8))
      ) ;) (((s46 = (s7 * (D [ (i5 + 1) ]))) ;) (((s57 = (((i5 + 1) == 0) ? 
      0.0 : (s5 + s46))) ;) (((s78 = (((i5 + 1) == 0) ? 1.0 : (s7 * s8))) ;) 
      .List{""})))))) })) ((for ( (i54 = (0 + (((3 - 0) / 2) * 2))) ; (i54 < 3
      ) ; (i54 = (i54 + 1)) ) ({ (((s469 = (s78 * (D [ i54 ]))) ;) (((s5710 = 
      ((i54 == 0) ? 0.0 : (s57 + s469))) ;) (((s7811 = ((i54 == 0) ? 1.0 : (
      s78 * s8))) ;) .List{""}))) })) ((for ( (i3 = 0) ; (i3 < (2 - ((2 - 0) %
       2))) ; (i3 = (i3 + (2 * 1))) ) ({ (((q3 = (X [ (i3 + 1) ])) ;) (((q4 = 
      (X [ (3 + i3) ])) ;) (((w1 = (q3 - q4)) ;) (((s6 = ((w1 >= 0) ? w1 : (- 
      w1))) ;) (((x1 = ((i3 == 0) ? 0.0 : s1)) ;) (((s1 = ((x1 >= s6) ? x1 : 
      s6)) ;) (((q314 = (X [ ((i3 + 1) + 1) ])) ;) (((q415 = (X [ (3 + (i3 + 1
      )) ])) ;) (((w116 = (q314 - q415)) ;) (((s617 = ((w116 >= 0) ? w116 : (-
       w116))) ;) (((x118 = (((i3 + 1) == 0) ? 0.0 : s1)) ;) (((s119 = ((x118 
      >= s617) ? x118 : s617)) ;) .List{""})))))))))))) })) ((for ( (i312 = (0
       + (((2 - 0) / 2) * 2))) ; (i312 < 2) ; (i312 = (i312 + 1)) ) ({ (((
      q31420 = (X [ (i312 + 1) ])) ;) (((q41521 = (X [ (3 + i312) ])) ;) (((
      w11622 = (q31420 - q41521)) ;) (((s61723 = ((w11622 >= 0) ? w11622 : (- 
      w11622))) ;) (((x11824 = ((i312 == 0) ? 0.0 : s119)) ;) (((s11925 = ((
      x11824 >= s61723) ? x11824 : s61723)) ;) .List{""})))))) })) (((w2 = (
      s11925 >= s5710)) ;) ((return w2 ;) .List{""})))))))))))))))))))))))))))
      ))))))))))))) })) .K
</refactor>
<debug>
    .K
</debug>

ubuntu:~/HACMS/c-refactor/c-refactor-separated/loop-unroll$ ~/k-framework/bin/krun test.c --parens smart
Fatal error at
javaParseStringRules_0_0
justFine_0_0
justFine2_0_0
Exception in thread "main" java.lang.RuntimeException: java.lang.OutOfMemoryError: Java heap space
at org.strategoxt.lang.StackSaver.invokeStackFriendly(StackSaver.java)
at org.strategoxt.lang.Context.invokeStrategyCLI(Context.java)
at org.kframework.parser.concrete.KParser.ParseKRuleString(KParser.java:224)
at org.kframework.parser.DefinitionLoader.parsePatternAmbiguous(DefinitionLoader.java:375)
at org.kframework.backend.unparser.AddBracketsFilter2.postpare(AddBracketsFilter2.java:117)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:37)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:505)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:36)
at org.kframework.kil.TermCons.accept(TermCons.java:154)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:192)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:60)
at org.kframework.kil.Cell.accept(Cell.java:274)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:199)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:44)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:229)
at org.kframework.kil.Bag.accept(Bag.java:74)
at org.kframework.kil.visitors.BasicTransformer.transform(BasicTransformer.java:192)
at org.kframework.backend.unparser.AddBracketsFilter2.transform(AddBracketsFilter2.java:60)
at org.kframework.kil.Cell.accept(Cell.java:274)
at org.kframework.krun.api.KRunState.concretize(KRunState.java:73)
at org.kframework.krun.api.KRunState.getResult(KRunState.java:124)
at org.kframework.krun.api.KRunState.toString(KRunState.java:115)
at org.kframework.krun.api.KRunResult.toString(KRunResult.java:41)
at org.kframework.krun.Main.normalExecution(Main.java:374)
at org.kframework.krun.Main.execute_Krun(Main.java:1103)
at org.kframework.main.Main.main(Main.java:61)
Caused by: java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2367)
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:130)
at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:114)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:415)
at java.lang.StringBuilder.append(StringBuilder.java:132)
at org.spoofax.interpreter.library.ssl.SSL_concat_strings.call(SSL_concat_strings.java:44)
at org.spoofax.interpreter.library.ssl.SSL_concat_strings.call(SSL_concat_strings.java:30)
at org.strategoxt.lang.Context.invokePrimitive(Context.java)
at org.strategoxt.lang.Context.invokePrimitive(Context.java)
at org.strategoxt.stratego_lib.concat_strings_0_0.invoke(concat_strings_0_0.java)
at org.kframework.parser.concrete.lib.just$Fine2_0_0.invoke(just$Fine2_0_0.java:103)
at org.kframework.parser.concrete.lib.just$Fine_0_0.invoke(just$Fine_0_0.java:24)
at org.kframework.parser.concrete.lib.java$Parse$String$Rules_0_0.invoke(java$Parse$String$Rules_0_0.java:55)
at org.strategoxt.lang.Strategy.invokeDynamic(Strategy.java)
at org.strategoxt.lang.StackSaver$1.call(StackSaver.java)
at org.strategoxt.lang.StackSaver$1.call(StackSaver.java)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.lang.Thread.run(Thread.java:724)


  • [K-user] krun --parens smart option, Seokje Seo, 12/02/2013

Archive powered by MHonArc 2.6.16.

Top of Page