问题
I am looking at creating an Eclipse PDE and need to communicate with with Isabelle. I do find some publication stating that Scala can be used to communicate to Isabelle.
I am looking for an example how to use Scala to create proves in Isabelle.
回答1:
For posterity, quoting myself from an older answer:
Isabelle itself is implemented in Standard ML, but for communicating with the external world, it uses a protocol called PIDE (= Prover IDE). The reference implementation of PIDE is bundled with Isabelle and written in Scala, so it can be used with any JVM language. The primary application of PIDE is Isabelle/jEdit, which uses the jEdit editor to build an IDE for Isabelle, including markup, continuous checking, ...
By reusing the underlying protocol, you can implement your own application on top of Isabelle.
As far as I'm aware, the current most advanced example for this is Leon, which is an automated verification & synthesis toolkit for Scala programs. Internally, it uses libisabelle to communicate with Isabelle. (Full disclosure: I'm the author of libisabelle.) An overview of how this works is given in a paper.
libisabelle itself is available as a stand-alone library including some basic documentation that should allow you to get started. See the repository for more details. In essence, it allows you to
- manage Isabelle installations from within Scala (download, unpacking)
- abstract over different Isabelle versions (currently supported: 2016 and the 2016-1 release candidates)
- lifecycle management of an Isabelle session (building, starting, stopping)
- treat Isabelle/ML functions as Scala functions
- goodies like Isabelle term syntax in Scala (
term"$n > 0 --> ($b & ${HOLogic.True})"
)
There is no built-in routine to set up a goal state and apply some proof steps, but the necessary infrastructure is all there.
来源:https://stackoverflow.com/questions/40848265/isabelle-and-scala