How can I use Z3 SMT locally - z3

Any one have an idea how to use Z3 SMT locally instead of using the website?
I know how to use z3.py but I need to use SMT. rise4fun.com is down which makes it difficult to check my models.

Z3 binaries for various platforms are available for download on the Z3 Website.

Related

Are C API more problematic than standard inputs SMTLIB2 for z3?

I'm completely new to z3. I wonder what the difference is between the two inputs, Are C API more problematic than standard inputs SMTLIB2 for z3? I would appreciate it if you could answer_(:з」∠)_
I'm not sure what you mean by "problematic." You'd use the C-API if you want to integrate z3 into a C/C++ based framework. You'd use SMTLib if you want a common language understood by many solvers, not just z3. So, it really depends on what your goals are.
If you're just experimenting with it, I'd advise using an interface in a higher level language like Python, as it is much easier to get started. SMTLib is generally not intended for human consumption, but rather generated by other programs. Only use the C/C++ API if you have some other requirement that requires you to stay in C/C++.
Long story short, it really depends on what your goal is; if you tell us more about what your use case is, we can recommend something more specific.

issuing multiple (check-sat) calls until it returns unsat

The release notes for z3 version 4.6 mention a new feature "issuing multiple (check-sat) calls until it returns unsat".
Is this an equivalent for ALLSAT?
Where can I find any further documentation or an example for this feature?
No, this was for addressing this issue: https://github.com/Z3Prover/z3/issues/1008
An ALLSAT command is not supported by z3; though it would be easy to code it using the "assert the negation of the previous model and re-check" loop. Most high-level interfaces provide this as a layer on top of what's possible using SMT-Lib2. If you do want support for this, it might be best to first convince the SMTLib folks (http://smtlib.cs.uiowa.edu/) so a standard way of doing so would be developed and can be implemented by multiple solvers.

anonymous functions

I have found the support for anonymous functions (lambda expressions) in Yices to be extremely helpful. I am now trying to use Z3 to implement a tool, but I have not been able to figure out if this feature is supported. I am invoking the tool using the -smt2 flag. thanks for your help.
AFAIK, lambda expressions are neither supported by Z3 (see this answer by Nikolaj Bjorner, one of the main Z3 developers), nor are they part of the SMTLib2 standard. Solvers that support lambda expressions, for example, Yices or veriT, support them as a custom extension to the SMTLib2 standard.
Depending on your needs (which you might want to illustrate by adding an example to your questions) you could try Z3 macros (define-fun), or a front-end like Z3Py that, compared with writing SMTLib code manually, simplifies working with Z3 a lot.

Custom simplifiers

Back in the old days (ie. last year), we used to be able to use theory plugins as a hack to implement custom simplifiers. The Z3 doc even contained an example of "procedural attachments".
My question is very simple; is there any way to achieve the same goal with Z3 4.x?
In particular, I'm interested in a way to provide Z3 with externally computed evaluations for ground terms.
The theory plugins are currently marked as deprecated in Z3 4.x. So, although they can still be used to implement custom simplifier, the user would be forced to use deprecated APIs.
In Z3 4.x, custom simplifiers should be implemented as Tactics. The new build system makes it fairly easy to extend the set of available tactics.
I will try to write a tutorial on how to write tactics inside the Z3 code base.
Of course, in this approach, we have to write C++ code. The main advantage is that the tactic will be available in all front-ends (C, C++, .Net, Java, Python, OCaml, SMT2). Moreover, external developers can contribute their tactics to the Z3 codebase and they will be available for all Z3 users.
We also plan to support an API for creating a simplifier tactic based on callbacks provided by the user. This API would allow users to write "custom simplifiers" in their favorite programming language. This new API is conceptually simple, but there is a lot of "hacking" needed to make it available in every front-end (C++, .Net, Java, Python, OCaml) . It would be great if some external developer is interested in implementing and maintaining this feature. I'm sure it would benefit many users.

Detailed documentation of Z3 INI options

Is there any detailed documentation of the INI options of Z3. I had to do a trial and error approach to figure out the best options for my QF_BV problems. I am still not sure if there are more options that would make my z3-run faster. It would be great if someone can point to any existing detailed explanation of the INI options.
Thanks.
We are currently restructuring Z3, and moving away from the approach: a solver with “thousand” parameters.
We are moving Z3 into a more modular and flexible approach for combining solvers and specifying strategies.
You can find more information about this new approach in the following draft.
Regarding INI options, several of them are deprecated, and only exist because we didn’t finish the transition to the new approach yet.
Several of these options were added for particular projects, and are obsolete now. They only exist for backward compatibility.
Regarding QF_BV, Z3 3.2 contains two QF_BV solvers: old (the one from 2.x) and new. The new (official) one is only available in the Z3 official input format: SMT 2.0.
SMT 1.0, Simplify and Z3 low level input formats are obsolete. Most of the performance improvements in Z3 3.x are only available when one uses SMT 2.0 input format.
In a couple of months, the strategy specification language will be officially supported in Z3.
We will have a tutorial and documentation describing how to use it.
In the meantime, I strongly recommend that you use the default configuration and the SMT 2.0 input format for logics such as QF_BV.

Resources