Translate smtlib2 model to COQ - coq

All
I have a complicated model generated by tool in smtlib2 format. And I found it is hard to prove the SMT problem with SMT slover. So I want to translate this model to COQ and prove it in a different way.
Is there any COQ lib, plugin, tools can do this?
Thanks

Related

The foundations of Coq

I'm assuming Coq at some point moved to an LCF approach. In the past, I wondered about the foundations of the kernel in Isabelle. And I found some nice description of Isabelle/Pure in a master thesis summarizing somehow the existing literature.
I was wondering if there is a description of Coq's kernel covering the logical and implementation aspects of it.
I think your questions is similar to How does one implement Coq?.
At least I'm tempted to give a similar answer.
I think MetaCoq is the state-of-the-art effort to specify and (partially) verify the Coq kernel: https://github.com/MetaCoq/metacoq.
It is initially a library for meta-programming in Coq and as such implements a representation of the kernel inside Coq. It has evolved a lot and now contains the typing rules of (a subset of) Coq as well as formalisation of several meta-theoretical properties, a type-checker and an erasure mechanism.
Now understanding your question:
The Coq reference manual already offers some sort of specification of the Calculus of Inductive Constructions, which should always be up to date with the latest version of Coq.
The MetaCoq Project paper also attempts a specification of the predicative calculus of cumulative inductive constructions (PCUIC).
You seem to think that this somehow might have less value than a paper specification when done in the proof assistant itself, obviously I do not exactly think so (but I'm one of the authors, I'm biased). This is a fair concern, but at least as far as the specification is concerned, it only makes it much more precise than could be done on paper. The Coq reference manual can be imprecise at times. Our work also forces us to explicit invariants of representations that are not enforced in ocaml. Also we separate implementation and specification (the Coq reference manual is pretty implementation oriented). Arguably more works need to be done on this separation.
Otherwise, usually people treat subsets of these calculi, espcially regarding inductive types which are rather painful to lay out entirely.

Coq impact analysis

Let's say I have several proofs based on data structure (or lemma) A. Then, I refactored A to A', is there a general practice / tool facility for Coq to know all proofs are impacted by my refactoring?
Thank you for shedding some light on this matter.
edit1: thank you for all your suggestions, I will give them a try, and get back on this.
Another tool that might be useful is dpdgraph, which makes it possible to display all the usage dependence between various objects.
There is no such tool available, as far as I am aware. What I usually do is to refactor the code and try to repair it. Because of Coq's proofs and typing discipline, once the code compiles again, it is usually the case that it works.
You might want to take a look at PUMPKIN PATCH (GitHub repo). Here's a quote from the project readme file:
This is a prototype plugin for finding patches for broken Coq proofs. To use PUMPKIN, the programmer modifies a single proof script to provide an example adaptation of a proof to a change. PUMPKIN generalizes this example into a reusable patch which can be used to fix other broken proofs.
Not sure if this is exactly what you're looking for but it might be of interest.

Combinatory logic library for proof assistants?

I'm working through some intro-level combinatory logic exercises using Coq. I've written a crude library for it, but it isn't very efficient. Is there a combinatory logic library for Coq or other proof assistants? Definitions of combinators, terms & their relations along with proofs of some important theorems would be quite helpful.
There is a discussion about Agda and combinatory logic that looks interesting, but I can't tell whether it is relevant for my question.

first-class module in Coq

Could anyone give me more information about the first-class module in Coq? I know that module in Coq is not a first-class. I would like to know the reason why? and is it possible that in the future module in Coq can be first-class?
Thank you very much
I’m not certain, but as I understand it it comes from essentially two points:
Coq is conservative. Because some of its main applications are in verification, Coq mostly restricts itself to constructs whose semantics are reasonably well-understood.
In the dependent-types setting, first-class modules are rather subtle and not fully understood. In particular, how much of the computational/reduction behaviour of definitions do you want visible outside a module? If none at all, then this is already available, as record types. But if some or all of the reduction behaviour is visible, then it’s hard to quantify exactly how much is, so it’s quite hard to analyse the semantics of the resulting modules.
I’m not an expert on the relevant literature, so I may well be wrong about 2, but I’ve gotten the impression that this is the basic situation.

Controlling exportation of constructors in code extracted from Coq

I'm looking at writing code in Coq and extracting this code for use in a large Haskell project. I want to build a single module in Coq, prove properties, then use Haskell's module system to prevent violation of these properties (via smart constructors).
I can't find any indication that it's possible to extract Coq code into a Haskell module with an explicit export list. It seems I must hand-modify the extracted Coq code, which isn't a big deal but I want to know if I have this right. Does anyone have an alternate proposal?
I just looked at the latest coq source (r14456). There doesn't seem to be any code to generate an export list.
Seems you'll have to do this yourself.