-
Notifications
You must be signed in to change notification settings - Fork 8
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
Some test cases failed, and which z3 version should I use? #2
Comments
Hi Siyuan, Thanks for your interest and kind words. I can't reproduce the issue with Some of the tests might not have been updated with the latest version of Z3. You can also get a much faster experience if you use a branch of faster-miniKanren. For example: https://github.com/namin/faster-miniKanren/blob/smt-assumptions/smt-tests.scm At some point, we had a version compatible with Racket. It shouldn't be too hard to revive it and have a common base for both the Scheme and Racket version as is the case in faster-miniKanren. I am curious to hear more about how you plan to use clpsmt-miniKanren. |
It's very strange. You can reproduce this issue as following: You can see that z3-4.8.7 has a However, z3-4.8.12 lacks this |
I tried z3-server.rkt in Racket. It complained:
at the I can workaround this issue by replacing Racket version v8.0 [bc]. |
Mainly to learn how logic programming combines with SMT solver. I am self-learning Constraint Logic Programming and Satisfiability Modulo Theories. In Constraint Logic Programming, it is a bit tricky to implement an common efficient domain-specific constraint, e.g. CLP(FD), CLP(Z), CLP(R), CLP(Set), etc. But if we can use an SMT solver as backend, they will be out of the box. It seems that CLP and SMT are very similar, even though they use different theoretical frameworks (Consider CLP(X) vs DPLL(T)). Another reason is that I'd like to collect some applications for miniKanren variants (especially about program synthesis). miniKanren has a lot of variants. Different variants have different features and restrictions. (Unfortunately, there is no all-in-one package.) clpsmt-miniKanren is one of such variants. For example, we can use miniKanren to do symbolic execution, but standard miniKanren with symbolic constraints does not support Integer arithmetic. By clpsmt-miniKanren, we can get CLP(Z) out of the box. That is why I said it is great! (Oleg numeral can be extended to negative, but it is another story). PS. I am also learning rosette. Comparing rosette and miniKanren for program synthesis is an interesting experience as well. |
OK, I guess the code will ignore the first constraint in the model. |
Sorry, the codebase is a bit rotted. We'll try to find some time to clean it up and bring it up to date. If you'd like to help, that would be great. |
Hi Nada, There is test case that I am not sure whether the current clpsmt-miniKanren's behavior correct:
The computed value is Does this mean that there is a bug in the current clpsmt-miniKanren? (BTW, I think the 3rd possible candidate result is I don't know which one should be the correct behavior when we combine with SMT solver? Thanks. |
Thanks, this is strange. You can enable logging here: https://github.com/namin/clpsmt-miniKanren/blob/master/z3-server.scm#L4 to see what's going on. If you can debug this, that would be great. If not, I'll take a look next month when I'll have more time. |
It would be nice, if you can write a paper explains how clpsmt-miniKanren be implemented, e.g. how BTW, You have searched the internet for "SMT and constraint logic programming". There are very few resources about how SMT and CLP connect. It seems that clpsmt-miniKanren is the first opensource project done this idea (bring SMT to CLP). That's a really cool stuff. |
I just added you to an old repo with work in progress about the project and its implementation. Eventually, we could turn this into a paper. |
Hi, Nada, I'm sorry... I don't quite understand the meaning of this sentence. What do you mean by "old repo" ? Could you explain further? Thanks. |
You should have gotten access to the |
Thank you. But is the I can't find this repo. Is there a link for it? |
I just emailed you the repo URL. |
Some behaviors of z3-4.8.7 and z3-4.8.12 are slightly different. 1. The format of the model returned by z3-4.8.7 and z3-4.8.12 is different. See namin/clpsmt-miniKanren#2 (comment) 2. Filter out functions in z3-4.8.12. We currently don't support functions, so we shouldn't get a model which includes functions: For z3-4.8.7, that's right, but for z3-4.8.12, it may still return functions, even if we don't use functions (see Z3Prover/z3#5553). Therefore, I raise an error in z3-4.8.7, but filter out them in z3-4.8.12.
Hi,
I am trying to use clpsmt-miniKanren for constraint logic programming, it's great work!
But I am not sure which z3 version should I use?
I initially used z3-4.8.12, but failed. The reason is that clpsmt-miniKanren assumes the result model s-exp has a
model
in the top, but z3-4.8.12 has no thismodel
.So I switched to an older version.
I currently use z3-4.8.7, it can pass many test cases, but some of them still failed.
It seems that there are two kinds of failure:
z3 version relevant
clpsmt-basic-tests.scm - Testing "5"
clpsmt-tests.scm - Testing "evalo-many-0"
clpsmt-tests.scm - Testing "many-1"
clpsmt-tests.scm - Testing "many-2"
clpsmt-tests.scm - all other
read-sat: unknown
cases.z3 version irrelevant
clpsmt-basic-tests.scm - Testing "declare-idempotent"
Could you tell me which z3 version should I use?
Thanks.
My environment:
Windows 7,
Chez Scheme Version 9.5,
z3-4.8.7,
clpsmt-miniKanren-master (4fa74fb)
PS. I used
z3-server.scm
instead ofz3-driver.scm
, becasuez3-driver.scm
doesn't work in windows 7. Is there way to workaround? BTW, does clpsmt-miniKanren support Racket? I saw the source code mixed.scm
and.rkt
, but all the test cases use.scm
andload
. So I don't know whether clpsmt-miniKanren is currently compatible with Racket.The text was updated successfully, but these errors were encountered: