UnsupportedOperationException with --search in OCaml backend
See original GitHub issue- Get Nightly build of K framework at commit 3af731f Prebuilt K binary
- Open terminal and change into
tutorial/1_k/1_lambda/lesson_1
- Run
kompile --backend ocaml lambda.k
- Run
krun --search --debug tests/identity.lambda
This occurs with Kool untyped as well. Running without --search
is fine, though.
I’m running OCaml 4.03.1+dev0-2016-04-25 on Linux Mint 18.3.
java.lang.UnsupportedOperationException
at org.kframework.backend.ocaml.OcamlRewriter$1.search(OcamlRewriter.java:116)
at org.kframework.krun.modes.KRunExecutionMode.execute(KRunExecutionMode.java:55)
at org.kframework.krun.KRun.run(KRun.java:99)
at org.kframework.krun.KRunFrontEnd.run(KRunFrontEnd.java:90)
at org.kframework.main.FrontEnd.main(FrontEnd.java:52)
at org.kframework.main.Main.runApplication(Main.java:114)
at org.kframework.main.Main.runApplication(Main.java:104)
at org.kframework.main.Main.main(Main.java:53)
java.lang.UnsupportedOperationException
at org.kframework.backend.ocaml.OcamlRewriter$1.search(OcamlRewriter.java:116)
at org.kframework.krun.modes.KRunExecutionMode.execute(KRunExecutionMode.java:55)
at org.kframework.krun.KRun.run(KRun.java:99)
at org.kframework.krun.KRunFrontEnd.run(KRunFrontEnd.java:90)
at org.kframework.main.FrontEnd.main(FrontEnd.java:52)
at org.kframework.main.Main.runApplication(Main.java:114)
at org.kframework.main.Main.runApplication(Main.java:104)
at org.kframework.main.Main.main(Main.java:53)
[Error] Internal: Uncaught exception thrown of type
UnsupportedOperationException.
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 (null)
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
binary-search in OCaml? - Stack Overflow
Your problem is that you are using an exception before it has been defined in the first place. Move the exception Found_It ......
Read more >CHANGES - third_party/swig - Git at Google
SWIG (Simplified Wrapper and Interface Generator). See the CHANGES.current file for changes in the current version. See the RELEASENOTES file for a summary ......
Read more >changes - SWIG.org
Without it, Python will do its own slower sequence search. ... Deprecate the equivalent -suffix option provided by the Ocaml backend, but continue...
Read more >Can I get some reasons to use Java instead of Kotlin? - Reddit
But perhaps you find this lack of openness more important than 'minor niggle'. ... some examples: Haskell, OCaml, Elm, Rust, Standard ML.
Read more >Programming in Scala - People
Scala compiler will find no such member of class String, but it will find an ... lar in spirit to the ML family...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Judging from your stack trace, it looks like a kserver is active, which probably means that you previously compiled this definition with the ocaml backend and the kserver cached the definition when you tried to run it. Then you switched to the java backend, but the kserver was never written to robustly invalidate caches when you recompile a definition, so it still thinks the definition has been built with the ocaml backend. If you run stop-kserver and then run these commands again, it should work. It might be slower though. Generally you should always stop and restart any kserver you started whenever you run kompile more than once on the same definition.
Seems resolved. For the record, as @dwightguth says,
krun --search
is not supported by the ocaml backend (only by Java and Haskell backends), and the KServer causes issues with cacheing between kompile calls. This led to weird behavior when first running with ocaml backend then trying to switch to java backend for search.