kframework / k-legacy

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

Kompiling file without main cell (cell with $PGM) results in Uncaught Exception of type Assertion Error. #1837

Open msaxena2 opened 9 years ago

msaxena2 commented 9 years ago

Stacktrace:

java.lang.AssertionError: No main cell found
    at org.kframework.compile.ConfigurationInfoFromModule.mainCell$lzycompute(ConfigurationInfoFromModule.scala:75)
    at org.kframework.compile.ConfigurationInfoFromModule.mainCell(ConfigurationInfoFromModule.scala:70)
    at org.kframework.compile.ConfigurationInfoFromModule.getComputationCell(ConfigurationInfoFromModule.scala:118)
    at org.kframework.kore.compile.AddImplicitComputationCell.apply(AddImplicitComputationCell.java:64)
    at org.kframework.kore.compile.AddImplicitComputationCell.apply(AddImplicitComputationCell.java:36)
    at org.kframework.kore.compile.AddImplicitComputationCell.apply(AddImplicitComputationCell.java:19)
    at org.kframework.definition.ModuleTransformer$$anonfun$fromSentenceTransformer$1.apply(transformers.scala:14)
    at org.kframework.definition.ModuleTransformer$$anonfun$fromSentenceTransformer$1.apply(transformers.scala:14)
    at org.kframework.definition.ModuleTransformer$$anonfun$fromSentenceTransformer$2$$anonfun$2.apply(transformers.scala:20)
    at org.kframework.definition.ModuleTransformer$$anonfun$fromSentenceTransformer$2$$anonfun$2.apply(transformers.scala:18)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
    at scala.collection.immutable.HashSet$HashSet1.foreach(HashSet.scala:322)
    at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:978)
    at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
    at scala.collection.AbstractSet.scala$collection$SetLike$$super$map(Set.scala:47)
    at scala.collection.SetLike$class.map(SetLike.scala:92)
    at scala.collection.AbstractSet.map(Set.scala:47)
    at org.kframework.definition.ModuleTransformer$$anonfun$fromSentenceTransformer$2.apply(transformers.scala:18)
    at org.kframework.definition.ModuleTransformer$$anonfun$fromSentenceTransformer$2.apply(transformers.scala:17)
    at org.kframework.definition.ModuleTransformer$$anonfun$apply$5.apply(transformers.scala:55)
    at org.kframework.definition.ModuleTransformer$$anonfun$apply$5.apply(transformers.scala:50)
    at scala.collection.concurrent.TrieMap.getOrElseUpdate(TrieMap.scala:901)
    at org.kframework.definition.ModuleTransformer.apply(transformers.scala:50)
    at org.kframework.definition.ModuleTransformer.apply(transformers.scala:46)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
    at scala.collection.immutable.HashSet$HashSet1.foreach(HashSet.scala:322)
    at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:978)
    at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:978)
    at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
    at scala.collection.AbstractSet.scala$collection$SetLike$$super$map(Set.scala:47)
    at scala.collection.SetLike$class.map(SetLike.scala:92)
    at scala.collection.AbstractSet.map(Set.scala:47)
    at org.kframework.definition.DefinitionTransformer.apply(transformers.scala:79)
    at org.kframework.kompile.Kompile.addImplicitComputationCellTransformer(Kompile.java:215)
    at scala.Function1$$anonfun$andThen$1.apply(Function1.scala:52)
    at scala.Function1$$anonfun$andThen$1.apply(Function1.scala:52)
    at scala.Function1$$anonfun$andThen$1.apply(Function1.scala:52)
    at scala.Function1$$anonfun$andThen$1.apply(Function1.scala:52)
    at org.kframework.kompile.Kompile.lambda$defaultSteps$19(Kompile.java:170)
    at org.kframework.backend.java.symbolic.JavaBackend.lambda$steps$109(JavaBackend.java:28)
    at org.kframework.kompile.Kompile.run(Kompile.java:141)
    at org.kframework.kompile.KompileFrontEnd.run(KompileFrontEnd.java:70)
    at org.kframework.main.FrontEnd.main(FrontEnd.java:52)
    at org.kframework.main.Main.runApplication(Main.java:109)
    at org.kframework.main.Main.runApplication(Main.java:99)
    at org.kframework.main.Main.main(Main.java:51)
java.lang.AssertionError: No main cell found
    at org.kframework.compile.ConfigurationInfoFromModule.mainCell$lzycompute(ConfigurationInfoFromModule.scala:75)
    at org.kframework.compile.ConfigurationInfoFromModule.mainCell(ConfigurationInfoFromModule.scala:70)
    at org.kframework.compile.ConfigurationInfoFromModule.getComputationCell(ConfigurationInfoFromModule.scala:118)
    at org.kframework.kore.compile.AddImplicitComputationCell.apply(AddImplicitComputationCell.java:64)
    at org.kframework.kore.compile.AddImplicitComputationCell.apply(AddImplicitComputationCell.java:36)
    at org.kframework.kore.compile.AddImplicitComputationCell.apply(AddImplicitComputationCell.java:19)
    at org.kframework.definition.ModuleTransformer$$anonfun$fromSentenceTransformer$1.apply(transformers.scala:14)
    at org.kframework.definition.ModuleTransformer$$anonfun$fromSentenceTransformer$1.apply(transformers.scala:14)
    at org.kframework.definition.ModuleTransformer$$anonfun$fromSentenceTransformer$2$$anonfun$2.apply(transformers.scala:20)
    at org.kframework.definition.ModuleTransformer$$anonfun$fromSentenceTransformer$2$$anonfun$2.apply(transformers.scala:18)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
    at scala.collection.immutable.HashSet$HashSet1.foreach(HashSet.scala:322)
    at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:978)
    at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
    at scala.collection.AbstractSet.scala$collection$SetLike$$super$map(Set.scala:47)
    at scala.collection.SetLike$class.map(SetLike.scala:92)
    at scala.collection.AbstractSet.map(Set.scala:47)
    at org.kframework.definition.ModuleTransformer$$anonfun$fromSentenceTransformer$2.apply(transformers.scala:18)
    at org.kframework.definition.ModuleTransformer$$anonfun$fromSentenceTransformer$2.apply(transformers.scala:17)
    at org.kframework.definition.ModuleTransformer$$anonfun$apply$5.apply(transformers.scala:55)
    at org.kframework.definition.ModuleTransformer$$anonfun$apply$5.apply(transformers.scala:50)
    at scala.collection.concurrent.TrieMap.getOrElseUpdate(TrieMap.scala:901)
    at org.kframework.definition.ModuleTransformer.apply(transformers.scala:50)
    at org.kframework.definition.ModuleTransformer.apply(transformers.scala:46)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
    at scala.collection.immutable.HashSet$HashSet1.foreach(HashSet.scala:322)
    at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:978)
    at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:978)
    at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
    at scala.collection.AbstractSet.scala$collection$SetLike$$super$map(Set.scala:47)
    at scala.collection.SetLike$class.map(SetLike.scala:92)
    at scala.collection.AbstractSet.map(Set.scala:47)
    at org.kframework.definition.DefinitionTransformer.apply(transformers.scala:79)
    at org.kframework.kompile.Kompile.addImplicitComputationCellTransformer(Kompile.java:215)
    at scala.Function1$$anonfun$andThen$1.apply(Function1.scala:52)
    at scala.Function1$$anonfun$andThen$1.apply(Function1.scala:52)
    at scala.Function1$$anonfun$andThen$1.apply(Function1.scala:52)
    at scala.Function1$$anonfun$andThen$1.apply(Function1.scala:52)
    at org.kframework.kompile.Kompile.lambda$defaultSteps$19(Kompile.java:170)
    at org.kframework.backend.java.symbolic.JavaBackend.lambda$steps$109(JavaBackend.java:28)
    at org.kframework.kompile.Kompile.run(Kompile.java:141)
    at org.kframework.kompile.KompileFrontEnd.run(KompileFrontEnd.java:70)
    at org.kframework.main.FrontEnd.main(FrontEnd.java:52)
    at org.kframework.main.Main.runApplication(Main.java:109)
    at org.kframework.main.Main.runApplication(Main.java:99)
    at org.kframework.main.Main.main(Main.java:51)
[Error] Internal: Uncaught exception thrown of type AssertionError.
Please rerun your program with the --debug flag to generate a stack trace, and
file a bug report at https://github.com/kframework/k/issues
bmmoore commented 9 years ago

This seems like a duplicate of #1834.

dwightguth commented 9 years ago

It is not. The latter happens because we do not have a check that all configuration variables have been specified to krun. This happens during kompile because we do not have a friendly error message for the case when no main cell has been specified.

bmmoore commented 9 years ago

Ah, in kompile. Yeah, this is definitely different.