gmalecha / coq-smt-check

Invoke SMT solvers from Coq to check obligations
MIT License
10 stars 3 forks source link

Polya #1

Open spitters opened 8 years ago

spitters commented 8 years ago

Since you can export real number expressions from Coq, maybe it is possible to call Polya, too? @avigad or @rlewis1988 will know more about this.

gmalecha commented 8 years ago

We'd love to do this. What is the input format for these tools? Right now we are generating SMT 2 format, if those follow that format, then porting should be pretty easy.

spitters commented 8 years ago

This is the conversion tool. https://github.com/rlewis1988/smtlib2polya

gmalecha commented 8 years ago

Great. I'll take a look at it.

robertylewis commented 8 years ago

Yes, this would be a great connection to make!

We can take SMT2 input, using the tool @spitters points out. We don't support all features of the format, and I suspect the conversion isn't entirely bug-free, but I'd be happy to take a look at anything that seems suspicious. I haven't worked on the conversion tool recently, but there are a bunch of additions on my to-do list that I'm hoping to get to over the next few weeks.

gmalecha commented 8 years ago

I refactored the implementation a bit in the split-solvers branch. This should make it pretty easy to write a new prover and plug it into the system. I took a brief look at the installation instructions but it seems a bit complex to install right now. Is it reasonable to have a program that acts in a similar way to the cvc4 or z3 executables where I can simply write a problem out and get a result? In particular the src/z3solve.ml file contains the code to invoke z3.

robertylewis commented 8 years ago

Yes, you can generate an executable similar to the one for z3. In the main directory of https://github.com/rlewis1988/smtlib2polya, there's an executable polya generated on Kubuntu -- I'm not sure how cross-platform it is, though. To generate your own:

Run this by giving it a .smt2 file: ./polya file_name.smt2 I don't think that you need to keep the polya directory in your python path for the executable to work. The output is 1 if unsat, -1 if Polya fails, and 0 if there is an error. (Polya is not a decision procedure, so you should interpret -1 as "possibly sat." 0 could mean a timeout, a feature of the SMT spec we don't support, or a bug in my code.)

If you'd prefer to call python directly, python single_translate.py file_name.smt2 will have the same output as the executable. You may need to be careful with the python path, though, or put the Polya directory in the smtlib2polya directory. (The two are released separately for licensing reasons, sorry for the complication.)