How to call proof asistant Coq from external software

后端 未结 2 1636
走了就别回头了
走了就别回头了 2020-12-30 11:02

How to call proof assistant Coq from external software? Does Coq have some API? Is Coq command line interface rich enough to pass arguments in file and receive response in f

2条回答
  •  春和景丽
    2020-12-30 11:10

    As of today, there are three ways to interact with Coq, ordered from more effort to less power:

    1. The OCaml API: This is what Coq plugins do, however, some parts of the OCaml API are notoriously difficult to master and a high expertise is usually needed. The API also changes from one release to another making maintenance hard. There is not official documentation for the OCaml API other than looking at the source code, but quite a few tutorials with different degrees of maintenance are floating around.

    2. The XML protocol: This is what IDEs use. It allows the client to perform basic Coq document operations such as checking a part of it, limited search, retrieving goals, etc... official documentation

    3. The command line: As the other answer details, this basically allows to check whether a file can be fully compiled by Coq.

    Alternatively, there is an experimental protocol called "SerAPI" [disclaimer I am the author] that lies between 1 and 2. SerAPI is an extension of the XML protocol (but using SEXPs) that tries to provide some advantages of 1 along with richer query operations, without the disadvantages of linking with OCaml.

    SerAPI is at a very experimental stage these days, however it may prove useful for some users. webpage

    Some additional links:

    • https://andy-morris.xyz/blog/20161001-coq-protocol.html
    • https://github.com/mattam82/Constructors
    • http://gallium.inria.fr/blog/your-first-coq-plugin/
    • https://github.com/uwplse/CoqAST

提交回复
热议问题