-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate CVC4 #23
Comments
I should add that below errors preceed the above errors (I missed these earlier as I was using make -j2) /home/anitha/kleestr/metasmt/build/root/include/metaSMT/backend/CVC4.hpp:229:51: error: template argument 1 is invalid |
Hi @anithag, The error in your first post could be cause by the error in the second.
This might be unrelated: Are you using the current git version of Klee? I could not find "Executor.cpp". I found metaSMT related code in https://github.com/klee/klee/blob/master/lib/Solver/Solver.cpp. |
I haven't used gist before. But assuming we create public gists and then share the link(Is this the way to work with gists?), this is the link containing my patch and make logs. |
Yes. Executor.cpp is present under lib/Core |
I am not sure I understand this completely. From the error messages, it appears that compiler is complaining about both arguments (template argument 1 and template argument 2 are invalid). Let me know if you want me to further ivestigate this issue. I'll be happy to report.
2 new errors got generated. Pasted below. (markdown would not display <> without escapes :( ) In file included from Solver.cpp:55:0: |
Ah, I had not seen from your last comment, I suspect a name clash (or Macros). If there is a name clash, you can try fixing it by fully qualifying all the CVC4 opcodes (insert - mpl::pair<predtags::and_tag, Op2<AND> >
+ mpl::pair<predtags::and_tag, Op2<::CVC4::kind::AND> > If this still fails, it would be interesting to look at the preprocessed source code to check if the AND was replaced by something different. I ran git grep AND|OR|XOR on the klee source code and did not find anything, so I hope this does not apply. |
Looks true! I could move one step ahead. Will make other changes and see if build goes through. In file included from Solver.cpp:55:0: |
The build proceeded past the template issues in CVC4.hpp; however I still have this error from Solver.cpp in klee code. Can you suggest what might be causing this? The header files are included properly. "CVC4" class gets recognized, but the compiler still complains of invalid argument. I tried reducing the testcase...could not reproduce the error in reduced testcase. Updated the gist with new make log. Solver.cpp:1268:58: error: template argument 1 is invalid |
ok. I now could successfully build klee with cvc4 using scope as below.
To sanity test working of cvc4, I used the well-known example from klee/examples. And klee dies :-( $klee --use-metasmt=cvc4 get_sign.o Full Error Log: |
I patched our dependency version of CVC4 last week. Can you please check you used the patched version of CVC4? |
I pulled the changes now. And am rebuilding metasmt.
It might be worth mentioning that I build only CVC4 and Z3. So I am not sure if the patched version helps. My bootstrap looks like this: https://github.com/anithag/kleestr/blob/metasmt/metasmt/bootstrap.sh (The "metasmt" branch is my working branch. It includes CVC4 changes discussed above + Klee modified to use CVC4) |
I think it is still required, because Klee uses its own version of STP with Minisat. See https://github.com/anithag/kleestr/blob/master/stp-r940/src/sat/core/Solver.h Node your might want to also pull the new version Z3 (zZ3-git, MIT license). |
Ok. Shall update once build completes. Earlier, there was a link issue in klee w.r.t undefined reference to __gmp_init_set_si. So i just updated the klee makefile in tools/klee/makefile to use lgmp. I am wondering if cvc4 has been used at all in metasmt. Or is this runtime issue specific to my build? I really want to get it running. |
CVC4 is the latest addition in metaSMT. I added it 2 month ago and it had the Minisat problem all the time. |
While building metasmt, I get this error for downloading Z3. What should I do? calling download for Z3-git Please make sure you have the correct access rights TERMINATING cvc4-1.4
-- Configuring done If I ignore this and proceed to make in "build" directory, I get this error [ 23%] Built target metaSMT |
I copy&pasted the wrong github url for Z3. I fixed it 2 weeks ago. Please make sure your have this commit in your checkout: agra-uni-bremen/dependencies@5e66da6 For the missing gmp when building CVC4 tests I created #24. |
Got everything rebuilt with updated metaSMT. (I faced another build issue in * klee* complaining about undefined reference to __gmpz_init_set_si. Changed the makefiles to include lgmp, but otherwise everything else went fine) However CVC4 still dumps core when invoked with "klee --use-metasmt=cvc4 get_sign.o". Any idea on how to proceed forward? (Maybe some option to klee?) |
sorry, but if direct_CVC4 works (modulo timeouts), I can not help you there. I do not know the klee internals. |
Can you elaborate what direct_CVC4 working means? How do I check that? From my log, it appears that the very first step of invoking CVC4 seemed to fail. I am wondering what the assertion failure means. I'll try to debug the issue. CVC4.hpp:200: metaSMT::solver::CVC4::result_type metaSMT::solver::CVC4::operator()(TagT, boost::any) [with TagT = metaSMT::logic::Array::tag::array_var_tag; metaSMT::solver::CVC4::result_type = CVC4::Expr]: Assertion `false' failed. |
For me only 2 direct_CVC4 tests timeout and I see no other failures:
The assertion you reported is Helpful again. Klee is trying to build an array formula, as can be seen from the assertion (from
The Problem is that I did not implement Array support in CVC4. For the same reason that we do not support Array with STP (see #4). Our test cases assume the solver supports equality of array variables, but this is not required by the SMT standard and not supported by CVC4 and STP. |
I created #25 to keep track of the missing Array support. |
I see. Z3 works just fine with the same example. So I assumed CVC4 might also work. The limitation is probably large for me :( I can work on this if required. Can you briefly outline me the changes necessary? I am also pretty new to these SMT theories. EDIT: Will the changes to array theory be similar to #4 but in CVC4.hpp ? (I want to try basic string theory with metaSMT. So I am looking for a backend that already has string theory support so that I can modify metaSMT to support for strings (basic). I have a strict deadline in another 2 weeks. Apart from CVC4 and Z3, I don't think any other backend has string theory support that I can start using) Here are direct_CVC4 results for me. 3 tests timeout. 97% tests passed, 3 tests failed out of 95 Total Test time (real) = 7.61 sec The following tests FAILED: |
@finnhaedicke Thanks for the prompt responses. :-) |
Let me paraphrase in one-line if I got the issue right: Official CVC4 supports theory of arrays but the CVC4 backend in metaSMT does not. |
Array support is just implementing 3 On your plan for strings. I can just repeat, what I wrote 3 weeks ago (repeated here without some typos)]:
Overall I still think this is quite a lot of work for a theory/logic that is not yet standardized. As you have to extract the common interface of Z3-str and CVC4. |
I wish there is a mailing list or some sort to discuss this. Would you mind helping me generate Array Expression in CVC4? As I understand to create array variable, I would probably need to generate an expression. I am using mkVar(). My patch currently looks like below. Barring syntax errors, is this doing what it is supposed to do? It gets compiled. (I might get better eventually at figuring out stuff). @@ -90,6 +91,23 @@ namespace metaSMT { + result_type operator() (arraytags::array_var_tag const &var,
|
Ah, just got through the testing and it works. Let me know if I can submit the patch for #25 for review. |
Feel free to fork metaSMT, commit your patch to a branch and submit a pull request. |
I have built metasmt with CVC4 and Z3 (only). The build suceeded. Now I am trying to build klee with this metaSMT. I have made few changes to make sure CVC4 backend is accepted. I get build error. Relevant change and error is shown below:
@@ -314,6 +315,10 @@ Executor::Executor(const InterpreterOptions &opts,
backend = "Z3";
coreSolver = new MetaSMTSolver< DirectSolver_Context < Z3_Backend > > (UseForkedCoreSolver, CoreSolverOptimizeDivides);
break;
This is giving me following compilation error. Any idea why? Note that METASMT_BACKEND_CVC4 is recognised and I have included CVC4.hpp in Executor.cpp. CVC4 is getting recognized but still is giving template 1 is invalid. Most of the code follows Z3_Backend.
Executor.cpp: In constructor ‘klee::Executor::Executor(const klee::Interpreter::InterpreterOptions&, klee::InterpreterHandler*)’:
Executor.cpp:320:75: error: template argument 1 is invalid
coreSolver = new MetaSMTSolver< DirectSolver_Context < CVC4 > >(UseForkedCoreSolver, CoreSolverOptimizeDivides);
^
Executor.cpp:320:77: error: template argument 1 is invalid
coreSolver = new MetaSMTSolver< DirectSolver_Context < CVC4 > >(UseForkedCoreSolver, CoreSolverOptimizeDivides);
The text was updated successfully, but these errors were encountered: